{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/mqX07xZJ4UkFMELM0vHu/DKIW0ricqRZum17yZKrt/AspectRatioImage.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */ export default function AspectRatioImage(props){var ref,ref1,ref2;const horizontal=((ref=props.style)===null||ref===void 0?void 0:ref.height)!=undefined;const invalidSize=((ref1=props.style)===null||ref1===void 0?void 0:ref1.height)!=undefined&&((ref2=props.style)===null||ref2===void 0?void 0:ref2.width)!=undefined;const[maxSize,setMaxSize]=useState(null);if(typeof Image!==\"undefined\"){var ref3;var image=new Image;image.onload=function(){setMaxSize({width:image.width,height:image.height});};image.src=(ref3=props.image)===null||ref3===void 0?void 0:ref3.src;}return /*#__PURE__*/ _jsx(\"img\",{src:props.image?props.image.src:\"\",alt:props.image?props.image.alt:\"\",style:{display:\"block\",objectFit:\"contain\",width:invalidSize?\"100%\":horizontal?\"auto\":\"100%\",height:invalidSize?\"100%\":horizontal?\"100%\":\"auto\",maxWidth:props.limitSize&&maxSize?`${maxSize.width}px`:horizontal?\"none\":\"100%\",maxHeight:props.limitSize&&maxSize?`${maxSize.height}px`:horizontal?\"100%\":\"none\",borderRadius:props.radiusIsMixed?`${props.topLeft}px ${props.topRight}px ${props.bottomRight}px ${props.bottomLeft}px`:`${props.radius}px`}});};AspectRatioImage.displayName=\"Aspect Ratio Image\";addPropertyControls(AspectRatioImage,{image:{type:ControlType.ResponsiveImage},limitSize:{type:ControlType.Boolean,defaultValue:false,description:\"If yes, the max size = image dimensions in px.\"},radius:{type:ControlType.FusedNumber,defaultValue:0,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeft\",\"topRight\",\"bottomRight\",\"bottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AspectRatioImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AspectRatioImage.map"],
  "mappings": "8DAGmB,SAARA,EAAkCC,EAAM,CAAC,IAAIC,EAAIC,EAAKC,EAAK,IAAMC,IAAaH,EAAID,EAAM,SAAS,MAAMC,IAAM,OAAO,OAAOA,EAAI,SAAS,KAAgBI,IAAcH,EAAKF,EAAM,SAAS,MAAME,IAAO,OAAO,OAAOA,EAAK,SAAS,QAAaC,EAAKH,EAAM,SAAS,MAAMG,IAAO,OAAO,OAAOA,EAAK,QAAQ,KAAe,CAACG,EAAQC,CAAU,EAAEC,EAAS,IAAI,EAAE,GAAG,OAAO,MAAQ,IAAY,CAAC,IAAIC,EAASC,EAAM,IAAI,MAAMA,EAAM,OAAO,UAAU,CAACH,EAAW,CAAC,MAAMG,EAAM,MAAM,OAAOA,EAAM,MAAM,CAAC,CAAE,EAAEA,EAAM,KAAKD,EAAKT,EAAM,SAAS,MAAMS,IAAO,OAAO,OAAOA,EAAK,IAAK,OAAqBE,EAAK,MAAM,CAAC,IAAIX,EAAM,MAAMA,EAAM,MAAM,IAAI,GAAG,IAAIA,EAAM,MAAMA,EAAM,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,QAAQ,UAAU,UAAU,MAAMK,EAAY,OAAOD,EAAW,OAAO,OAAO,OAAOC,GAAmBD,EAAP,OAAyB,OAAO,SAASJ,EAAM,WAAWM,EAAQ,GAAGA,EAAQ,UAAUF,EAAW,OAAO,OAAO,UAAUJ,EAAM,WAAWM,EAAQ,GAAGA,EAAQ,WAAWF,EAAW,OAAO,OAAO,aAAaJ,EAAM,cAAc,GAAGA,EAAM,aAAaA,EAA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