import{a as d,b as l}from"./validator-util.99457e19.js";import{T as u,t as m,o as n,j as p}from"./codemirror-lib.512a46ff.js";import{_ as c}from"./index.9e59753f.js";import{ah as f,o as h,O as g,K as _}from"./vendor-vue.cefe3aef.js";function V(o,e,t){if(!e)return t();if(!d(e))return t(new Error("\u5FC5\u987B\u662Fjson"));let s=JSON.parse(e);l(s)?t():t(new Error("\u5FC5\u987B\u662Fobject\u5BF9\u8C61"))}const y={name:"CodeEditor",props:{value:{type:String,default:""},placeholder:{type:String,default:""},height:{type:String,default:"200px"},mode:{type:String,default:"json"}},components:{Codemirror:u},data(){return{}},computed:{value_:{get(){return this.value},set(o){this.$emit("update:value",o)}},editorStyle(){return{width:"100%",height:this.height,"font-size":"16px"}},extensions(){return this.mode=="twig"?[m(),n]:[p(),n]}},methods:{async getData(){}},created(){this.getData()}};function j(o,e,t,s,x,r){const a=f("codemirror");return h(),g(a,{modelValue:r.value_,"onUpdate:modelValue":e[0]||(e[0]=i=>r.value_=i),placeholder:t.placeholder,style:_(r.editorStyle),autofocus:!0,"indent-with-tab":!0,"tab-size":2,extensions:r.extensions},null,8,["modelValue","placeholder","style","extensions"])}const E=c(y,[["render",j]]);export{E as C,V as j};
