import e from"../canUseDom.mjs";import{removeCSS as t,updateCSS as n}from"../../vc-util/Dom/dynamicCSS.mjs";import r from"../getScrollBarSize.mjs";import{computed as i,watchEffect as a}from"vue";var o=`vc-util-locker-${Date.now()}`,s=0;function c(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}function l(l){let u=i(()=>!!l&&!!l.value);s+=1;let d=`${o}_${s}`;a(i=>{if(e()){if(u.value){let e=r();n(`
html body {
  overflow-y: hidden;
  ${c()?`width: calc(100% - ${e}px);`:``}
}`,d)}else t(d);i(()=>{t(d)})}},{flush:`post`})}export{l as default,c as isBodyOverflowing};