"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5678],{45678:(e,t,r)=>{r.d(t,{N:()=>f});var s=r(60857),i=r(69270),l=r(27708),n=r(52422),h=r(90637);function f(e){let t=e+"CollectionProvider",[r,f]=(0,i.A)(t),[u,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=e=>{let{scope:t,children:r}=e,i=s.useRef(null),l=s.useRef(new Map).current;return(0,h.jsx)(u,{scope:t,itemMap:l,collectionRef:i,children:r})};a.displayName=t;let c=e+"CollectionSlot",y=(0,n.TL)(c),p=s.forwardRef((e,t)=>{let{scope:r,children:s}=e,i=o(c,r),n=(0,l.s)(t,i.collectionRef);return(0,h.jsx)(y,{ref:n,children:s})});p.displayName=c;let d=e+"CollectionItemSlot",k="data-radix-collection-item",R=(0,n.TL)(d),m=s.forwardRef((e,t)=>{let{scope:r,children:i,...n}=e,f=s.useRef(null),u=(0,l.s)(t,f),a=o(d,r);return s.useEffect(()=>(a.itemMap.set(f,{ref:f,...n}),()=>void a.itemMap.delete(f))),(0,h.jsx)(R,{...{[k]:""},ref:u,children:i})});return m.displayName=d,[{Provider:a,Slot:p,ItemSlot:m},function(t){let r=o(e+"CollectionConsumer",t);return s.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${k}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},f]}var u=new WeakMap;function o(e,t){var r,s;let i,l,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let h=(r=e,s=t,i=r.length,(n=(l=a(s))>=0?l:i+l)<0||n>=i?-1:n);return -1===h?void 0:e[h]}function a(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],u.set(this,!0)}set(e,t){return u.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let s,i=this.has(t),l=this.#e.length,n=a(e),h=n>=0?n:l+n,f=h<0||h>=l?-1:h;if(f===this.size||i&&f===this.size-1||-1===f)return this.set(t,r),this;let u=this.size+ +!i;n<0&&h++;let o=[...this.#e],c=!1;for(let e=h;e<u;e++)if(h===e){let l=o[e];o[e]===t&&(l=o[e+1]),i&&this.delete(t),s=this.get(l),this.set(t,r)}else{c||o[e-1]!==t||(c=!0);let r=o[c?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=o(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=o(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return o(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}})}}]);