{"version":3,"file":"Smart_image.B_WSb9qJ.mjs","names":[],"sources":["https:/framerusercontent.com/modules/gaMHfiDovF1i5LJhcXmY/WquCQKxdiMN4GfchvWlH/Component_instructions.js","https:/framer.com/m/Component-instructions-nvSSIr.js@WquCQKxdiMN4GfchvWlH","https:/framerusercontent.com/modules/mwKwkWY7kjFNZzNqtLCN/5SJcVlZVlBsTtf3BLgjE/Smart_image.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";export default function ComponentInstructions({title=\"Component Instructions\",description=\"Set up the component by adding image to the component properties.\"}){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:10,backgroundColor:\"#1C1C1C\",padding:\"40px\"},children:[/*#__PURE__*/_jsx(\"img\",{src:\"https://framerusercontent.com/images/GfOx3f6nJ3zn9ncjOQOsysz6gM.png\",alt:\"Component Instructions\",style:{width:\"32px\",height:\"32px\"}}),/*#__PURE__*/_jsx(\"h1\",{style:{color:\"#ededed\",fontSize:\"16px\",fontWeight:\"400\",margin:0,textAlign:\"center\",marginTop:\"6px\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{color:\"#999999\",fontSize:\"13px\",fontWeight:\"300\",margin:0,textAlign:\"center\"},children:description})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ComponentInstructions\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Component_instructions.map","/*\n * Component_instructions\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/gaMHfiDovF1i5LJhcXmY/WquCQKxdiMN4GfchvWlH/Component_instructions.js\"\nexport { default } from \"https://framerusercontent.com/modules/gaMHfiDovF1i5LJhcXmY/WquCQKxdiMN4GfchvWlH/Component_instructions.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";import{motion}from\"framer-motion\";// import ComponentInstructions from \"../component-template/componentInstructions\";\nimport ComponentInstructions from\"https://framer.com/m/Component-instructions-nvSSIr.js@WquCQKxdiMN4GfchvWlH\";// ------------------------------------------------------------ //\n// PROPERTY CONTROLS\n// ------------------------------------------------------------ //\naddPropertyControls(SmartImage,{imageType:{type:ControlType.Enum,options:[\"upload\",\"url\"],optionTitles:[\"Upload\",\"URL\"],defaultValue:\"upload\",displaySegmentedControl:true},image:{type:ControlType.ResponsiveImage,hidden:props=>props.imageType===\"url\"},imageUrl:{type:ControlType.String,hidden:props=>props.imageType===\"upload\"},imageAlt:{type:ControlType.String,hidden:props=>props.imageType===\"upload\"},objectFit:{type:ControlType.Enum,options:[\"fill\",\"fit\",\"strech\"],optionTitles:[\"Fill\",\"Fit\",\"Strech\"],defaultValue:\"fill\"},borderRadius:{type:ControlType.BorderRadius,defaultValue:\"0px\"},focalPointX:{title:\"X Focal Point\",type:ControlType.Number,min:0,max:100,step:1,defaultValue:50},focalPointY:{title:\"Y Focal Point\",type:ControlType.Number,min:0,max:100,step:1,defaultValue:50},loading:{type:ControlType.Enum,options:[\"lazy\",\"priority\"],optionTitles:[\"Lazy\",\"Priority\"],displaySegmentedControl:true,defaultValue:\"lazy\",description:\"More components at [VibeFrame](https://vibefra.me/creators/dd2f79ca-fb0a-40f1-8c69-7cf096f6e89b).\"},onTap:{type:ControlType.EventHandler,title:\"On Click\"}});// ------------------------------------------------------------ //\n// MAIN COMPONENT\n// ------------------------------------------------------------ //\n/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n */export default function SmartImage(props){// Default focal point if not provided\nconst focalPoint={x:props.focalPointX,y:props.focalPointY};// Handle URL image type\nif(props.imageType===\"url\"){if(!props.imageUrl){return /*#__PURE__*/_jsx(ComponentInstructions,{title:\"Smart Image\",description:\"Set up the component by adding an image URL to the component properties.\"});}return /*#__PURE__*/_jsx(motion.img,{src:props.imageUrl,alt:props.imageAlt||\"\",loading:props.loading===\"lazy\"?\"lazy\":\"eager\",fetchPriority:props.loading===\"priority\"?\"high\":\"auto\",style:{width:\"100%\",height:\"100%\",objectFit:getObjectFit(props.objectFit),objectPosition:`${focalPoint.x}% ${focalPoint.y}%`,borderRadius:props.borderRadius},onTap:props.onTap});}// Handle upload image type\nif(!(\"image\"in props)||!props.image){return /*#__PURE__*/_jsx(ComponentInstructions,{title:\"Smart Image\",description:\"Set up the component by adding image to the component properties.\"});}const transformedImage={...props.image,src:transformFramerAssetUrl(props.image.src)};return /*#__PURE__*/_jsx(motion.img,{...transformedImage,loading:props.loading===\"lazy\"?\"lazy\":\"eager\",fetchPriority:props.loading===\"priority\"?\"high\":\"auto\",style:{width:\"100%\",height:\"100%\",objectFit:getObjectFit(props.objectFit),objectPosition:`${focalPoint.x}% ${focalPoint.y}%`,borderRadius:props.borderRadius},onTap:props.onTap});}// ------------------------------------------------------------ //\n// HELPER FUNCTIONS\n// ------------------------------------------------------------ //\nfunction transformFramerAssetUrl(src){if(!src.startsWith(\"data:framer/asset-reference,\")){return src;}try{// Extract the asset ID (everything between comma and first ?)\nconst commaIndex=src.indexOf(\",\");const questionMarkIndex=src.indexOf(\"?\");if(commaIndex===-1||questionMarkIndex===-1){return src;}const assetId=src.substring(commaIndex+1,questionMarkIndex);// Parse query parameters\nconst urlParams=new URLSearchParams(src.substring(questionMarkIndex+1));const width=urlParams.get(\"width\");const height=urlParams.get(\"height\");// Construct new URL\nlet newUrl=`https://framerusercontent.com/images/${assetId}`;// Add width and height if they exist\nconst params=new URLSearchParams;if(width)params.append(\"width\",width);if(height)params.append(\"height\",height);const paramString=params.toString();if(paramString){newUrl+=`?${paramString}`;}return newUrl;}catch(error){console.warn(\"Failed to transform Framer asset URL:\",error);return src;}}function getObjectFit(objectFit){if(objectFit===\"fill\")return\"cover\";if(objectFit===\"fit\")return\"contain\";if(objectFit===\"strech\")return\"fill\";return\"cover\";}SmartImage.displayName=\"Smart Image\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmartImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Smart_image.map"],"mappings":"oNAAyD,SAAwB,EAAsB,CAAC,QAAM,yBAAyB,cAAY,qEAAqE,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,cAAc,SAAS,WAAW,SAAS,eAAe,SAAS,IAAI,GAAG,gBAAgB,UAAU,QAAQ,OAAO,CAAC,SAAS,CAAc,EAAK,MAAM,CAAC,IAAI,sEAAsE,IAAI,yBAAyB,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,CAAC,CAAC,CAAc,EAAK,KAAK,CAAC,MAAM,CAAC,MAAM,UAAU,SAAS,OAAO,WAAW,MAAM,OAAO,EAAE,UAAU,SAAS,UAAU,MAAM,CAAC,SAAS,EAAM,CAAC,CAAc,EAAK,IAAI,CAAC,MAAM,CAAC,MAAM,UAAU,SAAS,OAAO,WAAW,MAAM,OAAO,EAAE,UAAU,SAAS,CAAC,SAAS,EAAY,CAAC,CAAC,CAAC,CAAC,kBAAxyB,qBCO0E,ICMhI,SAAwB,EAAW,EAAM,CAC5C,IAAM,EAAW,CAAC,EAAE,EAAM,YAAY,EAAE,EAAM,YAAY,CAC1D,GAAG,EAAM,YAAY,MAAyL,OAA9K,EAAM,SAA4L,EAAK,EAAO,IAAI,CAAC,IAAI,EAAM,SAAS,IAAI,EAAM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