import{a2 as h,ap as G,a3 as M,G as u,o as i,c as P,a as C,ab as n,n as t,f as e,t as H,h as y,w as r,g as S,al as J,l as L,a7 as N,af as Y,a4 as Q,r as T,aa as W,aC as X,i as Z,U as _,av as x,v as ee,ai as oe}from"./index-25eb6331.js";import{u as se,E as ae,a as le}from"./index-db57f3ab.js";import{F as te,a as re,b as ne}from"./button-c2afb424.js";import{E as ie,_ as z,H as de,l as ce}from"./index-3bef6acb.js";import{d as fe,a as ue,b as pe,c as ge,u as ve}from"./overlay-25bb32bf.js";import{c as me}from"./refs-e3c707bd.js";const K=Symbol("dialogInjectionKey"),be=h({name:"ElDialogContent"}),Ce=h({...be,props:fe,emits:ue,setup(E,{expose:k}){const l=E,{t:w}=G(),{Close:d}=de,{dialogRef:c,headerRef:p,bodyId:f,ns:s,style:g}=M(K),{focusTrapRef:v}=M(te),R=u(()=>[s.b(),s.is("fullscreen",l.fullscreen),s.is("draggable",l.draggable),s.is("align-center",l.alignCenter),{[s.m("center")]:l.center}]),$=me(v,c),m=u(()=>l.draggable),A=u(()=>l.overflow),{resetPosition:D,updatePosition:I}=se(c,p,m,A);return k({resetPosition:D,updatePosition:I}),(a,b)=>(i(),P("div",{ref:e($),class:t(e(R)),style:N(e(g)),tabindex:"-1"},[C("header",{ref_key:"headerRef",ref:p,class:t([e(s).e("header"),a.headerClass,{"show-close":a.showClose}])},[n(a.$slots,"header",{},()=>[C("span",{role:"heading","aria-level":a.ariaLevel,class:t(e(s).e("title"))},H(a.title),11,["aria-level"])]),a.showClose?(i(),P("button",{key:0,"aria-label":e(w)("el.dialog.close"),class:t(e(s).e("headerbtn")),type:"button",onClick:B=>a.$emit("close")},[y(e(ie),{class:t(e(s).e("close"))},{default:r(()=>[(i(),S(J(a.closeIcon||e(d))))]),_:1},8,["class"])],10,["aria-label","onClick"])):L("v-if",!0)],2),C("div",{id:e(f),class:t([e(s).e("body"),a.bodyClass])},[n(a.$slots,"default")],10,["id"]),a.$slots.footer?(i(),P("footer",{key:0,class:t([e(s).e("footer"),a.footerClass])},[n(a.$slots,"footer")],2)):L("v-if",!0)],6))}});var ye=z(Ce,[["__file","dialog-content.vue"]]);const he=h({name:"ElDialog",inheritAttrs:!1}),Ee=h({...he,props:pe,emits:ge,setup(E,{expose:k}){const l=E,w=Y();ce({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"},u(()=>!!w.title));const d=Q("dialog"),c=T(),p=T(),f=T(),{visible:s,titleId:g,bodyId:v,style:R,overlayDialogStyle:$,rendered:m,zIndex:A,afterEnter:D,afterLeave:I,beforeLeave:a,handleClose:b,onModalClick:B,onOpenAutoFocus:O,onCloseAutoFocus:j,onCloseRequested:q,onFocusoutPrevented:U}=ve(l,c);W(K,{dialogRef:c,headerRef:p,bodyId:v,ns:d,rendered:m,style:R});const F=le(B),V=u(()=>l.draggable&&!l.fullscreen);return k({visible:s,dialogContentRef:f,resetPosition:()=>{var o;(o=f.value)==null||o.resetPosition()},handleClose:b}),(o,Re)=>(i(),S(e(ne),{to:o.appendTo,disabled:o.appendTo!=="body"?!1:!o.appendToBody},{default:r(()=>[y(X,{name:"dialog-fade",onAfterEnter:e(D),onAfterLeave:e(I),onBeforeLeave:e(a),persisted:""},{default:r(()=>[Z(y(e(ae),{"custom-mask-event":"",mask:o.modal,"overlay-class":o.modalClass,"z-index":e(A)},{default:r(()=>[C("div",{role:"dialog","aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e(g),"aria-describedby":e(v),class:t("".concat(e(d).namespace.value,"-overlay-dialog")),style:N(e($)),onClick:e(F).onClick,onMousedown:e(F).onMousedown,onMouseup:e(F).onMouseup},[y(e(re),{loop:"",trapped:e(s),"focus-start-el":"container",onFocusAfterTrapped:e(O),onFocusAfterReleased:e(j),onFocusoutPrevented:e(U),onReleaseRequested:e(q)},{default:r(()=>[e(m)?(i(),S(ye,_({key:0,ref_key:"dialogContentRef",ref:f},o.$attrs,{center:o.center,"align-center":o.alignCenter,"close-icon":o.closeIcon,draggable:e(V),overflow:o.overflow,fullscreen:o.fullscreen,"header-class":o.headerClass,"body-class":o.bodyClass,"footer-class":o.footerClass,"show-close":o.showClose,title:o.title,"aria-level":o.headerAriaLevel,onClose:e(b)}),x({header:r(()=>[o.$slots.title?n(o.$slots,"title",{key:1}):n(o.$slots,"header",{key:0,close:e(b),titleId:e(g),titleClass:e(d).e("title")})]),default:r(()=>[n(o.$slots,"default")]),_:2},[o.$slots.footer?{name:"footer",fn:r(()=>[n(o.$slots,"footer")])}:void 0]),1040,["center","align-center","close-icon","draggable","overflow","fullscreen","header-class","body-class","footer-class","show-close","title","aria-level","onClose"])):L("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,["aria-label","aria-labelledby","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["mask","overlay-class","z-index"]),[[ee,e(s)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var ke=z(Ee,[["__file","dialog.vue"]]);const Te=oe(ke);export{Te as E};
