import{g as P,p as x,j as E,aa as b,J as y,L as D,n as w,bx as u,ae as r,o as d,ap as A,ai as F,cf as L,cO as I,R as S,an as O}from"./index-BRUnowC8.js";const R=x({fullscreen:Boolean,scrollable:Boolean,...F(L({captureFocus:!0,origin:"center center",scrollStrategy:"block",transition:{component:I},zIndex:2400,retainFocus:!0}),["disableInitialFocus"])},"VDialog"),H=P()({name:"VDialog",props:R(),emits:{"update:modelValue":e=>!0,afterEnter:()=>!0,afterLeave:()=>!0},setup(e,f){let{emit:c,slots:i}=f;const o=E(e,"modelValue"),{scopeId:v}=b(),a=y();function m(){c("afterEnter"),(e.scrim||e.retainFocus)&&a.value?.contentEl&&!a.value.contentEl.contains(document.activeElement)&&a.value.contentEl.focus({preventScroll:!0})}function g(){c("afterLeave")}return D(o,async l=>{l||(await S(),a.value.activatorEl?.focus({preventScroll:!0}))}),w(()=>{const l=u.filterProps(e),V=r({"aria-haspopup":"dialog"},e.activatorProps),h=r({tabindex:-1},e.contentProps);return d(u,r({ref:a,class:["v-dialog",{"v-dialog--fullscreen":e.fullscreen,"v-dialog--scrollable":e.scrollable},e.class],style:e.style},l,{modelValue:o.value,"onUpdate:modelValue":t=>o.value=t,"aria-modal":"true",activatorProps:V,contentProps:h,height:e.fullscreen?void 0:e.height,width:e.fullscreen?void 0:e.width,maxHeight:e.fullscreen?void 0:e.maxHeight,maxWidth:e.fullscreen?void 0:e.maxWidth,role:"dialog",onAfterEnter:m,onAfterLeave:g},v),{activator:i.activator,default:function(){for(var t=arguments.length,s=new Array(t),n=0;n<t;n++)s[n]=arguments[n];return d(O,{root:"VDialog"},{default:()=>[i.default?.(...s)]})}})}),A({},a)}});export{H as V};
