import{B as a}from"./index158.js?v=20260328163632";import{u as e,l,v as t}from"./utils-lib.js?v=20260328163632";import{B as s}from"./naive-ui.js?v=20260328163632";import{k as i,a9 as n,ap as o,r as u,w as m,V as r,W as p,X as v,Z as d,Y as f,O as c,N as y,a3 as g,j as x,_ as h,a1 as V,F as b}from"./base-lib.js?v=20260328163632";const S={class:"text-[var(--text-color-2)]"},j=i({__name:"index",props:{modelValue:{default:"",type:String},modelModifiers:{},filename:{default:"",type:String},filenameModifiers:{},options:{default:[],type:Array},optionsModifiers:{},name:{default:"config",type:String},nameModifiers:{}},emits:["update:modelValue","update:filename","update:options","update:name"],setup(i){const{isWin:j,panel:w,getGlobalInfo:C,saveFileEvent:_,getFileEvent:F}=e(),{paths:M}=n(w.value),k=o(i,"modelValue"),B=o(i,"filename"),E=o(i,"options"),G=o(i,"name"),W=u(!1),A=u(""),I=async()=>{try{W.value=!0,await _({filename:j.value&&!B.value.includes("mongodb")?M.value.soft+"/"+B.value:B.value,data:A.value})}catch(a){}finally{W.value=!1}};return m((()=>[k.value,B.value]),(async([a,e])=>{a===G.value&&(M.value.soft||await C(),e&&(async()=>{try{W.value=!0;const{data:a,msg:e}=await F({filename:j.value&&!B.value.includes("mongodb")?M.value.soft+"/"+B.value:B.value});A.value=a||e}catch(a){}finally{W.value=!1}})())}),{immediate:!0}),(e,i)=>{const n=s;return r(),p(b,null,[v("div",S,d(f(l)("提示：Ctrl+F 搜索关键字，Ctrl+G 查找下一个，Ctrl+S 保存，Ctrl+Shift+R 查找替换!")),1),c(f(a),{modelValue:f(A),"onUpdate:modelValue":i[0]||(i[0]=a=>y(A)?A.value=a:null),style:{height:"350px"},class:"!h-[350px] w-[full] my-12px",onSave:I},null,8,["modelValue"]),c(n,{type:"primary",onClick:I},{default:g((()=>[x(d(f(l)("保存")),1)])),_:1}),E.value.length?(r(),h(f(t),{key:0,options:E.value,class:"!mt-[10px]"},null,8,["options"])):V("",!0)],64)}}});export{j as _};
