1var e,t,n;import{o as r}from"./C_JJxWoe.js";import{Dr as o,Vr as i}from"./CGcjPoY7.js";import{c as s,d as a,f as l,o as d,t as c,u}from"./BiWktRCH.js";import{a as h,l as f,n as g,o as p,r as m,t as y}from"./DUS-nzxL.js";import{t as v}from"./LEZvo1JG.js";import{r as I}from"./CuN125mL.js";import{t as x}from"./IjeYxuYp.js";import{t as b}from"./Da2t3Lmr.js";import{a as k,i as E,l as H,n as R,o as j,r as K,s as A,t as C,u as M}from"./qrvueeoX.js";function F(t){const{render:r,className:o,style:i,refs:j=a,props:F=a,state:P=l,stateAttributesMapping:w,highlightedIndex:D,onHighlightedIndexChange:L,orientation:S,grid:z,loopFocus:O,onLoop:q,enableHomeAndEndKeys:N,onMapChange:U,stopEventPropagation:V=!0,rootRef:B,disabledIndices:G,modifierKeys:J,highlightItemOnHover:Q=!1,tag:T="div",...W}=t,X=v(),{props:Y,highlightedIndex:Z,onHighlightedIndexChange:$,elementsRef:_,onMapChange:ee,relayKeyboardEvent:te}=function(t){const{loopFocus:n=!0,orientation:r="both",grid:o,onLoop:i,direction:l,highlightedIndex:c,onHighlightedIndexChange:v,rootRef:I,enableHomeAndEndKeys:x=!1,stopEventPropagation:j,disabledIndices:F,modifierKeys:P=a}=t,[w,D]=e.useState(0),L=null!=o,S=e.useRef(null),z=s(S,I),O=e.useRef([]),q=e.useRef(!1),N=e.useRef(null),U=c??w,V=d((e,t=!1)=>{if(N.current=O.current[e]??null,(v??D)(e),t){const t=O.current[e];M(S.current,t,l,r)}}),B=d(e=>{if(0===e.size)return;if(q.current){const e=O.current,t=e.indexOf(N.current);if(-1===t){const t=e[U];!t||p(e,U,F)?V(function(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const o=e[r];if(o&&!p(e,r,t)){if(o.hasAttribute("data-composite-item-active"))return r;-1===n&&(n=r)}}return Math.max(n,0)}(e,F)):N.current=t}else t!==U&&V(t);return}q.current=!0;const t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute("data-composite-item-active"))??null,o=n?e.get(n)?.index??-1:-1;if(-1!==o)V(o);else if(p(t,U,F)){const e=y(t,{disabledIndices:F});h(t,e)||V(e)}M(S.current,n,l,r)});u(()=>{if(null==F||null!=c||!q.current)return;const e=O.current;if(p(e,U,F)){const t=y(e,{disabledIndices:F});h(e,t)||V(t)}},[F,c,U,O,V]);const G=d((e,t,n)=>i?i(e,t,n,O):n),J=d(e=>{const t="Home"===e.key||"End"===e.key;if(!k.has(e.key)||!x&&t)return;if(function(e,t){for(const n of A)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}(e,P))return;if(!S.current)return;const s="rtl"===l,a=s?R:K,d=s?K:R,c="vertical"===r?C:a,u="vertical"===r?E:d,p=f(e.nativeEvent);if(null!=p&&H(p)&&!b(p)){const t=p.selectionStart,n=p.selectionEnd,r=p.value;if(null==t||e.shiftKey||t!==n)return;if(e.key!==u&&t<r.length)return;if(e.key!==c&&t>0)return}let v=U;const I=m(O,F),M=g(O,F);null!=o&&(v=o({disabledIndices:F,elementsRef:O,event:e,highlightedIndex:U,loopFocus:n,maxIndex:M,minIndex:I,onLoop:G,orientation:r,rtl:s}));const w="vertical"!==r&&e.key===a||"horizontal"!==r&&"ArrowDown"===e.key,D="vertical"!==r&&e.key===d||"horizontal"!==r&&"ArrowUp"===e.key;x&&("Home"===e.key?v=I:"End"===e.key&&(v=M)),v===U&&(w||D)&&(n&&v===M&&w?(v=I,i&&(v=i(e,U,v,O))):n&&v===I&&D?(v=M,i&&(v=i(e,U,v,O))):v=y(O.current,{startingIndex:v,decrement:D,disabledIndices:F})),v===U||h(O.current,v)||(j&&e.stopPropagation(),(L||t||w||D)&&e.preventDefault(),V(v,!0),queueMicrotask(()=>{O.current[v]?.focus()}))});return{props:{ref:z,onFocus(e){const t=S.current,n=f(e.nativeEvent);t&&null!=n&&H(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:J},highlightedIndex:U,onHighlightedIndexChange:V,elementsRef:O,onMapChange:B,relayKeyboardEvent:J}}({grid:z,loopFocus:O,onLoop:q,orientation:S,highlightedIndex:D,onHighlightedIndexChange:L,rootRef:B,stopEventPropagation:V,enableHomeAndEndKeys:N,direction:X,disabledIndices:G,modifierKeys:J}),ne=c(T,t,{state:P,ref:j,props:[Y,...F,W],stateAttributesMapping:w}),re=e.useMemo(()=>({highlightedIndex:Z,onHighlightedIndexChange:$,highlightItemOnHover:Q,relayKeyboardEvent:te}),[Z,$,Q,te]);return(0,n.jsx)(I.Provider,{value:re,children:(0,n.jsx)(x,{elementsRef:_,onMapChange:e=>{U?.(e),ee(e)},children:ne})})}e=r(i(),1),t="data-composite-item-active",n=o();export{t as n,F as t};
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.