import{d as _,H as C,f as B,h as b,i as o,c as l,D as s,y as i,v as r,S as c,bR as g,bS as v,bT as x,B as T}from"./index-C5GbdPxY.js";import{c as y,V as h,a as D,b as k}from"./VCard-DptrO3GI.js";import{V as w}from"./VDialog-Dr29crN8.js";const S=_({__name:"ConfirmDialog",props:{modelValue:{type:Boolean},title:{},message:{},confirmButtonText:{},cancelButtonText:{},confirmColor:{}},emits:["update:modelValue","close"],setup(u,{emit:m}){const{t}=C(),e=m,a=()=>e("update:modelValue",!1),f=()=>{e("close",!0),a()},p=()=>{e("close",!1),a()};return(n,d)=>(b(),B(w,{"max-width":"400","model-value":n.modelValue,persistent:"","onUpdate:modelValue":d[0]||(d[0]=V=>e("update:modelValue",V))},{default:o(()=>[l(y,null,{default:o(()=>[l(h,{class:"text-h6 font-weight-bold"},{default:o(()=>[s(i(n.title||r(t)("admin::admin.default_confirmation.title")),1)]),_:1}),l(D,null,{default:o(()=>[s(i(n.message||r(t)("admin::admin.default_confirmation.message")),1)]),_:1}),l(k,{class:"justify-end"},{default:o(()=>[l(c,{color:"default",variant:"text",onClick:p},{default:o(()=>[s(i(n.cancelButtonText||r(t)("admin::admin.default_confirmation.cancel_button_text")),1)]),_:1}),l(c,{color:n.confirmColor||"primary",onClick:f},{default:o(()=>[s(i(n.confirmButtonText||r(t)("admin::admin.default_confirmation.confirm_button_text")),1)]),_:1},8,["color"])]),_:1})]),_:1})]),_:1},8,["model-value"]))}}),j=u=>new Promise(m=>{const t=document.createElement("div");document.body.append(t);const e=g({render(){return T(S,{modelValue:!0,...u,"onUpdate:modelValue":a=>{a||(e.unmount(),t.remove())},onClose:a=>{m(a),e.unmount(),t.remove()}})}});e.use(v),e.use(x),e.mount(t)});export{j as u};
