const e=require("../../config-provider/context.js"),t=require("../../_util/props-util/initDefaultProps.js"),n=require("../../locale/en_US.js"),r=require("../../locale/LocaleReceiver.js"),i=require("../ConfirmDialog.js");let a=require("vue");var o=(0,a.defineComponent)({name:`HookModal`,inheritAttrs:!1,props:t.default({config:Object,afterClose:Function,destroyAction:Function,open:Boolean},{config:{width:520,okType:`primary`}}),setup(t,{expose:o}){let s=(0,a.computed)(()=>t.open),c=(0,a.computed)(()=>t.config),{direction:l,getPrefixCls:u}=e.useConfigContextInject(),d=u(`modal`),f=u(),p=()=>{t?.afterClose(),c.value.afterClose?.()},m=(...e)=>{t.destroyAction(...e)};o({destroy:m});let h=c.value.okCancel??c.value.type===`confirm`,[g]=r.useLocaleReceiver(`Modal`,n.default.Modal);return()=>(0,a.createVNode)(i.default,{prefixCls:d,rootPrefixCls:f,...c.value,close:m,open:s.value,afterClose:p,okText:c.value.okText||(h?g?.value.okText:g?.value.justOkText),direction:c.value.direction||l.value,cancelText:c.value.cancelText||g?.value.cancelText},null)}});exports.default=o;