System.register(["./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BSBh0Le2.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./index-legacy-y1mYB81o.js?v=1773287522785","./index-legacy-CDUlQ1jh.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./index-legacy-DGWsVoxN.js?v=1773287522785","./index-legacy-DWPn48Vb.js?v=1773287522785"],(function(e,a){"use strict";var l,s,t,r,n,d,u,i,o,_,c,p,b,v,g,x,m,f,h,y,w,D,j,$,U,k,q;return{setters:[e=>{l=e._},e=>{s=e._,t=e.fc,r=e.m},e=>{n=e._},e=>{d=e.k,u=e.R,i=e.a6,o=e.r,_=e.e,c=e.c,p=e.$,b=e.a8,v=e.a9,g=e.a0,x=e._,m=e.S,f=e.l,h=e.v,y=e.j,w=e.aa,D=e.N},e=>{j=e.u},e=>{$=e.g},e=>{U=e.a1,k=e.b,q=e.a6},null,null,null],execute:function(){const a={class:"w-240px"},R={class:"w-240px"},C={class:"w-240px"},E={class:"w-240px"},S={class:"ml-8px"};e("default",d({__name:"index",props:{data:{}},setup(e,{expose:d}){const{t:L}=u(),N=e,{status:Z}=N.data,z=j(),{remoteList:A}=i(z),B=o(null),F=_({sid:A.value.length>0?A.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),G=c((()=>A.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),H={name:{required:!0,message:L("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:L("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:L("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(L("Database.tools.index_64"))}},I=e=>{F.db_user=e},J=()=>{$()};return d({onConfirm:async({hide:e})=>{try{await(B.value?.validate());const a=(()=>{const{sid:e}=F;if(null===e)throw r.error(L("Database.tools.index_64")),new Error(L("Database.tools.index_64"));return{...D(F),sid:e,ps:F.name}})();await t(z.type,a),z.setRefresh(!0),e()}catch(a){console.error(a)}}}),(e,t)=>{const r=k,d=U,u=n,i=q,o=s,_=l;return p(),b(_,{ref_key:"formRef",ref:B,model:m(F),rules:H,class:"p-20px"},{default:v((()=>[g(d,{label:e.$t("Database.index_12"),path:"name"},{default:v((()=>[x("div",a,[g(r,{value:m(F).name,"onUpdate:value":[t[0]||(t[0]=e=>m(F).name=e),I],placeholder:e.$t("Database.form.index_2")},null,8,["value","placeholder"])])])),_:1},8,["label"]),f(g(d,{label:e.$t("Database.index_13"),path:"db_user"},{default:v((()=>[x("div",R,[g(r,{value:m(F).db_user,"onUpdate:value":t[1]||(t[1]=e=>m(F).db_user=e),placeholder:e.$t("Database.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"]),[[h,m(Z)]]),f(g(d,{label:e.$t("Database.index_14"),path:"password"},{default:v((()=>[x("div",C,[g(u,{value:m(F).password,"onUpdate:value":t[2]||(t[2]=e=>m(F).password=e)},null,8,["value"])])])),_:1},8,["label"]),[[h,m(Z)]]),g(d,{label:e.$t("Database.form.index_9"),path:"sid"},{default:v((()=>[x("div",E,[g(i,{value:m(F).sid,"onUpdate:value":t[3]||(t[3]=e=>m(F).sid=e),options:m(G)},null,8,["value","options"])]),x("div",S,[g(o,{onClick:J},{default:v((()=>[y(w(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
