import{cM as _,cN as J,cO as $e,cP as re,cB as X,cQ as je,cR as ie,cS as U,cT as ce,bM as Ie,aY as Ee,cU as we,cV as Be,cW as Fe,cX as Oe,b_ as De,cY as Le,a6 as Me,ap as ue,ab as Pe,f as G,ac as ke,O as Q,cf as Re,y as F,cZ as Ne,o as O,c as q,a as R,R as w,a2 as S,k as t,t as Ue,b as N,w as E,m as Y,a1 as _e,B as Ge,n as Z,a4 as de,_ as fe,c_ as Ve,aq as H,af as ge,aJ as Ke,bA as qe,ax as x,r as B,c$ as ze,d0 as Ye,bw as Ze,d1 as Je,W as ee,X as We,C as Xe,a5 as Qe,ci as oe,aE as He,bk as xe,c5 as te,N as eo,S as oo,$ as to,d2 as ao,d3 as no,bJ as so,bZ as lo,a0 as ro,bm as io,bG as co,d4 as uo,ar as fo}from"./entry.b59333b6.js";import{k as be,g as ye,s as go,a as bo,b as yo,c as W,d as po,i as mo}from"./isUndefined.00def29e.js";function vo(e,o){for(var a=-1,g=e==null?0:e.length;++ao=>{e.forEach(a=>{Me(a)?a(o):a.value=o})},Ce=Symbol("dialogInjectionKey"),Ae=ue({center:Boolean,alignCenter:Boolean,closeIcon:{type:Pe},customClass:{type:String,default:""},draggable:Boolean,fullscreen:Boolean,showClose:{type:Boolean,default:!0},title:{type:String,default:""},ariaLevel:{type:String,default:"2"}}),Mt={close:()=>!0},Pt=["aria-level"],kt=["aria-label"],Rt=["id"],Nt=G({name:"ElDialogContent"}),Ut=G({...Nt,props:Ae,emits:Mt,setup(e){const o=e,{t:a}=ke(),{Close:g}=Ve,{dialogRef:c,headerRef:u,bodyId:l,ns:r,style:b}=Q(Ce),{focusTrapRef:f}=Q(Re),v=F(()=>[r.b(),r.is("fullscreen",o.fullscreen),r.is("draggable",o.draggable),r.is("align-center",o.alignCenter),{[r.m("center")]:o.center},o.customClass]),d=Lt(f,c),C=F(()=>o.draggable);return Ne(c,u,C),(i,y)=>(O(),q("div",{ref:t(d),class:S(t(v)),style:de(t(b)),tabindex:"-1"},[R("header",{ref_key:"headerRef",ref:u,class:S(t(r).e("header"))},[w(i.$slots,"header",{},()=>[R("span",{role:"heading","aria-level":i.ariaLevel,class:S(t(r).e("title"))},Ue(i.title),11,Pt)]),i.showClose?(O(),q("button",{key:0,"aria-label":t(a)("el.dialog.close"),class:S(t(r).e("headerbtn")),type:"button",onClick:y[0]||(y[0]=$=>i.$emit("close"))},[N(t(Ge),{class:S(t(r).e("close"))},{default:E(()=>[(O(),Y(_e(i.closeIcon||t(g))))]),_:1},8,["class"])],10,kt)):Z("v-if",!0)],2),R("div",{id:t(l),class:S(t(r).e("body"))},[w(i.$slots,"default")],10,Rt),i.$slots.footer?(O(),q("footer",{key:0,class:S(t(r).e("footer"))},[w(i.$slots,"footer")],2)):Z("v-if",!0)],6))}});var _t=fe(Ut,[["__file","dialog-content.vue"]]);const Gt=ue({...Ae,appendToBody:Boolean,appendTo:{type:H(String),default:"body"},beforeClose:{type:H(Function)},destroyOnClose:Boolean,closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},top:{type:String},modelValue:Boolean,modalClass:String,width:{type:[String,Number]},zIndex:{type:Number},trapFocus:{type:Boolean,default:!1},headerAriaLevel:{type:String,default:"2"}}),Vt={open:()=>!0,opened:()=>!0,close:()=>!0,closed:()=>!0,[ge]:e=>Ke(e),openAutoFocus:()=>!0,closeAutoFocus:()=>!0},Kt=(e,o)=>{var a;const c=Qe().emit,{nextZIndex:u}=qe();let l="";const r=x(),b=x(),f=B(!1),v=B(!1),d=B(!1),C=B((a=e.zIndex)!=null?a:u());let i,y;const $=ze("namespace",Ye),p=F(()=>{const m={},I=`--${$.value}-dialog`;return e.fullscreen||(e.top&&(m[`${I}-margin-top`]=e.top),e.width&&(m[`${I}-width`]=Ze(e.width))),m}),T=F(()=>e.alignCenter?{display:"flex"}:{});function M(){c("opened")}function V(){c("closed"),c(ge,!1),e.destroyOnClose&&(d.value=!1)}function K(){c("close")}function P(){y==null||y(),i==null||i(),e.openDelay&&e.openDelay>0?{stop:i}=oe(()=>k(),e.openDelay):k()}function D(){i==null||i(),y==null||y(),e.closeDelay&&e.closeDelay>0?{stop:y}=oe(()=>n(),e.closeDelay):n()}function L(){function m(I){I||(v.value=!0,f.value=!1)}e.beforeClose?e.beforeClose(m):D()}function A(){e.closeOnClickModal&&L()}function k(){He&&(f.value=!0)}function n(){f.value=!1}function h(){c("openAutoFocus")}function j(){c("closeAutoFocus")}function he(m){var I;((I=m.detail)==null?void 0:I.focusReason)==="pointer"&&m.preventDefault()}e.lockScroll&&Je(f);function Se(){e.closeOnPressEscape&&L()}return ee(()=>e.modelValue,m=>{m?(v.value=!1,P(),d.value=!0,C.value=mo(e.zIndex)?u():C.value++,We(()=>{c("open"),o.value&&(o.value.scrollTop=0)})):f.value&&D()}),ee(()=>e.fullscreen,m=>{o.value&&(m?(l=o.value.style.transform,o.value.style.transform=""):o.value.style.transform=l)}),Xe(()=>{e.modelValue&&(f.value=!0,d.value=!0,P())}),{afterEnter:M,afterLeave:V,beforeLeave:K,handleClose:L,onModalClick:A,close:D,doClose:n,onOpenAutoFocus:h,onCloseAutoFocus:j,onCloseRequested:Se,onFocusoutPrevented:he,titleId:r,bodyId:b,closed:v,style:p,overlayDialogStyle:T,rendered:d,visible:f,zIndex:C}},qt=["aria-label","aria-labelledby","aria-describedby"],zt=G({name:"ElDialog",inheritAttrs:!1}),Yt=G({...zt,props:Gt,emits:Vt,setup(e,{expose:o}){const a=e,g=xe();te({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},F(()=>!!g.title)),te({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},F(()=>!!a.customClass));const c=eo("dialog"),u=B(),l=B(),r=B(),{visible:b,titleId:f,bodyId:v,style:d,overlayDialogStyle:C,rendered:i,zIndex:y,afterEnter:$,afterLeave:p,beforeLeave:T,handleClose:M,onModalClick:V,onOpenAutoFocus:K,onCloseAutoFocus:P,onCloseRequested:D,onFocusoutPrevented:L}=Kt(a,u);oo(Ce,{dialogRef:u,headerRef:l,bodyId:v,ns:c,rendered:i,style:d});const A=uo(V),k=F(()=>a.draggable&&!a.fullscreen);return o({visible:b,dialogContentRef:r}),(n,h)=>(O(),Y(co,{to:n.appendTo,disabled:n.appendTo!=="body"?!1:!n.appendToBody},[N(io,{name:"dialog-fade",onAfterEnter:t($),onAfterLeave:t(p),onBeforeLeave:t(T),persisted:""},{default:E(()=>[to(N(t(ao),{"custom-mask-event":"",mask:n.modal,"overlay-class":n.modalClass,"z-index":t(y)},{default:E(()=>[R("div",{role:"dialog","aria-modal":"true","aria-label":n.title||void 0,"aria-labelledby":n.title?void 0:t(f),"aria-describedby":t(v),class:S(`${t(c).namespace.value}-overlay-dialog`),style:de(t(C)),onClick:h[0]||(h[0]=(...j)=>t(A).onClick&&t(A).onClick(...j)),onMousedown:h[1]||(h[1]=(...j)=>t(A).onMousedown&&t(A).onMousedown(...j)),onMouseup:h[2]||(h[2]=(...j)=>t(A).onMouseup&&t(A).onMouseup(...j))},[N(t(no),{loop:"",trapped:t(b),"focus-start-el":"container",onFocusAfterTrapped:t(K),onFocusAfterReleased:t(P),onFocusoutPrevented:t(L),onReleaseRequested:t(D)},{default:E(()=>[t(i)?(O(),Y(_t,so({key:0,ref_key:"dialogContentRef",ref:r},n.$attrs,{"custom-class":n.customClass,center:n.center,"align-center":n.alignCenter,"close-icon":n.closeIcon,draggable:t(k),fullscreen:n.fullscreen,"show-close":n.showClose,title:n.title,"aria-level":n.headerAriaLevel,onClose:t(M)}),lo({header:E(()=>[n.$slots.title?w(n.$slots,"title",{key:1}):w(n.$slots,"header",{key:0,close:t(M),titleId:t(f),titleClass:t(c).e("title")})]),default:E(()=>[w(n.$slots,"default")]),_:2},[n.$slots.footer?{name:"footer",fn:E(()=>[w(n.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","aria-level","onClose"])):Z("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,qt)]),_:3},8,["mask","overlay-class","z-index"]),[[ro,t(b)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["to","disabled"]))}});var Zt=fe(Yt,[["__file","dialog.vue"]]);const Xt=fo(Zt);export{Xt as E,z as b,Lt as c};