import{At as e,Cn as t,Ft as n,Ht as r,J as i,Jt as a,Q as o,V as s,Wt as c,X as l,c as u,cn as d,dn as f,et as p,fn as m,gt as h,q as g,tt as _,ut as v,wt as y}from"./DRAiiyBy.mjs";import"./xihTtKlq.mjs";import{C as b,T as x,h as ee,o as te,p as S,y as C}from"./BUpDfg0N.mjs";import{m as w,p as T,t as E}from"./CdCBgqjH.mjs";import"./B4Eeq2EV.mjs";import{i as ne}from"./Cq8TXS2C.mjs";import{n as D,r as O}from"./BMmfFUzX.mjs";import{a as re,o as ie,r as ae,t as oe}from"./egWlagUo.mjs";function se(e,t){return setTimeout(t,e)}var ce=1,le=9,ue=11;function k(e){return x(e)&&e.nodeType===ce&&typeof e.nodeName==`string`}function de(e){return x(e)&&e.nodeType===le}function fe(e){return x(e)&&e.constructor?.name===`VisualViewport`}function pe(e){return x(e)&&e.nodeType!==void 0}function me(e){return pe(e)&&e.nodeType===ue&&`host`in e}function he(e,t){if(!e||!t||!k(e)||!k(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&me(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function A(e){return de(e)?e:fe(e)?e.document:e?.ownerDocument??document}function j(e){return me(e)?j(e.host):de(e)?e.defaultView??window:k(e)?e.ownerDocument?.defaultView??window:window}function ge(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var M=class{element;#e=a(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return h(this.#e)}set root(e){r(this.#e,e)}constructor(e){this.element=typeof e==`function`?C(e):e}getDocument=()=>A(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>ge(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function _e(e,r){var i=_(),a=n(i);g(a,()=>r.children,e=>{var i=_(),a=n(i);s(a,()=>r.children??t),p(e,i)}),p(e,i)}var N=new w(`BitsConfig`);function ve(){let e=new P(null,{});return N.getOr(e).opts}function ye(e){return N.set(new P(N.getOr(null),e))}var P=class{opts;constructor(e,t){let n=be(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function be(e,t){return n=>C(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function F(e,t){return n=>{let r=ve();return C(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var xe=F(e=>e.defaultLocale,`en`),Se=F(e=>e.defaultPortalTo,`body`);function Ce(e,r){m(r,!0);let c=Se(()=>r.to),u=d(),g=a(v);function v(){if(!oe||r.disabled)return null;let e=null;return e=typeof c.current==`string`?document.querySelector(c.current):c.current,e}let y;function b(){y&&=(o(y),null)}T([()=>h(g),()=>r.disabled],([e,t])=>{if(!e||t)b();else return y=l(_e,{target:e,props:{children:r.children},context:u}),()=>{b()}});var x=_(),ee=n(x),te=e=>{var i=_(),a=n(i);s(a,()=>r.children??t),p(e,i)};i(ee,e=>{r.disabled&&e(te)}),p(e,x),f()}var we=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return v(e,this.eventName,e=>{t(e)},n)}};function I(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function L(e,t){return e===t||e.contains(t)}function R(e){return e?.ownerDocument??document}function Te(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return ni.right||ri.bottom}var z=[`input:not([inert])`,`select:not([inert])`,`textarea:not([inert])`,`a[href]:not([inert])`,`button:not([inert])`,`[tabindex]:not(slot):not([inert])`,`audio[controls]:not([inert])`,`video[controls]:not([inert])`,`[contenteditable]:not([contenteditable="false"]):not([inert])`,`details>summary:first-of-type:not([inert])`,`details:not([inert])`],B=z.join(`,`),Ee=typeof Element>`u`,V=Ee?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,H=!Ee&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},U=function e(t,n){n===void 0&&(n=!0);var r=t?.getAttribute?.call(t,`inert`);return r===``||r===`true`||n&&t&&e(t.parentNode)},De=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Oe=function(e,t,n){if(U(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(B));return t&&V.call(e,B)&&r.unshift(e),r=r.filter(n),r},ke=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!U(o,!1)){if(o.tagName===`SLOT`){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{V.call(o,B)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var l=o.shadowRoot||typeof r.getShadowRoot==`function`&&r.getShadowRoot(o),u=!U(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(l===!0?o.children:l.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}}return i},Ae=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},je=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||De(e))&&!Ae(e)?0:e.tabIndex},Me=function(e,t){var n=je(e);return n<0&&t&&!Ae(e)?0:n},Ne=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Pe=function(e){return e.tagName===`INPUT`},Fe=function(e){return Pe(e)&&e.type===`hidden`},Ie=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Le=function(e,t){for(var n=0;nsummary:first-of-type`)?e.parentElement:e;if(V.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=H(e);if(o&&!o.shadowRoot&&r(o)===!0)return He(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Ve(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return He(e);return!1},We=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n=0)},Ke=function e(t){var n=[],r=[];return t.forEach(function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=Me(o,a),c=a?e(t.candidates):o;s===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:c})}),r.sort(Ne).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},qe=function(e,t){return t||={},Ke(t.getShadowRoot?ke([e],t.includeContainer,{filter:G.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ge}):Oe(e,t.includeContainer,G.bind(null,t)))},Je=function(e,t){return t||={},t.getShadowRoot?ke([e],t.includeContainer,{filter:W.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Oe(e,t.includeContainer,W.bind(null,t))},Ye=function(e,t){if(t||={},!e)throw Error(`No node provided`);return V.call(e,B)!==!1&&G(t,e)},Xe=z.concat(`iframe`).join(`,`),Ze=function(e,t){if(t||={},!e)throw Error(`No node provided`);return V.call(e,Xe)!==!1&&W(t,e)},Qe=`data-context-menu-trigger`,$e=`data-context-menu-content`;new w(`Menu.Root`),new w(`Menu.Root | Menu.Sub`),new w(`Menu.Content`),new w(`Menu.Group | Menu.RadioGroup`),new w(`Menu.RadioGroup`),new w(`Menu.CheckboxGroup`),new we(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),te({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),globalThis.bitsDismissableLayers??=new Map;var et=class t{static create(e){return new t(e)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=E;constructor(t){this.opts=t,this.#t=t.interactOutsideBehavior,this.#e=t.onInteractOutside,this.#o=t.onFocusOutside,e(()=>{this.#a=R(this.opts.ref.current)});let n=E,r=()=>{this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),n()};T([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(this.opts.enabled.current&&this.opts.ref.current)return se(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),n(),n=this.#l())}),r}),O(()=>{this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),n()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&D(()=>{this.opts.ref.current&&!this.#h(e.target)&&e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return S(v(this.#a,`pointerdown`,S(this.#f,this.#m),{capture:!0}),v(this.#a,`pointerdown`,S(this.#p,this.#d)),v(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=it(e)),this.#e.current(e)};#d=I(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||rt(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;n.defaultPrevented&&(n=it(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`?this.#s():e.pointerType===`touch`?(this.#s(),this.#s=v(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=nt(this.opts.ref.current))};#h=e=>this.opts.ref.current?L(this.opts.ref.current,e):!1;#g=I(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function tt(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function nt(e){let t=[...globalThis.bitsDismissableLayers],n=tt(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function rt(e,t){let n=e.target;if(!ae(n))return!1;let r=!!n.closest(`[${Qe}]`),i=!!t.closest(`[${$e}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:R(n).documentElement.contains(n)&&!L(t,n)&&Te(e,t)}function it(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function at(e,r){m(r,!0);let i=u(r,`interactOutsideBehavior`,3,`close`),a=u(r,`onInteractOutside`,3,E),o=u(r,`onFocusOutside`,3,E),c=u(r,`isValidEvent`,3,()=>!1),l=et.create({id:C(()=>r.id),interactOutsideBehavior:C(()=>i()),onInteractOutside:C(()=>a()),enabled:C(()=>r.enabled),onFocusOutside:C(()=>o()),isValidEvent:C(()=>c()),ref:r.ref});var d=_(),h=n(d);s(h,()=>r.children??t,()=>({props:l.props})),p(e,d),f()}globalThis.bitsEscapeLayers??=new Map;var ot=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new M(this.opts.ref);let t=E;T(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>v(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!st(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;(n===`close`||n===`defer-otherwise-close`)&&this.opts.onEscapeKeydown.current(t)}};function st(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function ct(e,r){m(r,!0);let i=u(r,`escapeKeydownBehavior`,3,`close`),a=u(r,`onEscapeKeydown`,3,E);ot.create({escapeKeydownBehavior:C(()=>i()),onEscapeKeydown:C(()=>a()),enabled:C(()=>r.enabled),ref:r.ref});var o=_(),c=n(o);s(c,()=>r.children??t),p(e,o),f()}var lt=class e{static instance;#e=b([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},ut=class e{#e=!1;#t=null;#n=lt.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(v(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n){if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&Ze(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}}},{capture:!0}),v(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?qe(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?Je(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return T([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),O(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function dt(e,r){m(r,!0);let i=u(r,`enabled`,3,!1),a=u(r,`trapFocus`,3,!1),o=u(r,`loop`,3,!1),c=u(r,`onCloseAutoFocus`,3,E),l=u(r,`onOpenAutoFocus`,3,E),d=ut.use({enabled:C(()=>i()),trap:C(()=>a()),loop:o(),onCloseAutoFocus:C(()=>c()),onOpenAutoFocus:C(()=>l()),ref:r.ref});var h=_(),g=n(h);s(g,()=>r.focusScope??t,()=>({props:d.props})),p(e,h),f()}var K=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var ft=class e{static create(t){return new e(t)}opts;domContext;#e=E;#t=!1;#n=K;#r=K;constructor(e){this.opts=e,this.domContext=new M(e.ref);let t=E;T(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return S(v(this.domContext.getDocument(),`pointerdown`,this.#o),v(this.domContext.getDocument(),`pointerup`,ee(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{let t=this.opts.ref.current,n=e.target;re(t)&&re(n)&&this.#t&&ht(this)&&he(t,n)&&(this.#n(e),e.defaultPrevented||(this.#e=mt(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=E}},pt=e=>e.style.userSelect||e.style.webkitUserSelect;function mt(e,t){let n=pt(t),r=pt(e);return q(t,`none`),q(e,`text`),()=>{q(t,n),q(e,r)}}function q(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function ht(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function gt(e,r){m(r,!0);let i=u(r,`preventOverflowTextSelection`,3,!0),a=u(r,`onPointerDown`,3,E),o=u(r,`onPointerUp`,3,E);ft.create({id:C(()=>r.id),onPointerDown:C(()=>a()),onPointerUp:C(()=>o()),enabled:C(()=>r.enabled&&i()),ref:r.ref});var c=_(),l=n(c);s(l,()=>r.children??t),p(e,c),f()}globalThis.bitsIdCounter??={current:0};function _t(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var vt=class{#e;#t=0;#n=c();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),r(this.#n,void 0),this.#r=void 0)}get(...t){return this.#t+=1,h(this.#n)===void 0&&(this.#r=y(()=>{r(this.#n,this.#e(...t),!0)})),e(()=>()=>{this.#i()}),h(this.#n)}},J=new ne,Y=c(null),X=null,Z=null,Q=!1,yt=C(()=>{for(let e of J.values())if(e)return!0;return!1}),$=null,bt=new vt(()=>{function e(){document.body.setAttribute(`style`,h(Y)??``),document.body.style.removeProperty(`--scrollbar-width`),ie&&X?.(),r(Y,null)}function t(){Z!==null&&(window.clearTimeout(Z),Z=null)}function n(e,n){t(),Q=!0,$=Date.now();let r=$,i=()=>{Z=null,$===r&&(St(J)?Q=!1:(Q=!1,n()))},a=e===null?24:e;Z=window.setTimeout(i,a)}function i(){h(Y)===null&&J.size===0&&!Q&&r(Y,document.body.getAttribute(`style`),!0)}return T(()=>yt.current,()=>{if(!yt.current)return;i(),Q=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),r=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+r,margin:Number.parseInt(t.marginRight??`0`,10)};r>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${r}px`)),document.body.style.overflow=`hidden`,ie&&(X=v(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),D(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),O(()=>()=>{X?.()}),{get lockMap(){return J},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:i}}),xt=class{#e=_t();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=bt.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=C(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),O(()=>{if(this.#r.lockMap.delete(this.#e),St(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function St(e){for(let[t,n]of e)if(n)return!0;return!1}function Ct(e,t){m(t,!0);let n=u(t,`preventScroll`,3,!0),r=u(t,`restoreScrollDelay`,3,null);n()&&new xt(n(),()=>r()),f()}export{ct as a,Ce as c,M as d,A as f,dt as i,xe as l,_t as n,at as o,j as p,gt as r,Ye as s,Ct as t,ye as u};