const e=require("../_util/omit.js"),t=require("../_util/vnode.js"),n=require("./locale.js"),r=require("../config-provider/index.js"),i=require("./ConfirmDialog.js"),a=require("./destroyFns.js");let o=require("vue");var s=s=>{let c=document.createDocumentFragment(),l={...e.default(s,[`parentContext`,`appContext`]),close:f,open:!0},u=null;function d(...e){u&&((0,o.render)(null,c),u=null);let t=e.some(e=>e&&e.triggerCancel);s.onCancel&&t&&s.onCancel(()=>{},...e.slice(1));for(let e=0;e<a.default.length;e++)if(a.default[e]===f){a.default.splice(e,1);break}}function f(...e){l={...l,open:!1,afterClose:()=>{typeof s.afterClose==`function`&&s.afterClose(),d.apply(this,e)}},l.visible&&delete l.visible,p(l)}function p(e){l=typeof e==`function`?e(l):{...l,...e},u&&t.triggerVNodeUpdate(u,l,c)}let m=e=>{let t=r.globalConfigForApi,a=t.prefixCls,s=e.prefixCls||`${a}-modal`,c=t.iconPrefixCls,l=n.getConfirmLocale();return(0,o.createVNode)(r.default,{...t,prefixCls:a},{default:()=>[(0,o.createVNode)(i.default,{...e,rootPrefixCls:a,prefixCls:s,iconPrefixCls:c,locale:l,cancelText:e.cancelText||l.cancelText},null)]})};function h(e){let t=(0,o.createVNode)(m,{...e});return t.appContext=s.parentContext||s.appContext||t.appContext,(0,o.render)(t,c),t}return u=h(l),a.default.push(f),{destroy:f,update:p}};function c(e){return{...e,type:`warning`}}function l(e){return{...e,type:`info`}}function u(e){return{...e,type:`success`}}function d(e){return{...e,type:`error`}}function f(e){return{...e,type:`confirm`}}exports.default=s,exports.withConfirm=f,exports.withError=d,exports.withInfo=l,exports.withSuccess=u,exports.withWarn=c;