{"version":3,"file":"SuperLogo_Live.CA6pYRLm.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/4Q2NVJQYVNI2JOsw6HKU/hFqj0QWhgyF4vjSAYtYQ/SuperLogo_Live.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useReducedMotion}from\"framer-motion\";// ─── Constants ────────────────────────────────────────────────────────────────\nconst FALLBACK_SRC=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\";const FALLBACK_RATIO=1;// ─── Component ────────────────────────────────────────────────────────────────\n/**\n * SuperLogo\n *\n * Renders any logo (SVG, PNG, JPG, WebP, GIF) at a fixed height while\n * automatically preserving its aspect ratio. Supports CMS image connections,\n * brightness, and invert controls for dark/light theme adaptation.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 80\n * @framerDisableUnlink\n */export default function SuperLogo({logo,altText=\"\",fixedHeight=80,invertColors=false,brightness=100,style}){const prefersReducedMotion=useReducedMotion();const src=typeof logo===\"string\"?logo:logo?.src??FALLBACK_SRC;const isSVG=src.toLowerCase().includes(\".svg\");const[aspectRatio,setAspectRatio]=useState(FALLBACK_RATIO);const[isLoading,setIsLoading]=useState(true);const imgRef=useRef(null);// ── SVG: fetch to read intrinsic dimensions ──────────────────────────────\nuseEffect(()=>{if(!src||!isSVG)return;let cancelled=false;setIsLoading(true);const controller=new AbortController;fetch(src,{signal:controller.signal}).then(res=>{if(!res.ok)throw new Error(\"Fetch failed\");return res.text();}).then(svgText=>{if(cancelled)return;const parser=new DOMParser;const doc=parser.parseFromString(svgText,\"image/svg+xml\");const svgEl=doc.querySelector(\"svg\");let ratio=FALLBACK_RATIO;if(svgEl){let w=parseFloat(svgEl.getAttribute(\"width\")??\"0\");let h=parseFloat(svgEl.getAttribute(\"height\")??\"0\");if(!w||!h){const vb=svgEl.getAttribute(\"viewBox\");if(vb){const parts=vb.trim().split(/[\\s,]+/).map(Number);if(parts.length===4&&parts[2]>0&&parts[3]>0){w=parts[2];h=parts[3];}}}if(w>0&&h>0)ratio=w/h;}setAspectRatio(ratio);setIsLoading(false);}).catch(err=>{if(cancelled||err.name===\"AbortError\")return;setAspectRatio(FALLBACK_RATIO);setIsLoading(false);});return()=>{cancelled=true;controller.abort();};},[src,isSVG]);// ── Raster: read natural dimensions from the <img> element ───────────────\nuseEffect(()=>{if(!src||isSVG)return;setIsLoading(true);setAspectRatio(FALLBACK_RATIO);const img=imgRef.current;if(!img)return;const handleLoad=()=>{const{naturalWidth,naturalHeight}=img;if(naturalWidth>0&&naturalHeight>0){setAspectRatio(naturalWidth/naturalHeight);}setIsLoading(false);};const handleError=()=>{setAspectRatio(FALLBACK_RATIO);setIsLoading(false);};if(img.complete){img.naturalWidth>0?handleLoad():handleError();return;}img.addEventListener(\"load\",handleLoad);img.addEventListener(\"error\",handleError);return()=>{img.removeEventListener(\"load\",handleLoad);img.removeEventListener(\"error\",handleError);};},[src,isSVG]);// ── Dimensions ───────────────────────────────────────────────────────────\n// fixedHeight always wins — never let Framer's injected style.height\n// override the user's explicit height setting.\nconst computedWidth=Math.round(fixedHeight*aspectRatio);// ── Styles ───────────────────────────────────────────────────────────────\nconst filterParts=[invertColors?\"invert(1) hue-rotate(180deg)\":\"\",brightness!==100?`brightness(${brightness}%)`:\"\"].filter(Boolean);const containerStyle={// Carry only positional data from Framer's injected style\nposition:style?.position,top:style?.top,left:style?.left,right:style?.right,bottom:style?.bottom,transform:style?.transform,// Our values always take precedence\nwidth:computedWidth,height:fixedHeight,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",background:\"transparent\",userSelect:\"none\",opacity:isLoading?0:1,transition:prefersReducedMotion?\"none\":\"opacity 0.2s ease-in-out\",pointerEvents:isLoading?\"none\":\"auto\"};const imageStyle={display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"contain\",filter:filterParts.length>0?filterParts.join(\" \"):undefined,pointerEvents:\"none\",userSelect:\"none\",// @ts-ignore\nWebkitUserDrag:\"none\"};// ── Render ───────────────────────────────────────────────────────────────\nreturn /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"img\",{ref:imgRef,src:src||FALLBACK_SRC,alt:altText||(typeof logo!==\"string\"?logo?.alt??\"\":\"\"),style:imageStyle,draggable:false,loading:\"eager\",decoding:\"async\"})});}// ─── Property Controls ────────────────────────────────────────────────────────\naddPropertyControls(SuperLogo,{logo:{type:ControlType.ResponsiveImage,title:\"Logo\"},altText:{type:ControlType.String,title:\"Alt Text\",placeholder:\"Leave empty for decorative logos\",defaultValue:\"\",description:\"Describe the logo for screen readers. Leave empty if purely decorative.\"},fixedHeight:{type:ControlType.Number,title:\"Height\",defaultValue:80,min:1,max:512,step:1,unit:\"px\",displayStepper:true},brightness:{type:ControlType.Number,title:\"Brightness\",defaultValue:100,min:0,max:200,step:1,unit:\"%\",displayStepper:true},invertColors:{type:ControlType.Boolean,title:\"Invert\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\",description:\"Created by [Framerpod](https://www.framerpod.com)\"}});SuperLogo.displayName=\"Super Logo\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SuperLogo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerIntrinsicHeight\":\"80\",\"framerIntrinsicWidth\":\"160\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SuperLogo_Live.map"],"mappings":"yOAcG,SAAwB,EAAU,CAAC,OAAK,UAAQ,GAAG,cAAY,GAAG,eAAa,GAAM,aAAW,IAAI,SAAO,CAAC,IAAM,EAAqB,EAAiB,EAAQ,EAAI,OAAO,GAAO,SAAS,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