const e=require("../_util/transition.js"),t=require("./IDialogPropTypes.js"),n=require("./util.js");let r=require("vue");var i={width:0,height:0,overflow:`hidden`,outline:`none`},a={outline:`none`},o=(0,r.defineComponent)({compatConfig:{MODE:3},name:`DialogContent`,inheritAttrs:!1,props:{...t.default(),motionName:String,ariaId:String,onVisibleChanged:Function,onMousedown:Function,onMouseup:Function},setup(t,{expose:o,slots:s,attrs:c}){let l=(0,r.ref)(),u=(0,r.ref)(),d=(0,r.ref)();o({focus:()=>{l.value?.focus({preventScroll:!0})},changeActive:e=>{let{activeElement:t}=document;e&&t===u.value?l.value.focus({preventScroll:!0}):!e&&t===l.value&&u.value.focus({preventScroll:!0})}});let f=(0,r.ref)(),p=(0,r.computed)(()=>{let{width:e,height:n}=t,r={};return e!==void 0&&(r.width=typeof e==`number`?`${e}px`:e),n!==void 0&&(r.height=typeof n==`number`?`${n}px`:n),f.value&&(r.transformOrigin=f.value),r}),m=()=>{(0,r.nextTick)(()=>{if(d.value){let e=n.offset(d.value);f.value=t.mousePosition?`${t.mousePosition.x-e.left}px ${t.mousePosition.y-e.top}px`:``}})},h=e=>{t.onVisibleChanged(e)};return()=>{let{prefixCls:n,footer:o=s.footer?.(),title:f=s.title?.(),ariaId:g,closable:_,closeIcon:v=s.closeIcon?.(),onClose:y,bodyStyle:b,bodyProps:x,onMousedown:S,onMouseup:C,visible:w,modalRender:T=s.modalRender,destroyOnClose:E,motionName:D}=t,O;o&&(O=(0,r.createVNode)(`div`,{class:`${n}-footer`},[o]));let k;f&&(k=(0,r.createVNode)(`div`,{class:`${n}-header`},[(0,r.createVNode)(`div`,{class:`${n}-title`,id:g},[f])]));let A;_&&(A=(0,r.createVNode)(`button`,{type:`button`,onClick:y,"aria-label":`Close`,class:`${n}-close`},[v||(0,r.createVNode)(`span`,{class:`${n}-close-x`},null)]));let j=(0,r.createVNode)(`div`,{class:`${n}-content`},[A,k,(0,r.createVNode)(`div`,{class:`${n}-body`,style:b,...x},[s.default?.()]),O]);return(0,r.createVNode)(r.Transition,{...e.getTransitionProps(D),onBeforeEnter:m,onAfterEnter:()=>h(!0),onAfterLeave:()=>h(!1)},{default:()=>[w||!E?(0,r.withDirectives)((0,r.createVNode)(`div`,{...c,ref:d,key:`dialog-element`,role:`document`,style:[p.value,c.style],class:[n,c.class],onMousedown:S,onMouseup:C},[(0,r.createVNode)(`div`,{tabindex:0,ref:l,style:a},[T?T({originVNode:j}):j]),(0,r.createVNode)(`div`,{tabindex:0,ref:u,style:i},null)]),[[r.vShow,w]]):null]})}}});exports.default=o;