{"version":3,"file":"AutoAdjustImage.DbP9N2AB.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/pvlnZcRFUhIoLKcYakz8/F5AHQTDAzU2lEDgGYACW/AutoAdjustImage.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function AutoAdjustImage(props){const{src,...rest}=props;const[dimensions,setDimensions]=useState({width:\"100%\",height:\"auto\"});useEffect(()=>{const img=new Image;img.src=src;img.onload=()=>{const aspectRatio=img.naturalWidth/img.naturalHeight;// Determine if the image is landscape or portrait\nif(aspectRatio>1){// Landscape\nsetDimensions({width:\"fill\",height:\"100%\"});}else{// Portrait or square\nsetDimensions({width:\"100%\",height:\"auto\"});}};},[src]);return /*#__PURE__*/_jsx(\"img\",{src:src,style:{...rest.style,...dimensions},alt:\"\"});}AutoAdjustImage.displayName=\"Auto Adjust Image\";addPropertyControls(AutoAdjustImage,{src:{type:ControlType.Image,title:\"Source\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AutoAdjustImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AutoAdjustImage.map"],"mappings":"kLAGG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,GAAM,EAAW,CAAC,EAAW,GAAeA,EAAS,CAAC,MAAM,OAAO,OAAO,MAAM,CAAC,EAGxF,OAH0F,MAAc,CAAC,IAAM,EAAI,IAAI,MAAM,EAAI,IAAI,EAAI,EAAI,WAAW,CAAmB,EAAI,aAAa,EAAI,cACzO,EACf,EAAc,CAAC,MAAM,OAAO,OAAO,MAAM,CAAC,EAC1C,EAAc,CAAC,MAAM,OAAO,OAAO,MAAM,CAAC,CAAG,CAAE,EAAE,CAAC,CAAG,CAAC,EAAsB,EAAK,MAAM,CAAK,MAAI,MAAM,CAAC,GAAG,EAAK,MAAM,GAAG,CAAU,EAAE,IAAI,EAAE,CAAC,CAAE,iBANnG,IAAoD,IAAsC,EAMU,EAAgB,YAAY,oBAAoB,EAAoB,EAAgB,CAAC,IAAI,CAAC,KAAK,EAAY,MAAM,MAAM,SAAS,aAAa,EAAE,CAAC,CAAC"}