/** * tua-body-scroll-lock v1.4.1 * (c) 2024 Evinma, BuptStEve * @license MIT */var a=function(){return typeof window>"u"},c=function(r){r=r||navigator.userAgent;var e=/(iPad).*OS\s([\d_]+)/.test(r),n=!e&&/(iPhone\sOS)\s([\d_]+)/.test(r),i=/(Android);?[\s/]+([\d.]+)?/.test(r),s=n||e;return{ios:s,android:i}};function v(o){if(a())return!1;if(!o)throw new Error("options must be provided");var r=!1,e={get passive(){r=!0}},n=function(){},i="__TUA_BSL_TEST_PASSIVE__";window.addEventListener(i,n,e),window.removeEventListener(i,n,e);var s=o.capture;return r?o:typeof s<"u"?s:!1}var d=0,u=null,t=[];v({passive:!1});!a()&&"scrollBehavior"in document.documentElement.style;var l=function(r){if(!a()&&(d-=1,!(d>0))){if(!c().ios&&typeof u=="function"){u();return}if(r){var e=Array.isArray(r)?r:[r];e.forEach(function(n){var i=t.indexOf(n);i!==-1&&(n.ontouchmove=null,n.ontouchstart=null,t.splice(i,1))})}}},p=function(){if(!a()){if(d=0,!c().ios&&typeof u=="function"){u();return}if(t.length)for(var r=t.pop();r;)r.ontouchmove=null,r.ontouchstart=null,r=t.pop()}};export{p as c,l as u};