import{Y as x,X as y,cJ as N,a3 as A,ae as M,E as _,A as b,B as o,b as l,n as S,S as e,G as d,Q as g,c as U,a8 as w,U as H,V as k,a4 as i}from"#entry";import{V as I,a as L}from"./DlybGOWB.js";import{V as R}from"./DArAxlee.js";import{V as z}from"./CdIepk1e.js";import{V as E}from"./DSnRMG2T.js";import{V as G}from"./D1vV9CHW.js";import{V as J}from"./DCaOoMt3.js";import"./BML-0xFj.js";import"./CIr4U5gS.js";import"./C1aoz2cp.js";import"./LWaCnj-p.js";import"./xGkJbl6f.js";import"./0VvUL2KS.js";import"./D_qxKlPu.js";import"./DCT0cttX.js";import"./CZqgYEd3.js";const Q=["innerHTML"],na={__name:"CoreDialog",setup(X){const{$on:V,$emit:v}=x(),{t:m}=y(),D=N("cancelBtn");A(()=>{V("confirmDialog",B),V("promptDialog",T)});const t=i("confirmDialog"),u=i(""),s=i(!1),r=i(""),C=i(""),c=i("");function B(a){t.value="confirmDialog",u.value=m(a.msg,a.args),c.value="",s.value=!0,M(()=>D.value?.$el?.focus())}function T(a){t.value="promptDialog",u.value=m(a.msg,a.args),c.value=m(a.title),C.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)=>(_(),b(J,{"model-value":e(s),"max-width":"550","onUpdate:modelValue":$},{default:o(()=>[l(I,{class:"border-0"},{default:o(()=>[l(L,{class:S({"bg-error":e(t)==="confirmDialog"})},{default:o(()=>[d(g(e(c)||a.$t("common.confirm")),1)]),_:1},8,["class"]),l(R,null,{default:o(()=>[U("div",{innerHTML:e(u)},null,8,Q),e(t)==="promptDialog"?(_(),b(z,{key:0,modelValue:e(r),"onUpdate:modelValue":n[0]||(n[0]=p=>w(r)?r.value=p:null),variant:"underlined",label:e(C)},null,8,["modelValue","label"])):H("",!0)]),_:1}),l(E,null,{default:o(()=>[l(k,{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(G),l(k,{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};
