{"version":3,"file":"CollectionSlideshow.ReVF1dZO.mjs","names":["React","_Fragment","__esmMin","window","init_ssg_sandbox_shims","init_npm_react_18_3_1","init_jsx_runtime","c","p","e","addPropertyControls","init_framer_B1b760uK","ControlType","CollectionSlideshow","containerRef","autoPlayRef","canScrollLeft","setCanScrollLeft","canScrollRight","setCanScrollRight","scrollToNext","container","scrollWidth","clientWidth","currentScroll","scrollAmount","scrollDistance","firstChild","newScroll","updateScrollState","scrollToPrevious","autoPlay","autoPlayInterval","handleKeyDown","event","collection","showArrows","l","arrowColor","init_CollectionSlideshow","props"],"sources":["https:/framerusercontent.com/modules/xOqAG4IvZ0rkSHvA1bRm/fVrfgQw7xoBVpDfATcDs/CollectionSlideshow.js"],"sourcesContent":["// Ignore import errors\n// @ts-nocheck\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import React from\"react\";export function CollectionSlideshow({collection,showArrows=true,autoPlay=false,autoPlayInterval=3e3,arrowColor=\"#000000\",scrollDistance=0}){const containerRef=React.useRef(null);const autoPlayRef=React.useRef(null);const[canScrollLeft,setCanScrollLeft]=React.useState(false);const[canScrollRight,setCanScrollRight]=React.useState(true);const scrollToNext=()=>{if(containerRef.current){const container=containerRef.current;const scrollWidth=container.scrollWidth;const clientWidth=container.clientWidth;const currentScroll=container.scrollLeft;// Use custom scroll distance or fall back to child width\nlet scrollAmount=scrollDistance;if(scrollDistance===0){const firstChild=container.firstElementChild;if(firstChild){scrollAmount=firstChild.clientWidth;}}const newScroll=Math.min(currentScroll+scrollAmount,scrollWidth-clientWidth);container.scrollTo({left:newScroll,behavior:\"smooth\"});// Update scroll state after scrolling\nsetTimeout(updateScrollState,100);}};const scrollToPrevious=()=>{if(containerRef.current){const container=containerRef.current;const currentScroll=container.scrollLeft;// Use custom scroll distance or fall back to child width\nlet scrollAmount=scrollDistance;if(scrollDistance===0){const firstChild=container.firstElementChild;if(firstChild){scrollAmount=firstChild.clientWidth;}}const newScroll=Math.max(currentScroll-scrollAmount,0);container.scrollTo({left:newScroll,behavior:\"smooth\"});// Update scroll state after scrolling\nsetTimeout(updateScrollState,100);}};const updateScrollState=()=>{if(containerRef.current){const container=containerRef.current;const currentScroll=container.scrollLeft;const scrollWidth=container.scrollWidth;const clientWidth=container.clientWidth;setCanScrollLeft(currentScroll>0);setCanScrollRight(currentScroll<scrollWidth-clientWidth-1)// -1 for rounding tolerance\n;}};// Auto-play functionality\nReact.useEffect(()=>{if(autoPlay){autoPlayRef.current=setInterval(()=>{scrollToNext();},autoPlayInterval);}return()=>{if(autoPlayRef.current){clearInterval(autoPlayRef.current);}};},[autoPlay,autoPlayInterval]);// Pause auto-play on hover\nconst handleMouseEnter=()=>{if(autoPlayRef.current){clearInterval(autoPlayRef.current);}};const handleMouseLeave=()=>{if(autoPlay){autoPlayRef.current=setInterval(()=>{scrollToNext();},autoPlayInterval);}};// Handle keyboard navigation\nReact.useEffect(()=>{const handleKeyDown=event=>{switch(event.key){case\"ArrowLeft\":scrollToPrevious();break;case\"ArrowRight\":scrollToNext();break;}};window.addEventListener(\"keydown\",handleKeyDown);return()=>window.removeEventListener(\"keydown\",handleKeyDown);},[]);// Update scroll state when scrolling\nReact.useEffect(()=>{const container=containerRef.current;if(container){container.addEventListener(\"scroll\",updateScrollState);// Initial state update\nupdateScrollState();return()=>container.removeEventListener(\"scroll\",updateScrollState);}},[]);return /*#__PURE__*/_jsxs(\"div\",{role:\"region\",\"aria-roledescription\":\"carousel\",\"aria-label\":\"Collection slideshow\",style:{width:\"100%\",position:\"relative\"},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,id:\"collection-slideshow-slides\",role:\"group\",\"aria-label\":\"Slides\",\"aria-live\":autoPlay?\"off\":\"polite\",style:{width:\"100%\",overflow:\"auto\",scrollbarWidth:\"none\",msOverflowStyle:\"none\"},children:collection}),showArrows&&/*#__PURE__*/_jsxs(_Fragment,{children:[canScrollLeft&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:scrollToPrevious,\"aria-label\":\"Previous slide\",\"aria-controls\":\"collection-slideshow-slides\",style:{position:\"absolute\",left:\"16px\",top:\"50%\",transform:\"translateY(-50%)\",width:\"48px\",height:\"48px\",backgroundColor:\"rgba(255, 255, 255, 0.9)\",backdropFilter:\"blur(8px)\",border:\"none\",borderRadius:\"50%\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:4,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\",transition:\"all 0.2s ease\",cursor:\"pointer\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 1)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 0.9)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 18L9 12L15 6\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})}),canScrollRight&&/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:scrollToNext,\"aria-label\":\"Next slide\",\"aria-controls\":\"collection-slideshow-slides\",style:{position:\"absolute\",right:\"16px\",top:\"50%\",transform:\"translateY(-50%)\",width:\"48px\",height:\"48px\",backgroundColor:\"rgba(255, 255, 255, 0.9)\",backdropFilter:\"blur(8px)\",border:\"none\",borderRadius:\"50%\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\",transition:\"all 0.2s ease\",cursor:\"pointer\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 1)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"rgba(255, 255, 255, 0.9)\";e.currentTarget.style.transform=\"translateY(-50%) scale(1)\";},children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 18L15 12L9 6\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]})]});}// Property Controls\naddPropertyControls(CollectionSlideshow,{collection:{type:ControlType.ComponentInstance,title:\"Collection\"},showArrows:{type:ControlType.Boolean,title:\"Show Arrows\",defaultValue:true},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:false},autoPlayInterval:{type:ControlType.Number,title:\"Auto Play Interval (ms)\",defaultValue:3e3,min:1e3,max:1e4,step:500,hidden:props=>!props.autoPlay},arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#000000\",hidden:props=>!props.showArrows},scrollDistance:{type:ControlType.Number,title:\"Scroll Distance (px)\",defaultValue:0,min:0,max:1e3,step:10,helpText:\"0 = auto (child width), or set custom pixel value\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"CollectionSlideshow\":{\"type\":\"reactComponent\",\"name\":\"CollectionSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CollectionSlideshow.map"],"mappings":"A,sMAE4J,SAAgBa,EAAoB,CAAC,aAAW,aAAW,GAAK,WAAS,GAAM,mBAAiB,IAAI,aAAW,UAAU,iBAAe,GAAG,CAAC,IAAMC,EAAad,EAAM,OAAO,IAAI,EAAQe,EAAYf,EAAM,OAAO,IAAI,EAAO,CAACgB,EAAcC,GAAkBjB,EAAM,SAAS,EAAK,EAAO,CAAC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