import{U as b,u as f,ar as h,ae as C,F as w,as as k,at as c,b as M,i,d as g,y as x,r as m,T as O}from"./index-6f5315ad.js";import{t as S}from"./el-button-c8e39703.js";import{q as y,u as E,v as T,t as P}from"./base-60afcd29.js";import{h as z}from"./el-table-column-efcb6f94.js";import{P as d}from"./vnode-76677048.js";const j=(e,t={})=>{b(e)||S("[useLockscreen]","You need to pass a ref param to this function");const s=t.ns||f("popup"),n=h(()=>s.bm("parent","hidden"));if(!C||y(document.body,n.value))return;let l=0,a=!1,o="0";const r=()=>{setTimeout(()=>{P(document==null?void 0:document.body,n.value),a&&document&&(document.body.style.width=o)},200)};w(e,u=>{if(!u){r();return}a=!y(document.body,n.value),a&&(o=document.body.style.width),l=z(s.namespace.value);const p=document.documentElement.clientHeight<document.body.scrollHeight,v=E(document.body,"overflowY");l>0&&(p||v==="scroll")&&a&&(document.body.style.width=`calc(100% - ${l}px)`),T(document.body,n.value)}),k(()=>r())},B=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}}},I=M({mask:{type:Boolean,default:!0},customMaskEvent:{type:Boolean,default:!1},overlayClass:{type:i([String,Array,Object])},zIndex:{type:i([String,Number])}}),L={click:e=>e instanceof MouseEvent},H="overlay";var N=g({name:"ElOverlay",props:I,emits:L,setup(e,{slots:t,emit:s}){const n=f(H),l=u=>{s("click",u)},{onClick:a,onMousedown:o,onMouseup:r}=B(e.customMaskEvent?void 0:l);return()=>e.mask?x("div",{class:[n.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:a,onMousedown:o,onMouseup:r},[m(t,"default")],d.STYLE|d.CLASS|d.PROPS,["onClick","onMouseup","onMousedown"]):O("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[m(t,"default")])}});const q=N;export{q as E,j as a,B as u};
