const e=require("./vue-types/index.js"),t=require("../vc-trigger/context.js");let n=require("vue");var r=(0,n.defineComponent)({compatConfig:{MODE:3},name:`Portal`,inheritAttrs:!1,props:{getContainer:e.default.func.isRequired,didUpdate:Function},setup(e,{slots:r}){let i=!0,a,{shouldRender:o}=t.useInjectPortal();function s(){o.value&&(a=e.getContainer())}(0,n.onBeforeMount)(()=>{i=!1,s()}),(0,n.onMounted)(()=>{a||s()});let c=(0,n.watch)(o,()=>{o.value&&!a&&(a=e.getContainer()),a&&c()});return(0,n.onUpdated)(()=>{(0,n.nextTick)(()=>{o.value&&e.didUpdate?.(e)})}),()=>o.value?i?r.default?.():a?(0,n.createVNode)(n.Teleport,{to:a},r):null:null}});exports.default=r;