{"version":3,"file":"HTMLFileEmbed.DmNvGXB1.mjs","names":["useRef","useState","useEffect","startTransition","_jsx","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","te","window","ce","_e","de","init_framer_ChujFWHC","addPropertyControls","useIsStaticRenderer","ControlType","withPadding","html","pad","bleed","ratio","zoom","scale","pct","v","side","css","inject","doc","m","re","match","template","patched","_m","a","_b","c","HTMLFileEmbed","props","url","DEFAULT_URL","file","ratioWidth","ratioHeight","background","interactive","showOnCanvas","padding","offsetY","offsetX","clip","title","style","isStatic","live","rootRef","near","setNear","setHtml","source","el","io","entries","cancelled","res","text","frameW","frameH","hasFixedHeight","init_HTMLFileEmbed","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/aa4XK4PfFAfdrfVMXL4L/8dCc8v0AzzejlE5O4OnK/HTMLFileEmbed.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const DEFAULT_URL=\"https://framerusercontent.com/assets/sdDQEeokt6zUuR2FnGjqf7txCU.html\";// Pads the page inside the iframe. Values are fractions of the box width:\n// `bleed` = how far the iframe overhangs the box on every side (content stays box-sized),\n// `pad` = how much the content shrinks inside the box (vertical room split 30% top, 70% bottom).\n// `zoom` = the animation's size relative to the box width, centred in the box.\nfunction withPadding(html,pad,bleed,ratio,zoom){if(pad<=0&&bleed<=0)return html;const scale=zoom+2*bleed;const pct=v=>(v/scale*100).toFixed(4)+\"%\";const side=pct(bleed+pad*zoom);const top=pct(bleed+.6*pad*ratio*zoom);const bottom=pct(bleed+1.4*pad*ratio*zoom);const css=\"<style>html,body{height:100%;overflow:hidden!important}\"+`body{box-sizing:border-box!important;padding:${top} ${side} ${bottom} ${side}!important}`+\"[style*=aspect-ratio],body>#wrap{overflow:visible!important}</style>\";const inject=doc=>doc.replace(/<head[^>]*>/i,m=>m+css);const re=/(<script type=\"__bundler\\/template\">)([\\s\\S]*?)(<\\/script>)/;const match=html.match(re);if(match){try{const template=JSON.parse(match[2]);const patched=JSON.stringify(inject(template)).replace(/<\\//g,\"<\\\\u002F\");return html.replace(re,(_m,a,_b,c)=>a+patched+c);}catch(e){return html;}}return inject(html);}/**\n * HTML File Embed\n *\n * Fetches a public .html file (for example a Claude Design export uploaded to Framer)\n * and renders it in an iframe at a fixed aspect ratio. Loads when the embed nears the viewport.\n *\n * @framerIntrinsicWidth 760\n * @framerIntrinsicHeight 420\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any\n */export default function HTMLFileEmbed(props){const{url=DEFAULT_URL,file,ratioWidth=760,ratioHeight=420,background=\"rgba(0, 0, 0, 0)\",interactive=false,showOnCanvas=true,padding=0,bleed=0,zoom=100,offsetY=0,offsetX=0,clip=false,title=\"Product animation\",style}=props;const isStatic=useIsStaticRenderer();const live=!isStatic||showOnCanvas;const rootRef=useRef(null);const[near,setNear]=useState(false);const[html,setHtml]=useState(null);const source=(file&&file.length>0?file:url)||\"\";useEffect(()=>{if(!live||typeof window===\"undefined\")return;const el=rootRef.current;if(isStatic||!el||typeof IntersectionObserver===\"undefined\"){startTransition(()=>setNear(true));return;}const io=new IntersectionObserver(entries=>{if(entries.some(e=>e.isIntersecting)){startTransition(()=>setNear(true));io.disconnect();}},{rootMargin:\"600px 0px\"});io.observe(el);return()=>io.disconnect();},[isStatic,live]);useEffect(()=>{if(!near||!source)return;let cancelled=false;fetch(source).then(res=>res.ok?res.text():Promise.reject(res.status)).then(text=>{if(!cancelled)startTransition(()=>setHtml(text));}).catch(()=>{if(!cancelled)startTransition(()=>setHtml(null));});return()=>{cancelled=true;};},[near,source]);const ratio=ratioHeight/ratioWidth;const doc=html?withPadding(html,padding/100,bleed/100,ratio,zoom/100):null;const frameW=zoom+2*bleed;const frameH=zoom*ratio+2*bleed;const hasFixedHeight=!!style&&style.height!==undefined&&style.height!==\"auto\";return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,style:{...style,position:\"relative\",width:style?.width??\"100%\",aspectRatio:hasFixedHeight?undefined:`${ratioWidth} / ${ratioHeight}`,overflow:clip?\"hidden\":bleed>0||zoom>100?\"visible\":\"hidden\",...{containerType:\"inline-size\"},background},children:doc&&live?/*#__PURE__*/_jsx(\"iframe\",{title:title,srcDoc:doc,style:{position:\"absolute\",top:clip?`calc(${offsetY} * 1cqw)`:`calc(50% - ${frameH/2-offsetY} * 1cqw)`,left:`calc(50% - ${frameW/2-offsetX} * 1cqw)`,width:`calc(${frameW} * 1cqw)`,height:`calc(${frameH} * 1cqw)`,border:0,display:\"block\",background:\"transparent\",pointerEvents:interactive?\"auto\":\"none\"},tabIndex:interactive?0:-1,\"aria-hidden\":interactive?undefined:true}):null});}addPropertyControls(HTMLFileEmbed,{url:{type:ControlType.String,title:\"URL\",defaultValue:DEFAULT_URL,placeholder:\"https://…/file.html\"},file:{type:ControlType.File,title:\"Or upload\",allowedFileTypes:[\"html\",\"htm\"]},ratioWidth:{type:ControlType.Number,title:\"Ratio W\",defaultValue:760,min:1,max:4e3,step:1,displayStepper:true},ratioHeight:{type:ControlType.Number,title:\"Ratio H\",defaultValue:420,min:1,max:4e3,step:1,displayStepper:true},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(0, 0, 0, 0)\"},interactive:{type:ControlType.Boolean,title:\"Interactive\",defaultValue:false},showOnCanvas:{type:ControlType.Boolean,title:\"Show on canvas\",defaultValue:true},padding:{type:ControlType.Number,title:\"Padding\",description:\"Shrinks the animation so its shadows have room. % of width.\",defaultValue:0,min:0,max:20,step:.5,unit:\"%\"},bleed:{type:ControlType.Number,title:\"Bleed\",description:\"Room for shadows outside the box, % of width. Keeps the animation full size.\",defaultValue:0,min:0,max:25,step:.5,unit:\"%\"},zoom:{type:ControlType.Number,title:\"Zoom\",description:\"Animation size relative to the box width, centred. Use it to trim empty margins in the file.\",defaultValue:100,min:50,max:200,step:.5,unit:\"%\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",description:\"Nudges the animation down (+) or up (−), % of the box width.\",defaultValue:0,min:-40,max:40,step:.5,unit:\"%\"},offsetX:{type:ControlType.Number,title:\"Offset X\",description:\"Moves the animation right (+) or left (−), % of the box width. With Zoom, shows one part of a wide file.\",defaultValue:0,min:-100,max:100,step:.5,unit:\"%\"},clip:{type:ControlType.Boolean,title:\"Clip\",description:\"Crop to the box. The animation is pinned to the top; Offset X and Y move it.\",defaultValue:false},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Product animation\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HTMLFileEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"420\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"760\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HTMLFileEmbed.map"],"mappings":"A,2MAIA,SAASiB,EAAYC,EAAKC,EAAIC,EAAMC,EAAMC,EAAK,CAAC,GAAGH,GAAK,GAAGC,GAAO,EAAE,OAAOF,EAAK,IAAMK,EAAMD,EAAK,EAAEF,EAAYI,EAAIC,IAAIA,EAAEF,EAAM,IAAA,CAAK,QAAQ,CAAC,EAAE,IAAUG,EAAKF,EAAIJ,EAAMD,EAAIG,CAAI,EAA0FK,EAAI,uGAAlFH,EAAIJ,EAAM,GAAGD,EAAIE,EAAMC,CAAuK,EAAE,GAAGI,EAAK,GAA9JF,EAAIJ,EAAM,IAAID,EAAIE,EAAMC,CAA8I,EAAE,GAAGI,EAAK,iFAA0FE,EAAOC,GAAKA,EAAI,QAAQ,eAAeC,GAAGA,EAAEH,CAAG,EAAQI,EAAG,8DAAoEC,EAAMd,EAAK,MAAMa,CAAE,EAAE,GAAGC,EAAO,GAAG,CAAC,IAAMC,EAAS,KAAK,MAAMD,EAAM,EAAE,EAAQE,EAAQ,KAAK,UA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