"use strict";(self["webpackChunkmi_wifi_agent"]=self["webpackChunkmi_wifi_agent"]||[]).push([[6570],{6570:function(e,t,i){i.r(t),i.d(t,{default:function(){return p}});var n=i(641),a=i(2644),r=i(9322);function o(e,t,i,o,u,h){return(0,n.uX)(),(0,n.CE)("div",{class:"sc-code-editor",style:(0,a.Tr)({height:h._height})},[(0,n.bo)((0,n.Lk)("textarea",{ref:"textarea","onUpdate:modelValue":t[0]||(t[0]=e=>u.contentValue=e)},null,512),[[r.Jo,u.contentValue]])],4)}var u=i(9841),h=i(5237),l=i.n(h),s=(i(436),i(6792),i(9532),{props:{modelValue:{type:String,default:""},mode:{type:String,default:"javascript"},height:{type:[String,Number],default:300},options:{type:Object,default:()=>{}},theme:{type:String,default:"idea"},readOnly:{type:Boolean,default:!1}},data(){return{contentValue:this.modelValue,coder:null,opt:{theme:this.theme,styleActiveLine:!0,lineNumbers:!0,lineWrapping:!1,tabSize:4,indentUnit:4,indentWithTabs:!0,mode:this.mode,readOnly:this.readOnly,...this.options}}},computed:{_height(){return Number(this.height)?Number(this.height)+"px":this.height}},watch:{modelValue(e){this.contentValue=e,e!==this.coder.getValue()&&this.coder.setValue(e)}},mounted(){this.init()},methods:{init(){this.coder=(0,u.IG)(l().fromTextArea(this.$refs.textarea,this.opt)),this.coder.on("change",(e=>{this.contentValue=e.getValue(),this.$emit("update:modelValue",this.contentValue)}))},formatStrInJson(e){return JSON.stringify(JSON.parse(e),null,4)}}}),d=i(6262);const c=(0,d.A)(s,[["render",o],["__scopeId","data-v-a0186eba"]]);var p=c}}]);