{"version":3,"file":"CustomScript_1.pigmJ6kp.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/f34JEXwXXvJC0q29reBA/my4Xkb7854raTtZIKyrZ/CustomScript_1.js"],"sourcesContent":["// Code Embed Component - Allows pasting custom scripts and HTML embeds in Framer\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Code Embed Component\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function CustomScript(props){const{scripts=[],htmlEmbed=\"\",embedContainerId=\"embed_container\",showPlaceholder=true,placeholderText=\"Custom scripts will load here\",placeholderColor=\"#666666\",placeholderBackground=\"#F5F5F5\"}=props;const[scriptsLoaded,setScriptsLoaded]=useState(false);const containerRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\"||scripts.length===0)return;const loadedScripts=[];scripts.forEach(scriptConfig=>{const script=document.createElement(\"script\");if(scriptConfig.id)script.id=scriptConfig.id;if(scriptConfig.src)script.src=scriptConfig.src;if(scriptConfig.type)script.type=scriptConfig.type;if(scriptConfig.async)script.async=true;if(scriptConfig.defer)script.defer=true;script.onload=()=>{startTransition(()=>setScriptsLoaded(true));};document.body.appendChild(script);loadedScripts.push(script);});return()=>{loadedScripts.forEach(script=>{if(script.parentNode){script.parentNode.removeChild(script);}});startTransition(()=>setScriptsLoaded(false));};},[scripts]);// Inject HTML embed\nuseEffect(()=>{if(typeof window===\"undefined\"||!htmlEmbed||!containerRef.current)return;containerRef.current.innerHTML=htmlEmbed;return()=>{if(containerRef.current){containerRef.current.innerHTML=\"\";}};},[htmlEmbed]);return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,id:embedContainerId,style:{width:\"100%\",height:\"100%\"}}),showPlaceholder&&!htmlEmbed&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:placeholderBackground,color:placeholderColor,borderRadius:8,padding:20,fontSize:14,fontFamily:\"system-ui, -apple-system, sans-serif\",textAlign:\"center\"},children:placeholderText})]});}addPropertyControls(CustomScript,{htmlEmbed:{type:ControlType.String,title:\"HTML Embed\",displayTextArea:true,placeholder:'<div id=\"ashby_embed\"></div>',defaultValue:\"\"},embedContainerId:{type:ControlType.String,title:\"Container ID\",defaultValue:\"embed_container\"},scripts:{type:ControlType.Array,title:\"Scripts\",control:{type:ControlType.Object,controls:{id:{type:ControlType.String,title:\"ID\",defaultValue:\"CustomScript\"},src:{type:ControlType.String,title:\"Source URL\",defaultValue:\"\",placeholder:\"https://example.com/script.js\"},type:{type:ControlType.String,title:\"Type\",defaultValue:\"text/javascript\"},async:{type:ControlType.Boolean,title:\"Async\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},defer:{type:ControlType.Boolean,title:\"Defer\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"}}},defaultValue:[{id:\"CookieDeclaration\",src:\"https://consent.cookiebot.com/1fad6d2d-f481-4470-b5a8-9ca871253be8/cd.js\",type:\"text/javascript\",async:true,defer:false}]},showPlaceholder:{type:ControlType.Boolean,title:\"Show Placeholder\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},placeholderText:{type:ControlType.String,title:\"Placeholder Text\",defaultValue:\"Custom scripts will load here\",hidden:({showPlaceholder})=>!showPlaceholder},placeholderColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#666666\",hidden:({showPlaceholder})=>!showPlaceholder},placeholderBackground:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5\",hidden:({showPlaceholder})=>!showPlaceholder}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomScript\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomScript_1.map"],"mappings":"gNASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,EAAE,CAAC,YAAU,GAAG,mBAAiB,kBAAkB,kBAAgB,GAAK,kBAAgB,gCAAgC,mBAAiB,UAAU,wBAAsB,WAAW,EAAW,CAAC,EAAc,GAAkBA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CACnH,OADoH,MAAc,CAAC,GAAU,IAAS,QAAa,EAAQ,SAAS,EAAE,OAAO,IAAM,EAAc,EAAE,CAA+a,OAA9a,EAAQ,QAAQ,GAAc,CAAC,IAAM,EAAO,SAAS,cAAc,SAAS,CAAI,EAAa,KAAG,EAAO,GAAG,EAAa,IAAM,EAAa,MAAI,EAAO,IAAI,EAAa,KAAO,EAAa,OAAK,EAAO,KAAK,EAAa,MAAQ,EAAa,QAAM,EAAO,MAAM,IAAQ,EAAa,QAAM,EAAO,MAAM,IAAK,EAAO,WAAW,CAAC,MAAoB,EAAiB,GAAK,CAAC,EAAG,SAAS,KAAK,YAAY,EAAO,CAAC,EAAc,KAAK,EAAO,EAAG,KAAW,CAAC,EAAc,QAAQ,GAAQ,CAAI,EAAO,YAAY,EAAO,WAAW,YAAY,EAAO,EAAI,CAAC,MAAoB,EAAiB,GAAM,CAAC,GAAK,CAAC,EAAQ,CAAC,CAChgC,MAAc,CAAI,KAAO,IAAS,QAAa,CAAC,GAAW,CAAC,EAAa,SAAwD,MAAzC,GAAa,QAAQ,UAAU,MAAoB,CAAI,EAAa,UAAS,EAAa,QAAQ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