import{ct as x,cm as y,cH as N,bw as w,bk as H,bB as C,X as k,cS as o,a3 as l,bm as M,c7 as e,a2 as d,c0 as g,W as S,aV as A,Y as I,V as _,bO as i}from"#entry";import{V as L,b as R}from"./RTCSF0Ks.js";import{V as U}from"./R1_j74h_.js";import{V as z}from"./CYzMxp8K.js";import{V as O}from"./BgQ5eU58.js";import{V as W}from"./VoZA954X.js";import{V as X}from"./B22rgjjN.js";import"./BKDgfSxC.js";import"./Cp3UUybv.js";import"./DmHQoNBb.js";import"./CEoxYnb5.js";import"./BbcaTmac.js";import"./BPHK4Dzs.js";import"./D_qxKlPu.js";import"./7nzMR1a0.js";import"./CAodMEV_.js";const Y=["innerHTML"],na={__name:"CoreDialog",setup(j){const{$on:V,$emit:v}=x(),{t:m}=y(),D=N("cancelBtn");w(()=>{V("confirmDialog",B),V("promptDialog",T)});const t=i("confirmDialog"),u=i(""),s=i(!1),r=i(""),b=i(""),c=i("");function B(a){t.value="confirmDialog",u.value=m(a.msg,a.args),c.value="",s.value=!0,H(()=>D.value?.$el?.focus())}function T(a){t.value="promptDialog",u.value=m(a.msg,a.args),c.value=m(a.title),b.value=a?.label?m(a.label):"",r.value=a?.value??"",s.value=!0}function f(a){s.value=!1,t.value==="confirmDialog"?v("confirmDialog:result",a):(v("promptDialog:result",a&&r.value),r.value="")}function $(a){!a&&s.value&&f(!1)}return(a,n)=>(C(),k(X,{"model-value":e(s),"max-width":"550","onUpdate:modelValue":$},{default:o(()=>[l(L,{class:"border-0"},{default:o(()=>[l(R,{class:M({"bg-error":e(t)==="confirmDialog"})},{default:o(()=>[d(g(e(c)||a.$t("common.confirm")),1)]),_:1},8,["class"]),l(U,null,{default:o(()=>[S("div",{innerHTML:e(u)},null,8,Y),e(t)==="promptDialog"?(C(),k(z,{key:0,modelValue:e(r),"onUpdate:modelValue":n[0]||(n[0]=p=>A(r)?r.value=p:null),variant:"underlined",label:e(b)},null,8,["modelValue","label"])):I("",!0)]),_:1}),l(O,null,{default:o(()=>[l(_,{ref_key:"cancelBtn",ref:D,variant:"flat",onClick:n[1]||(n[1]=p=>f(!1))},{default:o(()=>[d(g(a.$t("common.cancel")),1)]),_:1},512),l(W),l(_,{color:e(t)==="confirmDialog"?"error":"primary",variant:"outlined",onClick:n[2]||(n[2]=p=>f(!0))},{default:o(()=>[d(g(a.$t("common.ok")),1)]),_:1},8,["color"])]),_:1})]),_:1})]),_:1},8,["model-value"]))}};export{na as default};
