"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7565],{82166:function(e,t,n){n.d(t,{D:function(){return i}});function i(e,t){var n,i,o,s,r=t.waitMs,l=t.timing,a=void 0===l?"trailing":l,d=t.maxWaitMs;if(void 0!==d&&void 0!==r&&d<r)throw Error("debounce: maxWaitMs (".concat(d,") cannot be less than waitMs (").concat(r,")"));var c=function(){if(void 0!==o){if(void 0!==i){var t=i;i=void 0,clearTimeout(t)}var n=o;o=void 0,s=e.apply(void 0,n)}},u=function(){if(void 0!==n){var e=n;n=void 0,clearTimeout(e),void 0!==o&&c()}},h=function(e){o=e,void 0!==d&&void 0===i&&(i=setTimeout(c,d))};return{call:function(){for(var t,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(void 0===n)"trailing"===a?h(i):s=e.apply(void 0,i);else{"leading"!==a&&h(i);var l=n;n=void 0,clearTimeout(l)}return n=setTimeout(u,null!==(t=null!=r?r:d)&&void 0!==t?t:0),s},cancel:function(){if(void 0!==n){var e=n;n=void 0,clearTimeout(e)}if(void 0!==i){var e=i;i=void 0,clearTimeout(e)}o=void 0},flush:function(){return u(),s},get isPending(){return void 0!==n},get cachedValue(){return s}}}},91342:function(e,t,n){n.d(t,{y:function(){return c}});var i=n(85893),o=n(17920),s=n(67294),r=n(94525),l=n(48152),a=n(30912),d=n(48490);let c=(0,s.forwardRef)((e,t)=>{let n=(0,d.l)(),s=(0,a.u)(),c=(0,o.dG)(n.getContentProps(),s.getPresenceProps(),e);return s.unmounted?null:(0,i.jsx)(l.e.div,{...c,ref:(0,r.F)(s.ref,t)})});c.displayName="PopoverContent"},10531:function(e,t,n){n.d(t,{N:function(){return d}});var i=n(85893),o=n(17920),s=n(67294),r=n(48152),l=n(30912),a=n(48490);let d=(0,s.forwardRef)((e,t)=>{let n=(0,a.l)(),s=(0,l.u)(),d=(0,o.dG)(n.getPositionerProps(),e);return s.unmounted?null:(0,i.jsx)(r.e.div,{...d,ref:t})});d.displayName="PopoverPositioner"},84984:function(e,t,n){n.d(t,{P:function(){return P}});var i=n(85893),o=n(17920),s=n(89781),r=n(52910),l=n(30912),a=n(3148),d=n(75973),c=n(7120),u=n(40865),h=n(88366),g=n(46490),p=n(78061),m=n(36959),f=n(67522),v=(0,a.F)("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger").build(),E=(0,d.tp)({getAnchorId:e=>e.ids?.anchor??`popover:${e.id}:anchor`,getTriggerId:e=>e.ids?.trigger??`popover:${e.id}:trigger`,getContentId:e=>e.ids?.content??`popover:${e.id}:content`,getPositionerId:e=>e.ids?.positioner??`popover:${e.id}:popper`,getArrowId:e=>e.ids?.arrow??`popover:${e.id}:arrow`,getTitleId:e=>e.ids?.title??`popover:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`popover:${e.id}:desc`,getCloseTriggerId:e=>e.ids?.closeTrigger??`popover:${e.id}:close`,getAnchorEl:e=>E.getById(e,E.getAnchorId(e)),getTriggerEl:e=>E.getById(e,E.getTriggerId(e)),getContentEl:e=>E.getById(e,E.getContentId(e)),getPositionerEl:e=>E.getById(e,E.getPositionerId(e)),getTitleEl:e=>E.getById(e,E.getTitleId(e)),getDescriptionEl:e=>E.getById(e,E.getDescriptionId(e)),getFocusableEls:e=>(0,d.sd)(E.getContentEl(e)),getFirstFocusableEl:e=>E.getFocusableEls(e)[0]}),O=(0,f.e)()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","portalled","positioning"]);(0,p.xQ)(O);var x=n(58151),I=n(67294),b=n(82371),C=n(30032),T=n(63581);let y=(e={})=>{let{getRootNode:t}=(0,b.U)(),{dir:n}=(0,C.P)(),i={id:(0,I.useId)(),dir:n,getRootNode:t,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e},s={...i,open:e.open,onOpenChange:(0,T.z)(e.onOpenChange,{sync:!0})},[r,l]=(0,x.eO)(function(e){let t=(0,p.oA)(e);return(0,o.C8)({id:"popover",initial:t.open?"open":"closed",context:{closeOnInteractOutside:!0,closeOnEscape:!0,autoFocus:!0,modal:!1,portalled:!0,positioning:{placement:"bottom",...t.positioning},currentPlacement:void 0,...t,renderedElements:{title:!0,description:!0}},computed:{currentPortalled:e=>!!e.modal||!!e.portalled},watch:{open:["toggleVisibility"]},entry:["checkRenderedElements"],states:{closed:{on:{"CONTROLLED.OPEN":{target:"open",actions:["setInitialFocus"]},TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus"]}]}},open:{activities:["trapFocus","preventScroll","hideContentBelow","trackPositioning","trackDismissableElement","proxyTabFocus"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:"reposition"}}}}},{guards:{isOpenControlled:e=>!!e["open.controlled"]},activities:{trackPositioning(e){e.currentPlacement=e.positioning.placement;let t=E.getAnchorEl(e)??E.getTriggerEl(e);return(0,c.x_)(t,()=>E.getPositionerEl(e),{...e.positioning,defer:!0,onComplete(t){e.currentPlacement=t.placement}})},trackDismissableElement(e,t,{send:n}){let i=!0;return(0,h.A)(()=>E.getContentEl(e),{pointerBlocking:e.modal,exclude:E.getTriggerEl(e),defer:!0,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.closeOnEscape||t.preventDefault()},onInteractOutside(t){e.onInteractOutside?.(t),t.defaultPrevented||(i=!(t.detail.focusable||t.detail.contextmenu),e.closeOnInteractOutside||t.preventDefault())},onPointerDownOutside:e.onPointerDownOutside,onFocusOutside:e.onFocusOutside,persistentElements:e.persistentElements,onDismiss(){n({type:"CLOSE",src:"interact-outside",restoreFocus:i})}})},proxyTabFocus(e){if(!e.modal&&e.portalled)return(0,d.ne)(()=>E.getContentEl(e),{triggerElement:E.getTriggerEl(e),defer:!0,onFocus(e){e.focus({preventScroll:!0})}})},hideContentBelow(e){if(e.modal)return(0,u.G)(()=>[E.getContentEl(e),E.getTriggerEl(e)],{defer:!0})},preventScroll(e){if(e.modal)return(0,g.M)(E.getDoc(e))},trapFocus(e){let t;if(e.modal)return(0,d.Y3)(()=>{let n=E.getContentEl(e);if(n){t=(0,m.v)(n,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,document:E.getDoc(e),fallbackFocus:n,initialFocus:(0,d.Q2)({root:E.getContentEl(e),getInitialEl:e.initialFocusEl,enabled:e.autoFocus})});try{t.activate()}catch{}}}),()=>t?.deactivate()}},actions:{reposition(e,t){let n=E.getAnchorEl(e)??E.getTriggerEl(e);(0,c.x_)(n,()=>E.getPositionerEl(e),{...e.positioning,...t.options,defer:!0,listeners:!1,onComplete(t){e.currentPlacement=t.placement}})},checkRenderedElements(e){(0,d.Wn)(()=>{Object.assign(e.renderedElements,{title:!!E.getTitleEl(e),description:!!E.getDescriptionEl(e)})})},setInitialFocus(e){e.modal||(0,d.Wn)(()=>{let t=(0,d.Q2)({root:E.getContentEl(e),getInitialEl:e.initialFocusEl,enabled:e.autoFocus});t?.focus({preventScroll:!0})})},setFinalFocus(e,t){let n=t.restoreFocus??t.previousEvent?.restoreFocus;(null==n||n)&&(0,d.Wn)(()=>{let t=E.getTriggerEl(e);t?.focus({preventScroll:!0})})},invokeOnOpen(e){e.onOpenChange?.({open:!0})},invokeOnClose(e){e.onOpenChange?.({open:!1})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}})}(i),{context:s});return function(e,t,n){let i=e.matches("open"),o=e.context.currentPlacement,s=e.context.currentPortalled,r=e.context.renderedElements,l=(0,c.hn)({...e.context.positioning,placement:o});return{portalled:s,open:i,setOpen(e){e!==i&&t(e?"OPEN":"CLOSE")},reposition(e={}){t({type:"POSITIONING.SET",options:e})},getArrowProps:()=>n.element({id:E.getArrowId(e.context),...v.arrow.attrs,dir:e.context.dir,style:l.arrow}),getArrowTipProps:()=>n.element({...v.arrowTip.attrs,dir:e.context.dir,style:l.arrowTip}),getAnchorProps:()=>n.element({...v.anchor.attrs,dir:e.context.dir,id:E.getAnchorId(e.context)}),getTriggerProps:()=>n.button({...v.trigger.attrs,dir:e.context.dir,type:"button","data-placement":o,id:E.getTriggerId(e.context),"aria-haspopup":"dialog","aria-expanded":i,"data-state":i?"open":"closed","aria-controls":E.getContentId(e.context),onPointerDown(e){(0,d.G6)()&&e.currentTarget.focus()},onClick(e){e.defaultPrevented||t("TOGGLE")},onBlur(e){t({type:"TRIGGER_BLUR",target:e.relatedTarget})}}),getIndicatorProps:()=>n.element({...v.indicator.attrs,dir:e.context.dir,"data-state":i?"open":"closed"}),getPositionerProps:()=>n.element({id:E.getPositionerId(e.context),...v.positioner.attrs,dir:e.context.dir,style:l.floating}),getContentProps:()=>n.element({...v.content.attrs,dir:e.context.dir,id:E.getContentId(e.context),tabIndex:-1,role:"dialog",hidden:!i,"data-state":i?"open":"closed","data-expanded":(0,d.PB)(i),"aria-labelledby":r.title?E.getTitleId(e.context):void 0,"aria-describedby":r.description?E.getDescriptionId(e.context):void 0,"data-placement":o}),getTitleProps:()=>n.element({...v.title.attrs,id:E.getTitleId(e.context),dir:e.context.dir}),getDescriptionProps:()=>n.element({...v.description.attrs,id:E.getDescriptionId(e.context),dir:e.context.dir}),getCloseTriggerProps:()=>n.button({...v.closeTrigger.attrs,dir:e.context.dir,id:E.getCloseTriggerId(e.context),type:"button","aria-label":"close",onClick(e){e.defaultPrevented||t("CLOSE")}})}}(r,l,x.vs)};var w=n(48490);let P=e=>{let[t,{children:n,...a}]=(0,s.l)(e),d=y(a),c=(0,r.o)((0,o.dG)({present:d.open},t));return(0,i.jsx)(w.H,{value:d,children:(0,i.jsx)(l.w,{value:c,children:n})})}},31243:function(e,t,n){n.d(t,{x:function(){return d}});var i=n(85893),o=n(17920),s=n(67294),r=n(48152),l=n(30912),a=n(48490);let d=(0,s.forwardRef)((e,t)=>{let n=(0,a.l)(),s=(0,l.u)(),d=(0,o.dG)({...n.getTriggerProps(),"aria-controls":s.unmounted?void 0:n.getTriggerProps()["aria-controls"]},e);return(0,i.jsx)(r.e.button,{...d,ref:t})});d.displayName="PopoverTrigger"},48490:function(e,t,n){n.d(t,{H:function(){return i},l:function(){return o}});let[i,o]=(0,n(33581).k)({name:"PopoverContext",hookName:"usePopoverContext",providerName:"<PopoverProvider />"})},86:function(e,t,n){n.d(t,{MG:function(){return x}});var i=n(67294),o=n(73935);function s(e,t,n){let i,o=n.initialDeps??[];return()=>{var s,r,l,a;let d,c;n.key&&(null==(s=n.debug)?void 0:s.call(n))&&(d=Date.now());let u=e();if(!(u.length!==o.length||u.some((e,t)=>o[t]!==e)))return i;if(o=u,n.key&&(null==(r=n.debug)?void 0:r.call(n))&&(c=Date.now()),i=t(...u),n.key&&(null==(l=n.debug)?void 0:l.call(n))){let e=Math.round((Date.now()-d)*100)/100,t=Math.round((Date.now()-c)*100)/100,i=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,` font-size: .6rem; font-weight: bold; color: hsl(${Math.max(0,Math.min(120-120*i,120))}deg 100% 31%);`,null==n?void 0:n.key)}return null==(a=null==n?void 0:n.onChange)||a.call(n,i),i}}function r(e,t){if(void 0!==e)return e;throw Error(`Unexpected undefined${t?`: ${t}`:""}`)}let l=(e,t)=>1>Math.abs(e-t),a=(e,t)=>{let n;return function(...i){clearTimeout(n),n=setTimeout(()=>e.apply(this,i),t)}},d=e=>e,c=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),i=[];for(let e=t;e<=n;e++)i.push(e);return i},u=(e,t)=>{let n=e.scrollElement;if(!n)return;let i=e=>{let{width:n,height:i}=e;t({width:Math.round(n),height:Math.round(i)})};if(i(n.getBoundingClientRect()),"undefined"==typeof ResizeObserver)return()=>{};let o=new ResizeObserver(e=>{let t=e[0];if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e){i({width:e.inlineSize,height:e.blockSize});return}}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},h={passive:!0},g="undefined"==typeof window||"onscrollend"in window,p=(e,t)=>{let n=e.scrollElement;if(!n)return;let i=0,o=g?()=>void 0:a(()=>{t(i,!1)},e.options.isScrollingResetDelay),s=s=>()=>{i=n[e.options.horizontal?"scrollLeft":"scrollTop"],o(),t(i,s)},r=s(!0),l=s(!1);return l(),n.addEventListener("scroll",r,h),n.addEventListener("scrollend",l,h),()=>{n.removeEventListener("scroll",r),n.removeEventListener("scrollend",l)}},m=(e,t,n)=>{if(null==t?void 0:t.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},f=(e,{adjustments:t=0,behavior:n},i)=>{var o,s;null==(s=null==(o=i.scrollElement)?void 0:o.scrollTo)||s.call(o,{[i.options.horizontal?"left":"top"]:e+t,behavior:n})};class v{constructor(e){this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null,t=()=>e||("undefined"!=typeof ResizeObserver?e=new ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{void 0===n&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:d,rangeExtractor:c,onChange:()=>{},measureElement:m,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var n,i;let{startIndex:o,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},r=this.calculateRange();(e||o!==(null==r?void 0:r.startIndex)||s!==(null==r?void 0:r.endIndex))&&(null==(i=(n=this.options).onChange)||i.call(n,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{let e=this.options.getScrollElement();this.scrollElement!==e&&(this.cleanup(),this.scrollElement=e,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;let n=this.isScrolling;this.isScrolling=t,this.notify(n!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=s(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,n,i)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:i}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{let n=new Map,i=new Map;for(let o=t-1;o>=0;o--){let t=e[o];if(n.has(t.lane))continue;let s=i.get(t.lane);if(null==s||t.end>s.end?i.set(t.lane,t):t.end<s.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=s(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:i},o)=>{let s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];let r=this.measurementsCache.slice(0,s);for(let l=s;l<e;l++){let e=i(l),s=1===this.options.lanes?r[l-1]:this.getFurthestMeasurement(r,l),a=s?s.end+this.options.gap:t+n,d=o.get(e),c="number"==typeof d?d:this.options.estimateSize(l),u=a+c,h=s?s.lane:l%this.options.lanes;r[l]={index:l,start:a,size:c,end:u,key:e,lane:h}}return this.measurementsCache=r,r},{key:!1,debug:()=>this.options.debug}),this.calculateRange=s(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){let i=e.length-1,o=E(0,i,t=>e[t].start,n),s=o;for(;s<i&&e[s].end<n+t;)s++;return{startIndex:o,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:n}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=s(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,n,i)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{let n=this.measurementsCache[this.indexFromElement(e)];if(!n||!e.isConnected){this.measureElementCache.forEach((t,n)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(n))});return}let i=this.measureElementCache.get(n.key);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.measureElementCache.set(n.key,e));let o=this.options.measureElement(e,t,this);this.resizeItem(n,o)},this.resizeItem=(e,t)=>{let n=t-(this.itemSizeCache.get(e.key)??e.size);0!==n&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,n,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=s(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let i=0,o=e.length;i<o;i++){let o=t[e[i]];n.push(o)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();return r(t[E(0,t.length-1,e=>r(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{let n=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));let i=this.options.horizontal?"scrollWidth":"scrollHeight";return Math.max(Math.min((this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-this.getSize(),e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=r(this.getMeasurements()[e]);if("auto"===t){if(n.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}}let i="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&(clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");let[i,o]=this.getOffsetForIndex(e,t);this._scrollToOffset(i,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&(this.scrollToIndexTimeoutId=setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){let[t]=this.getOffsetForIndex(e,o);l(t,this.scrollOffset)||this.scrollToIndex(e,{align:o,behavior:n})}else this.scrollToIndex(e,{align:o,behavior:n})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;let t=this.getMeasurements();return(0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)))-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}let E=(e,t,n,i)=>{for(;e<=t;){let o=(e+t)/2|0,s=n(o);if(s<i)e=o+1;else{if(!(s>i))return o;t=o-1}}return e>0?e-1:0},O="undefined"!=typeof document?i.useLayoutEffect:i.useEffect;function x(e){return function(e){let t=i.useReducer(()=>({}),{})[1],n={...e,onChange:(n,i)=>{var s;i?(0,o.flushSync)(t):t(),null==(s=e.onChange)||s.call(e,n,i)}},[s]=i.useState(()=>new v(n));return s.setOptions(n),i.useEffect(()=>s._didMount(),[]),O(()=>s._willUpdate()),s}({observeElementRect:u,observeElementOffset:p,scrollToFn:f,...e})}}}]);