1import{o as e}from"./rolldown-runtime.DAXXjFlN.js";import{r as t}from"./emotion-is-prop-valid.esm.CygBv61C.js";import{t as n}from"./react-dom.DZwq-Xzd.js";import{D as r,F as i,G as a,H as o,K as s,P as c,S as l,T as u,U as d,W as f,X as p,Y as m,dt as h,ft as g,j as _,lt as v,ot as y,q as b,ut as x,w as S}from"./Tooltip.PNC8NIZa.js";import{h as ee,l as C,m as w,r as T,s as E}from"./useFocusRing.C8atAWyK.js";import{n as D}from"./Hidden.Bpblr2PM.js";import{t as O}from"./shim.Bu3ywy0h.js";import{t as k}from"./usePress.C0FRp5XM.js";import{r as A}from"./FocusScope.0TQQ9LKf.js";var j=e(t(),1),M=e(n(),1),N=`react-aria-clear-focus`,P=`react-aria-focus`;function F(e){let t=R(m(e));t!==e&&(t&&I(t,e),e&&L(e,t))}function I(e,t){e.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:t}))}function L(e,t){e.dispatchEvent(new FocusEvent(`focus`,{relatedTarget:t})),e.dispatchEvent(new FocusEvent(`focusin`,{bubbles:!0,relatedTarget:t}))}function R(e){let t=s(e),n=t?.getAttribute(`aria-activedescendant`);return n&&e.getElementById(n)||t}function z(e){return _()?e.metaKey:e.ctrlKey}var B=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function V(e){return e instanceof HTMLInputElement&&!B.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function H(e,t,n,i){let a=r(n),o=n==null;(0,j.useEffect)(()=>{if(o||!e.current)return;let n=e.current;return n.addEventListener(t,a,i),()=>{n.removeEventListener(t,a,i)}},[e,t,i,o])}var U=class{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue=``,this[`aria-label`]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw Error(`childNodes is not supported`)}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e[`aria-label`]=this[`aria-label`],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,t,n){let r=this.clone();return t.addDescendants(r,e),r}},W=class extends U{filter(e,t,n){let[r,i]=te(e,t,this.firstChildKey,n),a=this.clone();return a.firstChildKey=r,a.lastChildKey=i,a}};(class extends U{static{this.type=`header`}});var G=class extends U{static{this.type=`loader`}},K=class extends W{static{this.type=`item`}filter(e,t,n){if(n(this.textValue,this)){let n=this.clone();return t.addDescendants(n,e),n}return null}};(class extends W{static{this.type=`section`}filter(e,t,n){let r=super.filter(e,t,n);if(r&&r.lastChildKey!==null){let t=e.getItem(r.lastChildKey);if(t&&t.type!==`header`)return r}return null}});var q=class{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey==null?void 0:this.keyMap.get(this.firstKey);for(;e;)yield e,e=e.nextKey==null?void 0:this.keyMap.get(e.nextKey)}getChildren(e){let t=this.keyMap;return{*[Symbol.iterator](){let n=t.get(e),r=n?.firstChildKey==null?null:t.get(n.firstChildKey);for(;r;)yield r,r=r.nextKey==null?void 0:t.get(r.nextKey)}}}getKeyBefore(e){let t=this.keyMap.get(e);if(!t)return null;if(t.prevKey!=null){for(t=this.keyMap.get(t.prevKey);t&&t.type!==`item`&&t.lastChildKey!=null;)t=this.keyMap.get(t.lastChildKey);return t?.key??null}return t.parentKey}getKeyAfter(e){let t=this.keyMap.get(e);if(!t)return null;if(t.type!==`item`&&t.firstChildKey!=null)return t.firstChildKey;for(;t;){if(t.nextKey!=null)return t.nextKey;if(t.parentKey!=null)t=this.keyMap.get(t.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey==null?null:this.keyMap.get(this.lastKey);for(;e?.lastChildKey!=null;)e=this.keyMap.get(e.lastChildKey);return e?.key??null}getItem(e){return this.keyMap.get(e)??null}at(){throw Error(`Not implemented`)}clone(){let e=this.constructor,t=new e;return t.keyMap=new Map(this.keyMap),t.firstKey=this.firstKey,t.lastKey=this.lastKey,t.itemCount=this.itemCount,t}addNode(e){if(this.frozen)throw Error(`Cannot add a node to a frozen collection`);e.type===`item`&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,t){this.addNode(e);let n=t.getChildren(e.key);for(let e of n)this.addDescendants(e,t)}removeNode(e){if(this.frozen)throw Error(`Cannot remove a node to a frozen collection`);let t=this.keyMap.get(e);t!=null&&t.type===`item`&&this.itemCount--,this.keyMap.delete(e)}commit(e,t,n=!1){if(this.frozen)throw Error(`Cannot commit a frozen collection`);this.firstKey=e,this.lastKey=t,this.frozen=!n}filter(e){let t=new this.constructor,[n,r]=te(this,t,this.firstKey,e);return t?.commit(n,r),t}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}};
1function te(e,t,n,r){if(n==null)return[null,null];let i=null,a=null,o=e.getItem(n);for(;o!=null;){let n=o.filter(e,t,r);n!=null&&(n.nextKey=null,a&&(n.prevKey=a.key,a.nextKey=n.key),i??=n,t.addNode(n),a=n),o=o.nextKey==null?null:e.getItem(o.nextKey)}if(a&&a.type===`separator`){let e=a.prevKey;t.removeNode(a.key),e==null?a=null:(a=t.getItem(e),a.nextKey=null)}return[i?.key??null,a?.key??null]}var J=class{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){return this.parentNode?.isConnected||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.index<this._minInvalidChildIndex.index)&&(this._minInvalidChildIndex=e,this.ownerDocument.markDirty(this))}updateChildIndices(){let e=this._minInvalidChildIndex;for(;e;)e.index=e.previousSibling?e.previousSibling.index+1:0,e=e.nextSibling;this._minInvalidChildIndex=null}appendChild(e){e.parentNode&&e.parentNode.removeChild(e),this.firstChild??=e,this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),this.isConnected&&this.ownerDocument.queueUpdate()}insertBefore(e,t){if(t==null)return this.appendChild(e);e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=t,e.previousSibling=t.previousSibling,e.index=t.index-1,this.firstChild===t?this.firstChild=e:t.previousSibling&&(t.previousSibling.nextSibling=e),t.previousSibling=e,e.parentNode=t.parentNode,this.invalidateChildIndices(e),this.isConnected&&this.ownerDocument.queueUpdate()}removeChild(e){e.parentNode===this&&(this._minInvalidChildIndex===e&&(this._minInvalidChildIndex=null),e.nextSibling&&(this.invalidateChildIndices(e.nextSibling),e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.markDirty(e),this.isConnected&&this.ownerDocument.queueUpdate())}addEventListener(){}removeEventListener(){}get previousVisibleSibling(){let e=this.previousSibling;for(;e&&e.isHidden;)e=e.previousSibling;return e}get nextVisibleSibling(){let e=this.nextSibling;for(;e&&e.isHidden;)e=e.nextSibling;return e}get firstVisibleChild(){let e=this.firstChild;for(;e&&e.isHidden;)e=e.nextSibling;return e}get lastVisibleChild(){let e=this.lastChild;for(;e&&e.isHidden;)e=e.previousSibling;return e}},Y=class e extends J{constructor(e,t){super(t),this.nodeType=8,this.isMutated=!0,this._index=0,this.isHidden=!1,this.node=null}get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof e?this.parentNode.level+ +(this.parentNode.node?.type===`item`):0}getMutableNode(){return this.node==null?null:(this.isMutated||=(this.node=this.node.clone(),!0),this.ownerDocument.markDirty(this),this.node)}updateNode(){let t=this.nextVisibleSibling,n=this.getMutableNode();if(n!=null&&(n.index=this.index,n.level=this.level,n.parentKey=this.parentNode instanceof e?this.parentNode.node?.key??null:null,n.prevKey=this.previousVisibleSibling?.node?.key??null,
1n.nextKey=t?.node?.key??null,n.hasChildNodes=!!this.firstChild,n.firstChildKey=this.firstVisibleChild?.node?.key??null,n.lastChildKey=this.lastVisibleChild?.node?.key??null,(n.colSpan!=null||n.colIndex!=null)&&t)){let e=(n.colIndex??n.index)+(n.colSpan??1);if(t.node!=null&&e!==t.node.colIndex){let n=t.getMutableNode();n.colIndex=e}}}setProps(e,t,n,r,i){let a,{value:o,textValue:s,id:c,...l}=e;if(this.node==null?(a=new n(c??`react-aria-${++this.ownerDocument.nodeId}`),this.node=a):a=this.getMutableNode(),l.ref=t,a.props=l,a.rendered=r,a.render=i,a.value=o,e[`aria-label`]&&(a[`aria-label`]=e[`aria-label`]),a.textValue=s||(typeof l.children==`string`?l.children:``)||e[`aria-label`]||``,c!=null&&c!==a.key)throw Error(`Cannot change the id of an item`);l.colSpan!=null&&(a.colSpan=l.colSpan),this.isConnected&&this.ownerDocument.queueUpdate()}get style(){let e=this;return{get display(){return e.isHidden?`none`:``},set display(t){let n=t===`none`;if(e.isHidden!==n){(e.parentNode?.firstVisibleChild===e||e.parentNode?.lastVisibleChild===e)&&e.ownerDocument.markDirty(e.parentNode);let t=e.previousVisibleSibling,r=e.nextVisibleSibling;t&&e.ownerDocument.markDirty(t),r&&e.ownerDocument.markDirty(r),e.isHidden=n,e.ownerDocument.markDirty(e)}}}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}},ne=class extends J{constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.nextCollection=null,this.subscriptions=new Set,this.queuedRender=!1,this.inSubscription=!1,this.collection=e,this.nextCollection=e}get isConnected(){return!0}createElement(e){return new Y(e,this)}getMutableCollection(){return this.nextCollection||=this.collection.clone(),this.nextCollection}markDirty(e){this.dirtyNodes.add(e)}addNode(e){if(e.isHidden||e.node==null)return;let t=this.getMutableCollection();if(!t.getItem(e.node.key))for(let t of e)this.addNode(t);t.addNode(e.node)}removeNode(e){for(let t of e)this.removeNode(t);e.node&&this.getMutableCollection().removeNode(e.node.key)}getCollection(){return this.inSubscription?this.collection:(this.queuedRender=!1,this.updateCollection(),this.collection)}updateCollection(){for(let e of this.dirtyNodes)e instanceof Y&&(!e.isConnected||e.isHidden)?this.removeNode(e):e.updateChildIndices();for(let e of this.dirtyNodes)e instanceof Y?(e.isConnected&&!e.isHidden&&(e.updateNode(),this.addNode(e)),e.node&&this.dirtyNodes.delete(e),e.isMutated=!1):this.dirtyNodes.delete(e);this.nextCollection&&(this.nextCollection.commit(this.firstVisibleChild?.node?.key??null,this.lastVisibleChild?.node?.key??null,this.isSSR),this.isSSR||(this.collection=this.nextCollection,this.nextCollection=null))}queueUpdate(){if(!(this.dirtyNodes.size===0||this.queuedRender)){this.queuedRender=!0,this.inSubscription=!0,this.isSSR||(this.collection=this.collection.clone());for(let e of this.subscriptions)e();this.inSubscription=!1}}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}};function re(e){let{children:t,items:n,idScope:r,addIdAndValue:i,dependencies:a=[]}=e,o=(0,j.useMemo)(()=>void 0,[t]),s=(0,j.useMemo)(()=>new WeakMap,[...a,o]);return(0,j.useMemo)(()=>{if(n&&typeof t==`function`){let e=[];for(let a of n){let n=ie(a)?a:null,o=n?s.get(n):null;if(!o){o=t(a);let c=o.props.id??a?.key??a?.id;r!=null&&o.props.id==null&&c!=null&&(c=r+`:`+c);let l=c??e.length;o=(0,j.cloneElement)(o,i?{key:l,id:c,value:a}:{key:l}),n&&s.set(n,o)}e.push(o)}return e}else if(typeof t!=`function`)return t},[t,n,s,r,i])}function ie(e){switch(typeof e){case`object`:return e!=null;case`function`:case`symbol`:return!0;default:return!1}}var ae=O(),oe=(0,j.createContext)(!1),X=(0,j.createContext)(null);function se(e){if((0,j.useContext)(X))return e.content;let{collection:t,document:n}=de(e.createCollection);return j.createElement(j.Fragment,null,j.createElement(D,null,j.createElement(X.Provider,{value:n},e.content)),j.createElement(ce,{render:e.children,collection:t}))}function ce({collection:e,render:t}){return t(e)}function le(e,t,n){let r=x(),i=(0,j.useRef)(r);return i.current=r,(0,ae.useSyncExternalStore)(e,(0,j.useCallback)(()=>i.current?n():t(),[t,n]))}var ue=typeof j.useSyncExternalStore==`function`?j.useSyncExternalStore:le;
1function de(e){let[t]=(0,j.useState)(()=>new ne(e?.()||new q));return{collection:ue((0,j.useCallback)(e=>t.subscribe(e),[t]),(0,j.useCallback)(()=>{let e=t.getCollection();return t.isSSR&&t.resetAfterSSR(),e},[t]),(0,j.useCallback)(()=>(t.isSSR=!0,t.getCollection()),[t])),document:t}}var fe=(0,j.createContext)(null);function pe(e){return class extends U{static{this.type=e}}}function me(e,t,n,r,i,a){typeof e==`string`&&(e=pe(e));let o=(0,j.useCallback)(i=>{i?.setProps(t,n,e,r,a)},[t,n,r,a,e]),s=(0,j.useContext)(fe);if(s){let o=s.ownerDocument.nodesByProps.get(t);return o||(o=s.ownerDocument.createElement(e.type),o.setProps(t,n,e,r,a),s.appendChild(o),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(t,o)),i?j.createElement(fe.Provider,{value:o},i):null}return j.createElement(e.type,{ref:o},i)}function he(e,t){let n=({node:e})=>t(e.props,e.props.ref,e),r=(0,j.forwardRef)((r,i)=>{let a=(0,j.useContext)(T);if(!(0,j.useContext)(oe)){if(t.length>=3)throw Error(t.name+` cannot be rendered outside a collection.`);return t(r,i)}return me(e,r,i,`children`in r?r.children:null,null,e=>j.createElement(T.Provider,{value:a},j.createElement(n,{node:e})))});return r.displayName=t.name,r}function ge(e){return re({...e,addIdAndValue:!0})}var _e=(0,j.createContext)(null);function ve(e){let t=(0,j.useContext)(_e),n=(t?.dependencies||[]).concat(e.dependencies),r=e.idScope??t?.idScope,i=ge({...e,idScope:r,dependencies:n});return(0,j.useContext)(X)&&(i=j.createElement(ye,null,i)),t=(0,j.useMemo)(()=>({dependencies:n,idScope:r}),[r,...n]),j.createElement(_e.Provider,{value:t},i)}function ye({children:e}){let t=(0,j.useContext)(X),n=(0,j.useMemo)(()=>j.createElement(X.Provider,{value:null},j.createElement(oe.Provider,{value:!0},e)),[e]);return x()?j.createElement(fe.Provider,{value:t},n):(0,M.createPortal)(n,t)}var be=(0,j.createContext)(null),xe={CollectionRoot({collection:e,renderDropIndicator:t}){return Se(e,null,t)},CollectionBranch({collection:e,parent:t,renderDropIndicator:n}){return Se(e,t,n)}};function Se(e,t,n){return re({items:t?e.getChildren(t.key):e,dependencies:[n],children(t){if(t.type===`content`)return j.createElement(j.Fragment,null);let r=t.render(t);return!n||t.type!==`item`?r:j.createElement(j.Fragment,null,n({type:`item`,key:t.key,dropPosition:`before`}),r,Ce(e,t,n))}})}function Ce(e,t,n){let r=t.key,i=e.getKeyAfter(r),a=i==null?null:e.getItem(i);for(;a!=null&&a.type!==`item`;)i=e.getKeyAfter(a.key),a=i==null?null:e.getItem(i);let o=t.nextKey==null?null:e.getItem(t.nextKey);for(;o!=null&&o.type!==`item`;)o=o.nextKey==null?null:e.getItem(o.nextKey);let s=[];if(o==null){let r=t;for(;r?.type===`item`&&(!a||r.parentKey!==a.parentKey&&a.level<r.level);){let t=n({type:`item`,key:r.key,dropPosition:`after`});(0,j.isValidElement)(t)&&s.push((0,j.cloneElement)(t,{key:`${r.key}-after`})),r=r.parentKey==null?null:e.getItem(r.parentKey)}}return s}var we=(0,j.createContext)(xe);function Te(e){return(0,j.useMemo)(()=>e==null?null:new Set([e]),[e])}function Ee(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&n.overflow!==`hidden`&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function De(e,t){let n=[],r=document.scrollingElement||document.documentElement;for(;e&&(Ee(e,t)&&n.push(e),e!==r);)e=e.parentElement;return n}function Z(e,t,n={}){let{block:r=`nearest`,inline:a=`nearest`}=n;if(e===t)return;let o=e.scrollTop,s=e.scrollLeft,c=t.getBoundingClientRect(),l=e.getBoundingClientRect(),u=window.getComputedStyle(t),d=window.getComputedStyle(e),f=document.scrollingElement||document.documentElement,p=e===f,m=e===f?0:l.top,h=e===f?e.clientHeight:l.bottom,g=e===f?0:l.left,_=e===f?e.clientWidth:l.right,v=parseFloat(u.scrollMarginTop)||0,y=parseFloat(u.scrollMarginBottom)||0,b=parseFloat(u.scrollMarginLeft)||0,x=parseFloat(u.scrollMarginRight)||0,S=parseFloat(d.scrollPaddingTop)||0,ee=parseFloat(d.scrollPaddingBottom)||0,C=parseFloat(d.scrollPaddingLeft)||0,w=parseFloat(d.scrollPaddingRight)||0,T=parseFloat(d.borderTopWidth)||0,E=parseFloat(d.borderBottomWidth)||0,D=parseFloat(d.borderLeftWidth)||0,O=parseFloat(d.borderRightWidth)||0,k=c.top-v,A=c.bottom+y,j=c.left-b,M=c.right+x,N=e===f?0:D+O,P=e===f?0:T+E,F=e===f?0:e.offsetWidth-e.clientWidth-N,I=e===f?0:e.offsetHeight-e.clientHeight-P,L=m+(p?0:T)+S,R=h-(p?0:E)-ee-I,z=g+(p?0:D)+C,B=_-(p?0:O)-w;d.direction===`rtl`&&!i()?z+=F:B-=F;let V=k<L||A>R,H=j<z||M>B;if(V&&r===`start`)o+=k-L;else if(V&&r===`center`)o+=(k+A)/2-(L+R)/2;else if(V&&r===`end`)o+=A-R;else if(V&&r===`nearest`){let e=k-L,t=A-R;o+=Math.abs(e)<=Math.abs(t)?e:t}if(H&&a===`start`)s+=j-z;
1else if(H&&a===`center`)s+=(j+M)/2-(z+B)/2;else if(H&&a===`end`)s+=M-B;else if(H&&a===`nearest`){let e=j-z,t=M-B;s+=Math.abs(e)<=Math.abs(t)?e:t}e.scrollTo({left:s,top:o})}function Oe(e,t={}){let{containingElement:n}=t;if(e&&e.isConnected){let t=document.scrollingElement||document.documentElement;if(window.getComputedStyle(t).overflow!==`hidden`){let{left:t,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(t-i)>1||Math.abs(r-a)>1)&&(n?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let{left:t,top:r}=e.getBoundingClientRect(),i=De(e,!0);for(let t of i)Z(t,e);let{left:a,top:o}=e.getBoundingClientRect();if(Math.abs(t-a)>1||Math.abs(r-o)>1){i=n?De(n,!0):[];for(let e of i)Z(e,n,{block:`center`,inline:`center`});for(let t of De(e,!0))Z(t,e)}}}}var ke=0,Ae=new Map;function je(e){let[t,n]=(0,j.useState)();return h(()=>{if(!e)return;let t=Ae.get(e);if(t)n(t.element.id);else{let r=`react-aria-description-${ke++}`;n(r);let i=document.createElement(`div`);i.id=r,i.style.display=`none`,i.textContent=e,document.body.appendChild(i),t={refCount:0,element:i},Ae.set(e,t)}return t.refCount++,()=>{t&&--t.refCount===0&&(t.element.remove(),Ae.delete(e))}},[e]),{"aria-describedby":e?t:void 0}}function Me(e){return c()?e.altKey:e.ctrlKey}function Q(e,t){let n=`[data-key="${CSS.escape(String(t))}"]`,r=e.current?.dataset.collection;return r&&(n=`[data-collection="${CSS.escape(r)}"]${n}`),e.current?.querySelector(n)}var Ne=new WeakMap;function Pe(e){let t=v();return Ne.set(e,t),t}function Fe(e){return Ne.get(e)}var Ie=1e3;function Le(e){let{keyboardDelegate:t,selectionManager:n,onTypeSelect:r}=e,i=(0,j.useRef)({search:``,timeout:void 0});return(0,j.useEffect)(()=>{let e=i.current.timeout;return()=>{clearTimeout(e)}},[i]),{typeSelectProps:{onKeyDownCapture:t.getKeyForSearch?e=>{if(i.current.search.length>0&&e.key===` `){if(e.preventDefault(),(!(`continuePropagation`in e)||`continuePropagation`in e&&!e.isPropagationStopped())&&e.stopPropagation(),i.current.search+=` `,t.getKeyForSearch!=null){let e=t.getKeyForSearch(i.current.search,n.focusedKey);e??=t.getKeyForSearch(i.current.search),e!=null&&(n.setFocusedKey(e),r&&r(e))}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},Ie)}}:void 0,onKeyDown:t.getKeyForSearch?e=>{let a=Re(e.key);if(!(!a||e.ctrlKey||e.metaKey||e.altKey||!f(e.currentTarget,b(e))||i.current.search.length===0&&a===` `)){if(i.current.search+=a,t.getKeyForSearch!=null){let a=t.getKeyForSearch(i.current.search,n.focusedKey);if(a??=t.getKeyForSearch(i.current.search),a!=null)n.setFocusedKey(a),r&&r(a),e.preventDefault(),`continuePropagation`in e||e.stopPropagation();else{i.current.search=``,clearTimeout(i.current.timeout),i.current.timeout=void 0;return}}clearTimeout(i.current.timeout),i.current.timeout=setTimeout(()=>{i.current.search=``},Ie)}}:void 0}}}function Re(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function ze(e,t){let n=(0,j.useRef)(!0),r=(0,j.useRef)(null);h(()=>(n.current=!0,()=>{n.current=!1}),[]),h(()=>{n.current?n.current=!1:(!r.current||t.some((e,t)=>!Object.is(e,r[t])))&&e(),r.current=t},t)}function Be(e){let{selectionManager:t,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:c=!1,disallowEmptySelection:l=!1,disallowSelectAll:p=!1,escapeKeyBehavior:m=`clearSelection`,selectOnFocus:h=t.selectionBehavior===`replace`,disallowTypeAhead:g=!1,shouldUseVirtualFocus:_,allowsTabNavigation:v=!1,scrollRef:x=r,linkBehavior:S=`action`,UNSTABLE_focusOnEntry:w}=e,{direction:T}=u(),D=ee(),O=e=>{if(e.altKey&&e.key===`Tab`&&e.preventDefault(),!r.current||!f(r.current,b(e)))return;let i=(n,i)=>{if(n!=null){if(t.isLink(n)&&S===`selection`&&h&&!Me(e)){(0,M.flushSync)(()=>{t.setFocusedKey(n,i)});let a=Q(r,n),o=t.getItemProps(n);a&&D.open(a,e,o.href,o.routerOptions);return}if(t.setFocusedKey(n,i),t.isLink(n)&&S===`override`)return;e.shiftKey&&t.selectionMode===`multiple`?t.extendSelection(n):h&&!Me(e)&&t.replaceSelection(n)}};switch(e.key){case`ArrowDown`:if(n.getKeyBelow){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyBelow?.(t.focusedKey);r==null&&c&&(r=n.getFirstKey?.(t.focusedKey)),r!=null&&(e.preventDefault(),i(r))}break;case`ArrowUp`:if(n.getKeyAbove){let r=t.focusedKey==null?n.getLastKey?.():n.getKeyAbove?.(t.focusedKey);r==null&&c&&(r=n.getLastKey?.(t.focusedKey)),r!=null&&(e.preventDefault(),i(r))}break;case`ArrowLeft`:if(n.getKeyLeftOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyLeftOf?.(t.focusedKey);r==null&&c&&(r=T===`rtl`?n.getFirstKey?.(t.focusedKey):n.getLastKey?.(t.focusedKey)),r!=null&&(e.preventDefault(),i(r,T===`rtl`?`first`:`last`))}break;case`ArrowRight`:if(n.getKeyRightOf){let r=t.focusedKey==null?n.getFirstKey?.():n.getKeyRightOf?.(t.focusedKey);r==null&&c&&(r=T===`rtl`?n.getLastKey?.(t.focusedKey):n.getFirstKey?.(t.focusedKey)),r!=null&&(e.preventDefault(),i(r,T===`rtl`?`last`:`first`))}break;case`Home`:if(n.getFirstKey){if(t.focusedKey===null&&e.shiftKey)return;e.preventDefault();let r=n.getFirstKey(t.focusedKey,z(e));t.setFocusedKey(r),r!=null&&(z(e)&&e.shiftKey&&t.selectionMode===`multiple`?t.extendSelection(r):h&&t.replaceSelection(r))}break;case`End`:if(n.getLastKey){if(t.focusedKey===null&&e.shiftKey)return;e.preventDefault();let r=n.getLastKey(t.focusedKey,z(e));t.setFocusedKey(r),r!=null&&(z(e)&&e.shiftKey&&t.selectionMode===`multiple`?t.extendSelection(r):h&&t.replaceSelection(r))}break;
1case`PageDown`:if(n.getKeyPageBelow&&t.focusedKey!=null){let r=n.getKeyPageBelow(t.focusedKey);r!=null&&(e.preventDefault(),i(r))}break;case`PageUp`:if(n.getKeyPageAbove&&t.focusedKey!=null){let r=n.getKeyPageAbove(t.focusedKey);r!=null&&(e.preventDefault(),i(r))}break;case`a`:z(e)&&t.selectionMode===`multiple`&&p!==!0&&(e.preventDefault(),t.selectAll());break;case`Escape`:m===`clearSelection`&&!l&&t.selectedKeys.size!==0&&(e.stopPropagation(),e.preventDefault(),t.clearSelection());break;case`Tab`:if(!v){if(e.shiftKey)r.current.focus();else{let e=A(r.current,{tabbable:!0}),t,n;do n=e.lastChild(),n&&(t=n);while(n);let i=s();t&&(!a(t)||i&&!o(i))&&d(t)}break}}},k=(0,j.useRef)({top:0,left:0});H(x,`scroll`,()=>{k.current={top:x.current?.scrollTop??0,left:x.current?.scrollLeft??0}});let I=e=>{if(t.isFocused){f(e.currentTarget,b(e))||t.setFocused(!1);return}if(!f(e.currentTarget,b(e)))return;let i=C();t.setFocused(!0);let o=e=>{e!=null&&(t.setFocusedKey(e),h&&!t.isSelected(e)&&t.replaceSelection(e))};if(w&&(i===`keyboard`||i===`virtual`))o(w===`first`?n.getFirstKey?.():n.getLastKey?.());else if(t.focusedKey==null){let r=e.relatedTarget;r&&e.currentTarget.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING?o(t.lastSelectedKey??n.getLastKey?.()):o(t.firstSelectedKey??n.getFirstKey?.())}else x.current&&(x.current.scrollTop=k.current.top,x.current.scrollLeft=k.current.left);if(t.focusedKey!=null&&x.current){let e=Q(r,t.focusedKey);e instanceof HTMLElement&&(!a(e)&&!_&&d(e),(i===`keyboard`||w&&i===`virtual`)&&Oe(e,{containingElement:r.current}))}},R=e=>{f(e.currentTarget,e.relatedTarget)||t.setFocused(!1)},B=(0,j.useRef)(!1);H(r,P,_?e=>{let{detail:n}=e;
1e.stopPropagation(),t.setFocused(!0),n?.focusStrategy===`first`&&(B.current=!0)}:void 0);let V=n.getFirstKey?.()??null;ze(()=>{if(B.current)if(V==null){let e=s();F(r.current),L(e,null),t.collection.size>0&&(B.current=!1)}else t.setFocusedKey(V),B.current=!1},[V,t.collection.size]),ze(()=>{t.collection.size>0&&(B.current=!1)},[t.focusedKey]),H(r,N,_?e=>{e.stopPropagation(),t.setFocused(!1),e.detail?.clearFocusKey&&t.setFocusedKey(null)}:void 0);let U=(0,j.useRef)(i),W=(0,j.useRef)(!1);(0,j.useEffect)(()=>{if(U.current){let e=null;i===`first`&&(e=n.getFirstKey?.()??null),i===`last`&&(e=n.getLastKey?.()??null);let a=t.selectedKeys;if(a.size){for(let n of a)if(t.canSelectItem(n)){e=n;break}}t.setFocused(!0),t.setFocusedKey(e),e==null&&!_&&r.current&&E(r.current),t.collection.size>0&&(U.current=!1,W.current=!0)}});let G=(0,j.useRef)(t.focusedKey),K=(0,j.useRef)(null);(0,j.useEffect)(()=>{if(t.isFocused&&t.focusedKey!=null&&(t.focusedKey!==G.current||W.current)&&x.current&&r.current){let e=C(),n=Q(r,t.focusedKey);if(!(n instanceof HTMLElement))return;(e===`keyboard`||W.current)&&(K.current&&cancelAnimationFrame(K.current),K.current=requestAnimationFrame(()=>{x.current&&(Z(x.current,n),e!==`virtual`&&Oe(n,{containingElement:r.current}))}))}
vendor: 10,216 bytes, line 1
1!_&&t.isFocused&&t.focusedKey==null&&G.current!=null&&r.current&&E(r.current),G.current=t.focusedKey,W.current=!1}),(0,j.useEffect)(()=>()=>{K.current&&cancelAnimationFrame(K.current)},[]),H(r,`react-aria-focus-scope-restore`,e=>{e.preventDefault(),t.setFocused(!0)});let q={onKeyDown:O,onFocus:I,onBlur:R,onMouseDown(e){x.current===b(e)&&e.preventDefault()}},{typeSelectProps:te}=Le({keyboardDelegate:n,selectionManager:t});g||(q=y(te,q));let J;_||(J=t.focusedKey==null?0:-1);let Y=Pe(t.collection);return{collectionProps:y(q,{tabIndex:J,"data-collection":Y})}}var Ve=500;function He(e){let{isDisabled:t,onLongPressStart:n,onLongPressEnd:r,onLongPress:i,threshold:a=Ve,accessibilityDescription:o}=e,s=(0,j.useRef)(void 0),{addGlobalListener:c,removeGlobalListener:u}=l(),{pressProps:f}=k({isDisabled:t,onPressStart(e){if(e.continuePropagation(),(e.pointerType===`mouse`||e.pointerType===`touch`)&&(n&&n({...e,type:`longpressstart`}),s.current=setTimeout(()=>{e.target.dispatchEvent(new PointerEvent(`pointercancel`,{bubbles:!0})),m(e.target).activeElement!==e.target&&d(e.target),i&&i({...e,type:`longpress`}),s.current=void 0},a),e.pointerType===`touch`)){let t=e=>{e.preventDefault()},n=p(e.target);c(e.target,`contextmenu`,t,{once:!0}),c(n,`pointerup`,()=>{setTimeout(()=>{u(e.target,`contextmenu`,t)},30)},{once:!0})}},onPressEnd(e){s.current&&clearTimeout(s.current),r&&(e.pointerType===`mouse`||e.pointerType===`touch`)&&r({...e,type:`longpressend`})}});return{longPressProps:y(f,je(i&&!t?o:void 0))}}function Ue(e){let{id:t,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:a,shouldUseVirtualFocus:o,focus:c,isDisabled:l,onAction:u,allowsDifferentPressOrigin:d,linkBehavior:f=`action`}=e,p=ee();t=v(t);let m=e=>{if(e.pointerType===`keyboard`&&Me(e))n.toggleSelection(r);else{if(n.selectionMode===`none`)return;if(n.isLink(r)){if(f===`selection`&&i.current){let t=n.getItemProps(r);p.open(i.current,e,t.href,t.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(f===`override`||f===`none`)return}n.selectionMode===`single`?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):e&&e.shiftKey?n.extendSelection(r):n.selectionBehavior===`toggle`||e&&(z(e)||e.pointerType===`touch`||e.pointerType===`virtual`)?n.toggleSelection(r):n.replaceSelection(r)}};(0,j.useEffect)(()=>{r===n.focusedKey&&n.isFocused&&(o?F(i.current):c?c():s()!==i.current&&i.current&&E(i.current))},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,o]),l||=n.isDisabled(r);let h={};!o&&!l?h={tabIndex:r===n.focusedKey?0:-1,onFocus(e){b(e)===i.current&&n.setFocusedKey(r)}}:l&&(h.onMouseDown=e=>{e.preventDefault()}),(0,j.useEffect)(()=>{l&&n.focusedKey===r&&n.setFocusedKey(null)},[n,l,r]);let _=n.isLink(r)&&f===`override`,x=u&&e.UNSTABLE_itemBehavior===`action`,S=n.isLink(r)&&f!==`selection`&&f!==`none`,C=!l&&n.canSelectItem(r)&&!_&&!x,T=(u||S)&&!l,D=T&&(n.selectionBehavior===`replace`?!C:!C||n.isEmpty),O=T&&C&&n.selectionBehavior===`replace`,A=D||O,M=(0,j.useRef)(null),N=A&&C,P=(0,j.useRef)(!1),I=(0,j.useRef)(!1),L=n.getItemProps(r),R=e=>{u&&(u(),i.current?.dispatchEvent(new CustomEvent(`react-aria-item-action`,{bubbles:!0}))),S&&i.current&&p.open(i.current,e,L.href,L.routerOptions)},B={ref:i};if(a?(B.onPressStart=e=>{M.current=e.pointerType,P.current=N,e.pointerType===`keyboard`&&(!A||Ge(e.key))&&m(e)},d?(B.onPressUp=D?void 0:e=>{e.pointerType===`mouse`&&C&&m(e)},B.onPress=D?R:e=>{e.pointerType!==`keyboard`&&e.pointerType!==`mouse`&&C&&m(e)}):B.onPress=e=>{if(D||O&&e.pointerType!==`mouse`){if(e.pointerType===`keyboard`&&!We(e.key))return;R(e)}else e.pointerType!==`keyboard`&&C&&m(e)}):(B.onPressStart=e=>{M.current=e.pointerType,P.current=N,I.current=D,C&&(e.pointerType===`mouse`&&!D||e.pointerType===`keyboard`&&(!T||Ge(e.key)))&&m(e)},B.onPress=e=>{(e.pointerType===`touch`||e.pointerType===`pen`||e.pointerType===`virtual`||e.pointerType===`keyboard`&&A&&We(e.key)||e.pointerType===`mouse`&&I.current)&&(A?R(e):C&&m(e))}),h[`data-collection`]=Fe(n.collection),h[`data-key`]=r,B.preventFocusOnPress=o,o&&(B=y(B,{onPressStart(e){e.pointerType!==`touch`&&(n.setFocused(!0),n.setFocusedKey(r))},onPress(e){e.pointerType===`touch`&&(n.setFocused(!0),n.setFocusedKey(r))}})),L)for(let e of[`onPressStart`,`onPressEnd`,`onPressChange`,`onPress`,`onPressUp`,`onClick`])L[e]&&(B[e]=g(B[e],L[e]));let{pressProps:V,isPressed:H}=k(B),U=O?e=>{M.current===`mouse`&&(e.stopPropagation(),e.preventDefault(),R(e))}:void 0,{longPressProps:W}=He({isDisabled:!N,onLongPress(e){e.pointerType===`touch`&&(m(e),n.setSelectionBehavior(`toggle`))}}),G=e=>{M.current===`touch`&&P.current&&e.preventDefault()},K=f!==`none`&&n.isLink(r)?e=>{w.isOpening||e.preventDefault()}:void 0;return{itemProps:y(h,C||D||o&&!l?V:{},N?W:{},{onDoubleClick:U,onDragStartCapture:G,onClick:K,id:t},o?{onMouseDown:e=>e.preventDefault()}:void 0),isPressed:H,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:l,allowsSelection:C,hasAction:A}}function We(e){return e===`Enter`}function Ge(e){return e===` `}function Ke(e,t){return typeof t.getChildren==`function`?t.getChildren(e.key):e.childNodes}function qe(e){return Je(e,0)}function Je(e,t){if(t<0)return;let n=0;for(let r of e){if(n===t)return r;n++}}function Ye(e,t,n){if(t.parentKey===n.parentKey)return t.index-n.index;let r=[...Xe(e,t),t],i=[...Xe(e,n),n],a=r.slice(0,i.length).findIndex((e,t)=>e!==i[t]);return a===-1?r.findIndex(e=>e===n)>=0?1:(i.findIndex(e=>e===t),-1):(t=r[a],n=i[a],t.index-n.index)}function Xe(e,t){let n=[],r=t;for(;r?.parentKey!=null;)r=e.getItem(r.parentKey),r&&n.unshift(r);return n}var $=class e extends Set{constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n??t.anchorKey,this.currentKey=r??t.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Qe(e){let{selectionMode:t=`none`,disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i=`toggle`,disabledBehavior:a=`all`}=e,o=(0,j.useRef)(!1),[,s]=(0,j.useState)(!1),c=(0,j.useRef)(null),l=(0,j.useRef)(null),[,u]=(0,j.useState)(null),[d,f]=S((0,j.useMemo)(()=>$e(e.selectedKeys),[e.selectedKeys]),(0,j.useMemo)(()=>$e(e.defaultSelectedKeys,new $),[e.defaultSelectedKeys]),e.onSelectionChange),p=(0,j.useMemo)(()=>e.disabledKeys?new Set(e.disabledKeys):new Set,[e.disabledKeys]),[m,h]=(0,j.useState)(i);i===`replace`&&m===`toggle`&&typeof d==`object`&&d.size===0&&h(`replace`);let g=(0,j.useRef)(i);return(0,j.useEffect)(()=>{i!==g.current&&(h(i),g.current=i)},[i]),{selectionMode:t,disallowEmptySelection:n,selectionBehavior:m,setSelectionBehavior:h,get isFocused(){return o.current},setFocused(e){o.current=e,s(e)},get focusedKey(){return c.current},get childFocusStrategy(){return l.current},setFocusedKey(e,t=`first`){c.current=e,l.current=t,u(e)},selectedKeys:d,setSelectedKeys(e){(r||!Ze(e,d))&&f(e)},disabledKeys:p,disabledBehavior:a}}function $e(e,t){return e?e===`all`?`all`:new $(e):t}var et=class e{constructor(e,t,n){this.collection=e,this.state=t,this.allowsCellSelection=n?.allowsCellSelection??!1,this._isSelectAll=null,this.layoutDelegate=n?.layoutDelegate||null,this.fullCollection=n?.fullCollection||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,t){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,t)}get selectedKeys(){return this.state.selectedKeys===`all`?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode===`none`)return!1;let t=this.getKey(e);return t==null?!1:this.state.selectedKeys===`all`?this.canSelectItem(t):this.state.selectedKeys.has(t)}get isEmpty(){return this.state.selectedKeys!==`all`&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys===`all`)return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),t=this.state.selectedKeys;return this._isSelectAll=e.every(e=>t.has(e)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&Ye(this.collection,n,e)<0)&&(e=n)}return e?.key??null}get lastSelectedKey(){let e=null;for(let t of this.state.selectedKeys){let n=this.collection.getItem(t);(!e||n&&Ye(this.collection,n,e)>0)&&(e=n)}return e?.key??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n;if(this.state.selectedKeys===`all`)n=new $([t],t,t);else{let e=this.state.selectedKeys,r=e.anchorKey??t;n=new $(e,r,t);for(let i of this.getKeyRange(r,e.currentKey??t))n.delete(i);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&n.add(e)}this.state.setSelectedKeys(n)}getKeyRange(e,t){let n=this.collection.getItem(e),r=this.collection.getItem(t);return n&&r?Ye(this.collection,n,r)<=0?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){if(this.layoutDelegate?.getKeyRange)return this.layoutDelegate.getKeyRange(e,t);let n=[],r=e;for(;r!=null;){let e=this.collection.getItem(r);if(e&&(e.type===`item`||e.type===`cell`&&this.allowsCellSelection)&&n.push(r),r===t)return n;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let t=this.collection.getItem(e);if(!t||t.type===`cell`&&this.allowsCellSelection)return e;for(;t&&t.type!==`item`&&t.parentKey!=null;)t=this.collection.getItem(t.parentKey);return!t||t.type!==`item`?null:t.key}toggleSelection(e){if(this.selectionMode===`none`)return;if(this.selectionMode===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;
1let n=new $(this.state.selectedKeys===`all`?this.getSelectAllKeys():this.state.selectedKeys);n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new $([t],t,t):new $;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode===`none`)return;let t=new $;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode===`single`))break}this.state.setSelectedKeys(t)}getSelectAllKeys(){let e=this.fullCollection??this.collection,t=[],n=r=>{for(;r!=null;){if(this.canSelectItemIn(r,e)){let i=e.getItem(r);i?.type===`item`&&t.push(r),i?.hasChildNodes&&(this.allowsCellSelection||i.type!==`item`)&&n(qe(Ke(i,e))?.key??null)}r=e.getKeyAfter(r)}};return n(e.getFirstKey()),t}selectAll(){!this.isSelectAll&&this.selectionMode===`multiple`&&this.state.setSelectedKeys(`all`)}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys===`all`||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new $)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode!==`none`&&(this.selectionMode===`single`?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior===`toggle`||t&&(t.pointerType===`touch`||t.pointerType===`virtual`)?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let t=this.selectedKeys;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,t){if(this.state.selectionMode===`none`||this.state.disabledKeys.has(e))return!1;let n=t.getItem(e);return!(!n||n?.props?.isDisabled||n.type===`cell`&&!this.allowsCellSelection)}isDisabled(e){let t=this.collection.getItem(e);return this.state.disabledBehavior===`all`&&(this.state.disabledKeys.has(e)||!!t?.props?.isDisabled)&&t?.props?.disabledBehavior!==`selection`}isLink(e){return!!this.collection.getItem(e)?.props?.href}getItemProps(e){return this.collection.getItem(e)?.props}withCollection(t){return new e(t,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}},tt=class{build(e,t){return this.context=t,nt(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:t,items:n}=e;if(j.isValidElement(t)&&t.type===j.Fragment)yield*this.iterateCollection({children:t.props.children,items:n});else if(typeof t==`function`){if(!n)throw Error(`props.children was a function but props.items is missing`);let e=0;for(let r of n)yield*this.getFullNode({value:r,index:e},{renderer:t}),e++}else{let e=[];j.Children.forEach(t,t=>{t&&e.push(t)});let n=0;for(let t of e){let e=this.getFullNode({element:t,index:n},{});for(let t of e)n++,yield t}}}
vendor: 2,740 bytes, line 1
1getKey(e,t,n,r){if(e.key!=null)return e.key;if(t.type===`cell`&&t.key!=null)return`${r}${t.key}`;let i=t.value;if(i!=null){let e=i.key??i.id;if(e==null)throw Error(`No key found for item`);return e}return r?`${r}.${t.index}`:`$.${t.index}`}getChildState(e,t){return{renderer:t.renderer||e.renderer}}*getFullNode(e,t,n,r){if(j.isValidElement(e.element)&&e.element.type===j.Fragment){let i=[];j.Children.forEach(e.element.props.children,e=>{i.push(e)});let a=e.index??0;for(let e of i)yield*this.getFullNode({element:e,index:a++},t,n,r);return}let i=e.element;if(!i&&e.value&&t&&t.renderer){let n=this.cache.get(e.value);if(n&&(!n.shouldInvalidate||!n.shouldInvalidate(this.context))){n.index=e.index,n.parentKey=r?r.key:null,yield n;return}i=t.renderer(e.value)}if(j.isValidElement(i)){let a=i.type;if(typeof a!=`function`&&typeof a.getCollectionNode!=`function`){let e=i.type;throw Error(`Unknown element <${e}> in collection.`)}let o=a.getCollectionNode(i.props,this.context),s=e.index??0,c=o.next();for(;!c.done&&c.value;){let a=c.value;e.index=s;let l=a.key??null;l??=a.element?null:this.getKey(i,e,t,n);let u=[...this.getFullNode({...a,key:l,index:s,wrapper:rt(e.wrapper,a.wrapper)},this.getChildState(t,a),n?`${n}${i.key}`:i.key,r)];for(let t of u){if(t.value=a.value??e.value??null,t.value&&this.cache.set(t.value,t),e.type&&t.type!==e.type)throw Error(`Unsupported type <${it(t.type)}> in <${it(r?.type??`unknown parent type`)}>. Only <${it(e.type)}> is supported.`);s++,yield t}c=o.next(u)}return}if(e.key==null||e.type==null)return;let a=this,o={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:(r?.level??0)+ +(r?.type===`item`),index:e.index,rendered:e.rendered,textValue:e.textValue??``,"aria-label":e[`aria-label`],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:nt(function*(){if(!e.hasChildNodes||!e.childNodes)return;let n=0;for(let r of e.childNodes()){r.key!=null&&(r.key=`${o.key}${r.key}`);let e=a.getFullNode({...r,index:n},a.getChildState(t,r),o.key,o);for(let t of e)n++,yield t}})};yield o}constructor(){this.cache=new WeakMap}};function nt(e){let t=[],n=null;return{*[Symbol.iterator](){for(let e of t)yield e;n||=e();for(let e of n)t.push(e),yield e}}}function rt(e,t){if(e&&t)return n=>e(t(n));if(e)return e;if(t)return t}function it(e){return e[0].toUpperCase()+e.slice(1)}function at(e,t,n){let r=(0,j.useMemo)(()=>new tt,[]),{children:i,items:a,collection:o}=e;return(0,j.useMemo)(()=>o||t(r.build({children:i,items:a},n)),[r,i,a,o,n,t])}export{L as C,V as S,ve as _,Ue as a,K as b,Q as c,we as d,Te as f,se as g,he as h,Ke as i,Ee as l,be as m,et as n,He as o,xe as p,Qe as r,Be as s,at as t,Ce as u,G as v,H as x,U 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.