{"version":3,"file":"IntegrationLogo_7.DARVIn9j.mjs","names":["React.useState","React.useRef","__esmMin","de","init_npm_react_18_3_1","ce","_e","init_jsx_runtime","c","addPropertyControls","init_framer_CaDWdxiz","ControlType","IntegrationLogo","src","srcOf","logo","height","logoHeight","failed","setFailed","ratio","setRatio","ref","img","box","name","boost","srcSetOf","init_IntegrationLogo_7","image"],"sources":["https:/framerusercontent.com/modules/NqQZoMPKGXQ8EInvLo3F/eqG2QwcP1wzlh3iboWrV/IntegrationLogo_7.js"],"sourcesContent":["// Integration logo. The export of the Integrations template (scripts/lib/sales-template.mjs) places\n// it in the hero's logo cards and binds it to the item's logo and name; do not edit it in Framer.\n// The whole logo is shown at its own proportions (contain: no crop, no stretch), at the same\n// height for every logo, smaller only when it would not fit the card. Squarer logos get a little\n// more height so they look about as large as a wordmark. Without a usable logo the card shows the\n// name instead.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const srcOf=image=>(typeof image===\"string\"?image:image?.src)||\"\";const srcSetOf=image=>(typeof image===\"string\"?undefined:image?.srcSet)||undefined;/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function IntegrationLogo({logo,name,logoHeight}){const src=srcOf(logo);const height=logoHeight||44;const[failed,setFailed]=React.useState(!src);const[ratio,setRatio]=React.useState(null);const ref=React.useRef(null);React.useEffect(()=>{setFailed(!src);const img=ref.current;// An error before hydration fires no onError; a finished image without pixels did not load.\nif(img&&img.complete&&img.naturalWidth===0)img.decode().catch(()=>setFailed(true));else if(img&&img.complete&&img.naturalHeight)setRatio(img.naturalWidth/img.naturalHeight);},[src]);const box={width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\"};if(failed){return /*#__PURE__*/_jsx(\"div\",{style:box,children:/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"'League Spartan', 'League Spartan Placeholder', sans-serif\",fontWeight:700,fontSize:Math.round(height*.55),lineHeight:1.1,color:\"rgb(0, 0, 0)\",textAlign:\"center\",overflowWrap:\"anywhere\"},children:name||\"\"})});}// A wordmark (2:1 or wider) is `height` tall; a squarer logo up to 1.6 times that.\nconst boost=ratio&&ratio<2?Math.min(1.6,Math.sqrt(2/ratio)):1;return /*#__PURE__*/_jsx(\"div\",{style:box,children:/*#__PURE__*/_jsx(\"img\",{ref:ref,src:src,srcSet:srcSetOf(logo),alt:name?`${name} logo`:\"\",decoding:\"async\",draggable:false,onLoad:e=>{const t=e.currentTarget;if(t.naturalHeight)setRatio(t.naturalWidth/t.naturalHeight);},onError:()=>setFailed(true),style:{display:\"block\",height:Math.round(height*boost),width:\"auto\",maxWidth:\"100%\",maxHeight:\"100%\",objectFit:\"contain\",objectPosition:\"center\"}})});}addPropertyControls(IntegrationLogo,{logo:{type:ControlType.ResponsiveImage,title:\"Logo\"},name:{type:ControlType.String,title:\"Name\",description:\"Shown instead of the logo when there is none or it does not load.\"},logoHeight:{type:ControlType.Number,title:\"Logo height\",defaultValue:44,min:16,max:120,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"IntegrationLogo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./IntegrationLogo_7.map"],"mappings":"A,wLASG,SAAwBY,EAAgB,CAAC,OAAK,OAAK,cAAY,CAAC,IAAMC,EAAIC,EAAMC,CAAI,EAAQC,EAAOC,GAAY,GAAQ,CAACC,EAAOC,GAAWnB,EAAe,CAACa,CAAG,EAAO,CAACO,EAAMC,GAAUrB,EAAe,IAAI,EAAQsB,EAAIrB,EAAa,IAAI,EAAEI,MAAoB,CAACc,EAAU,CAACN,CAAG,EAAE,IAAMU,EAAID,EAA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