1import{i as W}from"./bT7aMvTG.js";import{f as D,g as K,i as M,h as A,b as H,c as q,j as $,u as Y}from"./BMk4nGzw.js";import{p as B,r as w,H as I,ar as j,I as P,h as V,e as G,as as X,a0 as C,i as z,o as J,w as Q,G as Z,k as ee}from"#entry";import{P as te}from"./CxGDggSy.js";function E(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}const ne=D(()=>{const e=w(new Map),t=w(),n=B(()=>{for(const v of e.value.values())if(v)return!0;return!1}),r=W({scrollBody:w(!0)});let u=null;const p=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",A&&u?.(),t.value=void 0};return I(n,(v,m)=>{if(!M)return;if(!v){m&&p();return}t.value===void 0&&(t.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,b={padding:l,margin:0},s=r.scrollBody?.value?typeof r.scrollBody.value=="object"?j({padding:r.scrollBody.value.padding===!0?l:r.scrollBody.value.padding,margin:r.scrollBody.value.margin===!0?l:r.scrollBody.value.margin},b):b:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof s.padding=="number"?`${s.padding}px`:String(s.padding),document.body.style.marginRight=typeof s.margin=="number"?`${s.margin}px`:String(s.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),A&&(u=H(document,"touchmove",o=>oe(o),{passive:!1})),P(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function ge(e){const t=Math.random().toString(36).substring(2,7),n=ne();n.value.set(t,e??!1);const r=B({get:()=>n.value.get(t)??!1,set:u=>n.value.set(t,u)});return K(()=>{n.value.delete(t)}),r}function R(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!(n instanceof Element)||n.tagName==="BODY"?!1:R(n)}}function oe(e){const t=e||window.event,n=t.target;return n instanceof Element&&R(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}var re=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},g=new WeakMap,S=new WeakMap,F={},O=0,x=function(e){return e&&(e.host||x(e.parentNode))},se=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=x(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},ae=function(e,t,n,r){var u=se(t,Array.isArray(e)?e:[e]);F[n]||(F[n]=new WeakMap);var p=F[n],v=[],m=new Set,l=new Set(u),b=function(o){!o||m.has(o)||(m.add(o),b(o.parentNode))};u.forEach(b);var s=function(o){!o||l.has(o)||Array.prototype.forEach.call(o.children,function(a){if(m.has(a))s(a);else try{var f=a.getAttribute(r),i=f!==null&&f!=="false",c=(g.get(a)||0)+1,d=(p.get(a)||0)+1;g.set(a,c),p.set(a,d),v.push(a),c===1&&i&&S.set(a,!0),d===1&&a.setAttribute(n,"true"),i||a.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",a,y)}})};return s(t),m.clear(),O++,function(){v.forEach(function(o){var a=g.get(o)-1,f=p.get(o)-1;g.set(o,a),p.set(o,f),a||(S.has(o)||o.removeAttribute(r),S.delete(o)),f||o.removeAttribute(n)}),O--,O||(g=new WeakMap,g=new WeakMap,S=new WeakMap,F={})}},ue=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),u=re(e);return u?(r.push.apply(r,Array.from(u.querySelectorAll("[aria-live], script"))),ae(r,u,n,"aria-hidden")):function(){return null}};function we(e){let t;I(()=>q(e),n=>{n?t=ue(n):t&&t()}),V(()=>{t&&t()})}const ie=$(()=>w([]));function ce(){const e=ie();return{add(t){const n=e.value[0];t!==n&&n?.pause(),e.value=_(e.value,t),e.value.unshift(t)},remove(t){e.value=_(e.value,t),e.value[0]?.resume()}}}function _(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function le(e){return e.filter(t=>t.tagName!=="A")}const T="focusScope.autoFocusOnMount",k="focusScope.autoFocusOnUnmount",L={bubbles:!1,cancelable:!0};function fe(e,{select:t=!1}={}){const n=E();for(const r of e)if(h(r,{select:t}),E()!==n)return!0}function de(e){const t=U(e),n=N(t,e),r=N(t.reverse(),e);return[n,r]}function U(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const u=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||u?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function N(e,t){for(const n of e)if(!ve(n,{upTo:t}))return n}function ve(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pe(e){return e instanceof HTMLInputElement&&"select"in e}function h(e,{select:t=!1}={}){if(e&&e.focus){const n=E();e.focus({preventScroll:!0}),e!==n&&pe(e)&&t&&e.select()}}var me=G({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const n=e,r=t,{currentRef:u,currentElement:p}=Y(),v=w(null),m=ce(),l=X({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});C(s=>{if(!M)return;const o=p.value;if(!n.trapped)return;
1function a(d){if(l.paused||!o)return;const y=d.target;o.contains(y)?v.value=y:h(v.value,{select:!0})}function f(d){if(l.paused||!o)return;const y=d.relatedTarget;y!==null&&(o.contains(y)||h(v.value,{select:!0}))}function i(d){o.contains(v.value)||h(o)}document.addEventListener("focusin",a),document.addEventListener("focusout",f);const c=new MutationObserver(i);o&&c.observe(o,{childList:!0,subtree:!0}),s(()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",f),c.disconnect()})}),C(async s=>{const o=p.value;if(await P(),!o)return;m.add(l);const a=E();if(!o.contains(a)){const i=new CustomEvent(T,L);o.addEventListener(T,c=>r("mountAutoFocus",c)),o.dispatchEvent(i),i.defaultPrevented||(fe(le(U(o)),{select:!0}),E()===a&&h(o))}s(()=>{o.removeEventListener(T,d=>r("mountAutoFocus",d));const i=new CustomEvent(k,L),c=d=>{r("unmountAutoFocus",d)};o.addEventListener(k,c),o.dispatchEvent(i),setTimeout(()=>{i.defaultPrevented||h(a??document.body,{select:!0}),o.removeEventListener(k,c),m.remove(l)},0)})});function b(s){if(!n.loop&&!n.trapped||l.paused)return;const o=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,a=E();if(o&&a){const f=s.currentTarget,[i,c]=de(f);i&&c?!s.shiftKey&&a===c?(s.preventDefault(),n.loop&&h(i,{select:!0})):s.shiftKey&&a===i&&(s.preventDefault(),n.loop&&h(c,{select:!0})):a===f&&s.preventDefault()}}return(s,o)=>(J(),z(ee(te),{ref_key:"currentRef",ref:u,tabindex:"-1","as-child":s.asChild,as:s.as,onKeydown:b},{default:Q(()=>[Z(s.$slots,"default")]),_:3},8,["as-child","as"]))}}),Se=me;function Fe(e){return e?"open":"closed"}function Oe(e){const t=E();for(const n of e)if(n===t||(n.focus(),E()!==t))return}export{Se as F,we as a,Fe as b,Oe as f,E as g,ge as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.