{"version":3,"file":"HtmlInjector.DMsWUhqM.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/uJ6MoqSaJoTtuTootMQc/5K3Fc0SpYr5nl8pWyrgJ/HtmlInjector.js"],"sourcesContent":["// HTML Injector component that renders custom HTML content\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function HtmlInjector(props){const{htmlContent=\"<p>Paste your HTML content here</p>\",allowScripts=false,sanitize=true,javascriptCode=\"\"}=props;const processedHTML=useMemo(()=>{let html=htmlContent;if(sanitize&&!allowScripts){// Remove script tags and event handlers for security\nhtml=html.replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\"\");html=html.replace(/\\son\\w+=\"[^\"]*\"/gi,\"\");html=html.replace(/\\son\\w+='[^']*'/gi,\"\");html=html.replace(/javascript:/gi,\"\");}return html;},[htmlContent,allowScripts,sanitize]);// Execute JavaScript code when component loads\nuseEffect(()=>{if(javascriptCode&&typeof window!==\"undefined\"){try{// Create a function to execute the code in a controlled scope\nconst executeCode=new Function(javascriptCode);executeCode();}catch(error){console.error(\"Error executing JavaScript code:\",error);}}},[javascriptCode]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"auto\",position:\"relative\"},dangerouslySetInnerHTML:{__html:processedHTML}});}addPropertyControls(HtmlInjector,{htmlContent:{type:ControlType.String,title:\"HTML Content\",defaultValue:\"<p>Paste your HTML content here</p>\",displayTextArea:true,placeholder:\"Enter your HTML code...\"},javascriptCode:{type:ControlType.String,title:\"JavaScript Code\",defaultValue:\"\",displayTextArea:true,placeholder:\"console.log('Component loaded!');\"},allowScripts:{type:ControlType.Boolean,title:\"Allow Scripts\",defaultValue:false,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},sanitize:{type:ControlType.Boolean,title:\"Sanitize HTML\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HtmlInjector\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HtmlInjector.map"],"mappings":"+LAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,cAAY,sCAAsC,eAAa,GAAM,WAAS,GAAK,iBAAe,IAAI,EAAY,EAAcA,MAAY,CAAC,IAAI,EAAK,EACJ,OADmB,GAAU,CAAC,IACrO,EAAK,EAAK,QAAQ,sDAAsD,EAAE,EAAE,EAAK,EAAK,QAAQ,oBAAoB,EAAE,EAAE,EAAK,EAAK,QAAQ,oBAAoB,EAAE,EAAE,EAAK,EAAK,QAAQ,gBAAgB,EAAE,GAAU,CAAK,EAAE,CAAC,EAAY,EAAa,CAAQ,CAAC,EAE/F,OADzJ,MAAc,CAAC,GAAG,GAAuB,IAAS,OAAa,GAAG,CAC5C,SAAS,CAA0B,CAAC,CAAC,CAAE,OAAO,EAAM,CAAC,QAAQ,MAAM,mCAAmC,CAAK,CAAE,CAAE,EAAE,CAAC,CAAc,CAAC,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,SAAS,OAAO,SAAS,UAAU,EAAE,wBAAwB,CAAC,OAAO,CAAa,CAAC,CAAC,CAAE,qBANvQ,IAAoD,IAAqC,EAM+K,EAAoB,EAAa,CAAC,YAAY,CAAC,KAAK,EAAY,OAAO,MAAM,eAAe,aAAa,sCAAsC,gBAAgB,GAAK,YAAY,yBAAyB,EAAE,eAAe,CAAC,KAAK,EAAY,OAAO,MAAM,kBAAkB,aAAa,GAAG,gBAAgB,GAAK,YAAY,mCAAmC,EAAE,aAAa,CAAC,KAAK,EAAY,QAAQ,MAAM,gBAAgB,aAAa,GAAM,aAAa,UAAU,cAAc,UAAU,EAAE,SAAS,CAAC,KAAK,EAAY,QAAQ,MAAM,gBAAgB,aAAa,GAAK,aAAa,KAAK,cAAc,KAAK,CAAC,CAAC"}