{"version":3,"file":"ScriptInjector.MbdH72l3.mjs","names":[],"sources":["https:/framerusercontent.com/modules/FszPl0CsrNBmNK2hEgwW/riphQcVARTqWwH7CFwc9/ScriptInjector.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function ScriptInjector({scripts}){useEffect(()=>{const scriptElements=[];scripts.forEach(({code,src,async,defer,module,nomodule,type})=>{const script=document.createElement(\"script\");if(src)script.src=src;if(code)script.text=code;if(async)script.async=true;if(defer)script.defer=true;if(nomodule)script.noModule=true;script.type=module?\"module\":type||\"text/javascript\";document.body.appendChild(script);scriptElements.push(script);});return()=>{scriptElements.forEach(script=>{document.body.removeChild(script);});};},[scripts]);// Render a hidden div so the component can be placed in the canvas\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:0,height:0,overflow:\"hidden\"}});}addPropertyControls(ScriptInjector,{scripts:{title:\"Scripts\",type:ControlType.Array,propertyControl:{type:ControlType.Object,controls:{code:{type:ControlType.String,title:\"Inline Script\",placeholder:\"// Your inline JS code\",displayTextArea:true,defaultValue:\"// console.log('Inline script');\"},src:{type:ControlType.String,title:\"Script URL\",placeholder:\"https://example.com/script.js\"},async:{type:ControlType.Boolean,title:\"Async\",defaultValue:false},defer:{type:ControlType.Boolean,title:\"Defer\",defaultValue:false},module:{type:ControlType.Boolean,title:\"Module\",defaultValue:false},nomodule:{type:ControlType.Boolean,title:\"NoModule\",defaultValue:false},type:{type:ControlType.String,title:\"Type\",defaultValue:\"text/javascript\"}}},defaultValue:[{code:\"// console.log('Inline script executed');\",async:false,defer:true,module:false,nomodule:false,type:\"text/javascript\"}]}});\nexport const __FramerMetadata__ = {\"exports\":{\"ScriptInjector\":{\"type\":\"reactComponent\",\"name\":\"ScriptInjector\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScriptInjector.map"],"mappings":"0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