{"version":3,"file":"ResponsiveQuizHTML.DjnmXvjr.mjs","names":["React.useRef","React.useState","React.useMemo","__esmMin","init_ssg_sandbox_shims","_e","de","pe","c","init_jsx_runtime","init_npm_react_18_3_1","ce","window","addPropertyControls","init_framer_BpuvUAiZ","ControlType","ResponsiveQuizHTML","ref","height","setHeight","documentHTML","html","onMessage","event","h","style","init_ResponsiveQuizHTML"],"sources":["https:/framerusercontent.com/modules/nTEVmw36S5wrBlHuIbiT/oztHQKGaQd3upPFyUtbd/ResponsiveQuizHTML.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ResponsiveQuizHTML({html=\"\",title=\"Porto quiz\",style}){const ref=React.useRef(null);const[height,setHeight]=React.useState(880);const documentHTML=React.useMemo(()=>{const css=\"<style>html{height:auto!important;min-height:0!important;overflow-x:hidden}body{height:auto!important;min-height:0!important;width:100%;overflow-x:hidden}.panel{min-height:0!important;width:100%}.game,.panel .inner{width:100%;max-width:38rem}.topbar{flex-wrap:wrap;gap:.5rem}.timer{min-width:0}.track{min-width:0}.opt{min-width:0;width:100%;overflow-wrap:anywhere}.opt span:last-child{min-width:0}.actions .btn{max-width:100%;white-space:normal}.ladder li span:first-child{min-width:0;overflow-wrap:anywhere}.ladder li span:last-child{flex-shrink:0}@media(max-width:480px){.panel .inner{padding:2rem 1.25rem 2.5rem}.timer{flex-wrap:wrap}}</style>\";const bridge='<script>(function(){let pending=false,last=0;function report(){pending=false;const h=Math.ceil(document.body.getBoundingClientRect().height);if(h>0&&h!==last){last=h;parent.postMessage({type:\"porto-quiz-size\",height:h},\"*\")}}function schedule(){if(!pending){pending=true;requestAnimationFrame(report)}}new ResizeObserver(schedule).observe(document.body);new MutationObserver(schedule).observe(document.body,{subtree:true,childList:true,attributes:true,characterData:true});window.addEventListener(\"load\",schedule);window.addEventListener(\"resize\",schedule);if(document.fonts)document.fonts.ready.then(schedule);schedule()})();</script>';return html.replace(\"</head>\",css+\"</head>\").replace(\"</body>\",bridge+\"</body>\");},[html]);React.useEffect(()=>{const onMessage=event=>{if(event.source!==ref.current?.contentWindow||event.data?.type!==\"porto-quiz-size\")return;const h=Number(event.data.height);if(Number.isFinite(h)&&h>0&&h<5e4)setHeight(h);};window.addEventListener(\"message\",onMessage);return()=>window.removeEventListener(\"message\",onMessage);},[]);return /*#__PURE__*/_jsx(\"iframe\",{ref:ref,title:title,srcDoc:documentHTML,sandbox:\"allow-scripts allow-popups allow-popups-to-escape-sandbox\",style:{...style,width:\"100%\",height,display:\"block\",border:0}});}addPropertyControls(ResponsiveQuizHTML,{html:{type:ControlType.String,title:\"HTML\",displayTextArea:true},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Porto quiz\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ResponsiveQuizHTML\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ResponsiveQuizHTML.map"],"mappings":"A,6MAGG,SAAwBgB,EAAmB,CAAC,OAAK,GAAG,QAAM,aAAa,SAAO,CAAC,IAAMC,EAAIjB,EAAa,IAAI,EAAO,CAACkB,EAAOC,GAAWlB,EAAe,GAAG,EAAQmB,EAAalB,MAAwzCmB,EAAK,QAAQ,UAAU,+oBAAa,CAAC,CAAC,QAAQ,UAAU,qoBAAgB,EAAI,CAACA,CAAI,CAAC,EAAyU,OAAvUV,MAAoB,CAAC,IAAMW,EAAU,GAAO,CAAC,GAAGC,EAAM,SAASN,EAAI,SAAS,eAAeM,EAAM,MAAM,OAAO,kBAAkB,OAAO,IAAMC,EAAE,OAAOD,EAAM,KAAK,MAAM,EAAK,OAAO,SAASC,CAAC,GAAGA,EAAE,GAAGA,EAAE,KAAIL,EAAUK,CAAC,CAAE,EAA+C,OAA7CZ,EAAO,iBAAiB,UAAUU,CAAS,MAAYV,EAAO,oBAAoB,UAAUU,CAAS,CAAE,EAAE,CAAC,CAAC,EAAsB,gBAAK,SAAS,CAAK,MAAU,QAAM,OAAOF,EAAa,QAAQ,4DAA4D,MAAM,CAAC,GAAGK,EAAM,MAAM,OAAO,SAAO,QAAQ,QAAQ,OAAO,CAAC,CAAC,CAAC,CAAE,C,8CAACZ,EAAoBG,EAAmB,CAAC,KAAK,CAAC,KAAKD,EAAY,OAAO,MAAM,OAAO,gBAAgB,EAAI,EAAE,MAAM,CAAC,KAAKA,EAAY,OAAO,MAAM,QAAQ,aAAa,YAAY,CAAC,CAAC,C"}