{"version":3,"file":"customSwiperDOM.CmFSkr9J.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/oxqTy1bFHR0x3KzWEJSm/lXwg7IhRLe02Z9Z4047L/customSwiperDOM.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function CustomSwiperDOM({images,loop,autoplay,autoplayDelay,speed,mousewheel}){const containerRef=useRef(null);const swiperInstanceRef=useRef(null);useEffect(()=>{if(!containerRef.current)return;const loadSwiperAssets=async()=>{return new Promise(resolve=>{const link=document.createElement(\"link\");link.rel=\"stylesheet\";link.href=\"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css\";document.head.appendChild(link);const script=document.createElement(\"script\");script.src=\"https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js\";script.onload=()=>resolve();document.body.appendChild(script);});};const setupSwiper=()=>{const swiperEl=containerRef.current.querySelector(\".swiper\");if(!swiperEl)return;if(swiperEl.swiper){swiperEl.swiper.destroy(true,true);}const wrapper=swiperEl.querySelector(\".swiper-wrapper\");if(wrapper)wrapper.innerHTML=\"\";images.forEach(src=>{const slide=document.createElement(\"div\");slide.className=\"swiper-slide\";const img=document.createElement(\"img\");img.src=src;img.style.width=\"100%\";img.style.height=\"100%\";img.style.objectFit=\"cover\";slide.appendChild(img);wrapper.appendChild(slide);});swiperInstanceRef.current=new window.Swiper(swiperEl,{effect:\"fade\",loop:loop,grabCursor:true,pagination:{el:\".swiper-pagination\",clickable:true},autoplay:autoplay?{delay:autoplayDelay,disableOnInteraction:false}:false,speed:speed,mousewheel:mousewheel?{forceToAxis:true}:false});};const init=async()=>{await loadSwiperAssets();setTimeout(setupSwiper,300);};init();},[images,loop,autoplay,autoplayDelay,speed,mousewheel]);useEffect(()=>{const autoplayButton=containerRef.current?.querySelector(\".swiper-autoplay-toggle\");if(autoplayButton){const handleClick=()=>{if(!swiperInstanceRef.current)return;if(autoplayButton.classList.contains(\"playing\")){swiperInstanceRef.current.autoplay.stop();console.log(\"Paused autoplay\");}else{swiperInstanceRef.current.autoplay.start();console.log(\"Resumed autoplay\");}autoplayButton.classList.toggle(\"playing\");};autoplayButton.addEventListener(\"click\",handleClick);return()=>{autoplayButton.removeEventListener(\"click\",handleClick);};}},[images]);return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsxs(\"div\",{className:\"swiper\",style:{width:\"100%\",height:\"100%\"},children:[/*#__PURE__*/_jsx(\"div\",{className:\"swiper-wrapper\"}),/*#__PURE__*/_jsxs(\"div\",{className:\"paginationArea\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"swiper-pagination\"}),/*#__PURE__*/_jsxs(\"div\",{className:\"swiper-autoplay-toggle playing\",children:[/*#__PURE__*/_jsx(\"div\",{className:\"page1\",children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 256 256\",width:\"15\",fill:\"white\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z\"})})}),/*#__PURE__*/_jsx(\"div\",{className:\"page2\",children:/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 256 256\",width:\"15\",fill:\"white\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z\"})})})]})]})]}),/*#__PURE__*/_jsx(\"style\",{children:`\n                .swiper { width: 100%; height: 100%; }\n                .swiper-wrapper { display: flex; transition-property: transform; transition-timing-function: ease; }\n                .swiper-slide { flex-shrink: 0; width: 100%; height: 100%; background: #000; }\n                .swiper-fade .swiper-slide { transition-property: opacity; }\n                .swiper-fade .swiper-slide-active { opacity: 1; }\n                .swiper-fade .swiper-slide-next,\n                .swiper-fade .swiper-slide-prev,\n                .swiper-fade .swiper-slide-duplicate-next,\n                .swiper-fade .swiper-slide-duplicate-prev { opacity: 0; }\n\n                .paginationArea {\n                    display: flex;\n                    justify-content: center;\n                    align-items: center;\n                    gap: 3px;\n                    position: absolute;\n                    bottom: 24px;\n                    width: 100%;\n                    z-index: 10;\n                }\n                .swiper-pagination {\n                    display: flex;\n                    justify-content: center;\n                    gap: 3px;\n                    width: auto !important;\n                    height: auto !important;\n                    position: static;\n                    top: unset !important;\n                    bottom: unset !important;\n                }\n                .swiper-pagination-bullet {\n                    width: 12px;\n                    height: 12px;\n                    background: none;\n                    border: 1px solid white;\n                    opacity: 1;\n                    border-radius: 0;\n                }\n                .swiper-pagination-bullet-active {\n                    background: white;\n                }\n                .swiper-autoplay-toggle {\n                    display: flex;\n                    width: 12px;\n                    height: 12px;\n                    background: none;\n                    justify-content: center;\n                    align-items: center;\n                    cursor: pointer;\n                    margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);\n                }\n                .swiper-autoplay-toggle :is(.page1, .page2) { place-items: center; }\n                .swiper-autoplay-toggle:not(.playing) .page1 { display: grid; }\n                .swiper-autoplay-toggle:not(.playing) .page2 { display: none; }\n                .swiper-autoplay-toggle.playing .page1 { display: none; }\n                .swiper-autoplay-toggle.playing .page2 { display: grid; }\n            `})]});}addPropertyControls(CustomSwiperDOM,{images:{title:\"Images\",type:ControlType.Array,propertyControl:{type:ControlType.Image}},loop:{title:\"Loop\",type:ControlType.Boolean,defaultValue:true},autoplay:{title:\"Autoplay\",type:ControlType.Boolean,defaultValue:true},autoplayDelay:{title:\"Autoplay Delay\",type:ControlType.Number,defaultValue:4500,min:1e3,max:1e4,step:100},speed:{title:\"Speed\",type:ControlType.Number,defaultValue:500,min:100,max:5e3,step:100},mousewheel:{title:\"Mousewheel\",type:ControlType.Boolean,defaultValue:false}});CustomSwiperDOM.defaultProps={images:[\"https://framerusercontent.com/images/ThCX1oPWUu9jV1kv348KPhbTtEg.jpg\",\"https://framerusercontent.com/images/UKC3rZayWBOsUEnoWIzrmZ44WY.jpg\",\"https://framerusercontent.com/images/HRwqdPuBnnUYeqTIN5Zmg8mcC6g.jpg\"],loop:true,autoplay:true,autoplayDelay:4500,speed:500,mousewheel:false};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomSwiperDOM\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./customSwiperDOM.map"],"mappings":"yTAAiJ,SAAwB,EAAgB,CAAC,SAAO,OAAK,WAAS,gBAAc,QAAM,cAAY,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAO,EAAkBA,EAAO,KAAK,CAAm7D,OAAl7D,MAAc,CAAC,GAAG,CAAC,EAAa,QAAQ,OAAO,IAAM,EAAiB,SAAiB,IAAI,QAAQ,GAAS,CAAC,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,IAAI,aAAa,EAAK,KAAK,+DAA+D,SAAS,KAAK,YAAY,EAAK,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAC,EAAO,IAAI,8DAA8D,EAAO,WAAW,GAAS,CAAC,SAAS,KAAK,YAAY,EAAO,EAAG,CAAS,MAAgB,CAAC,IAAM,EAAS,EAAa,QAAQ,cAAc,UAAU,CAAC,GAAG,CAAC,EAAS,OAAU,EAAS,QAAQ,EAAS,OAAO,QAAQ,GAAK,GAAK,CAAE,IAAM,EAAQ,EAAS,cAAc,kBAAkB,CAAI,IAAQ,EAAQ,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