1/* eslint-disable */ 2import{FranklinBlock,decorateCarouselScroller}from"../../scripts/lib-franklin.js";export default class Carousel extends FranklinBlock{beforeBlockDataRead(){this.findSectionContent("title").className="carousel-before-render--title"}beforeBlockRender(){this.inputData.cards=this.getCards(),this.inputData.disclaimers=this.getDisclaimers()}afterBlockRender(){let e;decorateCarouselScroller(this.block.querySelector(".core-carousel-scroller")),setTimeout(()=>this.equalizeCardContentHeights(),600),window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>this.equalizeCardContentHeights(),300)})}equalizeCardContentHeights(){const e=this.block.querySelectorAll(".core-carousel-card");if(!e.length)return;e.forEach(e=>{const t=e.querySelectorAll("h1, h2, h3, h4"),r=e.querySelectorAll("p");t.forEach(e=>{e.style.minHeight=""}),r.forEach(e=>{e.style.minHeight=""})});let t=0;e.forEach(e=>{const r=e.querySelector("h1, h2, h3, h4");r&&(t=Math.max(t,r.offsetHeight))});let r=0;e.forEach(e=>{const t=e.querySelector("p");t&&(r=Math.max(r,t.offsetHeight))}),t>0&&e.forEach(e=>{const r=e.querySelector("h1, h2, h3, h4");r&&(r.style.minHeight=`${t}px`)}),r>0&&e.forEach(e=>{const t=e.querySelector("p");t&&(t.style.minHeight=`${r}px`)})}getCards(){return Array.from(this.block.children).filter(e=>e.querySelector("div:first-child p, div:first-child").textContent.toLowerCase().startsWith("card")).map(e=>e.querySelector("div:last-child").innerHTML)}getDisclaimers(){return Array.from(this.block.children).filter(e=>e.querySelector("div:first-child p, div:first-child").textContent.toLowerCase().startsWith("disclaimer")).map(e=>e.querySelector("div:last-child").textContent)}}export const schema='{\n "carousel": {\n "name": "carousel",\n "type": "carousel",\n "description": "A dynamic content carousel component that allows users to browse through a sequence of content items with navigation controls. Supports auto-rotation capabilities and responsive design to effectively showcase multiple items in a space-efficient manner.",\n "coreBlockData": {\n "notApplicable": true\n },\n "schema": {\n "title": {\n "selector": ".carousel-before-render--title",\n "target": "textContent",\n "description": "The heading or title displayed above the carousel that describes the collection of items being presented to the user.",\n "optional": true\n }\n }\n }\n}\n';export const template=' <div class="core-carousel-inside block-inside">\n <h2 class="core-carousel-title">{{ title }}</h2>\n\n <div class="core-carousel-scroller">\n {{ #cards }}\n <div class="core-carousel-card atoms-content">\n {{ . }}\n </div>\n {{ /cards }}\n </div>\n\n <div class="core-carousel-disclaimer-container">\n {{ #disclaimers }}\n <div class="core-carousel-disclaimer atoms-disclaimer">\n {{ . }}\n </div>\n {{ /disclaimers }}\n </div>\n</div>\n';export const smartCaptureConfig=" {}";
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.