{"version":3,"file":"script.min.js","sources":["../../../../block-editor/blocks/cards-cta/script.js"],"sourcesContent":["const CardsCta = function( node ) {\n\tif ( ! node instanceof HTMLElement ) {\n\t\treturn;\n\t}\n\n\tconst items = node.querySelector( '.cards-cta__items' );\n\n\tif ( ! items ) {\n\t\treturn;\n\t}\n\n\tconst kards = items.querySelectorAll('.kard');\n\tconst nav = document.createElement('nav');\n\tnav.className = 'cards-cta__nav';\n\tnode.appendChild(nav);\n\n\tconst offscreenClass = 'cards-cta__offscreen';\n\n\tconst onMove = () => {\n\t\tlet hasOffscreenRight = false;\n\t\tconst nextButton = node.querySelector('.flickity-prev-next-button.next');\n\n\t\tkards.forEach( kard => {\n\t\t\tconst rect = kard.getBoundingClientRect();\n\n\t\t\tif ( rect.right > document.body.offsetWidth ) {\n\t\t\t\thasOffscreenRight = true;\n\t\t\t}\n\n\t\t\tif ( rect.left < 0 || rect.right > document.body.offsetWidth ) {\n\t\t\t\tkard.classList.add( offscreenClass );\n\t\t\t} else {\n\t\t\t\tkard.classList.remove( offscreenClass );\n\t\t\t}\n\t\t} );\n\n\t\tif ( nextButton ) {\n\t\t\tnextButton.disabled = ! hasOffscreenRight;\n\t\t}\n\t}\n\n\tconst flickity = new window.Flickity( items, {\n\t\tcellAlign: 'left',\n\t\tpageDots: false,\n\t\timagesLoaded: true,\n\t\tarrowShape: 'M100,55.5H22.1l33.8,31.4L48.4,95L0,50L48.4,5l7.5,8.1L22.1,44.5H100V55.5z',\n\t\ton: {\n\t\t\tready: () => {\n\t\t\t\tArray.from( node.querySelectorAll( '.flickity-button' ) ).forEach( button => nav.appendChild( button ) );\n\t\t\t\tonMove();\n\t\t\t},\n\t\t\tpointerMove: onMove,\n\t\t\tscroll: onMove,\n\t\t}\n\t} );\n\n\treturn flickity;\n}\n\nCardsCta.instances = Array.from( document.querySelectorAll( '.cards-cta' ) ).map( node => CardsCta( node ) );\n\nexport default CardsCta;\n"],"names":["CardsCta","node","HTMLElement","const","items","querySelector","kards","querySelectorAll","nav","document","createElement","className","appendChild","offscreenClass","onMove","let","hasOffscreenRight","nextButton","forEach","kard","rect","getBoundingClientRect","right","body","offsetWidth","left","classList","add","remove","disabled","window","Flickity","cellAlign","pageDots","imagesLoaded","arrowShape","on","ready","Array","from","button","pointerMove","scroll","instances","map"],"mappings":"wKAAK,IAACA,EAAW,SAAUC,GAC1B,MAAOA,aAAgBC,aAAvB,CAIAC,IAAMC,EAAQH,EAAKI,cAAe,qBAElC,GAAOD,EAAP,CAIAD,IAAMG,EAAQF,EAAMG,iBAAiB,SAC/BC,EAAMC,SAASC,cAAc,OACnCF,EAAIG,UAAY,iBAChBV,EAAKW,YAAYJ,GAEjBL,IAAMU,EAAiB,uBAEjBC,EAAM,WACXC,IAAIC,GAAoB,EAClBC,EAAahB,EAAKI,cAAc,mCAEtCC,EAAMY,SAAO,SAAEC,GACdhB,IAAMiB,EAAOD,EAAKE,wBAEbD,EAAKE,MAAQb,SAASc,KAAKC,cAC/BR,GAAoB,GAGhBI,EAAKK,KAAO,GAAKL,EAAKE,MAAQb,SAASc,KAAKC,YAChDL,EAAKO,UAAUC,IAAKd,GAEpBM,EAAKO,UAAUE,OAAQf,EAE3B,IAEOI,IACJA,EAAWY,UAAab,EAEzB,EAiBD,OAfiB,IAAIc,OAAOC,SAAU3B,EAAO,CAC5C4B,UAAW,OACXC,UAAU,EACVC,cAAc,EACdC,WAAY,2EACZC,GAAI,CACHC,iBACCC,MAAMC,KAAMtC,EAAKM,iBAAkB,qBAAuBW,SAAO,SAAEsB,GAAM,OAAIhC,EAAII,YAAa4B,EAAQ,IACtG1B,GACA,EACD2B,YAAa3B,EACb4B,OAAQ5B,IA3CT,CANA,CAsDF,SAEAd,EAAS2C,UAAYL,MAAMC,KAAM9B,SAASF,iBAAkB,eAAiBqC,KAAG,SAAE3C,GAAI,OAAID,EAAUC,EAAM"}