PageSourceSearch

https://use.kick.co/assets/usePositioner-ryLrusVg.js

js kick.co collected 2026-10-01 15:12:56 UTC 85,970 bytes, 2 lines download raw bytes

1import{o as e,t}from"./rolldown-runtime-C0FnF6B9.js";import{fr as n,nr as r,pr as i,rr as a}from"./Button-C_knaJ-O.js";var o=t((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.5`})),s=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=o()})),c=e(s(),1),l=e(i(),1),u={};function d(e,t){let n=l.useRef(u);return n.current===u&&(n.current=e(t)),n}var f=n();a();var p=[],m=void 0;function h(){return m}function g(e){p.push(e)}function _(e){let t=(t,n)=>{let r=d(y).current,i;try{m=r;for(let e of p)e.before(r);i=e(t,n);for(let e of p)e.after(r);r.didInitialize=!0}finally{m=void 0}return i};return t.displayName=e.displayName||e.name,t}function v(e){return l.forwardRef(_(e))}function y(){return{didInitialize:!1}}function b(){}var x=Object.freeze([]),S=Object.freeze({}),C=typeof document<`u`?l.useLayoutEffect:()=>{};function w(e,t){return function(n,...r){let i=new URL(e);
1return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var T=w(`https://base-ui.com/production-error`,`Base UI`);function E(e){l.useEffect(e,x)}var D=0,O=class e{constructor(){r(this,`currentId`,D),r(this,`clear`,()=>{this.currentId!==D&&(clearTimeout(this.currentId),this.currentId=D)}),r(this,`disposeEffect`,()=>this.clear)}static create(){return new e}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=D,t()},e)}isStarted(){return this.currentId!==D}};function k(){let e=d(O.create).current;return E(e.disposeEffect),e}function A(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:j,platform:M,maxTouchPoints:N}=A(),P=j.toLowerCase(),F=M.toLowerCase(),I=/^i(os$|p)/.test(F)||F===`macintel`&&N>1,ee=`android`,L=F===ee||P.includes(ee),R=!I&&F.startsWith(`mac`);F.startsWith(`win`),!L&&/^(linux|chrome os)/.test(F);var te=R||I,ne,z,re=typeof CSS<`u`&&!!((ne=(z=CSS).supports)!=null&&ne.call(z,`-webkit-backdrop-filter:none`)),ie=!re&&P.includes(`firefox`);!re&&P.includes(`chrom`);var B=te,ae=/jsdom|happydom/.test(P);function oe(e){e.preventDefault(),e.stopPropagation()}function se(e){return`nativeEvent`in e}function ce(e){return e.pointerType===``&&e.isTrusted?!0:L&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function le(e){return ae?!1:!L&&e.width===0&&e.height===0||L&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ue(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function de(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function fe(){return typeof window<`u`}function V(e){return me(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pe(e){var t;return(t=(me(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function me(e){return fe()?e instanceof Node||e instanceof H(e).Node:!1}function U(e){return fe()?e instanceof Element||e instanceof H(e).Element:!1}function W(e){return fe()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function G(e){return!fe()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function he(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=K(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ge(e){return/^(table|td|th)$/.test(V(e))}function _e(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ve=/transform|translate|scale|rotate|perspective|filter/,ye=/paint|layout|strict|content/,be=e=>!!e&&e!==`none`,xe;function Se(e){let t=U(e)?K(e):e;return be(t.transform)||be(t.translate)||be(t.scale)||be(t.rotate)||be(t.perspective)||!we()&&(be(t.backdropFilter)||be(t.filter))||ve.test(t.willChange||``)||ye.test(t.contain||``)}function Ce(e){let t=q(e);for(;W(t)&&!Te(t);){if(Se(t))return t;if(_e(t))return null;t=q(t)}return null}function we(){return xe??(xe=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`)),xe}function Te(e){return/^(html|body|#document)$/.test(V(e))}function K(e){return H(e).getComputedStyle(e)}function Ee(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(V(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||G(e)&&e.host||pe(e);return G(t)?t.host:t}function De(e){let t=q(e);return Te(t)?(e.ownerDocument||e).body:W(t)&&he(t)?t:De(t)}function Oe(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let i=De(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=H(i);if(a){let e=ke(o);return t.concat(o,o.visualViewport||[],he(i)?i:[],e&&n?Oe(e):[])}return t.concat(i,Oe(i,[],n))}function ke(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ae=`data-base-ui-focusable`,je=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Me=`ArrowLeft`,Ne=`ArrowRight`,Pe=`ArrowUp`,Fe=`ArrowDown`;function Ie(e){var t;let n=e.activeElement;for(;(n==null||(t=n.shadowRoot)==null?void 0:t.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function J(e,t){var n;if(!e||!t)return!1;let r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;
1if(r&&G(r)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Le(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Re(e,t){if(!U(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(J(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function ze(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Be(e){return e.matches(`html,body`)}function Ve(e){return W(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function He(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${je}`))!=null}function Ue(e){return e?e.getAttribute(`role`)===`combobox`&&Ve(e):!1}function We(e){if(!e||ae)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Ge(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ke(e,t){return t!=null&&!ue(t)?0:typeof e==`function`?e():e}function qe(e,t,n){let r=Ke(e,n);return typeof r==`number`?r:r==null?void 0:r[t]}function Je(e){return typeof e==`function`?e():e}function Ye(e,t){return t||e===`click`||e===`mousedown`}function Xe(e){return(e==null?void 0:e.includes(`mouse`))&&e!==`mousedown`}var Ze=`none`,Qe=`trigger-press`,$e=`trigger-hover`,et=`trigger-focus`,tt=`outside-press`,nt=`item-press`,rt=`close-press`,it=`clear-press`,at=`input-change`,ot=`input-clear`,st=`input-paste`,ct=`input-press`,lt=`focus-out`,ut=`escape-key`,dt=`close-watcher`,ft=`list-navigation`,pt=`keyboard`,mt=`pointer`,ht=`cancel-open`,gt=`sibling-open`,_t=`disabled`,vt=`missing`,yt=`initial`,bt=`imperative-action`,xt=`swipe`,St=`window-resize`;function Y(e,t,n,r){let i=!1,a=!1,o=r??S;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function Ct(e,t,n){let r=n??S;return{reason:e,event:t??new Event(`base-ui`),...r}}function X(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function wt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Tt(e,t,n,r){let i=d(Dt).current;return Ot(i,e,t,n,r)&&At(i,[e,t,n,r]),i.callback}function Et(e){let t=d(Dt).current;return kt(t,e)&&At(t,e),t.callback}function Dt(){return{callback:null,cleanup:null,refs:[]}}function Ot(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function kt(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function At(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function jt(e){let t=d(Mt,e).current;return t.next=e,C(t.effect),t}function Mt(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Nt={...l},Pt=Nt.useInsertionEffect,Ft=Pt&&Pt!==Nt.useLayoutEffect?Pt:e=>e();function Z(e){let t=d(It).current;return t.next=e,Ft(t.effect),t.trampoline}function It(){let e={next:void 0,callback:Lt,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function Lt(){}a();var Rt=null;globalThis.requestAnimationFrame;var zt=new class{constructor(){r(this,`callbacks`,[]),r(this,`callbacksCount`,0),r(this,`nextId`,1),r(this,`startId`,1),r(this,`isScheduled`,!1),r(this,`tick`,e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1){var r;(r=t[n])==null||r.call(t,e)}})}request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},Bt=class e{constructor(){r(this,`currentId`,Rt),r(this,`cancel`,()=>{this.currentId!==Rt&&(zt.cancel(this.currentId),this.currentId=Rt)}),r(this,`disposeEffect`,()=>this.cancel)}static create(){return new e}static request(e){return zt.request(e)}static cancel(e){return zt.cancel(e)}request(e){this.cancel(),this.currentId=zt.request(()=>{this.currentId=Rt,e()})}};function Vt(){let e=d(Bt.create).current;return E(e.disposeEffect),e}function Ht(e){return(e==null?void 0:e.ownerDocument)||document}var Ut={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Wt={...Ut,position:`fixed`,top:0,left:0},Gt={...Ut,position:`absolute`},Kt=l.forwardRef(function(e,t){let[n,r]=l.useState();C(()=>{B&&re&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,f.jsx)(`span`,{...e,ref:t,style:Wt,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})}),qt=Math.min,Jt=Math.max,Yt=Math.round,Xt=Math.floor,Zt=e=>({x:e,y:e}),Qt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $t(e,t,n){return Jt(e,qt(t,n))}function en(e,t){return typeof e==`function`?e(t):e}function Q(e){return e.split(`-`)[0]}function tn(e){return e.split(`-`)[1]}function nn(e){return e===`x`?`y`:`x`}function rn(e){return e===`y`?`height`:`width`}function an(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function on(e){return nn(an(e))}function sn(e,t,n){n===void 0&&(n=!1);
1let r=tn(e),i=on(e),a=rn(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=gn(o)),[o,gn(o)]}function cn(e){let t=gn(e);return[ln(e),t,ln(t)]}function ln(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var un=[`left`,`right`],dn=[`right`,`left`],fn=[`top`,`bottom`],pn=[`bottom`,`top`];function mn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?dn:un:t?un:dn;case`left`:case`right`:return t?fn:pn;default:return[]}}function hn(e,t,n,r){let i=tn(e),a=mn(Q(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ln)))),a}function gn(e){let t=Q(e);return Qt[t]+e.slice(t.length)}function _n(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_n(e)}function yn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bn(e,t,n){return Math.floor(e/t)!==n}function xn(e,t){return t<0||t>=e.length}function Sn(e,t){return wn(e.current,{disabledIndices:t})}function Cn(e,t){return wn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function wn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&En(e,a,r));return a}function Tn(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!En(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Xt(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!En(e,r,s))return r}};d&&oe(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=wn(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=wn(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}xn(e,f)&&(f=u)}if(n===`both`){let n=Xt(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&oe(t),u%o===o-1?r&&(f=wn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=wn(e,{startingIndex:u,disabledIndices:s}),r&&bn(f,o,n)&&(f=wn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),bn(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&oe(t),u%o===0?r&&(f=wn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=wn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&bn(f,o,n)&&(f=wn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),bn(f,o,n)&&(f=u));let c=Xt(l/o)===n;xn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:wn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function En(e,t,n){if(typeof n==`function`?n(t):(n==null?void 0:n.includes(t))??!1)return!0;let r=e[t];return r?!On(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Dn(e){return e.visibility===`hidden`||e.visibility===`collapse`}function On(e,t=e?K(e):null){return!e||!e.isConnected||!t||Dn(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var kn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function An(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return G(n)?n.host:null}function jn(e){for(let t of Array.from(e.children))if(V(t)===`summary`)return t;return null}function Mn(e,t){let n=jn(t);return!!n&&(e===n||J(n,e))}function Nn(e){let t=e?V(e):``;return e!=null&&e.matches(kn)&&(t!==`summary`||e.parentElement!=null&&V(e.parentElement)===`details`&&jn(e.parentElement)===e)&&(t!==`details`||jn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Pn(e){if(!Nn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=An(t)){let n=t!==e,r=V(t)===`slot`;if(t.hasAttribute(`inert`)||n&&V(t)===`details`&&!t.open&&!Mn(e,t)||t.hasAttribute(`hidden`)||!r&&!Fn(t,n))return!1}return!0}function Fn(e,t){let n=K(e);return t?n.display!==`none`:On(e,n)}function In(e){let t=e.tabIndex;if(t<0){let t=V(e);if(t===`details`||t===`audio`||t===`video`||W(e)&&e.isContentEditable)return 0}return t}function Ln(e){if(V(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Rn(e,t){let n=Ln(e);if(!n)return!0;let r=t.find(e=>{let t=Ln(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Ln(e);return(t==null?void 0:t.name)===n.name&&t.form===n.form})===n}function zn(e){if(W(e)&&V(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return W(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}
1function Bn(e,t){zn(e).forEach(e=>{Nn(e)&&t.push(e),Bn(e,t)})}function Vn(e,t,n){zn(e).forEach(e=>{W(e)&&e.matches(t)&&n.push(e),Vn(e,t,n)})}function Hn(e){return Pn(e)&&In(e)>=0}function Un(e){let t=[];return Bn(e,t),t.filter(Pn)}function Wn(e){let t=Un(e);return t.filter(e=>In(e)>=0&&Rn(e,t))}function Gn(e,t){let n=Wn(e),r=n.length;if(r===0)return;let i=Ie(Ht(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Kn(e){return Gn(Ht(e).body,1)||e}function qn(e){return Gn(Ht(e).body,-1)||e}function Jn(e,t){if(!e)return null;let n=Wn(Ht(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Yn(e){return Jn(e,1)}function Xn(e){return Jn(e,-1)}function Zn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!J(n,r)}function Qn(e){Wn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function $n(e){let t=[];Vn(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function er(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>{var r;return[...!n||(r=t.context)!=null&&r.open?[t]:[],...er(e,t.id,n)]})}function tr(e,t){var n;let r=[],i=(n=e.find(e=>e.id===t))==null?void 0:n.parentId;for(;i;){let t=e.find(e=>e.id===i);i=t==null?void 0:t.parentId,t&&(r=r.concat(t))}return r}function nr(e){return`data-base-ui-${e}`}var rr=0;function ir(e,t=`mui`){let[n,r]=l.useState(e),i=e||n;return l.useEffect(()=>{n??(rr+=1,r(`${t}-${rr}`))},[n,t]),i}var ar=Nt.useId;function or(e,t){if(ar!==void 0){let n=ar();return e??(t?`${t}-${n}`:n)}return ir(e,t)}var sr=19;function cr(e){return sr>=e}function lr(e){if(!l.isValidElement(e))return null;let t=e,n=t.props;return(cr(19)?n==null?void 0:n.ref:t.ref)??null}function ur(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function dr(e,t){let n={};for(let r in e){let i=e[r];if(t!=null&&t.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function fr(e,t){return typeof e==`function`?e(t):e}function pr(e,t){return typeof e==`function`?e(t):e}var mr={};function hr(e,t,n,r,i){if(!n&&!r&&!i&&!e)return _r(t);let a=_r(e);return t&&(a=vr(a,t)),n&&(a=vr(a,n)),r&&(a=vr(a,r)),i&&(a=vr(a,i)),a}function gr(e){if(e.length===0)return mr;if(e.length===1)return _r(e[0]);let t=_r(e[0]);for(let n=1;n<e.length;n+=1)t=vr(t,e[n]);return t}function _r(e){return Sr(e)?{...Cr(e,mr)}:yr(e)}function vr(e,t){return Sr(t)?Cr(t,e):br(e,t)}function yr(e){let t={...e};for(let e in t){let n=t[e];xr(e,n)&&(t[e]=Tr(n))}return t}function br(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=ur(e.style,r);break;case`className`:e[n]=Dr(e.className,r);break;default:e[n]=xr(n,r)?wr(e[n],r):r}}return e}function xr(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Sr(e){return typeof e==`function`}function Cr(e,t){return Sr(e)?e(t):e??mr}function wr(e,t){return t?e?(...n)=>{let r=n[0];if(Or(r)){let i=r;Er(i);let a=t(...n);return i.baseUIHandlerPrevented||e==null||e(...n),a}let i=t(...n);return e==null||e(...n),i}:Tr(t):e}function Tr(e){return e&&((...t)=>{let n=t[0];return Or(n)&&Er(n),e(...t)})}function Er(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Dr(e,t){return t?e?t+` `+e:t:e}function Or(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function kr(e,t,n={}){let r=t.render,i=Ar(t,n);return n.enabled===!1?null:Nr(e,r,i,n.state??S)}function Ar(e,t={}){let{className:n,style:r,render:i}=e,{state:a=S,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?fr(n,a):void 0,d=l?pr(r,a):void 0,f=l?dr(a,c):S,p=l&&s?jr(s):void 0,m=l?ur(f,p)??{}:S;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Et([m.ref,lr(i),...o]):Tt(m.ref,lr(i),o):Tt(null,null)),l?(u!==void 0&&(m.className=Dr(m.className,u)),d!==void 0&&(m.style=ur(m.style,d)),m):S}function jr(e){return Array.isArray(e)?gr(e):hr(void 0,e)}var Mr=Symbol.for(`react.lazy`);function Nr(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=hr(n,t.props);e.ref=n.ref;let i=t;return(i==null?void 0:i.$$typeof)===Mr&&(i=l.Children.toArray(t)[0]),l.cloneElement(i,e)}if(e&&typeof e==`string`)return Pr(e,n);throw Error(T(8))}function Pr(e,t){return e===`button`?(0,l.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,l.createElement)(`img`,{alt:``,...t,key:t.key}):l.createElement(e,t)}var Fr={style:{transition:`none`}},Ir=`data-base-ui-click-trigger`,Lr=`data-base-ui-swipe-ignore`,Rr=`data-swipe-ignore`,zr=`[${Lr}]`;`${Rr}`;var Br={fallbackAxisSide:`none`},Vr={fallbackAxisSide:`end`},Hr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Ur=l.createContext(null),Wr=()=>l.useContext(Ur),Gr=nr(`portal`);function Kr(e={}){let{ref:t,container:n,componentProps:r=S,elementProps:i}=e,a=or(),o=Wr(),s=o==null?void 0:o.portalNode,[u,d]=l.useState(null),[f,p]=l.useState(null),m=Z(e=>{e!==null&&p(e)}),h=l.useRef(null);C(()=>
1{if(n===null){h.current&&(h.current=null,p(null),d(null));return}let e=(n&&(me(n)?n:n.current))??s??document.body;if(e==null){h.current&&(h.current=null,p(null),d(null));return}h.current!==e&&(h.current=e,p(null),d(e))},[n,s]);let g=kr(`div`,r,{ref:[t,m],props:[{id:a,[Gr]:``},i]}),_=u&&g?c.createPortal(g,u):null;return{node:f,nodeId:l.isValidElement(g)?g.props.id:void 0,subtree:_}}var qr=l.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:u,nodeId:d,subtree:p}=Kr({container:o,ref:t,componentProps:e,elementProps:s}),m=l.useRef(null),h=l.useRef(null),g=l.useRef(null),_=l.useRef(null),[v,y]=l.useState(null),b=l.useRef(!1),x=v==null?void 0:v.modal,S=v==null?void 0:v.open,w=!!v&&!v.modal&&v.open&&!!u;l.useEffect(()=>{if(!u||x)return;function e(e){u&&e.relatedTarget&&Zn(e)&&(e.type===`focusin`?b.current&&($n(u),b.current=!1):(Qn(u),b.current=!0))}return wt(X(u,`focusin`,e,!0),X(u,`focusout`,e,!0))},[u,x]),C(()=>{!u||S!==!0||!b.current||($n(u),b.current=!1)},[S,u]);let T=l.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:h,beforeInsideRef:g,afterInsideRef:_,portalNode:u,setFocusManagerState:y}),[u]);return(0,f.jsxs)(l.Fragment,{children:[p,(0,f.jsxs)(Ur.Provider,{value:T,children:[w&&u&&(0,f.jsx)(Kt,{"data-type":`outside`,ref:m,onFocus:e=>{if(Zn(e,u)){var t;(t=g.current)==null||t.focus()}else{let e=qn(v?v.domReference:null);e==null||e.focus()}}}),w&&u&&(0,f.jsx)(`span`,{"aria-owns":d,style:Hr}),u&&c.createPortal(a,u),w&&u&&(0,f.jsx)(Kt,{"data-type":`outside`,ref:h,onFocus:e=>{if(Zn(e,u)){var t;(t=_.current)==null||t.focus()}else{let t=Kn(v?v.domReference:null);t==null||t.focus(),v!=null&&v.closeOnFocusOut&&(v==null||v.onOpenChange(!1,Y(`focu
1s-out`,e.nativeEvent)))}}})]})]})});function Jr(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}a();var Yr=class{constructor(){r(this,`nodesRef`,{current:[]}),r(this,`events`,Jr())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Xr=l.createContext(null),Zr=l.createContext(null),Qr=()=>{var e;return((e=l.useContext(Xr))==null?void 0:e.id)||null},$r=e=>{let t=l.useContext(Zr);return e??t};function ei(e){let t=or(),n=$r(e),r=Qr();return C(()=>{if(!t)return;let e={id:t,parentId:r};return n==null||n.addNode(e),()=>{n==null||n.removeNode(e)}},[n,t,r]),t}function ti(e){let{children:t,id:n}=e,r=Qr();return(0,f.jsx)(Xr.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ni(e){let{children:t,externalTree:n}=e,r=d(()=>n??new Yr).current;return(0,f.jsx)(Zr.Provider,{value:r,children:t})}function ri(e){return e==null?e:`current`in e?e.current:e}function ii(){return!1}function ai(e){return{escapeKey:typeof e==`boolean`?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e==`boolean`?e:(e==null?void 0:e.outsidePress)??!0}}function oi(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ii,bubbles:s,externalTree:c}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=u.useState(`floatingElement`),{dataRef:p}=u.context,m=$r(c),h=Z(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Z(()=>a),{escapeKey:y,outsidePress:b}=ai(s),x=l.useRef(!1),S=l.useRef(!1),C=l.useRef(!1),w=l.useRef(!1),T=l.useRef(``),E=l.useRef(null),D=k(),A=k(),j=Z(()=>{A.clear(),p.current.insideReactTree=!1}),M=Z(e=>{var t;let n=(t=p.current.floatingContext)==null?void 0:t.nodeId;return(m?er(m.nodesRef.current,n):[]).some(t=>{var n;return((n=t.context)==null?void 0:n.open)&&!t.context.dataRef.current[e]})}),N=Z(e=>ze(e,u.select(`floatingElement`))||ze(e,u.select(`domReferenceElement`))),P=Z(e=>{o()&&u.setOpen(!1,Y(Qe,e.nativeEvent))}),F=Z(e=>{if(!d||!n||!r||e.key!==`Escape`||w.current||!y&&M(`__escapeKeyBubbles`))return;let t=Y(ut,se(e)?e.nativeEvent:e);u.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Z(()=>{p.current.insideReactTree=!0,A.start(0,j)}),ee=Z(e=>{if(!d||!n||e.button!==0)return;let t=Le(e.nativeEvent);J(u.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),L=Z(e=>{!d||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});l.useEffect(()=>{if(!d||!n)return j;p.current.__escapeKeyBubbles=y,p.current.__outsidePressBubbles=b;let e=new O,t=new O;function i(){e.clear(),w.current=!0}function a(){e.start(re?5:0,()=>{w.current=!1})}function o(){C.current=!0,t.start(0,()=>{C.current=!1})}function s(){x.current=!1,S.current=!1}function c(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function l(e){let t=c();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){var t;let n=(t=p.current.floatingContext)==null?void 0:t.nodeId,r=m&&er(m.nodesRef.current,n).some(t=>{var n;return ze(e,(n=t.context)==null?void 0:n.elements.floating)});return N(e)||r}function k(e){if(l(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(p.current.insideReactTree){j();return}let n=Le(e),r=`[${nr(`inert`)}]`,i=U(n)?n.getRootNode():null,a=Array.from((G(i)?i:Ht(u.select(`floatingElement`))).querySelectorAll(r)),o=u.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>J(e,n))))return;let s=U(n)?n:null;for(;s&&!Te(s);){let e=q(s);if(Te(e)||!U(e))break;s=e}if(!(a.length&&U(n)&&!Be(n)&&!J(n,u.select(`floatingElement`))&&a.every(e=>!J(s,e)))){if(W(n)&&!(`touches`in e)){let t=Te(n),r=K(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}
1if(!h(e)){if(c()===`intentional`&&C.current){t.clear(),C.current=!1;return}typeof g==`function`&&!g(e)||M(`__outsidePressBubbles`)||(u.setOpen(!1,Y(tt,e)),j())}}}function A(e){c()!==`sloppy`||e.pointerType===`touch`||!u.select(`open`)||!n||N(e)||k(e)}function P(e){if(c()!==`sloppy`||!u.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(E.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function I(e,t){let n=Le(e);if(!n)return;let r=X(n,e.type,()=>{t(e),r()})}function ee(e){T.current=`touch`,I(e,P)}function L(e){D.clear(),e.type===`pointerdown`&&(T.current=e.pointerType),!(e.type===`mousedown`&&E.current&&!E.current.dismissOnMouseDown)&&I(e,e=>{e.type===`pointerdown`?A(e):k(e)})}function R(e){if(!x.current)return;let n=S.current;if(s(),c()===`intentional`){if(e.type===`pointercancel`){n&&o();return}if(!h(e)){if(n){o();return}typeof g==`function`&&!g(e)||(t.clear(),C.current=!0,j())}}}function te(e){if(c()!==`sloppy`||!E.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(k(e),D.clear(),E.current=null)}function ne(e){I(e,te)}function z(e){c()!==`sloppy`||!E.current||N(e)||(E.current.dismissOnTouchEnd&&k(e),D.clear(),E.current=null)}function ie(e){I(e,z)}let B=Ht(f),ae=wt(r&&wt(X(B,`keydown`,F),X(B,`compositionstart`,i),X(B,`compositionend`,a)),_&&wt(X(B,`click`,L,!0),X(B,`pointerdown`,L,!0),X(B,`pointerup`,R,!0),X(B,`pointercancel`,R,!0),X(B,`mousedown`,L,!0),X(B,`mouseup`,R,!0),X(B,`touchstart`,ee,!0),X(B,`touchmove`,ne,!0),X(B,`touchend`,ie,!0)));return()=>{ae(),e.clear(),t.clear(),s(),C.current=!1,j()}},[p,f,r,_,g,d,n,y,b,F,j,v,M,N,m,u,D]);let R=l.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),te=l.useMemo(()=>({onKeyDown:F,onPointerDown:L,onMouseDown:L,onClickCapture:I,onMouseDownCapture(e){I(),ee(e)},onPointerDownCapture(e){I(),ee(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,ee,L]);return l.useMemo(()=>n?{reference:R,floating:te,trigger:R}:{},[n,R,te])}function si(e,t,n){let{reference:r,floating:i}=e,a=an(t),o=on(t),s=rn(o),c=Q(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=tn(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ci(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=en(t,e),p=vn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=yn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var li=50,ui=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ci},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=si(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<li&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}
vendor: 4,729 bytes, line 1
1):x.rects),{x:u,y:d}=si(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},di=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n,r;let{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=en(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let _=Q(i),v=an(s),y=Q(s)===s,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(y||!h?[gn(s)]:cn(s)),S=m!==`none`;!f&&S&&x.push(...hn(s,h,m,b));let C=[s,...x],w=await c.detectOverflow(t,g),T=[],E=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&T.push(w[_]),d){let e=sn(i,o,b);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:i,overflows:T}],!T.every(e=>e<=0)){var D,O;let e=(((D=a.flip)==null?void 0:D.index)||0)+1,t=C[e];if(t&&(d!==`alignment`||v===an(t)||E.every(e=>an(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:E},reset:{placement:t}};let n=(O=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])==null?void 0:O.placement;if(!n)switch(p){case`bestFit`:{var k;let e=(k=E.filter(e=>{if(S){let t=an(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])==null?void 0:k[0];e&&(n=e);break}case`initialPlacement`:n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},fi=new Set([`left`,`top`]);async function pi(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Q(n),s=tn(n),c=an(n)===`y`,l=fi.has(o)?-1:1,u=a&&c?-1:1,d=en(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var mi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,middlewareData:s}=t,c=await pi(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},hi=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=en(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=an(i),p=nn(f),m=u[p],h=u[f],g=(e,t)=>$t(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},gi=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=en(e,t),u={x:n,y:r},d=an(i),f=nn(d),p=u[f],m=u[d],h=en(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var _,v;let e=f===`y`?`width`:`height`,t=fi.has(Q(i)),n=a.reference[d]-a.floating[e]+(t&&((_=o.offset)==null?void 0:_[d])||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:((v=o.offset)==null?void 0:v[d])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},_i=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=en(e,t),c=await i.detectOverflow(t,s),l=Q(n),u=tn(n),d=an(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=qt(p-c[m],g),y=qt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Jt(c.left,c.right):S=p-2*Jt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function vi(e){let t=K(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Yt(n)!==a||Yt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function yi(e){return U(e)?e:e.contextElement}function bi(e){let t=yi(e);if(!W(t))return Zt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vi(t),o=(a?Yt(n.width):n.width)/r,s=(a?Yt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var xi=Zt(0);function Si(e){let t=H(e);
vendor: 5,793 bytes, line 1
1return!we()||!t.visualViewport?xi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ci(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function wi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=yi(e),o=Zt(1);t&&(r?U(r)&&(o=bi(r)):o=bi(e));let s=Ci(a,n,r)?Si(a):Zt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=U(r)?H(r):r,n=e,i=ke(n);for(;i&&t!==n;){let e=bi(i),t=i.getBoundingClientRect(),r=K(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=ke(n)}}return yn({width:u,height:d,x:c,y:l})}function Ti(e,t){let n=Ee(e).scrollLeft;return t?t.left+n:wi(pe(e)).left+n}function Ei(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ti(e,n),y:n.top+t.scrollTop}}function Di(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=pe(r),s=t?_e(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Zt(1),u=Zt(0),d=W(r);if((d||!a)&&((V(r)!==`body`||he(o))&&(c=Ee(r)),d)){let e=wi(r);l=bi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Ei(o,c):Zt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Oi(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ki(e){let t=Ee(e),n=e.ownerDocument.body,r=Jt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Jt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ti(e),o=-t.scrollTop;return K(n).direction===`rtl`&&(a+=Jt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ai=25;function ji(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=pe(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!we()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ti(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Ai&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Mi(e,t){let n=wi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=bi(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ni(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ji(e,n,t);else if(t===`document`)r=ki(pe(e));else if(U(t))r=Mi(t,n);else{let n=Si(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yn(r)}function Pi(e,t){let n=t.get(e);if(n)return n;let r=Oe(e,[],!1).filter(e=>U(e)&&V(e)!==`body`),i=null,a=K(e).position===`fixed`,o=a?q(e):e;for(;U(o)&&!Te(o);){let e=K(o),t=Se(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=q(o)}return t.set(e,r),r}function Fi(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?_e(t)?[]:Pi(t,this._c):[].concat(n),r],o=Ni(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ni(t,a[e],i);s=Jt(n.top,s),c=qt(n.right,c),l=qt(n.bottom,l),u=Jt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ii(e){let{width:t,height:n}=vi(e);return{width:t,height:n}}function Li(e,t,n){let r=W(t),i=pe(t),a=n===`fixed`,o=wi(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Zt(0);if((r||!a)&&((V(t)!==`body`||he(i))&&(s=Ee(t)),r)){let e=wi(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ti(i));let l=i&&!r&&!a?Ei(i,s):Zt(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ri(e){return K(e).position===`static`}function zi(e,t){if(!W(e)||K(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return pe(e)===n&&(n=n.ownerDocument.body),n}function Bi(e,t){let n=H(e);if(_e(e))return n;if(!W(e)){let t=q(e);for(;t&&!Te(t);){if(U(t)&&!Ri(t))return t;t=q(t)}return n}let r=zi(e,t);for(;r&&ge(r)&&Ri(r);)r=zi(r,t);return r&&Te(r)&&Ri(r)&&!Se(r)?n:r||Ce(e)||n}var Vi=async function(e){let t=this.getOffsetParent||Bi,n=this.getDimensions,r=await n(e.floating);return{reference:Li(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hi(e){return K(e).direction===`rtl`}var Ui={convertOffsetParentRelativeRectToViewportRelativeRect:Di,getDocumentElement:pe,getClippingRect:Fi,getOffsetParent:Bi,getElementRects:Vi,getClientRects:Oi,getDimensions:Ii,getScale:bi,isElement:U,isRTL:Hi};function Wi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gi(e,t,n){let r=null,i,a=pe(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Xt(d),h=Xt(a.clientWidth-(u+f)),g=Xt(a.clientHeight-(d+p)),_=Xt(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Jt(0,qt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Wi(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ki(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=yi(e),u=i||a?[...l?Oe(l):[],...t?Oe(t):[]]:[];
1u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Gi(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?wi(e):null;c&&g();function g(){let t=wi(e);h&&!Wi(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d==null||d(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var qi=mi,Ji=hi,Yi=di,Xi=_i,Zi=gi,Qi=(e,t,n)=>{let r=new Map,i=n??{},a={...Ui,...i.platform,_c:r};return ui(e,t,{...i,platform:a})},$i=typeof document<`u`?l.useLayoutEffect:function(){};function ea(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ea(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ea(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ta(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function na(e,t){let n=ta(e);return Math.round(t*n)/n}function ra(e){let t=l.useRef(e);return $i(()=>{t.current=e}),t}function ia(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:u,open:d}=e,[f,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=l.useState(r);ea(m,r)||h(r);let[g,_]=l.useState(null),[v,y]=l.useState(null),b=l.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=l.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=l.useRef(null),T=l.useRef(null),E=l.useRef(f),D=u!=null,O=ra(u),k=ra(i),A=ra(d),j=l.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Qi(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!ea(E.current,t)&&(E.current=t,c.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);$i(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=l.useRef(!1);$i(()=>(M.current=!0,()=>{M.current=!1}),[]),$i(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=l.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=l.useMemo(()=>({reference:S,floating:C}),[S,C]),F=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=na(P.floating,f.x),r=na(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ta(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var aa=(e,t)=>{let n=qi(e);return{name:n.name,fn:n.fn,options:[e,t]}},oa=(e,t)=>{let n=Ji(e);return{name:n.name,fn:n.fn,options:[e,t]}},sa=(e,t)=>({fn:Zi(e).fn,options:[e,t]}),ca=(e,t)=>{let n=Yi(e);return{name:n.name,fn:n.fn,options:[e,t]}},la=(e,t)=>{let n=Xi(e);return{name:n.name,fn:n.fn,options:[e,t]}},ua=t((e=>{var t=i();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),da=t(((e,t)=>{t.exports=ua()})),fa=t((e=>{var t=i(),n=da();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),pa=t(((e,t)=>{t.exports=fa()})),ma=da(),ha=e(pa(),1),ga=cr(19)?ya:ba;function _a(e,t,n,r,i){return ga(e,t,n,r,i)}function va(e,t,n,r,i){let a=l.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ma.useSyncExternalStore)(e.subscribe,a,a)}g({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ma.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ya(e,t,n,r,i){let a=h();if(!a)return va(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function ba(e,t,n,r,i){return(0,ha.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}a();var xa=class{constructor(e){r(this,`subscribe`,e=>(this.listeners.add(e),()=>{this.listeners.delete(e)})),r(this,`getSnapshot`,()=>this.state),this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return _a(this,e,t,n,r)}},Sa=class extends xa{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){l.useDebugValue(e);let n=this;C(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;C(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;C(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){l.useDebugValue(e);let n=this,r=t!==void 0;C(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return l.useDebugValue(e),_a(this,this.selectors[e],t,n,r)}useContextCallback(e,t){l.useDebugValue(e);let n=Z(t??b);this.context[e]=n}useStateSetter(e){let t=l.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};a();var Ca={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},wa=class extends Sa{constructor(e){let{syncOnly:t,nested:n,onOpenChange:i,triggerElements:a,...o}=e;super({...o,positionReference:o.referenceElement,domReferenceElement:o.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:Jr(),nested:n,triggerElements:a},Ca),r(this,`syncOpenEvent`,(e,t)=>{(!e||!this.state.open||t!=null&&de(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)}),r(this,`dispatchOpenChange`,(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}),r(this,`setOpen`,(e,t)=>{var n,r;if(this.syncOnly){var i,a;(i=(a=this.context).onOpenChange)==null||i.call(a,e,t);return}this.dispatchOpenChange(e,t),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t)}),this.syncOnly=t}};function Ta(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),u=t.useState(n?`popupElement`:`positionerElement`),d=t.context.triggerElements,f=o,p=l.useRef(null);
1r===void 0&&p.current===null&&(p.current=new wa({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:i,syncOnly:!0,nested:a}));let m=r??p.current;return t.useSyncedValue(`floatingId`,i),C(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:u};U(c)&&(e.domReferenceElement=c),m.state.positionReference===m.state.referenceElement&&(e.positionReference=c),m.update(e)},[s,i,c,u,m]),m.context.onOpenChange=f,m.context.nested=a,m}function Ea(e,t=!1,n=!1){let[r,i]=l.useState(e&&t?`idle`:void 0),[a,o]=l.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),C(()=>{if(!e&&a&&r!==`ending`&&n){let e=Bt.request(()=>{i(`ending`)});return()=>{Bt.cancel(e)}}},[e,a,r,n]),C(()=>{if(!e||t)return;let n=Bt.request(()=>{i(void 0)});return()=>{Bt.cancel(n)}},[t,e]),C(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=Bt.request(()=>{i(`idle`)});return()=>{Bt.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}function Da(e,t=!1){let n=Vt();return Z((r,i=null)=>{n.cancel();let a=ri(e);if(a==null)return;let o=a,s=()=>{c.flushSync(r)};if(typeof o.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function l(){Promise.all(o.getAnimations().map(e=>e.finished)).then(()=>{i!=null&&i.aborted||s()},()=>{if(!(i!=null&&i.aborted)){if(o.getAnimations().some(e=>e.pending||e.playState!==`finished`)){l();return}s()}})}if(t){let e=`data-starting-style`;if(!o.hasAttribute(e)){n.request(l);return}let t=new MutationObserver(()=>{o.hasAttribute(e)||(t.disconnect(),l())});t.observe(o,{attributes:!0,attributeFilter:[e]}),i==null||i.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}n.request(l)})}function Oa(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=Z(i),o=Da(r,n);l.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}var ka={tabIndex:-1,[Ae]:``};function Aa(e){return t=>t!==`touch`||e.current}function ja(e,t=!1){let n=or(),r=Qr()!=null,i=d(()=>e(n,r)).current;return Ta({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Ma({handle:e,store:t}){return C(()=>e.attachStore(t),[e,t]),null}function Na(e,t){let n=l.useRef(null),r=l.useRef(null);return l.useCallback(i=>{if(e===void 0)return;let a=!1;if(n.current!==null){let e=n.current,i=r.current,o=t.context.triggerElements.getById(e);i&&o===i&&(t.context.triggerElements.delete(e),a=!0),n.current=null,r.current=null}if(i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i),a=!0),a){let e=t.context.triggerElements.size;t.select(`open`)&&t.state.triggerCount!==e&&t.set(`triggerCount`,e)}},[t,e])}function Pa(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);let i=(n==null?void 0:n.id)??null;(i||t)&&(e.activeTriggerId=i,e.activeTriggerElement=n??null)}function Fa(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ia(e,t,n,r={}){var i,a,o;let s=n.reason,l=s===$e,u=t&&s===`trigger-focus`,d=!t&&(s===`trigger-press`||s===`escape-key`),f=Fa(n);if((i=(a=e.context).onOpenChange)==null||i.call(a,t,n),n.isCanceled)return;(o=r.onBeforeDispatch)==null||o.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);let p=()=>{let i={...r.extraState,open:t};u?i.instantType=`focus`:d?i.instantType=`dismiss`:l&&(i.instantType=void 0),Pa(i,t,n.trigger,f()),e.update(i)};l?c.flushSync(p):p()}function La(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Na(e,n),o=Z(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){n.update({activeTriggerElement:t,...i?r:null});return}a==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:t,...r})}),s=l.useCallback(e=>{a(e),e&&o(e)},[a,o]);return C(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ra(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=l.useRef(null),i=e.useState(`open`);C(()=>
1{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Y(Ze);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function za(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=Ea(e),o=t.useState(`preventUnmountingOnClose`),s=!e&&o;t.useSyncedValues({mounted:r,transitionStatus:a,preventUnmountingOnClose:s});let c=Z(()=>{var e,r;i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(e=(r=t.context).onOpenChangeComplete)==null||e.call(r,!1)});return Oa({enabled:r&&!e&&!s,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}function Ba(e,t){e.useSyncedValues(t),C(()=>()=>{e.update({activeTriggerProps:S,inactiveTriggerProps:S,popupProps:S})},[e])}function Va(e,t){C(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),C(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ha=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Ua(){return new wa({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new Ha,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Wa(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Ua(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:S,inactiveTriggerProps:S,popupProps:S}}function Ga(e,t,n=!1){return new wa({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var Ka=e=>e.triggerIdProp??e.activeTriggerId,qa=e=>e.openProp??e.open,Ja=e=>{var t;return(((t=e.popupElement)==null?void 0:t.id)??e.floatingId)||void 0};function Ya(e,t){return t!==void 0&&qa(e)&&Ka(e)===t}function Xa(e,t){return Ya(e,t)?!0:t!==void 0&&qa(e)&&Ka(e)==null&&e.triggerCount===1}var Za={open:qa,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ka,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ja,isTriggerActive:(e,t)=>t!==void 0&&Ka(e)===t,isOpenedByTrigger:(e,t)=>Ya(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ka(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Xa(e,t)?Ja(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Qa(e){let t=l.useCallback(t=>e===void 0?b:e.subscribeStore(t),[e]),n=l.useCallback(()=>e===void 0?void 0:e.store,[e]);
1return(0,ma.useSyncExternalStore)(t,n,()=>e==null?void 0:e.serverStore)}function $a(e){return eo(e,e.rootContext)}function eo(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[u,d]=l.useState(null),[f,p]=l.useState(void 0),[m,h]=l.useState(void 0),g=l.useRef(null),_=$r(r),v=l.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),y=ia({...e,elements:{...v,...u&&{reference:u}}}),b=U(f)?f:null,x=m===void 0?t.state.floatingElement:m;t.useSyncedValue(`referenceElement`,f??null),t.useSyncedValue(`domReferenceElement`,f===void 0?o:b),t.useSyncedValue(`floatingElement`,x);let S=l.useCallback(e=>{let t=U(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),y.refs.setReference(t)},[y.refs]),w=l.useCallback(e=>{(U(e)||e===null)&&(g.current=e,p(e)),(U(y.refs.reference.current)||y.refs.reference.current===null||e!==null&&!U(e))&&y.refs.setReference(e)},[y.refs,p]),T=l.useCallback(e=>{h(e),y.refs.setFloating(e)},[y.refs]),E=l.useMemo(()=>({...y.refs,setReference:w,setFloating:T,setPositionReference:S,domReference:g}),[y.refs,w,T,S]),D=l.useMemo(()=>({...y.elements,domReference:o}),[y.elements,o]),O=l.useMemo(()=>({...y,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:E,elements:D,nodeId:n,rootStore:t}),[y,E,D,n,t,s,c]);return C(()=>{o&&(g.current=o)},[o]),C(()=>{t.context.dataRef.current.floatingContext=O;let e=_==null?void 0:_.nodesRef.current.find(e=>e.id===n);e&&(e.context=O)}),l.useMemo(()=>({...y,context:O,refs:E,elements:D,rootStore:t}),[y,E,D,O,t])}a();var to=class e{constructor(){r(this,`dispose`,()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()}),r(this,`disposeEffect`,()=>this.dispose),this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new O,this.restTimeout=new O,this.handleCloseOptions=void 0}static create(){return new e}},no=new WeakMap;function ro(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;if(t&&no.get(t)===e){var n,r,i;(n=e.pointerEventsScopeElement)==null||n.style.removeProperty(`pointer-events`),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty(`pointer-events`),(i=e.pointerEventsFloatingElement)==null||i.style.removeProperty(`pointer-events`),no.delete(t)}e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function io(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=no.get(n);a&&a!==e&&ro(a),ro(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,no.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function ao(e){let t=e.context.dataRef.current,n=d(()=>t.hoverInteractionState??to.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),E(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function oo(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:u}=a.context,d=$r(),f=Qr(),p=ao(a),m=k(),h=Z(()=>{var e;return Ye((e=u.current.openEvent)==null?void 0:e.type,p.interactedInside)}),g=Z(()=>{var e;return Xe((e=u.current.openEvent)==null?void 0:e.type)}),_=Z(()=>{ro(p)});C(()=>{o||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,_())},[o,p,_]),l.useEffect(()=>_,[_]),C(()=>{var e;if(n&&o&&(e=p.handleCloseOptions)!=null&&e.blockPointerEvents&&g()&&U(c)&&s){var t,r,i;let e=c,n=s,a=Ht(s),o=d==null||(t=d.nodesRef.current.find(e=>e.id===f))==null||(t=t.context)==null?void 0:t.elements.floating;o&&(o.style.pointerEvents=``);let l=p.pointerEventsScopeElement===n?null:p.pointerEventsScopeElement,u=o===n?null:o,m=((r=p.handleCloseOptions)==null||(i=r.getScope)==null?void 0:i.call(r))??l??u??e.closest(`[data-rootownerid]`)??a.body;return io(p,{scopeElement:m,referenceElement:e,floatingElement:n}),()=>{_()}}},[n,o,c,s,p,g,d,f,_]),l.useEffect(()=>{if(!n)return;function e(){return!!(d&&f&&er(d.nodesRef.current,f).length>0)}function t(e){let t=qe(r,`close`,p.pointerType),n=()=>{a.setOpen(!1,Y($e,e)),d==null||d.events.emit(`floating.closed`,e)};t?p.openChangeTimeout.start(t,n):(p.openChangeTimeout.clear(),n())}function o(e){let t=Le(e);if(!He(t)){p.interactedInside=!1;return}p.interactedInside=(t==null?void 0:t.closest(`[aria-haspopup]`))!=null}function c(){p.openChangeTimeout.clear(),m.clear(),d==null||d.events.off(`floating.closed`,v),_()}function l(n){var r;if(e()&&d){d.events.on(`floating.closed`,v);return}
1if(Re(n.relatedTarget,a.context.triggerElements))return;let o=((r=u.current.floatingContext)==null?void 0:r.nodeId)??i,s=n.relatedTarget;if(!(d&&o&&U(s)&&er(d.nodesRef.current,o,!1).some(e=>{var t;return J((t=e.context)==null?void 0:t.elements.floating,s)}))){if(p.handler){p.handler(n);return}_(),g()&&!h()&&t(n)}}function v(t){!d||!f||e()||m.start(0,()=>{d.events.off(`floating.closed`,v),a.setOpen(!1,Y($e,t)),d.events.emit(`floating.closed`,t)})}let y=s;return wt(y&&X(y,`mouseenter`,c),y&&X(y,`mouseleave`,l),y&&X(y,`pointerdown`,o,!0),()=>{d==null||d.events.off(`floating.closed`,v)})},[n,s,a,u,r,i,g,h,_,p,d,f,m])}var so={current:null};function co(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:u=so,externalTree:d,isActiveTrigger:f=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:h,guardStaleOpen:g=!1}=t,_=`rootStore`in e?e.rootStore:e,{dataRef:v,events:y}=_.context,b=$r(d),x=ao(_),S=l.useRef(!1),C=jt(i),w=jt(r),T=jt(o),E=jt(n),D=jt(h),O=jt(m),k=Z(()=>{var e;return Ye((e=v.current.openEvent)==null?void 0:e.type,x.interactedInside)}),A=Z(()=>{var e;return((e=D.current)==null?void 0:e.call(D))!==!1}),j=Z((e,t,n)=>{let r=_.context.triggerElements;if(r.hasElement(t))return!e||!J(e,t);if(!U(n))return!1;let i=n;return r.hasMatchingElement(e=>J(e,i))&&(!e||!J(e,i))}),M=Z(()=>{x.handler&&(Ht(_.select(`domReferenceElement`)).removeEventListener(`mousemove`,x.handler),x.handler=void 0)}),N=Z(()=>{ro(x)});if(f){var P;x.handleCloseOptions=(P=C.current)==null?void 0:P.__options}return l.useEffect(()=>M,[M]),l.useEffect(()=>{if(!n)return;function e(e){e.open?S.current=!1:(S.current=e.reason===$e,M(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on(`openchange`,e),()=>{y.off(`openchange`,e)}},[n,y,x,M]),l.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=qe(w.current,`close`,x.pointerType);n?x.openChangeTimeout.start(n,()=>{_.setOpen(!1,Y($e,e)),b==null||b.events.emit(`floating.closed`,e)}):t&&(x.openChangeTimeout.clear(),_.setOpen(!1,Y($e,e)),b==null||b.events.emit(`floating.closed`,e))}let t=u.current??(f?_.select(`domReferenceElement`):null);if(!U(t))return;function r(e){var t;if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!ue(x.pointerType))return;let n=Je(T.current),r=qe(w.current,`open`,x.pointerType),i=Le(e),o=e.currentTarget??null,s=_.select(`domReferenceElement`),c=o;if(U(i)&&!_.context.triggerElements.hasElement(i)){for(let e of _.context.triggerElements.elements())if(J(e,i)){c=e;break}}U(o)&&U(s)&&!_.context.triggerElements.hasElement(o)&&J(o,s)&&(c=s);let l=c!=null&&j(s,c,i),u=_.select(`open`),d=((t=O.current)==null?void 0:t.call(O))??_.select(`transitionStatus`)===`ending`,f=!u&&d&&S.current,p=!l&&U(c)&&U(s)&&J(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){A()&&_.setOpen(!0,Y($e,e,c));return}m||(r?x.openChangeTimeout.start(r,()=>{g&&A()&&_.setOpen(!0,Y($e,e,c))}):g&&A()&&_.setOpen(!0,Y($e,e,c)))}function i(t){if(k()){N();return}M();let n=Ht(_.select(`domReferenceElement`));x.restTimeout.clear(),x.restTimeoutPending=!1;let r=v.current.floatingContext??(p==null?void 0:p());if(!Re(t.relatedTarget,_.context.triggerElements)){if(C.current&&r){_.select(`open`)||x.openChangeTimeout.clear();let i=u.current;x.handler=C.current({...r,tree:b,x:t.clientX,y:t.clientY,onClose(){N(),M(),E.current&&!k()&&i===_.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,x.handler),x.handler(t);return}(x.pointerType!==`touch`||!J(_.select(`floatingElement`),t.relatedTarget))&&e(t)}}function o(e){J(t,e.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}let c=g?X(t,`mouseout`,o):void 0;return s?wt(X(t,`mousemove`,r,{once:!0}),X(t,`mouseenter`,r),X(t,`mouseleave`,i),c):wt(X(t,`mouseenter`,r),X(t,`mouseleave`,i),c)},[M,N,v,w,_,n,C,x,f,j,k,a,s,T,u,b,E,p,O,A,g]),l.useMemo(()=>{if(!n)return;function e(e){x.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){var t;let{nativeEvent:n}=e,r=e.currentTarget,i=_.select(`domReferenceElement`),o=_.select(`open`),s=j(i,r,e.target);if(a&&!ue(x.pointerType))return;if(o&&s&&(t=x.handleCloseOptions)!=null&&t.blockPointerEvents){let e=_.select(`floatingElement`);if(e){var l,u;let t=((l=x.handleCloseOptions)==null||(u=l.getScope)==null?void 0:u.call(l))??r.ownerDocument.body;io(x,{scopeElement:t,referenceElement:r,floatingElement:e})}}let d=Je(T.current);if(o&&!s||d===0||!s&&x.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;x.restTimeout.clear();function f(){if(x.restTimeoutPending=!1,k())return;let e=_.select(`open`);
vendor: 4,482 bytes, line 1
1!x.blockMouseMove&&(!e||s)&&A()&&_.setOpen(!0,Y($e,n,r))}x.pointerType===`touch`?c.flushSync(()=>{f()}):s&&o?f():(x.restTimeoutPending=!0,x.restTimeout.start(d,f))}}},[n,x,k,j,a,_,T,A])}var lo=.1,uo=lo*lo,$=.5;function fo(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function po(e,t,n,r,i,a,o,s,c,l){let u=!1;return fo(e,t,n,r,i,a)&&(u=!u),fo(e,t,i,a,o,s)&&(u=!u),fo(e,t,o,s,c,l)&&(u=!u),fo(e,t,c,l,n,r)&&(u=!u),u}function mo(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function ho(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function go(e={}){let{blockPointerEvents:t=!1}=e,n=new O,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r==null?void 0:r.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*uo;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=Le(r),g=r.type===`mouseleave`,_=J(u,h),v=J(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&U(r.relatedTarget)&&J(u,r.relatedTarget))return;function y(){return!!(s&&er(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=ho(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=ho(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=ho(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=ho(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!mo(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+$+1,o=C||T?S.bottom-$:S.top,s=C?T?S.bottom-$:S.top:S.bottom-$;M=po(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?$/2:$*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-$,o=C||T?S.top+$:S.bottom,s=C?T?S.top+$:S.bottom:S.top+$;M=po(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+$+1,o=w||E?S.right-$:S.left,s=w?E?S.right-$:S.left:S.right-$;M=po(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?$/2:$*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-$,o=w||E?S.left+$:S.right,s=w?E?S.left+$:S.right:S.left+$;M=po(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var _o=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),vo={"data-starting-style":``},yo={"data-ending-style":``},bo={transitionStatus(e){return e===`starting`?vo:e===`ending`?yo:null}},xo=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=_o.startingStyle]=`startingStyle`,e[e.endingStyle=_o.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),So={"data-popup-open":``},Co={"data-popup-open":``,"data-pressed":``},wo={"data-open":``},To={"data-closed":``},Eo={"data-anchor-hidden":``},Do={open(e){return e?So:null}},Oo={open(e){return e?Co:null}},ko={open(e){return e?wo:To},anchorHidden(e){return e?Eo:null}},Ao={...ko,...bo};function jo(e){return or(e,`base-ui`)}var Mo=l.createContext(void 0);function No(){let e=l.useContext(Mo);return(e==null?void 0:e.direction)??`ltr`}var Po=e=>({name:`arrow`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,rects:s,platform:c,elements:l,middlewareData:u}=t,{element:d,padding:f=0,offsetParent:p=`real`}=en(e,t)||{};if(d==null)return{};let m=vn(f),h={x:i,y:a},g=on(o),_=rn(g),v=await c.getDimensions(d),y=g===`y`,b=y?`top`:`left`,x=y?`bottom`:`right`,S=y?`clientHeight`:`clientWidth`,C=s.reference[_]+s.reference[g]-h[g]-s.floating[_],w=h[g]-s.reference[g],T=p===`real`?await((n=c.getOffsetParent)==null?void 0:n.call(c,d)):l.floating,E=l.floating[S]||s.floating[_];(!E||!await((r=c.isElement)==null?void 0:r.call(c,T)))&&(E=l.floating[S]||s.floating[_]);let D=C/2-w/2,O=E/2-v[_]/2-1,k=Math.min(m[b],O),A=Math.min(m[x],O),j=k,M=E-v[_]-A,N=E/2-v[_]/2+D,P=$t(j,N,M),F=!u.arrow&&tn(o)!=null&&N!==P&&s.reference[_]/2-(N<j?k:A)-v[_]/2<0,I=F?
1N<j?N-j:N-M:0;return{[g]:h[g]+I,data:{[g]:P,centerOffset:N-P-I,...F&&{alignmentOffset:I}},reset:F}}}),Fo=(e,t)=>({...Po(e),options:[e,t]}),Io={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Lo={sideX:`left`,sideY:`top`},Ro=`--available-width`,zo=`--available-height`;function Bo(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Vo(e,t,n){let{rects:r,placement:i}=e;return{side:Bo(t,Q(i),n),align:tn(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ho(e){return Uo(e,$a)}function Uo(e,t){var n,r;let{anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,sideOffset:s=0,align:c=`center`,alignOffset:u=0,collisionBoundary:d,collisionPadding:f=5,sticky:p=!1,arrowPadding:m=5,disableAnchorTracking:h=!1,inline:g,keepMounted:_=!1,floatingRootContext:v,mounted:y,collisionAvoidance:b,shift:x,nodeId:S,adaptiveOrigin:w,lazyFlip:T=!1,externalTree:E}=e,[D,O]=l.useState(null);!y&&D!==null&&O(null);let k=b.side||`flip`,A=b.align||`flip`,j=b.fallbackAxisSide||`end`,M=(x==null?void 0:x.crossAxis)??!1,N=x==null?void 0:x.rootBoundary,P=typeof i==`function`?i:void 0,F=Z(P),I=P?F:i,ee=jt(i),L=jt(y),R=No()===`rtl`,te=D||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":R?`left`:`right`,"inline-start":R?`right`:`left`}[o],ne=c===`center`?te:`${te}-${c}`,z=f;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&(z={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0});let re=+(o===`bottom`),ie=+(o===`top`),B=+(o===`right`),ae=+(o===`left`),oe={boundary:d===`clipping-ancestors`?`clippingAncestors`:d,padding:z},se=l.useRef(null),ce=jt(s),le=jt(u),ue=typeof s==`function`?0:s,de=typeof u==`function`?0:u,fe=[];g&&fe.push(g),fe.push(aa(e=>{let t=Vo(e,o,R),n=typeof ce.current==`function`?ce.current(t):ce.current,r=typeof le.current==`function`?le.current(t):le.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ue,de,R,o]));let V=A===`none`&&k!==`shift`,pe=!V&&(p||M||k===`shift`),me=k===`none`?null:ca({...oe,padding:{top:z.top+1+re,right:z.right+1+ae,bottom:z.bottom+1+ie,left:z.left+1+B},mainAxis:!M&&k===`flip`,crossAxis:A===`flip`&&`alignment`,fallbackAxisSideDirection:j}),U=V?null:oa({...oe,rootBoundary:N,mainAxis:A!==`none`,crossAxis:pe,limiter:p||M?void 0:sa(e=>{if(!se.current)return{};let{width:t,height:n}=se.current.getBoundingClientRect(),r=an(Q(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[oe,p,M,N,z,A]);k===`shift`||A===`shift`||c===`center`?fe.push(U,me):fe.push(me,U),fe.push(la({...oe,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!L.current)return;let i=e.style;i.setProperty(Ro,`${t}px`),i.setProperty(zo,`${n}px`);let a=H(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Fo(e=>({element:se.current||Ht(e.elements.floating).createElement(`div`),padding:m,offsetParent:`floating`}),[m]),{name:`transformOrigin`,fn(e){var t,n,r;let{elements:i,middlewareData:a,placement:c,rects:l,y:u}=e,d=Q(c),f=an(d),p=se.current,m=((t=a.arrow)==null?void 0:t.x)||0,h=((n=a.arrow)==null?void 0:n.y)||0,g=(p==null?void 0:p.clientWidth)||0,_=(p==null?void 0:p.clientHeight)||0,v=m+g/2,y=h+_/2,b=Math.abs(((r=a.shift)==null?void 0:r.y)||0),x=l.reference.height/2,S=typeof s==`function`?s(Vo(e,o,R)):s,C=b>S,w={top:`${v}px calc(100% + ${S}px)`,bottom:`${v}px ${-S}px`,left:`calc(100% + ${S}px) ${y}px`,right:`${-S}px ${y}px`}[d],T=`${v}px ${l.reference.y+x-u}px`;return i.floating.style.setProperty(`--transform-origin`,pe&&f===`y`&&C?T:w),{}}},Io,w),C(()=>{!y&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[y,v]);let W=l.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<`u`,layoutShift:!h&&typeof IntersectionObserver<`u`}),[h]),{refs:G,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:v,open:_?y:void 0,placement:ne,middleware:fe,strategy:a,whileElementsMounted:_?void 0:(...e)=>Ki(...e,W),nodeId:S,externalTree:E}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Lo,K=Se?a:`fixed`,Ee=l.useMemo(()=>{let e;return e=Se?w?{position:K,[we]:ge,[Te]:_e}:{...Ce,position:K}:{position:K,top:0,left:0},e[Ro]=`100vw`,e[zo]=`100vh`,Se||(e.opacity=0),e},[w,K,we,ge,Te,_e,Ce,Se]),q=l.useRef(null);C(()=>
1{if(!y)return;let e=ee.current,t=typeof e==`function`?e():e,n=(Wo(t)?t.current:t)||null;n!==q.current&&(G.setPositionReference(n),q.current=n)},[y,G,I,ee]),l.useEffect(()=>{if(!y)return;let e=ee.current;typeof e!=`function`&&Wo(e)&&e.current!==q.current&&(G.setPositionReference(e.current),q.current=e.current)},[y,G,I,ee]),l.useEffect(()=>{if(_&&y&&he.reference&&he.floating)return Ki(he.reference,he.floating,ye,W)},[_,y,he,ye,W]);let De=Q(be),Oe=Bo(o,De,R),ke=tn(be)||`center`,Ae=!!((n=ve.hide)!=null&&n.referenceHidden);C(()=>{T&&y&&Se&&De!==te&&O(De)},[T,y,Se,De,te]);let je=l.useMemo(()=>{var e,t;return{position:`absolute`,top:(e=ve.arrow)==null?void 0:e.y,left:(t=ve.arrow)==null?void 0:t.x}},[ve.arrow]),Me=((r=ve.arrow)==null?void 0:r.centerOffset)!==0;return l.useMemo(()=>({positionerStyles:Ee,arrowStyles:je,arrowRef:se,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:G,context:xe,isPositioned:Se,update:ye}),[Ee,je,se,Me,Oe,ke,De,Ae,G,xe,Se,ye])}function Wo(e){return e!=null&&`current`in e}function Go(e){return e===`starting`?Fr:S}function Ko(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),kr(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Go(r),i],stateAttributesMapping:ko})}export{Yr as $,k as $n,bt as $t,Ba as A,Pe as An,En as At,Sa as B,G as Bn,jt as Bt,Ma as C,We as Cn,Wn as Ct,Pa as D,Fe as Dn,Sn as Dt,Aa as E,Le as En,Cn as Et,Oa as F,H as Fn,Gt as Ft,Ui as G,ae as Gn,Ct as Gt,_a as H,ce as Hn,wt as Ht,Da as I,U as In,Ht as It,ti as J,re as Jn,rt as Jt,oi as K,B as Kn,ht as Kt,Ea as L,W as Ln,Bt as Lt,Va as M,V as Mn,Yt as Mt,La as N,Oe as Nn,Kt as Nt,Ra as O,Me as On,On as Ot,Na as P,q as Pn,Wt as Pt,$r as Q,O as Qn,lt as Qt,Ta as R,Te as Rn,Vt as Rt,ka as S,Ve as Sn,Hn as St,Fa as T,J as Tn,Tn as Tt,pa as U,le as Un,X as Ut,xa as V,ue as Vn,Tt as Vt,da as W,oe as Wn,Y as Wt,ei as X,I as Xn,_t as Xt,ni as Y,L as Yn,dt as Yt,Qr as Z,R as Zn,ut as Zt,Qa as _,St as _n,Kn as _t,jo as a,nt as an,_ as ar,Br as at,Za as b,Re as bn,Xn as bt,Ao as c,vt as cn,s as cr,Er as ct,_o as d,mt as dn,cr as dt,yt as en,T as er,qr as et,bo as f,gt as fn,or as ft,ao as g,Qe as gn,Un as gt,oo as h,$e as hn,er as ht,No as i,ct as in,b as ir,Ir as it,ja as j,K as jn,yn as jt,za as k,Ne as kn,xn as kt,Oo as l,Ze as ln,hr as lt,co as m,et as mn,tr as mt,Go as n,ot as nn,x as nr,Wr as nt,xo as o,pt as on,v as or,Vr as ot,go as p,xt as pn,nr as pt,ri as q,ie as qn,it as qt,Ho as r,st as rn,S as rr,zr as rt,ko as s,ft as sn,d as sr,kr as st,Ko as t,at as tn,C as tr,Kr as tt,Do as u,tt as un,pr as ut,Wa as v,qe as vn,qn as vt,Ia as w,Ie as wn,wn as wt,Ha as x,Ue as xn,Zn as xt,Ga as y,Ge as yn,Yn as yt,wa as z,he as zn,Z as zt};
2//# sourceMappingURL=usePositioner-ryLrusVg.js.map

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.