{"version":3,"file":"CMSLinkedImage.CUnldyDc.mjs","names":["React.useMemo","_jsx","__esmMin","pe","init_npm_react_18_3_1","c","init_jsx_runtime","addPropertyControls","init_framer_ChujFWHC","ControlType","CMSLinkedImage","props","image","imageUrl","link","openInNewTab","rel","ariaLabel","fit","backgroundColor","borderRadius","border","style","target","computedRel","normalizedImage","anyImage","srcFromProp","imgAlt","label","containerStyle","imgStyle","content","href","init_CMSLinkedImage"],"sources":["https:/framerusercontent.com/modules/wTYAHTxKDLWws2VTolMF/Aib7ubdVS3jQhngPd0jG/CMSLinkedImage.js"],"sourcesContent":["// Instructions: Créé un composant image compatible avec l'intégration sous forme de lien dans un CMS\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CMSLinkedImage(props){const{image={src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Linked image\"},imageUrl,link,openInNewTab,rel,ariaLabel,fit,backgroundColor,borderRadius,border,style}=props;const target=openInNewTab?\"_blank\":undefined;const computedRel=React.useMemo(()=>{if(!openInNewTab&&rel===\"auto\")return undefined;if(rel===\"auto\")return\"noopener noreferrer\";return rel;},[openInNewTab,rel]);const normalizedImage=React.useMemo(()=>{const anyImage=image;const srcFromProp=typeof anyImage===\"string\"?anyImage:anyImage?.src??anyImage?.url;const src=(imageUrl?.trim()||srcFromProp||\"\").trim();const srcSet=typeof anyImage===\"object\"?anyImage?.srcSet:undefined;const alt=typeof anyImage===\"object\"?anyImage?.alt:undefined;return{src,srcSet,alt};},[image,imageUrl]);const imgAlt=normalizedImage.alt??\"\";const label=ariaLabel?.trim()?ariaLabel.trim():imgAlt?.trim()?imgAlt.trim():\"Image\";const containerStyle={position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius,backgroundColor,...border??{},...style??{}};const imgStyle={display:\"block\",width:\"100%\",height:\"100%\",objectFit:fit,userSelect:\"none\",WebkitUserSelect:\"none\"};const content=/*#__PURE__*/_jsx(\"img\",{src:normalizedImage.src,srcSet:normalizedImage.srcSet,alt:imgAlt,style:imgStyle,draggable:false,loading:\"lazy\"});const href=link?.trim();if(!href){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:content});}return /*#__PURE__*/_jsx(\"a\",{href:href,target:target,rel:computedRel,\"aria-label\":label,style:{...containerStyle,display:\"block\",textDecoration:\"none\",color:\"inherit\"},children:content});}addPropertyControls(CMSLinkedImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},imageUrl:{type:ControlType.Link,title:\"Image URL (CMS)\",defaultValue:\"\"},link:{type:ControlType.Link,title:\"Lien\",defaultValue:\"\"},openInNewTab:{type:ControlType.Boolean,title:\"Nouvel onglet\",defaultValue:false},rel:{type:ControlType.Enum,title:\"Rel\",options:[\"auto\",\"noopener\",\"noreferrer\",\"nofollow\",\"noopener noreferrer\"],optionTitles:[\"Auto\",\"noopener\",\"noreferrer\",\"nofollow\",\"noopener noreferrer\"],defaultValue:\"auto\"},ariaLabel:{type:ControlType.String,title:\"ARIA label\",defaultValue:\"\",placeholder:\"Optionnel (sinon alt de l’image)\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\",\"fill\",\"none\",\"scale-down\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\",\"None\",\"Scale-down\"],defaultValue:\"cover\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Fond\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.BorderRadius,title:\"Rayon\",defaultValue:\"12px\"},border:{type:ControlType.Border,title:\"Bordure\",optional:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CMSLinkedImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"320\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CMSLinkedImage.map"],"mappings":"A,0KAOG,SAAwBU,EAAeC,EAAM,CAAC,GAAK,CAACC,QAAM,CAAC,IAAI,sEAAsE,IAAI,cAAc,EAAEC,WAASC,OAAKC,eAAaC,MAAIC,YAAUC,MAAIC,kBAAgBC,eAAaC,SAAOC,SAAOX,EAAYY,EAAOR,EAAa,SAAS,IAAA,GAAgBS,EAAYxB,MAAkB,CAAC,GAAIe,GAAcC,IAAM,OAAoE,OAAzCA,IAAM,OAAa,sBAA6BA,CAAI,EAAE,CAACD,EAAaC,CAAG,CAAC,EAAQS,EAAgBzB,MAAkB,CAAC,IAAM0B,EAASd,EAAYe,EAAY,OAAOD,GAAW,SAASA,EAASA,GAAU,KAAKA,GAAU,IAAyL,MAAM,CAAC,KAAjLb,GAAU,KAAK,GAAGc,GAAa,GAAA,CAAI,KAAgJ,EAAE,OAA9H,OAAOD,GAAW,SAASA,GAAU,OAAO,IAAA,GAAyF,IAArE,OAAOA,GAAW,SAASA,GAAU,IAAI,IAAA,EAA+B,CAAE,EAAE,CAACd,EAAMC,CAAQ,CAAC,EAAQe,EAAOH,EAAgB,KAAK,GAASI,EAAMZ,GAAW,KAAK,EAAEA,EAAU,KAAK,EAAEW,GAAQ,KAAK,EAAEA,EAAO,KAAK,EAAE,QAAcE,EAAe,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAASV,eAAaD,kBAAgB,GAAGE,GAAQ,CAAC,EAAE,GAAGC,GAAO,CAAC,CAAC,EAAQS,EAAS,CAAC,QAAQ,QAAQ,MAAM,OAAO,OAAO,OAAO,UAAUb,EAAI,WAAW,OAAO,iBAAiB,MAAM,EAAQc,EAAqB/B,gBAAK,MAAM,CAAC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