import{defineComponent as g,ref as d,watch as c,createVNode as t}from"vue";import v from"../_util/PortalWrapper.mjs";import C from"../_util/props-util/initDefaultProps.mjs";import{useProvidePortal as b}from"../vc-trigger/context.mjs";import n from"./Dialog.mjs";import P from"./IDialogPropTypes.mjs";const D=P(),R=g({compatConfig:{MODE:3},name:"DialogWrap",inheritAttrs:!1,props:C(D,{visible:!1}),setup(e,{attrs:f,slots:i}){const r=d(e.visible);return b({},{inTriggerContext:!1}),c(()=>e.visible,()=>{e.visible&&(r.value=!0)},{flush:"post"}),()=>{const{visible:s,getContainer:a,forceRender:l,destroyOnClose:u=!1,afterClose:m}=e;let o={...e,...f,ref:"_component",key:"dialog"};return a===!1?t(n,{...o,getOpenCount:()=>2},i):!l&&u&&!r.value?null:t(v,{autoLock:!0,visible:s,forceRender:l,getContainer:a},{default:p=>(o={...o,...p,afterClose:()=>{m?.(),r.value=!1}},t(n,o,i))})}}});export{R as default};
