import{aB as v,C as b,a as m,D as h,bK as C,$ as w,_ as k,bL as M,a0 as g,j as x,aU as c,d as E,s as O,h as d,I as S,b as T,R as i}from"./index-B7nSi2no.js";import{g as B}from"./scroll-DLeu_baX.js";const Y=(e,t={})=>{v(e)||b("[useLockscreen]","You need to pass a ref param to this function");const s=t.ns||m("popup"),a=x(()=>s.bm("parent","hidden"));let l=0,n=!1,o="0",u=!1;const r=()=>{u||(u=!0,setTimeout(()=>{typeof document>"u"||n&&document&&(document.body.style.width=o,g(document.body,a.value))},200))};h(e,f=>{if(!f){r();return}u=!1,n=!w(document.body,a.value),n&&(o=document.body.style.width,k(document.body,a.value)),l=B(s.namespace.value);const y=document.documentElement.clientHeight0&&(y||p==="scroll")&&n&&(document.body.style.width=`calc(100% - ${l}px)`)}),C(()=>r())},I=e=>{if(!e)return{onClick:c,onMousedown:c,onMouseup:c};let t=!1,s=!1;return{onClick:o=>{t&&s&&e(o),t=s=!1},onMousedown:o=>{t=o.target===o.currentTarget},onMouseup:o=>{s=o.target===o.currentTarget}}},z=T({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:i([String,Array,Object])},zIndex:{type:i([String,Number])}}),H={click:e=>e instanceof MouseEvent},L="overlay";var N=E({name:"ElOverlay",props:z,emits:H,setup(e,{slots:t,emit:s}){const a=m(L),l=r=>{s("click",r)},{onClick:n,onMousedown:o,onMouseup:u}=I(e.customMaskEvent?void 0:l);return()=>e.mask?O("div",{class:[a.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:n,onMousedown:o,onMouseup:u},[d(t,"default")],14,["onClick","onMouseup","onMousedown"]):S("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[d(t,"default")])}});const j=N;export{j as E,I as a,Y as u};