1import{r as a,D as d,o as l,v as u,e as m,f,az as v}from"#entry";const y={class:"script-injector"},j={__name:"ScriptInjector",props:{code:{type:String,required:!0},scriptId:{type:String,default:()=>`script-${Date.now()}-${Math.random().toString(36).substr(2,9)}`},executeImmediately:{type:Boolean,default:!0}},emits:["script-injected","script-removed","script-error"],setup(n,{expose:s,emit:p}){const t=n,c=p,r=a(null);d(()=>t.code,e=>{t.executeImmediately&&r.value&&o()}),l(()=>{t.executeImmediately&&o()}),u(()=>{i()});function o(){try{i();const e=document.createElement("script");e.id=t.scriptId,e.type="text/javascript",e.innerHTML=t.code,document.body.appendChild(e),r.value=e,c("script-injected",t.scriptId)}catch(e){c("script-error",e),console.error("Error injecting script:",e)}}function i(){const e=document.getElementById(t.scriptId);e&&e.remove(),r.value&&(r.value.remove(),r.value=null,c("script-removed",t.scriptId))}return s({injectScript:o,removeScript:i}),(e,I)=>(m(),f("div",y,[v(e.$slots,"default")]))}};export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.