brd-ui-kit 0.1.83 → 0.1.84
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/dist/{calendar-Cf3VkgyX.js → calendar-B78l3uF9.js} +2 -2
- package/dist/{calendar-Cf3VkgyX.js.map → calendar-B78l3uF9.js.map} +1 -1
- package/dist/calendar-BClkfQSD.cjs +2 -0
- package/dist/{calendar-DvDG9hIB.cjs.map → calendar-BClkfQSD.cjs.map} +1 -1
- package/dist/{calendar-locale-Br6M-e1P.cjs → calendar-locale-CbU8VmD3.cjs} +2 -2
- package/dist/{calendar-locale-Br6M-e1P.cjs.map → calendar-locale-CbU8VmD3.cjs.map} +1 -1
- package/dist/{calendar-locale-DivjTEYg.js → calendar-locale-CtuBfQOO.js} +2 -2
- package/dist/{calendar-locale-DivjTEYg.js.map → calendar-locale-CtuBfQOO.js.map} +1 -1
- package/dist/components/icons/ArrowCounterClockwise.d.ts +1 -1
- package/dist/components/icons/BoundingBox.d.ts +1 -1
- package/dist/components/icons/Briefcase.d.ts +1 -1
- package/dist/components/icons/Building.d.ts +1 -1
- package/dist/components/icons/Buildings.d.ts +1 -1
- package/dist/components/icons/CaretDown.d.ts +1 -1
- package/dist/components/icons/CaretLeft.d.ts +1 -1
- package/dist/components/icons/CaretRight.d.ts +1 -1
- package/dist/components/icons/CaretUp.d.ts +1 -1
- package/dist/components/icons/CaretUpDown.d.ts +1 -1
- package/dist/components/icons/ChartLine.d.ts +1 -1
- package/dist/components/icons/Check.d.ts +1 -1
- package/dist/components/icons/CheckCircle.d.ts +1 -1
- package/dist/components/icons/Clock.d.ts +1 -1
- package/dist/components/icons/CreditCard.d.ts +1 -1
- package/dist/components/icons/DotsThree.d.ts +1 -1
- package/dist/components/icons/DownloadSimple.d.ts +1 -1
- package/dist/components/icons/EnvelopeSimple.d.ts +1 -1
- package/dist/components/icons/Eye.d.ts +1 -1
- package/dist/components/icons/EyeSlash.d.ts +1 -1
- package/dist/components/icons/FileText.d.ts +1 -1
- package/dist/components/icons/Folder.d.ts +1 -1
- package/dist/components/icons/Funnel.d.ts +1 -1
- package/dist/components/icons/Gear.d.ts +1 -1
- package/dist/components/icons/Info.d.ts +1 -1
- package/dist/components/icons/LockKey.d.ts +1 -1
- package/dist/components/icons/MagnifyingGlass.d.ts +1 -1
- package/dist/components/icons/MaxLogo.d.ts +1 -1
- package/dist/components/icons/Package.d.ts +1 -1
- package/dist/components/icons/Pencil.d.ts +1 -1
- package/dist/components/icons/Phone.d.ts +1 -1
- package/dist/components/icons/Plus.d.ts +1 -1
- package/dist/components/icons/PresentationChart.d.ts +1 -1
- package/dist/components/icons/SpinnerGap.d.ts +1 -1
- package/dist/components/icons/TelegramLogo.d.ts +1 -1
- package/dist/components/icons/Trash.d.ts +1 -1
- package/dist/components/icons/UserCircleGear.d.ts +1 -1
- package/dist/components/icons/Users.d.ts +1 -1
- package/dist/components/icons/UsersFour.d.ts +1 -1
- package/dist/components/icons/Warning.d.ts +1 -1
- package/dist/components/icons/WarningCircle.d.ts +1 -1
- package/dist/components/icons/WhatsAppLogoFilled.d.ts +1 -1
- package/dist/components/icons/Wrench.d.ts +1 -1
- package/dist/components/icons/X.d.ts +1 -1
- package/dist/components/icons/XCircle.d.ts +1 -1
- package/dist/components/icons/index.d.ts +46 -46
- package/dist/components/icons/stroke-icon.d.ts +1 -1
- package/dist/components/ui/icon/icon-map.d.ts +1 -1
- package/dist/components/ui/icon/icon.d.ts +2 -2
- package/dist/components-app-pagination-app-pagination.cjs +1 -1
- package/dist/components-app-pagination-app-pagination.cjs.map +1 -1
- package/dist/components-app-pagination-app-pagination.js +2 -2
- package/dist/components-app-sidebar-app-sidebar.cjs +1 -1
- package/dist/components-app-sidebar-app-sidebar.cjs.map +1 -1
- package/dist/components-app-sidebar-app-sidebar.js +1 -1
- package/dist/components-approval-log-approval-log.cjs +1 -1
- package/dist/components-approval-log-approval-log.cjs.map +1 -1
- package/dist/components-approval-log-approval-log.js +21 -21
- package/dist/components-avatar-uploader-avatar-uploader.cjs +1 -1
- package/dist/components-avatar-uploader-avatar-uploader.cjs.map +1 -1
- package/dist/components-avatar-uploader-avatar-uploader.js +21 -21
- package/dist/components-basic-avatar-basic-avatar.cjs +1 -1
- package/dist/components-basic-avatar-basic-avatar.cjs.map +1 -1
- package/dist/components-basic-avatar-basic-avatar.js +21 -21
- package/dist/components-checkbox-group-checkbox-group.cjs +1 -1
- package/dist/components-checkbox-group-checkbox-group.cjs.map +1 -1
- package/dist/components-checkbox-group-checkbox-group.js +21 -21
- package/dist/components-data-table-data-table-actions-column.cjs +1 -1
- package/dist/components-data-table-data-table-actions-column.cjs.map +1 -1
- package/dist/components-data-table-data-table-actions-column.js +1 -1
- package/dist/components-data-table-data-table-column-visibility.cjs +1 -1
- package/dist/components-data-table-data-table-column-visibility.cjs.map +1 -1
- package/dist/components-data-table-data-table-column-visibility.js +1 -1
- package/dist/components-data-table-data-table-row-actions-column.cjs +1 -1
- package/dist/components-data-table-data-table-row-actions-column.cjs.map +1 -1
- package/dist/components-data-table-data-table-row-actions-column.js +1 -1
- package/dist/components-files-uploader-files-uploader.cjs +1 -1
- package/dist/components-files-uploader-files-uploader.cjs.map +1 -1
- package/dist/components-files-uploader-files-uploader.js +3 -3
- package/dist/components-icons-ArrowCounterClockwise.cjs +1 -1
- package/dist/components-icons-ArrowCounterClockwise.js +1 -1
- package/dist/components-icons-BoundingBox.cjs +1 -1
- package/dist/components-icons-BoundingBox.js +1 -1
- package/dist/components-icons-Briefcase.cjs +1 -1
- package/dist/components-icons-Briefcase.js +1 -1
- package/dist/components-icons-Building.cjs +1 -1
- package/dist/components-icons-Building.js +1 -1
- package/dist/components-icons-Buildings.cjs +1 -1
- package/dist/components-icons-Buildings.js +1 -1
- package/dist/components-icons-CaretDown.cjs +1 -1
- package/dist/components-icons-CaretDown.js +1 -1
- package/dist/components-icons-CaretLeft.cjs +1 -1
- package/dist/components-icons-CaretLeft.js +1 -1
- package/dist/components-icons-CaretRight.cjs +1 -1
- package/dist/components-icons-CaretRight.js +1 -1
- package/dist/components-icons-CaretUp.cjs +1 -1
- package/dist/components-icons-CaretUp.js +1 -1
- package/dist/components-icons-CaretUpDown.cjs +1 -1
- package/dist/components-icons-CaretUpDown.js +1 -1
- package/dist/components-icons-ChartLine.cjs +1 -1
- package/dist/components-icons-ChartLine.js +1 -1
- package/dist/components-icons-Check.cjs +1 -1
- package/dist/components-icons-Check.js +1 -1
- package/dist/components-icons-CheckCircle.cjs +1 -1
- package/dist/components-icons-CheckCircle.js +1 -1
- package/dist/components-icons-Clock.cjs +1 -1
- package/dist/components-icons-Clock.js +1 -1
- package/dist/components-icons-CreditCard.cjs +1 -1
- package/dist/components-icons-CreditCard.js +1 -1
- package/dist/components-icons-DotsThree.cjs +1 -1
- package/dist/components-icons-DotsThree.js +1 -1
- package/dist/components-icons-DownloadSimple.cjs +1 -1
- package/dist/components-icons-DownloadSimple.js +1 -1
- package/dist/components-icons-EnvelopeSimple.cjs +1 -1
- package/dist/components-icons-EnvelopeSimple.js +1 -1
- package/dist/components-icons-Eye.cjs +1 -1
- package/dist/components-icons-Eye.js +1 -1
- package/dist/components-icons-EyeSlash.cjs +1 -1
- package/dist/components-icons-EyeSlash.js +1 -1
- package/dist/components-icons-FileText.cjs +1 -1
- package/dist/components-icons-FileText.js +1 -1
- package/dist/components-icons-Folder.cjs +1 -1
- package/dist/components-icons-Folder.js +1 -1
- package/dist/components-icons-Funnel.cjs +1 -1
- package/dist/components-icons-Funnel.js +1 -1
- package/dist/components-icons-Gear.cjs +1 -1
- package/dist/components-icons-Gear.js +1 -1
- package/dist/components-icons-Info.cjs +1 -1
- package/dist/components-icons-Info.js +1 -1
- package/dist/components-icons-LockKey.cjs +1 -1
- package/dist/components-icons-LockKey.js +1 -1
- package/dist/components-icons-MagnifyingGlass.cjs +1 -1
- package/dist/components-icons-MagnifyingGlass.js +1 -1
- package/dist/components-icons-MaxLogo.cjs +1 -1
- package/dist/components-icons-MaxLogo.js +1 -1
- package/dist/components-icons-Package.cjs +1 -1
- package/dist/components-icons-Package.js +1 -1
- package/dist/components-icons-Pencil.cjs +1 -1
- package/dist/components-icons-Pencil.js +1 -1
- package/dist/components-icons-Phone.cjs +1 -1
- package/dist/components-icons-Phone.js +1 -1
- package/dist/components-icons-Plus.cjs +1 -1
- package/dist/components-icons-Plus.js +1 -1
- package/dist/components-icons-PresentationChart.cjs +1 -1
- package/dist/components-icons-PresentationChart.js +1 -1
- package/dist/components-icons-SpinnerGap.cjs +1 -1
- package/dist/components-icons-SpinnerGap.js +1 -1
- package/dist/components-icons-TelegramLogo.cjs +1 -1
- package/dist/components-icons-TelegramLogo.js +1 -1
- package/dist/components-icons-Trash.cjs +1 -1
- package/dist/components-icons-Trash.js +1 -1
- package/dist/components-icons-UserCircleGear.cjs +1 -1
- package/dist/components-icons-UserCircleGear.js +1 -1
- package/dist/components-icons-Users.cjs +1 -1
- package/dist/components-icons-Users.js +1 -1
- package/dist/components-icons-UsersFour.cjs +1 -1
- package/dist/components-icons-UsersFour.js +1 -1
- package/dist/components-icons-Warning.cjs +1 -1
- package/dist/components-icons-Warning.js +1 -1
- package/dist/components-icons-WarningCircle.cjs +1 -1
- package/dist/components-icons-WarningCircle.js +1 -1
- package/dist/components-icons-WhatsAppLogoFilled.cjs +1 -1
- package/dist/components-icons-WhatsAppLogoFilled.js +1 -1
- package/dist/components-icons-Wrench.cjs +1 -1
- package/dist/components-icons-Wrench.js +1 -1
- package/dist/components-icons-X.cjs +1 -1
- package/dist/components-icons-X.js +1 -1
- package/dist/components-icons-XCircle.cjs +1 -1
- package/dist/components-icons-XCircle.js +1 -1
- package/dist/components-icons-stroke-icon.cjs.map +1 -1
- package/dist/components-icons-stroke-icon.js.map +1 -1
- package/dist/components-icons.cjs +1 -1
- package/dist/components-icons.js +45 -45
- package/dist/components-input-contact-input-contact.cjs +1 -1
- package/dist/components-input-contact-input-contact.cjs.map +1 -1
- package/dist/components-input-contact-input-contact.js +21 -21
- package/dist/components-input-password-input-password.cjs +1 -1
- package/dist/components-input-password-input-password.cjs.map +1 -1
- package/dist/components-input-password-input-password.js +2 -2
- package/dist/components-story-drawer-story-drawer.cjs +1 -1
- package/dist/components-story-drawer-story-drawer.cjs.map +1 -1
- package/dist/components-story-drawer-story-drawer.js +21 -21
- package/dist/components-transfer-list-transfer-list-card.cjs +1 -1
- package/dist/components-transfer-list-transfer-list-card.cjs.map +1 -1
- package/dist/components-transfer-list-transfer-list-card.js +1 -1
- package/dist/components-transfer-list-transfer-list.cjs +1 -1
- package/dist/components-transfer-list-transfer-list.cjs.map +1 -1
- package/dist/components-transfer-list-transfer-list.js +1 -1
- package/dist/components-ui-calendar-calendar.cjs +1 -1
- package/dist/components-ui-calendar-calendar.js +2 -2
- package/dist/components-ui-calendar.cjs +1 -1
- package/dist/components-ui-calendar.js +2 -2
- package/dist/components-ui-checkbox-checkbox.cjs +1 -1
- package/dist/components-ui-checkbox-checkbox.cjs.map +1 -1
- package/dist/components-ui-checkbox-checkbox.js +1 -1
- package/dist/components-ui-combobox-combobox.cjs +1 -1
- package/dist/components-ui-combobox-combobox.cjs.map +1 -1
- package/dist/components-ui-combobox-combobox.js +1 -1
- package/dist/components-ui-dialog-dialog.cjs +1 -1
- package/dist/components-ui-dialog-dialog.cjs.map +1 -1
- package/dist/components-ui-dialog-dialog.js +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.cjs.map +1 -1
- package/dist/components-ui-dropdown-menu-dropdown-menu.js +1 -1
- package/dist/components-ui-icon-icon-map.cjs +1 -1
- package/dist/components-ui-icon-icon-map.cjs.map +1 -1
- package/dist/components-ui-icon-icon-map.js +1 -1
- package/dist/components-ui-icon-icon-map.js.map +1 -1
- package/dist/components-ui-icon-icon.cjs +1 -1
- package/dist/components-ui-icon-icon.cjs.map +1 -1
- package/dist/components-ui-icon-icon.js +23 -23
- package/dist/components-ui-icon-icon.js.map +1 -1
- package/dist/components-ui-pagination-pagination.cjs +1 -1
- package/dist/components-ui-pagination-pagination.cjs.map +1 -1
- package/dist/components-ui-pagination-pagination.js +3 -3
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs +1 -1
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.cjs.map +1 -1
- package/dist/components-ui-select-calendar-menu-select-calendar-menu.js +2 -2
- package/dist/components-ui-select-select.cjs +1 -1
- package/dist/components-ui-select-select.cjs.map +1 -1
- package/dist/components-ui-select-select.js +1 -1
- package/dist/components-ui-sonner-sonner.cjs +1 -1
- package/dist/components-ui-sonner-sonner.cjs.map +1 -1
- package/dist/components-ui-sonner-sonner.js +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/package.json +2 -2
- package/dist/calendar-DvDG9hIB.cjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Cc=Object.defineProperty;var wc=(e,t,n)=>t in e?Cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>wc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),Ge=require("react"),et=require("./lib-utils.cjs"),Rc=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const Mn=require("./components-ui-field-field.cjs"),sr=require("./components-ui-icon-icon.cjs");require("phosphor-strokes-icons/icons");const Wn=require("./components-ui-input-group-input-group.cjs"),He=require("./components-ui-combobox-combobox.styles.cjs"),Kn=require("./with-selector-DSbfqgSY.cjs"),Ic=require("react-dom");function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=Is(Ge),Yt=Is(Ic);function ko({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=u.useRef(e!==void 0),[s,i]=u.useState(t),c=r?e:s;if(process.env.NODE_ENV!=="production"){u.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
1
|
+
"use strict";var Cc=Object.defineProperty;var wc=(e,t,n)=>t in e?Cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>wc(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react/jsx-runtime"),Ge=require("react"),et=require("./lib-utils.cjs"),Rc=require("./components-ui-button-button.cjs");require("./components-ui-button-button.styles.cjs");const Mn=require("./components-ui-field-field.cjs"),sr=require("./components-ui-icon-icon.cjs");require("brd-phosphor-strokes-icons/icons");const Wn=require("./components-ui-input-group-input-group.cjs"),He=require("./components-ui-combobox-combobox.styles.cjs"),Kn=require("./with-selector-DSbfqgSY.cjs"),Ic=require("react-dom");function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const u=Is(Ge),Yt=Is(Ic);function ko({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=u.useRef(e!==void 0),[s,i]=u.useState(t),c=r?e:s;if(process.env.NODE_ENV!=="production"){u.useEffect(()=>{r!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${r?"":"un"}controlled ${o} state of ${n} to be ${r?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
2
2
|
`))},[o,n,e]);const{current:l}=u.useRef(t);u.useEffect(()=>{!r&&JSON.stringify(l)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${o} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
3
3
|
`))},[JSON.stringify(t)])}const a=u.useCallback(l=>{r||i(l)},[]);return[c,a]}const Wr={};function ut(e,t){const n=u.useRef(Wr);return n.current===Wr&&(n.current=e(t)),n}const Mo=u[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Sc=Mo&&Mo!==u.useLayoutEffect?Mo:e=>e();function Y(e){const t=ut(Oc).current;return t.next=e,Sc(t.effect),t.trampoline}function Oc(){const e={next:void 0,callback:Pc,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Pc(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Ac=()=>{},Q=typeof document<"u"?u.useLayoutEffect:Ac,ir=u.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(ir.displayName="CompositeListContext");function Tc(){return u.useContext(ir)}function Ss(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=Y(r),i=u.useRef(0),c=ut(kc).current,a=ut(Nc).current,[l,d]=u.useState(0),f=u.useRef(l),g=Y((b,m)=>{a.set(b,m??null),f.current+=1,d(f.current)}),p=Y(b=>{a.delete(b),f.current+=1,d(f.current)}),x=u.useMemo(()=>{const b=new Map;return Array.from(a.keys()).filter(w=>w.isConnected).sort(Mc).forEach((w,v)=>{const E=a.get(w)??{};b.set(w,{...E,index:v})}),b},[a,l]);Q(()=>{if(typeof MutationObserver!="function"||x.size===0)return;const b=new MutationObserver(m=>{const w=new Set,v=E=>w.has(E)?w.delete(E):w.add(E);m.forEach(E=>{E.removedNodes.forEach(v),E.addedNodes.forEach(v)}),w.size===0&&(f.current+=1,d(f.current))});return x.forEach((m,w)=>{w.parentElement&&b.observe(w.parentElement,{childList:!0})}),()=>{b.disconnect()}},[x]),Q(()=>{f.current===l&&(n.current.length!==x.size&&(n.current.length=x.size),o&&o.current.length!==x.size&&(o.current.length=x.size),i.current=x.size),s(x)},[s,x,n,o,l]),Q(()=>()=>{n.current=[]},[n]),Q(()=>()=>{o&&(o.current=[])},[o]);const y=Y(b=>(c.add(b),()=>{c.delete(b)}));Q(()=>{c.forEach(b=>b(x))},[c,x]);const h=u.useMemo(()=>({register:g,unregister:p,subscribeMapChange:y,elementsRef:n,labelsRef:o,nextIndexRef:i}),[g,p,y,n,o,i]);return j.jsx(ir.Provider,{value:h,children:t})}function Nc(){return new Map}function kc(){return new Set}function Mc(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Os=u.createContext(void 0);process.env.NODE_ENV!=="production"&&(Os.displayName="DirectionContext");function Ps(){return u.useContext(Os)?.direction??"ltr"}function bt(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}function vn(e,t,n,o){const r=ut(As).current;return Vc(r,e,t,n,o)&&Ts(r,[e,t,n,o]),r.callback}function Dc(e){const t=ut(As).current;return Lc(t,e)&&Ts(t,e),t.callback}function As(){return{callback:null,cleanup:null,refs:[]}}function Vc(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function Lc(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Ts(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const Fc=parseInt(u.version,10);function cr(e){return Fc>=e}function Gr(e){if(!u.isValidElement(e))return null;const t=e,n=t.props;return(cr(19)?n?.ref:t.ref)??null}function Ho(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function _c(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function Bc(e,t){return typeof e=="function"?e(t):e}function jc(e,t){return typeof e=="function"?e(t):e}const mn={};function Ns(e,t,n,o,r){let s={...Uo(e,mn)};return t&&(s=Gn(s,t)),n&&(s=Gn(s,n)),o&&(s=Gn(s,o)),s}function $c(e){if(e.length===0)return mn;if(e.length===1)return Uo(e[0],mn);let t={...Uo(e[0],mn)};for(let n=1;n<e.length;n+=1)t=Gn(t,e[n]);return t}function Gn(e,t){return ks(t)?t(e):Hc(e,t)}function Hc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=Ho(e.style,o);break}case"className":{e[n]=Ms(e.className,o);break}default:Uc(n,o)?e[n]=Wc(e[n],o):e[n]=o}}return e}function Uc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function ks(e){return typeof e=="function"}function Uo(e,t){return ks(e)?e(t):e??mn}function Wc(e,t){return t?e?n=>{if(Gc(n)){const r=n;Wo(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function Wo(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Ms(e,t){return t?e?t+" "+e:t:e}function Gc(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Re(){}const Dn=Object.freeze([]),We=Object.freeze({}),qc={style:{transition:"none"}},Kc="data-base-ui-click-trigger",zc={fallbackAxisSide:"none"},Yc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function qe(e,t,n={}){const o=t.render,r=Xc(t,n);if(n.enabled===!1)return null;const s=n.state??We;return Qc(e,o,r,s)}function Xc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=We,ref:i,props:c,stateAttributesMapping:a,enabled:l=!0}=t,d=l?Bc(n,s):void 0,f=l?jc(o,s):void 0,g=l?_c(s,a):We,p=l?Ho(g,Array.isArray(c)?$c(c):c)??We:We;return typeof document<"u"&&(l?Array.isArray(i)?p.ref=Dc([p.ref,Gr(r),...i]):p.ref=vn(p.ref,Gr(r),i):vn(null,null)),l?(d!==void 0&&(p.className=Ms(p.className,d)),f!==void 0&&(p.style=Ho(p.style,f)),p):We}const Jc=Symbol.for("react.lazy");function Qc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=Ns(n,t.props);r.ref=n.ref;let s=t;if(s?.$$typeof===Jc&&(s=u.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!u.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
|
|
4
4
|
`));return u.cloneElement(s,r)}if(e&&typeof e=="string")return Zc(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":bt(8))}function Zc(e,t){return e==="button"?Ge.createElement("button",{type:"button",...t,key:t.key}):e==="img"?Ge.createElement("img",{alt:"",...t,key:t.key}):u.createElement(e,t)}const ct="none",Go="trigger-press",el="trigger-hover",lr="outside-press",tl="item-press",qr="clear-press",nl="chip-remove-press",Qt="input-change",kt="input-clear",ol="input-press",so="focus-out",Ds="escape-key",hn="list-navigation";function ce(e,t,n,o){let r=!1,s=!1;const i=We;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}function fn(e,t,n){const o=n??We;return{reason:e,event:t??new Event("base-ui"),...o}}const qo={...u};let Kr=0;function rl(e,t="mui"){const[n,o]=u.useState(e),r=e||n;return u.useEffect(()=>{n==null&&(Kr+=1,o(`${t}-${Kr}`))},[n,t]),r}const zr=qo.useId;function ar(e,t){if(zr!==void 0){const n=zr();return e??(t?`${t}-${n}`:n)}return rl(e,t)}function ur(e){return ar(e,"base-ui")}const sl=[];function Vs(e){u.useEffect(e,sl)}const Vn=null;let Yr=globalThis.requestAnimationFrame;class il{constructor(){Pe(this,"callbacks",[]);Pe(this,"callbacksCount",0);Pe(this,"nextId",1);Pe(this,"startId",1);Pe(this,"isScheduled",!1);Pe(this,"tick",t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)})}request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const o=process.env.NODE_ENV!=="production"&&Yr!==requestAnimationFrame&&(Yr=requestAnimationFrame,!0);return(!this.isScheduled||o)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Ln=new il;class yt{constructor(){Pe(this,"currentId",Vn);Pe(this,"cancel",()=>{this.currentId!==Vn&&(Ln.cancel(this.currentId),this.currentId=Vn)});Pe(this,"disposeEffect",()=>this.cancel)}static create(){return new yt}static request(t){return Ln.request(t)}static cancel(t){return Ln.cancel(t)}request(t){this.cancel(),this.currentId=Ln.request(()=>{this.currentId=Vn,t()})}}function fr(){const e=ut(yt.create).current;return Vs(e.disposeEffect),e}function wt(e){return e==null?e:"current"in e?e.current:e}let En=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const cl={[En.startingStyle]:""},ll={[En.endingStyle]:""},Ls={transitionStatus(e){return e==="starting"?cl:e==="ending"?ll:null}};function al(e,t=!1,n=!0){const o=fr();return Y((r,s=null)=>{o.cancel();function i(){Yt.flushSync(r)}const c=wt(e);if(c==null)return;const a=c;if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let l=function(){const f=En.startingStyle;if(!a.hasAttribute(f)){o.request(d);return}const g=new MutationObserver(()=>{a.hasAttribute(f)||(g.disconnect(),d())});g.observe(a,{attributes:!0,attributeFilter:[f]}),s?.addEventListener("abort",()=>g.disconnect(),{once:!0})},d=function(){Promise.all(a.getAnimations().map(f=>f.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const f=a.getAnimations();if(n){if(s?.aborted)return;i()}else f.length>0&&f.some(g=>g.pending||g.playState!=="finished")&&d()})};if(t){l();return}o.request(d)}})}function Fs(e,t=!1,n=!1){const[o,r]=u.useState(e&&t?"idle":void 0),[s,i]=u.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),Q(()=>{if(!e&&s&&o!=="ending"&&n){const c=yt.request(()=>{r("ending")});return()=>{yt.cancel(c)}}},[e,s,o,n]),Q(()=>{if(!e||t)return;const c=yt.request(()=>{r(void 0)});return()=>{yt.cancel(c)}},[t,e]),Q(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const c=yt.request(()=>{r("idle")});return()=>{yt.cancel(c)}},[t,e,s,r,o]),u.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}let _s=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Bs(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:c,subscribeMapChange:a,elementsRef:l,labelsRef:d,nextIndexRef:f}=Tc(),g=u.useRef(-1),[p,x]=u.useState(s??(r===_s.GuessFromOrder?()=>{if(g.current===-1){const b=f.current;f.current+=1,g.current=b}return g.current}:-1)),y=u.useRef(null),h=u.useCallback(b=>{if(y.current=b,p!==-1&&b!==null&&(l.current[p]=b,d)){const m=t!==void 0;d.current[p]=m?t:o?.current?.textContent??b.textContent}},[p,l,d,t,o]);return Q(()=>{if(s!=null)return;const b=y.current;if(b)return i(b,n),()=>{c(b)}},[s,i,c,n]),Q(()=>{if(s==null)return a(b=>{const m=y.current?b.get(y.current)?.index:null;m!=null&&x(m)})},[s,a,x]),u.useMemo(()=>({ref:h,index:p}),[p,h])}function io(){return typeof window<"u"}function Ft(e){return dr(e)?(e.nodeName||"").toLowerCase():"#document"}function _e(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Et(e){var t;return(t=(dr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function dr(e){return io()?e instanceof Node||e instanceof _e(e).Node:!1}function Ce(e){return io()?e instanceof Element||e instanceof _e(e).Element:!1}function ke(e){return io()?e instanceof HTMLElement||e instanceof _e(e).HTMLElement:!1}function Ko(e){return!io()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _e(e).ShadowRoot}function _t(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=st(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ul(e){return/^(table|td|th)$/.test(Ft(e))}function co(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const fl=/transform|translate|scale|rotate|perspective|filter/,dl=/paint|layout|strict|content/,Wt=e=>!!e&&e!=="none";let Do;function pr(e){const t=Ce(e)?st(e):e;return Wt(t.transform)||Wt(t.translate)||Wt(t.scale)||Wt(t.rotate)||Wt(t.perspective)||!lo()&&(Wt(t.backdropFilter)||Wt(t.filter))||fl.test(t.willChange||"")||dl.test(t.contain||"")}function pl(e){let t=St(e);for(;ke(t)&&!It(t);){if(pr(t))return t;if(co(t))return null;t=St(t)}return null}function lo(){return Do==null&&(Do=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Do}function It(e){return/^(html|body|#document)$/.test(Ft(e))}function st(e){return _e(e).getComputedStyle(e)}function ao(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ko(e)&&e.host||Et(e);return Ko(t)?t.host:t}function js(e){const t=St(e);return It(t)?e.ownerDocument?e.ownerDocument.body:e.body:ke(t)&&_t(t)?t:js(t)}function Dt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=js(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=_e(r);if(s){const c=zo(i);return t.concat(i,i.visualViewport||[],_t(r)?r:[],c&&n?Dt(c):[])}else return t.concat(r,Dt(r,[],n))}function zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}let Yo;process.env.NODE_ENV!=="production"&&(Yo=new Set);function Xr(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Yo.has(t)||(Yo.add(t),console.error(`Base UI: ${t}`))}}const $s=u.createContext(void 0);process.env.NODE_ENV!=="production"&&($s.displayName="CompositeRootContext");function ml(e=!1){const t=u.useContext($s);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":bt(16));return t}function hl(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,c=o&&t===!1;return{props:u.useMemo(()=>{const l={onKeyDown(d){n&&t&&d.key!=="Tab"&&d.preventDefault()}};return o||(l.tabIndex=r,!s&&n&&(l.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||c)&&(l.disabled=n),l},[o,n,t,i,c,s,r])}}function uo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=u.useRef(null),i=ml(!0)!==void 0,c=Y(()=>{const g=s.current;return!!(g?.tagName==="A"&&g?.href)}),{props:a}=hl({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r});process.env.NODE_ENV!=="production"&&u.useEffect(()=>{if(!s.current)return;const g=s.current.tagName==="BUTTON";if(r){if(!g){const p=qo.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${p}`)}}else if(g){const p=qo.captureOwnerStack?.()||"";Xr(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${p}`)}},[r]);const l=u.useCallback(()=>{const g=s.current;gl(g)&&i&&t&&a.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,a.disabled,i]);Q(l,[l]);const d=u.useCallback((g={})=>{const{onClick:p,onMouseDown:x,onKeyUp:y,onKeyDown:h,onPointerDown:b,...m}=g;return Ns({type:r?"button":void 0,onClick(v){if(t){v.preventDefault();return}p?.(v)},onMouseDown(v){t||x?.(v)},onKeyDown(v){if(t||(Wo(v),h?.(v)),v.baseUIHandlerPrevented)return;const E=v.target===v.currentTarget&&!r&&!c()&&!t,S=v.key==="Enter",R=v.key===" ";E&&((R||S)&&v.preventDefault(),S&&p?.(v))},onKeyUp(v){t||(Wo(v),y?.(v)),!v.baseUIHandlerPrevented&&v.target===v.currentTarget&&!r&&!t&&v.key===" "&&p?.(v)},onPointerDown(v){if(t){v.preventDefault();return}b?.(v)}},r?void 0:{role:"button"},a,m)},[t,a,r,c]),f=Y(g=>{s.current=g,l()});return{getButtonProps:d,buttonRef:f}}function gl(e){return ke(e)&&e.tagName==="BUTTON"}const Xt=typeof navigator<"u",Vo=yl(),Hs=El(),mr=vl(),Us=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Ws=Vo.platform==="MacIntel"&&Vo.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Vo.platform),Jr=Xt&&/firefox/i.test(mr),bl=Xt&&/apple/i.test(navigator.vendor),zn=Xt&&/android/i.test(Hs)||/android/i.test(mr);Xt&&Hs.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const xl=mr.includes("jsdom/");function yl(){if(!Xt)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function vl(){if(!Xt)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function El(){if(!Xt)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Xo="data-base-ui-focusable",Gs="active",qs="selected",Cl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Vt="ArrowLeft",Lt="ArrowRight",hr="ArrowUp",wn="ArrowDown";function Rt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function me(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ko(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ze(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function wl(e){return e.matches("html,body")}function gr(e){return ke(e)&&e.matches(Cl)}function Jo(e){return e?e.getAttribute("role")==="combobox"&&gr(e):!1}function Qo(e){return e?e.hasAttribute(Xo)?e:e.querySelector(`[${Xo}]`)||e:null}function en(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...en(e,r.id,n)])}function Qr(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function Ee(e){e.preventDefault(),e.stopPropagation()}function Rl(e){return"nativeEvent"in e}function Ks(e){return e.pointerType===""&&e.isTrusted?!0:zn&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function zs(e){return xl?!1:!zn&&e.width===0&&e.height===0||zn&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Zr(e,t){return["mouse","pen"].includes(e)}function Ys(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Il=["top","right","bottom","left"],on=Math.min,ot=Math.max,Yn=Math.round,Zt=Math.floor,vt=e=>({x:e,y:e}),Sl={left:"right",right:"left",bottom:"top",top:"bottom"};function Zo(e,t,n){return ot(e,on(t,n))}function Ot(e,t){return typeof e=="function"?e(t):e}function rt(e){return e.split("-")[0]}function Bt(e){return e.split("-")[1]}function br(e){return e==="x"?"y":"x"}function xr(e){return e==="y"?"height":"width"}function at(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yr(e){return br(at(e))}function Ol(e,t,n){n===void 0&&(n=!1);const o=Bt(e),r=yr(e),s=xr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Xn(i)),[i,Xn(i)]}function Pl(e){const t=Xn(e);return[er(e),t,er(t)]}function er(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const es=["left","right"],ts=["right","left"],Al=["top","bottom"],Tl=["bottom","top"];function Nl(e,t,n){switch(e){case"top":case"bottom":return n?t?ts:es:t?es:ts;case"left":case"right":return t?Al:Tl;default:return[]}}function kl(e,t,n,o){const r=Bt(e);let s=Nl(rt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(er)))),s}function Xn(e){const t=rt(e);return Sl[t]+e.slice(t.length)}function Ml(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xs(e){return typeof e!="number"?Ml(e):{top:e,right:e,bottom:e,left:e}}function Jn(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Fn(e,t,n){return Math.floor(e/t)!==n}function gn(e,t){return t<0||t>=e.current.length}function Lo(e,t){return $e(e,{disabledIndices:t})}function ns(e,t){return $e(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $e(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&bn(e,s,o));return s}function Dl(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:c,maxIndex:a,prevIndex:l,stopEvent:d=!1}){let f=l;const g=[],p={};let x=!1;{let b=null,m=-1;e.current.forEach((w,v)=>{if(w==null)return;const E=w.closest('[role="row"]');E&&(x=!0),(E!==b||m===-1)&&(b=E,m+=1,g[m]=[]),g[m].push(v),p[v]=m})}const y=x&&g.length>0&&g.some(b=>b.length!==s);function h(b){if(!y||l===-1)return;const m=p[l];if(m==null)return;const w=g[m].indexOf(l);let v=b==="up"?m-1:m+1;o&&(v<0?v=g.length-1:v>=g.length&&(v=0));const E=new Set;for(;v>=0&&v<g.length&&!E.has(v);){E.add(v);const S=g[v];if(S.length===0){v=b==="up"?v-1:v+1;continue}const R=Math.min(w,S.length-1);for(let I=R;I>=0;I-=1){const G=S[I];if(!bn(e,G,i))return G}v=b==="up"?v-1:v+1,o&&(v<0?v=g.length-1:v>=g.length&&(v=0))}}if(t.key===hr){const b=h("up");if(b!==void 0)d&&Ee(t),f=b;else{if(d&&Ee(t),l===-1)f=a;else if(f=$e(e,{startingIndex:f,amount:s,decrement:!0,disabledIndices:i}),o&&(l-s<c||f<0)){const m=l%s,w=a%s,v=a-(w-m);w===m?f=a:f=w>m?v:v-s}gn(e,f)&&(f=l)}}if(t.key===wn){const b=h("down");b!==void 0?(d&&Ee(t),f=b):(d&&Ee(t),l===-1?f=c:(f=$e(e,{startingIndex:l,amount:s,disabledIndices:i}),o&&l+s>a&&(f=$e(e,{startingIndex:l%s-s,amount:s,disabledIndices:i}))),gn(e,f)&&(f=l))}if(n==="both"){const b=Zt(l/s);t.key===(r?Vt:Lt)&&(d&&Ee(t),l%s!==s-1?(f=$e(e,{startingIndex:l,disabledIndices:i}),o&&Fn(f,s,b)&&(f=$e(e,{startingIndex:l-l%s-1,disabledIndices:i}))):o&&(f=$e(e,{startingIndex:l-l%s-1,disabledIndices:i})),Fn(f,s,b)&&(f=l)),t.key===(r?Lt:Vt)&&(d&&Ee(t),l%s!==0?(f=$e(e,{startingIndex:l,decrement:!0,disabledIndices:i}),o&&Fn(f,s,b)&&(f=$e(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i}))):o&&(f=$e(e,{startingIndex:l+(s-l%s),decrement:!0,disabledIndices:i})),Fn(f,s,b)&&(f=l));const m=Zt(a/s)===b;gn(e,f)&&(o&&m?f=t.key===(r?Lt:Vt)?a:$e(e,{startingIndex:l-l%s-1,disabledIndices:i}):f=l)}return f}function Vl(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},c)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${c} is greater than grid columns`);let a=!1;for(;!a;){const l=[];for(let d=0;d<s;d+=1)for(let f=0;f<i;f+=1)l.push(r+d+f*t);r%t+s<=t&&l.every(d=>o[d]==null)?(l.forEach(d=>{o[d]=c}),a=!0):r+=1}}),[...o]}function Ll(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function Fl(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function bn(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}var _l=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Qn=_l.join(","),Js=typeof Element>"u",rn=Js?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zn=!Js&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},eo=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):eo(t.parentNode));return i},Bl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Qs=function(t,n,o){if(eo(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Qn));return n&&rn.call(t,Qn)&&r.unshift(t),r=r.filter(o),r},to=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!eo(i,!1))if(i.tagName==="SLOT"){var c=i.assignedElements(),a=c.length?c:i.children,l=to(a,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:i,candidates:l})}else{var d=rn.call(i,Qn);d&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var f=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),g=!eo(f,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(f&&g){var p=to(f===!0?i.children:f.children,!0,o);o.flatten?r.push.apply(r,p):r.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return r},Zs=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ei=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Bl(t))&&!Zs(t)?0:t.tabIndex},jl=function(t,n){var o=ei(t);return o<0&&n&&!Zs(t)?0:o},$l=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ti=function(t){return t.tagName==="INPUT"},Hl=function(t){return ti(t)&&t.type==="hidden"},Ul=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Wl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Gl=function(t){if(!t.name)return!0;var n=t.form||Zn(t),o=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Wl(r,t.form);return!s||s===t},ql=function(t){return ti(t)&&t.type==="radio"},Kl=function(t){return ql(t)&&!Gl(t)},zl=function(t){var n,o=t&&Zn(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,c,a;for(s=!!((i=r)!==null&&i!==void 0&&(c=i.ownerDocument)!==null&&c!==void 0&&c.contains(r)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&r;){var l,d,f;o=Zn(r),r=(l=o)===null||l===void 0?void 0:l.host,s=!!((d=r)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(r))}}return s},os=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Yl=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=rn.call(t,"details>summary:first-of-type"),c=i?t.parentElement:t;if(rn.call(c,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var a=t;t;){var l=t.parentElement,d=Zn(t);if(l&&!l.shadowRoot&&r(l)===!0)return os(t);t.assignedSlot?t=t.assignedSlot:!l&&d!==t.ownerDocument?t=d.host:t=l}t=a}if(zl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return os(t);return!1},Xl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return rn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},tr=function(t,n){return!(n.disabled||Hl(n)||Yl(n,t)||Ul(n)||Xl(n))},nr=function(t,n){return!(Kl(n)||ei(n)<0||!tr(t,n))},Jl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ni=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,c=i?r.scopeParent:r,a=jl(c,i),l=i?ni(r.candidates):c;a===0?i?n.push.apply(n,l):n.push(c):o.push({documentOrder:s,tabIndex:a,item:r,isScope:i,content:l})}),o.sort($l).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},fo=function(t,n){n=n||{};var o;return n.getShadowRoot?o=to([t],n.includeContainer,{filter:nr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Jl}):o=Qs(t,n.includeContainer,nr.bind(null,n)),ni(o)},Ql=function(t,n){n=n||{};var o;return n.getShadowRoot?o=to([t],n.includeContainer,{filter:tr.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=Qs(t,n.includeContainer,tr.bind(null,n)),o},oi=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return rn.call(t,Qn)===!1?!1:nr(n,t)};function Ne(e){return e?.ownerDocument||document}const Rn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ri(e,t){const n=fo(e,Rn()),o=n.length;if(o===0)return;const r=Rt(Ne(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function si(e){return ri(Ne(e).body,1)||e}function ii(e){return ri(Ne(e).body,-1)||e}function xn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!me(n,o)}function Zl(e){fo(e,Rn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function rs(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function vr(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=Y(r),i=al(o,n,!1);u.useEffect(()=>{if(!t)return;const c=new AbortController;return i(s,c.signal),()=>{c.abort()}},[t,n,s,i])}const dn=0;class sn{constructor(){Pe(this,"currentId",dn);Pe(this,"clear",()=>{this.currentId!==dn&&(clearTimeout(this.currentId),this.currentId=dn)});Pe(this,"disposeEffect",()=>this.clear)}static create(){return new sn}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=dn,n()},t)}isStarted(){return this.currentId!==dn}}function qt(){const e=ut(sn.create).current;return Vs(e.disposeEffect),e}let ss={},is={},cs="";function ea(e){if(typeof document>"u")return!1;const t=Ne(e);return _e(t).innerWidth-t.documentElement.clientWidth>0}function ta(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ne(e),o=n.documentElement,r=n.body,s=_t(o)?o:r,i=s.style.overflowY,c=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const a=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=c,a===l}function na(e){const t=Ne(e),n=t.documentElement,o=t.body,r=_t(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function oa(e){const t=Ne(e),n=t.documentElement,o=t.body,r=_e(n);let s=0,i=0,c=!1;const a=yt.create();if(Us&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const g=r.getComputedStyle(n),p=r.getComputedStyle(o),h=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,ss={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},cs=n.style.scrollBehavior,is={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,m=n.scrollWidth>n.clientWidth,w=g.overflowY==="scroll"||p.overflowY==="scroll",v=g.overflowX==="scroll"||p.overflowX==="scroll",E=Math.max(0,r.innerWidth-o.clientWidth),S=Math.max(0,r.innerHeight-o.clientHeight),R=parseFloat(p.marginTop)+parseFloat(p.marginBottom),I=parseFloat(p.marginLeft)+parseFloat(p.marginRight),G=_t(n)?n:o;if(c=ta(e),c){n.style.scrollbarGutter=h,G.style.overflowY="hidden",G.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:h,overflowY:"hidden",overflowX:"hidden"}),(b||w)&&(n.style.overflowY="scroll"),(m||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:R||S?`calc(100dvh - ${R+S}px)`:"100dvh",width:I||E?`calc(100vw - ${I+E}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,ss),Object.assign(o.style,is),c||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=cs)}function f(){d(),a.request(l)}return l(),r.addEventListener("resize",f),()=>{a.cancel(),d(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",f)}}class ra{constructor(){Pe(this,"lockCount",0);Pe(this,"restore",null);Pe(this,"timeoutLock",sn.create());Pe(this,"timeoutUnlock",sn.create());Pe(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Pe(this,"unlock",()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ne(t).documentElement,r=_e(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=Re;return}const s=Ws||!ea(t);this.restore=s?na(t):oa(t)}}const sa=new ra;function ia(e=!0,t=null){Q(()=>{if(e)return sa.acquire(t)},[e,t])}function lt(e){const t=ut(ca,e).current;return t.next=e,Q(t.effect),t}function ca(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function la(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(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)}}}const ci=u.createContext(null);process.env.NODE_ENV!=="production"&&(ci.displayName="FloatingNodeContext");const li=u.createContext(null);process.env.NODE_ENV!=="production"&&(li.displayName="FloatingTreeContext");const ai=()=>u.useContext(ci)?.id||null,po=e=>{const t=u.useContext(li);return e??t};function no(e){return`data-base-ui-${e}`}const ui={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Er={...ui,position:"fixed",top:0,left:0},aa={...ui,position:"absolute"},Cn=u.forwardRef(function(t,n){const[o,r]=u.useState();Q(()=>{bl&&r("button")},[]);const s={tabIndex:0,role:o};return j.jsx("span",{...t,ref:n,style:Er,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Cn.displayName="FocusGuard");let ls=0;function yn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(ls);const s=()=>e?.focus({preventScroll:n});r?s():ls=requestAnimationFrame(s)}const tn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function as(e){return e==="inert"?tn.inert:e==="aria-hidden"?tn["aria-hidden"]:tn.none}let _n=new WeakSet,Bn={},Fo=0;const fi=e=>e&&(e.host||fi(e.parentNode)),ua=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=fi(n);return e.contains(o)?o:null}).filter(n=>n!=null);function fa(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=ua(t,e),c=new Set,a=new Set(i),l=[];Bn[r]||(Bn[r]=new WeakMap);const d=Bn[r];i.forEach(f),g(t),c.clear();function f(p){!p||c.has(p)||(c.add(p),p.parentNode&&f(p.parentNode))}function g(p){!p||a.has(p)||[].forEach.call(p.children,x=>{if(Ft(x)!=="script")if(c.has(x))g(x);else{const y=s?x.getAttribute(s):null,h=y!==null&&y!=="false",b=as(s),m=(b.get(x)||0)+1,w=(d.get(x)||0)+1;b.set(x,m),d.set(x,w),l.push(x),m===1&&h&&_n.add(x),w===1&&x.setAttribute(r,""),!h&&s&&x.setAttribute(s,s==="inert"?"":"true")}})}return Fo+=1,()=>{l.forEach(p=>{const x=as(s),h=(x.get(p)||0)-1,b=(d.get(p)||0)-1;x.set(p,h),d.set(p,b),h||(!_n.has(p)&&s&&p.removeAttribute(s),_n.delete(p)),b||p.removeAttribute(r)}),Fo-=1,Fo||(tn.inert=new WeakMap,tn["aria-hidden"]=new WeakMap,tn.none=new WeakMap,_n=new WeakSet,Bn={})}}function da(e,t=!1,n=!1){const o=Ne(e[0]).body;return fa(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Cr=u.createContext(null);process.env.NODE_ENV!=="production"&&(Cr.displayName="PortalContext");const di=()=>u.useContext(Cr),pa=no("portal");function ma(e={}){const{ref:t,container:n,componentProps:o=We,elementProps:r}=e,s=ar(),c=di()?.portalNode,[a,l]=u.useState(null),[d,f]=u.useState(null),g=Y(h=>{h!==null&&f(h)}),p=u.useRef(null);Q(()=>{if(n===null){p.current&&(p.current=null,f(null),l(null));return}if(s==null)return;const h=(n&&(dr(n)?n:n.current))??c??document.body;if(h==null){p.current&&(p.current=null,f(null),l(null));return}p.current!==h&&(p.current=h,f(null),l(h))},[n,c,s]);const x=qe("div",o,{ref:[t,g],props:[{id:s,[pa]:""},r]});return{portalNode:d,portalSubtree:a&&x?Yt.createPortal(x,a):null}}const pi=u.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:c,...a}=t,{portalNode:l,portalSubtree:d}=ma({container:r,ref:n,componentProps:t,elementProps:a}),f=u.useRef(null),g=u.useRef(null),p=u.useRef(null),x=u.useRef(null),[y,h]=u.useState(null),b=y?.modal,m=y?.open,w=typeof c=="boolean"?c:!!y&&!y.modal&&y.open&&!!l;u.useEffect(()=>{if(!l||b)return;function E(S){l&&S.relatedTarget&&xn(S)&&(S.type==="focusin"?rs:Zl)(l)}return l.addEventListener("focusin",E,!0),l.addEventListener("focusout",E,!0),()=>{l.removeEventListener("focusin",E,!0),l.removeEventListener("focusout",E,!0)}},[l,b]),u.useEffect(()=>{!l||m||rs(l)},[m,l]);const v=u.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:p,afterInsideRef:x,portalNode:l,setFocusManagerState:h}),[l]);return j.jsxs(u.Fragment,{children:[d,j.jsxs(Cr.Provider,{value:v,children:[w&&l&&j.jsx(Cn,{"data-type":"outside",ref:f,onFocus:E=>{if(xn(E,l))p.current?.focus();else{const S=y?y.domReference:null;ii(S)?.focus()}}}),w&&l&&j.jsx("span",{"aria-owns":l.id,style:Yc}),l&&Yt.createPortal(o,l),w&&l&&j.jsx(Cn,{"data-type":"outside",ref:g,onFocus:E=>{if(xn(E,l))x.current?.focus();else{const S=y?y.domReference:null;si(S)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,ce(so,E.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(pi.displayName="FloatingPortal");function ha(e,t){const n=_e(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const us=20;let Mt=[];function wr(){Mt=Mt.filter(e=>e.deref()?.isConnected)}function ga(e){wr(),e&&Ft(e)!=="body"&&(Mt.push(new WeakRef(e)),Mt.length>us&&(Mt=Mt.slice(-us)))}function _o(){return wr(),Mt[Mt.length-1]?.deref()}function ba(e){if(!e)return null;const t=Rn();return oi(e,t)?e:fo(e,t)[0]||e}function xa(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():st(e).display!=="none"}function fs(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Rn(),r=Ql(e,n).filter(i=>{const c=i.getAttribute("data-tabindex")||"";return oi(i,n)||i.hasAttribute("data-tabindex")&&!c.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ya(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:c=!0,closeOnFocusOut:a=!0,openInteractionType:l="",nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:g,externalTree:p}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),h=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:m,dataRef:w}=x.context,v=Y(()=>w.current.floatingContext?.nodeId),E=r===!1,S=Jo(h)&&E,R=u.useRef(["content"]),I=lt(r),G=lt(s),K=lt(l),q=po(p),D=di(),X=u.useRef(null),Z=u.useRef(null),B=u.useRef(!1),M=u.useRef(!1),U=u.useRef(!1),F=u.useRef(-1),J=u.useRef(""),ne=u.useRef(""),ye=u.useRef(null),ue=u.useRef(null),he=vn(ye,g,D?.beforeInsideRef),se=vn(ue,D?.afterInsideRef),pe=qt(),Me=qt(),Ie=fr(),we=D!=null,re=Qo(b),fe=Y((k=re)=>k?fo(k,Rn()):[]),xe=Y(k=>{const V=fe(k);return R.current.map(()=>V).filter(Boolean).flat()});u.useEffect(()=>{if(o||!c)return;function k(ie){ie.key==="Tab"&&me(re,Rt(Ne(re)))&&fe().length===0&&!S&&Ee(ie)}const V=Ne(re);return V.addEventListener("keydown",k),()=>{V.removeEventListener("keydown",k)}},[o,h,re,c,R,S,fe,xe]),u.useEffect(()=>{if(o||!y)return;const k=Ne(re);function V(){U.current=!1}function ie(L){const _=Ze(L),P=me(b,_)||me(h,_)||me(D?.portalNode,_);U.current=!P,ne.current=L.pointerType||"keyboard",_?.closest(`[${Kc}]`)&&(M.current=!0)}function C(){ne.current="keyboard"}return k.addEventListener("pointerdown",ie,!0),k.addEventListener("pointerup",V,!0),k.addEventListener("pointercancel",V,!0),k.addEventListener("keydown",C,!0),()=>{k.removeEventListener("pointerdown",ie,!0),k.removeEventListener("pointerup",V,!0),k.removeEventListener("pointercancel",V,!0),k.removeEventListener("keydown",C,!0)}},[o,b,h,re,y,D]),u.useEffect(()=>{if(o||!a)return;const k=Ne(re);function V(){M.current=!0,Me.start(0,()=>{M.current=!1})}function ie($){const T=Ze($),te=fe().indexOf(T);te!==-1&&(F.current=te)}function C($){const T=$.relatedTarget,W=$.currentTarget,te=Ze($);queueMicrotask(()=>{const ae=v(),De=x.context.triggerElements,Ke=T?.hasAttribute(no("focus-guard"))&&[ye.current,ue.current,D?.beforeInsideRef.current,D?.afterInsideRef.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,wt(f),wt(d)].includes(T),Se=!(me(h,T)||me(b,T)||me(T,b)||me(D?.portalNode,T)||T!=null&&De.hasElement(T)||De.hasMatchingElement(ge=>me(ge,T))||Ke||q&&(en(q.nodesRef.current,ae).find(ge=>me(ge.context?.elements.floating,T)||me(ge.context?.elements.domReference,T))||Qr(q.nodesRef.current,ae).find(ge=>[ge.context?.elements.floating,Qo(ge.context?.elements.floating)].includes(T)||ge.context?.elements.domReference===T)));if(W===h&&re&&fs(re,R),i&&W!==h&&!xa(te)&&Rt(k)===k.body){if(ke(re)&&(re.focus(),i==="popup")){Ie.request(()=>{re.focus()});return}const ge=F.current,Ae=fe(),ze=Ae[ge]||Ae[Ae.length-1]||re;ke(ze)&&ze.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(S||!c)&&T&&Se&&!M.current&&(S||T!==_o())&&(B.current=!0,x.setOpen(!1,ce(so,$)))})}function L(){U.current||(w.current.insideReactTree=!0,pe.start(0,()=>{w.current.insideReactTree=!1}))}const _=ke(h)?h:null,P=[];if(!(!b&&!_))return _&&(_.addEventListener("focusout",C),_.addEventListener("pointerdown",V),P.push(()=>{_.removeEventListener("focusout",C),_.removeEventListener("pointerdown",V)})),b&&(b.addEventListener("focusin",ie),b.addEventListener("focusout",C),D&&(b.addEventListener("focusout",L,!0),P.push(()=>{b.removeEventListener("focusout",L,!0)})),P.push(()=>{b.removeEventListener("focusin",ie),b.removeEventListener("focusout",C)})),()=>{P.forEach($=>{$()})}},[o,h,b,re,c,q,D,x,a,i,fe,S,v,R,w,pe,Me,Ie,d,f]),u.useEffect(()=>{if(o||!b||!y)return;const k=Array.from(D?.portalNode?.querySelectorAll(`[${no("portal")}]`)||[]),ie=(q?Qr(q.nodesRef.current,v()):[]).find(L=>Jo(L.context?.elements.domReference||null))?.context?.elements.domReference,C=[b,ie,...k,X.current,Z.current,ye.current,ue.current,D?.beforeOutsideRef.current,D?.afterOutsideRef.current,wt(f),wt(d),S?h:null].filter(L=>L!=null);return da(C,c||S)},[y,o,h,b,c,R,D,S,q,v,d,f]),Q(()=>{if(!y||o||!ke(re))return;const k=Ne(re),V=Rt(k);queueMicrotask(()=>{const ie=xe(re),C=I.current,L=typeof C=="function"?C(K.current||""):C;if(L===void 0||L===!1)return;let _;L===!0||L===null?_=ie[0]||re:_=wt(L),_=_||ie[0]||re,!me(re,V)&&yn(_,{preventScroll:_===re})})},[o,y,re,E,xe,I,K]),Q(()=>{if(o||!re)return;const k=Ne(re),V=Rt(k);ga(V);function ie(_){if(_.open||(J.current=ha(_.nativeEvent,ne.current)),_.reason===el&&_.nativeEvent.type==="mouseleave"&&(B.current=!0),_.reason===lr)if(_.nested)B.current=!1;else if(Ks(_.nativeEvent)||zs(_.nativeEvent))B.current=!1;else{let P=!1;document.createElement("div").focus({get preventScroll(){return P=!0,!1}}),P?B.current=!1:B.current=!0}}m.on("openchange",ie);const C=k.createElement("span");C.setAttribute("tabindex","-1"),C.setAttribute("aria-hidden","true"),Object.assign(C.style,Er),we&&h&&h.insertAdjacentElement("afterend",C);function L(){const _=G.current;let P=typeof _=="function"?_(J.current):_;if(P===void 0||P===!1)return null;if(P===null&&(P=!0),typeof P=="boolean"){const T=h||_o();return T&&T.isConnected?T:C}const $=h||_o()||C;return wt(P)||$}return()=>{m.off("openchange",ie);const _=Rt(k),P=me(b,_)||q&&en(q.nodesRef.current,v(),!1).some(T=>me(T.context?.elements.floating,_)),$=L();queueMicrotask(()=>{const T=ba($),W=typeof G.current!="boolean";G.current&&!B.current&&ke(T)&&(!(!W&&T!==_&&_!==k.body)||P)&&T.focus({preventScroll:!0}),C.remove(),B.current=!1})}},[o,b,re,G,w,m,q,we,h,v]),Q(()=>{if(!Us||y||!b)return;const k=Rt(Ne(b));!ke(k)||!gr(k)||me(b,k)&&k.blur()},[y,b]),Q(()=>{if(!(o||!D))return D.setFocusManagerState({modal:c,closeOnFocusOut:a,open:y,onOpenChange:x.setOpen,domReference:h}),()=>{D.setFocusManagerState(null)}},[o,D,c,y,x,a,h]),Q(()=>{if(!(o||!re))return fs(re,R),()=>{queueMicrotask(wr)}},[o,re,R]);const O=!o&&(c?!S:!0)&&(we||c);return j.jsxs(u.Fragment,{children:[O&&j.jsx(Cn,{"data-type":"inside",ref:he,onFocus:k=>{if(c){const V=xe();yn(V[V.length-1])}else D?.portalNode&&(B.current=!1,xn(k,D.portalNode)?si(h)?.focus():wt(f??D.beforeOutsideRef)?.focus())}}),n,O&&j.jsx(Cn,{"data-type":"inside",ref:se,onFocus:k=>{c?yn(xe()[0]):D?.portalNode&&(a&&(B.current=!0),xn(k,D.portalNode)?ii(h)?.focus():wt(d??D.afterOutsideRef)?.focus())}})]})}function mi(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:c=!1,stickIfOpen:a=!0,touchOpenDelay:l=0,reason:d=Go}=t,f=u.useRef(void 0),g=fr(),p=qt(),x=u.useMemo(()=>({onPointerDown(y){f.current=y.pointerType},onMouseDown(y){const h=f.current,b=y.nativeEvent,m=n.select("open");if(y.button!==0||s==="click"||Zr(h)&&c)return;const w=o.current.openEvent,v=w?.type,E=n.select("domReferenceElement")!==y.currentTarget,S=m&&E||!(m&&i&&(!(w&&a)||v==="click"||v==="mousedown"));if(gr(b.target)){const I=ce(d,b,b.target);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I);return}const R=y.currentTarget;g.request(()=>{const I=ce(d,b,R);S&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,I)}):n.setOpen(S,I)})},onClick(y){if(s==="mousedown-only")return;const h=f.current;if(s==="mousedown"&&h){f.current=void 0;return}if(Zr(h)&&c)return;const b=n.select("open"),m=o.current.openEvent,w=n.select("domReferenceElement")!==y.currentTarget,v=b&&w||!(b&&i&&(!(m&&a)||Ys(m))),E=ce(d,y.nativeEvent,y.currentTarget);v&&h==="touch"&&l>0?p.start(l,()=>{n.setOpen(!0,E)}):n.setOpen(v,E)},onKeyDown(){f.current=void 0}}),[o,s,c,n,a,i,g,p,l,d]);return u.useMemo(()=>r?{reference:x}:We,[r,x])}function ds(e,t,n){let{reference:o,floating:r}=e;const s=at(t),i=yr(t),c=xr(i),a=rt(t),l=s==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let p;switch(a){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(Bt(t)){case"start":p[i]-=g*(n&&l?-1:1);break;case"end":p[i]+=g*(n&&l?-1:1);break}return p}async function va(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Ot(t,e),x=Xs(p),h=c[g?f==="floating"?"reference":"floating":f],b=Jn(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(h)))==null||n?h:h.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:l,rootBoundary:d,strategy:a})),m=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,w=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),v=await(s.isElement==null?void 0:s.isElement(w))?await(s.getScale==null?void 0:s.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Jn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:m,offsetParent:w,strategy:a}):m);return{top:(b.top-E.top+x.top)/v.y,bottom:(E.bottom-b.bottom+x.bottom)/v.y,left:(b.left-E.left+x.left)/v.x,right:(E.right-b.right+x.right)/v.x}}const Ea=50,Ca=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:va},a=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=ds(l,o,a),g=o,p=0;const x={};for(let y=0;y<s.length;y++){const h=s[y];if(!h)continue;const{name:b,fn:m}=h,{x:w,y:v,data:E,reset:S}=await m({x:d,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:x,rects:l,platform:c,elements:{reference:e,floating:t}});d=w??d,f=v??f,x[b]={...x[b],...E},S&&p<Ea&&(p++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(l=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:d,y:f}=ds(l,g,a)),y=-1)}return{x:d,y:f,placement:g,strategy:r,middlewareData:x}},wa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...h}=Ot(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=rt(r),m=at(c),w=rt(c)===c,v=await(a.isRTL==null?void 0:a.isRTL(l.floating)),E=g||(w||!y?[Xn(c)]:Pl(c)),S=x!=="none";!g&&S&&E.push(...kl(c,y,x,v));const R=[c,...E],I=await a.detectOverflow(t,h),G=[];let K=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&G.push(I[b]),f){const Z=Ol(r,i,v);G.push(I[Z[0]],I[Z[1]])}if(K=[...K,{placement:r,overflows:G}],!G.every(Z=>Z<=0)){var q,D;const Z=(((q=s.flip)==null?void 0:q.index)||0)+1,B=R[Z];if(B&&(!(f==="alignment"?m!==at(B):!1)||K.every(F=>at(F.placement)===m?F.overflows[0]>0:!0)))return{data:{index:Z,overflows:K},reset:{placement:B}};let M=(D=K.filter(U=>U.overflows[0]<=0).sort((U,F)=>U.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!M)switch(p){case"bestFit":{var X;const U=(X=K.filter(F=>{if(S){const J=at(F.placement);return J===m||J==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(J=>J>0).reduce((J,ne)=>J+ne,0)]).sort((F,J)=>F[1]-J[1])[0])==null?void 0:X[0];U&&(M=U);break}case"initialPlacement":M=c;break}if(r!==M)return{reset:{placement:M}}}return{}}}};function ps(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ms(e){return Il.some(t=>e[t]>=0)}const Ra=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=Ot(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=ps(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:ms(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=ps(i,n.floating);return{data:{escapedOffsets:c,escaped:ms(c)}}}default:return{}}}}},hi=new Set(["left","top"]);async function Ia(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=rt(n),c=Bt(n),a=at(n)==="y",l=hi.has(i)?-1:1,d=s&&a?-1:1,f=Ot(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof x=="number"&&(p=c==="end"?x*-1:x),a?{x:p*d,y:g*l}:{x:g*l,y:p*d}}const Sa=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,a=await Ia(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},Oa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:b=>{let{x:m,y:w}=b;return{x:m,y:w}}},...l}=Ot(e,t),d={x:n,y:o},f=await s.detectOverflow(t,l),g=at(rt(r)),p=br(g);let x=d[p],y=d[g];if(i){const b=p==="y"?"top":"left",m=p==="y"?"bottom":"right",w=x+f[b],v=x-f[m];x=Zo(w,x,v)}if(c){const b=g==="y"?"top":"left",m=g==="y"?"bottom":"right",w=y+f[b],v=y-f[m];y=Zo(w,y,v)}const h=a.fn({...t,[p]:x,[g]:y});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[p]:i,[g]:c}}}}}},Pa=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:a=!0,crossAxis:l=!0}=Ot(e,t),d={x:n,y:o},f=at(r),g=br(f);let p=d[g],x=d[f];const y=Ot(c,t),h=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(a){const w=g==="y"?"height":"width",v=s.reference[g]-s.floating[w]+h.mainAxis,E=s.reference[g]+s.reference[w]-h.mainAxis;p<v?p=v:p>E&&(p=E)}if(l){var b,m;const w=g==="y"?"width":"height",v=hi.has(rt(r)),E=s.reference[f]-s.floating[w]+(v&&((b=i.offset)==null?void 0:b[f])||0)+(v?0:h.crossAxis),S=s.reference[f]+s.reference[w]+(v?0:((m=i.offset)==null?void 0:m[f])||0)-(v?h.crossAxis:0);x<E?x=E:x>S&&(x=S)}return{[g]:p,[f]:x}}}},Aa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...l}=Ot(e,t),d=await i.detectOverflow(t,l),f=rt(r),g=Bt(r),p=at(r)==="y",{width:x,height:y}=s.floating;let h,b;f==="top"||f==="bottom"?(h=f,b=g===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(b=f,h=g==="end"?"top":"bottom");const m=y-d.top-d.bottom,w=x-d.left-d.right,v=on(y-d[h],m),E=on(x-d[b],w),S=!t.middlewareData.shift;let R=v,I=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(R=m),S&&!g){const K=ot(d.left,0),q=ot(d.right,0),D=ot(d.top,0),X=ot(d.bottom,0);p?I=x-2*(K!==0||q!==0?K+q:ot(d.left,d.right)):R=y-2*(D!==0||X!==0?D+X:ot(d.top,d.bottom))}await a({...t,availableWidth:I,availableHeight:R});const G=await i.getDimensions(c.floating);return x!==G.width||y!==G.height?{reset:{rects:!0}}:{}}}};function gi(e){const t=st(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ke(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=Yn(n)!==s||Yn(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Rr(e){return Ce(e)?e:e.contextElement}function nn(e){const t=Rr(e);if(!ke(t))return vt(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=gi(t);let i=(s?Yn(n.width):n.width)/o,c=(s?Yn(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Ta=vt(0);function bi(e){const t=_e(e);return!lo()||!t.visualViewport?Ta:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_e(e)?!1:t}function Kt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Rr(e);let i=vt(1);t&&(o?Ce(o)&&(i=nn(o)):i=nn(e));const c=Na(s,n,o)?bi(s):vt(0);let a=(r.left+c.x)/i.x,l=(r.top+c.y)/i.y,d=r.width/i.x,f=r.height/i.y;if(s){const g=_e(s),p=o&&Ce(o)?_e(o):o;let x=g,y=zo(x);for(;y&&o&&p!==x;){const h=nn(y),b=y.getBoundingClientRect(),m=st(y),w=b.left+(y.clientLeft+parseFloat(m.paddingLeft))*h.x,v=b.top+(y.clientTop+parseFloat(m.paddingTop))*h.y;a*=h.x,l*=h.y,d*=h.x,f*=h.y,a+=w,l+=v,x=_e(y),y=zo(x)}}return Jn({width:d,height:f,x:a,y:l})}function mo(e,t){const n=ao(e).scrollLeft;return t?t.left+n:Kt(Et(e)).left+n}function xi(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-mo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ka(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=Et(o),c=t?co(t.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},l=vt(1);const d=vt(0),f=ke(o);if((f||!f&&!s)&&((Ft(o)!=="body"||_t(i))&&(a=ao(o)),f)){const p=Kt(o);l=nn(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=i&&!f&&!s?xi(i,a):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+d.x+g.x,y:n.y*l.y-a.scrollTop*l.y+d.y+g.y}}function Ma(e){return Array.from(e.getClientRects())}function Da(e){const t=Et(e),n=ao(e),o=e.ownerDocument.body,r=ot(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=ot(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+mo(e);const c=-n.scrollTop;return st(o).direction==="rtl"&&(i+=ot(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const hs=25;function Va(e,t){const n=_e(e),o=Et(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const d=lo();(!d||d&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const l=mo(o);if(l<=0){const d=o.ownerDocument,f=d.body,g=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,x=Math.abs(o.clientWidth-f.clientWidth-p);x<=hs&&(s-=x)}else l<=hs&&(s+=l);return{width:s,height:i,x:c,y:a}}function La(e,t){const n=Kt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ke(e)?nn(e):vt(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,l=o*s.y;return{width:i,height:c,x:a,y:l}}function gs(e,t,n){let o;if(t==="viewport")o=Va(e,n);else if(t==="document")o=Da(Et(e));else if(Ce(t))o=La(t,n);else{const r=bi(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Jn(o)}function yi(e,t){const n=St(e);return n===t||!Ce(n)||It(n)?!1:st(n).position==="fixed"||yi(n,t)}function Fa(e,t){const n=t.get(e);if(n)return n;let o=Dt(e,[],!1).filter(c=>Ce(c)&&Ft(c)!=="body"),r=null;const s=st(e).position==="fixed";let i=s?St(e):e;for(;Ce(i)&&!It(i);){const c=st(i),a=pr(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||_t(i)&&!a&&yi(e,i))?o=o.filter(d=>d!==i):r=c,i=St(i)}return t.set(e,o),o}function _a(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?co(t)?[]:Fa(t,this._c):[].concat(n),o],c=gs(t,i[0],r);let a=c.top,l=c.right,d=c.bottom,f=c.left;for(let g=1;g<i.length;g++){const p=gs(t,i[g],r);a=ot(p.top,a),l=on(p.right,l),d=on(p.bottom,d),f=ot(p.left,f)}return{width:l-f,height:d-a,x:f,y:a}}function Ba(e){const{width:t,height:n}=gi(e);return{width:t,height:n}}function ja(e,t,n){const o=ke(t),r=Et(t),s=n==="fixed",i=Kt(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=vt(0);function l(){a.x=mo(r)}if(o||!o&&!s)if((Ft(t)!=="body"||_t(r))&&(c=ao(t)),o){const p=Kt(t,!0,s,t);a.x=p.x+t.clientLeft,a.y=p.y+t.clientTop}else r&&l();s&&!o&&r&&l();const d=r&&!o&&!s?xi(r,c):vt(0),f=i.left+c.scrollLeft-a.x-d.x,g=i.top+c.scrollTop-a.y-d.y;return{x:f,y:g,width:i.width,height:i.height}}function Bo(e){return st(e).position==="static"}function bs(e,t){if(!ke(e)||st(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Et(e)===n&&(n=n.ownerDocument.body),n}function vi(e,t){const n=_e(e);if(co(e))return n;if(!ke(e)){let r=St(e);for(;r&&!It(r);){if(Ce(r)&&!Bo(r))return r;r=St(r)}return n}let o=bs(e,t);for(;o&&ul(o)&&Bo(o);)o=bs(o,t);return o&&It(o)&&Bo(o)&&!pr(o)?n:o||pl(e)||n}const $a=async function(e){const t=this.getOffsetParent||vi,n=this.getDimensions,o=await n(e.floating);return{reference:ja(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ha(e){return st(e).direction==="rtl"}const Ua={convertOffsetParentRelativeRectToViewportRelativeRect:ka,getDocumentElement:Et,getClippingRect:_a,getOffsetParent:vi,getElementRects:$a,getClientRects:Ma,getDimensions:Ba,getScale:nn,isElement:Ce,isRTL:Ha};function Ei(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wa(e,t){let n=null,o;const r=Et(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const l=e.getBoundingClientRect(),{left:d,top:f,width:g,height:p}=l;if(c||t(),!g||!p)return;const x=Zt(f),y=Zt(r.clientWidth-(d+g)),h=Zt(r.clientHeight-(f+p)),b=Zt(d),w={rootMargin:-x+"px "+-y+"px "+-h+"px "+-b+"px",threshold:ot(0,on(1,a))||1};let v=!0;function E(S){const R=S[0].intersectionRatio;if(R!==a){if(!v)return i();R?i(!1,R):o=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!Ei(l,e.getBoundingClientRect())&&i(),v=!1}try{n=new IntersectionObserver(E,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return i(!0),s}function xs(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=Rr(e),d=r||s?[...l?Dt(l):[],...t?Dt(t):[]]:[];d.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=l&&c?Wa(l,n):null;let g=-1,p=null;i&&(p=new ResizeObserver(b=>{let[m]=b;m&&m.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),l&&!a&&p.observe(l),t&&p.observe(t));let x,y=a?Kt(e):null;a&&h();function h(){const b=Kt(e);y&&!Ei(y,b)&&n(),y=b,x=requestAnimationFrame(h)}return n(),()=>{var b;d.forEach(m=>{r&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),f?.(),(b=p)==null||b.disconnect(),p=null,a&&cancelAnimationFrame(x)}}const Ga=Sa,qa=Oa,Ka=wa,za=Aa,Ya=Ra,Xa=Pa,Ja=(e,t,n)=>{const o=new Map,r={platform:Ua,...n},s={...r.platform,_c:o};return Ca(e,t,{...r,platform:s})};var Qa=typeof document<"u",Za=function(){},qn=Qa?Ge.useLayoutEffect:Za;function oo(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!oo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!oo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Ci(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ys(e,t){const n=Ci(e);return Math.round(t*n)/n}function jo(e){const t=u.useRef(e);return qn(()=>{t.current=e}),t}function eu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=u.useState(o);oo(g,o)||p(o);const[x,y]=u.useState(null),[h,b]=u.useState(null),m=u.useCallback(F=>{F!==S.current&&(S.current=F,y(F))},[]),w=u.useCallback(F=>{F!==R.current&&(R.current=F,b(F))},[]),v=s||x,E=i||h,S=u.useRef(null),R=u.useRef(null),I=u.useRef(d),G=a!=null,K=jo(a),q=jo(r),D=jo(l),X=u.useCallback(()=>{if(!S.current||!R.current)return;const F={placement:t,strategy:n,middleware:g};q.current&&(F.platform=q.current),Ja(S.current,R.current,F).then(J=>{const ne={...J,isPositioned:D.current!==!1};Z.current&&!oo(I.current,ne)&&(I.current=ne,Yt.flushSync(()=>{f(ne)}))})},[g,t,n,q,D]);qn(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f(F=>({...F,isPositioned:!1})))},[l]);const Z=u.useRef(!1);qn(()=>(Z.current=!0,()=>{Z.current=!1}),[]),qn(()=>{if(v&&(S.current=v),E&&(R.current=E),v&&E){if(K.current)return K.current(v,E,X);X()}},[v,E,X,K,G]);const B=u.useMemo(()=>({reference:S,floating:R,setReference:m,setFloating:w}),[m,w]),M=u.useMemo(()=>({reference:v,floating:E}),[v,E]),U=u.useMemo(()=>{const F={position:n,left:0,top:0};if(!M.floating)return F;const J=ys(M.floating,d.x),ne=ys(M.floating,d.y);return c?{...F,transform:"translate("+J+"px, "+ne+"px)",...Ci(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:ne}},[n,c,M.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:X,refs:B,elements:M,floatingStyles:U}),[d,X,B,M,U])}const tu=(e,t)=>{const n=Ga(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{const n=qa(e);return{name:n.name,fn:n.fn,options:[e,t]}},ou=(e,t)=>({fn:Xa(e).fn,options:[e,t]}),ru=(e,t)=>{const n=Ka(e);return{name:n.name,fn:n.fn,options:[e,t]}},su=(e,t)=>{const n=za(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{const n=Ya(e);return{name:n.name,fn:n.fn,options:[e,t]}},cu={intentional:"onClick",sloppy:"onPointerDown"};function lu(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function au(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:a}=n.context,{enabled:l=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:g="sloppy",referencePress:p=!1,referencePressEvent:x="sloppy",ancestorScroll:y=!1,bubbles:h,externalTree:b}=t,m=po(b),w=Y(typeof f=="function"?f:()=>!1),v=typeof f=="function"?w:f,E=u.useRef(!1),{escapeKey:S,outsidePress:R}=lu(h),I=u.useRef(null),G=qt(),K=qt(),q=Y(()=>{K.clear(),a.current.insideReactTree=!1}),D=u.useRef(!1),X=u.useRef(""),Z=Y(O=>{X.current=O.pointerType}),B=Y(()=>{const O=X.current,k=O==="pen"||!O?"mouse":O,V=typeof g=="function"?g():g;return typeof V=="string"?V:V[k]}),M=Y(O=>{if(!o||!l||!d||O.key!=="Escape"||D.current)return;const k=a.current.floatingContext?.nodeId,V=m?en(m.nodesRef.current,k):[];if(!S&&V.length>0){let L=!0;if(V.forEach(_=>{_.context?.open&&!_.context.dataRef.current.__escapeKeyBubbles&&(L=!1)}),!L)return}const ie=Rl(O)?O.nativeEvent:O,C=ce(Ds,ie);n.setOpen(!1,C),!S&&!C.isPropagationAllowed&&O.stopPropagation()}),U=Y(O=>{const k=B();return k==="intentional"&&O.type!=="click"||k==="sloppy"&&O.type==="click"}),F=Y(()=>{a.current.insideReactTree=!0,K.start(0,q)}),J=Y((O,k=!1)=>{if(U(O)){q();return}if(a.current.insideReactTree){q();return}if(B()==="intentional"&&k||typeof v=="function"&&!v(O))return;const V=Ze(O),ie=`[${no("inert")}]`,C=Ne(n.select("floatingElement")).querySelectorAll(ie),L=n.context.triggerElements;if(V&&(L.hasElement(V)||L.hasMatchingElement(W=>me(W,V))))return;let _=Ce(V)?V:null;for(;_&&!It(_);){const W=St(_);if(It(W)||!Ce(W))break;_=W}if(C.length&&Ce(V)&&!wl(V)&&!me(V,n.select("floatingElement"))&&Array.from(C).every(W=>!me(_,W)))return;if(ke(V)&&!("touches"in O)){const W=It(V),te=st(V),ae=/auto|scroll/,De=W||ae.test(te.overflowX),Ke=W||ae.test(te.overflowY),Se=De&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,ge=Ke&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,Ae=te.direction==="rtl",ze=ge&&(Ae?O.offsetX<=V.offsetWidth-V.clientWidth:O.offsetX>V.clientWidth),Ue=Se&&O.offsetY>V.clientHeight;if(ze||Ue)return}const P=a.current.floatingContext?.nodeId,$=m&&en(m.nodesRef.current,P).some(W=>gt(O,W.context?.elements.floating));if(gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement"))||$)return;const T=m?en(m.nodesRef.current,P):[];if(T.length>0){let W=!0;if(T.forEach(te=>{te.context?.open&&!te.context.dataRef.current.__outsidePressBubbles&&(W=!1)}),!W)return}n.setOpen(!1,ce(lr,O)),q()}),ne=Y(O=>{B()!=="sloppy"||O.pointerType==="touch"||!n.select("open")||!l||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement"))||J(O)}),ye=Y(O=>{if(B()!=="sloppy"||!n.select("open")||!l||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement")))return;const k=O.touches[0];k&&(I.current={startTime:Date.now(),startX:k.clientX,startY:k.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},G.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}),ue=Y(O=>{const k=Ze(O);function V(){ye(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)}),he=Y(O=>{const k=E.current;if(E.current=!1,G.clear(),O.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const V=Ze(O);function ie(){O.type==="pointerdown"?ne(O):J(O,k),V?.removeEventListener(O.type,ie)}V?.addEventListener(O.type,ie)}),se=Y(O=>{if(B()!=="sloppy"||!I.current||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement")))return;const k=O.touches[0];if(!k)return;const V=Math.abs(k.clientX-I.current.startX),ie=Math.abs(k.clientY-I.current.startY),C=Math.sqrt(V*V+ie*ie);C>5&&(I.current.dismissOnTouchEnd=!0),C>10&&(J(O),G.clear(),I.current=null)}),pe=Y(O=>{const k=Ze(O);function V(){se(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)}),Me=Y(O=>{B()!=="sloppy"||!I.current||gt(O,n.select("floatingElement"))||gt(O,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&J(O),G.clear(),I.current=null)}),Ie=Y(O=>{const k=Ze(O);function V(){Me(O),k?.removeEventListener(O.type,V)}k?.addEventListener(O.type,V)});u.useEffect(()=>{if(!o||!l)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=R;const O=new sn;function k(_){n.setOpen(!1,ce(ct,_))}function V(){O.clear(),D.current=!0}function ie(){O.start(lo()?5:0,()=>{D.current=!1})}const C=Ne(r);C.addEventListener("pointerdown",Z,!0),d&&(C.addEventListener("keydown",M),C.addEventListener("compositionstart",V),C.addEventListener("compositionend",ie)),v&&(C.addEventListener("click",he,!0),C.addEventListener("pointerdown",he,!0),C.addEventListener("touchstart",ue,!0),C.addEventListener("touchmove",pe,!0),C.addEventListener("touchend",Ie,!0),C.addEventListener("mousedown",he,!0));let L=[];return y&&(Ce(i)&&(L=Dt(i)),Ce(r)&&(L=L.concat(Dt(r))),!Ce(s)&&s&&s.contextElement&&(L=L.concat(Dt(s.contextElement)))),L=L.filter(_=>_!==C.defaultView?.visualViewport),L.forEach(_=>{_.addEventListener("scroll",k,{passive:!0})}),()=>{C.removeEventListener("pointerdown",Z,!0),d&&(C.removeEventListener("keydown",M),C.removeEventListener("compositionstart",V),C.removeEventListener("compositionend",ie)),v&&(C.removeEventListener("click",he,!0),C.removeEventListener("pointerdown",he,!0),C.removeEventListener("touchstart",ue,!0),C.removeEventListener("touchmove",pe,!0),C.removeEventListener("touchend",Ie,!0),C.removeEventListener("mousedown",he,!0)),L.forEach(_=>{_.removeEventListener("scroll",k)}),O.clear(),E.current=!1}},[a,r,s,i,d,v,o,c,y,l,S,R,M,J,he,ne,ue,pe,Ie,Z,n]),u.useEffect(q,[v,q]);const we=u.useMemo(()=>({onKeyDown:M,...p&&{[cu[x]]:O=>{n.setOpen(!1,ce(Go,O.nativeEvent))},...x!=="intentional"&&{onClick(O){n.setOpen(!1,ce(Go,O.nativeEvent))}}}}),[M,n,p,x]),re=Y(O=>{const k=Ze(O.nativeEvent);!me(n.select("floatingElement"),k)||O.button!==0||(E.current=!0)}),fe=Y(O=>{!o||!l||O.button!==0||(E.current=!0)}),xe=u.useMemo(()=>({onKeyDown:M,onPointerDown:re,onMouseDown:re,onMouseUp:re,onClickCapture:F,onMouseDownCapture(O){F(),fe(O)},onPointerDownCapture(O){F(),fe(O)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[M,re,F,fe]);return u.useMemo(()=>l?{reference:we,floating:xe,trigger:we}:{},[l,we,xe])}Kn.createSelectorCreator({memoize:Kn.lruMemoize,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const z=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":bt(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var uu=Kn.requireShim();const fu=cr(19),du=fu?mu:hu;function A(e,t,n,o,r){return du(e,t,n,o,r)}function pu(e,t,n,o,r){const s=u.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return uu.useSyncExternalStore(e.subscribe,s,s)}function mu(e,t,n,o,r){return pu(e,t,n,o,r)}function hu(e,t,n,o,r){return Kn.withSelectorExports.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class wi{constructor(t){Pe(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Pe(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return A(this,t,n,o,r)}}class gu extends wi{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){u.useDebugValue(t),Q(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;Q(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){u.useDebugValue(t,i=>Object.keys(i));const r=u.useRef(Object.keys(t)).current,s=Object.keys(t);(r.length!==s.length||r.some((i,c)=>i!==s[c]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const o=Object.values(t);Q(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){u.useDebugValue(t);const o=n!==void 0;if(Q(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o]),process.env.NODE_ENV!=="production"){const r=this.controlledValues??(this.controlledValues=new Map);r.has(t)||r.set(t,o);const s=r.get(t);s!==void 0&&s!==o&&console.error(`A component is changing the ${o?"":"un"}controlled state of ${t.toString()} to be ${o?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return u.useDebugValue(t),A(this,this.selectors[t],n,o,r)}useContextCallback(t,n){u.useDebugValue(t);const o=Y(n??Re);this.context[t]=o}useStateSetter(t){const n=u.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const c=r;r=i,n(i,c,this)}})}}const bu={open:z(e=>e.open),domReferenceElement:z(e=>e.domReferenceElement),referenceElement:z(e=>e.positionReference??e.referenceElement),floatingElement:z(e=>e.floatingElement),floatingId:z(e=>e.floatingId)};class xu extends gu{constructor(n){const{nested:o,noEmit:r,onOpenChange:s,triggerElements:i,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:la(),nested:o,noEmit:r,triggerElements:i},bu);Pe(this,"setOpen",(n,o)=>{if((!n||!this.state.open||Ys(o.event))&&(this.context.dataRef.current.openEvent=n?o.event:void 0),!this.context.noEmit){const r={open:n,reason:o.reason,nativeEvent:o.event,nested:this.context.nested,triggerElement:o.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(n,o)})}}class yu{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);if(o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Ri(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=ar(),s=ai()!=null;if(process.env.NODE_ENV!=="production"){const c=o.reference;c&&!Ce(c)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=ut(()=>new xu({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new yu,floatingId:r,nested:s,noEmit:!1})).current;return Q(()=>{const c={open:t,floatingId:r};o.reference!==void 0&&(c.referenceElement=o.reference,c.domReferenceElement=Ce(o.reference)?o.reference:null),o.floating!==void 0&&(c.floatingElement=o.floating),i.update(c)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function vu(e={}){const{nodeId:t,externalTree:n}=e,o=Ri(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,c]=u.useState(null),a=u.useRef(null),l=po(n);Q(()=>{s.domReference&&(a.current=s.domReference)},[s.domReference]);const d=eu({...e,elements:{...s,...i&&{reference:i}}}),f=u.useCallback(R=>{const I=Ce(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;c(I),d.refs.setReference(I)},[d.refs]),[g,p]=u.useState(null),[x,y]=u.useState(null);r.useSyncedValue("referenceElement",g),r.useSyncedValue("domReferenceElement",Ce(g)?g:null),r.useSyncedValue("floatingElement",x);const h=u.useCallback(R=>{(Ce(R)||R===null)&&(a.current=R,p(R)),(Ce(d.refs.reference.current)||d.refs.reference.current===null||R!==null&&!Ce(R))&&d.refs.setReference(R)},[d.refs,p]),b=u.useCallback(R=>{y(R),d.refs.setFloating(R)},[d.refs]),m=u.useMemo(()=>({...d.refs,setReference:h,setFloating:b,setPositionReference:f,domReference:a}),[d.refs,h,b,f]),w=u.useMemo(()=>({...d.elements,domReference:s.domReference}),[d.elements,s.domReference]),v=r.useState("open"),E=r.useState("floatingId"),S=u.useMemo(()=>({...d,dataRef:r.context.dataRef,open:v,onOpenChange:r.setOpen,events:r.context.events,floatingId:E,refs:m,elements:w,nodeId:t,rootStore:r}),[d,m,w,t,r,v,E]);return Q(()=>{r.context.dataRef.current.floatingContext=S;const R=l?.nodesRef.current.find(I=>I.id===t);R&&(R.context=S)}),u.useMemo(()=>({...d,context:S,refs:m,elements:w,rootStore:r}),[d,m,w,S,r])}function Eu(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),o=e.map(l=>l?.item),r=e.map(l=>l?.trigger),s=u.useCallback(l=>jn(l,e,"reference"),t),i=u.useCallback(l=>jn(l,e,"floating"),n),c=u.useCallback(l=>jn(l,e,"item"),o),a=u.useCallback(l=>jn(l,e,"trigger"),r);return u.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:c,getTriggerProps:a}),[s,i,c,a])}function jn(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Xo]="");for(const i in e)r&&e&&(i===Gs||i===qs)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let c;const a=t[i]?.[n];typeof a=="function"?c=e?a(e):null:c=a,c&&vs(s,c,r,o)}return vs(s,e,r,o),s}function vs(e,t,n,o){for(const r in t){const s=t[r];n&&(r===Gs||r===qs)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(c=>c(...i)).find(c=>c!==void 0))):e[r]=s)}}const Cu="Escape";function ho(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function $n(e,t){return ho(t,e===hr||e===wn,e===Vt||e===Lt)}function $o(e,t,n){return ho(t,e===wn,n?e===Vt:e===Lt)||e==="Enter"||e===" "||e===""}function wu(e,t,n){return ho(t,n?e===Vt:e===Lt,e===wn)}function Ru(e,t,n,o){const r=n?e===Lt:e===Vt,s=e===hr;return t==="both"||t==="horizontal"&&o&&o>1?e===Cu:ho(t,r,s)}function Iu(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:c,activeIndex:a,onNavigate:l=()=>{},enabled:d=!0,selectedIndex:f=null,allowEscape:g=!1,loopFocus:p=!1,nested:x=!1,rtl:y=!1,virtual:h=!1,focusItemOnOpen:b="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:w=!0,disabledIndices:v=void 0,orientation:E="vertical",parentOrientation:S,cols:R=1,id:I,resetOnPointerLeave:G=!0,externalTree:K}=t;process.env.NODE_ENV!=="production"&&(g&&(p||console.warn("`useListNavigation` looping must be enabled to allow escaping."),h||console.warn("`useListNavigation` must be virtual to allow escaping.")),E==="vertical"&&R>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const q=Qo(r),D=lt(q),X=ai(),Z=po(K);Q(()=>{i.current.orientation=E},[i,E]);const B=Jo(s),M=u.useRef(b),U=u.useRef(f??-1),F=u.useRef(null),J=u.useRef(!0),ne=Y(P=>{l(U.current===-1?null:U.current,P)}),ye=u.useRef(ne),ue=u.useRef(!!r),he=u.useRef(o),se=u.useRef(!1),pe=u.useRef(!1),Me=lt(v),Ie=lt(o),we=lt(f),re=lt(G),fe=Y(()=>{function P(te){h?Z?.events.emit("virtualfocus",te):yn(te,{sync:se.current,preventScroll:!0})}const $=c.current[U.current],T=pe.current;$&&P($),(se.current?te=>te():requestAnimationFrame)(()=>{const te=c.current[U.current]||$;if(!te)return;$||P(te),O&&(T||!J.current)&&te.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Q(()=>{d&&(o&&r?(U.current=f??-1,M.current&&f!=null&&(pe.current=!0,ne())):ue.current&&(U.current=-1,ye.current()))},[d,o,r,f,ne]),Q(()=>{if(d){if(!o){se.current=!1;return}if(r)if(a==null){if(se.current=!1,we.current!=null)return;if(ue.current&&(U.current=-1,fe()),(!he.current||!ue.current)&&M.current&&(F.current!=null||M.current===!0&&F.current==null)){let P=0;const $=()=>{c.current[0]==null?(P<2&&(P?requestAnimationFrame:queueMicrotask)($),P+=1):(U.current=F.current==null||$o(F.current,E,y)||x?Lo(c):ns(c),F.current=null,ne())};$()}}else gn(c,a)||(U.current=a,fe(),pe.current=!1)}},[d,o,r,a,we,x,c,E,y,ne,fe,Me]),Q(()=>{if(!d||r||!Z||h||!ue.current)return;const P=Z.nodesRef.current,$=P.find(te=>te.id===X)?.context?.elements.floating,T=Rt(Ne(r)),W=P.some(te=>te.context&&me(te.context.elements.floating,T));$&&!W&&J.current&&$.focus({preventScroll:!0})},[d,r,Z,X,h]),Q(()=>{ye.current=ne,he.current=o,ue.current=!!r}),Q(()=>{o||(F.current=null,M.current=b)},[o,b]);const xe=a!=null,O=u.useMemo(()=>{function P(T){if(!Ie.current)return;const W=c.current.indexOf(T.currentTarget);W!==-1&&U.current!==W&&(U.current=W,ne(T))}return{onFocus(T){se.current=!0,P(T)},onClick:({currentTarget:T})=>T.focus({preventScroll:!0}),onMouseMove(T){se.current=!0,pe.current=!1,m&&P(T)},onPointerLeave(T){if(!Ie.current||!J.current||T.pointerType==="touch")return;se.current=!0;const W=T.relatedTarget;!m||c.current.includes(W)||re.current&&(yn(null,{sync:!0}),U.current=-1,ne(T),h||D.current?.focus({preventScroll:!0}))}}},[Ie,D,m,c,ne,re,h]),k=u.useCallback(()=>S??Z?.nodesRef.current.find(P=>P.id===X)?.context?.dataRef?.current.orientation,[X,Z,S]),V=Y(P=>{if(J.current=!1,se.current=!0,P.which===229||!Ie.current&&P.currentTarget===D.current)return;if(x&&Ru(P.key,E,y,R)){$n(P.key,k())||Ee(P),n.setOpen(!1,ce(hn,P.nativeEvent)),ke(s)&&(h?Z?.events.emit("virtualfocus",s):s.focus());return}const $=U.current,T=Lo(c,v),W=ns(c,v);if(B||(P.key==="Home"&&(Ee(P),U.current=T,ne(P)),P.key==="End"&&(Ee(P),U.current=W,ne(P))),R>1){const te=Array.from({length:c.current.length},()=>({width:1,height:1})),ae=Vl(te,R),De=ae.findIndex(ge=>ge!=null&&!bn(c,ge,v)),Ke=ae.reduce((ge,Ae,ze)=>Ae!=null&&!bn(c,Ae,v)?ze:ge,-1),Se=ae[Dl({current:ae.map(ge=>ge!=null?c.current[ge]:null)},{event:P,orientation:E,loopFocus:p,rtl:y,cols:R,disabledIndices:Fl([...(typeof v!="function"?v:null)||c.current.map((ge,Ae)=>bn(c,Ae,v)?Ae:void 0),void 0],ae),minIndex:De,maxIndex:Ke,prevIndex:Ll(U.current>W?T:U.current,te,ae,R,P.key===wn?"bl":P.key===(y?Vt:Lt)?"tr":"tl"),stopEvent:!0})];if(Se!=null&&(U.current=Se,ne(P)),E==="both")return}if($n(P.key,E)){if(Ee(P),o&&!h&&Rt(P.currentTarget.ownerDocument)===P.currentTarget){U.current=$o(P.key,E,y)?T:W,ne(P);return}$o(P.key,E,y)?p?$>=W?g&&$!==c.current.length?U.current=-1:(se.current=!1,U.current=T):U.current=$e(c,{startingIndex:$,disabledIndices:v}):U.current=Math.min(W,$e(c,{startingIndex:$,disabledIndices:v})):p?$<=T?g&&$!==-1?U.current=c.current.length:(se.current=!1,U.current=W):U.current=$e(c,{startingIndex:$,decrement:!0,disabledIndices:v}):U.current=Math.max(T,$e(c,{startingIndex:$,decrement:!0,disabledIndices:v})),gn(c,U.current)&&(U.current=-1),ne(P)}}),ie=u.useMemo(()=>h&&o&&xe&&{"aria-activedescendant":`${I}-${a}`},[h,o,xe,I,a]),C=u.useMemo(()=>({"aria-orientation":E==="both"?void 0:E,...B?{}:ie,onKeyDown(P){if(P.key==="Tab"&&P.shiftKey&&o&&!h){const $=Ze(P.nativeEvent);if($&&!me(D.current,$))return;Ee(P),n.setOpen(!1,ce(so,P.nativeEvent)),ke(s)&&s.focus();return}V(P)},onPointerMove(){J.current=!0}}),[ie,V,D,E,B,n,o,h,s]),L=u.useMemo(()=>{function P(T){b==="auto"&&Ks(T.nativeEvent)&&(M.current=!h)}function $(T){M.current=b,b==="auto"&&zs(T.nativeEvent)&&(M.current=!0)}return{onKeyDown(T){const W=n.select("open");J.current=!1;const te=T.key.startsWith("Arrow"),ae=wu(T.key,k(),y),De=$n(T.key,E),Ke=(x?ae:De)||T.key==="Enter"||T.key.trim()==="";if(h&&W)return V(T);if(!(!W&&!w&&te)){if(Ke){const Se=$n(T.key,k());F.current=x&&Se?null:T.key}if(x){ae&&(Ee(T),W?(U.current=Lo(c,Me.current),ne(T)):n.setOpen(!0,ce(hn,T.nativeEvent,T.currentTarget)));return}De&&(we.current!=null&&(U.current=we.current),Ee(T),!W&&w?n.setOpen(!0,ce(hn,T.nativeEvent,T.currentTarget)):V(T),W&&ne(T))}},onFocus(T){n.select("open")&&!h&&(U.current=-1,ne(T))},onPointerDown:$,onPointerEnter:$,onMouseDown:P,onClick:P}},[V,Me,b,c,x,ne,n,w,E,k,y,we,h]),_=u.useMemo(()=>({...ie,...L}),[ie,L]);return u.useMemo(()=>d?{reference:_,floating:C,item:O,trigger:L}:{},[d,_,C,L,O])}function Su(e,t){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,r=n.useState("open"),{listRef:s,activeIndex:i,onMatch:c,onTypingChange:a,enabled:l=!0,resetMs:d=750,selectedIndex:f=null}=t,g=qt(),p=u.useRef(""),x=u.useRef(f??i??-1),y=u.useRef(null);Q(()=>{!r&&f!==null||(g.clear(),y.current=null,p.current!==""&&(p.current=""))},[r,f,g]),Q(()=>{r&&p.current===""&&(x.current=f??i??-1)},[r,f,i]);const h=Y(E=>{E?o.current.typing||(o.current.typing=E,a?.(E)):o.current.typing&&(o.current.typing=E,a?.(E))}),b=Y(E=>{function S(D,X,Z){const B=X.find(M=>M?.toLocaleLowerCase().indexOf(Z.toLocaleLowerCase())===0);return B?D.indexOf(B):-1}const R=s.current;if(p.current.length>0&&p.current[0]!==" "&&(S(R,R,p.current)===-1?h(!1):E.key===" "&&Ee(E)),R==null||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;r&&E.key!==" "&&(Ee(E),h(!0));const I=p.current==="";I&&(x.current=f??i??-1),R.every(D=>D?D[0]?.toLocaleLowerCase()!==D[1]?.toLocaleLowerCase():!0)&&p.current===E.key&&(p.current="",x.current=y.current),p.current+=E.key,g.start(d,()=>{p.current="",x.current=y.current,h(!1)});const K=I?f??i??-1:x.current,q=S(R,[...R.slice((K||0)+1),...R.slice(0,(K||0)+1)],p.current);q!==-1?(c?.(q),y.current=q):E.key!==" "&&(p.current="",h(!1))}),m=Y(E=>{const S=E.relatedTarget,R=n.select("domReferenceElement"),I=n.select("floatingElement"),G=me(R,S),K=me(I,S);G||K||(g.clear(),p.current="",x.current=y.current,h(!1))}),w=u.useMemo(()=>({onKeyDown:b,onBlur:m}),[b,m]),v=u.useMemo(()=>({onKeyDown:b,onKeyUp(E){E.key===" "&&h(!1)},onBlur:m}),[b,m,h]);return u.useMemo(()=>l?{reference:w,floating:v}:{},[l,w,v])}function Ou(e){const t=u.useRef(""),n=u.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:u.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function Pu(e){const[t,n]=u.useState(null),o=Y((c,a)=>{e||n(a||(Ws?"touch":""))}),r=u.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Ou(o);return u.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}let Ir=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=En.startingStyle]="startingStyle",e[e.endingStyle=En.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),or=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Au={[or.popupOpen]:""},Tu={[or.popupOpen]:"",[or.pressed]:""},Nu={[Ir.open]:""},ku={[Ir.closed]:""},Mu={[Ir.anchorHidden]:""},Du={open(e){return e?Au:null}},Vu={open(e){return e?Tu:null}},Ii={open(e){return e?Nu:ku},anchorHidden(e){return e?Mu:null}};function Lu(e){return cr(19)?e:e?"true":void 0}const Si=u.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
|