import{W as f,a as h,b as v,c as y}from"./ts.worker.921d436c.js";import{W as C,e as F}from"./toggleHighContrast.483b4227.js";import{d as x,h as s,ag as E,L as k,D as B,r as u,o as V,c as W,a as n,b as a,w as i,F as j,l as w}from"./index.e3896b23.js";const S={style:{height:"40px"}},L=n("span",{style:{"margin-left":"10px"}},"SQL\u53C2\u6570\u8BBE\u7F6E\uFF1A",-1),D=n("div",{id:"jsonCodeEditBox"},null,-1),$={style:{height:"40px",padding:"5px"}},A=w("\u683C\u5F0F\u5316"),O=x({__name:"json-studio",setup(N,{expose:l}){const d=s(""),c=s("json"),p=s("vs-dark");E(()=>{t.dispose(),console.log("editor dispose")}),k(()=>{_(),console.log("editor init")}),self.MonacoEnvironment={getWorker(o,e){return e==="json"?new f:e==="css"||e==="scss"||e==="less"?new h:e==="html"||e==="handlebars"||e==="razor"?new v:["typescript","javascript"].includes(e)?new y:new C}};let t=null;const _=()=>{B(()=>{t?t.setValue("{}"):t=F.create(document.getElementById("jsonCodeEditBox"),{value:d.value,language:c.value,automaticLayout:!0,theme:p.value,foldingStrategy:"indentation",renderLineHighlight:"all",selectOnLineNumbers:!0,minimap:{enabled:!1},cursorStyle:"line",readOnly:!1,fontSize:16,autoIndent:!0,useTabStops:!1,quickSuggestionsDelay:100,scrollBeyondLastLine:!1,overviewRulerBorder:!1}),t.setValue("{}")})},r=()=>{let o=t.getValue();t.trigger("anyString","editor.action.formatDocument"),t.setValue(o)};return l({setEditorValue:o=>{t.setValue(o)},getEditorValue:()=>t.getValue(),handleFormat:r}),(o,e)=>{const m=u("el-tooltip"),g=u("el-button");return V(),W(j,null,[n("div",S,[a(m,{class:"box-item",effect:"dark",content:"\u586B\u5199 sql \u8FD0\u884C\u9700\u8981\u7684\u53C2\u6570\u503C,\u62FC\u63A5\u6210 json \u683C\u5F0F, sql \u4E2A\u6570\u548C\u5BF9\u8C61\u53C2\u6570\u4E2A\u6570\u4FDD\u6301\u4E00\u81F4",placement:"top-end"},{default:i(()=>[L]),_:1})]),D,n("div",$,[a(g,{type:"primary",onClick:e[0]||(e[0]=I=>r()),round:""},{default:i(()=>[A]),_:1})])],64)}}});export{O as _};
