import{objectType as e}from"../_util/type.mjs";import t from"../_util/warning.mjs";import n from"../_util/classNames.mjs";import r from"../_util/props-util/initDefaultProps.mjs";import{useLocaleReceiver as i}from"../locale/LocaleReceiver.mjs";import a from"../config-provider/hooks/useConfigInject.mjs";import o from"../vc-util/Dom/addEventListener.mjs";import s from"../_util/vue-types/index.mjs";import{getTransitionName as c}from"../_util/transition.mjs";import{convertLegacyProps as l}from"../button/buttonTypes.mjs";import u from"../button/index.mjs";import{canUseDocElement as d}from"../_util/styleChecker.mjs";import f from"../vc-dialog/index.mjs";import p from"./style/index.mjs";import{Fragment as m,createVNode as h,defineComponent as g}from"vue";import{CloseOutlined as _}from"@antsoo-lib/icons";var v;d()&&o(document.documentElement,`click`,e=>{v={x:e.pageX,y:e.pageY},setTimeout(()=>v=null,100)},!0);var y=()=>({prefixCls:String,visible:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},confirmLoading:{type:Boolean,default:void 0},title:s.any,closable:{type:Boolean,default:void 0},closeIcon:s.any,onOk:Function,onCancel:Function,"onUpdate:visible":Function,"onUpdate:open":Function,onChange:Function,afterClose:Function,centered:{type:Boolean,default:void 0},width:[String,Number],footer:s.any,okText:s.any,okType:String,cancelText:s.any,icon:s.any,maskClosable:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},okButtonProps:e(),cancelButtonProps:e(),destroyOnClose:{type:Boolean,default:void 0},wrapClassName:String,maskTransitionName:String,transitionName:String,getContainer:{type:[String,Function,Boolean,Object],default:void 0},zIndex:Number,bodyStyle:e(),maskStyle:e(),mask:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},wrapProps:Object,focusTriggerAfterClose:{type:Boolean,default:void 0},modalRender:Function,mousePosition:e()}),b=g({compatConfig:{MODE:3},name:`AModal`,inheritAttrs:!1,props:r(y(),{width:520,confirmLoading:!1,okType:`primary`}),setup(e,{emit:r,slots:o,attrs:s}){let[d]=i(`Modal`),{prefixCls:g,rootPrefixCls:y,direction:b,getPopupContainer:x}=a(`modal`,e),[S,C]=p(g);t(e.visible===void 0,`Modal`,"`visible` will be removed in next major version, please use `open` instead.");let w=e=>{r(`update:visible`,!1),r(`update:open`,!1),r(`cancel`,e),r(`change`,!1)},T=e=>{r(`ok`,e)},E=()=>{let{okText:t=o.okText?.(),okType:n,cancelText:r=o.cancelText?.(),confirmLoading:i}=e;return h(m,null,[h(u,{onClick:w,...e.cancelButtonProps},{default:()=>[r||d.value.cancelText]}),h(u,{...l(n),loading:i,onClick:T,...e.okButtonProps},{default:()=>[t||d.value.okText]})])};return()=>{let{prefixCls:t,visible:r,open:i,wrapClassName:a,centered:l,getContainer:u,closeIcon:d=o.closeIcon?.(),focusTriggerAfterClose:p=!0,...m}=e,T=n(a,{[`${g.value}-centered`]:!!l,[`${g.value}-wrap-rtl`]:b.value===`rtl`});return S(h(f,{...m,...s,rootClassName:C.value,class:n(C.value,s.class),getContainer:u||x?.value,prefixCls:g.value,wrapClassName:T,visible:i??r,onClose:w,focusTriggerAfterClose:p,transitionName:c(y.value,`zoom`,e.transitionName),maskTransitionName:c(y.value,`fade`,e.maskTransitionName),mousePosition:m.mousePosition??v},{...o,footer:o.footer||E,closeIcon:()=>h(`span`,{class:`${g.value}-close-x`},[d||h(_,{class:`${g.value}-close-icon`},null)])}))}}});export{b as default,y as modalProps};