1import{o as h}from"./use-disposables-CfFTDyR-.js";import{u as x,l as F}from"./keyboard-DWH7cf9L.js";import{o as f}from"./owner-DMFep04G.js";import{r as b}from"./index-wQAhJmvO.js";let d=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var p=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(p||{}),y=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(y||{}),w=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(w||{});function m(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(d)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var S=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(S||{});function O(e,t=0){var r;return e===((r=f(e))==null?void 0:r.body)?!1:x(t,{0(){return e.matches(d)},1(){let n=e;for(;n!==null;){if(n.matches(d))return!0;n=n.parentElement}return!1}})}function G(e){let t=f(e);h().nextFrame(()=>{t&&!O(t.activeElement,0)&&M(e)})}var A=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(A||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function M(e){e==null||e.focus({preventScroll:!0})}let I=["textarea","input"].join(",");function L(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,I))!=null?r:!1}function P(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),s=t(n);if(i===null||s===null)return 0;let o=i.compareDocumentPosition(s);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function R(e,t){return T(m(),t,{relativeTo:e})}function T(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?P(e):e:m(e);i.length>0&&o.length>1&&(o=o.filter(u=>!i.includes(u))),n=n??s.activeElement;let E=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),v=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),N=t&32?{preventScroll:!0}:{},c=0,a=o.length,l;do{if(c>=a||c+a<=0)return 0;let u=v+c;if(t&16)u=(u+a)%a;else{if(u<0)return 3;if(u>=a)return 1}l=o[u],l==null||l.focus(N),c+=E}while(l!==s.activeElement);return t&6&&L(l)&&l.select(),2}function U(){let e=b.useRef(!1);return F(()=>(e.current=!0,()=>{e.current=!1}),[]),e}export{G as D,P as I,p as M,y as N,T as O,S as T,R as _,m as a,U as f,O as h,M as y};
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.