import{_ as k}from"./preload-helper-ec9aa979.js";import{S as E,i as S,s as V,e as p,c as z,a as H,d as v,b as M,f as R,N as j,a8 as O,A as P,a9 as C,aa as I,ab as T,ac as b,ad as A,a0 as L}from"./vendor-f44913f5.js";function K(o){let t;return{c(){t=p("div"),this.h()},l(n){t=z(n,"DIV",{class:!0}),H(t).forEach(v),this.h()},h(){M(t,"class","w-full h-full")},m(n,f){R(n,t,f),o[7](t)},p:j,i:j,o:j,d(n){n&&v(t),o[7](null)}}}function U(o,t,n){const f=O();let{language:h="json"}=t,{value:r=""}=t,{isReadonly:c=!1}=t,{schema:g={type:"object"}}=t,{lineHighlight:m=!c}=t,{fontSize:_}=t,i,u=null,s;const y=()=>{i.layout()};function D(e){if(!i)return;const d=i.getPosition();i.setValue(e),i.setPosition(d)}P(async()=>{self.MonacoEnvironment={getWorker(l,a){return a==="json"?new C:a==="css"||a==="scss"||a==="less"?new I:a==="html"||a==="handlebars"||a==="razor"?new T:a==="typescript"||a==="javascript"?new b:new A}},s=await k(()=>import("./editor.main-cbfa99b0.js").then(function(l){return l.b}),["chunks/editor.main-cbfa99b0.js","assets/editor.main-200e01be.css"]);const e=await k(()=>import("./Monokai-89d42e8f.js"),[]);s.editor.defineTheme("monokai",e),s.editor.setTheme("monokai");const d=s.Uri.parse(`ds://${Date.now()}.json`),w=s.editor.createModel(r,"json",d);return s.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",schemas:[{uri:"https://datastore/schema.json",fileMatch:[d.toString()],schema:g},...s.languages.json.jsonDefaults._diagnosticsOptions.schemas]}),i=s.editor.create(u,{model:w,language:h,readOnly:c,minimap:{enabled:!1},renderLineHighlight:m===!1?"none":void 0,fontSize:_}),i.onDidContentSizeChange(y),y(),i.onKeyDown(function(l){l.ctrlKey&&l.keyCode===49&&(l.preventDefault(),n(1,r=i.getValue()),f("save",{value:r}))}),()=>{i.dispose()}});function W(e){L[e?"unshift":"push"](()=>{u=e,n(0,u)})}return o.$$set=e=>{"language"in e&&n(2,h=e.language),"value"in e&&n(1,r=e.value),"isReadonly"in e&&n(3,c=e.isReadonly),"schema"in e&&n(4,g=e.schema),"lineHighlight"in e&&n(5,m=e.lineHighlight),"fontSize"in e&&n(6,_=e.fontSize)},o.$$.update=()=>{o.$$.dirty&2&&D(r)},[u,r,h,c,g,m,_,W]}class N extends E{constructor(t){super();S(this,t,U,K,V,{language:2,value:1,isReadonly:3,schema:4,lineHighlight:5,fontSize:6})}}export{N as E};
