import{l as p,e as k}from"./toggleHighContrast-D1cjJdpv.js";import{d as g,r as l,K as v,w as m,k as W,O as E,o as _,e as h,f as y,_ as B}from"./index-8C--RVV5.js";function C(e){return new Worker(""+new URL("editor.worker-BVwmgLrR.js",import.meta.url).href,{name:e==null?void 0:e.name})}function V(e){return new Worker(""+new URL("json.worker-BwvX8PuZ.js",import.meta.url).href,{name:e==null?void 0:e.name})}function R(e){return new Worker(""+new URL("css.worker-DvNUQFd1.js",import.meta.url).href,{name:e==null?void 0:e.name})}function U(e){return new Worker(""+new URL("html.worker-BJMlcbMU.js",import.meta.url).href,{name:e==null?void 0:e.name})}function j(e){return new Worker(""+new URL("ts.worker-CwG1rUES.js",import.meta.url).href,{name:e==null?void 0:e.name})}self.MonacoEnvironment={getWorker(e,r){return r==="json"?new V:r==="css"||r==="scss"||r==="less"?new R:r==="html"||r==="handlebars"||r==="razor"?new U:r==="typescript"||r==="javascript"?new j:new C}};p.typescript.typescriptDefaults.setEagerModelSync(!0);const M=g({__name:"BuilderEmbeddedCodeEditor",props:{language:{},variant:{},modelValue:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:r}){const o=l(null),u=l(null),s=new ResizeObserver(w);let n=null;const t=e,{modelValue:d,disabled:i}=v(t),c=r,f={full:{minimap:{enabled:!1}},minimal:{minimap:{enabled:!1},lineNumbers:"off",folding:!1}};m(i,a=>{if(a){n.updateOptions({readOnly:!0});return}n.updateOptions({readOnly:!1})}),m(d,a=>{n.getValue()!=a&&n.getModel().setValue(a)}),W(()=>{n=k.create(u.value,{value:d.value,language:t.language,...f[t.variant]}),n.getModel().onDidChangeContent(()=>{const a=n.getValue();c("update:modelValue",a)}),s.observe(o.value)});function w(){n.layout()}return E(()=>{n.dispose(),s.disconnect()}),(a,O)=>(_(),h("div",{ref_key:"rootEl",ref:o,class:"BuilderEmbeddedCodeEditor"},[y("div",{ref_key:"editorContainerEl",ref:u,class:"editorContainer"},null,512)],512))}}),N=B(M,[["__scopeId","data-v-b94ac34e"]]);export{N as default};
