{"version":3,"file":"SliderProduct.DKAaXTdn.mjs","names":["useState","prev","_Fragment"],"sources":["https:/framerusercontent.com/modules/XM2mH5eUP5uNzOdRif5z/5VPX46GEmzJ5v0QZOt7j/SliderProduct.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState}from\"react\";export default function SliderProduct(props){const{images:images1,imagesInString:images2,imageLink}=props;const[current,setCurrent]=useState(0);const images=[...images1,...images2.split(\",\")].filter(Boolean);if(!images||images.length===0)return null;const next=()=>{setCurrent(prev=>(prev+1)%images.length);};const prev=()=>{setCurrent(prev=>(prev-1+images.length)%images.length);};return /*#__PURE__*/_jsxs(\"div\",{style:{...containerStyle,...props.style},children:[/*#__PURE__*/_jsx(motion.a,{animate:{x:`-${current*100}%`},transition:{duration:.4},style:{display:\"flex\",width:\"100%\",height:\"100%\"},href:imageLink||undefined,children:images.map((src,index)=>/*#__PURE__*/_jsx(\"img\",{src:src,alt:`Slide ${index+1}`,style:{...imageStyle}},index))}),images.length>1&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{onClick:prev,style:buttonLeft,children:\"◀\"}),/*#__PURE__*/_jsx(\"button\",{onClick:next,style:buttonRight,children:\"▶\"})]})]});}addPropertyControls(SliderProduct,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.String},defaultValue:[\"https://picsum.photos/800/800?random=1\",\"https://picsum.photos/800/800?random=2\",\"https://picsum.photos/800/800?random=3\"]},imagesInString:{type:ControlType.String,title:\"Images String\",defaultValue:\"https://picsum.photos/800/800?random=1,https://picsum.photos/800/800?random=2\"},imageLink:{type:ControlType.Link,title:\"Link all Image\",defaultValue:\"\"}});const containerStyle={width:\"100%\",height:\"100%\",overflow:\"hidden\",position:\"relative\"};const imageStyle={width:\"100%\",height:\"100%\",objectFit:\"contain\",flexShrink:0};const buttonLeft={position:\"absolute\",top:\"50%\",left:\"10px\",transform:\"translateY(-50%)\",zIndex:1,background:\"#fff\",border:\"none\",borderRadius:\"50%\",padding:\"10px\",cursor:\"pointer\",lineHeight:\"10px\"};const buttonRight={...buttonLeft,left:\"auto\",right:\"10px\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SliderProduct\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SliderProduct.map"],"mappings":"yOAAiM,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,OAAO,EAAQ,eAAe,EAAQ,aAAW,EAAW,CAAC,EAAQ,GAAYA,EAAS,EAAE,CAAO,EAAO,CAAC,GAAG,EAAQ,GAAG,EAAQ,MAAM,IAAI,CAAC,CAAC,OAAO,QAAQ,CAAC,GAAG,CAAC,GAAQ,EAAO,SAAS,EAAE,OAAO,KAAK,IAAM,MAAS,CAAC,EAAW,IAAOC,EAAK,GAAG,EAAO,OAAO,EAAS,MAAS,CAAC,EAAW,IAAOA,EAAK,EAAE,EAAO,QAAQ,EAAO,OAAO,EAAG,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAe,GAAG,EAAM,MAAM,CAAC,SAAS,CAAc,EAAK,EAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAQ,IAAI,GAAG,CAAC,WAAW,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,QAAQ,OAAO,MAAM,OAAO,OAAO,OAAO,CAAC,KAAK,GAAW,IAAA,GAAU,SAAS,EAAO,KAAK,EAAI,IAAqB,EAAK,MAAM,CAAK,MAAI,IAAI,SAAS,EAAM,IAAI,MAAM,CAAC,GAAG,EAAW,CAAC,CAAC,EAAM,CAAC,CAAC,CAAC,CAAC,EAAO,OAAO,GAAgB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,SAAS,CAAC,QAAQ,EAAK,MAAM,E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