{"version":3,"file":"BlogCarousel.DFG4oj0J.mjs","names":["useRef","useState","useCallback","_jsxs","_jsx","p","_Fragment","__esmMin","init_npm_react_18_3_1","init_jsx_runtime","ne","l","c","p","_e","de","addPropertyControls","init_framer_ChujFWHC","ControlType","srcOf","photo","BlogCarousel","props","caption","ratio","fit","alts","style","altList","a","list","SLOTS","k","track","index","setIndex","goTo","i","el","next","onScroll","prev","aspect","many","CSS","p$1","url","alt","_","photoControls","__FramerMetadata__","init_BlogCarousel","\"exports\"","\"default\"","\"type\"","\"name\"","\"slots\"","\"annotations\"","\"framerSupportedLayoutHeight\"","\"framerContractVersion\"","\"framerSupportedLayoutWidth\"","\"__FramerMetadata__\""],"sources":["https:/framerusercontent.com/modules/mkTZ2UVgKV9SRiWkMo5C/2qEXVCJGoMxai20bQC8p/BlogCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useRef,useState,useCallback}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const CSS=`.fccar { width: 100%; margin: 28px 0 40px; display: flex; flex-direction: column; gap: 14px; font-family: \"Inter\", ui-sans-serif, system-ui, sans-serif; box-sizing: border-box; }\n.fccar-frame { position: relative; width: 100%; border: 2px solid #111; border-radius: 22px; overflow: hidden; background: #111; box-shadow: 6px 6px 0 #C7F6FE; box-sizing: border-box; }\n.fccar-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }\n.fccar-track::-webkit-scrollbar { display: none; }\n.fccar-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; overflow: hidden; }\n.fccar-blur { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(22px) brightness(0.75); }\n.fccar-photo { position: absolute; inset: 0; background-repeat: no-repeat; background-position: center; }\n.fccar-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 999px; border: 2px solid #111; background: #fff; color: #111; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 3px 3px 0 #111; transition: transform 0.15s ease, opacity 0.15s ease; }\n.fccar-btn:hover { transform: translateY(-50%) scale(1.06); }\n.fccar-btn[disabled] { opacity: 0; pointer-events: none; }\n.fccar-prev { left: 14px; }\n.fccar-next { right: 14px; }\n.fccar-count { position: absolute; right: 14px; bottom: 12px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 2px solid #111; font-size: 12px; font-weight: 700; color: #111; line-height: 1.2; }\n.fccar-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }\n.fccar-dots { display: flex; gap: 8px; align-items: center; justify-content: center; }\n.fccar-dot { width: 10px; height: 10px; border-radius: 999px; border: 2px solid #111; background: #fff; padding: 0; cursor: pointer; box-sizing: border-box; }\n.fccar-dot[aria-current=\"true\"] { background: #FFF87A; width: 22px; }\n.fccar-caption { font-size: 14px; line-height: 1.5; color: #555; text-align: center; }\n@media (max-width: 520px) { .fccar-btn { width: 36px; height: 36px; } .fccar-prev { left: 8px; } .fccar-next { right: 8px; } .fccar-frame { border-radius: 16px; } }`;const SLOTS=[\"photo1\",\"photo2\",\"photo3\",\"photo4\",\"photo5\",\"photo6\",\"photo7\",\"photo8\",\"photo9\",\"photo10\"];function srcOf(photo){if(!photo)return\"\";if(typeof photo===\"string\")return photo;return photo.src||\"\";}/**\n * Photo carousel for blog posts. Arrows, dots and swipe. One photo shows as a single framed image.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function BlogCarousel(props){const{caption,ratio,fit,alts,style}=props;const altList=String(alts||\"\").split(\"\\n\").map(a=>a.trim());const list=SLOTS.map(k=>props[k]).filter(p=>srcOf(p));const track=useRef(null);const[index,setIndex]=useState(0);const goTo=useCallback(i=>{const el=track.current;if(!el)return;const next=Math.max(0,Math.min(list.length-1,i));el.scrollTo({left:next*el.clientWidth,behavior:\"smooth\"});},[list.length]);const onScroll=useCallback(()=>{const el=track.current;if(!el||!el.clientWidth)return;const i=Math.round(el.scrollLeft/el.clientWidth);setIndex(prev=>prev===i?prev:i);},[]);const aspect=ratio===\"16:9\"?\"16 / 9\":ratio===\"4:3\"?\"4 / 3\":ratio===\"1:1\"?\"1 / 1\":\"3 / 2\";const many=list.length>1;return /*#__PURE__*/_jsxs(\"div\",{className:\"fccar\",style:{...style,maxWidth:props.size===\"small\"?380:props.size===\"medium\"?520:undefined,marginLeft:\"auto\",marginRight:\"auto\"},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),/*#__PURE__*/_jsxs(\"div\",{className:\"fccar-frame\",style:{aspectRatio:aspect},children:[/*#__PURE__*/_jsx(\"div\",{className:\"fccar-track\",ref:track,onScroll:onScroll,children:list.map((p,i)=>{const url=srcOf(p);const alt=altList[i]||p&&typeof p===\"object\"&&p.alt||\"\";return /*#__PURE__*/_jsxs(\"div\",{className:\"fccar-slide\",role:\"img\",\"aria-label\":alt||\"Photo \"+(i+1),children:[fit!==\"cover\"?/*#__PURE__*/_jsx(\"div\",{className:\"fccar-blur\",style:{backgroundImage:\"url(\"+JSON.stringify(url)+\")\"}}):null,/*#__PURE__*/_jsx(\"div\",{className:\"fccar-photo\",style:{backgroundImage:\"url(\"+JSON.stringify(url)+\")\",backgroundSize:fit===\"cover\"?\"cover\":\"contain\"}})]},i);})}),many?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"fccar-btn fccar-prev\",\"aria-label\":\"Previous photo\",disabled:index===0,onClick:()=>goTo(index-1),children:/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"3\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M15 5l-7 7 7 7\"})})}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"fccar-btn fccar-next\",\"aria-label\":\"Next photo\",disabled:index===list.length-1,onClick:()=>goTo(index+1),children:/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"3\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 5l7 7-7 7\"})})}),/*#__PURE__*/_jsxs(\"div\",{className:\"fccar-count\",children:[index+1,\" / \",list.length]})]}):null]}),many||caption?/*#__PURE__*/_jsxs(\"div\",{className:\"fccar-foot\",children:[many?/*#__PURE__*/_jsx(\"div\",{className:\"fccar-dots\",children:list.map((_,i)=>/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"fccar-dot\",\"aria-label\":\"Go to photo \"+(i+1),\"aria-current\":i===index?\"true\":\"false\",onClick:()=>goTo(i)},i))}):null,caption?/*#__PURE__*/_jsx(\"div\",{className:\"fccar-caption\",children:caption}):null]}):null]});}const photoControls={};SLOTS.forEach((k,i)=>{photoControls[k]={type:ControlType.ResponsiveImage,title:\"Photo \"+(i+1),hidden:p=>i>0&&!srcOf(p[SLOTS[i-1]])&&!srcOf(p[k])};});addPropertyControls(BlogCarousel,{...photoControls,alts:{type:ControlType.String,title:\"Descriptions\",displayTextArea:true,description:\"One line per photo, for screen readers.\"},caption:{type:ControlType.String,title:\"Caption\"},ratio:{type:ControlType.Enum,title:\"Ratio\",options:[\"3:2\",\"4:3\",\"16:9\",\"1:1\"],defaultValue:\"3:2\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"full\",\"medium\",\"small\"],optionTitles:[\"Full width\",\"Medium\",\"Small\"],defaultValue:\"full\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"contain\",\"cover\"],optionTitles:[\"Show whole photo\",\"Fill the frame\"],defaultValue:\"contain\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlogCarousel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlogCarousel.map"],"mappings":"A,sMAkB+Q,SAASmB,EAAMC,EAAM,CAA4D,OAAvDA,EAAkB,OAAOA,GAAQ,SAAgBA,EAAaA,EAAM,KAAK,GAA7D,EAAgE,CAKlX,SAAwBC,EAAaC,EAAM,CAAC,GAAK,CAACC,UAAQC,QAAMC,MAAIC,OAAKC,SAAOL,EAAYM,EAAQ,OAAOF,GAAM,EAAE,CAAC,CAAC,MAAM;CAAI,CAAC,CAAC,IAAIG,GAAGA,EAAE,KAAK,CAAC,EAAQC,EAAKC,EAAM,IAAIC,GAAGV,EAAMU,EAAE,CAAC,CAAC,OAAOnB,GAAGM,EAAMN,CAAC,CAAC,EAAQoB,EAAMjC,EAAO,IAAI,EAAO,CAACkC,EAAMC,GAAUlC,EAAS,CAAC,EAAQmC,EAAKlC,EAAYmC,GAAG,CAAC,IAAMC,EAAGL,EAAM,QAAQ,GAAG,CAACK,EAAG,OAAO,IAAMC,EAAK,KAAK,IAAI,EAAE,KAAK,IAAIT,EAAK,OAAO,EAAEO,CAAC,CAAC,EAAEC,EAAG,SAAS,CAAC,KAAKC,EAAKD,EAAG,YAAY,SAAS,QAAQ,CAAC,CAAE,EAAE,CAACR,EAAK,MAAM,CAAC,EAAQU,EAAStC,MAAgB,CAAC,IAAMoC,EAAGL,EAAM,QAAQ,GAAG,CAACK,GAAI,CAACA,EAAG,YAAY,OAAO,IAAMD,EAAE,KAAK,MAAMC,EAAG,WAAWA,EAAG,WAAW,EAAEH,EAASM,GAAMA,IAAOJ,EAAEI,EAAKJ,CAAC,CAAE,EAAE,CAAC,CAAC,EAAQK,EAAOlB,IAAQ,OAAO,SAASA,IAAQ,MAAM,QAAQA,IAAQ,MAAM,QAAQ,QAAcmB,EAAKb,EAAK,OAAO,EAAE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