{"version":3,"file":"CMSCarousel.CBXUT_eT.mjs","names":[],"sources":["https:/framerusercontent.com/modules/quHN9fiVgSQ45xytkwoG/Cej9yh1NurXWRdQ2Ng09/CMSCarousel.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,// @ts-ignore\ngetPropertyControls,// @ts-ignore\nControlType,RenderTarget}from\"framer\";import Carousel from\"https://framer.com/m/Carousel-bt0d.js\";import{CanvasPlaceholder,getCollectionListItems}from\"https://framer.com/m/CMSSlideshow-xxTt.js@Gwq5XNGR2fw3oxqNnFeg\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n */export default function CMSCarousel(props){const{startLayers,endLayers,...otherProps}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;// ✅ FIX: always use the first element if collectionList is an array\nconst items=isCanvas?[]:getCollectionListItems(props.collectionList?.[0])??[];// Early exit\nconst hasNoContent=!isCanvas&&items.length===0&&(!startLayers||startLayers.length===0)&&(!endLayers||endLayers.length===0);if(hasNoContent){console.warn(\"[CMSCarousel] No items or layers to display. Component will not render.\");return null;}let layers=[];// Add start layers\nif(startLayers){layers=layers.concat(startLayers);}// Process CMS items\nif(!isCanvas){for(let i=0;i<items.length;i++){// ✅ SAFER extraction: handle multiple possible shapes\nlet childNode=null;if(items[i]?.props?.children){// Case 1: direct React child\nchildNode=items[i].props.children;}if(items[i]?.props?.children?.props&&items[i].props.children.props.children){// Case 2: nested children (old assumption)\nchildNode=items[i].props.children.props.children;}if(childNode){layers.push(childNode);}else{console.warn(`[CMSCarousel] Item at index ${i} has no valid children.`);}}}else{// Canvas preview placeholders\nlet count=1;if(props.axis){if(props.sizingObject?.widthType===\"columns\"){count=props.sizingObject?.widthColumns||1;}}else{if(props.sizingObject?.heightType===\"columns\"){count=props.sizingObject?.heightColumns||1;}}for(let i=0;i<count;i++){layers.push(/*#__PURE__*/_jsx(CanvasPlaceholder,{title:\"Run project to view carousel content\",subtitle:\"Collection List content is not accessible to the carousel component in the editor. Run your project or visit the live website to view the carousel with CMS content.\"}));}}// Add end layers\nif(endLayers){layers=layers.concat(endLayers);}if(layers.length===0){console.warn(\"[CMSCarousel] No layers to render. Component will not render.\");return null;}return /*#__PURE__*/_jsx(\"div\",{style:{display:layers.length>0?\"block\":\"none\",width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(Carousel,{...otherProps,slots:layers})});}CMSCarousel.displayName=\"CMS Carousel\";addPropertyControls(CMSCarousel,{collectionList:{type:ControlType.ComponentInstance},startLayers:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"Start\"},endLayers:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"End\"},...getComponentProps(Carousel)});function getComponentProps(component){const{slots,...otherProps}=getPropertyControls(component);return otherProps;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSCarousel.map"],"mappings":"+aAOG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,cAAY,YAAU,GAAG,GAAY,EAAY,EAAS,EAAa,SAAS,GAAG,EAAa,OAC9I,EAAM,EAAS,EAAE,CAAC,EAAuB,EAAM,iBAAiB,GAAG,EAAE,EAAE,CAC8C,GAAxG,CAAC,GAAU,EAAM,SAAS,IAAI,CAAC,GAAa,EAAY,SAAS,KAAK,CAAC,GAAW,EAAU,SAAS,GAA4G,OAAxF,QAAQ,KAAK,0EAA0E,CAAQ,KAAM,IAAI,EAAO,EAAE,CAE9P,GADG,IAAa,EAAO,EAAO,OA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