{"version":3,"file":"ResponsiveHTMLTool.DVqfuggR.mjs","names":["useState","useCallback","useMemo"],"sources":["https:/framerusercontent.com/modules/pczJbrLuXVmanOBLoBj3/DpmnWAQkuWGopUuZoRWW/ResponsiveHTMLTool.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ResponsiveHTMLTool(props){const{html,desktopHeight,mobileHeight,borderColor,cornerRadius,backgroundColor}=props;const[isMobile,setIsMobile]=useState(false);const getIsMobile=useCallback(()=>{if(typeof window!==\"undefined\"){return window.innerWidth<768;}return false;},[]);useEffect(()=>{if(typeof window!==\"undefined\"){startTransition(()=>setIsMobile(getIsMobile()));const handleResize=()=>{startTransition(()=>setIsMobile(getIsMobile()));};window.addEventListener(\"resize\",handleResize);return()=>{window.removeEventListener(\"resize\",handleResize);};}return;},[getIsMobile]);const frameHeight=useMemo(()=>{return isMobile?mobileHeight:desktopHeight;},[desktopHeight,isMobile,mobileHeight]);const wrapperStyle=useMemo(()=>({position:\"relative\",width:\"100%\",height:`${frameHeight}px`,backgroundColor,border:`1px solid ${borderColor}`,borderRadius:`${cornerRadius}px`,overflow:\"hidden\",boxSizing:\"border-box\"}),[backgroundColor,borderColor,cornerRadius,frameHeight]);const iframeStyle=useMemo(()=>({display:\"block\",width:\"100%\",minWidth:0,height:`${frameHeight}px`,border:\"none\",backgroundColor:\"transparent\"}),[frameHeight]);return /*#__PURE__*/_jsx(\"div\",{style:wrapperStyle,children:/*#__PURE__*/_jsx(\"iframe\",{title:\"Responsive embedded HTML content for clinical calculator\",srcDoc:html,style:iframeStyle})});}addPropertyControls(ResponsiveHTMLTool,{html:{type:ControlType.String,title:\"HTML\",defaultValue:\"<!doctype html><html><head><meta charset='utf-8' /><meta name='viewport' content='width=device-width, initial-scale=1' /></head><body><div>Embed your self-contained HTML here.</div></body></html>\",displayTextArea:true},desktopHeight:{type:ControlType.Number,title:\"Desktop H\",defaultValue:720,min:120,max:2e3,step:10,unit:\"px\"},mobileHeight:{type:ControlType.Number,title:\"Mobile H\",defaultValue:980,min:120,max:3e3,step:10,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},cornerRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:48,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ResponsiveHTMLTool\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ResponsiveHTMLTool.map"],"mappings":"oNAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,gBAAc,eAAa,cAAY,eAAa,mBAAiB,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAQ,EAAYC,MAA2B,IAAS,QAAoB,EAAO,WAAW,IAAoB,CAAC,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,MAAoB,EAAY,EAAY,CAAC,CAAC,EAAE,IAAM,MAAiB,CAAC,MAAoB,EAAY,EAAY,CAAC,CAAC,CAAE,EAAiD,OAA/C,EAAO,iBAAiB,SAAS,CAAY,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAY,CAAE,CAAE,CAAQ,EAAE,CAAC,CAAW,CAAC,EAAE,IAAM,EAAYC,MAAoB,EAAS,EAAa,EAAgB,CAAC,EAAc,EAAS,CAAY,CAAC,EAAmb,OAAoB,EAAK,MAAM,CAAC,MAA9bA,OAAa,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,GAAG,EAAY,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