import{b as h,g as s,c as V,w as a,a as l,D as k,l as r,t as n,E as D,H as T,q as z,bb as L,o as b}from"./index-CTxlYqj4.js";import{V as S,a as B}from"./VToolbar-Cd2iSn8H.js";import{V as K,a as N,b as I}from"./VCard-DRptUN8Y.js";import{V as O}from"./VSpacer-BcQnH0oL.js";import{V as g}from"./VAvatar-x_79C0tA.js";import{V as $}from"./VDialog-DzctVbsK.js";const H={__name:"ConfirmDialog",props:{callback_agree:{type:Function,default:null}},setup(_,{expose:x}){const{$gettext:f}=h(),m=_,o=s(!1),c=s(""),p=s("");let u;const e=s({color:"primary",width:400,zIndex:2400,noconfirm:!1,cancelLabel:f("Cancel"),agreeLabel:f("OK")});function w(i,t,d){return o.value=!0,p.value=i,c.value=t,e.value=Object.assign(e.value,d),new Promise(C=>{u=C})}x({open:w});async function y(){m.callback_agree!==null&&!await m.callback_agree()||(u(!0),o.value=!1)}function v(){u(!1),o.value=!1}return(i,t)=>(b(),V($,{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=d=>o.value=d),"max-width":e.value.width,"z-index":e.value.zIndex,onKeydown:L(v,["esc"])},{default:a(()=>[l(I,null,{default:a(()=>[l(S,{color:e.value.color,density:"compact",flat:""},{default:a(()=>[l(B,{class:"text-body-2 font-weight-bold"},{default:a(()=>[r(n(p.value),1)]),_:1})]),_:1},8,["color"]),k(l(K,{class:"pa-4"},{default:a(()=>[r(n(c.value)+" ",1),T(i.$slots,"default")]),_:3},512),[[D,!!c.value]]),l(N,{class:"pt-3"},{default:a(()=>[l(O),e.value.noconfirm?z("",!0):(b(),V(g,{key:0,onClick:v},{default:a(()=>[r(n(e.value.cancelLabel),1)]),_:1})),l(g,{color:e.value.color,onClick:y},{default:a(()=>[r(n(e.value.agreeLabel),1)]),_:1},8,["color"])]),_:1})]),_:3})]),_:3},8,["modelValue","max-width","z-index"]))}};export{H as _};
