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