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 s,l,r,t,n,u,d,i,o,p,c,_,b,m,v,g,x,f,y,h,w,D,j,$,U;return{setters:[e=>{s=e._},e=>{l=e._,r=e.fc,t=e.m},e=>{n=e._},e=>{u=e.k,d=e.R,i=e.a6,o=e.r,p=e.e,c=e.c,_=e.$,b=e.a8,m=e.a9,v=e.a0,g=e._,x=e.S,f=e.j,y=e.aa,h=e.N},e=>{w=e.u},e=>{D=e.g},e=>{j=e.a1,$=e.b,U=e.a6},null,null,null],execute:function(){const a={class:"w-240px"},k={class:"w-240px"},q={class:"w-240px"},R={class:"w-240px"},C={class:"ml-8px"};e("default",u({__name:"index",setup(e,{expose:u}){const{t:E}=d(),S=w(),{remoteList:L}=i(S),N=o(null),Z=p({sid:L.value.length>0?L.value[0].id:null,name:"",db_user:"",password:"",active:!1,ssl:""}),z=c((()=>L.value.map((e=>({label:`${e.ps} (${e.db_host})`,value:e.id}))))),A={name:{required:!0,message:E("Database.form.index_15"),trigger:["blur","change"]},db_user:{required:!0,message:E("Database.form.index_16"),trigger:["blur","change"]},password:{required:!0,message:E("Database.form.index_17"),trigger:["blur","change"]},sid:{trigger:"change",validator:(e,a)=>null!==a||new Error(E("Database.form.index_18"))}},B=e=>{Z.db_user=e},F=()=>{D()};return u({onConfirm:async()=>{try{await(N.value?.validate());const e=(()=>{const e=h(Z),{sid:a}=e;if(null===a)throw t.error(E("Database.form.index_18")),new Error(E("Database.form.index_18"));return{...e,sid:a,ps:e.name}})();await r(S.type,e),S.setRefresh(!0)}catch(e){console.warn(e)}}}),(e,r)=>{const t=$,u=j,d=n,i=U,o=l,p=s;return _(),b(p,{ref_key:"formRef",ref:N,model:x(Z),rules:A,class:"p-20px"},{default:m((()=>[v(u,{label:e.$t("Database.index_12"),path:"name"},{default:m((()=>[g("div",a,[v(t,{value:x(Z).name,"onUpdate:value":[r[0]||(r[0]=e=>x(Z).name=e),B],placeholder:e.$t("Database.form.index_2"),"input-props":{name:"name"}},null,8,["value","placeholder"])])])),_:1},8,["label"]),v(u,{label:e.$t("Database.index_13"),path:"db_user"},{default:m((()=>[g("div",k,[v(t,{value:x(Z).db_user,"onUpdate:value":r[1]||(r[1]=e=>x(Z).db_user=e),placeholder:"Database user","input-props":{name:"user"}},null,8,["value"])])])),_:1},8,["label"]),v(u,{label:e.$t("Database.index_14"),path:"password"},{default:m((()=>[g("div",q,[v(d,{value:x(Z).password,"onUpdate:value":r[2]||(r[2]=e=>x(Z).password=e),"input-props":{name:"password"}},null,8,["value"])])])),_:1},8,["label"]),v(u,{label:e.$t("Database.form.index_9"),path:"sid"},{default:m((()=>[g("div",R,[v(i,{value:x(Z).sid,"onUpdate:value":r[3]||(r[3]=e=>x(Z).sid=e),class:"server-select",options:x(z)},null,8,["value","options"])]),g("div",C,[v(o,{onClick:F},{default:m((()=>[f(y(e.$t("Database.form.index_10")),1)])),_:1})])])),_:1},8,["label"])])),_:1},8,["model"])}}}))}}}));
