{"version":3,"file":"CollectionSlideshow.wHDR0U00.mjs","names":["React","_Fragment"],"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":"uMAE4J,SAAgB,EAAoB,CAAC,aAAW,aAAW,GAAK,WAAS,GAAM,mBAAiB,IAAI,aAAW,UAAU,iBAAe,GAAG,CAAC,IAAM,EAAaA,EAAM,OAAO,KAAK,CAAO,EAAYA,EAAM,OAAO,KAAK,CAAM,CAAC,EAAc,GAAkBA,EAAM,SAAS,GAAM,CAAM,CAAC,EAAe,GAAmBA,EAAM,SAAS,GAAK,CAAO,MAAiB,CAAC,GAAG,EAAa,QAAQ,CAAC,IAAM,EAAU,EAAa,QAAc,EAAY,EAAU,YAAkB,EAAY,EAAU,YAAkB,EAAc,EAAU,WAC5qB,EAAa,EAAe,GAAG,IAAiB,EAAE,CAAC,IAAM,EAAW,EAAU,kBAAqB,IAAY,EAAa,EAAW,aAAc,IAAM,EAAU,KAAK,IAAI,EAAc,EAAa,EAAY,EAAY,CAAC,EAAU,SAAS,C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