@miravo/cli-linux-arm64-musl 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/console-dist/assets/{AnimatePresence-CPmH1DMY.js → AnimatePresence-BSSlw02V.js} +1 -1
- package/console-dist/assets/api-B2QJEzbS.js +1 -0
- package/console-dist/assets/api-Vq4lny_H.js +1 -0
- package/console-dist/assets/arrow-up-right-CwPw_2U1.js +1 -0
- package/console-dist/assets/asset-detail-E-TllNHT.js +1 -0
- package/console-dist/assets/asset-detail-actions-jjbvaDES.js +1 -0
- package/console-dist/assets/asset-panel-DDziFlFl.js +1 -0
- package/console-dist/assets/{auth-screen-backdrop-CgwRhIbi.js → auth-screen-backdrop-CEykEbfF.js} +1 -1
- package/console-dist/assets/backup-power-BDMAO2bO.js +1 -0
- package/console-dist/assets/{badge-DuuEINVl.js → badge-Bk1DaL6C.js} +1 -1
- package/console-dist/assets/boiler-CWAR1Nq2.js +1 -0
- package/console-dist/assets/by-path-VBqTBdlG.js +1 -0
- package/console-dist/assets/catalog-BlkPPAWE.js +1 -0
- package/console-dist/assets/catalog-CQopEu5C.js +1 -0
- package/console-dist/assets/catalog-source-B4L5N-a1.js +1 -0
- package/console-dist/assets/catalog-template-icons-BOSywIKV.js +1 -0
- package/console-dist/assets/check-B-yvIfMj.js +1 -0
- package/console-dist/assets/checkbox-DEAkDfFr.js +1 -0
- package/console-dist/assets/chevron-down-x70Pto6j.js +1 -0
- package/console-dist/assets/chevron-left-XHFooLn1.js +1 -0
- package/console-dist/assets/chevron-right-CMSQPSEo.js +1 -0
- package/console-dist/assets/chiller-BSx8eUMN.js +1 -0
- package/console-dist/assets/circle-x-_o0nl0Rg.js +1 -0
- package/console-dist/assets/combobox-B8h0-NHs.js +1 -0
- package/console-dist/assets/commercial-building-CNvi6IZK.js +1 -0
- package/console-dist/assets/compressor-D63w6Ir2.js +1 -0
- package/console-dist/assets/console-panel-CMDoBJiO.js +1 -0
- package/console-dist/assets/control-CBviLxJB.js +1 -0
- package/console-dist/assets/control-jNqzZWa9.js +1 -0
- package/console-dist/assets/copy-button-CSUP1VjU.js +1 -0
- package/console-dist/assets/dialog-B5PqrKVw.js +1 -0
- package/console-dist/assets/district-heating-Cr4CrgCA.js +1 -0
- package/console-dist/assets/dom-Cm_OH5jc.js +1 -0
- package/console-dist/assets/dropdown-menu-B_MMNbTy.js +1 -0
- package/console-dist/assets/events-D531_1EZ.js +1 -0
- package/console-dist/assets/events-RmbRTKFV.js +1 -0
- package/console-dist/assets/events-format-C5HTkIsC.js +1 -0
- package/console-dist/assets/export-tab-fZDO4r2u.js +1 -0
- package/console-dist/assets/factory-C2OucdpQ.js +1 -0
- package/console-dist/assets/factory-CgSIjU5V.js +1 -0
- package/console-dist/assets/factory-DLE12zAd.js +1 -0
- package/console-dist/assets/floor-page-D0mX5OuA.js +1 -0
- package/console-dist/assets/floor-page-E-0txA4z.css +1 -0
- package/console-dist/assets/format-Bx7DF-TB.js +1 -0
- package/console-dist/assets/genset-BRgqR1AT.js +1 -0
- package/console-dist/assets/{get-error-message-BowDodwy.js → get-error-message-dM0BMfdP.js} +1 -1
- package/console-dist/assets/index-CrLa65Ur.css +2 -0
- package/console-dist/assets/index-CvuwOe37.js +12 -0
- package/console-dist/assets/integration-api-D2tA69Yb.js +2 -0
- package/console-dist/assets/integration-targets-Byvdd3Or.js +1 -0
- package/console-dist/assets/integrations-BLG4PT3c.js +1 -0
- package/console-dist/assets/integrations-iAjWxaDS.js +1 -0
- package/console-dist/assets/{label-DTHSKF2S.js → label-2sIXTEUK.js} +1 -1
- package/console-dist/assets/loader-circle-DjgHgHHl.js +1 -0
- package/console-dist/assets/{login-O9dnrHI9.js → login-DpNKicxy.js} +1 -1
- package/console-dist/assets/minus-CaT9UaQx.js +1 -0
- package/console-dist/assets/model-schemas-3w38IPdc.js +1 -0
- package/console-dist/assets/models-CMN9Eppf.js +1 -0
- package/console-dist/assets/models-I_V8J5Y0.js +1 -0
- package/console-dist/assets/not-found-C4YVKP97.js +1 -0
- package/console-dist/assets/pause-CqW7v5Dc.js +1 -0
- package/console-dist/assets/pharma-cleanroom-ClJRwROz.js +1 -0
- package/console-dist/assets/play-kg50os4l.js +1 -0
- package/console-dist/assets/plus-Cl4Ay5Ry.js +1 -0
- package/console-dist/assets/protocol-card-ARSwIjkN.js +1 -0
- package/console-dist/assets/{proxy-Be4WzmcS.js → proxy-CWZabK8f.js} +1 -1
- package/console-dist/assets/query-fetch-error-CWLZA2L5.js +1 -0
- package/console-dist/assets/radio-BxpVYiyS.js +1 -0
- package/console-dist/assets/registry-Dau_GjK6.js +2 -0
- package/console-dist/assets/rocket-KZ5oHK1G.js +1 -0
- package/console-dist/assets/rtu-D-1lltcO.js +1 -0
- package/console-dist/assets/select-BWlrSYlA.js +1 -0
- package/console-dist/assets/{select-display-items-BEVMAho-.js → select-display-items-DN2G8DNG.js} +1 -1
- package/console-dist/assets/server-BVem_egD.js +1 -0
- package/console-dist/assets/sliders-horizontal-BNKmYQgd.js +1 -0
- package/console-dist/assets/smart-factory-cem4tLAv.js +1 -0
- package/console-dist/assets/source-host-miravo-B8eM2IHw.js +1 -0
- package/console-dist/assets/stages-hidkaJPI.js +1 -0
- package/console-dist/assets/status-CZFZLqVk.js +1 -0
- package/console-dist/assets/tabs-BbQkzBZZ.js +1 -0
- package/console-dist/assets/tags-BBz30-eV.js +4 -0
- package/console-dist/assets/tags-K96jT8PY.js +1 -0
- package/console-dist/assets/tank-THHXGdzg.js +1 -0
- package/console-dist/assets/{tooltip-D1ydB4g3.js → tooltip-B3vOB1Vu.js} +1 -1
- package/console-dist/assets/{transition-nav-link-Crj9XTbK.js → transition-nav-link-B11-gXld.js} +1 -1
- package/console-dist/assets/trash-2-BH9HDsZv.js +1 -0
- package/console-dist/assets/use-engine-command-mutation-CHqjOqfS.js +1 -0
- package/console-dist/assets/use-transition-navigate-B-nk4aWh.js +2 -0
- package/console-dist/assets/useQuery-M9KTdi7Q.js +1 -0
- package/console-dist/assets/validation-BkfmaBBi.js +1 -0
- package/console-dist/assets/vendor-ui-D8j69UH4.js +1 -0
- package/console-dist/assets/water-treatment-CfVR0p0L.js +1 -0
- package/console-dist/index.html +65 -46
- package/miravo +2 -2
- package/package.json +1 -1
- package/console-dist/assets/api-0DOQsu1W.js +0 -1
- package/console-dist/assets/api-DdyA1QMC.js +0 -1
- package/console-dist/assets/arrow-right-BjBb4z7g.js +0 -1
- package/console-dist/assets/arrow-up-down-C1oJAmrw.js +0 -1
- package/console-dist/assets/asset-detail-D-coMgED.js +0 -1
- package/console-dist/assets/catalog-Ca9rhNLN.js +0 -1
- package/console-dist/assets/catalog-CdbAE0Ki.js +0 -1
- package/console-dist/assets/catalog-source-CPFWtBJF.js +0 -1
- package/console-dist/assets/catalog-template-icons-aec8m5-A.js +0 -1
- package/console-dist/assets/checkbox-BL44aFel.js +0 -1
- package/console-dist/assets/circle-question-mark-CJvcT6V6.js +0 -1
- package/console-dist/assets/combobox-B5iFVe7N.js +0 -1
- package/console-dist/assets/control-CtvncuAA.js +0 -1
- package/console-dist/assets/control-DYdEZmP0.js +0 -1
- package/console-dist/assets/copy-button-RVCJ3aqM.js +0 -1
- package/console-dist/assets/dropdown-menu-82O7jPU6.js +0 -1
- package/console-dist/assets/events-Bp3BqWYo.js +0 -1
- package/console-dist/assets/events-D5uZ2cwr.js +0 -1
- package/console-dist/assets/fleet-CBXZ0Xts.js +0 -1
- package/console-dist/assets/fleet-CRB8-QDg.js +0 -1
- package/console-dist/assets/format-6q8Tnwmn.js +0 -1
- package/console-dist/assets/index-BPmjm3uU.css +0 -2
- package/console-dist/assets/index-Chh5Cd8X.js +0 -12
- package/console-dist/assets/integration-targets-ChYQ8POe.js +0 -1
- package/console-dist/assets/integrations-BrZWbG5Q.js +0 -1
- package/console-dist/assets/integrations-D4x6ee5M.js +0 -1
- package/console-dist/assets/layers-1figUpjG.js +0 -1
- package/console-dist/assets/models-BDeOqKQk.js +0 -1
- package/console-dist/assets/models-CgWCVmnx.js +0 -1
- package/console-dist/assets/not-found-Dw4OTZHH.js +0 -1
- package/console-dist/assets/query-fetch-error-ytmF7SP9.js +0 -1
- package/console-dist/assets/select-Cg2u0NQI.js +0 -1
- package/console-dist/assets/shallow-Cin0mLuv.js +0 -1
- package/console-dist/assets/spawn-protocol-scope-picker-DDi-hZwj.js +0 -1
- package/console-dist/assets/tabs-BJs5Kci7.js +0 -1
- package/console-dist/assets/tags-CcmWc8Xj.js +0 -1
- package/console-dist/assets/tags-DnyhyxDB.js +0 -4
- package/console-dist/assets/use-engine-command-mutation-OZ8_Roso.js +0 -1
- package/console-dist/assets/use-integration-stream-CFkuEB9r.js +0 -2
- package/console-dist/assets/use-transition-navigate-BBXUEW59.js +0 -2
- package/console-dist/assets/validation-BvXCKp12.js +0 -1
- package/console-dist/assets/vendor-ui-CWUk2ulb.js +0 -1
- /package/console-dist/assets/{download-DmUZKo9N.js → download-i8CTJ7oi.js} +0 -0
- /package/console-dist/assets/{runtime-link-D-uJbw97.js → runtime-link-vBANRqcD.js} +0 -0
- /package/console-dist/assets/{transition-types-CPlGtM8w.js → transition-types-BKZuWApE.js} +0 -0
- /package/console-dist/assets/{triangle-alert-BXrJNk3g.js → triangle-alert-DoAwrRgk.js} +0 -0
- /package/console-dist/assets/{vendor-table-BAHQgdwg.js → vendor-table-B0Z9e_sn.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-COnpUsM8.js";import{c as n}from"./vendor-charts-95ykyDlI.js";var r=t((e=>{var t=n();function r(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 i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(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 n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return c(e,t,null,n)},e.flushSync=function(e){var t=l.T,n=a.p;try{if(l.T=null,a.p=2,e)return e()}finally{l.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=u(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=u(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=u(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=u(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 l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0-canary-fef12a01-20260413`})),i=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=r()})),a=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),o=t(((e,t)=>{t.exports=a()}));function s(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var c={};function l(e,t,n,r,i){if(!n&&!r&&!i&&!e)return d(t);let a=d(e);return t&&(a=f(a,t)),n&&(a=f(a,n)),r&&(a=f(a,r)),i&&(a=f(a,i)),a}function u(e){if(e.length===0)return c;if(e.length===1)return d(e[0]);let t=d(e[0]);for(let n=1;n<e.length;n+=1)t=f(t,e[n]);return t}function d(e){return g(e)?{...e(c)}:p(e)}function f(e,t){return g(t)?t(e):m(e,t)}function p(e){let t={...e};for(let e in t){let n=t[e];h(e,n)&&(t[e]=v(n))}return t}function m(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=s(e.style,r);break;case`className`:e[n]=b(e.className,r);break;default:h(n,r)?e[n]=_(e[n],r):e[n]=r}}return e}function h(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 g(e){return typeof e==`function`}function _(e,t){return t?e?(...n)=>{let r=n[0];if(x(r)){let i=r;y(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:v(t):e}function v(e){return e&&((...t)=>{let n=t[0];return x(n)&&y(n),e(...t)})}function y(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function b(e,t){return t?e?t+` `+e:t:e}function x(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var S=e(n(),1),C={};function w(e,t){let n=S.useRef(C);return n.current===C&&(n.current=e(t)),n}function T(e,t,n,r){let i=w(D).current;return O(i,e,t,n,r)&&A(i,[e,t,n,r]),i.callback}function E(e){let t=w(D).current;return k(t,e)&&A(t,e),t.callback}function D(){return{callback:null,cleanup:null,refs:[]}}function O(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function k(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function A(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(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;break;default:}}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;break;default:}}}}}}var j=19;function M(e){return j>=e}function N(e){if(!S.isValidElement(e))return null;let t=e,n=t.props;return(M(19)?n?.ref:t.ref)??null}function P(){}var F=Object.freeze([]),I=Object.freeze({});function L(e,t){let n={};for(let r in e){let i=e[r];if(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 ee(e,t){return typeof e==`function`?e(t):e}function R(e,t){return typeof e==`function`?e(t):e}function z(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=U(r));let i=B(t,n,r);if(n.enabled===!1)return null;let a=n.state??I;return W(e,r,i,a)}function B(e,t,n){let{className:r,style:i}=e,{state:a=I,ref:o,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?ee(r,a):void 0,f=u?R(i,a):void 0,p=u?L(a,l):I,m=u&&c?V(c):void 0,h=u?s(p,m)??{}:I;return typeof document<`u`&&(u?Array.isArray(o)?h.ref=E([h.ref,N(n),...o]):h.ref=T(h.ref,N(n),o):T(null,null)),u?(d!==void 0&&(h.className=b(h.className,d)),f!==void 0&&(h.style=s(h.style,f)),h):I}function V(e){return Array.isArray(e)?u(e):l(void 0,e)}var H=Symbol.for(`react.lazy`);function U(e){if(e?.$$typeof!==H)return e;let t=S.Children.toArray(e)[0];return S.isValidElement(t)?t:e}function W(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=l(n,t.props);return e.ref=n.ref,S.cloneElement(t,e)}return te(e,n)}function te(e,t){return e===`button`?(0,S.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,S.createElement)(`img`,{alt:``,...t,key:t.key}):S.createElement(e,t)}function G(e){return z(e.defaultTagName??`div`,e,e)}function ne(){return typeof window<`u`}function re(e){return ie(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((ie(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ie(e){return ne()?e instanceof Node||e instanceof K(e).Node:!1}function ae(e){return ne()?e instanceof Element||e instanceof K(e).Element:!1}function oe(e){return ne()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function se(e){return!ne()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function ce(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function le(e){return/^(table|td|th)$/.test(re(e))}function ue(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var de=/transform|translate|scale|rotate|perspective|filter/,fe=/paint|layout|strict|content/,pe=e=>!!e&&e!==`none`,me;function he(e){let t=ae(e)?ye(e):e;return pe(t.transform)||pe(t.translate)||pe(t.scale)||pe(t.rotate)||pe(t.perspective)||!_e()&&(pe(t.backdropFilter)||pe(t.filter))||de.test(t.willChange||``)||fe.test(t.contain||``)}function ge(e){let t=xe(e);for(;oe(t)&&!ve(t);){if(he(t))return t;if(ue(t))return null;t=xe(t)}return null}function _e(){return me??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),me}function ve(e){return/^(html|body|#document)$/.test(re(e))}function ye(e){return K(e).getComputedStyle(e)}function be(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xe(e){if(re(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||se(e)&&e.host||q(e);return se(t)?t.host:t}function Se(e){let t=xe(e);return ve(t)?(e.ownerDocument||e).body:oe(t)&&ce(t)?t:Se(t)}function Ce(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Se(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=we(a);return t.concat(a,a.visualViewport||[],ce(r)?r:[],e&&n?Ce(e):[])}else return t.concat(r,Ce(r,[],n))}function we(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Te={...S},Ee=Te.useInsertionEffect,De=Ee&&Ee!==Te.useLayoutEffect?Ee:e=>e();function J(e){let t=w(Oe).current;return t.next=e,De(t.effect),t.trampoline}function Oe(){let e={next:void 0,callback:ke,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ke(){}var Y=typeof document<`u`?S.useLayoutEffect:()=>{};function Ae(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var je=Ae(`https://base-ui.com/production-error`,`Base UI`),Me=S.createContext(void 0);function Ne(e=!1){let t=S.useContext(Me);if(t===void 0&&!e)throw Error(je(16));return t}function Pe(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:S.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function Fe(e){return e?.ownerDocument||document}function Ie(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(K(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Le(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=S.useRef(null),s=Ne(!0),c=a??s!==void 0,{props:u}=Pe({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),d=S.useCallback(()=>{let e=o.current;Re(e)&&c&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,c]);return Y(d,[d]),{getButtonProps:S.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...d}=e;return l({onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(y(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=Re(r),s=!i&&ze(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),Ie(r,e));return}if(!l||i||!d&&!u){n&&s&&d&&e.preventDefault();return}e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Ie(r,e)))},onKeyUp(e){if(!t){if(y(e),a?.(e),e.target===e.currentTarget&&i&&c&&Re(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Ie(e.currentTarget,e))}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?{type:`button`}:{role:`button`},u,d)},[t,u,c,i]),buttonRef:J(e=>{o.current=e,d()})}}function Re(e){return oe(e)&&e.tagName===`BUTTON`}function ze(e){return oe(e)&&e.tagName===`A`&&!!e.href}var Be=S.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Le({disabled:i,focusableWhenDisabled:a,native:o});return z(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Ve=`data-valid`,He=`data-invalid`,Ue={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},We={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Ge={disabled:!1,...We},Ke={valid(e){return e===null?null:e?{[Ve]:``}:{[He]:``}}},qe={invalid:void 0,name:void 0,validityData:{state:Ue,errors:[],error:``,value:``,initialValue:null},setValidityData:P,disabled:void 0,setTouched:P,setDirty:P,setFilled:P,setFocused:P,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:Ge,registerFieldControl:P,validation:{getValidationProps:(e,t=I)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:P,getInputControl:()=>null,commit:async()=>{},change:P}},Je=S.createContext(qe);function Ye(e=!0){let t=S.useContext(Je);if(t.setValidityData===P&&!e)throw Error(je(28));return t}var Xe=S.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:P,validationMode:`onSubmit`,submitCountRef:{current:0}});function Ze(){return S.useContext(Xe)}function Qe(){let[,e]=S.useState({});return S.useCallback(()=>{e({})},[])}var $e=0;function et(e,t=`mui`){let n=S.useRef(void 0),r=Qe(),i=e??n.current;return S.useEffect(()=>{n.current??($e+=1,n.current=`${t}-${$e}`,e??r())},[e,t,r]),i}var tt=Te.useId;function nt(e,t){if(tt!==void 0){let n=tt();return e??(t?`${t}-${n}`:n)}return et(e,t)}function rt(e){return nt(e,`base-ui`)}var it=S.createContext({controlId:void 0,registerControlId:P,resetControlId:P,labelId:void 0,setLabelId:P,messageIds:[],setMessageIds:P,getDescriptionProps:e=>e});function at(){return S.useContext(it)}var ot=e(i(),1),X=o();function st(e,t,n,r=!0,i,a){let[o,s]=S.useState(),c=rt(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Y(()=>{let i=e||t||l||!r?void 0:ct(n.current,c);o!==i&&s(i)}),u}function ct(e,t){let n=lt(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function lt(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function ut(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=at(),o=rt(),s=w(()=>Symbol()),c=S.useRef(!1),l=S.useRef(!1),u=J(()=>{!c.current||i===P||(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===P){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}if(e===void 0){u();return}c.current=!0,i(s.current,e)},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}function dt(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ft,platform:pt,maxTouchPoints:mt}=dt(),ht=ft.toLowerCase(),gt=pt.toLowerCase(),Z=/^i(os$|p)/.test(gt)||gt===`macintel`&&mt>1,_t=`android`,vt=gt===_t||ht.includes(_t),yt=!Z&>.startsWith(`mac`);gt.startsWith(`win`),!vt&&/^(linux|chrome os)/.test(gt);var bt=yt||Z,xt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),St=!xt&&ht.includes(`firefox`);!xt&&ht.includes(`chrom`);var Ct=bt,wt=/jsdom|happydom/.test(ht);function Tt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&se(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Et(e,t){let n=e;for(;n;){if(ae(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(se(n)?n.host:null)}return null}function Dt(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Ot=`data-base-ui-focusable`,kt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,At=`ArrowLeft`,jt=`ArrowRight`,Mt=`ArrowUp`,Nt=`ArrowDown`,Pt=`data-starting-style`,Ft=`data-ending-style`,It={[Pt]:``},Lt={[Ft]:``},Rt={transitionStatus(e){return e===`starting`?It:e===`ending`?Lt:null}},zt=`data-open`,Bt=`data-closed`,Vt=`data-anchor-hidden`,Ht=`data-popup-open`,Ut=`data-pressed`,Wt={[Ht]:``},Gt={[Ht]:``,[Ut]:``},Kt={[zt]:``},qt={[Bt]:``},Jt={[Vt]:``},Yt={open(e){return e?Wt:null}},Xt={open(e){return e?Gt:null}},Zt={open(e){return e?Kt:qt},anchorHidden(e){return e?Jt:null}},Qt={...Zt,...Rt},$t=`data-trigger-disabled`;function en(e,t){if(!ae(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute($t);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute($t);return!1}function tn(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 nn(e){return e.matches(`html,body`)}function rn(e){return oe(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function an(e){return Et(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${kt}`)!=null}function on(e){return e?e.getAttribute(`role`)===`combobox`&&rn(e):!1}function sn(e){if(!e||wt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function cn(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ln(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ln(e,t.id,n)])}function un(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function dn(e){e.preventDefault(),e.stopPropagation()}function fn(e){return`nativeEvent`in e}function pn(e){return e.pointerType===``&&e.isTrusted?!0:vt&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function mn(e){return wt?!1:!vt&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(vt||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function hn(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function gn(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var _n=Math.min,vn=Math.max,yn=Math.round,bn=Math.floor,xn=e=>({x:e,y:e}),Sn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Cn(e,t,n){return vn(e,_n(t,n))}function wn(e,t){return typeof e==`function`?e(t):e}function Tn(e){return e.split(`-`)[0]}function En(e){return e.split(`-`)[1]}function Dn(e){return e===`x`?`y`:`x`}function On(e){return e===`y`?`height`:`width`}function kn(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function An(e){return Dn(kn(e))}function jn(e,t,n){n===void 0&&(n=!1);let r=En(e),i=An(e),a=On(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Bn(o)),[o,Bn(o)]}function Mn(e){let t=Bn(e);return[Nn(e),t,Nn(t)]}function Nn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Pn=[`left`,`right`],Fn=[`right`,`left`],In=[`top`,`bottom`],Ln=[`bottom`,`top`];function Rn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Fn:Pn:t?Pn:Fn;case`left`:case`right`:return t?In:Ln;default:return[]}}function zn(e,t,n,r){let i=En(e),a=Rn(Tn(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Nn)))),a}function Bn(e){let t=Tn(e);return Sn[t]+e.slice(t.length)}function Vn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Hn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Vn(e)}function Un(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 Wn(e,t,n){return Math.floor(e/t)!==n}function Gn(e,t){return t<0||t>=e.length}function Kn(e,t){return Yn(e.current,{disabledIndices:t})}function qn(e,t){return Yn(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Jn(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Yn(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Gn(e,u)?-1:u,wrapped:d}}function Yn(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&&Zn(e,a,r));return a}function Xn(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=Et(e,`[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);o=a[i(t,u,n[o][e]??n[o][0])]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Zn(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=bn(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(!Zn(e,r,s))return r}};d&&dn(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=Yn(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=Yn(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Gn(e,f)&&(f=u)}if(n===`both`){let n=bn(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&dn(t),u%o===o-1?r&&(f=Yn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Yn(e,{startingIndex:u,disabledIndices:s}),r&&Wn(f,o,n)&&(f=Yn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Wn(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&dn(t),u%o===0?r&&(f=Yn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Yn(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Wn(f,o,n)&&(f=Yn(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Wn(f,o,n)&&(f=u));let c=bn(l/o)===n;Gn(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Yn(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Zn(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!$n(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Qn(e){return e.visibility===`hidden`||e.visibility===`collapse`}function $n(e,t=e?ye(e):null){return!e||!e.isConnected||!t||Qn(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var er=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function tr(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return se(n)?n.host:null}function nr(e){for(let t of Array.from(e.children))if(re(t)===`summary`)return t;return null}function rr(e,t){let n=nr(t);return!!n&&(e===n||Q(n,e))}function ir(e){let t=e?re(e):``;return e!=null&&e.matches(er)&&(t!==`summary`||e.parentElement!=null&&re(e.parentElement)===`details`&&nr(e.parentElement)===e)&&(t!==`details`||nr(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ar(e){if(!ir(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=tr(t)){let n=t!==e,r=re(t)===`slot`;if(t.hasAttribute(`inert`)||n&&re(t)===`details`&&!t.open&&!rr(e,t)||t.hasAttribute(`hidden`)||!r&&!or(t,n))return!1}return!0}function or(e,t){let n=ye(e);return t?n.display!==`none`:$n(e,n)}function sr(e){let t=e.tabIndex;if(t<0){let t=re(e);if(t===`details`||t===`audio`||t===`video`||oe(e)&&e.isContentEditable)return 0}return t}function cr(e){if(re(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function lr(e,t){let n=cr(e);if(!n)return!0;let r=t.find(e=>{let t=cr(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=cr(e);return t?.name===n.name&&t.form===n.form})===n}function ur(e){if(oe(e)&&re(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return oe(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function dr(e,t){ur(e).forEach(e=>{ir(e)&&t.push(e),dr(e,t)})}function fr(e,t,n){ur(e).forEach(e=>{oe(e)&&e.matches(t)&&n.push(e),fr(e,t,n)})}function pr(e){return ar(e)&&sr(e)>=0}function mr(e){let t=[];return dr(e,t),t.filter(ar)}function hr(e){let t=mr(e);return t.filter(e=>sr(e)>=0&&lr(e,t))}function gr(e,t){let n=hr(e),r=n.length;if(r===0)return;let i=Tt(Fe(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _r(e){return gr(Fe(e).body,1)||e}function vr(e){return gr(Fe(e).body,-1)||e}function yr(e,t,n){if(!e)return null;let r=[];dr(Fe(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(ar);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&pr(o)&&lr(o,a))return o}return r[i]}function br(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function xr(e){hr(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Sr(e){let t=[];fr(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 Cr(e){S.useEffect(e,F)}var wr=0,Tr=class e{static create(){return new e}currentId=wr;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=wr,t()},e)}isStarted(){return this.currentId!==wr}clear=()=>{this.currentId!==wr&&(clearTimeout(this.currentId),this.currentId=wr)};disposeEffect=()=>this.clear};function Er(){let e=w(Tr.create).current;return Cr(e.disposeEffect),e}var Dr=S.createContext({disabled:!1});function Or(){return S.useContext(Dr)}var kr=null;globalThis.requestAnimationFrame;var Ar=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;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)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},jr=class e{static create(){return new e}static request(e){return Ar.request(e)}static cancel(e){return Ar.cancel(e)}currentId=kr;request(e){this.cancel(),this.currentId=Ar.request(()=>{this.currentId=kr,e()})}cancel=()=>{this.currentId!==kr&&(Ar.cancel(this.currentId),this.currentId=kr)};disposeEffect=()=>this.cancel};function Mr(){let e=w(jr.create).current;return Cr(e.disposeEffect),e}function Nr(e){return e==null?e:`current`in e?e.current:e}function Pr(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Fr=null;function Ir(e){if(!Fr){let e=[];Fr=e,queueMicrotask(()=>{Fr=null,ot.flushSync(()=>{for(let t of e)t()})})}Fr.push(e)}function Lr(e,t=!1,n=!1){let r=Mr();return J((i,a=null)=>{r.cancel();let o=Nr(e);if(o==null)return;let s=o,c=()=>{if(!n){ot.flushSync(i);return}Ir(()=>{a?.aborted||i()})};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Pr(s).map(e=>e.finished.then(P))).then(()=>{a?.aborted||c()},()=>{if(!a?.aborted){if(Pr(s).some(e=>e.pending||e.playState!==`finished`)){l();return}c()}})}if(t){let e=Pt;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function Rr(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=J(a),s=Lr(r,n,i);S.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function zr(e,t=!1,n=!1,r=!1){let[i,a]=S.useState(e&&t?`idle`:void 0),[o,s]=S.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=jr.request(()=>{a(`ending`)});return()=>{jr.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t||i===void 0)return;let n=jr.request(()=>{a(void 0)});return()=>{jr.cancel(n)}},[t,e,i]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=jr.request(()=>{a(`idle`)});return()=>{jr.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Br(e,t,n){let{setFocused:r,focusOwnerRef:i}=Ye(),a=J(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Y(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Vr(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Ye(),s=w(()=>Symbol());Y(()=>{let c=s.current;if(!i){o(c,void 0);return}o(c,{controlRef:e,getValue:r,id:t,name:a,value:n})},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Hr(e,t){let n=S.useRef(e),r=J(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function $(e,t,n,r){let i=!1,a=!1,o=r??I;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 Ur(e,t,n){let r=n??I;return{reason:e,event:t??new Event(`base-ui`),...r}}var Wr=`none`,Gr=`trigger-press`,Kr=`trigger-hover`,qr=`trigger-focus`,Jr=`outside-press`,Yr=`item-press`,Xr=`close-press`,Zr=`clear-press`,Qr=`input-change`,$r=`input-clear`,ei=`input-press`,ti=`focus-out`,ni=`escape-key`,ri=`list-navigation`,ii=`keyboard`,ai=`pointer`,oi=`cancel-open`,si=`sibling-open`,ci=`disabled`,li=`missing`,ui=`initial`,di=`imperative-action`,fi=`window-resize`,pi=S.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=Ye(),{clearErrors:C,elementRef:w,submitCountRef:T}=Ze(),E=h||s,D=m??a,O={...p,disabled:E},{labelId:k}=at(),A=ut({id:i}),j=o!==void 0,M=o==null?void 0:String(o),N=J(()=>x.inputRef.current?.value);Vr(x.inputRef,A,M,N,!E,a),Y(()=>{let e=M??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[M,l,x.inputRef,y]),Hr(M,()=>{M!==void 0&&(C(D),_(M!==(v.initialValue??``)),x.change(M))});let P=S.useRef(null),F=Br(E,P),I=Er();return z(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:x.inputRef,"aria-labelledby":k,autoFocus:u,...j?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=$(Wr,e.nativeEvent);c?.(t,n),!j&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),x.change(t)))},onFocus(){F(!0)},onBlur(e){if(g(!0),F(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),j&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(E,e)],stateAttributesMapping:Ke})}),mi=S.forwardRef(function(e,t){return(0,X.jsx)(pi,{ref:t,...e})}),hi=S.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return z(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),gi=S.createContext(void 0);function _i(e){let t=S.useContext(gi);if(!e&&t===void 0)throw Error(je(27));return t}var vi=S.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=_i(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return z(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:Qt,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),yi=S.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=_i(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Le({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,$(Xr,e.nativeEvent))}return z(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),bi=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_i(),c=rt(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),z(`p`,e,{ref:t,props:[{id:c},o]})});function xi(e,t){return t!=null&&!hn(t)?0:typeof e==`function`?e():e}function Si(e,t,n){let r=xi(e,n);return typeof r==`number`?r:r?.[t]}function Ci(e){return typeof e==`function`?e():e}function wi(e,t){return t||e===`click`||e===`mousedown`}function Ti(e){return e?.includes(`mouse`)&&e!==`mousedown`}var Ei=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Tr,currentIdRef:{current:null},currentContextRef:{current:null}});function Di(e,t){e.current=t.current}function Oi(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=S.useRef(n),a=S.useRef(n),o=S.useRef(null),s=S.useRef(null),c=Er();return Y(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:Si(i.current,`open`),close:Si(n,`close`)}},[n,o,i,a]),(0,X.jsx)(Ei.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function ki(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=S.useContext(Ei),[d,f]=S.useState(!1),p=S.useRef(n);return Y(()=>{p.current=n},[n]),Y(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Y(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:Si(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,$(Wr))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Y(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,Di(a,s),u.clear()}},[c,i,a,r,s,u]),S.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function Ai(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ji(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Mi(e){let t=w(Ni,e).current;return t.next=e,Y(t.effect),t}function Ni(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Pi={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Fi={...Pi,position:`fixed`,margin:0,top:0,left:0},Ii={...Pi,position:`absolute`},Li=S.forwardRef(function(e,t){let[n,r]=S.useState();Y(()=>{Ct&&xt&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,X.jsx)(`span`,{...e,ref:t,style:Fi,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function Ri(e){return`data-base-ui-${e}`}var zi=0;function Bi(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(zi);function a(){i&&!i()||e?.focus({preventScroll:n})}if(r)return a(),P;let o=requestAnimationFrame(a);return zi=o,()=>{zi===o&&(cancelAnimationFrame(o),zi=0)}}var Vi=`data-base-ui-inert`,Hi=new WeakMap,Ui=new WeakSet,Wi=new WeakMap,Gi=0;function Ki(e){return e?se(e)?e.host:Ki(e.parentNode):null}var qi=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ki(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ji=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Yi=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{re(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Xi(e,t,n,{mark:r=!0}){let i=qi(t,e),a=r?Yi(t,Ji(i),new Set(i)):[],o=[],s=[];if(n){let e=qi(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Yi(t,Ji(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Hi.get(e)||0)+1;Hi.set(e,r),o.push(e),r===1&&n&&Ui.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Wi.get(e)||0)+1;Wi.set(e,t),s.push(e),t===1&&e.setAttribute(Vi,``)}),Gi+=1,()=>{o.forEach(e=>{let t=(Hi.get(e)||0)-1;Hi.set(e,t),t||(Ui.has(e)||e.removeAttribute(`aria-hidden`),Ui.delete(e))}),r&&s.forEach(e=>{let t=(Wi.get(e)||0)-1;Wi.set(e,t),t||e.removeAttribute(Vi)}),--Gi,Gi||(Hi=new WeakMap,Ui=new WeakSet,Wi=new WeakMap)}}function Zi(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Fe(e[0]).body;return Xi(e,i,n,{mark:r})}var Qi={style:{transition:`none`}},$i={fallbackAxisSide:`none`},ea={fallbackAxisSide:`end`},ta={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},na=S.createContext(null),ra=()=>S.useContext(na),ia=Ri(`portal`);function aa(e={}){let{ref:t,container:n,componentProps:r=I,elementProps:i}=e,a=nt(),o=ra()?.portalNode,[s,c]=S.useState(null),[l,u]=S.useState(null),d=J(e=>{e!==null&&u(e)}),f=S.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(ie(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=z(`div`,r,{ref:[t,d],props:[{id:a,[ia]:``},i]}),m=s&&p?ot.createPortal(p,s):null;return{node:l,nodeId:S.isValidElement(p)?p.props.id:void 0,subtree:m}}var oa=S.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=aa({container:o,ref:t,componentProps:e,elementProps:c}),f=S.useRef(null),p=S.useRef(null),m=S.useRef(null),h=S.useRef(null),[g,_]=S.useState(null),v=S.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;S.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&br(e)&&(e.type===`focusin`?v.current&&=(Sr(l),!1):(xr(l),v.current=!0))}return ji(Ai(l,`focusin`,e,!0),Ai(l,`focusout`,e,!0))},[l,y]),Y(()=>{!l||b!==!0||!v.current||(Sr(l),v.current=!1)},[b,l]);let C=S.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,X.jsxs)(S.Fragment,{children:[d,(0,X.jsxs)(na.Provider,{value:C,children:[x&&l&&(0,X.jsx)(Li,{"data-type":`outside`,ref:f,onFocus:e=>{br(e,l)?m.current?.focus():vr(g?g.domReference:null)?.focus()}}),x&&l&&(0,X.jsx)(`span`,{role:s,"aria-owns":u,style:ta}),l&&ot.createPortal(a,l),x&&l&&(0,X.jsx)(Li,{"data-type":`outside`,ref:p,onFocus:e=>{br(e,l)?h.current?.focus():(_r(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,$(`focus-out`,e.nativeEvent)))}})]})]})});function sa(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ca=class{nodesRef={current:[]};events=sa();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)}},la=S.createContext(null),ua=S.createContext(null),da=()=>S.useContext(la)?.id||null,fa=e=>{let t=S.useContext(ua);return e??t};function pa(e){let t=nt(),n=fa(e),r=da();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ma(e){let{children:t,id:n}=e,r=da();return(0,X.jsx)(la.Provider,{value:S.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ha(e){let{children:t,externalTree:n}=e,r=w(()=>n??new ca).current;return(0,X.jsx)(ua.Provider,{value:r,children:t})}function ga(e,t){let n=K(Dt(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(pn(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var _a=20,va=[];function ya(){va=va.filter(e=>e.deref()?.isConnected)}function ba(e){ya(),e&&re(e)!==`body`&&(va.push(new WeakRef(e)),va.length>_a&&(va=va.slice(-_a)))}function xa(){return ya(),va[va.length-1]?.deref()}function Sa(e){return e?pr(e)?e:hr(e)[0]||e:null}function Ca(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=mr(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return pr(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function wa(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=J(()=>b.current.floatingContext?.nodeId),C=i===!1,w=on(_)&&C,E=Mi(i),D=Mi(a),O=Mi(o),k=Mi(u),A=Mi(g),j=fa(m),M=ra(),N=S.useRef(!1),P=S.useRef(!1),F=S.useRef(!1),I=S.useRef(null),L=S.useRef(``),ee=S.useRef(``),R=S.useRef(null),z=S.useRef(null),B=T(R,p,M?.beforeInsideRef),V=T(z,M?.afterInsideRef),H=Er(),U=Er(),W=Mr(),te=M!=null,G=cn(v),ne=J((e=G)=>e?hr(e):[]),K=J(()=>h?.().filter(e=>e!=null)??[]);S.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(G,Tt(Fe(G)))&&ne().length===0&&!w&&dn(e)}return Ai(Fe(G),`keydown`,e)},[r,G,c,w,ne]),S.useEffect(()=>{if(r||!g)return;let e=Fe(G);function t(){F.current=!1}function n(e){let t=Dt(e),n=K();F.current=!(Q(v,t)||Q(_,t)||Q(M?.portalNode,t)||n.some(e=>e===t||Q(e,t))),ee.current=e.pointerType||`keyboard`,Et(t,`[data-base-ui-click-trigger]`)&&(P.current=!0,U.start(0,()=>{P.current=!1}))}function i(){ee.current=`keyboard`}return ji(Ai(e,`pointerdown`,n,!0),Ai(e,`pointerup`,t,!0),Ai(e,`pointercancel`,t,!0),Ai(e,`keydown`,i,!0),t)},[r,v,_,G,g,M,U,K]),S.useEffect(()=>{if(r||!l)return;let e=Fe(G);function n(){P.current=!0,U.start(0,()=>{P.current=!1})}function i(e){let t=Dt(e);pr(t)&&(I.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Dt(n);c&&r==null&&a!=null&&Q(v,a)&&ba(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=K(),p=r?.hasAttribute(Ri(`focus-guard`))&&[R.current,z.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Nr(f),Nr(d)].includes(r),m=!(Q(_,r)||Q(v,r)||Q(r,v)||Q(M?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||j&&(ln(j.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||un(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,cn(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&G&&Ca(G),s&&i!==_&&!$n(a)&&Tt(e)===e.body){if(oe(G)&&(G.focus(),s===`popup`)){W.request(()=>{G.focus()});return}let e=ne(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||G;oe(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(w||!c)&&r&&m&&!P.current&&(w||r!==xa())&&(N.current=!0,t.setOpen(!1,$(ti,n)))})}function o(){F.current||(b.current.insideReactTree=!0,H.start(0,()=>{b.current.insideReactTree=!1}))}let u=oe(_)?_:null;if(!(!v&&!u))return ji(u&&Ai(u,`focusout`,a),u&&Ai(u,`pointerdown`,n),v&&Ai(v,`focusin`,i),v&&Ai(v,`focusout`,a),v&&M&&Ai(v,`focusout`,o,!0))},[r,_,v,G,c,j,M,t,l,s,ne,w,x,b,H,U,W,d,f,K]),S.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${Ri(`portal`)}]`)||[]),t=(j?un(j.nodesRef.current,x()):[]).find(e=>on(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Zi([...[v,...e,R.current,z.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...K()],t,Nr(f),Nr(d),w?_:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=Zi([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,M,w,j,x,d,f,K]),Y(()=>{if(!g||r||!oe(G))return;L.current=``,ee.current=``;let e=Fe(G),t=Tt(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Q(G,t))return;let i=null,a=()=>(i??=ne(G),i[0]||G),o;o=r===!0||r===null?a():Nr(r),o||=a();let s=Q(G,Tt(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&pn(c);Bi(o,{sync:l,preventScroll:o===G,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Tt(e);return!(t!==o&&Q(G,t))}})})},[r,g,G,ne,E,k,A,b]);let q=S.useRef(null);Y(()=>{if(r||!G){q.current=null;return}q.current&&=(q.current.cancelled=!0,null);let e=Fe(G),t=Tt(e),n=k.current==null;ba(t);function i(e){if(e.open||(L.current=ga(e.nativeEvent,ee.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Ri(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(N.current=!0),e.reason===`outside-press`)if(e.nested)N.current=!1;else if(pn(e.nativeEvent)||mn(e.nativeEvent))N.current=!1;else{let e=!1;Fe(G).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}y.on(`openchange`,i);function a(e){let r=D.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&re(t)!==`body`?t:null,s=n?o||a:a||o;return s||=xa()||null,typeof i==`boolean`?s:Nr(i)||s||null}return()=>{y.off(`openchange`,i);let t=Tt(e),n=K(),r=Q(v,t)||n.some(e=>e===t||Q(e,t))||j&&ln(j.nodesRef.current,x(),!1).some(e=>Q(e.context?.elements.floating,t)),o=D.current,s=L.current,c=a(s),l={cancelled:!1};q.current=l,queueMicrotask(()=>{q.current===l&&(q.current=null);let n=Sa(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!N.current&&oe(n)&&(!(!i&&n!==t&&t!==e.body)||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,v,G,D,O,k,y,j,_,x,K]),Y(()=>{if(!xt||g||!v)return;let e=Tt(Fe(v));!oe(e)||!rn(e)||Q(v,e)&&e.blur()},[g,v]),Y(()=>{if(!(r||!M))return M.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,c,g,t,l,_]),Y(()=>{if(!(r||!G))return Ca(G),()=>{queueMicrotask(ya)}},[r,G]);let ie=!r&&(c?!w:!0)&&(te||c);return(0,X.jsxs)(S.Fragment,{children:[ie&&(0,X.jsx)(Li,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=ne();Bi(e[e.length-1])}else M?.portalNode&&(N.current=!1,br(e,M.portalNode)?_r(_)?.focus():Nr(f??M.beforeOutsideRef)?.focus())}}),n,ie&&(0,X.jsx)(Li,{"data-type":`inside`,ref:V,onFocus:e=>{c?Bi(ne()[0]):M?.portalNode&&(l&&(N.current=!0),br(e,M.portalNode)?vr(_)?.focus():Nr(d??M.afterOutsideRef)?.focus())}})]})}function Ta(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Gr}=t,l=e.context.dataRef,u=S.useRef(void 0),d=Mr(),f=Er(),p=S.useMemo(()=>{function t(t,n,r,i){let a=$(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=hn(e.pointerType,!0)&&mn(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||hn(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Dt(s),p=rn(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;if(r===`mousedown`&&o){u.current=void 0;return}hn(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return S.useMemo(()=>n?{reference:p}:I,[n,p])}function Ea(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Da(e){return e!=null&&e.clientX!=null}function Oa(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=S.useRef(!1),l=S.useRef(null),[u,d]=S.useState(),[f,p]=S.useState([]),m=J(t=>{e.set(`positionReference`,t)}),h=J((t,n,i)=>{c.current||s.current.openEvent&&!Da(s.current.openEvent)||e.set(`positionReference`,Ea(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=J(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=hn(u)?a:i;S.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=K(a);function r(t){Q(a,Dt(t))?e():h(t.clientX,t.clientY)}return!s.current.openEvent||Da(s.current.openEvent)?l.current=Ai(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),S.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),S.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),S.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=S.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return S.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function ka(){return!1}function Aa(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ja(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=ka,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=fa(c),m=J(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=J(()=>a),{escapeKey:v,outsidePress:y}=Aa(s),b=S.useRef(!1),x=S.useRef(!1),C=S.useRef(!1),w=S.useRef(!1),T=S.useRef(!1),E=S.useRef(``),D=S.useRef(null),O=Er(),k=Er(),A=Er(),j=J(()=>{k.clear(),d.current.insideReactTree=!1}),M=J(e=>{let t=d.current.floatingContext?.nodeId;return(p?ln(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=J(t=>tn(t,e.select(`floatingElement`))||tn(t,e.select(`domReferenceElement`))),P=J(t=>{o()&&e.setOpen(!1,$(Gr,t.nativeEvent))}),F=J(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=fn(t)?t.nativeEvent:t;if(T.current||i.isComposing||!v&&M(`__escapeKeyBubbles`))return;let a=$(ni,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),I=J(()=>{d.current.insideReactTree=!0,k.start(0,j)}),L=J(t=>{if(!l||!n||t.button!==0)return;let r=Dt(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),ee=J(e=>{!l||!n||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});S.useEffect(()=>{function e(e){e.open||(w.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),S.useEffect(()=>j,[j]),S.useEffect(()=>{if(!l||!n)return l||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Tr,i=Fe(u);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(xt?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function S(e){let t=d.current.floatingContext?.nodeId,n=p&&ln(p.nodesRef.current,t).some(t=>tn(e,t.context?.elements.floating));return N(e)||n}function k(n){if(m(n)){n.type!==`click`&&!N(n)&&(t.clear(),C.current=!1),j();return}if(d.current.insideReactTree){j();return}let r=Dt(n),i=`[${Ri(`inert`)}]`,a=ae(r)?r.getRootNode():null,o=Array.from((se(a)?a:Fe(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=ae(r)?r:null;for(;c&&!ve(c);){let e=xe(c);if(ve(e)||!ae(e))break;c=e}if(!(o.length&&ae(r)&&!nn(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(oe(r)&&!(`touches`in n)){let e=ve(r),t=ye(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!S(n)){if(f()===`intentional`){if(n.detail!==0&&!pn(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof h==`function`&&!h(n)||M(`__outsidePressBubbles`)||(e.setOpen(!1,$(Jr,n)),j())}}}function P(t){f()!==`sloppy`||t.pointerType===`touch`||!e.select(`open`)||!n||N(t)||k(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||N(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=Dt(e);if(!n)return;let r=Ai(n,e.type,()=>{t(e),r()})}function ee(e){E.current=`touch`,L(e,I)}function R(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),!(e.type===`mousedown`&&D.current&&!D.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?P(e):k(e)})}function z(e){if(e.type===`pointercancel`&&(w.current=!1),!b.current)return;let n=x.current;if(c(),f()===`intentional`){if(e.type===`pointercancel`){n&&s();return}if(!S(e)){if(n){s();return}typeof h==`function`&&!h(e)||(t.clear(),C.current=!0,j())}}}function B(e){if(f()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function V(e){L(e,B)}function H(e){f()!==`sloppy`||!D.current||N(e)||(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function U(e){L(e,H)}let W=ji(r&&ji(Ai(i,`keydown`,F),Ai(i,`compositionstart`,a),Ai(i,`compositionend`,o)),g&&ji(Ai(i,`click`,R,!0),Ai(i,`pointerdown`,R,!0),Ai(i,`pointerup`,z,!0),Ai(i,`pointercancel`,z,!0),Ai(i,`mousedown`,R,!0),Ai(i,`mouseup`,z,!0),Ai(i,`touchstart`,ee,{capture:!0,passive:!0}),Ai(i,`touchmove`,V,{capture:!0,passive:!0}),Ai(i,`touchend`,U,{capture:!0,passive:!0})));return()=>{W(),t.clear(),c(),C.current=!1}},[d,u,r,g,h,l,n,v,y,F,j,_,M,N,p,e,O,A]);let R=S.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),z=S.useMemo(()=>({onKeyDown:F,onPointerDown:ee,onMouseDown:ee,onClickCapture:I,onMouseDownCapture(e){I(),L(e)},onPointerDownCapture(e){I(),L(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,L,ee]);return S.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function Ma(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};ae(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Na(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=J(i),{mounted:c,setMounted:l,transitionStatus:u}=zr(t,!1,!1,o),d=t?!1:r;Y(()=>{t&&s(!1)},[t,s]);let f=S.useRef(c),p=S.useRef(!1),m=Qe(),h=()=>{f.current=!1,l(!1),a()};Y(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=J(()=>{if(f.current){if(t){p.current=!0,m();return}h()}});return Rr({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Pa={tabIndex:-1,[Ot]:``};function Fa(e){return t=>t===`touch`?e.current:!0}function Ia(e,t=!1){let n=nt(),r=da()!=null,i=w(()=>e(n,r)).current;return Ma({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function La({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function Ra(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function za(e,t){let n=S.useRef(null);return J(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ra(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ra(t))})}function Ba(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Va(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ha(e,t,n,r={}){let i=n.reason,a=i===Kr,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Va(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Ba(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?ot.flushSync(l):l()}function Ua(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=za(e,n),o=J(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=J(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Wa(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=S.useRef(null),i=e.useState(`open`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);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&&!e.state.openedWithoutTrigger&&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=$(Wr);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 Ga(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Na({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return w(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Ka(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:I,inactiveTriggerProps:I,popupProps:I})},[e])}function qa(e,t){Y(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Y(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ja=class{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}},Ya=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,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!i(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})),Xa=t(((e,t)=>{t.exports=Ya()})),Za=t((e=>{var t=n(),r=Xa();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.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}})),Qa=t(((e,t)=>{t.exports=Za()})),$a=Xa(),eo=Qa(),to=[],no=void 0;function ro(){return no}function io(e){to.push(e)}function ao(e){let t=(t,n)=>{let r=w(so).current,i;try{no=r;for(let e of to)e.before(r);i=e(t,n);for(let e of to)e.after(r);r.didInitialize=!0}finally{no=void 0}return i};return t.displayName=e.displayName||e.name,t}function oo(e){return S.forwardRef(ao(e))}function so(){return{didInitialize:!1}}var co=M(19)?fo:po;function lo(e,t,n,r,i){return co(e,t,n,r,i)}function uo(e,t,n,r,i){let a=S.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,$a.useSyncExternalStore)(e.subscribe,a,a)}io({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,$a.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function fo(e,t,n,r,i){let a=ro();if(!a)return uo(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 po(e,t,n,r,i){return(0,eo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var mo=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;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 lo(this,e,t,n,r)}},ho=class extends mo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){S.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Y(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){S.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{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 S.useDebugValue(e),lo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){S.useDebugValue(e);let n=J(t??P);this.context[e]=n}useStateSetter(e){let t=S.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)}})}},go={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},_o=class extends ho{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:sa(),nested:n,triggerElements:i},go),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&gn(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};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)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function vo(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new _o({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:I,inactiveTriggerProps:I,popupProps:I}}var yo=e=>e.triggerIdProp??e.activeTriggerId,bo=e=>e.openProp??e.open,xo=e=>(e.popupElement?.id??e.floatingId)||void 0;function So(e,t){return t!==void 0&&bo(e)&&yo(e)===t}function Co(e,t){return So(e,t)?!0:t!==void 0&&bo(e)&&yo(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var wo={open:bo,mounted:e=>e.mounted,transitionStatus:e=>bo(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:yo,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:xo,isTriggerActive:(e,t)=>t!==void 0&&yo(e)===t,isOpenedByTrigger:(e,t)=>So(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&yo(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Co(e,t)?xo(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function To(e){return(0,$a.useSyncExternalStore)(S.useCallback(t=>e===void 0?P:e.subscribeStore(t),[e]),S.useCallback(()=>e===void 0?void 0:e.store,[e]),()=>e?.serverStore)}function Eo(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=nt(),a=da()!=null,o=w(()=>new _o({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ja,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=ae(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Do=yt&&xt;function Oo(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=S.useRef(!1),s=S.useRef(null),c=S.useRef(!0),l=Er();S.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=K(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&oe(t)&&t===Tt(Fe(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return ji(Ai(r,`blur`,i),Do&&Ai(r,`keydown`,a,!0),Do&&Ai(r,`pointerdown`,l,!0))},[e,n]),S.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);ae(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=S.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=Dt(n.nativeEvent);if(ae(a)){if(Do&&!n.relatedTarget){if(!c.current&&!rn(a))return}else if(!sn(a))return}let u=en(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;if(e.select(`open`)&&u||!r){e.setOpen(!0,$(qr,d,f));return}l.start(r,()=>{o.current||e.setOpen(!0,$(qr,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=ae(r)&&r.hasAttribute(Ri(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Tt(Fe(t));!r&&n===t||Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||en(r??n,e.context.triggerElements)||e.setOpen(!1,$(qr,i))})}}},[a,r,e,l]);return S.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var ko=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Tr;restTimeout=new Tr;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ao=new WeakMap;function jo(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ao.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ao.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Mo(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ao.get(n);a&&a!==e&&jo(a),jo(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ao.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function No(e){let t=e.context.dataRef.current,n=w(()=>t.hoverInteractionState??ko.create()).current;return t.hoverInteractionState||=n,Cr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Po(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=fa(),u=da(),d=No(e),f=Er(),p=J(()=>wi(c.current.openEvent?.type,d.interactedInside)),m=J(()=>Ti(c.current.openEvent?.type)),h=J(()=>{jo(d)});Y(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),S.useEffect(()=>h,[h]),Y(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&ae(s)&&o){let e=s,t=o,n=Fe(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r;return Mo(d,{scopeElement:d.handleCloseOptions?.getScope?.()??i??a??Et(e,`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),S.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ln(l.nodesRef.current,u).length>0)}function a(t){let n=Si(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,$(Kr,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Dt(e);if(!an(t)){d.interactedInside=!1;return}d.interactedInside=Et(t,`[aria-haspopup]`)!=null}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(en(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;if(!(l&&r&&ae(o)&&ln(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o)))){if(d.handler){d.handler(n);return}h(),m()&&!p()&&a(n)}}function v(n){!l||!u||t()||f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,$(Kr,n)),l.events.emit(`floating.closed`,n)})}let y=o;return ji(y&&Ai(y,`mouseenter`,g),y&&Ai(y,`mouseleave`,_),y&&Ai(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Fo={current:null};function Io(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Fo,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=fa(l),v=No(e),y=S.useRef(!1),b=Mi(i),x=Mi(r),C=Mi(o),w=Mi(n),T=Mi(p),E=Mi(f),D=J(()=>wi(h.current.openEvent?.type,v.interactedInside)),O=J(()=>T.current?.()!==!1),k=J((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!ae(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),A=J(()=>{v.handler&&=(Fe(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=J(()=>{jo(v)});return u&&(v.handleCloseOptions=i?.__options),S.useEffect(()=>A,[A]),S.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===Kr,A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,A]),S.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Si(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,$(Kr,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,$(Kr,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!ae(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!hn(v.pointerType))return;let n=Ci(C.current),r=Si(x.current,`open`,v.pointerType),i=Dt(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(ae(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}ae(o)&&ae(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c==null?!1:k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&ae(c)&&ae(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){O()&&e.setOpen(!0,$(Kr,t,c));return}m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,$(Kr,t,c))}):g&&O()&&e.setOpen(!0,$(Kr,t,c)))}function o(n){if(D()){j();return}A();let r=Fe(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!en(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n);return}(v.pointerType!==`touch`||!Q(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Ai(r,`mouseout`,l):void 0;return s?ji(Ai(r,`mousemove`,i,{once:!0}),Ai(r,`mouseenter`,i),Ai(r,`mouseleave`,o),f):ji(Ai(r,`mouseenter`,i),Ai(r,`mouseleave`,o),f)},[A,j,h,x,e,n,b,v,u,k,D,a,s,C,c,_,w,d,E,O,m]),S.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!hn(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);t&&Mo(v,{scopeElement:v.handleCloseOptions?.getScope?.()??r.ownerDocument.body,referenceElement:r,floatingElement:t})}let c=Ci(C.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,D())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,$(Kr,n,r))}v.pointerType===`touch`?ot.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,C,O])}function Lo(e){return xt&&e.movementX===0&&e.movementY===0}function Ro(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function zo(e,t){return Ro(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Bo(e,t,n){return Ro(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Vo(e,t,n){return Ro(t,n?e===At:e===jt,e===Nt)}function Ho(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ro(t,n?e===jt:e===At,e===Mt)}function Uo(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=cn(D),j=on(O),M=Mi(A),N=da(),P=fa(x),F=S.useRef(f),I=S.useRef(o??-1),L=S.useRef(null),ee=S.useRef(!0),R=J(e=>{i(I.current===-1?null:I.current,e)}),z=S.useRef(!!D),B=S.useRef(E),V=S.useRef(!1),H=S.useRef(!1),U=S.useRef(null),W=Mi(h),te=Mi(E),G=Mi(o),ne=Mi(b),re=Mr(),K=Mr(),q=J(()=>{re.cancel();function e(e){d||(U.current=Bi(e,{sync:V.current,preventScroll:!0}))}let t=n.current[I.current],r=H.current;t&&e(t),(V.current?e=>e():e=>re.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),ue&&(r||!ee.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{k.current.orientation=g},[k,g]),Y(()=>{E||(L.current=null),(!E||f!==`auto`)&&(F.current=f)},[E,f]),Y(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(H.current=!0,R())):z.current&&(I.current=-1,R()))},[a,E,D,o,R]),Y(()=>{if(a){if(!E){V.current=!1;return}if(D)if(r==null){if(V.current=!1,G.current!=null)return;if(z.current&&(I.current=-1,q()),(!B.current||!z.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>K.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||Bo(L.current,_,u)||l?Kn(n):qn(n),L.current=null,R())};t()}}else Gn(n.current,r)||(I.current=r,q(),H.current=!1)}},[a,E,D,r,G,l,n,_,u,R,q,K]),Y(()=>{if(!a||D||!P||d||!z.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=Tt(Fe(O??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&ee.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,d]),Y(()=>{B.current=E,z.current=!!D});let ie=r!=null,ae=J(e=>{if(!te.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,R(e))}),se=J(()=>v??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),ce=J(()=>Kn(n,W.current)),le=J(t=>{if(ee.current=!1,V.current=!0,t.which===229||!te.current&&t.currentTarget===M.current)return;if(l&&Ho(t.key,g,u,T)){zo(t.key,se())||dn(t),e.setOpen(!1,$(ri,t.nativeEvent));let n=C?.current??O;oe(n)&&n.focus();return}r!=null&&r!==I.current&&!Gn(n.current,r)&&(I.current=r);let i=I.current,a=Kn(n,h),o=qn(n,h);if(j||(t.key===`Home`&&(dn(t),I.current=a,R(t)),t.key===`End`&&(dn(t),I.current=o,R(t))),w!=null){let e=w(t,I.current,n,g,c,u,h,a,o);if(e!=null&&e!==I.current&&(I.current=e,R(t)),g===`both`)return}if(zo(t.key,g)){dn(t);let e=Tt(t.currentTarget.ownerDocument);if(E&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){I.current=Bo(t.key,g,u)?a:o,R(t),r===I.current&&q();return}let{index:l,wrapped:f}=Jn(n.current,i,{decrement:!Bo(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(V.current=!1),I.current=l,R(t)}}),ue=S.useMemo(()=>({onFocus(e){V.current=!0,ae(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Lo(e)||(V.current=!0,H.current=!1,p&&ae(e))},onPointerLeave(e){if(!te.current||!ee.current||e.pointerType===`touch`)return;V.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&ne.current&&(U.current?.(),U.current=null,I.current=-1,R(e),!d)){let e=M.current,t=Tt(Fe(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[ae,te,M,p,n,R,ne,d]),de=S.useMemo(()=>d&&E&&ie&&{"aria-activedescendant":`${y}-${r}`},[d,E,ie,y,r]),fe=S.useMemo(()=>({...j?{}:de,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!d){let n=Dt(t.nativeEvent);if(n&&!Q(M.current,n))return;dn(t);let r=$(ti,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&oe(i)&&i.focus();return}le(t)},onPointerMove(e){Lo(e)||(ee.current=!0)}}),[de,le,M,j,e,E,d,O,C]),pe=S.useMemo(()=>{function t(t){e.setOpen(!0,$(ri,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&pn(e.nativeEvent)&&(F.current=!d)}function r(e){F.current=f,f===`auto`&&mn(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);ee.current=!1;let i=n.key.startsWith(`Arrow`),a=Vo(n.key,se(),u),o=zo(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||rn(n.currentTarget)))return le(n);if(!(!r&&!m&&i)){if(s){let e=zo(n.key,se());L.current=l&&e?null:n.key}if(l){a&&(dn(n),r?(I.current=ce(),R(n),d&&M.current?.focus()):t(n));return}o&&(G.current!=null&&(I.current=G.current),dn(n),!r&&m?t(n):le(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(I.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[le,f,ce,l,R,e,m,g,_,se,u,G,d,M]),me=S.useMemo(()=>({...de,...pe}),[de,pe]);return S.useMemo(()=>a?{reference:me,floating:fe,item:ue,trigger:pe}:{},[a,me,fe,pe,ue])}function Wo(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=J(s),f=e.useState(`open`),p=Er(),m=S.useRef(``),h=S.useRef(u??i??-1),g=S.useRef(null),_=J(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!$n(n)||n?.matches(`:disabled`)?!1:o==null||!Zn(F,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!s(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(dn(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(dn(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=J(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Y(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=S.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return S.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Go=.1,Ko=Go*Go,qo=.5;function Jo(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Yo(e,t,n,r,i,a,o,s,c,l){let u=!1;return Jo(e,t,n,r,i,a)&&(u=!u),Jo(e,t,i,a,o,s)&&(u=!u),Jo(e,t,o,s,c,l)&&(u=!u),Jo(e,t,c,l,n,r)&&(u=!u),u}function Xo(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Zo(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 Qo(e={}){let{blockPointerEvents:t=!1}=e,n=new Tr,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=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*Ko;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=Dt(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&ae(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&ln(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=Zo(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Zo(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Zo(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Zo(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!Xo(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?qo/2:qo*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+qo+1,o=C||T?S.bottom-qo:S.top,s=C?T?S.bottom-qo:S.top:S.bottom-qo;M=Yo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?qo/2:qo*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-qo,o=C||T?S.top+qo:S.bottom,s=C?T?S.top+qo:S.bottom:S.top+qo;M=Yo(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?qo/2:qo*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+qo+1,o=w||E?S.right-qo:S.left,s=w?E?S.right-qo:S.left:S.right-qo;M=Yo(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?qo/2:qo*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-qo,o=w||E?S.left+qo:S.right,s=w?E?S.left+qo:S.right:S.left+qo;M=Yo(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function $o(e,t,n){let{reference:r,floating:i}=e,a=kn(t),o=An(t),s=On(o),c=Tn(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=En(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function es(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}=wn(t,e),p=Hn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Un(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=Un(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 ts=50,ns=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:es},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$o(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<ts&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=$o(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},rs=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=wn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Tn(r),_=kn(o),v=Tn(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Bn(o)]:Mn(o)),x=p!==`none`;!d&&x&&b.push(...zn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=jn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==kn(t))||T.every(e=>kn(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=kn(e.placement);return t===_||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]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},is=new Set([`left`,`top`]);async function as(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Tn(n),s=En(n),c=kn(n)===`y`,l=is.has(o)?-1:1,u=a&&c?-1:1,d=wn(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 os=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await as(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ss=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}=wn(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=kn(i),p=Dn(f),m=u[p],h=u[f],g=(e,t)=>Cn(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}}}}}},cs=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}=wn(e,t),u={x:n,y:r},d=kn(i),f=Dn(d),p=u[f],m=u[d],h=wn(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){let e=f===`y`?`width`:`height`,t=is.has(Tn(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ls=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}=wn(e,t),c=await i.detectOverflow(t,s),l=Tn(n),u=En(n),d=kn(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=_n(p-c[m],g),y=_n(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*vn(c.left,c.right):S=p-2*vn(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 us(e){let t=ye(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=oe(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=yn(n)!==a||yn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ds(e){return ae(e)?e:e.contextElement}function fs(e){let t=ds(e);if(!oe(t))return xn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=us(t),o=(a?yn(n.width):n.width)/r,s=(a?yn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ps=xn(0);function ms(e){let t=K(e);return!_e()||!t.visualViewport?ps:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===K(e)}function gs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ds(e),o=xn(1);t&&(r?ae(r)&&(o=fs(r)):o=fs(e));let s=hs(a,n,r)?ms(a):xn(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=K(a),t=ae(r)?K(r):r,n=e,i=we(n);for(;i&&t!==n;){let e=fs(i),t=i.getBoundingClientRect(),r=ye(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=K(i),i=we(n)}}return Un({width:u,height:d,x:c,y:l})}function _s(e,t){let n=be(e).scrollLeft;return t?t.left+n:gs(q(e)).left+n}function vs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-_s(e,n),y:n.top+t.scrollTop}}function ys(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?ue(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=xn(1),u=xn(0),d=oe(r);if((d||!a)&&((re(r)!==`body`||ce(o))&&(c=be(r)),d)){let e=gs(r);l=fs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?vs(o,c):xn(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 bs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function xs(e){let t=be(e),n=e.ownerDocument.body,r=vn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=vn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+_s(e),o=-t.scrollTop;return ye(n).direction===`rtl`&&(a+=vn(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ss=25;function Cs(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=K(e),a=q(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!_e()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(_s(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<=Ss&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ws(e,t){let n=gs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=fs(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ts(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Cs(e,n,t);else if(t===`document`)r=xs(q(e));else if(ae(t))r=ws(t,n);else{let n=ms(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Un(r)}function Es(e,t){let n=t.get(e);if(n)return n;let r=Ce(e,[],!1).filter(e=>ae(e)&&re(e)!==`body`),i=null,a=ye(e).position===`fixed`,o=a?xe(e):e;for(;ae(o)&&!ve(o);){let e=ye(o),t=he(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=xe(o)}return t.set(e,r),r}function Ds(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ue(t)?[]:Es(t,this._c):[].concat(n),r],o=Ts(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=Ts(t,a[e],i);s=vn(n.top,s),c=_n(n.right,c),l=_n(n.bottom,l),u=vn(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Os(e){let{width:t,height:n}=us(e);return{width:t,height:n}}function ks(e,t,n){let r=oe(t),i=q(t),a=n===`fixed`,o=gs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=xn(0);if((r||!a)&&((re(t)!==`body`||ce(i))&&(s=be(t)),r)){let e=gs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=_s(i));let l=i&&!r&&!a?vs(i,s):xn(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 As(e){return ye(e).position===`static`}function js(e,t){if(!oe(e)||ye(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function Ms(e,t){let n=K(e);if(ue(e))return n;if(!oe(e)){let t=xe(e);for(;t&&!ve(t);){if(ae(t)&&!As(t))return t;t=xe(t)}return n}let r=js(e,t);for(;r&&le(r)&&As(r);)r=js(r,t);return r&&ve(r)&&As(r)&&!he(r)?n:r||ge(e)||n}var Ns=async function(e){let t=this.getOffsetParent||Ms,n=this.getDimensions,r=await n(e.floating);return{reference:ks(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ps(e){return ye(e).direction===`rtl`}var Fs={convertOffsetParentRelativeRectToViewportRelativeRect:ys,getDocumentElement:q,getClippingRect:Ds,getOffsetParent:Ms,getElementRects:Ns,getClientRects:bs,getDimensions:Os,getScale:fs,isElement:ae,isRTL:Ps};function Is(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ls(e,t,n){let r=null,i,a=q(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=bn(d),h=bn(a.clientWidth-(u+f)),g=bn(a.clientHeight-(d+p)),_=bn(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:vn(0,_n(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Is(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=K(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Rs(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=ds(e),u=i||a?[...l?Ce(l):[],...t?Ce(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ls(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?gs(e):null;c&&g();function g(){let t=gs(e);h&&!Is(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?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var zs=os,Bs=ss,Vs=rs,Hs=ls,Us=cs,Ws=(e,t,n)=>{let r=new Map,i=n??{},a={...Fs,...i.platform,_c:r};return ns(e,t,{...i,platform:a})},Gs=typeof document<`u`?S.useLayoutEffect:function(){};function Ks(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(!Ks(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)&&!Ks(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function qs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Js(e,t){let n=qs(e);return Math.round(t*n)/n}function Ys(e){let t=S.useRef(e);return Gs(()=>{t.current=e}),t}function Xs(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:c,open:l}=e,[u,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);Ks(f,r)||p(r);let[m,h]=S.useState(null),[g,_]=S.useState(null),v=S.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=S.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),b=a||m,x=o||g,C=S.useRef(null),w=S.useRef(null),T=S.useRef(u),E=c!=null,D=Ys(c),O=Ys(i),k=Ys(l),A=S.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Ws(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Ks(T.current,t)&&(T.current=t,ot.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Gs(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=S.useRef(!1);Gs(()=>(j.current=!0,()=>{j.current=!1}),[]),Gs(()=>{if(b&&(C.current=b),x&&(w.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,E]);let M=S.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=S.useMemo(()=>({reference:b,floating:x}),[b,x]),P=S.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Js(N.floating,u.x),r=Js(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...qs(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var Zs=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},$s=(e,t)=>({fn:Us(e).fn,options:[e,t]}),ec=(e,t)=>{let n=Vs(e);return{name:n.name,fn:n.fn,options:[e,t]}},tc=(e,t)=>{let n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},nc=S.createContext(void 0);function rc(){let e=S.useContext(nc);if(e===void 0)throw Error(je(26));return e}var ic=`ArrowUp`,ac=`ArrowDown`,oc=`ArrowLeft`,sc=`ArrowRight`,cc=new Set([ic,ac,oc,sc,`Home`,`End`]),lc=[`Shift`,`Control`,`Alt`,`Meta`];function uc(e){return oe(e)&&e.tagName===`INPUT`}function dc(e){return!!(uc(e)&&e.selectionStart!=null||oe(e)&&e.tagName===`TEXTAREA`)}function fc(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=pc(e,t,`left`),a=mc(e),o=mc(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=pc(e,t,`top`),r=mc(e),i=mc(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function pc(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function mc(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var hc=`--nested-dialogs`,gc=`data-nested-dialog-open`,_c={...Zt,...Rt,nestedDialogOpen(e){return e?{[gc]:``}:null}},vc=S.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=_i(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);rc(),Rr({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Fa(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=z(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Pa,hidden:!m,onKeyDown(e){cc.has(e.key)&&e.stopPropagation()},style:{[hc]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:_c});return(0,X.jsx)(wa,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function yc(e){return M(19)?e:e?`true`:void 0}var bc=S.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,X.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),xc=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=_i(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,X.jsx)(nc.Provider,{value:n,children:(0,X.jsxs)(oa,{ref:t,...r,children:[a&&o===!0&&(0,X.jsx)(bc,{ref:i.context.internalBackdropRef,inert:yc(!s)}),e.children]})}):null}),Sc={},Cc={},wc=``;function Tc(e,t){return ce(e)?e:t}function Ec(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Tc(t,n)).overflowY)}function Dc(e){if(typeof document>`u`)return!1;let t=Fe(e);return K(t).innerWidth-t.documentElement.clientWidth>0}function Oc(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Fe(e),n=t.documentElement,r=t.body,i=Tc(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function kc(e){let t=Fe(e),n=t.documentElement,r=t.body,i=Tc(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Ac(e){let t=Fe(e),n=t.documentElement,r=t.body,i=K(n),a=0,o=0,s=!1,c=jr.create();if(xt&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Sc={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},wc=n.style.scrollBehavior,Cc={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Tc(n,r);if(s=Oc(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,Sc),Object.assign(r.style,Cc),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=wc)}function d(){u(),c.request(l)}l();let f=Ai(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var jc=new class{lockCount=0;restore=null;timeoutLock=Tr.create();timeoutUnlock=Tr.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Fe(e),n=t.documentElement,r=t.body,i=K(n);if(Ec(i,n,r)){let t=new i.MutationObserver(()=>{Ec(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}this.restore=Z||!Dc(e)?kc(e):Ac(e)}};function Mc(e=!0,t=null){Y(()=>{if(e)return jc.acquire(t)},[e,t])}function Nc({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=S.useState(0),[d,f]=S.useState(0),p=l===0,m=ja(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Dt(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||Q(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return Mc(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{!e.select(`open`)&&!e.select(`mounted`)||(u(t),f(n))}),Y(()=>{!r&&!i&&(u(0),f(0))},[r,i]),Y(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),Ka(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var Pc={...wo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Fc=class extends ho{constructor(e,t,n){let r=new Ja,i=Ic(e,r,t,n);super(i,Lc(r),Pc)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(Ba(this.state,e,t.trigger)))}};function Ic(e,t,n,r=!1){return{...vo(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Lc(e){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Rc(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=_i(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=Ia((e,t)=>new Fc({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`payload`);qa(b,x),Wa(b);let{forceUnmount:T}=Ga(x,b);S.useImperativeHandle(l,()=>({unmount:T,close:()=>b.setOpen(!1,$(di))}),[T,b]);let E=x||C||u!=null;return(0,X.jsxs)(gi.Provider,{value:b,children:[u&&(0,X.jsx)(La,{handle:u,store:b}),E&&(0,X.jsx)(Nc,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:w}):n]})}var zc=ao(function(e){return Rc(`dialog`,e)}),Bc=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=_i(),c=rt(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),z(`h2`,e,{ref:t,props:[{id:c},o]})});function Vc(e){let t=S.useRef(``),n=S.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:S.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Hc(e,t){let{onClick:n,onPointerDown:r}=Vc(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(Z?`touch`:``))}));return S.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Uc(e){let[t,n]=S.useState(null),r=Hc(e,n);return Hr(e,t=>{t&&!e&&n(null)}),S.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Wc=S.createContext(void 0);function Gc(e){let t=S.useContext(Wc);if(t===void 0&&!e)throw Error(je(72));return t}var Kc={...wo,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},qc=class extends ho{constructor(e,t,n){let r=new Ja;super(Jc(e,r,t,n),Yc(r),Kc)}setOpen=(e,t)=>{Ha(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,$(Gr,e))}};function Jc(e,t,n,r=!1){return{...vo(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Yc(e){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Xc=ao(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Ia((e,t)=>new qc({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Wa(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Ga(h,p),x=p.useState(`isInstantPhase`),C=p.useState(`instantType`),w=p.useState(`lastOpenChangeReason`),T=S.useRef(null);Y(()=>{m&&t&&p.setOpen(!1,$(ci))},[m,t,p]),Y(()=>{b===`ending`&&w===`none`||b!==`ending`&&x?(C!==`delay`&&(T.current=C),p.set(`instantType`,`delay`)):T.current!==null&&(p.set(`instantType`,T.current),T.current=null)},[b,x,w,C,p]),Y(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),S.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,$(di))}),[y,p]);let E=h||_||!t&&a!==`none`;return(0,X.jsxs)(Wc.Provider,{value:p,children:[l&&(0,X.jsx)(La,{handle:l,store:p}),E&&(0,X.jsx)(Zc,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function Zc({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=ja(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=Oa(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=S.useMemo(()=>l(a.reference,i.reference),[a.reference,i.reference]);return Ka(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??I}),null}var Qc=S.createContext(void 0);function $c(){return S.useContext(Qc)}var el=`data-base-ui-tooltip-trigger`;function tl(e){let t=Dt(e);return ae(t)?t:null}var nl=oo(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=Gc(!0),m=To(a)??p;if(!m)throw Error(je(82));let h=rt(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=S.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:C}=Ua(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),w=$c(),{activeIdRef:T,delayRef:E,isInstantPhase:D,hasProvider:O}=ki(v,{open:_}),k=No(v);m.useSyncedValue(`isInstantPhase`,D);let A=m.useState(`disabled`),j=s??A,M=Mi(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=S.useRef(!1),I=Er(),L=S.useRef(void 0);function ee(){return O&&T.current!=null?0:c??w??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=Et(e,`[${el}]`);return n!==null&&n!==t&&Q(t,n)}function B(e){let t=R(e);return F.current=t,t&&(k.openChangeTimeout.clear(),k.restTimeout.clear(),k.restTimeoutPending=!1,I.clear()),t}let V=Io(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?Qo():null,restMs:ee,delay(){return u==null&&O?{close:Si(E.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),H=Oo(v,{enabled:!j}).reference,U=e=>{let t=F.current,n=tl(e),r=B(n),i=y.current,a=i&&n&&Q(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`){m.setOpen(!1,$(Kr,e));return}if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&hn(L.current)){let t=()=>{!F.current&&!M.current&&!m.select(`open`)&&m.setOpen(!0,$(Kr,e,i))},n=ee();n===0?(I.clear(),t()):I.start(n,t)}},W=m.useState(`appliedTriggerProps`,C||N!==`none`);return z(`button`,e,{state:{open:_},ref:[t,x,y],props:[V,H,W,{onMouseOver(e){U(e.nativeEvent)},onFocus(e){R(tl(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),L.current=void 0},onPointerEnter(e){L.current=e.pointerType},onPointerDown(e){L.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[$t]:j?``:void 0,[el]:j?void 0:``},f],stateAttributesMapping:Yt})}),rl=S.createContext(void 0);function il(){let e=S.useContext(rl);if(e===void 0)throw Error(je(70));return e}var al=S.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=aa({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,X.jsxs)(S.Fragment,{children:[l,c&&ot.createPortal(n,c)]})}),ol=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Gc().useState(`mounted`)||n?(0,X.jsx)(rl.Provider,{value:n,children:(0,X.jsx)(al,{ref:t,...r})}):null}),sl=S.createContext(void 0);function cl(){let e=S.useContext(sl);if(e===void 0)throw Error(je(71));return e}function ll(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=S.useState(null),d=S.useRef(null),f=fa(n),p=S.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Xs({...e,elements:{...p,...l&&{reference:l}}}),h=S.useCallback(e=>{let t=ae(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=S.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=S.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=S.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Y(()=>{o&&(d.current=o)},[o]),Y(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),S.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var ul=S.createContext(void 0);function dl(){return S.useContext(ul)?.direction??`ltr`}var fl=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=wn(e,t)||{};if(l==null)return{};let d=Hn(u),f={x:n,y:r},p=An(i),m=On(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=Cn(D,k,O),j=!c.arrow&&En(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),pl=(e,t)=>{let{name:n,fn:r}=fl(e);return{name:n,fn:r,options:[e,t]}},ml={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}}}},hl={sideX:`left`,sideY:`top`},gl=`--available-width`,_l=`--available-height`,vl=`--anchor-width`,yl=`--anchor-height`,bl=`--transform-origin`,xl=gl,Sl=_l;function Cl(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 wl(e,t,n){let{rects:r,placement:i}=e;return{side:Cl(t,Tn(i),n),align:En(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Tl(e){return El(e,ll)}function El(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:C}=e,w=_.side||`flip`,T=_.align||`flip`,E=_.fallbackAxisSide||`end`,D=v?.crossAxis??!1,O=v?.rootBoundary,k=typeof n==`function`?n:void 0,A=J(k),j=k?A:n,M=Mi(n),N=Mi(g),P=dl()===`rtl`,[F,I]=S.useState(null);!g&&F!==null&&I(null);let L=x===`placement`,ee=F?Tn(F):null,R=F&&L?En(F)||`center`:null,z=ee||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":P?`left`:`right`,"inline-start":P?`right`:`left`}[i],B=R||o,V=B===`center`?z:`${z}-${B}`,H=l;typeof H==`number`?H={top:H,right:H,bottom:H,left:H}:H&&={top:H.top||0,right:H.right||0,bottom:H.bottom||0,left:H.left||0};let U=+(i===`bottom`),W=+(i===`top`),te=+(i===`right`),G=+(i===`left`),ne={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:H},re=S.useRef(null),q=Mi(a),ie=Mi(s),ae=typeof a==`function`?0:a,oe=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(Zs(e=>{let t=wl(e,i,P),n=typeof q.current==`function`?q.current(t):q.current,r=typeof ie.current==`function`?ie.current(t):ie.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ae,oe,P,i]));let ce=T===`none`&&w!==`shift`,le=!ce&&(u||D||w===`shift`),ue=w===`none`?null:ec({...ne,padding:{top:H.top+1+U,right:H.right+1+G,bottom:H.bottom+1+W,left:H.left+1+te},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`?`alignment`:!1,fallbackAxisSideDirection:E}),de=ce?null:Qs({...ne,rootBoundary:O,mainAxis:T!==`none`,crossAxis:le,limiter:u||D?void 0:$s(e=>{if(!re.current)return{};let{width:t,height:n}=re.current.getBoundingClientRect(),r=kn(Tn(e.placement)),i=r===`y`?t:n,a=r===`y`?H.left+H.right:H.top+H.bottom;return{offset:i/2+a/2}})},[ne,u,D,O,H,T]);w===`shift`||T===`shift`||B===`center`?se.push(de,ue):se.push(ue,de),se.push(tc({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!N.current)return;let i=e.style;i.setProperty(xl,`${t}px`),i.setProperty(Sl,`${n}px`);let a=K(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(vl,`${u}px`),i.setProperty(yl,`${d}px`)}}),pl(e=>({element:re.current||Fe(e.elements.floating).createElement(`div`),padding:re.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Tn(r),u=En(r),d=kn(l)===`y`,f=re.current,p=typeof a==`function`?a(wl(e,i,P)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return le&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(bl,d?`${m} ${h}`:`${h} ${m}`),{}}},ml,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=S.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:_e,update:ve,placement:ye,context:be,isPositioned:xe,floatingStyles:Se}=t({rootContext:h,open:m?g:void 0,placement:V,middleware:se,strategy:r,whileElementsMounted:m?void 0:(...e)=>Rs(...e,fe),nodeId:y,externalTree:C}),{sideX:Ce,sideY:we}=_e.adaptiveOrigin||hl,Te=xe?r:`fixed`,Ee=S.useMemo(()=>{let e;return e=xe?b?{position:Te,[Ce]:he,[we]:ge}:{...Se,position:Te}:{position:Te,top:0,left:0},e[xl]=`100vw`,e[Sl]=`100vh`,xe||(e.opacity=0),e},[b,Te,Ce,he,we,ge,Se,xe]),De=S.useRef(null);Y(()=>{if(!g)return;let e=M.current,t=typeof e==`function`?e():e,n=(Dl(t)?t.current:t)||null;n!==De.current&&(pe.setPositionReference(n),De.current=n)},[g,pe,j,M]),S.useEffect(()=>{if(!g)return;let e=M.current;typeof e!=`function`&&Dl(e)&&e.current!==De.current&&(pe.setPositionReference(e.current),De.current=e.current)},[g,pe,j,M]),S.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return Rs(me.reference,me.floating,ve,fe)},[m,g,me,ve,fe]);let Oe=Tn(ye),ke=Cl(i,Oe,P),Ae=En(ye)||`center`,je=!!_e.hide?.referenceHidden;Y(()=>{x&&g&&xe&&(Oe!==z||L&&Ae!==B)&&I(ye)},[x,L,g,xe,ye,Oe,Ae,z,B]);let Me=S.useMemo(()=>({position:`absolute`,top:_e.arrow?.y,left:_e.arrow?.x}),[_e.arrow]),Ne=_e.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:Ee,arrowStyles:Me,arrowRef:re,arrowUncentered:Ne,side:ke,align:Ae,physicalSide:Oe,anchorHidden:je,refs:pe,context:be,isPositioned:xe,update:ve}),[Ee,Me,re,Ne,ke,Ae,Oe,je,pe,be,xe,ve])}function Dl(e){return e!=null&&`current`in e}function Ol(e){return e===`starting`?Qi:I}function kl(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),z(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Ol(r),i],stateAttributesMapping:Zt})}var Al=S.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=ea,style:g,..._}=e,v=Gc(),y=il(),b=v.useState(`open`),x=v.useState(`mounted`),C=v.useState(`trackCursorAxis`),w=v.useState(`disableHoverablePopup`),T=v.useState(`floatingRootContext`),E=v.useState(`instantType`),D=v.useState(`transitionStatus`),O=Tl({anchor:i,positionMethod:a,floatingRootContext:T,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),k=kl(e,S.useMemo(()=>({open:b,side:O.side,align:O.align,anchorHidden:O.anchorHidden,instant:C===`none`?E:`tracking-cursor`}),[b,O.side,O.align,O.anchorHidden,C,E]),{styles:O.positionerStyles,transitionStatus:D,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||C===`both`||w});return(0,X.jsx)(sl.Provider,{value:O,children:k})}),jl=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Gc(),{side:s,align:c}=cl(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Rr({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),Po(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return z(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[Pa,f,Ol(d),a],stateAttributesMapping:Qt})}),Ml=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Gc(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=cl();return z(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:Zt})}),Nl=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=S.useMemo(()=>({open:t,close:n}),[t,n]);return(0,X.jsx)(Qc.Provider,{value:t,children:(0,X.jsx)(Oi,{delay:i,timeoutMs:r,children:e.children})})};function Pl(e){let[t,n]=S.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var Fl=S.createContext(void 0);function Il(){let e=S.useContext(Fl);if(e===void 0)throw Error(je(13));return e}var Ll={imageLoadingStatus:()=>null},Rl=S.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=S.useState(`idle`),c={imageLoadingStatus:o},l=S.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=z(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:Ll});return(0,X.jsx)(Fl.Provider,{value:l,children:u})}),zl=S.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=Il(),[c,l]=S.useState(i===0),u=Er();return S.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),z(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:Ll,enabled:s!==`loaded`&&(i===0||c)})}),Bl=S.createContext(void 0);function Vl(e){let t=S.useContext(Bl);if(t===void 0&&!e)throw Error(je(33));return t}var Hl=S.createContext(void 0);function Ul(e){let t=S.useContext(Hl);if(t===void 0&&!e)throw Error(je(36));return t}var Wl=S.createContext(void 0);function Gl(e=!0){let t=S.useContext(Wl);if(t===void 0&&!e)throw Error(je(25));return t}function Kl({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=S.useRef(e!==void 0),[a,o]=S.useState(()=>t);return[i&&e!==void 0?e:a,S.useCallback(e=>{i||o(e)},[])]}var ql=S.createContext(null);function Jl(e=`root`){let t=S.useContext(ql),n=S.useContext(Hl);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Yl={visible:!0,ref:null};function Xl(){return Yl}function Zl(e,t,n=`root`){let r=Jl(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Xl)({label:e.label,children:e.children,render:e.render}),a=T(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Ql(e){e.preventDefault()}function $l(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Ul(),u=Gl(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return S.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Ql:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Yr})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!yt&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Ie(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var eu={type:`regular-item`};function tu(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:u}=e,d=S.useRef(null),{getButtonProps:f,buttonRef:p}=Le({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),m=$l({closeOnClick:t,highlighted:r,id:i,nodeId:u,store:a,typingRef:o,itemRef:d,itemMetadata:c}),h=S.useCallback(e=>l(m,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,f),[m,f,c]),g=T(d,p);return S.useMemo(()=>({getItemProps:h,itemRef:g}),[h,g])}var nu=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ru(){return S.useContext(nu)}function iu(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=ru(),u=S.useRef(-1),[d,f]=S.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=S.useRef(null),h=S.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var au=S.createContext(void 0);function ou(){let e=S.useContext(au);if(e===void 0)throw Error(je(31));return e}var su=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=S.useState(void 0),c=z(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,X.jsx)(au.Provider,{value:s,children:c})}),cu=S.forwardRef(function(e,t){return(0,X.jsx)(Jl()?.Group??su,{...e,ref:t})}),lu=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=rt(a),c=ou();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),z(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),uu=S.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=Ul(),f=iu({guess:!0,label:a}),p=rt(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=tu({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:eu});return z(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),du=S.forwardRef(function(e,t){let n=Zl(e,t);return n.visible?(0,X.jsx)(uu,{...e,ref:n.ref}):null}),fu=S.createContext(void 0);function pu(e){let t=S.useContext(fu);if(t===void 0&&!e)throw Error(je(69));return t}var mu=S.createContext(void 0);function hu(){return S.useContext(mu)}function gu(e,t){let n=U(e.render);if(S.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function _u(e,t,n){let r=gu(e,t),i=r===t?void 0:r;return[r,S.useCallback(e=>n?.(e?i:void 0),[i,n])]}function vu(e,t,n){let r=U(e.render),i=S.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var yu=S.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=Ul(),m=hu(),{side:h,align:g}=Vl(),_=pu(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),C=l.useState(`instantType`),w=l.useState(`activeTriggerElement`),T=l.useState(`parent`),E=l.useState(`lastOpenChangeReason`),D=l.useState(`rootId`),O=l.useState(`floatingRootContext`),k=l.useState(`floatingTreeRoot`),A=l.useState(`closeDelay`),j=l.useState(`hoverEnabled`),M=l.useState(`disabled`),N=l.useState(`openMethod`),P=l.useState(`activeTriggerId`),F=l.useState(`listElement`),[I,L]=_u(e,u,d),ee=vu(e,w,P),R=T.type===`menu`?m:void 0,B=T.type===`context-menu`,V=s??T.type!==`menu`;s===void 0&&F&&T.type!==`menu`&&(V=()=>l.state.activeIndex===null?F:!1),Rr({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),S.useEffect(()=>{function e(e){l.setOpen(!1,$(e.reason,e.domEvent))}return k.events.on(`close`,e),()=>{k.events.off(`close`,e)}},[k.events,l]),Po(O,{enabled:j&&!M&&!B&&T.type!==`menubar`,closeDelay:A});let H=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:U,handleFocus:W}=(S.useContext(ql)?.useParentHandoff??xu)(l,T,v,f),te=z(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:T.type===`menu`,instant:C},ref:[t,l.context.popupRef,H,L],stateAttributesMapping:Qt,props:[b,{id:I,...F?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":ee},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&cc.has(e.key)&&e.stopPropagation()},onFocus:W},Ol(y),c,{"data-rootownerid":D}]}),G=T.type===void 0||B;(w||T.type===`menubar`&&E!==`outside-press`)&&(G=!0);let ne=R?.getReturnElement??U;return(0,X.jsx)(wa,{context:O,openInteractionType:N,modal:B,disabled:!x,returnFocus:a??ne??G,explicitReturnFocus:a===void 0&&ne?!1:void 0,initialFocus:V,restoreFocus:!0,getInsideElements:T.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:T.type===`menubar`?void 0:k,previousFocusableElement:w,nextFocusableElement:T.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:te})}),bu={parentVirtualFocusRef:void 0,handleFocus:void 0};function xu(){return bu}var Su=S.forwardRef(function(e,t){return(0,X.jsx)(Jl()?.Popup??yu,{...e,ref:t})}),Cu=S.createContext(void 0);function wu(){let e=S.useContext(Cu);if(e===void 0)throw Error(je(32));return e}var Tu=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Ul();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,X.jsx)(Cu.Provider,{value:n,children:(0,X.jsx)(oa,{ref:t,...r,portalOwnerRole:o})})});function Eu(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=S.useState(0),s=w(Ou).current,c=w(Du).current,l=S.useRef(0),u=S.useRef(!0),d=S.useRef(null),f=S.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ju(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Mu(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Au(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=J(()=>{let[e,t]=ku(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=J(e=>(s.add(e),()=>{s.delete(e)})),b=S.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,X.jsx)(nu.Provider,{value:b,children:t})}function Du(){return new Map}function Ou(){return new Set}function ku(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Mu(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Au(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ju(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Mu(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Nu(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=S.useRef(null),o=S.useRef(null),s=Lr(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Pu=20;function Fu(e,t,n,r){let[i,a]=S.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=Fe(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Pu)},[e,t,n]),Mc(e&&(!t||i),r)}var Iu=S.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=$i,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=Ul(),x=wu(),C=Gl(!0),w=v.useState(`parent`),T=v.useState(`floatingRootContext`),E=v.useState(`floatingTreeRoot`),D=v.useState(`mounted`),O=v.useState(`open`),k=v.useState(`modal`),A=v.useState(`openMethod`),j=v.useState(`activeTriggerElement`),M=v.useState(`transitionStatus`),N=v.useState(`positionerElement`),P=v.useState(`instantType`),F=v.useState(`adaptiveOrigin`),I=v.useState(`lastOpenChangeReason`),L=v.useState(`floatingNodeId`),ee=v.useState(`floatingParentNodeId`),R=T.useState(`domReferenceElement`),z=n,B=c,V=l,H=s,U=h;w.type===`context-menu`&&(z=n??w.context?.anchor,H??=`start`,!o&&H!==`center`&&(V=e.alignOffset??2,B=e.sideOffset??-5));let W=o,te=H;w.type===`menu`?(W??=`inline-end`,te??=`start`,U=e.collisionAvoidance??ea):w.type===`menubar`&&(W??=w.context.orientation===`vertical`?`inline-end`:`bottom`,te??=`start`);let G=w.type===`context-menu`,ne=Tl({anchor:z,floatingRootContext:T,positionMethod:C?`fixed`:r,mounted:D,side:W,sideOffset:B,align:te,alignOffset:V,arrowPadding:G?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:L,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:U,shift:G?{crossAxis:!(`side`in U&&U.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:F,lazyFlip:y?`placement`:!1});S.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===L&&v.set(`hoverEnabled`,!1),e.nodeId!==L&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,$(si)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[v,E.events,L]),S.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,$(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,v]);let re=Er();S.useEffect(()=>{O||re.clear()},[O,re]),S.useEffect(()=>{function e(e){if(!(!O||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&j&&j!==e.target){let e=v.select(`closeDelay`);e>0?re.isStarted()||re.start(e,()=>{v.setOpen(!1,$(si))}):v.setOpen(!1,$(si))}else re.clear()}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,j,v,re]),S.useEffect(()=>{let e={open:O,nodeId:L,parentNodeId:ee,reason:v.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,v,L,ee]),Nu({store:v,domReference:R,positionerElement:N,open:O});let K={open:O,side:ne.side,align:ne.align,anchorHidden:ne.anchorHidden,nested:w.type===`menu`,instant:P},q=w.type===`menubar`&&w.context.modal;Fu(O&&(q||k&&I!==`trigger-hover`),A===`touch`,N,j);let ie=kl(e,K,{styles:ne.positionerStyles,transitionStatus:M,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),ae=D&&w.type!==`menu`&&(w.type!==`menubar`&&k&&I!==`trigger-hover`||w.type===`menubar`&&w.context.modal),oe=null;return w.type===`menubar`?oe=w.context.contentElement:w.type===void 0&&(oe=j),(0,X.jsxs)(Bl.Provider,{value:ne,children:[ae&&(0,X.jsx)(bc,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:yc(!O),cutout:oe}),(0,X.jsx)(ma,{id:L,children:(0,X.jsx)(Eu,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:ie})})]})}),Lu=S.createContext(null);function Ru(e){let t=S.useContext(Lu);if(t===null&&!e)throw Error(je(5));return t}function zu(e){return e==null?Wr:e.type.startsWith(`key`)?ii:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?ai:Wr}var Bu={...wo,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=wo.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>xt&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!wo.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Vu=class extends ho{constructor(e,t,n=!1){let r=new Ja,i=Uu(r,t,n,e);super(i,Hu(r),Bu),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Hu(e){return{positionerRef:S.createRef(),popupRef:S.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:S.createRef(),beforeTriggerFocusGuardRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Uu(e,t,n=!1,r){return{...vo(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:I,inputProps:I,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ca,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:I,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Wu=S.createContext(null);function Gu(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Ku(e,t){return e===`list-navigation`||Gu(e,t)}var qu=ao(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:u=!0,orientation:d=`vertical`,actionsRef:f,closeParentOnEsc:p=!1,handle:m,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:_=!0,isSubmenu:v=!1,virtualFocus:y=!1,virtualFocusRef:b,allowEscape:x=!0,resetOnPointerLeave:C=!0}=e,T=Gl(!0),E=Ul(!0),D=Ru(!0),O=E?.store,k=E?.virtualFocus??!1,A=S.useMemo(()=>v&&O?{type:`menu`,store:O}:D?{type:`menubar`,context:D}:T&&!O?{type:`context-menu`,context:T}:{type:void 0},[T,O,D,v]),j=rt(),M=rt(),[N,P]=S.useState(void 0),L=(N??M)||void 0,ee=da(),R=A.type===`menu`?A.store:void 0,z=(n??o)&&R?.state.transitionStatus===`starting`,B=w(()=>z?R?.state.instantType:void 0).current,V=w(()=>{let e=new Vu({open:o,openProp:n,activeTriggerId:g,triggerIdProp:h,parent:A,disabled:s,highlightItemOnHover:_,modal:A.type===void 0?c:void 0,rootId:j,instantType:B},L,ee!=null);return e.context.virtualFocusRef=b,e}).current;V.useControlledProp(`openProp`,n),V.useControlledProp(`triggerIdProp`,h),V.useContextCallback(`onOpenChangeComplete`,i);let H=V.useState(`floatingTreeRoot`),U=pa(H),W=V.useState(`open`),te=V.useState(`activeTriggerElement`),G=V.useState(`positionerElement`),ne=V.useState(`hoverEnabled`),re=V.useState(`disabled`),K=V.useState(`lastOpenChangeReason`),q=V.useState(`parent`),ie=V.useState(`activeIndex`),ae=V.useState(`keyboardOpen`),oe=V.useState(`payload`),se=V.useState(`floatingParentNodeId`),ce=S.useRef(null),le=S.useRef(q.type!==`context-menu`),ue=Er(),de=S.useRef(!0),fe=Er(),pe=se!=null,{openMethod:me,triggerProps:he}=Uc(W);V.useSyncedValues({disabled:s,highlightItemOnHover:_,modal:q.type===void 0?c:void 0,openMethod:me,rootId:j}),Wa(V);let{forceUnmount:ge,transitionStatus:_e}=Ga(W,V,()=>{V.set(`allowMouseEnter`,!1)},z),ve=Lr(V.context.popupRef);S.useEffect(()=>{if(B===void 0)return;let e=()=>{V.state.instantType===B&&V.set(`instantType`,void 0)};if(!W){e();return}if(_e!==void 0)return;if(V.context.popupRef.current==null){e();return}let t=new AbortController;return ve(e,t.signal),()=>{t.abort()}},[B,W,_e,ve,V]),Y(()=>{T&&!E?V.update({parent:{type:`context-menu`,context:T},floatingNodeId:U,floatingParentNodeId:ee}):(E||!V.select(`activeTriggerElement`))&&V.update({floatingNodeId:U,floatingParentNodeId:ee})},[T,E,U,ee,te,V]),S.useEffect(()=>{if(W||(ce.current=null),q.type===`context-menu`){if(!W){ue.clear(),le.current=!1;return}ue.start(500,()=>{le.current=!0})}},[ue,W,q.type]),Y(()=>{!W&&!ne&&V.set(`hoverEnabled`,!0)},[W,ne,V]);let ye=J((e,t)=>{let n=t.reason;if(!e&&!V.select(`open`)||W===e&&t.trigger===te&&K===n)return;let i=Va(t);if(!e&&t.trigger==null&&(t.trigger=te??void 0),r?.(e,t),t.isCanceled)return;V.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);ce.current=t.event;let s=Ba(V.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Ku(n,a),q.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?s.instantType=`group`:Gu(n,a)?s.instantType=`click`:o?s.instantType=`dismiss`:s.instantType=void 0,V.update(s)}),be=Ma({popupStore:V,floatingRootContext:V.state.floatingRootContext,floatingId:L,nested:ee!=null,onOpenChange:ye}),xe=be.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>ye(e,t);return xe.on(`setOpen`,e),()=>{xe?.off(`setOpen`,e)}},[xe,ye]),Y(()=>V.subscribeToParentMenu(),[V]);let Se=S.useCallback(()=>{V.setOpen(!1,$(di))},[V]);S.useImperativeHandle(f,()=>({unmount:ge,close:Se}),[ge,Se]);let Ce;q.type===`context-menu`&&(Ce=q.context),S.useImperativeHandle(Ce?.positionerRef,()=>G,[G]),S.useImperativeHandle(Ce?.actionsRef,()=>({setOpen:ye}),[ye]);let we=ja(be,{enabled:!re,bubbles:{escapeKey:p&&q.type===`menu`},outsidePress(){return q.type!==`context-menu`||ce.current?.type===`contextmenu`?!0:le.current},externalTree:pe?H:void 0}),Te=dl(),Ee=Uo(be,{enabled:!re,listRef:V.context.itemDomElements,activeIndex:ie,virtual:y,nested:q.type===`menubar`||!y&&q.type!==void 0,parentOrientation:q.type===`menubar`?q.context.orientation:void 0,loopFocus:u,focusItemOnOpen:y?ae:void 0,allowEscape:y&&u&&x,orientation:d,triggerOrientation:y?`vertical`:d,rtl:Te===`rtl`,disabledIndices:F,onNavigate(e,t){V.setActiveIndex(e,zu(t),t?.nativeEvent)},openOnArrowKeyDown:q.type!==`context-menu`&&!(y&&v),externalTree:!y&&pe?H:void 0,nestedReturnFocusRef:R?.context.virtualFocusRef,focusItemOnHover:_,resetOnPointerLeave:C}),De=S.useCallback(e=>{V.context.typingRef.current=e},[V]),Oe=Wo(be,{enabled:!re&&!y,listRef:V.context.itemLabels,elementsRef:V.context.itemDomElements,activeIndex:ie,resetMs:500,onMatch:(e,t)=>{W&&e!==ie&&V.setActiveIndex(e,ii,t.nativeEvent)},onTyping:De}),ke=J(a),Ae=S.useRef(-1),je=J(()=>{let e=V.state.activeIndex,t=e===null?void 0:V.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&V.context.reportedItem===t)return;Ae.current=n,V.context.reportedItem=t,y&&V.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=V.context;V.context.highlightReason=Wr,V.context.highlightEvent=void 0,a&&ke(t,Ur(r,i,{label:t===void 0?void 0:V.context.itemLabels.current[n]??void 0}))});Y(()=>{je()},[ie,je]);let Me=S.useMemo(()=>{if(!y)return Ee.reference;if(!Ee.trigger)return I;let{onFocus:e,...t}=Ee.trigger;return t},[y,Ee.reference,Ee.trigger]);V.useSyncedValue(`inputProps`,y?Ee.reference??I:I);let Ne=S.useMemo(()=>{let e=l(Oe.reference,Me,we.reference,{onMouseMove(){V.set(`allowMouseEnter`,!0)}},he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=W,e},[V,Oe.reference,Me,we.reference,he,W]),Pe=S.useMemo(()=>{let e=l(Ee.trigger,we.trigger,he);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,we.trigger,he]);w(()=>(V.update({inactiveTriggerProps:Pe}),null)),Ka(V,{floatingRootContext:be,activeTriggerProps:Ne,inactiveTriggerProps:Pe,popupProps:S.useMemo(()=>l(Pa,{onMouseMove(){V.set(`allowMouseEnter`,!0),q.type===`menu`&&V.set(`hoverEnabled`,!1)},onClick(){V.select(`hoverEnabled`)&&V.set(`hoverEnabled`,!1)},onKeyDown(e){let t=V.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,we.floating),[q.type,V,Oe.floating,Ee.floating,we.floating]),itemProps:Ee.item??I});let Fe=S.useMemo(()=>({store:V,parent:A,orientation:d,loopFocus:u,allowEscape:x,defaultFloatingId:M,setRenderedFloatingId:P,virtualFocus:y,parentVirtualFocus:k,syncHighlightedItem:je}),[V,A,d,u,x,M,y,k,je]),Ie=typeof t==`function`?t({payload:oe}):t,Le=(0,X.jsxs)(Hl.Provider,{value:Fe,children:[m&&(0,X.jsx)(La,{handle:m,store:V}),Ie]});return(q.type===void 0||q.type===`context-menu`)&&(Le=(0,X.jsx)(ha,{externalTree:H,children:Le})),Le});function Ju(e){let t=S.useContext(Wu);if(t===null)return(0,X.jsx)(qu,{...e});let n=t.Root;return(0,X.jsx)(Wu.Provider,{value:null,children:(0,X.jsx)(n,{...t.options,...e})})}var Yu=5;function Xu(e,t){let n=Zu(t);return e.clientX>=n.left-Yu&&e.clientX<=n.right+Yu&&e.clientY>=n.top-Yu&&e.clientY<=n.bottom+Yu}function Zu(e){let t=e.getBoundingClientRect(),n=K(e);if(wt)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Qu(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ne(),{ref:i,index:a}=iu(e),o=n===a,s=S.useRef(null),c=T(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function $u(e){let{render:t,className:n,style:r,state:i=I,props:a=F,refs:o=F,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Qu({metadata:s});return z(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function ed(e){if(oe(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ve(e))return ed(xe(e))}function td(e,t){function n(n,r,i){let a=n.currentTarget;ot.flushSync(()=>{e.setOpen(!1,$(ti,n.nativeEvent,a))}),yr(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&br(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function nd(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=S.useRef(!1);return S.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Fe(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:I,[t,n,r])}var rd=oo(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:u=100,closeDelay:d=0,handle:f,payload:p,...m}=e,h=Ul(!0),g=To(f)??h?.store;if(!g)throw Error(je(85));let _=rt(s),v=g.useState(`isTriggerActive`,_),y=g.useState(`floatingRootContext`),b=g.useState(`isOpenedByTrigger`,_),x=g.useState(`triggerControlsId`,_),C=S.useRef(null),w=ad(),T=Ne(!0),E=fa(),D=S.useMemo(()=>E??new ca,[E]),{registerTrigger:O,isMountedByThisTrigger:k}=Ua(_,C,g,{payload:p,closeDelay:d,parent:w,floatingTreeRoot:D,floatingNodeId:pa(D),floatingParentNodeId:da(),keyboardEventRelay:T?.relayKeyboardEvent}),A=w.type===`menubar`,j=g.useState(`disabled`),M=a||j||A&&w.context.disabled,{getButtonProps:N,buttonRef:P}=Le({disabled:M,native:o});S.useEffect(()=>{!b&&w.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,b,w.type]);let F=S.useRef(null),L=Er(),ee=J(e=>{if(!F.current)return;L.clear(),g.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(F.current,t)||Q(g.select(`positionerElement`),t)||t===F.current||t!=null&&ed(t)===g.select(`rootId`)||Xu(e,F.current)||D.events.emit(`close`,{domEvent:e,reason:oi})});S.useEffect(()=>{let e=Fe(F.current);if(b&&g.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,ee,{once:!0}),()=>{e.removeEventListener(`mouseup`,ee)}},[b,ee,g]);let R=A&&w.context.hasSubmenuOpen,B=Io(y,{enabled:(c??R)&&!M&&(!A||R&&!k),handleClose:Qo({blockPointerEvents:!A}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:d},triggerElementRef:C,externalTree:D,isActiveTrigger:v,isClosing:()=>g.select(`transitionStatus`)===`ending`}),V=id(b,g.select(`lastOpenChangeReason`)),H=Ta(y,{enabled:!M,event:b&&A?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0?V:!1}),U=Oo(y,{enabled:!M&&R}),W=nd({open:b,enabled:A,mouseDownAction:`open`}),te=S.useMemo(()=>l(U.reference,H.reference),[U.reference,H.reference]),G=g.useState(`triggerProps`,k),ne=g.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:re,handleFocusTargetFocus:K}=td(g,C),q={disabled:M,open:b},ie=[F,t,P,O,C],ae=[te,B??I,G,{"aria-haspopup":`menu`,"aria-controls":x,id:_,onMouseDown:e=>{g.select(`open`)||(L.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),Fe(e.currentTarget).addEventListener(`mouseup`,ee,{once:!0}))}},ne,A?{role:`menuitem`}:{},W,m,N],oe=z(`button`,e,{enabled:!A,stateAttributesMapping:Xt,state:q,ref:ie,props:ae});return A?(0,X.jsx)($u,{tag:`button`,render:n,className:r,style:i,state:q,refs:ie,props:ae,stateAttributesMapping:Xt}):b?(0,X.jsxs)(S.Fragment,{children:[(0,X.jsx)(Li,{ref:g.context.beforeTriggerFocusGuardRef,onFocus:re},`${_}-pre-focus-guard`),(0,X.jsx)(S.Fragment,{children:oe},_),(0,X.jsx)(Li,{ref:g.context.triggerFocusTargetRef,onFocus:K},`${_}-post-focus-guard`)]}):(0,X.jsx)(S.Fragment,{children:oe},_)});function id(e,t){let n=Er(),[r,i]=S.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function ad(){let e=Ru(!0);return S.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function od(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}function sd(e){return Array.isArray(e)?e.map(e=>sd(e)).join(`,`):e==null?``:String(e)}function cd(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function ld(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function ud(e){return ld(e?.[0])}function dd(e){return ud(e)?e.flatMap(e=>e.items):e}function fd(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(ud(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function pd(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return cd(e)}function md(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?cd(e.value):cd(e)}function hd(e,t,n){function r(){return pd(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=dd(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function gd(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,X.jsx)(S.Fragment,{children:hd(r,t,n)},i)),e),[])}var _d=new Map;function vd(e={}){let{locale:t,...n}=e,r={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...n},i=`${sd(t)}|${JSON.stringify(r)}`,a=_d.get(i);if(a)return a;let o=new Intl.Collator(t,r),s={contains(e,t,n){if(!t)return!0;let r=pd(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(o.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=pd(e,n);return o.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=pd(e,n),i=t.length;return r.length>=i&&o.compare(r.slice(r.length-i),t)===0}};return _d.set(i,s),s}var yd=S.createContext(void 0);function bd(){let e=S.useContext(yd);if(e===void 0)throw Error(je(64));return e}var xd=`data-activation-direction`,Sd={tabActivationDirection:e=>({[xd]:e})},Cd=S.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=S.useRef([]),[f,p]=S.useState(()=>new Map),[m,h]=Kl({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=S.useState(()=>new Map),y=S.useRef(void 0),b=S.useCallback(e=>wd(_,e),[_]),[x,C]=S.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:w,tabActivationDirection:T}=x,E=T,D=!1;w!==m&&(E=Td(w,m,a,_),D=w!=null&&m!=null&&b(m)==null);let O=D?w:m,k=w!==O||T!==E;Y(()=>{k&&C({previousValue:O,tabActivationDirection:E})},[O,k,E]);let A=J((e,t)=>{t.activationDirection=Td(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),j=J((e,t)=>{i?.(e,$(t,void 0,void 0,{activationDirection:`none`}))}),M=J((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),N=S.useCallback(e=>f.get(e),[f]),P=S.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),F=S.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:P,getTabPanelIdByValue:N,onValueChange:A,orientation:a,registerMountedTabPanel:M,setTabMap:v,tabActivationDirection:E,value:m}),[b,P,N,A,a,M,v,E,m]),I=S.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),L=S.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),ee=S.useRef(!u),R=S.useRef(r),B=S.useRef(u),V=S.useRef(!1);Y(()=>{if(g)return;function e(e,t){h(()=>e),C({previousValue:e,tabActivationDirection:`none`}),j(e,t),ee.current=!1}if(_.size===0){V.current&&m!==null&&!y.current?.isConnected&&e(null,li);return}V.current=!0,y.current=_.keys().next().value;let t=I?.disabled,n=I==null&&m!==null;if(!t&&m===R.current&&(B.current=!1),B.current&&t&&m===R.current)return;let r=ee.current;if(t||n){let n=L??null;if(m===n){ee.current=!1;return}let i=li;r?i=ui:t&&(i=ci),e(n,i);return}r&&I!=null&&(j(m,ui),ee.current=!1)},[L,g,j,I,h,_,m]);let H=z(`div`,e,{state:{orientation:a,tabActivationDirection:E},ref:t,props:l,stateAttributesMapping:Sd});return(0,X.jsx)(yd.Provider,{value:F,children:(0,X.jsx)(Eu,{elementsRef:d,children:H})})});function wd(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function Td(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=wd(r,e),c=wd(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var Ed=`data-composite-item-active`,Dd=S.createContext(void 0);function Od(){let e=S.useContext(Dd);if(e===void 0)throw Error(je(65));return e}var kd=S.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=bd(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=Od(),{highlightedIndex:v,onHighlightedIndexChange:y}=Ne(),b=rt(o),{compositeProps:x,compositeRef:C,index:w}=Qu({metadata:S.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),T=a===u,E=S.useRef(!1),D=S.useRef(null),O=J(e=>{D.current?.(),D.current=e?g(e):null});Y(()=>{if(E.current){E.current=!1;return}if(!(T&&w>-1&&v!==w))return;let e=_;if(e!=null){let t=Tt(Fe(e));if(t&&Q(e,t))return}r||y(w)},[T,w,v,y,r,_]);let{getButtonProps:k,buttonRef:A}=Le({disabled:r,native:s,focusableWhenDisabled:!0}),j=d(a),M=S.useRef(!1),N=S.useRef(!1);function P(e){f(a,$(Wr,e.nativeEvent,void 0,{activationDirection:`none`}))}function F(e){T||r||P(e)}function I(e){T||r||h&&(!M.current||N.current)&&P(e)}function L(e){if(T||r)return;M.current=!0,N.current=e.button===0;let t=Fe(e.currentTarget);function n(){M.current=!1,N.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return z(`button`,e,{state:{disabled:r,active:T,orientation:p,tabActivationDirection:m},ref:[t,A,C,O],props:[x,{role:`tab`,"aria-controls":j,"aria-selected":T,id:b,onClick:F,onFocus:I,onPointerDown:L,[Ed]:T?``:void 0,onKeyDownCapture(){E.current=!0}},l,k],stateAttributesMapping:Sd})}),Ad=S.createContext(void 0),jd={disableStyleElements:!1};function Md(){return S.useContext(Ad)??jd}var Nd=`data-index`,Pd={...Sd,...Rt},Fd=S.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=bd(),p=rt(),{ref:m,index:h}=iu(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=zr(g),b=!_,x=l(r),C={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},w=S.useRef(null),T=z(`div`,e,{state:C,ref:[t,m,w],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:yc(!g),[Nd]:h},s],stateAttributesMapping:Pd});return Rr({open:g,ref:w,onComplete(){g||y(!1)}}),Y(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?T:null});function Id(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=F}=e,[p,m]=S.useState(0),h=r!=null,g=S.useRef(null),_=T(g,c),v=S.useRef([]),y=S.useRef(!1),b=S.useRef(null),x=o??p,C=J((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];fc(g.current,t,a,n)}}),w=J(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||Zn(e,x,d)?C(Ld(e,d)):b.current=t}else t!==x&&C(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)C(i);else if(Zn(t,x,d)){let e=Yn(t,{disabledIndices:d});Gn(t,e)||C(e)}fc(g.current,r,a,n)});Y(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(Zn(e,x,d)){let t=Yn(e,{disabledIndices:d});Gn(e,t)||C(t)}},[d,o,x,v,C]);let E=J((e,t,n)=>i?i(e,t,n,v):n),D=J(e=>{let o=e.key===`Home`||e.key===`End`;if(!cc.has(e.key)||!l&&o||Rd(e,f)||!g.current)return;let s=a===`rtl`,c=s?oc:sc,p=s?sc:oc,m=n===`vertical`?ac:c,_=n===`vertical`?ic:p,y=Dt(e.nativeEvent);if(y!=null&&dc(y)&&!od(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,S=Kn(v,d),w=qn(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:w,minIndex:S,onLoop:E,orientation:n,rtl:s}));let T=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=S:e.key===`End`&&(b=w)),b===x&&(T||D)&&(t&&b===w&&T?(b=S,i&&(b=i(e,x,b,v))):t&&b===S&&D?(b=w,i&&(b=i(e,x,b,v))):b=Yn(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!Gn(v.current,b)&&(u&&e.stopPropagation(),(h||o||T||D)&&e.preventDefault(),C(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=Dt(e.nativeEvent);!t||n==null||!dc(n)||n.setSelectionRange(0,n.value.length)},onKeyDown:D},highlightedIndex:x,onHighlightedIndexChange:C,elementsRef:v,onMapChange:w,relayKeyboardEvent:D}}function Ld(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(!(!i||Zn(e,r,t))){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function Rd(e,t){for(let n of lc)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function zd(e){let{render:t,className:n,style:r,refs:i=F,props:a=F,state:o=I,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...C}=e,{props:w,highlightedIndex:T,onHighlightedIndexChange:E,elementsRef:D,onMapChange:O,relayKeyboardEvent:k}=Id({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:dl(),disabledIndices:v,modifierKeys:y}),A=z(x,e,{state:o,ref:i,props:[w,...a,C],stateAttributesMapping:s}),j=S.useMemo(()=>({highlightedIndex:T,onHighlightedIndexChange:E,highlightItemOnHover:b,relayKeyboardEvent:k}),[T,E,b,k]);return(0,X.jsx)(Me.Provider,{value:j,children:(0,X.jsx)(Eu,{elementsRef:D,onMapChange:e=>{h?.(e),O(e)},children:A})})}var Bd=S.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=bd(),[d,f]=S.useState(0),[p,m]=S.useState(null),h=S.useRef(new Set),g=S.useRef(new Set),_=S.useRef(null);Y(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=J(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=J(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},C=S.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,X.jsx)(Dd.Provider,{value:C,children:(0,X.jsx)(zd,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:Sd,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:F})})});function Vd(e){let t=S.useRef(!0);t.current&&(t.current=!1,e())}function Hd(e,t,n,r,i,a,o,s,c,l=2){let u=Xn(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return Gn(n.current,u)?void 0:u}var Ud=S.createContext(void 0),Wd=S.createContext(void 0),Gd=S.createContext(void 0),Kd=S.createContext(!1),qd=S.createContext(``);function Jd(){let e=S.useContext(Ud);if(!e)throw Error(je(22));return e}function Yd(){let e=S.useContext(Wd);if(!e)throw Error(je(23));return e}function Xd(){let e=S.useContext(Gd);if(!e)throw Error(je(24));return e}function Zd(){return S.useContext(qd)}function Qd(){return S.useContext(Kd)}function $d(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var ef=(e,t)=>Object.is(e,t);function tf(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function nf(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!$d(e,t,(e,t)=>tf(e,t,n)):e!==t}function rf(e,t,n){return e?e.some(e=>e===void 0?!1:tf(t,e,n)):!1}function af(e,t,n){return e?e.findIndex(e=>e===void 0?!1:tf(e,t,n)):-1}function of(e,t){if(t!==ef)return n=>rf(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function sf(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(of(t,n)):af(e,t,n);return i===-1?null:i}function cf(e,t,n,r,i,a){return rf(r,t,i)?a!=null&&e>a&&rf(r,n[a],i)?a:e:e===a?sf(n,r,i,!0):a}function lf(e,t,n){return e.filter(e=>!tf(t,e,n))}var uf={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?fd(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>tf(t,e,n)):tf(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function df(e){return e==null?void 0:`${e}-popup`}function ff(e,t){return(n,r)=>n==null?!1:e.contains(n,r,t)}var pf=vd;function mf(e,t=!1){let{overflowY:n}=ye(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var hf=Symbol(`none`),gf={value:hf,index:-1};function _f(e,t,n){let r=e.get(t);if(r!==void 0||n===ef)return r;for(let[r,i]of e)if(tf(r,t,n))return i}function vf(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:u=!1,selectionMode:d,onItemHighlighted:f,name:p,form:m,disabled:h=!1,readOnly:g=!1,required:_=!1,inputRef:v,grid:y=!1,items:b,filteredItems:x,filter:C,filterQuery:E,openOnInputClick:D=!0,autoHighlight:O=!1,keepHighlight:k=!1,highlightItemOnHover:A=!0,loopFocus:j=!0,itemToStringLabel:M,itemToStringValue:N,isItemEqualToValue:L=ef,virtualized:ee=!1,inline:R=!1,fillInputOnItemPress:z=!0,modal:B=!1,limit:V=-1,autoComplete:H=`list`,formAutoComplete:U,locale:W,submitOnItemClick:te=!1}=e,{clearErrors:G}=Ze(),{setDirty:ne,validityData:re,setFilled:K,name:q,disabled:ie,setTouched:ae,setFocused:se,validationMode:ce,validation:le}=Ye(),ue=dl(),de=ut({id:t}),fe=pf({locale:W}),pe=Array.isArray(b)?null:b;if(pe&&typeof pe.label!=`function`)throw Error(je(100));let me=pe?pe.data:b,he=pe?.value,ge=he?void 0:me,_e=S.useMemo(()=>{if(!x||!he)return;let e=dd(x),t=e.map(he),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return _f(n,r,i)}}},[x,he]),ve=S.useMemo(()=>pe?e=>pe.label(e,L,e=>{let t=_e?.findItem(e,L);return t==null?pd(e,M):pe.itemLabel(t)}):M,[pe,M,_e,L]),ye=S.useMemo(()=>pe?Object.assign(e=>pe.itemLabel(e),{selected:e=>pd(e,ve)}):M,[pe,ve,M]);function be(e){return pd(e,ve)}let[xe,Se]=S.useState(!1),[we,Te]=S.useState(null),Ee=S.useRef(we),De=S.useRef([]),Oe=S.useRef([]),ke=S.useRef(null),Ae=S.useRef(null),Me=S.useRef(null),Ne=S.useRef(null),Pe=S.useRef(null),Fe=S.useRef(!1),Ie=S.useRef(null),Le=S.useRef(null),Re=S.useRef(null),ze=S.useRef(gf),Be=S.useRef(null),Ve=S.useRef([]),He=S.useRef(null),Ue=ie||h,We=q??p,Ge=d===`multiple`,Ke=d===`single`,qe=s!==void 0||o!==void 0,Je=me!==void 0,Xe=x!==void 0,Qe;Qe=O===`always`?`always`:O?`input-change`:!1;let[$e,et]=Kl({controlled:i,default:Ge?r??F:r,name:`Combobox`,state:`selectedValue`}),tt=S.useMemo(()=>C===null?()=>!0:C===void 0?ff(fe,ye):C,[C,fe,ye]),nt=w(()=>qe?o??``:Ke?be($e):``).current,[rt,it]=Kl({controlled:s,default:nt,name:`Combobox`,state:`inputValue`}),[at,ot]=Kl({controlled:c,default:u,name:`Combobox`,state:`open`}),st=ud(me),ct=!at&&we!==null?we:String(rt).trim(),lt=Ke?be($e):``,dt=Ke&&!xe&&ct!==``&<.length===ct.length&&fe.contains(lt,ct),ft=dt?``:E??ct,pt=Je&&Xe&&dt&&(!pe||pe.hasValue($e,L)),mt=S.useMemo(()=>me?dd(me):F,[me]),ht=S.useMemo(()=>{if(x&&!pt)return x;if(!me)return F;if(st){let e=me,t=[],n=0;for(let r of e){if(V>-1&&n>=V)break;let e=V>-1?V-n:1/0,i=ft===``?r.items.slice(0,e):[];if(ft!==``)for(let t of r.items){if(i.length>=e)break;tt(t,ft,ye)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(ft===``)return V>-1?mt.slice(0,V):mt;let e=[];for(let t of mt){if(V>-1&&e.length>=V)break;tt(t,ft,ye)&&e.push(t)}return e},[x,pt,me,st,ft,V,tt,ye,mt]),gt=S.useMemo(()=>{if(_e&&ht===x)return _e.values;let e=dd(ht);return he?e.map(e=>he(e)):e},[ht,x,_e,he]),Z=w(()=>{let e=null;return R&&at&&Je&&d!==`none`&&(e=sf(gt,$e,L,Ge)),new ho({id:de,labelId:void 0,selectedValue:$e,open:at,items:ge,selectionMode:d,name:We,form:m,disabled:Ue,readOnly:g,required:_,grid:y,virtualized:ee,openOnInputClick:D,itemToStringLabel:ve,isItemEqualToValue:L,modal:B,autoHighlight:Qe,submitOnItemClick:te,hasInputValue:qe,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:R,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:I,id:de,selectionMode:d,disabled:Ue,readOnly:g,isItemEqualToValue:L},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:d===`none`},{onOpenChangeComplete:P,setOpen:P,setInputValue:P,setSelectedValue:P,setIndices:P,handleSelection:P,forceMount:P,requestSubmit:P,listRef:De,labelsRef:Oe,popupRef:ke,emptyRef:Pe,inputRef:Ae,startDismissRef:Me,endDismissRef:Ne,chipsContainerRef:Ie,clearRef:Le,valuesRef:Ve,pointerDownItemRef:He,selectionEventRef:Re},uf)}).current,_t=d===`none`?rt:$e,vt=S.useMemo(()=>d===`none`?_t:Array.isArray($e)?$e.map(e=>md(e,N)):md($e,N),[_t,N,d,$e]),yt=J(f),bt=J(n),xt=Z.useState(`activeIndex`),St=Z.useState(`selectedIndex`),Ct=Z.useState(`positionerElement`),wt=Z.useState(`listElement`),Ot=Z.useState(`triggerElement`),kt=Z.useState(`inputElement`),At=Z.useState(`inputGroupElement`),jt=Z.useState(`inline`),Mt=Z.useState(`inputInsidePopup`),Nt=Z.useState(`inputOwnsFormValue`),Pt=Ke&&!Mt&&rt===lt,Ft=Mi(Ot),{openMethod:It,triggerProps:Lt}=Uc(at),Rt=J(()=>vt);Vr(Mt?Ft:Ae,de,_t,Rt,!Ue,p);let zt=J(()=>{me?Oe.current=gt.map(be):Z.set(`forceMounted`,!0)}),Bt=J((e,t,n,r)=>{if(t===-1){if(ze.current===gf)return;ze.current=gf}else ze.current={value:e,index:t};yt(e,Ur(n,r,{index:t}))}),Vt=J(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),Z.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Bt(void 0,-1,r,e.event):Bt(Ve.current[n],n,r,e.event)}),Ht=J((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Fe.current=n.reason===$r,n.reason===`input-change`){at&&we!==null&&Te(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&Se(!0),Be.current={hasQuery:e};let n=Z.state.listElement;if(!Z.state.virtualized&&n){let e=ke.current;for(let t of Ce(n.firstElementChild??n)){if(!oe(t)||(e?!Q(e,t):t.getAttribute(`role`)===`dialog`))break;if(mf(t)){t.scrollTop=0;break}}}e&&Qe&&Z.state.activeIndex==null&&(at||jt)&&Z.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&Z.state.inputInsidePopup&&(Be.current={hasQuery:!1,selection:!0});it(t)}}),Ut=J(e=>{let t=!e&&Mt&&!jt&&rt!==``&&(String(rt).trim()===we||rt===lt);!e&&(t||rt===``||Pt)&&Se(!1),Te(null),t&&Ht(``,$($r))}),[Wt,Gt]=S.useState(!1),Kt=J((t,n)=>{if(at===t)return;n.reason===`escape-key`&&Je&>.length===0&&!Pe.current&&n.allowPropagation();let r=n,i=Va(r);if(e.onOpenChange?.(t,r),Be.current?.hasQuery&&n.reason===`input-change`===n.isCanceled&&(Be.current=null),!n.isCanceled&&(t&&we!==null&&Ut(n.reason===Qr),!t&&xe&&(Ke?(jt||Te(ct),ct===``&&Se(!1)):Ge&&(jt||Te(ct),Mt&&Vt({activeIndex:null}),(!Mt||jt)&&Ht(``,$($r,n.event,void 0,{isItemPress:n.reason===Yr})))),t||Gt(i()),ot(t),!t&&Mt&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(ae(!0),se(!1),ce===`onBlur`))){let e=d===`none`?rt:$e;le.commit(e)}}),qt=J((e,t)=>{a?.(e,t),!t.isCanceled&&(et(e),(d===`none`&&ke.current&&z||Ke&&!Z.state.inputInsidePopup)&&Ht(be(e),$(t.reason,t.event)))}),Jt=J((e,t)=>{let n=Dt(e),r=Re.current??e;Re.current=null;let i=$(Yr,r),a=Et(n,`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Kt(!1,i);return}if(Ge){let e=Array.isArray($e)?$e:[],n=rf(e,t,L);if(qt(n?lf(e,t,L):[...e,t],i),i.isCanceled||!(Ae.current&&Ae.current.value.trim()!==``))return;if(Z.state.inputInsidePopup){Ht(``,$($r,i.event,void 0,{isItemPress:!0}));let e=Be.current;e&&!n&&(e.toggledValue=t)}else Kt(!1,i)}else{if(qt(t,i),i.isCanceled)return;Kt(!1,i)}}),Yt=J(()=>{let e=le.inputRef.current?.form??Z.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Xt=J(()=>{if(bt?.(!1),Se(!1),Te(null),Vt(d===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ge&&Ae.current&&Ae.current.value!==``&&!Fe.current&&Ht(``,$($r)),Ke)if(Z.state.inputInsidePopup)Ae.current&&Ae.current.value!==``&&Ht(``,$($r));else{let e=be($e);Ae.current&&Ae.current.value!==e&&Ht(e,$(e===``?$r:Wr))}}),Zt=S.useMemo(()=>jt&&Ct?{current:Et(Ct,`[role="dialog"]`)}:ke,[jt,Ct]),{mounted:Qt,transitionStatus:$t,forceUnmount:en}=Na({open:at,ref:Zt,preventUnmountOnClose:Wt,setPreventUnmountOnClose:Gt,onUnmount:Xt});S.useImperativeHandle(e.actionsRef,()=>({unmount:en,close:()=>Kt(!1,$(di))}),[en,Kt]),Y(function(){let e=Ee.current!==null&&we===null;Ee.current=we,!(at&&(!e||!Je))&&(at||(He.current=null),d!==`none`&&Vt({selectedIndex:sf(Je?gt:Ve.current,$e,L,Ge)}))},[at,we,$e,d,Ge,Je,gt,L,Vt]),Y(()=>{me&&(Ve.current=gt,De.current.length=gt.length)},[me,gt]),Y(()=>{!at&&Be.current?.hasQuery&&(Be.current=null)},[at]),Y(()=>{if(!at&&jt&&Zt.current){Be.current=null;return}let e=Je||Xe?gt:Ve.current,t=Be.current;if(t){let n=at||jt||Z.state.positionerElement?.hidden===!1;if(t.hasQuery){let t=Ae.current;!Qe||String(rt).trim()===``||jt&&Qe!==`always`&&(!t||Tt(t.ownerDocument)!==t)?Be.current=null:n&&(e[0]!==void 0||!Je&&!Xe)&&(Z.set(`activeIndex`,0),Be.current=null)}else if(String(rt).trim()===``&&(Be.current=null,n)){let e=t.selection;Qe===`always`&&!e&&Z.state.selectionMode===`none`&&Z.set(`activeIndex`,0),queueMicrotask(()=>{if(!Z.state.open&&(!Z.state.inline||Zt.current)||Ae.current&&Ae.current.value.trim()!==``)return;let n=Z.state.selectedValue,r=Z.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:Z.state.selectionMode!==`none`&&n!=null){let e=Je||Xe?gt:Ve.current,i=af(e,t.toggledValue,Z.state.isItemEqualToValue);Z.set(`activeIndex`,i===-1?sf(e,n,Z.state.isItemEqualToValue,r):i)}else e?Z.set(`activeIndex`,null):Qe===`always`&&Z.set(`activeIndex`,0)})}}if(!at&&!jt)return;let n=Z.state.activeIndex;if(n==null){if(Qe===`always`&&e.length>0){Z.set(`activeIndex`,0);return}Bt(void 0,-1,Wr);return}if(n>=e.length){Bt(void 0,-1,Wr),Z.set(`activeIndex`,null);return}let r=e[n],i=ze.current.value,a=i!==hf&&tf(r,i,Z.state.isItemEqualToValue);(ze.current.index!==n||!a)&&Bt(r,n,Wr)},[xt,Qe,Bt,Xe,Je,gt,jt,at,Zt,Z,rt]),Y(()=>{if(d===`none`){K(String(rt)!==``);return}K(Ge?Array.isArray($e)&&$e.length>0:$e!=null)},[K,d,rt,$e,Ge]),S.useEffect(()=>{Je&&Qe&>.length===0&&Vt({activeIndex:null})},[Je,Qe,gt.length,Vt]);function tn(){at&&ct!==``&&ct!==String(nt)&&!Pt&&Se(!0)}function nn(){at&&we!==null&&Ut(!1)}let rn=!1;function an(){!rn&&rt!==lt&&(rn=!0,Ht(lt,$(Wr)))}function on(){d!==`none`&&(G(We),ne(nf($e,re.initialValue,L)),le.change($e),Ke&&!qe&&!Mt&&an())}function sn(){Ke&&!qe&&!Mt&&!xe&&an()}function cn(){d===`none`&&(G(We),ne(rt!==re.initialValue),le.change(rt))}Hr(ct,tn),Hr(at,nn),Hr($e,on),Hr(lt,sn),Hr(me,sn),Hr(rt,cn);let ln=Eo({open:jt?!0:at,onOpenChange:Kt,elements:{reference:Mt?Ot:kt,floating:Ct}}),un=y?`grid`:`listbox`,dn=at||jt,fn=dn?`true`:`false`,pn=S.useMemo(()=>{let e=kt?.tagName===`INPUT`,t=kt==null||e,n=t||dn,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=fn,r[`aria-haspopup`]=un,r[`aria-controls`]=dn?wt?.id:void 0,r[`aria-autocomplete`]=g?`none`:H),{reference:r,floating:{role:`presentation`}}},[kt,dn,fn,un,wt?.id,H,g]),mn=Ta(ln,{enabled:!Ue&&D,event:`mousedown-only`,toggle:!1,touchOpenDelay:Mt?0:100,reason:ei}),hn=ja(ln,{enabled:!Ue&&!jt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:jt?!0:void 0,outsidePress(e){let t=Dt(e);return!Q(Ot,t)&&!Q(Le.current,t)&&!Q(Ie.current,t)&&!Q(At,t)}}),gn=Uo(ln,{enabled:!Ue,id:de,listRef:De,activeIndex:xt,selectedIndex:St,virtual:!0,loopFocus:j,allowEscape:j&&!Qe,focusItemOnOpen:xe||d===`none`&&!Qe?!1:`auto`,focusItemOnHover:A,resetOnPointerLeave:!k,orientation:y?`horizontal`:void 0,rtl:ue===`rtl`,disabledIndices:F,grid:y?Hd:void 0,onNavigate(e,t){!t&&!at&&!(jt&&e===null)||$t===`ending`||Vt({activeIndex:e,type:zu(t),event:t?.nativeEvent})}}),_n=S.useMemo(()=>l(gn.reference,{onKeyDown(e){y&&Z.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},hn.reference,mn.reference,pn.reference),[gn.reference,hn.reference,mn.reference,pn.reference,y,Z]),vn=S.useMemo(()=>l(Pa,hn.floating),[hn.floating]),yn=S.useMemo(()=>l(gn.floating,pn.floating),[gn.floating,pn.floating]),bn=S.useMemo(()=>{let e=gn.item;return{props:e?{...e,onFocus:void 0}:I,id:de,selectionMode:d,disabled:Ue,readOnly:g,isItemEqualToValue:L}},[gn.item,de,d,Ue,g,L]);Z.useContextCallback(`setOpen`,Kt),Z.useContextCallback(`setInputValue`,Ht),Z.useContextCallback(`setSelectedValue`,qt),Z.useContextCallback(`setIndices`,Vt),Z.useContextCallback(`handleSelection`,Jt),Z.useContextCallback(`forceMount`,zt),Z.useContextCallback(`requestSubmit`,Yt),Z.useContextCallback(`onOpenChangeComplete`,n),Vd(()=>{Z.update({inline:R,popupProps:vn,listProps:yn,inputProps:_n,triggerProps:Lt,itemRoot:bn})});let xn={id:de,selectedValue:$e,open:at,mounted:Qt,transitionStatus:$t,items:ge,inline:R,popupProps:vn,listProps:yn,inputProps:_n,triggerProps:Lt,itemRoot:bn,openMethod:It,selectionMode:d,name:We,form:m,disabled:Ue,readOnly:g,required:_,grid:y,virtualized:ee,openOnInputClick:D,itemToStringLabel:ve,modal:B,autoHighlight:Qe,isItemEqualToValue:L,submitOnItemClick:te,hasInputValue:qe};Y(()=>{Z.update({...xn,inputOwnsFormValue:d===`none`&&(R||!Z.state.inputInsidePopup)})},[Z,...Object.values(xn)]);let Sn=T(v,le.inputRef),Cn=S.useMemo(()=>({query:ct,hasItems:Je,filteredItems:ht,flatFilteredValues:gt}),[ct,Je,ht,gt]),wn=S.useMemo(()=>Array.isArray(_t)?``:md(_t,N),[_t,N]),Tn=Ge&&Array.isArray($e)&&$e.length>0,En=Ge||d===`none`&&Nt?void 0:We,Dn=S.useMemo(()=>!Ge||!Array.isArray($e)||!We?null:$e.map(e=>{let t=md(e,N);return(0,X.jsx)(`input`,{type:`hidden`,form:m,name:We,value:t,disabled:Ue},t)}),[Ge,$e,m,We,N,Ue]),On=(0,X.jsxs)(S.Fragment,{children:[e.children,(0,X.jsx)(`input`,{...le.getValidationProps(Ue,{onFocus(){if(Mt){Ot?.focus();return}(Ae.current||Ot)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ue||g)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=$(Wr,e.nativeEvent),i=()=>Ve.current.findIndex(e=>md(e,N).toLowerCase()===n||be(e).toLowerCase()===n);function a(){if(Ge)return;if(d===`none`){Ht(t,r);return}let e=i();e===-1&&(e=Ve.current.findIndex((e,t)=>{let r=Oe.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Ve.current[e];a!=null&&qt?.(a,r)}Ke&&(zt(),me&&i()===-1&&Z.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:de&&En==null?`${de}-hidden-input`:void 0,form:m,name:En,autoComplete:U,disabled:Ue,required:_&&!Tn,readOnly:g,value:wn,ref:Sn,style:En?Ii:Fi,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Dn]});return(0,X.jsx)(Ud.Provider,{value:Z,children:(0,X.jsx)(Wd.Provider,{value:ln,children:(0,X.jsx)(Kd.Provider,{value:Je,children:(0,X.jsx)(Gd.Provider,{value:Cn,children:(0,X.jsx)(qd.Provider,{value:rt,children:On})})})})})}var yf=`data-popup-side`,bf=`data-list-empty`,xf={...Xt,...Ke,popupSide:e=>e?{[yf]:e}:null,listEmpty:e=>e?{[bf]:``}:null};function Sf(e,t){return e??t}function Cf(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function wf(){return Xd().filteredItems.length===0}function Tf(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function Ef(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var Df=S.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,validationMode:f,validation:p}=Ye(),{labelId:m}=at(),h=Jd(),g=h.useState(`selectionMode`),_=h.useState(`disabled`),v=h.useState(`readOnly`),y=h.useState(`required`),b=h.useState(`positionerElement`),x=h.useState(`listElement`),C=h.useState(`popupId`),w=h.useState(`triggerProps`),T=h.useState(`inputInsidePopup`),E=h.useState(`id`),D=h.useState(`labelId`),O=h.useState(`open`),k=h.useState(`selectedValue`),A=h.useState(`activeIndex`),j=h.useState(`selectedIndex`),M=h.useState(`hasSelectedValue`),N=Yd(),P=Zd(),F=Er(),I=u||_||a,L=wf(),ee=Cf(h),R=S.useRef(null),B=Br(I,R);ut({id:T?o:void 0});let V=T?o??E:o,H=Sf(m,D),U;O&&T?U=C??df(E):O&&(U=x?.id);let W=S.useRef(``);function te(e){W.current=e.pointerType}let{reference:G}=Wo(N,{enabled:!O&&!v&&!_&&g===`single`,listRef:h.context.labelsRef,activeIndex:A,selectedIndex:j,onMatch(e){let t=h.context.valuesRef.current[e];t!==void 0&&h.context.setSelectedValue(t,$(Wr))}}),{reference:ne}=Ta(N,{enabled:!_,event:`mousedown`}),{buttonRef:re,getButtonProps:K}=Le({native:i,disabled:I}),q={...l,readOnly:v,open:O,disabled:I,popupSide:ee,listEmpty:L,placeholder:g===`none`?!1:!M};return z(`button`,e,{ref:[t,re,R,J(e=>{h.set(`triggerElement`,e)})],state:q,props:[w,ne,G,{id:V,tabIndex:T?0:-1,role:T?`combobox`:void 0,"aria-expanded":O,"aria-haspopup":T?`dialog`:`listbox`,"aria-controls":U,"aria-required":T&&y||void 0,"aria-readonly":T&&v||void 0,"aria-labelledby":H,onPointerDown:te,onPointerEnter:te,onFocus(){B(!0),!I&&F.start(0,h.context.forceMount)},onBlur(e){if(!Q(b,e.relatedTarget)&&(d(!0),B(!1),f===`onBlur`)){let e=g===`none`?P:k;p.commit(e)}},onMouseDown(e){if(I||(T||N.set(`domReferenceElement`,e.currentTarget),h.context.forceMount(),W.current!==`touch`&&(h.context.inputRef.current?.focus(),T||e.preventDefault()),O))return;let t=Fe(e.currentTarget);function n(e){let t=h.state.triggerElement;if(!t)return;let n=Dt(e),r=h.state.positionerElement,i=h.state.listElement;Q(t,n)||Q(r,n)||Q(i,n)||Xu(e,t)||h.context.setOpen(!1,$(oi,e))}T&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(dn(e),h.context.setOpen(!0,$(ri,e.nativeEvent)),h.context.inputRef.current?.focus())}},p.getValidationProps(I,c),K],stateAttributesMapping:xf})}),Of=S.createContext(void 0);function kf(){return S.useContext(Of)}var Af=S.createContext(void 0);function jf(e){let t=S.useContext(Af);if(t===void 0&&!e)throw Error(je(21));return t}var Mf=S.forwardRef(function(e,t){let n=Jd(),{buttonRef:r,getButtonProps:i}=Le({native:!1}),a=T(t,r);function o(e){n.context.setOpen(!1,$(Xr,e.nativeEvent,e.currentTarget))}return(0,X.jsx)(`span`,{ref:a,...i({onClick:o}),"aria-label":`Dismiss`,tabIndex:void 0,style:Ii})}),Nf=S.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,validationMode:d,validation:f}=Ye(),{labelId:p}=at(),m=kf(),h=!!jf(!0),g=Jd(),_=Zd(),v=dl(),y=g.useState(`required`),b=g.useState(`disabled`),x=g.useState(`readOnly`),C=g.useState(`name`),w=g.useState(`form`),T=g.useState(`selectionMode`),E=g.useState(`autoHighlight`),D=g.useState(`inputProps`),O=g.useState(`triggerProps`),k=g.useState(`open`),A=g.useState(`mounted`),j=g.useState(`selectedValue`),M=g.useState(`id`),N=g.useState(`inline`),P=g.useState(`modal`),F=!!E,I=Cf(g),L=l||b||i,ee=wf(),R=Br(L,g.context.inputRef),B=h||N,V=!B||P,H=rt(a??(B?void 0:M)),U=h?We:c,[W,te]=S.useState(null),G=S.useRef(!1),ne=S.useRef(null);Y(()=>{k||(ne.current=null)},[k]);let re=T===`none`&&!h,K=J(e=>{let t=h||g.state.inline;t&&!g.state.hasInputValue&&g.context.setInputValue(``,$(Wr)),g.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:re})}),q=h?s:f.getValidationProps(L,s);function ie(e){g.context.setIndices({activeIndex:null,selectedIndex:null,type:zu(e),event:e})}let ae={...U,open:k,disabled:L,readOnly:x,popupSide:I,listEmpty:ee};function oe(e){if(!m)return;let t,n=m.chipsRef.current.length,[r]=Tf(v);return e.key===r&&(e.currentTarget.selectionStart??0)===0&&j.length>0&&(e.preventDefault(),t=n>0?n-1:void 0),t}let se=z(`input`,e,{state:ae,ref:[t,g.context.inputRef,K],props:[D,O,{value:W??_,"aria-readonly":x||void 0,"aria-required":y||void 0,"aria-labelledby":p,disabled:L,readOnly:x,required:T===`none`?y:void 0,form:w,...re&&C&&{name:C},id:H,onFocus(){if(R(!0),!N)return;let e=ne.current;ne.current=null,!(e==null||!Object.hasOwn(g.context.valuesRef.current,e))&&g.context.setIndices({activeIndex:e})},onBlur(){u(!0),R(!1);let e=g.state.activeIndex;if(N&&e!==null&&E!==`always`&&(ne.current=e,g.context.setIndices({activeIndex:null})),d===`onBlur`){let e=T===`none`?_:j;f.commit(e)}},onCompositionStart(e){vt||(G.current=!0,te(e.currentTarget.value))},onCompositionEnd(e){G.current=!1;let t=e.currentTarget.value;te(null),g.context.setInputValue(t,$(Qr,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=G.current||!r;function a(e){x||L||!e||!i||(g.context.setOpen(!0,$(Qr,t)),F||ie(t))}if(G.current){let n=e.currentTarget.value;te(n),n===``&&!g.state.openOnInputClick&&!g.state.inputInsidePopup&&g.context.setOpen(!1,$($r,t));let r=n.trim(),i=F&&r!==``;a(r),k&&g.state.activeIndex!==null&&!i&&ie(t);return}let o=$(Qr,t);if(g.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=$($r,t);s&&!g.state.inputInsidePopup&&(T===`single`&&g.context.setSelectedValue(null,c),g.state.openOnInputClick||g.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),k&&g.state.activeIndex!==null&&!F&&ie(t)},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(L||x){x&&e.key===`Enter`&&k&&g.state.activeIndex!==null&&dn(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=v===`rtl`;if(e.key===`Home`){dn(e);let n=St&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){dn(e);let i=St&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!A&&e.key===`Escape`){let t=T===`multiple`&&Array.isArray(j)?j.length===0:j===null,n=$(ni,e.nativeEvent),r=T===`multiple`?[]:null;g.context.setInputValue(``,n),g.context.setSelectedValue(r,n),!t&&!g.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(m&&e.key===`Backspace`&&t.value===``&&Array.isArray(j)&&j.length>0){let t=m.chipsRef.current.length,n=t>0?t-1:j.length-1,r=j.filter((e,t)=>t!==n);ie(e.nativeEvent),g.context.setSelectedValue(r,$(Wr,e.nativeEvent));return}let i=oe(e);if(i!==void 0&&m?.chipsRef.current[i]?.focus(),e.which!==229&&e.key===`Enter`&&k){let t=g.state.activeIndex,n=e.nativeEvent;if(t===null){if(N)return;g.context.setOpen(!1,$(Wr,n));return}dn(e),Ef(g,t,n)}}},q],stateAttributesMapping:xf}),ce=h?(0,X.jsx)(Je.Provider,{value:qe,children:se}):se;return(0,X.jsxs)(S.Fragment,{children:[k&&V&&(0,X.jsx)(Mf,{ref:g.context.startDismissRef}),ce]})}),Pf={...Rt,...Yt},Ff=S.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=Ye(),u=Jd(),d=u.useState(`selectionMode`),f=u.useState(`disabled`),p=u.useState(`readOnly`),m=u.useState(`open`),h=u.useState(`selectedValue`),g=u.useState(`hasSelectionChips`),_=Zd(),v=!1;v=d===`none`?_!==``:d===`single`?h!=null:g;let y=l||f||i,{buttonRef:b,getButtonProps:x}=Le({native:a,disabled:y}),{mounted:S,transitionStatus:C,setMounted:w}=zr(v),T={disabled:y,visible:v,open:m,transitionStatus:C};Rr({open:v,ref:u.context.clearRef,onComplete(){v||w(!1)}});let E=z(`button`,e,{state:T,ref:[t,b,u.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(y||p)return;let t=zu(e);u.context.setInputValue(``,$(Zr,e.nativeEvent)),d===`none`?u.context.setIndices({activeIndex:null,type:t,event:e.nativeEvent}):(u.context.setSelectedValue(Array.isArray(h)?[]:null,$(Zr,e.nativeEvent)),u.context.setIndices({activeIndex:null,selectedIndex:null,type:t,event:e.nativeEvent})),u.context.inputRef.current?.focus()}},c,x],stateAttributesMapping:Pf});return o||S?E:null}),If=S.createContext(null);function Lf(){return S.useContext(If)}function Rf(e){let{children:t}=e,{filteredItems:n}=Xd(),r=Lf(),i=r?r.items:n;return(0,X.jsx)(S.Fragment,{children:i.map(t)})}var zf=S.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=Jd(),l=Yd(),u=!!jf(!0),{filteredItems:d,hasItems:f}=Xd(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=J(e=>{c.set(`positionerElement`,e)}),C=J(e=>{c.set(`listElement`,e)}),w=S.useMemo(()=>typeof o==`function`?n||=(0,X.jsx)(Rf,{children:o}):o,[o]),T={empty:b},E=l.useState(`floatingId`),D=z(`div`,e,{state:T,ref:[t,C,u?null:x],props:[g,{children:w,tabIndex:-1,id:E,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;dn(e),Ef(c,t,e.nativeEvent)}}},s]});if(_)return D;let O=f&&!v?void 0:c.context.labelsRef;return(0,X.jsx)(Eu,{elementsRef:c.context.listRef,labelsRef:O,children:D})}),Bf=S.createContext(void 0);function Vf(){let e=S.useContext(Bf);if(e===void 0)throw Error(je(20));return e}var Hf=S.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Jd(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,X.jsx)(Bf.Provider,{value:n,children:(0,X.jsx)(oa,{ref:t,...r})}):null}),Uf=S.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=$i,style:g,..._}=e,v=Jd(),y=Yd(),b=Vf(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=wf(),M=Tl({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});Fu(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};Y(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=J(e=>{v.set(`positionerElement`,e)}),F=kl(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,X.jsxs)(Af.Provider,{value:M,children:[C&&x&&(0,X.jsx)(bc,{inert:yc(!S),cutout:O??D??E}),F]})}),Wf={...Zt,...Rt},Gf=S.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Jd(),l=jf(),u=Yd(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=wf(),x=s.id??(g?df(y):void 0);Y(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),Rr({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let C=z(`div`,e,{state:{open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=Dt(e.nativeEvent);p!==`touch`&&(Q(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Ol(h),s],stateAttributesMapping:Wf}),w=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,T;T=o??(g?void 0:!1);let E=!g||v;return(0,X.jsx)(wa,{context:u,disabled:!d,modal:E,openInteractionType:p,initialFocus:w,returnFocus:T,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,X.jsxs)(S.Fragment,{children:[C,E&&(0,X.jsx)(Mf,{ref:c.context.endDismissRef})]})})}),Kf=S.createContext(void 0);function qf(){let e=S.useContext(Kf);if(!e)throw Error(je(19));return e}var Jf=S.createContext(!1);function Yf(){return S.useContext(Jf)}function Xf(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=S.useRef(null),m=iu({guess:!0,index:l,textRef:p}),h=Jd(),g=Yf(),_=Qd(),{props:v,id:y,selectionMode:b,disabled:x,readOnly:C,isItemEqualToValue:w}=h.useState(`itemRoot`),T=x||u,E=b!==`none`,D=l??i??m.index,O=D!==-1,k=h.useState(`isActive`,D),A=h.useState(`isSelected`,c),j=S.useRef(null),M=y!=null&&O?`${y}-${D}`:void 0,N=A&&E;Y(()=>{if(!(O&&(r||l!=null)))return;let e=h.context.listRef.current;return e[D]=j.current,()=>{delete e[D]}},[O,r,D,l,h]),Y(()=>{if(!O||_)return;let e=h.context.valuesRef.current;return e[D]=c,()=>{delete e[D]}},[O,_,D,c,h]),Y(()=>{if(!O||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=cf(D,c,h.context.valuesRef.current,e,w,t):tf(c,e,w)&&(t=D),h.set(`selectedIndex`,t)},[O,_,h,D,c,w]);let{getButtonProps:P,buttonRef:F}=Le({disabled:T,focusableWhenDisabled:!0,native:d,composite:!0}),I={disabled:T,selected:N,highlighted:k};function L(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(ot.flushSync(t),h.context.requestSubmit()):t()}let ee={id:M,role:g?`gridcell`:`option`,"aria-selected":E?N:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){T||C||L(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(T||C||e.button!==0||t||!k)&&L(e.nativeEvent)}},R=z(`div`,t,{ref:[F,n,m.ref,j],state:I,props:[v,ee,f,P]}),B=S.useMemo(()=>({selected:N,textRef:p}),[N,p]);return(0,X.jsx)(Kf.Provider,{value:B,children:R})}function Zf(e){let{componentProps:t,forwardedRef:n}=e,r=Jd().useState(`isItemEqualToValue`),{flatFilteredValues:i}=Xd();return(0,X.jsx)(Xf,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:af(i,t.value??null,r)})}var Qf=S.memo(S.forwardRef(function(e,t){let n=Jd().useState(`virtualized`);return n&&e.index==null?(0,X.jsx)(Zf,{componentProps:e,forwardedRef:t}):(0,X.jsx)(Xf,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),$f=S.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return z(`div`,e,{state:{orientation:i},ref:t,props:[{role:`presentation`},o]})});function ep(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var tp=`data-checked`,np=`data-unchecked`;function rp(e){return{checked(t){return e.indeterminate?{}:t?{[tp]:``}:{[np]:``}},...Ke}}var ip=S.createContext(void 0);function ap(){return S.useContext(ip)}var op=S.createContext(void 0);function sp(){let e=S.useContext(op);if(e===void 0)throw Error(je(14));return e}var cp=`data-parent`,lp=S.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:u=!1,inputRef:d,name:f,onCheckedChange:p,parent:m=!1,readOnly:h=!1,render:g,required:_=!1,uncheckedValue:v,value:y,nativeButton:b=!1,style:x,...C}=e,{clearErrors:w}=Ze(),{disabled:E,name:D,setDirty:O,setFilled:k,setTouched:A,state:j,validationMode:M,validityData:N,validation:P}=Ye(),F=Or(),{labelId:L,registerControlId:ee,getDescriptionProps:R}=at(),B=ap(),V=B?.allValues===void 0?void 0:B.parent,H=V!==void 0,U=E||F.disabled||B?.disabled||o,W=D??f,te=y??W,G=rt(),ne=B?.registerControlId!==ee,re=ut({id:c||void 0,enabled:ne}),q=b?re:G,ie={};H&&(m?ie=V.getParentProps():te!==void 0&&(ie=V.getChildProps(te)));let{checked:ae=n,indeterminate:oe=u,onCheckedChange:se,...ce}=ie,le=B?.value,ue=S.useRef(null),de=Br(U,ue),{getButtonProps:fe,buttonRef:pe}=Le({disabled:U,native:b}),me=B?.validation??P,[he,ge]=Kl({controlled:te!==void 0&&le!==void 0&&!m?le.includes(te):ae,default:i,name:`Checkbox`,state:`checked`}),_e=H?!!ae:he,ve=H&&oe||u;Vr(ue,G,he,void 0,!B&&!U,f);let ye=V?.registerChildId,be=S.useRef(null),xe=me.registerInput,Se=B?te:void 0,Ce=S.useCallback(e=>xe(e,{controlRef:ue,value:Se}),[xe,Se]),we=T(d,be,m?void 0:Ce),Te=st(a,L,be,!b,re,C[`aria-label`]);Y(()=>{be.current&&(be.current.indeterminate=ve),B||k(he)},[he,ve,B,k]),Hr(he,()=>{B||(w(W),O(he!==N.initialValue),me.change(he))});let Ee=l({checked:he,disabled:U,form:s,name:m?void 0:W,id:b?void 0:re,required:_,ref:we,style:W?Ii:Fi,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(h){e.preventDefault();return}let t=e.currentTarget.checked,n=$(Wr,e.nativeEvent);if(p?.(t,n),!n.isCanceled&&(se?.(t,n),!n.isCanceled&&(ge(t),te!==void 0&&B!==void 0&&!m&&!H))){let e=t?[...B.value,te]:B.value.filter(e=>e!==te);B.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){ue.current?.focus()}},y===void 0?I:{value:(B?he&&y:y)||``},R,e=>me.getValidationProps(U,e));S.useEffect(()=>{if(!V||te===void 0)return;let e=V.disabledStatesRef.current;return e.set(te,U),()=>{e.delete(te)}},[V,U,te]);let De=S.useMemo(()=>({...j,checked:_e,disabled:U,readOnly:h,required:_,indeterminate:ve}),[j,_e,U,h,_,ve]),J=rp(De),Oe=z(`span`,e,{state:De,ref:[pe,ue,t],props:[{id:q,role:`checkbox`,"aria-checked":ve?`mixed`:_e,"aria-readonly":h||void 0,"aria-required":_||void 0,"aria-labelledby":Te,[cp]:m?``:void 0,onFocus(){de(!0)},onBlur(){let e=be.current;e&&(A(!0),de(!1),M===`onBlur`&&me.commit(B?le:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=be.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),K(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||ep(t)?.click()})},onClick(e){if(h||U)return;e.preventDefault();let t=be.current;t&&Ie(t,e)}},C,ce,fe,R,e=>me.getValidationProps(U,e)],stateAttributesMapping:J}),ke=Oe.props.id;return Y(()=>{if(!(!ye||m||te===void 0||ke===void 0))return ye(te,ke)},[ye,m,te,ke]),(0,X.jsxs)(op.Provider,{value:De,children:[Oe,!he&&!B&&W&&!m&&v!==void 0&&(0,X.jsx)(`input`,{type:`hidden`,form:s,name:W,value:v,disabled:U}),(0,X.jsx)(`input`,{...Ee,suppressHydrationWarning:!0})]})}),up=S.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=sp(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:d}=zr(c),f=S.useRef(null),p={...s,transitionStatus:u};Rr({batch:!0,enabled:!c,open:c,ref:f,onComplete(){c||d(!1)}});let m={...rp(s),...Rt},h=a||l,g=z(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:m,props:o});return h?g:null});function dp(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,X.jsx)(vf,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}var fp=S.memo(S.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=S.useRef(null),{transitionStatus:l,setMounted:u}=zr(o),d=z(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:Rt});return Rr({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),pp=S.forwardRef(function(e,t){let{selected:n}=qf();return e.keepMounted||n?(0,X.jsx)(fp,{...e,selected:n,ref:t}):null});function mp(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var hp=`base-ui-disable-scrollbar`,gp={className:hp,getElement(e){return(0,X.jsx)(`style`,{nonce:e,href:hp,precedence:`base-ui:low`,children:`.${hp}{scrollbar-width:none}.${hp}::-webkit-scrollbar{display:none}`})}};function _p(e,t){return Math.max(0,e-t)}function vp(e,t){if(t<=0)return 0;let n=mp(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}var yp=S.createContext(void 0),bp=S.createContext(void 0);function xp(){let e=S.useContext(yp);if(e===void 0)throw Error(je(60));return e}function Sp(){let e=S.useContext(bp);if(e===void 0)throw Error(je(61));return e}var Cp={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:md(t,r)!==``},hasNullItemLabel:(e,t)=>t?fd(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>tf(t,e,n)):tf(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function wp(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:u,autoComplete:d,disabled:f=!1,readOnly:p=!1,required:m=!1,modal:h=!0,actionsRef:g,inputRef:_,onOpenChangeComplete:v,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:C,isItemEqualToValue:E=ef,highlightItemOnHover:D=!0,children:O}=e,{clearErrors:k}=Ze(),{setDirty:A,setTouched:j,setFocused:M,validityData:N,setFilled:L,name:ee,disabled:R,validation:z,validationMode:B}=Ye(),V=ut({id:t}),H=R||f,U=ee??c,[W,te]=Kl({controlled:n,default:b?r??F:r,name:`Select`,state:`value`}),[G,ne]=Kl({controlled:a,default:o,name:`Select`,state:`open`}),re=S.useRef([]),K=S.useRef([]),q=S.useRef(null),ie=S.useRef(null),ae=S.useRef(0),oe=S.useRef(null),se=S.useRef([]),ce=S.useRef(!1),le=S.useRef(null),ue=S.useRef(null),de=S.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),fe=S.useRef(!1),pe=S.useRef(W),{openMethod:me,triggerProps:he}=Uc(G),ge=w(()=>new ho({id:V,labelId:void 0,modal:h,multiple:b,disabled:H,readOnly:p,required:m,highlightItemOnHover:D,itemToStringLabel:x,itemToStringValue:C,isItemEqualToValue:E,value:W,open:G,mounted:G,transitionStatus:void 0,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:I,triggerProps:I,itemRoot:{props:I,multiple:b,disabled:H,readOnly:p,isItemEqualToValue:E},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:P,setOpen:P,handleScrollArrowVisibility:P,onOpenChangeComplete:P,listRef:re,popupRef:q,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:oe,valuesRef:se,labelsRef:K,typingRef:ce,selectionRef:de,firstItemTextRef:le,selectedItemTextRef:ue,alignItemWithTriggerActiveRef:fe,initialValueRef:pe},Cp)).current,[_e,ve]=S.useState(!1),{mounted:ye,transitionStatus:be,forceUnmount:xe}=Na({open:G,ref:q,preventUnmountOnClose:_e,setPreventUnmountOnClose:ve,onUnmount(){ge.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)}}),Se=ge.useState(`activeIndex`),Ce=ge.useState(`selectedIndex`),we=ge.useState(`triggerElement`),Te=ge.useState(`positionerElement`),Ee=Pl(me),De=me??Ee,Oe=S.useMemo(()=>b?``:md(W,C),[b,W,C]),ke=S.useMemo(()=>b&&Array.isArray(W)?W.map(e=>md(e,C)):md(W,C),[b,W,C]);Vr(Mi(we),V,W,J(()=>ke),!H,c);let Ae=b?Array.isArray(W)&&W.length>0:W!=null&&Oe!==``;Y(()=>{L(Ae)},[Ae,L]),Y(function(){let e=sf(se.current,W,E,b);e===null&&(ue.current=null),!G&&ge.set(`selectedIndex`,e)},[b,G,W,E,ge]),Hr(W,()=>{k(U),A(nf(W,N.initialValue,E)),z.change(W)});let je=J((e,t)=>{let n=t,r=Va(n);s?.(e,n),!t.isCanceled&&(e||ve(r()),ne(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(j(!0),M(!1),B===`onBlur`&&z.commit(W)))});S.useImperativeHandle(g,()=>({unmount:xe,close:()=>{ge.state.open&&je(!1,$(di))}}),[xe,je,ge]);let Me=J((e,t)=>{i?.(e,t),!t.isCanceled&&te(e)}),Ne=J(e=>{let t=_p(e.scrollHeight,e.clientHeight),n=vp(e.scrollTop,t),r=n>0,i=n<t;ge.set(`scrollUpArrowVisible`,r),ge.set(`scrollDownArrowVisible`,i)}),Pe=Eo({open:G,onOpenChange:je,elements:{reference:we,floating:Te}}),Fe=Ta(Pe,{enabled:!H,event:`mousedown`}),Ie=ja(Pe),Le=Uo(Pe,{enabled:!H,listRef:re,activeIndex:Se,selectedIndex:Ce,disabledIndices:F,onNavigate(e){e===null&&!G||ge.set(`activeIndex`,e)},focusItemOnHover:D}),Re=Wo(Pe,{enabled:!H&&(G||!p&&!b),listRef:K,activeIndex:Se,selectedIndex:Ce,disabledIndices:e=>od(re.current[e]),onMatch(e){G?ge.set(`activeIndex`,e):Me(se.current[e],$(Wr))},onTyping(e){ce.current=e}}),ze=S.useMemo(()=>l(Re.reference,Le.reference,Ie.reference,Fe.reference,he),[Fe.reference,Re.reference,Le.reference,Ie.reference,he]),Be=S.useMemo(()=>l(Pa,Re.floating,Le.floating,Ie.floating),[Re.floating,Le.floating,Ie.floating]),Ve=Le.item??I,He=S.useMemo(()=>({props:Ve,multiple:b,disabled:H,readOnly:p,isItemEqualToValue:E}),[Ve,b,H,p,E]);ge.useContextCallback(`setValue`,Me),ge.useContextCallback(`setOpen`,je),ge.useContextCallback(`handleScrollArrowVisibility`,Ne),ge.useContextCallback(`onOpenChangeComplete`,v),Vd(()=>{ge.update({popupProps:Be,triggerProps:ze,itemRoot:He})}),ge.useSyncedValues({id:V,modal:h,multiple:b,disabled:H,readOnly:p,required:m,highlightItemOnHover:D,value:W,open:G,mounted:ye,transitionStatus:be,popupProps:Be,triggerProps:ze,itemRoot:He,items:y,itemToStringLabel:x,itemToStringValue:C,isItemEqualToValue:E,openMethod:De});let Ue=T(_,z.inputRef),We=b?void 0:U,Ge=S.useMemo(()=>!b||!Array.isArray(W)||!U?null:W.map(e=>{let t=md(e,C);return(0,X.jsx)(`input`,{type:`hidden`,form:u,name:U,value:t,disabled:H},t)}),[b,W,u,U,C,H]);return(0,X.jsxs)(yp.Provider,{value:ge,children:[(0,X.jsx)(bp.Provider,{value:Pe,children:O}),(0,X.jsx)(`input`,{...z.getValidationProps(H,{onFocus(){ge.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||H||p)return;let t=e.currentTarget.value,n=$(Wr,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=se.current.findIndex(t=>md(t,C).toLowerCase()===e||pd(t,x).toLowerCase()===e);r===-1&&(r=se.current.findIndex((t,n)=>{let r=K.current[n];return r!=null&&r.toLowerCase()===e}));let i=se.current[r];i!=null&&Me(i,n)}ge.set(`forceMount`,!0),queueMicrotask(r)}}),id:V&&We==null?`${V}-hidden-input`:void 0,form:u,name:We,autoComplete:d,value:Oe,disabled:H,required:m&&!(b&&Ae),readOnly:p,ref:Ue,style:U?Ii:Fi,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ge]})}var Tp=`data-popup-side`,Ep=400,Dp={...Xt,...Ke,popupSide:e=>e?{[Tp]:e}:null,value:()=>null},Op=S.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:u,validationMode:d,validation:f,state:p,disabled:m}=Ye(),{labelId:h}=at(),g=xp(),_=g.useState(`readOnly`),v=g.useState(`required`),y=g.useState(`disabled`),b=m||y||a,x=g.useState(`open`),C=g.useState(`mounted`),w=g.useState(`value`),T=g.useState(`triggerProps`),E=g.useState(`positionerElement`),D=g.useState(`listElement`),O=g.useState(`popupSide`),k=g.useState(`id`),A=g.useState(`labelId`),j=g.useState(`hasSelectedValue`),M=C&&E?O:null,N=i??k,P=Sf(h,A);ut({id:i});let F=Mi(E),I=S.useRef(null),L=Br(b,I),{getButtonProps:ee,buttonRef:R}=Le({disabled:b,native:o}),B=g.useStateSetter(`triggerElement`),V=Er(),H=Er(),U=Er();S.useEffect(()=>{if(x)return U.start(Ep,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{U.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},H.clear()},[x,g,H,U]);let W=l(T,{id:N,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?D?.id??cn(E)?.id:void 0,"aria-labelledby":P,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){L(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,$(Wr,e.nativeEvent)),V.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){Q(E,e.relatedTarget)||(u(!0),L(!1),d===`onBlur`&&f.commit(w))},onMouseDown(e){if(x)return;let t=Fe(e.currentTarget);function n(e){if(!I.current)return;let t=e.target;Q(I.current,t)||Q(F.current,t)||Xu(e,I.current)||g.context.setOpen(!1,$(oi,e))}H.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,ee),te=f.getValidationProps(b,W);te.role=`combobox`;let G={...p,open:x,disabled:b,value:w,readOnly:_,popupSide:M,placeholder:!j};return z(`button`,e,{ref:[t,I,R,B],state:G,stateAttributesMapping:Dp,props:te})}),kp={value:()=>null},Ap=S.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=xp(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?gd(l,u,d):hd(l,u,d)),z(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:kp})}),jp=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return z(`span`,e,{state:{open:xp().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Yt})}),Mp=S.forwardRef(function(e,t){let n=xp(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,X.jsx)(oa,{ref:t,...e}):null}),Np=S.createContext(void 0);function Pp(){let e=S.useContext(Np);if(!e)throw Error(je(59));return e}function Fp(e,t){e&&Object.assign(e.style,t)}var Ip={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},Lp={position:`fixed`},Rp=S.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=$i,style:_,...v}=e,y=xp(),b=Sp(),x=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`modal`),T=y.useState(`value`),E=y.useState(`openMethod`),D=y.useState(`positionerElement`),O=y.useState(`triggerElement`),k=y.useState(`isItemEqualToValue`),A=y.useState(`transitionStatus`),j=S.useRef(null),M=S.useRef(null),[N,P]=S.useState(h),F=C&&N&&E!==`touch`;!C&&N!==h&&P(h),S.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>F),Fu((F||w)&&x,E===`touch`,D,O);let I=Tl({anchor:n,floatingRootContext:b,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??F,collisionAvoidance:g,keepMounted:!0}),L=F?`none`:I.side,ee=F?Lp:I.positionerStyles,R={open:x,side:L,align:I.align,anchorHidden:I.anchorHidden};Y(()=>{y.set(`popupSide`,I.side)},[y,I.side]);let z=kl(e,R,{styles:ee,transitionStatus:A,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!x}),B=S.useRef(0),V=J(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=$(Wr);if(t!==0&&!y.state.multiple&&T!==null&&af(y.context.valuesRef.current,T,k)===-1){let e=y.context.initialValueRef.current,t=e!=null&&af(y.context.valuesRef.current,e,k)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(T)){let e=T.filter(e=>af(y.context.valuesRef.current,e,k)!==-1);e.length!==T.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&F){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};Fp(D,e),Fp(y.context.popupRef.current,e)}}),H=S.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,X.jsx)(Eu,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:V,children:(0,X.jsxs)(Np.Provider,{value:H,children:[C&&w&&(0,X.jsx)(bc,{inert:yc(!x),cutout:O}),z]})})}),zp=`--transform-origin`,Bp={...Zt,...Rt},Vp=S.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=xp(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=Sp(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=Pp(),_=pu(!0)!=null,v=dl(),{nonce:y,disableStyleElements:b}=Md(),x=s.useState(`id`),C=s.useState(`open`),w=s.useState(`openMethod`),T=s.useState(`mounted`),E=s.useState(`popupProps`),D=s.useState(`transitionStatus`),O=s.useState(`triggerElement`),k=s.useState(`positionerElement`),A=s.useState(`listElement`),j=S.useRef(!1),M=S.useRef(!1),N=S.useRef({}),P=Mr(),F=J(e=>{if(!k||!s.context.popupRef.current||!M.current)return;let t=k.style.top===`0px`,n=k.style.bottom===`0px`;if(j.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=Wp(k),i=Gp(k.getBoundingClientRect().height,`y`,r),a=Fe(k),o=K(k),c=o.getComputedStyle(k),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=Hp(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=Up(e),g=null,_=e=>{k.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=mp(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(j.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=mp(g,0,Up(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(j.current=!0),s.context.handleScrollArrowVisibility(e)});S.useImperativeHandle(s.context.scrollHandlerRef,()=>F,[F]),Rr({open:C,ref:s.context.popupRef,onComplete(){C&&s.context.onOpenChangeComplete(!0)}});let I={open:C,transitionStatus:D,side:f,align:p};Y(()=>{!k||!s.context.popupRef.current||Object.keys(N.current).length||(N.current={top:k.style.top||`0`,left:k.style.left||`0`,right:k.style.right,height:k.style.height,bottom:k.style.bottom,minHeight:k.style.minHeight,maxHeight:k.style.maxHeight,marginTop:k.style.marginTop,marginBottom:k.style.marginBottom})},[s,k]),Y(()=>{C||m||(M.current=!1,j.current=!1,Fp(k,N.current))},[C,m,k]),Y(()=>{let e=s.context.popupRef.current;if(!C||!O||!k||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(M.current=!0,e.style.removeProperty(zp),!m){P.request(()=>s.context.handleScrollArrowVisibility(A||e));return}let t=Jp(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=K(k),i=r.getComputedStyle(k),a=r.getComputedStyle(e),o=Fe(O),c=Wp(O),l=Kp(O.getBoundingClientRect(),c),d=Kp(k.getBoundingClientRect(),c),f=l.height,p=A||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Hp(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,D=0;if(t&&n){let e=Kp(n.getBoundingClientRect(),c);T=Kp(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-d.top+T.height/2-r}let M=w+D+y+h,P=Math.min(S,M),F=S-_-y,I=M-P,L=C-5;k.style.left=`${mp(E,5,L-d.width)}px`,k.style.height=`${P}px`,k.style.maxHeight=`none`,k.style.marginTop=`${_}px`,k.style.marginBottom=`${y}px`,e.style.height=`100%`;let ee=Up(p),R=I>=ee-1;R&&(P=Math.min(S,d.height)-(I-ee));let z=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),B=(r.visualViewport?.scale??1)!==1&&xt;if(z||B){Fp(k,N.current),g(!1);return}let V=Math.max(b,P);if(R){let e=Math.max(0,S-M);k.style.top=d.height>=F?`0`:`${e}px`,k.style.height=`${P}px`,p.scrollTop=Up(p)}else k.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=mp(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(zp,`50% ${i}%`)}(V===S||P>=x)&&(j.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,C,k,O,m,g,P,A,u,v,h]),S.useEffect(()=>{if(!m||!k||!C)return;let e=K(k);function t(e){s.context.setOpen(!1,$(fi,e))}return Ai(e,`resize`,t)},[s,m,k,C]);let L={...A?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&cc.has(e.key)&&e.stopPropagation()},onScroll(e){A||F(e.currentTarget)},...m&&{style:A?{height:`100%`}:Ip},className:!A&&m?gp.className:void 0},ee=z(`div`,e,{ref:[t,s.context.popupRef],state:I,stateAttributesMapping:Bp,props:[E,L,Ol(D),o]});return(0,X.jsxs)(S.Fragment,{children:[!b&&gp.getElement(y),(0,X.jsx)(wa,{context:d,modal:!1,disabled:!T,openInteractionType:w,returnFocus:a,restoreFocus:!0,children:ee})]})});function Hp(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Up(e){return _p(e.scrollHeight,e.clientHeight)}function Wp(e){return Fs.getScale(e)}function Gp(e,t,n){return e/n[t]}function Kp(e,t){return Un({x:Gp(e.x,`x`,t),y:Gp(e.y,`y`,t),width:Gp(e.width,`x`,t),height:Gp(e.height,`y`,t)})}var qp=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Jp(e){let{style:t}=e,n={};for(let[e,r]of qp)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of qp){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Yp=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=xp(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=Pp(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:Ip},className:u&&d!==`touch`?gp.className:void 0};return z(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),Xp=S.createContext(void 0);function Zp(){let e=S.useContext(Xp);if(!e)throw Error(je(57));return e}var Qp=S.memo(S.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=S.useRef(null),d=iu({guess:!0,label:o,textRef:u}),f=xp(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),C=f.useState(`isSelectedByFocus`,d.index),w=d.index,T=S.useRef(null);Y(()=>{let e=f.context.valuesRef.current;return e[w]=a,()=>{delete e[w]}},[w,a,f]),Y(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=cf(w,a,f.context.valuesRef.current,e,_,t),r=n===w,w===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&tf(a,e,_),r&&(n=w)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[w,m,_,f,a]);let E=S.useRef(`mouse`),D=S.useRef(!1),{getButtonProps:O,buttonRef:k}=Le({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),A={disabled:v,selected:x,highlighted:y};function j(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?lf(n,a,_):[...n,a];f.context.setValue(r,$(Yr,e))}else f.context.setValue(a,$(Yr,e)),f.context.setOpen(!1,$(Yr,e))}function M(){f.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,w),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&pn(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!D.current;D.current=!1,!(v||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),v||E.current===`touch`||D.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},P=z(`div`,e,{ref:[k,t,d.ref,T],state:A,props:[p,N,l,O]}),F=S.useMemo(()=>({selected:x,index:w,textRef:u,selectedByFocus:C}),[x,w,u,C]);return(0,X.jsx)(Xp.Provider,{value:F,children:P})})),$p=S.forwardRef(function(e,t){let{selected:n}=Zp();return e.keepMounted||n?(0,X.jsx)(fp,{...e,selected:n,ref:t}):null}),em=S.memo(S.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=Zp(),a=xp(),{render:o,className:s,style:c,...l}=e;return z(`div`,e,{ref:[S.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),tm=S.createContext(void 0);function nm(){let e=S.useContext(tm);if(e===void 0)throw Error(je(56));return e}var rm=S.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=S.useState(),c=S.useMemo(()=>({labelId:o,setLabelId:s}),[o,s]),l=z(`div`,e,{ref:t,props:[{role:`group`,"aria-labelledby":o},a]});return(0,X.jsx)(tm.Provider,{value:c,children:l})}),im=S.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=nm(),c=rt(a);return Y(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),z(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),am=$f;export{yi as $,Cd as A,Rl as B,zf as C,Bd as D,Df as E,Su as F,ol as G,Ml as H,du as I,Bc as J,nl as K,lu as L,Ju as M,Iu as N,Fd as O,Tu as P,bi as Q,cu as R,Hf as S,Nf as T,jl as U,Nl as V,Al as W,xc as X,zc as Y,vc as Z,up as _,$p as a,l as at,Gf as b,Vp as c,jp as d,vi as et,Ap as f,dp as g,pp as h,em as i,G as it,rd as j,kd as k,Rp as l,wp as m,im as n,mi as nt,Qp as o,o as ot,Op as p,Xc as q,rm as r,Be as rt,Yp as s,i as st,am as t,hi as tt,Mp as u,lp as v,Ff as w,Uf as x,Qf as y,zl as z};
|