import{bZ as e,d as o,a2 as t,X as s,p as n,a9 as a,j as u,ak as d,I as c,c as r,aZ as l,a0 as i,w as m,cH as p,$ as y,ct as f,a1 as v}from"./index-ip5gDR6L.js";import{P as b}from"./vnode-6FKeug3R.js";import{t as x}from"./index-fnD_mPvE.js";import{g as k}from"./scroll-ChxXkPhM.js";const M=o=>{if(!o)return{onClick:e,onMousedown:e,onMouseup:e};let t=!1,s=!1;return{onClick:e=>{t&&s&&o(e),t=s=!1},onMousedown:e=>{t=e.target===e.currentTarget},onMouseup:e=>{s=e.target===e.currentTarget}}},g=t({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:d([String,Array,Object])},zIndex:{type:d([String,Number])}});const w=o({name:"ElOverlay",props:g,emits:{click:e=>e instanceof MouseEvent},setup(e,{slots:o,emit:t}){const d=s("overlay"),{onClick:c,onMousedown:r,onMouseup:l}=M(e.customMaskEvent?void 0:e=>{t("click",e)});return()=>e.mask?n("div",{class:[d.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:c,onMousedown:r,onMouseup:l},[u(o,"default")],b.STYLE|b.CLASS|b.PROPS,["onClick","onMouseup","onMousedown"]):a("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[u(o,"default")])}}),C=(e,o={})=>{c(e)||x("[useLockscreen]","You need to pass a ref param to this function");const t=o.ns||s("popup"),n=r(()=>t.bm("parent","hidden"));if(!l||i(document.body,n.value))return;let a=0,u=!1,d="0";const b=()=>{setTimeout(()=>{"undefined"!=typeof document&&u&&document&&(document.body.style.width=d,v(document.body,n.value))},200)};m(e,e=>{if(!e)return void b();u=!i(document.body,n.value),u&&(d=document.body.style.width,y(document.body,n.value)),a=k(t.namespace.value);const o=document.documentElement.clientHeight<document.body.scrollHeight,s=f(document.body,"overflowY");a>0&&(o||"scroll"===s)&&u&&(document.body.style.width=`calc(100% - ${a}px)`)}),p(()=>b())};export{w as E,M as a,C as u};
