@xyhp915/slack-base-ui 0.1.1 → 0.1.4
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/libs/Dialog.d.ts +1 -1
- package/libs/Dialog.d.ts.map +1 -1
- package/libs/Toast.d.ts +1 -1
- package/libs/index.js +9977 -10381
- package/libs/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/clsx/dist/clsx.mjs","../node_modules/@base-ui/utils/esm/error.js","../node_modules/@base-ui/utils/esm/useControlled.js","../node_modules/@base-ui/utils/esm/useRefWithInit.js","../node_modules/@base-ui/utils/esm/useStableCallback.js","../node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js","../node_modules/@base-ui/utils/esm/warn.js","../node_modules/@base-ui/react/esm/composite/list/CompositeListContext.js","../node_modules/@base-ui/react/esm/composite/list/CompositeList.js","../node_modules/@base-ui/react/esm/direction-provider/DirectionContext.js","../node_modules/@base-ui/utils/esm/formatErrorMessage.js","../node_modules/@base-ui/utils/esm/useMergedRefs.js","../node_modules/@base-ui/utils/esm/reactVersion.js","../node_modules/@base-ui/utils/esm/getReactElementRef.js","../node_modules/@base-ui/utils/esm/mergeObjects.js","../node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js","../node_modules/@base-ui/react/esm/utils/resolveClassName.js","../node_modules/@base-ui/react/esm/utils/resolveStyle.js","../node_modules/@base-ui/react/esm/merge-props/mergeProps.js","../node_modules/@base-ui/utils/esm/empty.js","../node_modules/@base-ui/react/esm/utils/constants.js","../node_modules/@base-ui/react/esm/utils/useRenderElement.js","../node_modules/@base-ui/react/esm/utils/reason-parts.js","../node_modules/@base-ui/react/esm/utils/createBaseUIEventDetails.js","../node_modules/@base-ui/utils/esm/safeReact.js","../node_modules/@base-ui/utils/esm/useId.js","../node_modules/@base-ui/react/esm/utils/useBaseUiId.js","../node_modules/@base-ui/utils/esm/useOnMount.js","../node_modules/@base-ui/utils/esm/useAnimationFrame.js","../node_modules/@base-ui/react/esm/utils/resolveRef.js","../node_modules/@base-ui/react/esm/utils/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/utils/useAnimationsFinished.js","../node_modules/@base-ui/react/esm/utils/useTransitionStatus.js","../node_modules/@base-ui/react/esm/composite/list/useCompositeListItem.js","../node_modules/@base-ui/utils/esm/isElementDisabled.js","../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../node_modules/@base-ui/react/esm/composite/root/CompositeRootContext.js","../node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js","../node_modules/@base-ui/react/esm/use-button/useButton.js","../node_modules/@base-ui/utils/esm/detectBrowser.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/shadowDom.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/nodes.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/event.js","../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js","../node_modules/@base-ui/utils/esm/owner.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/tabbable.js","../node_modules/@base-ui/react/esm/composite/composite.js","../node_modules/@base-ui/utils/esm/addEventListener.js","../node_modules/@base-ui/react/esm/utils/useOpenChangeComplete.js","../node_modules/@base-ui/utils/esm/useOnFirstRender.js","../node_modules/@base-ui/utils/esm/useTimeout.js","../node_modules/@base-ui/utils/esm/useScrollLock.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverShared.js","../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingDelayGroup.js","../node_modules/@base-ui/utils/esm/mergeCleanups.js","../node_modules/@base-ui/utils/esm/useValueAsRef.js","../node_modules/@base-ui/utils/esm/visuallyHidden.js","../node_modules/@base-ui/react/esm/utils/FocusGuard.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/createAttribute.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/enqueueFocus.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/markOthers.js","../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/createEventEmitter.js","../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTreeStore.js","../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTree.js","../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingFocusManager.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useClick.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useClientPoint.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useDismiss.js","../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","../node_modules/@base-ui/utils/esm/store/createSelector.js","../node_modules/reselect/dist/reselect.mjs","../node_modules/@base-ui/utils/esm/store/createSelectorMemoized.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../node_modules/use-sync-external-store/shim/index.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../node_modules/use-sync-external-store/shim/with-selector.js","../node_modules/@base-ui/utils/esm/fastHooks.js","../node_modules/@base-ui/utils/esm/store/useStore.js","../node_modules/@base-ui/utils/esm/store/Store.js","../node_modules/@base-ui/utils/esm/store/ReactStore.js","../node_modules/@base-ui/utils/esm/useForcedRerendering.js","../node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingRootStore.js","../node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js","../node_modules/@base-ui/react/esm/utils/popups/popupTriggerMap.js","../node_modules/@base-ui/react/esm/floating-ui-react/utils/getEmptyRootContext.js","../node_modules/@base-ui/react/esm/utils/popups/store.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useInteractions.js","../node_modules/@base-ui/utils/esm/isMouseWithinBounds.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useListNavigation.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useRole.js","../node_modules/@base-ui/react/esm/floating-ui-react/hooks/useTypeahead.js","../node_modules/@base-ui/react/esm/floating-ui-react/safePolygon.js","../node_modules/@base-ui/utils/esm/useEnhancedClickHandler.js","../node_modules/@base-ui/react/esm/utils/useValueChanged.js","../node_modules/@base-ui/react/esm/utils/useOpenInteractionType.js","../node_modules/@base-ui/react/esm/dialog/root/useDialogRoot.js","../node_modules/@base-ui/react/esm/dialog/root/DialogRootContext.js","../node_modules/@base-ui/react/esm/dialog/store/DialogStore.js","../node_modules/@base-ui/react/esm/dialog/root/DialogRoot.js","../node_modules/@base-ui/react/esm/utils/popupStateMapping.js","../node_modules/@base-ui/react/esm/dialog/backdrop/DialogBackdrop.js","../node_modules/@base-ui/react/esm/dialog/close/DialogClose.js","../node_modules/@base-ui/react/esm/dialog/description/DialogDescription.js","../node_modules/@base-ui/react/esm/dialog/popup/DialogPopupCssVars.js","../node_modules/@base-ui/react/esm/dialog/popup/DialogPopupDataAttributes.js","../node_modules/@base-ui/react/esm/dialog/portal/DialogPortalContext.js","../node_modules/@base-ui/react/esm/dialog/popup/DialogPopup.js","../node_modules/@base-ui/utils/esm/inertValue.js","../node_modules/@base-ui/react/esm/utils/InternalBackdrop.js","../node_modules/@base-ui/react/esm/dialog/portal/DialogPortal.js","../node_modules/@base-ui/react/esm/dialog/title/DialogTitle.js","../node_modules/@base-ui/react/esm/dialog/trigger/DialogTrigger.js","../node_modules/@base-ui/react/esm/combobox/root/ComboboxRootContext.js","../node_modules/@base-ui/react/esm/utils/itemEquality.js","../node_modules/@base-ui/react/esm/utils/serializeValue.js","../node_modules/@base-ui/react/esm/utils/resolveValueLabel.js","../node_modules/@base-ui/react/esm/combobox/store.js","../node_modules/@base-ui/react/esm/field/control/FieldControlDataAttributes.js","../node_modules/@base-ui/react/esm/field/utils/constants.js","../node_modules/@base-ui/react/esm/field/root/FieldRootContext.js","../node_modules/@base-ui/react/esm/field/root/useRegisterFieldControl.js","../node_modules/@base-ui/react/esm/form/FormContext.js","../node_modules/@base-ui/react/esm/labelable-provider/LabelableContext.js","../node_modules/@base-ui/react/esm/labelable-provider/useLabelableId.js","../node_modules/@base-ui/react/esm/combobox/root/utils/index.js","../node_modules/@base-ui/react/esm/combobox/root/utils/useFilter.js","../node_modules/@base-ui/react/esm/combobox/root/utils/constants.js","../node_modules/@base-ui/react/esm/combobox/root/AriaCombobox.js","../node_modules/@base-ui/react/esm/combobox/utils/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/utils/getPseudoElementBounds.js","../node_modules/@base-ui/react/esm/utils/resolveAriaLabelledBy.js","../node_modules/@base-ui/react/esm/combobox/trigger/ComboboxTrigger.js","../node_modules/@base-ui/react/esm/combobox/chips/ComboboxChipsContext.js","../node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositionerContext.js","../node_modules/@base-ui/react/esm/combobox/utils/ComboboxInternalDismissButton.js","../node_modules/@base-ui/react/esm/combobox/input/ComboboxInput.js","../node_modules/@base-ui/react/esm/combobox/utils/handleInputPress.js","../node_modules/@base-ui/react/esm/combobox/clear/ComboboxClear.js","../node_modules/@base-ui/react/esm/combobox/collection/GroupCollectionContext.js","../node_modules/@base-ui/react/esm/combobox/collection/ComboboxCollection.js","../node_modules/@base-ui/react/esm/combobox/list/ComboboxList.js","../node_modules/@base-ui/react/esm/combobox/utils/useInitialLiveRegionTextMutation.js","../node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortalContext.js","../node_modules/@base-ui/react/esm/combobox/portal/ComboboxPortal.js","../node_modules/@base-ui/react/esm/floating-ui-react/middleware/arrow.js","../node_modules/@base-ui/react/esm/utils/hideMiddleware.js","../node_modules/@base-ui/react/esm/utils/adaptiveOriginMiddleware.js","../node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js","../node_modules/@base-ui/react/esm/utils/getDisabledMountTransitionStyles.js","../node_modules/@base-ui/react/esm/utils/usePositioner.js","../node_modules/@base-ui/react/esm/utils/useAnchoredPopupScrollLock.js","../node_modules/@base-ui/react/esm/combobox/positioner/ComboboxPositioner.js","../node_modules/@base-ui/react/esm/combobox/popup/ComboboxPopup.js","../node_modules/@base-ui/react/esm/combobox/group/ComboboxGroupContext.js","../node_modules/@base-ui/react/esm/combobox/group/ComboboxGroup.js","../node_modules/@base-ui/react/esm/combobox/group-label/ComboboxGroupLabel.js","../node_modules/@base-ui/react/esm/combobox/item/ComboboxItemContext.js","../node_modules/@base-ui/react/esm/combobox/row/ComboboxRowContext.js","../node_modules/@base-ui/react/esm/combobox/item/ComboboxItem.js","../node_modules/@base-ui/react/esm/combobox/empty/ComboboxEmpty.js","../node_modules/@base-ui/react/esm/separator/Separator.js","../node_modules/@base-ui/react/esm/button/Button.js","../node_modules/@base-ui/react/esm/checkbox/root/CheckboxRootDataAttributes.js","../node_modules/@base-ui/react/esm/checkbox/utils/useStateAttributesMapping.js","../node_modules/@base-ui/react/esm/field/item/FieldItemContext.js","../node_modules/@base-ui/react/esm/labelable-provider/useAriaLabelledBy.js","../node_modules/@base-ui/react/esm/checkbox-group/CheckboxGroupContext.js","../node_modules/@base-ui/react/esm/checkbox/root/CheckboxRootContext.js","../node_modules/@base-ui/react/esm/checkbox/root/CheckboxRoot.js","../node_modules/@base-ui/react/esm/checkbox/indicator/CheckboxIndicator.js","../node_modules/@base-ui/react/esm/combobox/root/ComboboxRoot.js","../node_modules/@base-ui/react/esm/combobox/item-indicator/ComboboxItemIndicator.js","../node_modules/@base-ui/react/esm/combobox/chips/ComboboxChips.js","../node_modules/@base-ui/react/esm/combobox/chip/ComboboxChipContext.js","../node_modules/@base-ui/react/esm/combobox/chip/ComboboxChip.js","../node_modules/@base-ui/react/esm/combobox/chip-remove/ComboboxChipRemove.js","../node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRootContext.js","../node_modules/@base-ui/react/esm/menu/positioner/MenuPositionerContext.js","../node_modules/@base-ui/react/esm/menu/root/MenuRootContext.js","../node_modules/@base-ui/react/esm/menu/arrow/MenuArrow.js","../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemContext.js","../node_modules/@base-ui/react/esm/menu/item/useMenuItemCommonProps.js","../node_modules/@base-ui/react/esm/menu/item/useMenuItem.js","../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItemDataAttributes.js","../node_modules/@base-ui/react/esm/menu/utils/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/menu/checkbox-item/MenuCheckboxItem.js","../node_modules/@base-ui/react/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js","../node_modules/@base-ui/react/esm/menu/group/MenuGroupContext.js","../node_modules/@base-ui/react/esm/menu/group/MenuGroup.js","../node_modules/@base-ui/react/esm/menu/group-label/MenuGroupLabel.js","../node_modules/@base-ui/react/esm/menu/item/MenuItem.js","../node_modules/@base-ui/react/esm/toolbar/root/ToolbarRootContext.js","../node_modules/@base-ui/react/esm/menu/popup/MenuPopup.js","../node_modules/@base-ui/react/esm/menu/portal/MenuPortalContext.js","../node_modules/@base-ui/react/esm/menu/portal/MenuPortal.js","../node_modules/@base-ui/react/esm/menu/positioner/MenuPositioner.js","../node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroupContext.js","../node_modules/@base-ui/react/esm/menu/radio-group/MenuRadioGroup.js","../node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItemContext.js","../node_modules/@base-ui/react/esm/menu/radio-item/MenuRadioItem.js","../node_modules/@base-ui/react/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js","../node_modules/@base-ui/react/esm/menubar/MenubarContext.js","../node_modules/@base-ui/react/esm/menu/store/MenuStore.js","../node_modules/@base-ui/react/esm/menu/submenu-root/MenuSubmenuRootContext.js","../node_modules/@base-ui/react/esm/menu/root/MenuRoot.js","../node_modules/@base-ui/react/esm/composite/item/useCompositeItem.js","../node_modules/@base-ui/react/esm/composite/item/CompositeItem.js","../node_modules/@base-ui/react/esm/menu/utils/findRootOwnerId.js","../node_modules/@base-ui/react/esm/utils/popups/useTriggerFocusGuards.js","../node_modules/@base-ui/react/esm/utils/useMixedToggleClickHandler.js","../node_modules/@base-ui/react/esm/menu/trigger/MenuTrigger.js","../node_modules/@base-ui/utils/esm/usePreviousValue.js","../node_modules/@base-ui/react/esm/utils/getCssDimensions.js","../node_modules/@base-ui/react/esm/csp-provider/CSPContext.js","../node_modules/@base-ui/react/esm/utils/clamp.js","../node_modules/@base-ui/react/esm/fieldset/root/FieldsetRootContext.js","../node_modules/@base-ui/react/esm/field/control/FieldControl.js","../node_modules/@base-ui/react/esm/input/Input.js","../node_modules/@base-ui/react/esm/composite/constants.js","../node_modules/@base-ui/react/esm/composite/root/useCompositeRoot.js","../node_modules/@base-ui/react/esm/composite/root/CompositeRoot.js","../node_modules/@base-ui/react/esm/utils/formatNumber.js","../node_modules/@base-ui/react/esm/utils/valueToPercent.js","../node_modules/@base-ui/react/esm/popover/root/PopoverRootContext.js","../node_modules/@base-ui/react/esm/popover/store/PopoverStore.js","../node_modules/@base-ui/react/esm/popover/root/PopoverRoot.js","../node_modules/@base-ui/react/esm/popover/utils/constants.js","../node_modules/@base-ui/react/esm/popover/trigger/PopoverTrigger.js","../node_modules/@base-ui/react/esm/popover/portal/PopoverPortalContext.js","../node_modules/@base-ui/react/esm/popover/portal/PopoverPortal.js","../node_modules/@base-ui/react/esm/popover/positioner/PopoverPositionerContext.js","../node_modules/@base-ui/react/esm/popover/positioner/PopoverPositioner.js","../node_modules/@base-ui/react/esm/utils/closePart.js","../node_modules/@base-ui/react/esm/popover/popup/PopoverPopup.js","../node_modules/@base-ui/react/esm/popover/arrow/PopoverArrow.js","../node_modules/@base-ui/react/esm/popover/close/PopoverClose.js","../node_modules/@base-ui/react/esm/utils/FloatingPortalLite.js","../node_modules/@base-ui/react/esm/progress/root/ProgressRootContext.js","../node_modules/@base-ui/react/esm/progress/root/ProgressRootDataAttributes.js","../node_modules/@base-ui/react/esm/progress/root/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/progress/root/ProgressRoot.js","../node_modules/@base-ui/react/esm/progress/track/ProgressTrack.js","../node_modules/@base-ui/react/esm/progress/indicator/ProgressIndicator.js","../node_modules/@base-ui/react/esm/radio/root/RadioRootDataAttributes.js","../node_modules/@base-ui/react/esm/radio/utils/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/radio-group/RadioGroupContext.js","../node_modules/@base-ui/react/esm/radio/root/RadioRootContext.js","../node_modules/@base-ui/react/esm/radio/root/RadioRoot.js","../node_modules/@base-ui/react/esm/radio/indicator/RadioIndicator.js","../node_modules/@base-ui/react/esm/radio-group/RadioGroup.js","../node_modules/@base-ui/react/esm/utils/styles.js","../node_modules/@base-ui/react/esm/utils/scrollEdges.js","../node_modules/@base-ui/react/esm/select/root/SelectRootContext.js","../node_modules/@base-ui/react/esm/select/store.js","../node_modules/@base-ui/react/esm/select/root/SelectRoot.js","../node_modules/@base-ui/react/esm/select/trigger/SelectTrigger.js","../node_modules/@base-ui/react/esm/select/value/SelectValue.js","../node_modules/@base-ui/react/esm/select/icon/SelectIcon.js","../node_modules/@base-ui/react/esm/select/portal/SelectPortalContext.js","../node_modules/@base-ui/react/esm/select/portal/SelectPortal.js","../node_modules/@base-ui/react/esm/select/positioner/SelectPositionerContext.js","../node_modules/@base-ui/react/esm/select/popup/utils.js","../node_modules/@base-ui/react/esm/select/positioner/SelectPositioner.js","../node_modules/@base-ui/react/esm/select/popup/SelectPopup.js","../node_modules/@base-ui/react/esm/select/item/SelectItemContext.js","../node_modules/@base-ui/react/esm/select/item/SelectItem.js","../node_modules/@base-ui/react/esm/select/item-indicator/SelectItemIndicator.js","../node_modules/@base-ui/react/esm/select/item-text/SelectItemText.js","../node_modules/@base-ui/react/esm/select/scroll-arrow/SelectScrollArrow.js","../node_modules/@base-ui/react/esm/select/scroll-down-arrow/SelectScrollDownArrow.js","../node_modules/@base-ui/react/esm/select/scroll-up-arrow/SelectScrollUpArrow.js","../node_modules/@base-ui/react/esm/select/group/SelectGroupContext.js","../node_modules/@base-ui/react/esm/select/group/SelectGroup.js","../node_modules/@base-ui/react/esm/select/group-label/SelectGroupLabel.js","../node_modules/@base-ui/react/esm/utils/useIsHydrating.js","../node_modules/@base-ui/react/esm/switch/root/SwitchRootContext.js","../node_modules/@base-ui/react/esm/switch/root/SwitchRootDataAttributes.js","../node_modules/@base-ui/react/esm/switch/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/switch/root/SwitchRoot.js","../node_modules/@base-ui/react/esm/switch/thumb/SwitchThumb.js","../node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js","../node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js","../node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js","../node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js","../node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js","../node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js","../node_modules/@base-ui/react/esm/tabs/indicator/prehydrationScript.min.js","../node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicatorCssVars.js","../node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js","../node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js","../node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js","../node_modules/@base-ui/react/esm/tabs/list/TabsList.js","../node_modules/@base-ui/react/esm/toast/provider/ToastProviderContext.js","../node_modules/@base-ui/utils/esm/generateId.js","../node_modules/@base-ui/react/esm/toast/utils/resolvePromiseOptions.js","../node_modules/@base-ui/react/esm/toast/store.js","../node_modules/@base-ui/react/esm/toast/provider/ToastProvider.js","../node_modules/@base-ui/react/esm/toast/viewport/ToastViewportCssVars.js","../node_modules/@base-ui/react/esm/toast/viewport/ToastViewport.js","../node_modules/@base-ui/react/esm/toast/root/ToastRootContext.js","../node_modules/@base-ui/react/esm/toast/root/ToastRootCssVars.js","../node_modules/@base-ui/react/esm/toast/root/ToastRoot.js","../node_modules/@base-ui/react/esm/toast/description/ToastDescription.js","../node_modules/@base-ui/react/esm/toast/title/ToastTitle.js","../node_modules/@base-ui/react/esm/toast/close/ToastClose.js","../node_modules/@base-ui/react/esm/toast/useToastManager.js","../node_modules/@base-ui/react/esm/tooltip/root/TooltipRootContext.js","../node_modules/@base-ui/react/esm/tooltip/store/TooltipStore.js","../node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js","../node_modules/@base-ui/react/esm/tooltip/provider/TooltipProviderContext.js","../node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTriggerDataAttributes.js","../node_modules/@base-ui/react/esm/tooltip/utils/constants.js","../node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js","../node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortalContext.js","../node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortal.js","../node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositionerContext.js","../node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js","../node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js","../node_modules/@base-ui/react/esm/tooltip/arrow/TooltipArrow.js","../src/components/Button.tsx","../src/components/Avatar.tsx","../src/components/Badge.tsx","../src/components/Input.tsx","../src/components/IconButton.tsx","../src/components/Tooltip.tsx","../src/components/Popover.tsx","../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js","../node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js","../node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js","../node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js","../node_modules/lucide-react/dist/esm/Icon.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/check.js","../node_modules/lucide-react/dist/esm/icons/chevron-down.js","../node_modules/lucide-react/dist/esm/icons/chevron-right.js","../node_modules/lucide-react/dist/esm/icons/chevron-up.js","../node_modules/lucide-react/dist/esm/icons/circle-check-big.js","../node_modules/lucide-react/dist/esm/icons/circle-x.js","../node_modules/lucide-react/dist/esm/icons/info.js","../node_modules/lucide-react/dist/esm/icons/minus.js","../node_modules/lucide-react/dist/esm/icons/triangle-alert.js","../node_modules/lucide-react/dist/esm/icons/x.js","../src/components/Menu.tsx","../src/components/ContextMenu.tsx","../src/components/Dialog.tsx","../src/components/AlertDialog.tsx","../src/components/Form.tsx","../src/components/Select.tsx","../src/components/Checkbox.tsx","../src/components/Radio.tsx","../src/components/Switch.tsx","../src/components/Tabs.tsx","../src/components/Progress.tsx","../src/components/Toast.tsx","../src/components/Loading.tsx","../src/components/AutoComplete.tsx","../src/components/Combobox.tsx","../src/components/Dropdown.tsx"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","let set;\nif (process.env.NODE_ENV !== 'production') {\n set = new Set();\n}\nexport function error(...messages) {\n if (process.env.NODE_ENV !== 'production') {\n const messageKey = messages.join(' ');\n if (!set.has(messageKey)) {\n set.add(messageKey);\n console.error(`Base UI: ${messageKey}`);\n }\n }\n}\nexport function reset() {\n set?.clear();\n}","'use client';\n\n// TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- process.env never changes, dependency arrays are intentionally ignored\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nimport { error } from \"./error.js\";\nexport function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n error([`A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + '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('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) {\n error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [defaultProp]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}\nfunction serializeToDevModeString(input) {\n let nextId = 0;\n const seen = new WeakMap();\n try {\n const result = JSON.stringify(input, function replacer(key, value) {\n if (key === '_owner' && this != null && typeof this === 'object' && '$$typeof' in this) {\n return undefined;\n }\n if (typeof value === 'bigint') {\n return `__bigint__:${value}`;\n }\n if (value !== null && typeof value === 'object') {\n const id = seen.get(value);\n if (id !== undefined) {\n return `__object__:${id}`;\n }\n seen.set(value, nextId);\n nextId += 1;\n }\n return value;\n });\n return result ?? `__top__:${typeof input}`;\n } catch {\n return '__unserializable__';\n }\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useRefWithInit(sortColumns, columns)\n */\n\nexport function useRefWithInit(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.js\";\n\n// https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\nconst useInsertionEffect = React[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)];\nconst useSafeInsertionEffect =\n// React 17 doesn't have useInsertionEffect.\nuseInsertionEffect &&\n// Preact replaces useInsertionEffect with useLayoutEffect and fires too late.\nuseInsertionEffect !== React.useLayoutEffect ? useInsertionEffect : fn => fn();\n/**\n * Stabilizes the function passed so it's always the same between renders.\n *\n * The function becomes non-reactive to any values it captures.\n * It can safely be passed as a dependency of `React.useMemo` and `React.useEffect` without re-triggering them if its captured values change.\n *\n * The function must only be called inside effects and event handlers, never during render (which throws an error).\n *\n * This hook is a more permissive version of React 19.2's `React.useEffectEvent` in that it can be passed through contexts and called in event handler props, not just effects.\n */\nexport function useStableCallback(callback) {\n const stable = useRefWithInit(createStableCallback).current;\n stable.next = callback;\n useSafeInsertionEffect(stable.effect);\n return stable.trampoline;\n}\nfunction createStableCallback() {\n const stable = {\n next: undefined,\n callback: assertNotCalled,\n trampoline: (...args) => stable.callback?.(...args),\n effect: () => {\n stable.callback = stable.next;\n }\n };\n return stable;\n}\nfunction assertNotCalled() {\n if (process.env.NODE_ENV !== 'production') {\n throw /* minify-error-disabled */new Error('Base UI: Cannot call an event handler while rendering.');\n }\n}","'use client';\n\nimport * as React from 'react';\nconst noop = () => {};\nexport const useIsoLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : noop;","let set;\nif (process.env.NODE_ENV !== 'production') {\n set = new Set();\n}\nexport function warn(...messages) {\n if (process.env.NODE_ENV !== 'production') {\n const messageKey = messages.join(' ');\n if (!set.has(messageKey)) {\n set.add(messageKey);\n console.warn(`Base UI: ${messageKey}`);\n }\n }\n}","'use client';\n\nimport * as React from 'react';\nexport const CompositeListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n subscribeMapChange: () => {\n return () => {};\n },\n elementsRef: {\n current: []\n },\n nextIndexRef: {\n current: 0\n }\n});\nif (process.env.NODE_ENV !== \"production\") CompositeListContext.displayName = \"CompositeListContext\";\nexport function useCompositeListContext() {\n return React.useContext(CompositeListContext);\n}","/* eslint-disable no-bitwise */\n'use client';\n\nimport * as React from 'react';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { CompositeListContext } from \"./CompositeListContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Provides context for a list of items in a composite component.\n * @internal\n */\nexport function CompositeList(props) {\n const {\n children,\n elementsRef,\n labelsRef,\n onMapChange: onMapChangeProp\n } = props;\n const onMapChange = useStableCallback(onMapChangeProp);\n const nextIndexRef = React.useRef(0);\n const listeners = useRefWithInit(createListeners).current;\n\n // We use a stable `map` to avoid O(n^2) re-allocation costs for large lists.\n // `mapTick` is our re-render trigger mechanism. We also need to update the\n // elements and label refs, but there's a lot of async work going on and sometimes\n // the effect that handles `onMapChange` gets called after those refs have been\n // filled, and we don't want to lose those values by setting their lengths to `0`.\n // We also need to have them at the proper length because floating-ui uses that\n // information for list navigation.\n\n const map = useRefWithInit(createMap).current;\n // `mapTick` uses a counter rather than objects for low precision-loss risk and better memory efficiency\n const [mapTick, setMapTick] = React.useState(0);\n const lastTickRef = React.useRef(mapTick);\n const register = useStableCallback((node, metadata) => {\n map.set(node, metadata ?? null);\n lastTickRef.current += 1;\n setMapTick(lastTickRef.current);\n });\n const unregister = useStableCallback(node => {\n map.delete(node);\n lastTickRef.current += 1;\n setMapTick(lastTickRef.current);\n });\n const sortedMap = React.useMemo(() => {\n // `mapTick` is the `useMemo` trigger as `map` is stable.\n disableEslintWarning(mapTick);\n const newMap = new Map();\n // Filter out disconnected elements before sorting to avoid inconsistent\n // compareDocumentPosition results when elements are detached from the DOM.\n const sortedNodes = Array.from(map.keys()).filter(node => node.isConnected).sort(sortByDocumentPosition);\n sortedNodes.forEach((node, index) => {\n const metadata = map.get(node) ?? {};\n newMap.set(node, {\n ...metadata,\n index\n });\n });\n return newMap;\n }, [map, mapTick]);\n useIsoLayoutEffect(() => {\n if (typeof MutationObserver !== 'function' || sortedMap.size === 0) {\n return undefined;\n }\n const mutationObserver = new MutationObserver(entries => {\n const diff = new Set();\n const updateDiff = node => diff.has(node) ? diff.delete(node) : diff.add(node);\n entries.forEach(entry => {\n entry.removedNodes.forEach(updateDiff);\n entry.addedNodes.forEach(updateDiff);\n });\n if (diff.size === 0) {\n lastTickRef.current += 1;\n setMapTick(lastTickRef.current);\n }\n });\n sortedMap.forEach((_, node) => {\n if (node.parentElement) {\n mutationObserver.observe(node.parentElement, {\n childList: true\n });\n }\n });\n return () => {\n mutationObserver.disconnect();\n };\n }, [sortedMap]);\n useIsoLayoutEffect(() => {\n const shouldUpdateLengths = lastTickRef.current === mapTick;\n if (shouldUpdateLengths) {\n if (elementsRef.current.length !== sortedMap.size) {\n elementsRef.current.length = sortedMap.size;\n }\n if (labelsRef && labelsRef.current.length !== sortedMap.size) {\n labelsRef.current.length = sortedMap.size;\n }\n nextIndexRef.current = sortedMap.size;\n }\n onMapChange(sortedMap);\n }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]);\n useIsoLayoutEffect(() => {\n return () => {\n elementsRef.current = [];\n };\n }, [elementsRef]);\n useIsoLayoutEffect(() => {\n return () => {\n if (labelsRef) {\n labelsRef.current = [];\n }\n };\n }, [labelsRef]);\n const subscribeMapChange = useStableCallback(fn => {\n listeners.add(fn);\n return () => {\n listeners.delete(fn);\n };\n });\n useIsoLayoutEffect(() => {\n listeners.forEach(l => l(sortedMap));\n }, [listeners, sortedMap]);\n const contextValue = React.useMemo(() => ({\n register,\n unregister,\n subscribeMapChange,\n elementsRef,\n labelsRef,\n nextIndexRef\n }), [register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]);\n return /*#__PURE__*/_jsx(CompositeListContext.Provider, {\n value: contextValue,\n children: children\n });\n}\nfunction createMap() {\n return new Map();\n}\nfunction createListeners() {\n return new Set();\n}\nfunction sortByDocumentPosition(a, b) {\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1;\n }\n return 0;\n}\nfunction disableEslintWarning(_) {}","'use client';\n\nimport * as React from 'react';\n/**\n * @internal\n */\nexport const DirectionContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DirectionContext.displayName = \"DirectionContext\";\nexport function useDirection() {\n const context = React.useContext(DirectionContext);\n return context?.direction ?? 'ltr';\n}","/**\n * Creates a formatErrorMessage function with a custom URL and prefix.\n * @param baseUrl - The base URL for the error page (e.g., 'https://base-ui.com/production-error')\n * @param prefix - The prefix for the error message (e.g., 'Base UI')\n * @returns A function that formats error messages with the given URL and prefix\n */\nexport function createFormatErrorMessage(baseUrl, prefix) {\n return function formatErrorMessage(code, ...args) {\n const url = new URL(baseUrl);\n url.searchParams.set('code', code.toString());\n args.forEach(arg => url.searchParams.append('args[]', arg));\n return `${prefix} error #${code}; visit ${url} for the full message.`;\n };\n}\n\n/**\n * WARNING: Don't import this directly. It's imported by the code generated by\n * `@mui/internal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`\n * constructors to ensure the plugin works as expected. Supported patterns include:\n * throw new Error('My message');\n * throw new Error(`My message: ${foo}`);\n * throw new Error(`My message: ${foo}` + 'another string');\n * ...\n */\nconst formatErrorMessage = createFormatErrorMessage('https://base-ui.com/production-error', 'Base UI');\nexport default formatErrorMessage;","import { useRefWithInit } from \"./useRefWithInit.js\";\n\n/**\n * Merges refs into a single memoized callback ref or `null`.\n * This makes sure multiple refs are updated together and have the same value.\n *\n * This function accepts up to four refs. If you need to merge more, or have an unspecified number of refs to merge,\n * use `useMergedRefsN` instead.\n */\n\nexport function useMergedRefs(a, b, c, d) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChange(forkRef, a, b, c, d)) {\n update(forkRef, [a, b, c, d]);\n }\n return forkRef.callback;\n}\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n *\n * If you need to merge a fixed number (up to four) of refs, use `useMergedRefs` instead for better performance.\n */\nexport function useMergedRefsN(refs) {\n const forkRef = useRefWithInit(createForkRef).current;\n if (didChangeN(forkRef, refs)) {\n update(forkRef, refs);\n }\n return forkRef.callback;\n}\nfunction createForkRef() {\n return {\n callback: null,\n cleanup: null,\n refs: []\n };\n}\nfunction didChange(forkRef, a, b, c, d) {\n // prettier-ignore\n return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;\n}\nfunction didChangeN(forkRef, newRefs) {\n return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);\n}\nfunction update(forkRef, refs) {\n forkRef.refs = refs;\n if (refs.every(ref => ref == null)) {\n forkRef.callback = null;\n return;\n }\n forkRef.callback = instance => {\n if (forkRef.cleanup) {\n forkRef.cleanup();\n forkRef.cleanup = null;\n }\n if (instance != null) {\n const cleanupCallbacks = Array(refs.length).fill(null);\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const refCleanup = ref(instance);\n if (typeof refCleanup === 'function') {\n cleanupCallbacks[i] = refCleanup;\n }\n break;\n }\n case 'object':\n {\n ref.current = instance;\n break;\n }\n default:\n }\n }\n forkRef.cleanup = () => {\n for (let i = 0; i < refs.length; i += 1) {\n const ref = refs[i];\n if (ref == null) {\n continue;\n }\n switch (typeof ref) {\n case 'function':\n {\n const cleanupCallback = cleanupCallbacks[i];\n if (typeof cleanupCallback === 'function') {\n cleanupCallback();\n } else {\n ref(null);\n }\n break;\n }\n case 'object':\n {\n ref.current = null;\n break;\n }\n default:\n }\n }\n };\n }\n };\n}","import * as React from 'react';\nconst majorVersion = parseInt(React.version, 10);\nexport function isReactVersionAtLeast(reactVersionToCheck) {\n return majorVersion >= reactVersionToCheck;\n}","import * as React from 'react';\nimport { isReactVersionAtLeast } from \"./reactVersion.js\";\n\n/**\n * Extracts the `ref` from a React element, handling different React versions.\n */\nexport function getReactElementRef(element) {\n if (! /*#__PURE__*/React.isValidElement(element)) {\n return null;\n }\n const reactElement = element;\n const propsWithRef = reactElement.props;\n return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;\n}","export function mergeObjects(a, b) {\n if (a && !b) {\n return a;\n }\n if (!a && b) {\n return b;\n }\n if (a || b) {\n return {\n ...a,\n ...b\n };\n }\n return undefined;\n}","export function getStateAttributesProps(state, customMapping) {\n const props = {};\n\n /* eslint-disable-next-line guard-for-in */\n for (const key in state) {\n const value = state[key];\n if (customMapping?.hasOwnProperty(key)) {\n const customProps = customMapping[key](value);\n if (customProps != null) {\n Object.assign(props, customProps);\n }\n continue;\n }\n if (value === true) {\n props[`data-${key.toLowerCase()}`] = '';\n } else if (value) {\n props[`data-${key.toLowerCase()}`] = value.toString();\n }\n }\n return props;\n}","/**\n * If the provided className is a string, it will be returned as is.\n * Otherwise, the function will call the className function with the state as the first argument.\n *\n * @param className\n * @param state\n */\nexport function resolveClassName(className, state) {\n return typeof className === 'function' ? className(state) : className;\n}","/**\n * If the provided style is an object, it will be returned as is.\n * Otherwise, the function will call the style function with the state as the first argument.\n *\n * @param style\n * @param state\n */\nexport function resolveStyle(style, state) {\n return typeof style === 'function' ? style(state) : style;\n}","import { mergeObjects } from '@base-ui/utils/mergeObjects';\nconst EMPTY_PROPS = {};\n\n/* eslint-disable id-denylist */\n/**\n * Merges multiple sets of React props. It follows the Object.assign pattern where the rightmost object's fields overwrite\n * the conflicting ones from others. This doesn't apply to event handlers, `className` and `style` props.\n *\n * Event handlers are merged and called in right-to-left order (rightmost handler executes first, leftmost last).\n * For React synthetic events, the rightmost handler can prevent prior (left-positioned) handlers from executing\n * by calling `event.preventBaseUIHandler()`. For non-synthetic events (custom events with primitive/object values),\n * all handlers always execute without prevention capability.\n *\n * The `className` prop is merged by concatenating classes in right-to-left order (rightmost class appears first in the string).\n * The `style` prop is merged with rightmost styles overwriting the prior ones.\n *\n * Props can either be provided as objects or as functions that take the previous props as an argument.\n * The function will receive the merged props up to that point (going from left to right):\n * so in the case of `(obj1, obj2, fn, obj3)`, `fn` will receive the merged props of `obj1` and `obj2`.\n * The function is responsible for chaining event handlers if needed (that is, we don't run the merge logic).\n *\n * Event handlers returned by the functions are not automatically prevented when `preventBaseUIHandler` is called.\n * They must check `event.baseUIHandlerPrevented` themselves and bail out if it's true.\n *\n * @important **`ref` is not merged.**\n * @param a Props object to merge.\n * @param b Props object to merge. The function will overwrite conflicting props from `a`.\n * @param c Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param d Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @param e Props object to merge. The function will overwrite conflicting props from previous parameters.\n * @returns The merged props.\n * @public\n */\n\nexport function mergeProps(a, b, c, d, e) {\n if (!c && !d && !e && !a) {\n return createInitialMergedProps(b);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(a);\n if (b) {\n merged = mergeInto(merged, b);\n }\n if (c) {\n merged = mergeInto(merged, c);\n }\n if (d) {\n merged = mergeInto(merged, d);\n }\n if (e) {\n merged = mergeInto(merged, e);\n }\n return merged;\n}\n/* eslint-enable id-denylist */\n\n/**\n * Merges an arbitrary number of React props using the same logic as {@link mergeProps}.\n * This function accepts an array of props instead of individual arguments.\n *\n * This has slightly lower performance than {@link mergeProps} due to accepting an array\n * instead of a fixed number of arguments. Prefer {@link mergeProps} when merging 5 or\n * fewer prop sets for better performance.\n *\n * @param props Array of props to merge.\n * @returns The merged props.\n * @see mergeProps\n * @public\n */\nexport function mergePropsN(props) {\n if (props.length === 0) {\n return EMPTY_PROPS;\n }\n if (props.length === 1) {\n return createInitialMergedProps(props[0]);\n }\n\n // We need to mutably own `merged`.\n let merged = createInitialMergedProps(props[0]);\n for (let i = 1; i < props.length; i += 1) {\n merged = mergeInto(merged, props[i]);\n }\n return merged;\n}\nfunction createInitialMergedProps(inputProps) {\n if (isPropsGetter(inputProps)) {\n // Getter-returned handlers intentionally keep their existing semantics.\n return {\n ...resolvePropsGetter(inputProps, EMPTY_PROPS)\n };\n }\n return copyInitialProps(inputProps);\n}\nfunction mergeInto(merged, inputProps) {\n if (isPropsGetter(inputProps)) {\n return resolvePropsGetter(inputProps, merged);\n }\n return mutablyMergeInto(merged, inputProps);\n}\nfunction copyInitialProps(inputProps) {\n const copiedProps = {\n ...inputProps\n };\n\n // `copiedProps` is our fresh own-object copy, so iterating with `for...in` is safe here.\n // eslint-disable-next-line guard-for-in\n for (const propName in copiedProps) {\n const propValue = copiedProps[propName];\n if (isEventHandler(propName, propValue)) {\n copiedProps[propName] = wrapEventHandler(propValue);\n }\n }\n return copiedProps;\n}\n\n/**\n * Merges two sets of props. In case of conflicts, the external props take precedence.\n */\nfunction mutablyMergeInto(mergedProps, externalProps) {\n if (!externalProps) {\n return mergedProps;\n }\n\n // eslint-disable-next-line guard-for-in\n for (const propName in externalProps) {\n const externalPropValue = externalProps[propName];\n switch (propName) {\n case 'style':\n {\n mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);\n break;\n }\n case 'className':\n {\n mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);\n break;\n }\n default:\n {\n if (isEventHandler(propName, externalPropValue)) {\n mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);\n } else {\n mergedProps[propName] = externalPropValue;\n }\n }\n }\n }\n return mergedProps;\n}\nfunction isEventHandler(key, value) {\n // This approach is more efficient than using a regex.\n const code0 = key.charCodeAt(0);\n const code1 = key.charCodeAt(1);\n const code2 = key.charCodeAt(2);\n return code0 === 111 /* o */ && code1 === 110 /* n */ && code2 >= 65 /* A */ && code2 <= 90 /* Z */ && (typeof value === 'function' || typeof value === 'undefined');\n}\nfunction isPropsGetter(inputProps) {\n return typeof inputProps === 'function';\n}\nfunction resolvePropsGetter(inputProps, previousProps) {\n if (isPropsGetter(inputProps)) {\n return inputProps(previousProps);\n }\n return inputProps ?? EMPTY_PROPS;\n}\nfunction mergeEventHandlers(ourHandler, theirHandler) {\n if (!theirHandler) {\n return ourHandler;\n }\n if (!ourHandler) {\n return wrapEventHandler(theirHandler);\n }\n return event => {\n if (isSyntheticEvent(event)) {\n const baseUIEvent = event;\n makeEventPreventable(baseUIEvent);\n const result = theirHandler(baseUIEvent);\n if (!baseUIEvent.baseUIHandlerPrevented) {\n ourHandler?.(baseUIEvent);\n }\n return result;\n }\n const result = theirHandler(event);\n ourHandler?.(event);\n return result;\n };\n}\nfunction wrapEventHandler(handler) {\n if (!handler) {\n return handler;\n }\n return event => {\n if (isSyntheticEvent(event)) {\n makeEventPreventable(event);\n }\n return handler(event);\n };\n}\nexport function makeEventPreventable(event) {\n event.preventBaseUIHandler = () => {\n event.baseUIHandlerPrevented = true;\n };\n return event;\n}\nexport function mergeClassNames(ourClassName, theirClassName) {\n if (theirClassName) {\n if (ourClassName) {\n // eslint-disable-next-line prefer-template\n return theirClassName + ' ' + ourClassName;\n }\n return theirClassName;\n }\n return ourClassName;\n}\nfunction isSyntheticEvent(event) {\n return event != null && typeof event === 'object' && 'nativeEvent' in event;\n}","export function NOOP() {}\nexport const EMPTY_ARRAY = Object.freeze([]);\nexport const EMPTY_OBJECT = Object.freeze({});","export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport { EMPTY_OBJECT, EMPTY_ARRAY } from '@base-ui/utils/empty';\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};","import _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';\nimport { getReactElementRef } from '@base-ui/utils/getReactElementRef';\nimport { mergeObjects } from '@base-ui/utils/mergeObjects';\nimport { warn } from '@base-ui/utils/warn';\nimport { getStateAttributesProps } from \"./getStateAttributesProps.js\";\nimport { resolveClassName } from \"./resolveClassName.js\";\nimport { resolveStyle } from \"./resolveStyle.js\";\nimport { mergeProps, mergePropsN, mergeClassNames } from \"../merge-props/index.js\";\nimport { EMPTY_OBJECT } from \"./constants.js\";\nimport { createElement as _createElement } from \"react\";\n/**\n * Renders a Base UI element.\n *\n * @param element The default HTML element to render. Can be overridden by the `render` prop.\n * @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.\n * @param params Additional parameters for rendering the element.\n */\nexport function useRenderElement(element, componentProps, params = {}) {\n const renderProp = componentProps.render;\n const outProps = useRenderElementProps(componentProps, params);\n if (params.enabled === false) {\n return null;\n }\n const state = params.state ?? EMPTY_OBJECT;\n return evaluateRenderProp(element, renderProp, outProps, state);\n}\n\n/**\n * Computes render element final props.\n */\nfunction useRenderElementProps(componentProps, params = {}) {\n const {\n className: classNameProp,\n style: styleProp,\n render: renderProp\n } = componentProps;\n const {\n state = EMPTY_OBJECT,\n ref,\n props,\n stateAttributesMapping,\n enabled = true\n } = params;\n const className = enabled ? resolveClassName(classNameProp, state) : undefined;\n const style = enabled ? resolveStyle(styleProp, state) : undefined;\n const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;\n const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : undefined;\n\n // Ensure outProps is always a new mutable object when enabled, never EMPTY_OBJECT.\n // This prevents potential TypeError when setting ref, className, or style properties,\n // since EMPTY_OBJECT is frozen and mutations would fail in strict mode.\n const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;\n\n // SAFETY: The `useMergedRefs` functions use a single hook to store the same value,\n // switching between them at runtime is safe. If this assertion fails, React will\n // throw at runtime anyway.\n // This also skips the `useMergedRefs` call on the server, which is fine because\n // refs are not used on the server side.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (typeof document !== 'undefined') {\n if (!enabled) {\n useMergedRefs(null, null);\n } else if (Array.isArray(ref)) {\n outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);\n } else {\n outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);\n }\n }\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n if (className !== undefined) {\n outProps.className = mergeClassNames(outProps.className, className);\n }\n if (style !== undefined) {\n outProps.style = mergeObjects(outProps.style, style);\n }\n return outProps;\n}\nfunction resolveRenderFunctionProps(props) {\n if (Array.isArray(props)) {\n return mergePropsN(props);\n }\n return mergeProps(undefined, props);\n}\n\n// The symbol React uses internally for lazy components\n// https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/shared/ReactSymbols.js#L31\n//\n// TODO delete once https://github.com/facebook/react/issues/32392 is fixed\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\nconst COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;\nconst LOWERCASE_CHARACTER_PATTERN = /[a-z]/;\nfunction evaluateRenderProp(element, render, props, state) {\n if (render) {\n if (typeof render === 'function') {\n if (process.env.NODE_ENV !== 'production') {\n warnIfRenderPropLooksLikeComponent(render);\n }\n return render(props, state);\n }\n const mergedProps = mergeProps(props, render.props);\n mergedProps.ref = props.ref;\n let newElement = render;\n\n // Workaround for https://github.com/facebook/react/issues/32392\n // This works because the toArray() logic unwrap lazy element type in\n // https://github.com/facebook/react/blob/a0566250b210499b4c5677f5ac2eedbd71d51a1b/packages/react/src/ReactChildren.js#L186\n if (newElement?.$$typeof === REACT_LAZY_TYPE) {\n const children = React.Children.toArray(render);\n newElement = children[0];\n }\n\n // There is a high number of indirections, the error message thrown by React.cloneElement() is\n // hard to use for developers, this logic provides a better context.\n //\n // Our general guideline is to never change the control flow depending on the environment.\n // However, React.cloneElement() throws if React.isValidElement() is false,\n // so we can throw before with custom message.\n if (process.env.NODE_ENV !== 'production') {\n if (! /*#__PURE__*/React.isValidElement(newElement)) {\n 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('\\n'));\n }\n }\n return /*#__PURE__*/React.cloneElement(newElement, mergedProps);\n }\n if (element) {\n if (typeof element === 'string') {\n return renderTag(element, props);\n }\n }\n // Unreachable, but the typings on `useRenderElement` need to be reworked\n // to annotate it correctly.\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: Render element or function are not defined.' : _formatErrorMessage(8));\n}\nfunction warnIfRenderPropLooksLikeComponent(renderFn) {\n const functionName = renderFn.name;\n if (functionName.length === 0) {\n return;\n }\n if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {\n return;\n }\n if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {\n return;\n }\n warn(`The \\`render\\` prop received a function named \\`${functionName}\\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');\n}\nfunction renderTag(Tag, props) {\n if (Tag === 'button') {\n return /*#__PURE__*/_createElement(\"button\", {\n type: \"button\",\n ...props,\n key: props.key\n });\n }\n if (Tag === 'img') {\n return /*#__PURE__*/_createElement(\"img\", {\n alt: \"\",\n ...props,\n key: props.key\n });\n }\n return /*#__PURE__*/React.createElement(Tag, props);\n}","export const none = 'none';\nexport const triggerPress = 'trigger-press';\nexport const triggerHover = 'trigger-hover';\nexport const triggerFocus = 'trigger-focus';\nexport const outsidePress = 'outside-press';\nexport const itemPress = 'item-press';\nexport const closePress = 'close-press';\nexport const linkPress = 'link-press';\nexport const clearPress = 'clear-press';\nexport const chipRemovePress = 'chip-remove-press';\nexport const trackPress = 'track-press';\nexport const incrementPress = 'increment-press';\nexport const decrementPress = 'decrement-press';\nexport const inputChange = 'input-change';\nexport const inputClear = 'input-clear';\nexport const inputBlur = 'input-blur';\nexport const inputPaste = 'input-paste';\nexport const inputPress = 'input-press';\nexport const focusOut = 'focus-out';\nexport const escapeKey = 'escape-key';\nexport const closeWatcher = 'close-watcher';\nexport const listNavigation = 'list-navigation';\nexport const keyboard = 'keyboard';\nexport const pointer = 'pointer';\nexport const drag = 'drag';\nexport const wheel = 'wheel';\nexport const scrub = 'scrub';\nexport const cancelOpen = 'cancel-open';\nexport const siblingOpen = 'sibling-open';\nexport const disabled = 'disabled';\nexport const imperativeAction = 'imperative-action';\nexport const swipe = 'swipe';\nexport const windowResize = 'window-resize';\nexport const dayPress = 'day-press';\nexport const monthChange = 'month-change';\nexport const valuePropChange = 'value-prop-change';","import { EMPTY_OBJECT } from \"./constants.js\";\nimport { REASONS } from \"./reasons.js\";\n\n/**\n * Maps a change `reason` string to the corresponding native event type.\n */\n\n/**\n * Details of custom change events emitted by Base UI components.\n */\n\n/**\n * Details of custom generic events emitted by Base UI components.\n */\n\n/**\n * Creates a Base UI event details object with the given reason and utilities\n * for preventing Base UI's internal event handling.\n */\nexport function createChangeEventDetails(reason, event, trigger, customProperties) {\n let canceled = false;\n let allowPropagation = false;\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n cancel() {\n canceled = true;\n },\n allowPropagation() {\n allowPropagation = true;\n },\n get isCanceled() {\n return canceled;\n },\n get isPropagationAllowed() {\n return allowPropagation;\n },\n trigger,\n ...custom\n };\n return details;\n}\nexport function createGenericEventDetails(reason, event, customProperties) {\n const custom = customProperties ?? EMPTY_OBJECT;\n const details = {\n reason,\n event: event ?? new Event('base-ui'),\n ...custom\n };\n return details;\n}","import * as React from 'react';\n\n// https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\nexport const SafeReact = {\n ...React\n};","'use client';\n\nimport * as React from 'react';\nimport { SafeReact } from \"./safeReact.js\";\nlet globalId = 0;\n\n// TODO React 17: Remove `useGlobalId` once React 17 support is removed\nfunction useGlobalId(idOverride, prefix = 'mui') {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`${prefix}-${globalId}`);\n }\n }, [defaultId, prefix]);\n return id;\n}\nconst maybeReactUseId = SafeReact.useId;\n\n/**\n *\n * @example <div id={useId()} />\n * @param idOverride\n * @returns {string}\n */\nexport function useId(idOverride, prefix) {\n // React.useId() is only available from React 17.0.0.\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);\n }\n\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride, prefix);\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\n\n/**\n * Wraps `useId` and prefixes generated `id`s with `base-ui-`\n * @param {string | undefined} idOverride overrides the generated id when provided\n * @returns {string | undefined}\n */\nexport function useBaseUiId(idOverride) {\n return useId(idOverride, 'base-ui');\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport function useOnMount(fn) {\n // TODO: uncomment once we enable eslint-plugin-react-compiler // eslint-disable-next-line react-compiler/react-compiler -- no need to put `fn` in the dependency array\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.js\";\nimport { useOnMount } from \"./useOnMount.js\";\n/** Unlike `setTimeout`, rAF doesn't guarantee a positive integer return value, so we can't have\n * a monomorphic `uint` type with `0` meaning empty.\n * See warning note at:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame#return_value */\nconst EMPTY = null;\nlet LAST_RAF = globalThis.requestAnimationFrame;\nclass Scheduler {\n /* This implementation uses an array as a backing data-structure for frame callbacks.\n * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it\n * never calls the native `cancelAnimationFrame` if there are no frames left. This can\n * be much more efficient if there is a call pattern that alterns as\n * \"request-cancel-request-cancel-…\".\n * But in the case of \"request-request-…-cancel-cancel-…\", it leaves the final animation\n * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */\n\n callbacks = [];\n callbacksCount = 0;\n nextId = 1;\n startId = 1;\n isScheduled = false;\n tick = timestamp => {\n this.isScheduled = false;\n const currentCallbacks = this.callbacks;\n const currentCallbacksCount = this.callbacksCount;\n\n // Update these before iterating, callbacks could call `requestAnimationFrame` again.\n this.callbacks = [];\n this.callbacksCount = 0;\n this.startId = this.nextId;\n if (currentCallbacksCount > 0) {\n for (let i = 0; i < currentCallbacks.length; i += 1) {\n currentCallbacks[i]?.(timestamp);\n }\n }\n };\n request(fn) {\n const id = this.nextId;\n this.nextId += 1;\n this.callbacks.push(fn);\n this.callbacksCount += 1;\n\n /* In a test environment with fake timers, a fake `requestAnimationFrame` can be called\n * but there's no guarantee that the animation frame will actually run before the fake\n * timers are teared, which leaves `isScheduled` set, but won't run our `tick()`. */\n const didRAFChange = process.env.NODE_ENV !== 'production' && LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);\n if (!this.isScheduled || didRAFChange) {\n requestAnimationFrame(this.tick);\n this.isScheduled = true;\n }\n return id;\n }\n cancel(id) {\n const index = id - this.startId;\n if (index < 0 || index >= this.callbacks.length) {\n return;\n }\n this.callbacks[index] = null;\n this.callbacksCount -= 1;\n }\n}\nconst scheduler = new Scheduler();\nexport class AnimationFrame {\n static create() {\n return new AnimationFrame();\n }\n static request(fn) {\n return scheduler.request(fn);\n }\n static cancel(id) {\n return scheduler.cancel(id);\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n request(fn) {\n this.cancel();\n this.currentId = scheduler.request(() => {\n this.currentId = EMPTY;\n fn();\n });\n }\n cancel = () => {\n if (this.currentId !== EMPTY) {\n scheduler.cancel(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.cancel;\n };\n}\n\n/**\n * A `requestAnimationFrame` with automatic cleanup and guard.\n */\nexport function useAnimationFrame() {\n const timeout = useRefWithInit(AnimationFrame.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","/**\n * If the provided argument is a ref object, returns its `current` value.\n * Otherwise, returns the argument itself.\n */\nexport function resolveRef(maybeRef) {\n if (maybeRef == null) {\n return maybeRef;\n }\n return 'current' in maybeRef ? maybeRef.current : maybeRef;\n}","export let TransitionStatusDataAttributes = /*#__PURE__*/function (TransitionStatusDataAttributes) {\n /**\n * Present when the component is animating in.\n */\n TransitionStatusDataAttributes[\"startingStyle\"] = \"data-starting-style\";\n /**\n * Present when the component is animating out.\n */\n TransitionStatusDataAttributes[\"endingStyle\"] = \"data-ending-style\";\n return TransitionStatusDataAttributes;\n}({});\nconst STARTING_HOOK = {\n [TransitionStatusDataAttributes.startingStyle]: ''\n};\nconst ENDING_HOOK = {\n [TransitionStatusDataAttributes.endingStyle]: ''\n};\nexport const transitionStatusMapping = {\n transitionStatus(value) {\n if (value === 'starting') {\n return STARTING_HOOK;\n }\n if (value === 'ending') {\n return ENDING_HOOK;\n }\n return null;\n }\n};","'use client';\n\nimport * as ReactDOM from 'react-dom';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { resolveRef } from \"./resolveRef.js\";\nimport { TransitionStatusDataAttributes } from \"./stateAttributesMapping.js\";\n\n/**\n * Executes a function once all animations have finished on the provided element.\n * @param elementOrRef - The element to watch for animations.\n * @param waitForStartingStyleRemoved - Whether to wait for [data-starting-style] to be removed before checking for animations.\n * @param treatAbortedAsFinished - Whether to treat aborted animations as finished. If `false`, and there are aborted animations,\n * the function will check again if any new animations have started and wait for them to finish.\n * @returns A function that takes a callback to execute once all animations have finished, and an optional AbortSignal to abort the callback\n */\nexport function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {\n const frame = useAnimationFrame();\n return useStableCallback((fnToExecute,\n /**\n * An optional [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) that\n * can be used to abort `fnToExecute` before all the animations have finished.\n * @default null\n */\n signal = null) => {\n frame.cancel();\n const element = resolveRef(elementOrRef);\n if (element == null) {\n return;\n }\n const resolvedElement = element;\n const done = () => {\n // Synchronously flush the unmounting of the component so that the browser doesn't\n // paint: https://github.com/mui/base-ui/issues/979\n ReactDOM.flushSync(fnToExecute);\n };\n if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {\n fnToExecute();\n return;\n }\n function exec() {\n Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {\n if (!signal?.aborted) {\n done();\n }\n }).catch(() => {\n if (treatAbortedAsFinished) {\n if (!signal?.aborted) {\n done();\n }\n return;\n }\n const currentAnimations = resolvedElement.getAnimations();\n if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {\n // Sometimes animations can be aborted because a property they depend on changes while the animation plays.\n // In such cases, we need to re-check if any new animations have started.\n exec();\n }\n });\n }\n if (waitForStartingStyleRemoved) {\n const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;\n\n // If `[data-starting-style]` isn't present, fall back to waiting one more frame\n // to give \"open\" animations a chance to be registered.\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n frame.request(exec);\n return;\n }\n\n // Wait for `[data-starting-style]` to have been removed.\n const attributeObserver = new MutationObserver(() => {\n if (!resolvedElement.hasAttribute(startingStyleAttribute)) {\n attributeObserver.disconnect();\n exec();\n }\n });\n attributeObserver.observe(resolvedElement, {\n attributes: true,\n attributeFilter: [startingStyleAttribute]\n });\n signal?.addEventListener('abort', () => attributeObserver.disconnect(), {\n once: true\n });\n return;\n }\n frame.request(exec);\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { AnimationFrame } from '@base-ui/utils/useAnimationFrame';\n/**\n * Provides a status string for CSS animations.\n * @param open - a boolean that determines if the element is open.\n * @param enableIdleState - a boolean that enables the `'idle'` state between `'starting'` and `'ending'`\n */\nexport function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {\n const [transitionStatus, setTransitionStatus] = React.useState(open && enableIdleState ? 'idle' : undefined);\n const [mounted, setMounted] = React.useState(open);\n if (open && !mounted) {\n setMounted(true);\n setTransitionStatus('starting');\n }\n if (!open && mounted && transitionStatus !== 'ending' && !deferEndingState) {\n setTransitionStatus('ending');\n }\n if (!open && !mounted && transitionStatus === 'ending') {\n setTransitionStatus(undefined);\n }\n useIsoLayoutEffect(() => {\n if (!open && mounted && transitionStatus !== 'ending' && deferEndingState) {\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('ending');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }\n return undefined;\n }, [open, mounted, transitionStatus, deferEndingState]);\n useIsoLayoutEffect(() => {\n if (!open || enableIdleState) {\n return undefined;\n }\n const frame = AnimationFrame.request(() => {\n // Avoid `flushSync` here due to Firefox.\n // See https://github.com/mui/base-ui/pull/3424\n setTransitionStatus(undefined);\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open]);\n useIsoLayoutEffect(() => {\n if (!open || !enableIdleState) {\n return undefined;\n }\n if (open && mounted && transitionStatus !== 'idle') {\n setTransitionStatus('starting');\n }\n const frame = AnimationFrame.request(() => {\n setTransitionStatus('idle');\n });\n return () => {\n AnimationFrame.cancel(frame);\n };\n }, [enableIdleState, open, mounted, transitionStatus]);\n return {\n mounted,\n setMounted,\n transitionStatus\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useCompositeListContext } from \"./CompositeListContext.js\";\nexport let IndexGuessBehavior = /*#__PURE__*/function (IndexGuessBehavior) {\n IndexGuessBehavior[IndexGuessBehavior[\"None\"] = 0] = \"None\";\n IndexGuessBehavior[IndexGuessBehavior[\"GuessFromOrder\"] = 1] = \"GuessFromOrder\";\n return IndexGuessBehavior;\n}({});\n\n/**\n * Used to register a list item and its index (DOM position) in the `CompositeList`.\n */\nexport function useCompositeListItem(params = {}) {\n const {\n label,\n metadata,\n textRef,\n indexGuessBehavior,\n index: externalIndex\n } = params;\n const {\n register,\n unregister,\n subscribeMapChange,\n elementsRef,\n labelsRef,\n nextIndexRef\n } = useCompositeListContext();\n const indexRef = React.useRef(-1);\n const [index, setIndex] = React.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {\n if (indexRef.current === -1) {\n const newIndex = nextIndexRef.current;\n nextIndexRef.current += 1;\n indexRef.current = newIndex;\n }\n return indexRef.current;\n } : -1));\n const componentRef = React.useRef(null);\n const ref = React.useCallback(node => {\n componentRef.current = node;\n if (index !== -1 && node !== null) {\n elementsRef.current[index] = node;\n if (labelsRef) {\n const isLabelDefined = label !== undefined;\n labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;\n }\n }\n }, [index, elementsRef, labelsRef, label, textRef]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n const node = componentRef.current;\n if (node) {\n register(node, metadata);\n return () => {\n unregister(node);\n };\n }\n return undefined;\n }, [externalIndex, register, unregister, metadata]);\n useIsoLayoutEffect(() => {\n if (externalIndex != null) {\n return undefined;\n }\n return subscribeMapChange(map => {\n const i = componentRef.current ? map.get(componentRef.current)?.index : null;\n if (i != null) {\n setIndex(i);\n }\n });\n }, [externalIndex, subscribeMapChange, setIndex]);\n return React.useMemo(() => ({\n ref,\n index\n }), [index, ref]);\n}","export function isElementDisabled(element) {\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CompositeRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CompositeRootContext.displayName = \"CompositeRootContext\";\nexport function useCompositeRootContext(optional = false) {\n const context = React.useContext(CompositeRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.' : _formatErrorMessage(16));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport function useFocusableWhenDisabled(parameters) {\n const {\n focusableWhenDisabled,\n disabled,\n composite = false,\n tabIndex: tabIndexProp = 0,\n isNativeButton\n } = parameters;\n const isFocusableComposite = composite && focusableWhenDisabled !== false;\n const isNonFocusableComposite = composite && focusableWhenDisabled === false;\n\n // we can't explicitly assign `undefined` to any of these props because it\n // would otherwise prevent subsequently merged props from setting them\n const props = React.useMemo(() => {\n const additionalProps = {\n // allow Tabbing away from focusableWhenDisabled elements\n onKeyDown(event) {\n if (disabled && focusableWhenDisabled && event.key !== 'Tab') {\n event.preventDefault();\n }\n }\n };\n if (!composite) {\n additionalProps.tabIndex = tabIndexProp;\n if (!isNativeButton && disabled) {\n additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;\n }\n }\n if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) {\n additionalProps['aria-disabled'] = disabled;\n }\n if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {\n additionalProps.disabled = disabled;\n }\n return additionalProps;\n }, [composite, disabled, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);\n return {\n props\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { error } from '@base-ui/utils/error';\nimport { SafeReact } from '@base-ui/utils/safeReact';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { makeEventPreventable, mergeProps } from \"../merge-props/index.js\";\nimport { useCompositeRootContext } from \"../composite/root/CompositeRootContext.js\";\nimport { useFocusableWhenDisabled } from \"../utils/useFocusableWhenDisabled.js\";\nexport function useButton(parameters = {}) {\n const {\n disabled = false,\n focusableWhenDisabled,\n tabIndex = 0,\n native: isNativeButton = true,\n composite: compositeProp\n } = parameters;\n const elementRef = React.useRef(null);\n const compositeRootContext = useCompositeRootContext(true);\n const isCompositeItem = compositeProp ?? compositeRootContext !== undefined;\n const {\n props: focusableWhenDisabledProps\n } = useFocusableWhenDisabled({\n focusableWhenDisabled,\n disabled,\n composite: isCompositeItem,\n tabIndex,\n isNativeButton\n });\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!elementRef.current) {\n return;\n }\n const isButtonTag = isButtonElement(elementRef.current);\n if (isNativeButton) {\n if (!isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '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`.';\n error(`${message}${ownerStackMessage}`);\n }\n } else if (isButtonTag) {\n const ownerStackMessage = SafeReact.captureOwnerStack?.() || '';\n const message = '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`.';\n error(`${message}${ownerStackMessage}`);\n }\n }, [isNativeButton]);\n }\n\n // handles a disabled composite button rendering another button, e.g.\n // <Toolbar.Button disabled render={<Menu.Trigger />} />\n // the `disabled` prop needs to pass through 2 `useButton`s then finally\n // delete the `disabled` attribute from DOM\n const updateDisabled = React.useCallback(() => {\n const element = elementRef.current;\n if (!isButtonElement(element)) {\n return;\n }\n if (isCompositeItem && disabled && focusableWhenDisabledProps.disabled === undefined && element.disabled) {\n element.disabled = false;\n }\n }, [disabled, focusableWhenDisabledProps.disabled, isCompositeItem]);\n useIsoLayoutEffect(updateDisabled, [updateDisabled]);\n const getButtonProps = React.useCallback((externalProps = {}) => {\n const {\n onClick: externalOnClick,\n onMouseDown: externalOnMouseDown,\n onKeyUp: externalOnKeyUp,\n onKeyDown: externalOnKeyDown,\n onPointerDown: externalOnPointerDown,\n ...otherExternalProps\n } = externalProps;\n const type = isNativeButton ? 'button' : undefined;\n return mergeProps({\n type,\n onClick(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnClick?.(event);\n },\n onMouseDown(event) {\n if (!disabled) {\n externalOnMouseDown?.(event);\n }\n },\n onKeyDown(event) {\n if (disabled) {\n return;\n }\n makeEventPreventable(event);\n externalOnKeyDown?.(event);\n if (event.baseUIHandlerPrevented) {\n return;\n }\n const isCurrentTarget = event.target === event.currentTarget;\n const currentTarget = event.currentTarget;\n const isButton = isButtonElement(currentTarget);\n const isLink = !isNativeButton && isValidLinkElement(currentTarget);\n const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);\n const isEnterKey = event.key === 'Enter';\n const isSpaceKey = event.key === ' ';\n const role = currentTarget.getAttribute('role');\n const isTextNavigationRole = role?.startsWith('menuitem') || role === 'option' || role === 'gridcell';\n if (isCurrentTarget && isCompositeItem && isSpaceKey) {\n if (event.defaultPrevented && isTextNavigationRole) {\n return;\n }\n event.preventDefault();\n if (isLink || isNativeButton && isButton) {\n currentTarget.click();\n event.preventBaseUIHandler();\n } else if (shouldClick) {\n externalOnClick?.(event);\n event.preventBaseUIHandler();\n }\n return;\n }\n\n // Keyboard accessibility for native and non-native elements.\n if (shouldClick) {\n if (!isNativeButton && (isSpaceKey || isEnterKey)) {\n event.preventDefault();\n }\n if (!isNativeButton && isEnterKey) {\n externalOnClick?.(event);\n }\n }\n },\n onKeyUp(event) {\n if (disabled) {\n return;\n }\n\n // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed\n // https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0\n makeEventPreventable(event);\n externalOnKeyUp?.(event);\n if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === ' ') {\n event.preventDefault();\n return;\n }\n if (event.baseUIHandlerPrevented) {\n return;\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === ' ') {\n externalOnClick?.(event);\n }\n },\n onPointerDown(event) {\n if (disabled) {\n event.preventDefault();\n return;\n }\n externalOnPointerDown?.(event);\n }\n }, !isNativeButton ? {\n role: 'button'\n } : undefined, focusableWhenDisabledProps, otherExternalProps);\n }, [disabled, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);\n const buttonRef = useStableCallback(element => {\n elementRef.current = element;\n updateDisabled();\n });\n return {\n getButtonProps,\n buttonRef\n };\n}\nfunction isButtonElement(elem) {\n return isHTMLElement(elem) && elem.tagName === 'BUTTON';\n}\nfunction isValidLinkElement(elem) {\n return Boolean(elem?.tagName === 'A' && elem?.href);\n}","const hasNavigator = typeof navigator !== 'undefined';\nconst nav = getNavigatorData();\nconst platform = getPlatform();\nconst userAgent = getUserAgent();\nexport const isWebKit = typeof CSS === 'undefined' || !CSS.supports ? false : CSS.supports('-webkit-backdrop-filter:none');\nexport const isIOS =\n// iPads can claim to be MacIntel\nnav.platform === 'MacIntel' && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform);\nexport const isFirefox = hasNavigator && /firefox/i.test(userAgent);\nexport const isSafari = hasNavigator && /apple/i.test(navigator.vendor);\nexport const isEdge = hasNavigator && /Edg/i.test(userAgent);\nexport const isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent);\nexport const isMac = hasNavigator && platform.toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\nexport const isJSDOM = userAgent.includes('jsdom/');\n\n// Avoid Chrome DevTools blue warning.\nfunction getNavigatorData() {\n if (!hasNavigator) {\n return {\n platform: '',\n maxTouchPoints: -1\n };\n }\n const uaData = navigator.userAgentData;\n if (uaData?.platform) {\n return {\n platform: uaData.platform,\n maxTouchPoints: navigator.maxTouchPoints\n };\n }\n return {\n platform: navigator.platform ?? '',\n maxTouchPoints: navigator.maxTouchPoints ?? -1\n };\n}\nfunction getUserAgent() {\n if (!hasNavigator) {\n return '';\n }\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(({\n brand,\n version\n }) => `${brand}/${version}`).join(' ');\n }\n return navigator.userAgent;\n}\nfunction getPlatform() {\n if (!hasNavigator) {\n return '';\n }\n const uaData = navigator.userAgentData;\n if (uaData?.platform) {\n return uaData.platform;\n }\n return navigator.platform ?? '';\n}","export const FOCUSABLE_ATTRIBUTE = 'data-base-ui-focusable';\nexport const ACTIVE_KEY = 'active';\nexport const SELECTED_KEY = 'selected';\nexport const TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';","import { isShadowRoot } from '@floating-ui/utils/dom';\nexport function activeElement(doc) {\n let element = doc.activeElement;\n while (element?.shadowRoot?.activeElement != null) {\n element = element.shadowRoot.activeElement;\n }\n return element;\n}\nexport function contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode?.();\n\n // First, attempt with the faster native method.\n if (parent.contains(child)) {\n return true;\n }\n\n // Then fall back to traversing out of shadow roots when needed.\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS assumes `composedPath()` always exists, but older browsers without\n // shadow DOM support still fall back to `target`.\n return event.target;\n}","import { isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { isJSDOM } from '@base-ui/utils/detectBrowser';\nimport { FOCUSABLE_ATTRIBUTE, TYPEABLE_SELECTOR } from \"./constants.js\";\nimport { activeElement, contains, getTarget } from \"./shadowDom.js\";\nexport { activeElement, contains, getTarget };\nexport function isTargetInsideEnabledTrigger(target, triggerElements) {\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n if (triggerElements.hasElement(targetElement)) {\n return !targetElement.hasAttribute('data-trigger-disabled');\n }\n for (const [, trigger] of triggerElements.entries()) {\n if (contains(trigger, targetElement)) {\n return !trigger.hasAttribute('data-trigger-disabled');\n }\n }\n return false;\n}\nexport function isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const eventAgain = event;\n return eventAgain.target != null && node.contains(eventAgain.target);\n}\nexport function isRootElement(element) {\n return element.matches('html,body');\n}\nexport function isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nexport function isInteractiveElement(element) {\n return element?.closest(`button,a[href],[role=\"button\"],select,[tabindex]:not([tabindex=\"-1\"]),${TYPEABLE_SELECTOR}`) != null;\n}\nexport function isTypeableCombobox(element) {\n if (!element) {\n return false;\n }\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\nexport function matchesFocusVisible(element) {\n // We don't want to block focus from working with `visibleOnly`\n // (JSDOM doesn't match `:focus-visible` when the element has `:focus`)\n if (!element || isJSDOM) {\n return true;\n }\n try {\n return element.matches(':focus-visible');\n } catch (_e) {\n return true;\n }\n}\nexport function getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;\n}","/* eslint-disable @typescript-eslint/no-loop-func */\n\nexport function getNodeChildren(nodes, id, onlyOpenChildren = true) {\n const directChildren = nodes.filter(node => node.parentId === id);\n return directChildren.flatMap(child => [...(!onlyOpenChildren || child.context?.open ? [child] : []), ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nexport function getDeepestNode(nodes, id) {\n let deepestNodeId;\n let maxDepth = -1;\n function findDeepest(nodeId, depth) {\n if (depth > maxDepth) {\n deepestNodeId = nodeId;\n maxDepth = depth;\n }\n const children = getNodeChildren(nodes, nodeId);\n children.forEach(child => {\n findDeepest(child.id, depth + 1);\n });\n }\n findDeepest(id, 0);\n return nodes.find(node => node.id === deepestNodeId);\n}\nexport function getNodeAncestors(nodes, id) {\n let allAncestors = [];\n let currentParentId = nodes.find(node => node.id === id)?.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode?.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}","import { isAndroid, isJSDOM } from '@base-ui/utils/detectBrowser';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport function isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts\nexport function isVirtualClick(event) {\n if (event.pointerType === '' && event.isTrusted) {\n return true;\n }\n if (isAndroid && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nexport function isVirtualPointerEvent(event) {\n if (isJSDOM) {\n return false;\n }\n return !isAndroid && event.width === 0 && event.height === 0 || isAndroid && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nexport function isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nexport function isClickLikeEvent(event) {\n const type = event.type;\n return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';\n}","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { floor } from '@floating-ui/utils';\nimport { getComputedStyle } from '@floating-ui/utils/dom';\nimport { stopEvent } from \"./event.js\";\nimport { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP } from \"./constants.js\";\nexport function isDifferentGridRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nexport function isIndexOutOfListBounds(list, index) {\n return index < 0 || index >= list.length;\n}\nexport function getMinListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n disabledIndices\n });\n}\nexport function getMaxListIndex(listRef, disabledIndices) {\n return findNonDisabledListIndex(listRef.current, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\nexport function findNonDisabledListIndex(list, {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n} = {}) {\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));\n return index;\n}\nexport function getGridNavigatedIndex(list, {\n event,\n orientation,\n loopFocus,\n onLoop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n}) {\n let nextIndex = prevIndex;\n let verticalDirection;\n if (event.key === ARROW_UP) {\n verticalDirection = 'up';\n } else if (event.key === ARROW_DOWN) {\n verticalDirection = 'down';\n }\n if (verticalDirection) {\n // -------------------------------------------------------------------------\n // Detect row structure only when handling vertical navigation. This keeps\n // the non-vertical key paths free from row inference work.\n // -------------------------------------------------------------------------\n const rows = [];\n const rowIndexMap = [];\n let hasRoleRow = false;\n let visibleItemCount = 0;\n {\n let currentRowEl = null;\n let currentRowIndex = -1;\n list.forEach((el, idx) => {\n if (el == null) {\n return;\n }\n visibleItemCount += 1;\n const rowEl = el.closest('[role=\"row\"]');\n if (rowEl) {\n hasRoleRow = true;\n }\n if (rowEl !== currentRowEl || currentRowIndex === -1) {\n currentRowEl = rowEl;\n currentRowIndex += 1;\n rows[currentRowIndex] = [];\n }\n rows[currentRowIndex].push(idx);\n rowIndexMap[idx] = currentRowIndex;\n });\n }\n let hasDomRows = false;\n let inferredDomCols = 0;\n if (hasRoleRow) {\n for (const row of rows) {\n const rowLength = row.length;\n if (rowLength > inferredDomCols) {\n inferredDomCols = rowLength;\n }\n if (rowLength !== cols) {\n hasDomRows = true;\n }\n }\n }\n const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;\n const verticalCols = inferredDomCols || cols;\n const navigateVertically = direction => {\n if (!hasDomRows || prevIndex === -1) {\n return undefined;\n }\n const currentRow = rowIndexMap[prevIndex];\n if (currentRow == null) {\n return undefined;\n }\n const colInRow = rows[currentRow].indexOf(prevIndex);\n const step = direction === 'up' ? -1 : 1;\n for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {\n if (nextRow < 0 || nextRow >= rows.length) {\n if (!loopFocus || hasVirtualizedGaps) {\n return undefined;\n }\n nextRow = nextRow < 0 ? rows.length - 1 : 0;\n if (onLoop) {\n const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);\n const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];\n const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);\n nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;\n }\n }\n const targetRow = rows[nextRow];\n for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {\n const candidate = targetRow[col];\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n const navigateVerticallyWithInferredRows = direction => {\n if (!hasVirtualizedGaps || prevIndex === -1) {\n return undefined;\n }\n const colInRow = prevIndex % verticalCols;\n const rowStep = direction === 'up' ? -verticalCols : verticalCols;\n const lastRowStart = maxIndex - maxIndex % verticalCols;\n const rowCount = floor(maxIndex / verticalCols) + 1;\n for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {\n if (rowStart < 0 || rowStart > maxIndex) {\n if (!loopFocus) {\n return undefined;\n }\n rowStart = rowStart < 0 ? lastRowStart : 0;\n }\n const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);\n for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {\n if (!isListIndexDisabled(list, candidate, disabledIndices)) {\n return candidate;\n }\n }\n }\n return undefined;\n };\n if (stop) {\n stopEvent(event);\n }\n const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);\n if (verticalCandidate !== undefined) {\n nextIndex = verticalCandidate;\n } else if (prevIndex === -1) {\n nextIndex = verticalDirection === 'up' ? maxIndex : minIndex;\n } else {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n amount: verticalCols,\n decrement: verticalDirection === 'up',\n disabledIndices\n });\n if (loopFocus) {\n if (verticalDirection === 'up' && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {\n const col = prevIndex % verticalCols;\n const maxCol = maxIndex % verticalCols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - verticalCols;\n }\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (verticalDirection === 'down' && prevIndex + verticalCols > maxIndex) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex % verticalCols - verticalCols,\n amount: verticalCols,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n }\n }\n if (isIndexOutOfListBounds(list, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n if (stop) {\n stopEvent(event);\n }\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n } else if (loopFocus) {\n nextIndex = findNonDisabledListIndex(list, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n }\n if (isDifferentGridRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfListBounds(list, nextIndex)) {\n if (loopFocus && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n if (onLoop) {\n nextIndex = onLoop(event, prevIndex, nextIndex);\n }\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nexport function createGridCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach(({\n width,\n height\n }, index) => {\n if (width > cols) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i += 1) {\n for (let j = 0; j < height; j += 1) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex += 1;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nexport function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) {\n return -1;\n }\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n default:\n return -1;\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nexport function getGridCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nexport function isListIndexDisabled(list, index, disabledIndices) {\n const isExplicitlyDisabled = typeof disabledIndices === 'function' ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;\n if (isExplicitlyDisabled) {\n return true;\n }\n const element = list[index];\n if (!element) {\n return false;\n }\n if (!isElementVisible(element)) {\n return true;\n }\n return !disabledIndices && (element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true');\n}\nexport function isElementVisible(element) {\n if (typeof element.checkVisibility === 'function') {\n return element.checkVisibility();\n }\n return getComputedStyle(element).display !== 'none';\n}","export { getWindow as ownerWindow } from '@floating-ui/utils/dom';\nexport function ownerDocument(node) {\n return node?.ownerDocument || document;\n}","import { getNodeName, isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains } from \"./element.js\";\nimport { isElementVisible } from \"./composite.js\";\nconst CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]';\nfunction getParentElement(element) {\n const assignedSlot = element.assignedSlot;\n if (assignedSlot) {\n return assignedSlot;\n }\n if (element.parentElement) {\n return element.parentElement;\n }\n const rootNode = element.getRootNode();\n return isShadowRoot(rootNode) ? rootNode.host : null;\n}\nfunction getDetailsSummary(details) {\n for (const child of Array.from(details.children)) {\n if (getNodeName(child) === 'summary') {\n return child;\n }\n }\n return null;\n}\nfunction isWithinOpenDetailsSummary(element, details) {\n const summary = getDetailsSummary(details);\n return !!summary && (element === summary || contains(summary, element));\n}\nfunction isFocusableCandidate(element) {\n const nodeName = element ? getNodeName(element) : '';\n return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== 'summary' || element.parentElement != null && getNodeName(element.parentElement) === 'details' && getDetailsSummary(element.parentElement) === element) && (nodeName !== 'details' || getDetailsSummary(element) == null) && (nodeName !== 'input' || element.type !== 'hidden');\n}\nfunction isFocusableElement(element) {\n if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) {\n return false;\n }\n for (let current = element; current; current = getParentElement(current)) {\n const isSlot = getNodeName(current) === 'slot';\n if (current.hasAttribute('inert')) {\n return false;\n }\n if (current !== element && getNodeName(current) === 'details' && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isElementVisible(current)) {\n return false;\n }\n }\n return true;\n}\nfunction getTabIndex(element) {\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n const nodeName = getNodeName(element);\n if (nodeName === 'details' || nodeName === 'audio' || nodeName === 'video' || isHTMLElement(element) && element.isContentEditable) {\n return 0;\n }\n }\n return tabIndex;\n}\nfunction getNamedRadioInput(element) {\n if (getNodeName(element) !== 'input') {\n return null;\n }\n const input = element;\n return input.type === 'radio' && input.name !== '' ? input : null;\n}\nfunction isTabbableRadio(element, candidates) {\n const input = getNamedRadioInput(element);\n if (!input) {\n return true;\n }\n const checkedRadio = candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form && radio.checked;\n });\n if (checkedRadio) {\n return checkedRadio === input;\n }\n return candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form;\n }) === input;\n}\nfunction getComposedChildren(container) {\n if (isHTMLElement(container) && getNodeName(container) === 'slot') {\n const assignedElements = container.assignedElements({\n flatten: true\n });\n if (assignedElements.length > 0) {\n return assignedElements;\n }\n }\n if (isHTMLElement(container) && container.shadowRoot) {\n return Array.from(container.shadowRoot.children);\n }\n return Array.from(container.children);\n}\nfunction appendCandidates(container, list) {\n getComposedChildren(container).forEach(child => {\n if (isFocusableCandidate(child)) {\n list.push(child);\n }\n appendCandidates(child, list);\n });\n}\nfunction appendMatchingElements(container, selector, list) {\n getComposedChildren(container).forEach(child => {\n if (isHTMLElement(child) && child.matches(selector)) {\n list.push(child);\n }\n appendMatchingElements(child, selector, list);\n });\n}\nexport function isTabbable(element) {\n return isFocusableElement(element) && getTabIndex(element) >= 0;\n}\nexport function focusable(container) {\n const candidates = [];\n appendCandidates(container, candidates);\n return candidates.filter(isFocusableElement);\n}\nexport function tabbable(container) {\n const candidates = focusable(container);\n return candidates.filter(element => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));\n}\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container);\n const len = list.length;\n if (len === 0) {\n return undefined;\n }\n const active = activeElement(ownerDocument(container));\n const index = list.indexOf(active);\n // eslint-disable-next-line no-nested-ternary\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nexport function getNextTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;\n}\nexport function getPreviousTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;\n}\nfunction getTabbableNearElement(referenceElement, dir) {\n if (!referenceElement) {\n return null;\n }\n const list = tabbable(ownerDocument(referenceElement).body);\n const elementCount = list.length;\n if (elementCount === 0) {\n return null;\n }\n const index = list.indexOf(referenceElement);\n if (index === -1) {\n return null;\n }\n const nextIndex = (index + dir + elementCount) % elementCount;\n return list[nextIndex];\n}\nexport function getTabbableAfterElement(referenceElement) {\n return getTabbableNearElement(referenceElement, 1);\n}\nexport function getTabbableBeforeElement(referenceElement) {\n return getTabbableNearElement(referenceElement, -1);\n}\nexport function isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nexport function disableFocusInside(container) {\n const tabbableElements = tabbable(container);\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nexport function enableFocusInside(container) {\n const elements = [];\n appendMatchingElements(container, '[data-tabindex]', elements);\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}","import { isHTMLElement } from '@floating-ui/utils/dom';\nexport { stopEvent, isIndexOutOfListBounds, isListIndexDisabled, createGridCellMap, findNonDisabledListIndex, getGridCellIndexOfCorner, getGridCellIndices, getGridNavigatedIndex, getMaxListIndex, getMinListIndex } from \"../floating-ui-react/utils.js\";\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const ARROW_LEFT = 'ArrowLeft';\nexport const ARROW_RIGHT = 'ArrowRight';\nexport const HOME = 'Home';\nexport const END = 'End';\nexport const PAGE_UP = 'PageUp';\nexport const PAGE_DOWN = 'PageDown';\nexport const HORIZONTAL_KEYS = new Set([ARROW_LEFT, ARROW_RIGHT]);\nexport const HORIZONTAL_KEYS_WITH_EXTRA_KEYS = new Set([ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const VERTICAL_KEYS = new Set([ARROW_UP, ARROW_DOWN]);\nexport const VERTICAL_KEYS_WITH_EXTRA_KEYS = new Set([ARROW_UP, ARROW_DOWN, HOME, END]);\nexport const ARROW_KEYS = new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);\nexport const ALL_KEYS = new Set([...ARROW_KEYS, HOME, END]);\nexport const COMPOSITE_KEYS = new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);\nexport const SHIFT = 'Shift';\nexport const CONTROL = 'Control';\nexport const ALT = 'Alt';\nexport const META = 'Meta';\nexport const MODIFIER_KEYS = new Set([SHIFT, CONTROL, ALT, META]);\nfunction isInputElement(element) {\n return isHTMLElement(element) && element.tagName === 'INPUT';\n}\nexport function isNativeInput(element) {\n if (isInputElement(element) && element.selectionStart != null) {\n return true;\n }\n if (isHTMLElement(element) && element.tagName === 'TEXTAREA') {\n return true;\n }\n return false;\n}\nexport function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {\n if (!scrollContainer || !element || !element.scrollTo) {\n return;\n }\n let targetX = scrollContainer.scrollLeft;\n let targetY = scrollContainer.scrollTop;\n const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;\n const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;\n if (isOverflowingX && orientation !== 'vertical') {\n const elementOffsetLeft = getOffset(scrollContainer, element, 'left');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (direction === 'ltr') {\n if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n }\n }\n if (direction === 'rtl') {\n if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {\n // overflow to the left, scroll to align left edges\n targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;\n } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {\n // overflow to the right, scroll to align right edges\n targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;\n }\n }\n }\n if (isOverflowingY && orientation !== 'horizontal') {\n const elementOffsetTop = getOffset(scrollContainer, element, 'top');\n const containerStyles = getStyles(scrollContainer);\n const elementStyles = getStyles(element);\n if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {\n // overflow upwards, align top edges\n targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;\n } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {\n // overflow downwards, align bottom edges\n targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;\n }\n }\n scrollContainer.scrollTo({\n left: targetX,\n top: targetY,\n behavior: 'auto'\n });\n}\nfunction getOffset(ancestor, element, side) {\n const propName = side === 'left' ? 'offsetLeft' : 'offsetTop';\n let result = 0;\n while (element.offsetParent) {\n result += element[propName];\n if (element.offsetParent === ancestor) {\n break;\n }\n element = element.offsetParent;\n }\n return result;\n}\nfunction getStyles(element) {\n const styles = getComputedStyle(element);\n return {\n scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,\n scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,\n scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,\n scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,\n scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,\n scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,\n scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,\n scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0\n };\n}","/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useAnimationsFinished } from \"./useAnimationsFinished.js\";\n\n/**\n * Calls the provided function when the CSS open/close animation or transition completes.\n */\nexport function useOpenChangeComplete(parameters) {\n const {\n enabled = true,\n open,\n ref,\n onComplete: onCompleteParam\n } = parameters;\n const onComplete = useStableCallback(onCompleteParam);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const abortController = new AbortController();\n runOnceAnimationsFinish(onComplete, abortController.signal);\n return () => {\n abortController.abort();\n };\n }, [enabled, open, onComplete, runOnceAnimationsFinish]);\n}","'use client';\n\nimport * as React from 'react';\nexport function useOnFirstRender(fn) {\n const ref = React.useRef(true);\n if (ref.current) {\n ref.current = false;\n fn();\n }\n}","'use client';\n\nimport { useRefWithInit } from \"./useRefWithInit.js\";\nimport { useOnMount } from \"./useOnMount.js\";\nconst EMPTY = 0;\nexport class Timeout {\n static create() {\n return new Timeout();\n }\n currentId = EMPTY;\n\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = EMPTY;\n fn();\n }, delay); /* Node.js types are enabled in development */\n }\n isStarted() {\n return this.currentId !== EMPTY;\n }\n clear = () => {\n if (this.currentId !== EMPTY) {\n clearTimeout(this.currentId);\n this.currentId = EMPTY;\n }\n };\n disposeEffect = () => {\n return this.clear;\n };\n}\n\n/**\n * A `setTimeout` with automatic cleanup and guard.\n */\nexport function useTimeout() {\n const timeout = useRefWithInit(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\nimport { isOverflowElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from \"./addEventListener.js\";\nimport { isIOS, isWebKit } from \"./detectBrowser.js\";\nimport { ownerDocument, ownerWindow } from \"./owner.js\";\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.js\";\nimport { Timeout } from \"./useTimeout.js\";\nimport { AnimationFrame } from \"./useAnimationFrame.js\";\nimport { NOOP } from \"./empty.js\";\nlet originalHtmlStyles = {};\nlet originalBodyStyles = {};\nlet originalHtmlScrollBehavior = '';\nfunction hasInsetScrollbars(referenceElement) {\n if (typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const win = ownerWindow(doc);\n return win.innerWidth - doc.documentElement.clientWidth > 0;\n}\nfunction supportsStableScrollbarGutter(referenceElement) {\n const supported = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('scrollbar-gutter', 'stable');\n if (!supported || typeof document === 'undefined') {\n return false;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const scrollContainer = isOverflowElement(html) ? html : body;\n const originalScrollContainerOverflowY = scrollContainer.style.overflowY;\n const originalHtmlStyleGutter = html.style.scrollbarGutter;\n html.style.scrollbarGutter = 'stable';\n scrollContainer.style.overflowY = 'scroll';\n const before = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = 'hidden';\n const after = scrollContainer.offsetWidth;\n scrollContainer.style.overflowY = originalScrollContainerOverflowY;\n html.style.scrollbarGutter = originalHtmlStyleGutter;\n return before === after;\n}\nfunction preventScrollOverlayScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n\n // If an `overflow` style is present on <html>, we need to lock it, because a lock on <body>\n // won't have any effect.\n // But if <body> has an `overflow` style (like `overflow-x: hidden`), we need to lock it\n // instead, as sticky elements shift otherwise.\n const elementToLock = isOverflowElement(html) ? html : body;\n const originalElementToLockStyles = {\n overflowY: elementToLock.style.overflowY,\n overflowX: elementToLock.style.overflowX\n };\n Object.assign(elementToLock.style, {\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n return () => {\n Object.assign(elementToLock.style, originalElementToLockStyles);\n };\n}\nfunction preventScrollInsetScrollbars(referenceElement) {\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const body = doc.body;\n const win = ownerWindow(html);\n let scrollTop = 0;\n let scrollLeft = 0;\n let updateGutterOnly = false;\n const resizeFrame = AnimationFrame.create();\n\n // Pinch-zoom in Safari causes a shift. Just don't lock scroll if there's any pinch-zoom.\n if (isWebKit && (win.visualViewport?.scale ?? 1) !== 1) {\n return () => {};\n }\n function lockScroll() {\n /* DOM reads: */\n\n const htmlStyles = win.getComputedStyle(html);\n const bodyStyles = win.getComputedStyle(body);\n const htmlScrollbarGutterValue = htmlStyles.scrollbarGutter || '';\n const hasBothEdges = htmlScrollbarGutterValue.includes('both-edges');\n const scrollbarGutterValue = hasBothEdges ? 'stable both-edges' : 'stable';\n scrollTop = html.scrollTop;\n scrollLeft = html.scrollLeft;\n originalHtmlStyles = {\n scrollbarGutter: html.style.scrollbarGutter,\n overflowY: html.style.overflowY,\n overflowX: html.style.overflowX\n };\n originalHtmlScrollBehavior = html.style.scrollBehavior;\n originalBodyStyles = {\n position: body.style.position,\n height: body.style.height,\n width: body.style.width,\n boxSizing: body.style.boxSizing,\n overflowY: body.style.overflowY,\n overflowX: body.style.overflowX,\n scrollBehavior: body.style.scrollBehavior\n };\n const isScrollableY = html.scrollHeight > html.clientHeight;\n const isScrollableX = html.scrollWidth > html.clientWidth;\n const hasConstantOverflowY = htmlStyles.overflowY === 'scroll' || bodyStyles.overflowY === 'scroll';\n const hasConstantOverflowX = htmlStyles.overflowX === 'scroll' || bodyStyles.overflowX === 'scroll';\n\n // Values can be negative in Firefox\n const scrollbarWidth = Math.max(0, win.innerWidth - body.clientWidth);\n const scrollbarHeight = Math.max(0, win.innerHeight - body.clientHeight);\n\n // Avoid shift due to the default <body> margin. This does cause elements to be clipped\n // with whitespace. Warn if <body> has margins?\n const marginY = parseFloat(bodyStyles.marginTop) + parseFloat(bodyStyles.marginBottom);\n const marginX = parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight);\n const elementToLock = isOverflowElement(html) ? html : body;\n updateGutterOnly = supportsStableScrollbarGutter(referenceElement);\n\n /*\n * DOM writes:\n * Do not read the DOM past this point!\n */\n\n if (updateGutterOnly) {\n html.style.scrollbarGutter = scrollbarGutterValue;\n elementToLock.style.overflowY = 'hidden';\n elementToLock.style.overflowX = 'hidden';\n return;\n }\n Object.assign(html.style, {\n scrollbarGutter: scrollbarGutterValue,\n overflowY: 'hidden',\n overflowX: 'hidden'\n });\n if (isScrollableY || hasConstantOverflowY) {\n html.style.overflowY = 'scroll';\n }\n if (isScrollableX || hasConstantOverflowX) {\n html.style.overflowX = 'scroll';\n }\n Object.assign(body.style, {\n position: 'relative',\n height: marginY || scrollbarHeight ? `calc(100dvh - ${marginY + scrollbarHeight}px)` : '100dvh',\n width: marginX || scrollbarWidth ? `calc(100vw - ${marginX + scrollbarWidth}px)` : '100vw',\n boxSizing: 'border-box',\n overflow: 'hidden',\n scrollBehavior: 'unset'\n });\n body.scrollTop = scrollTop;\n body.scrollLeft = scrollLeft;\n html.setAttribute('data-base-ui-scroll-locked', '');\n html.style.scrollBehavior = 'unset';\n }\n function cleanup() {\n Object.assign(html.style, originalHtmlStyles);\n Object.assign(body.style, originalBodyStyles);\n if (!updateGutterOnly) {\n html.scrollTop = scrollTop;\n html.scrollLeft = scrollLeft;\n html.removeAttribute('data-base-ui-scroll-locked');\n html.style.scrollBehavior = originalHtmlScrollBehavior;\n }\n }\n function handleResize() {\n cleanup();\n resizeFrame.request(lockScroll);\n }\n lockScroll();\n const unsubscribeResize = addEventListener(win, 'resize', handleResize);\n return () => {\n resizeFrame.cancel();\n cleanup();\n // Sometimes this cleanup can run after test teardown because it is called\n // in a `setTimeout(fn, 0)`. Guard the returned cleanup to avoid calling\n // `removeEventListener` when it is no longer available in tests.\n if (typeof win.removeEventListener === 'function') {\n unsubscribeResize();\n }\n };\n}\nclass ScrollLocker {\n lockCount = 0;\n restore = null;\n timeoutLock = Timeout.create();\n timeoutUnlock = Timeout.create();\n acquire(referenceElement) {\n this.lockCount += 1;\n if (this.lockCount === 1 && this.restore === null) {\n this.timeoutLock.start(0, () => this.lock(referenceElement));\n }\n return this.release;\n }\n release = () => {\n this.lockCount -= 1;\n if (this.lockCount === 0 && this.restore) {\n this.timeoutUnlock.start(0, this.unlock);\n }\n };\n unlock = () => {\n if (this.lockCount === 0 && this.restore) {\n this.restore?.();\n this.restore = null;\n }\n };\n lock(referenceElement) {\n if (this.lockCount === 0 || this.restore !== null) {\n return;\n }\n const doc = ownerDocument(referenceElement);\n const html = doc.documentElement;\n const htmlOverflowY = ownerWindow(html).getComputedStyle(html).overflowY;\n\n // If the site author already hid overflow on <html>, respect it and bail out.\n if (htmlOverflowY === 'hidden' || htmlOverflowY === 'clip') {\n this.restore = NOOP;\n return;\n }\n const hasOverlayScrollbars = isIOS || !hasInsetScrollbars(referenceElement);\n\n // On iOS, scroll locking does not work if the navbar is collapsed. Due to numerous\n // side effects and bugs that arise on iOS, it must be researched extensively before\n // being enabled to ensure it doesn't cause the following issues:\n // - Textboxes must scroll into view when focused, nor cause a glitchy scroll animation.\n // - The navbar must not force itself into view and cause layout shift.\n // - Scroll containers must not flicker upon closing a popup when it has an exit animation.\n this.restore = hasOverlayScrollbars ? preventScrollOverlayScrollbars(referenceElement) : preventScrollInsetScrollbars(referenceElement);\n }\n}\nconst SCROLL_LOCKER = new ScrollLocker();\n\n/**\n * Locks the scroll of the document when enabled.\n *\n * @param enabled - Whether to enable the scroll lock.\n * @param referenceElement - Element to use as a reference for lock calculations.\n */\nexport function useScrollLock(enabled = true, referenceElement = null) {\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n return SCROLL_LOCKER.acquire(referenceElement);\n }, [enabled, referenceElement]);\n}","import { isMouseLikePointerType } from \"../utils/event.js\";\nfunction resolveValue(value, pointerType) {\n if (pointerType != null && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\nexport function getDelay(value, prop, pointerType) {\n const result = resolveValue(value, pointerType);\n if (typeof result === 'number') {\n return result;\n }\n return result?.[prop];\n}\nexport function getRestMs(value) {\n if (typeof value === 'function') {\n return value();\n }\n return value;\n}\nexport function isClickLikeOpenEvent(openEventType, interactedInside) {\n return interactedInside || openEventType === 'click' || openEventType === 'mousedown';\n}","'use client';\n\nimport * as React from 'react';\nimport { useTimeout, Timeout } from '@base-ui/utils/useTimeout';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { getDelay } from \"../hooks/useHoverShared.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n hasProvider: false,\n timeoutMs: 0,\n delayRef: {\n current: 0\n },\n initialDelayRef: {\n current: 0\n },\n timeout: new Timeout(),\n currentIdRef: {\n current: null\n },\n currentContextRef: {\n current: null\n }\n});\nif (process.env.NODE_ENV !== \"production\") FloatingDelayGroupContext.displayName = \"FloatingDelayGroupContext\";\n/**\n * Experimental next version of `FloatingDelayGroup` to become the default\n * in the future. This component is not yet stable.\n * Provides context for a group of floating elements that should share a\n * `delay`. Unlike `FloatingDelayGroup`, `useDelayGroup` with this\n * component does not cause a re-render of unrelated consumers of the\n * context when the delay changes.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n * @internal\n */\nexport function FloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const delayRef = React.useRef(delay);\n const initialDelayRef = React.useRef(delay);\n const currentIdRef = React.useRef(null);\n const currentContextRef = React.useRef(null);\n const timeout = useTimeout();\n return /*#__PURE__*/_jsx(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n hasProvider: true,\n delayRef,\n initialDelayRef,\n currentIdRef,\n timeoutMs,\n currentContextRef,\n timeout\n }), [timeoutMs, timeout]),\n children: children\n });\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `FloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n * @internal\n */\nexport function useDelayGroup(context, options = {\n open: false\n}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const floatingId = store.useState('floatingId');\n const {\n open\n } = options;\n const groupContext = React.useContext(FloatingDelayGroupContext);\n const {\n currentIdRef,\n delayRef,\n timeoutMs,\n initialDelayRef,\n currentContextRef,\n hasProvider,\n timeout\n } = groupContext;\n const [isInstantPhase, setIsInstantPhase] = React.useState(false);\n useIsoLayoutEffect(() => {\n function unset() {\n setIsInstantPhase(false);\n currentContextRef.current?.setIsInstantPhase(false);\n currentIdRef.current = null;\n currentContextRef.current = null;\n delayRef.current = initialDelayRef.current;\n }\n if (!currentIdRef.current) {\n return undefined;\n }\n if (!open && currentIdRef.current === floatingId) {\n setIsInstantPhase(false);\n if (timeoutMs) {\n const closingId = floatingId;\n timeout.start(timeoutMs, () => {\n // If another tooltip has taken over the group, skip resetting.\n if (store.select('open') || currentIdRef.current && currentIdRef.current !== closingId) {\n return;\n }\n unset();\n });\n return () => {\n timeout.clear();\n };\n }\n unset();\n }\n return undefined;\n }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]);\n useIsoLayoutEffect(() => {\n if (!open) {\n return;\n }\n const prevContext = currentContextRef.current;\n const prevId = currentIdRef.current;\n\n // A new tooltip is opening, so cancel any pending timeout that would reset\n // the group's delay back to the initial value.\n timeout.clear();\n currentContextRef.current = {\n onOpenChange: store.setOpen,\n setIsInstantPhase\n };\n currentIdRef.current = floatingId;\n delayRef.current = {\n open: 0,\n close: getDelay(initialDelayRef.current, 'close')\n };\n if (prevId !== null && prevId !== floatingId) {\n setIsInstantPhase(true);\n prevContext?.setIsInstantPhase(true);\n prevContext?.onOpenChange(false, createChangeEventDetails(REASONS.none));\n } else {\n setIsInstantPhase(false);\n prevContext?.setIsInstantPhase(false);\n }\n }, [open, floatingId, store, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout]);\n useIsoLayoutEffect(() => {\n return () => {\n currentContextRef.current = null;\n };\n }, [currentContextRef]);\n return React.useMemo(() => ({\n hasProvider,\n delayRef,\n isInstantPhase\n }), [hasProvider, delayRef, isInstantPhase]);\n}","/**\n * Combines multiple cleanup functions into a single cleanup function.\n */\nexport function mergeCleanups(...cleanups) {\n return () => {\n for (let i = 0; i < cleanups.length; i += 1) {\n const cleanup = cleanups[i];\n if (cleanup) {\n cleanup();\n }\n }\n };\n}","'use client';\n\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.js\";\nimport { useRefWithInit } from \"./useRefWithInit.js\";\n\n/**\n * Untracks the provided value by turning it into a ref to remove its reactivity.\n *\n * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.\n */\nexport function useValueAsRef(value) {\n const latest = useRefWithInit(createLatestRef, value).current;\n latest.next = value;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(latest.effect);\n return latest;\n}\nfunction createLatestRef(value) {\n const latest = {\n current: value,\n next: value,\n effect: () => {\n latest.current = latest.next;\n }\n };\n return latest;\n}","const visuallyHiddenBase = {\n clipPath: 'inset(50%)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n border: 0,\n padding: 0,\n width: 1,\n height: 1,\n margin: -1\n};\nexport const visuallyHidden = {\n ...visuallyHiddenBase,\n position: 'fixed',\n top: 0,\n left: 0\n};\nexport const visuallyHiddenInput = {\n ...visuallyHiddenBase,\n position: 'absolute'\n};","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isSafari } from '@base-ui/utils/detectBrowser';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useIsoLayoutEffect(() => {\n if (isSafari) {\n // Unlike other screen readers such as NVDA and JAWS, the virtual cursor\n // on VoiceOver does trigger the onFocus event, so we can use the focus\n // trap element. On Safari, only buttons trigger the onFocus event.\n setRole('button');\n }\n }, []);\n const restProps = {\n tabIndex: 0,\n // Role is only for VoiceOver\n role\n };\n return /*#__PURE__*/_jsx(\"span\", {\n ...props,\n ref: ref,\n style: visuallyHidden,\n \"aria-hidden\": role ? undefined : true,\n ...restProps,\n \"data-base-ui-focus-guard\": \"\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") FocusGuard.displayName = \"FocusGuard\";","export function createAttribute(name) {\n return `data-base-ui-${name}`;\n}","import { NOOP } from \"../../utils/noop.js\";\nlet rafId = 0;\nexport function enqueueFocus(el, options = {}) {\n const {\n preventScroll = false,\n cancelPrevious = true,\n sync = false\n } = options;\n if (cancelPrevious) {\n cancelAnimationFrame(rafId);\n }\n const exec = () => el?.focus({\n preventScroll\n });\n if (sync) {\n exec();\n return NOOP;\n }\n const currentRafId = requestAnimationFrame(exec);\n rafId = currentRafId;\n return () => {\n if (rafId === currentRafId) {\n cancelAnimationFrame(currentRafId);\n rafId = 0;\n }\n };\n}","// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nimport { getNodeName, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nconst counters = {\n inert: new WeakMap(),\n 'aria-hidden': new WeakMap()\n};\nconst markerName = 'data-base-ui-inert';\nconst uncontrolledElementsSets = {\n inert: new WeakSet(),\n 'aria-hidden': new WeakSet()\n};\nlet markerCounterMap = new WeakMap();\nlet lockCount = 0;\nfunction getUncontrolledElementsSet(controlAttribute) {\n return uncontrolledElementsSets[controlAttribute];\n}\nexport const supportsInert = () => typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;\nfunction unwrapHost(node) {\n if (!node) {\n return null;\n }\n return isShadowRoot(node) ? node.host : unwrapHost(node.parentNode);\n}\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nconst buildKeepSet = targets => {\n const keep = new Set();\n targets.forEach(target => {\n let node = target;\n while (node && !keep.has(node)) {\n keep.add(node);\n node = node.parentNode;\n }\n });\n return keep;\n};\nconst collectOutsideElements = (root, keepElements, stopElements) => {\n const outside = [];\n const walk = parent => {\n if (!parent || stopElements.has(parent)) {\n return;\n }\n Array.from(parent.children).forEach(node => {\n if (getNodeName(node) === 'script') {\n return;\n }\n if (keepElements.has(node)) {\n walk(node);\n } else {\n outside.push(node);\n }\n });\n };\n walk(root);\n return outside;\n};\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert, {\n mark = true,\n markerIgnoreElements = []\n}) {\n // eslint-disable-next-line no-nested-ternary\n const controlAttribute = inert ? 'inert' : ariaHidden ? 'aria-hidden' : null;\n let counterMap = null;\n let uncontrolledElementsSet = null;\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const markerIgnoreTargets = mark ? correctElements(body, markerIgnoreElements) : [];\n const markerIgnoreSet = new Set(markerIgnoreTargets);\n const markerTargets = mark ? collectOutsideElements(body, buildKeepSet(avoidElements), new Set(avoidElements)).filter(target => !markerIgnoreSet.has(target)) : [];\n const hiddenElements = [];\n const markedElements = [];\n if (controlAttribute) {\n const map = counters[controlAttribute];\n const currentUncontrolledElementsSet = getUncontrolledElementsSet(controlAttribute);\n uncontrolledElementsSet = currentUncontrolledElementsSet;\n counterMap = map;\n const ariaLiveElements = correctElements(body, Array.from(body.querySelectorAll('[aria-live]')));\n const controlElements = avoidElements.concat(ariaLiveElements);\n const controlTargets = collectOutsideElements(body, buildKeepSet(controlElements), new Set(controlElements));\n controlTargets.forEach(node => {\n const attr = node.getAttribute(controlAttribute);\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (map.get(node) || 0) + 1;\n map.set(node, counterValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n currentUncontrolledElementsSet.add(node);\n }\n if (!alreadyHidden) {\n node.setAttribute(controlAttribute, controlAttribute === 'inert' ? '' : 'true');\n }\n });\n }\n if (mark) {\n markerTargets.forEach(node => {\n const markerValue = (markerCounterMap.get(node) || 0) + 1;\n markerCounterMap.set(node, markerValue);\n markedElements.push(node);\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n });\n }\n lockCount += 1;\n return () => {\n if (counterMap) {\n hiddenElements.forEach(element => {\n const currentCounterValue = counterMap.get(element) || 0;\n const counterValue = currentCounterValue - 1;\n counterMap.set(element, counterValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet?.has(element) && controlAttribute) {\n element.removeAttribute(controlAttribute);\n }\n uncontrolledElementsSet?.delete(element);\n }\n });\n }\n if (mark) {\n markedElements.forEach(element => {\n const markerValue = (markerCounterMap.get(element) || 0) - 1;\n markerCounterMap.set(element, markerValue);\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n }\n lockCount -= 1;\n if (!lockCount) {\n counters.inert = new WeakMap();\n counters['aria-hidden'] = new WeakMap();\n uncontrolledElementsSets.inert = new WeakSet();\n uncontrolledElementsSets['aria-hidden'] = new WeakSet();\n markerCounterMap = new WeakMap();\n }\n };\n}\nexport function markOthers(avoidElements, options = {}) {\n const {\n ariaHidden = false,\n inert = false,\n mark = true,\n markerIgnoreElements = []\n } = options;\n const body = ownerDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements, body, ariaHidden, inert, {\n mark,\n markerIgnoreElements\n });\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { createAttribute } from \"../utils/createAttribute.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { EMPTY_OBJECT, ownerVisuallyHidden } from \"../../utils/constants.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n\n // React 17 does not use React.useId().\n if (uniqueId == null) {\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode, uniqueId]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n portalNode,\n portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n children,\n container,\n className,\n render,\n renderGuards,\n style,\n ...elementProps\n } = componentProps;\n const {\n portalNode,\n portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = typeof renderGuards === 'boolean' ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n React.useEffect(() => {\n if (!portalNode || open !== false) {\n return;\n }\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n \"aria-owns\": portalNode.id,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";","export function createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n map.get(event)?.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n map.get(event)?.delete(listener);\n }\n };\n}","import { createEventEmitter } from \"../utils/createEventEmitter.js\";\n\n/**\n * Stores and manages floating elements in a tree structure.\n * This is a backing store for the `FloatingTree` component.\n */\nexport class FloatingTreeStore {\n nodesRef = {\n current: []\n };\n events = createEventEmitter();\n addNode(node) {\n this.nodesRef.current.push(node);\n }\n removeNode(node) {\n const index = this.nodesRef.current.findIndex(n => n === node);\n if (index !== -1) {\n this.nodesRef.current.splice(index, 1);\n }\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"./FloatingTreeStore.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") FloatingNodeContext.displayName = \"FloatingNodeContext\";\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nif (process.env.NODE_ENV !== \"production\") FloatingTreeContext.displayName = \"FloatingTreeContext\";\nexport const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null;\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nexport const useFloatingTree = externalTree => {\n const contextTree = React.useContext(FloatingTreeContext);\n return externalTree ?? contextTree;\n};\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nexport function useFloatingNodeId(externalTree) {\n const id = useId();\n const tree = useFloatingTree(externalTree);\n const parentId = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (!id) {\n return undefined;\n }\n const node = {\n id,\n parentId\n };\n tree?.addNode(node);\n return () => {\n tree?.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/_jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingTree(props) {\n const {\n children,\n externalTree\n } = props;\n const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;\n return /*#__PURE__*/_jsx(FloatingTreeContext.Provider, {\n value: tree,\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { getNodeName, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { isWebKit } from '@base-ui/utils/detectBrowser';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { activeElement, contains, getTarget, isTypeableCombobox, getFloatingFocusElement, isTypeableElement } from \"../utils/element.js\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.js\";\nimport { tabbable, focusable, isOutsideEvent, isTabbable, getNextTabbable, getPreviousTabbable } from \"../utils/tabbable.js\";\nimport { getNodeAncestors, getNodeChildren } from \"../utils/nodes.js\";\nimport { isElementVisible } from \"../utils/composite.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { createAttribute } from \"../utils/createAttribute.js\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.js\";\nimport { markOthers } from \"../utils/markOthers.js\";\nimport { usePortalContext } from \"./FloatingPortal.js\";\nimport { useFloatingTree } from \"./FloatingTree.js\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../utils/constants.js\";\nimport { resolveRef } from \"../../utils/resolveRef.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction getEventType(event, lastInteractionType) {\n const win = ownerWindow(getTarget(event));\n if (event instanceof win.KeyboardEvent) {\n return 'keyboard';\n }\n if (event instanceof win.FocusEvent) {\n // Focus events can be caused by a preceding pointer interaction (e.g., focusout on outside press).\n // Prefer the last known pointer type if provided, else treat as keyboard.\n return lastInteractionType || 'keyboard';\n }\n if ('pointerType' in event) {\n return event.pointerType || 'keyboard';\n }\n if ('touches' in event) {\n return 'touch';\n }\n if (event instanceof win.MouseEvent) {\n // onClick events may not contain pointer events, and will fall through to here\n return lastInteractionType || (event.detail === 0 ? 'keyboard' : 'mouse');\n }\n return '';\n}\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction clearDisconnectedPreviouslyFocusedElements() {\n previouslyFocusedElements = previouslyFocusedElements.filter(entry => {\n return entry.deref()?.isConnected;\n });\n}\nfunction addPreviouslyFocusedElement(element) {\n clearDisconnectedPreviouslyFocusedElements();\n if (element && getNodeName(element) !== 'body') {\n previouslyFocusedElements.push(new WeakRef(element));\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n }\n}\nfunction getPreviouslyFocusedElement() {\n clearDisconnectedPreviouslyFocusedElements();\n return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();\n}\nfunction getFirstTabbableElement(container) {\n if (!container) {\n return null;\n }\n if (isTabbable(container)) {\n return container;\n }\n return tabbable(container)[0] || container;\n}\nfunction isFocusable(element) {\n if (!element || !element.isConnected) {\n return false;\n }\n if (typeof element.checkVisibility === 'function') {\n return element.checkVisibility();\n }\n return isElementVisible(element);\n}\nfunction handleTabIndex(floatingFocusElement, orderRef) {\n if (floatingFocusElement.hasAttribute('tabindex') && !floatingFocusElement.hasAttribute('data-tabindex')) {\n return;\n }\n if (!orderRef.current.includes('floating') && !floatingFocusElement.getAttribute('role')?.includes('dialog')) {\n return;\n }\n const focusableElements = focusable(floatingFocusElement);\n const tabbableContent = focusableElements.filter(element => {\n const dataTabIndex = element.getAttribute('data-tabindex') || '';\n return isTabbable(element) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');\n });\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n if (orderRef.current.includes('floating') || tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n }\n } else if (tabIndex !== '-1' || floatingFocusElement.hasAttribute('data-tabindex') && floatingFocusElement.getAttribute('data-tabindex') !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n floatingFocusElement.setAttribute('data-tabindex', '-1');\n }\n}\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n * @internal\n */\nexport function FloatingFocusManager(props) {\n const {\n context,\n children,\n disabled = false,\n initialFocus = true,\n returnFocus = true,\n restoreFocus = false,\n modal = true,\n closeOnFocusOut = true,\n openInteractionType = '',\n nextFocusableElement,\n previousFocusableElement,\n beforeContentFocusGuardRef,\n externalTree,\n getInsideElements\n } = props;\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const domReference = store.useState('domReferenceElement');\n const floating = store.useState('floatingElement');\n const {\n events,\n dataRef\n } = store.context;\n const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);\n const ignoreInitialFocus = initialFocus === false;\n // If the reference is a combobox and is typeable (e.g. input/textarea),\n // there are different focus semantics. The guards should not be rendered, but\n // aria-hidden should be applied to all nodes still. Further, the visually\n // hidden dismiss button should only appear at the end of the list, not the\n // start.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n const orderRef = React.useRef(['content']);\n const initialFocusRef = useValueAsRef(initialFocus);\n const returnFocusRef = useValueAsRef(returnFocus);\n const openInteractionTypeRef = useValueAsRef(openInteractionType);\n const tree = useFloatingTree(externalTree);\n const portalContext = usePortalContext();\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const pointerDownOutsideRef = React.useRef(false);\n const lastFocusedTabbableRef = React.useRef(null);\n const closeTypeRef = React.useRef('');\n const lastInteractionTypeRef = React.useRef('');\n const beforeGuardRef = React.useRef(null);\n const afterGuardRef = React.useRef(null);\n const mergedBeforeGuardRef = useMergedRefs(beforeGuardRef, beforeContentFocusGuardRef, portalContext?.beforeInsideRef);\n const mergedAfterGuardRef = useMergedRefs(afterGuardRef, portalContext?.afterInsideRef);\n const blurTimeout = useTimeout();\n const pointerDownTimeout = useTimeout();\n const restoreFocusFrame = useAnimationFrame();\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useStableCallback((container = floatingFocusElement) => {\n return container ? tabbable(container) : [];\n });\n const getResolvedInsideElements = useStableCallback(() => getInsideElements?.().filter(element => element != null) ?? []);\n\n // Prevent Tab from escaping the modal when there are no tabbable elements.\n React.useEffect(() => {\n if (disabled || !modal) {\n return undefined;\n }\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n }\n }\n const doc = ownerDocument(floatingFocusElement);\n return addEventListener(doc, 'keydown', onKeyDown);\n }, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent]);\n\n // Track pointer/keyboard interactions to disambiguate focus and outside presses.\n React.useEffect(() => {\n if (disabled || !open) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n function clearPointerDownOutside() {\n pointerDownOutsideRef.current = false;\n }\n function onPointerDown(event) {\n const target = getTarget(event);\n const insideElements = getResolvedInsideElements();\n const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target) || insideElements.some(element => element === target || contains(element, target));\n pointerDownOutsideRef.current = !pointerTargetInside;\n lastInteractionTypeRef.current = event.pointerType || 'keyboard';\n if (target?.closest(`[${CLICK_TRIGGER_IDENTIFIER}]`)) {\n isPointerDownRef.current = true;\n }\n }\n function onKeyDown() {\n lastInteractionTypeRef.current = 'keyboard';\n }\n return mergeCleanups(addEventListener(doc, 'pointerdown', onPointerDown, true), addEventListener(doc, 'pointerup', clearPointerDownOutside, true), addEventListener(doc, 'pointercancel', clearPointerDownOutside, true), addEventListener(doc, 'keydown', onKeyDown, true));\n }, [disabled, floating, domReference, floatingFocusElement, open, portalContext, getResolvedInsideElements]);\n\n // Close on focus out and restore focus within the floating tree when needed.\n React.useEffect(() => {\n if (disabled || !closeOnFocusOut) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n pointerDownTimeout.start(0, () => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusIn(event) {\n const target = getTarget(event);\n if (isTabbable(target)) {\n lastFocusedTabbableRef.current = target;\n }\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const currentTarget = event.currentTarget;\n const target = getTarget(event);\n queueMicrotask(() => {\n const nodeId = getNodeId();\n const triggers = store.context.triggerElements;\n const insideElements = getResolvedInsideElements();\n const isRelatedFocusGuard = relatedTarget?.hasAttribute(createAttribute('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement)].includes(relatedTarget);\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || contains(element, relatedTarget)) || relatedTarget != null && triggers.hasElement(relatedTarget) || triggers.hasMatchingElement(trigger => contains(trigger, relatedTarget)) || isRelatedFocusGuard || tree && (getNodeChildren(tree.nodesRef.current, nodeId).find(node => contains(node.context?.elements.floating, relatedTarget) || contains(node.context?.elements.domReference, relatedTarget)) || getNodeAncestors(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, getFloatingFocusElement(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));\n if (currentTarget === domReference && floatingFocusElement) {\n handleTabIndex(floatingFocusElement, orderRef);\n }\n\n // Restore focus to the previous tabbable element index to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && activeElement(doc) === doc.body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n // If explicitly requested to restore focus to the popup container, do not search\n // for the next/previous tabbable element.\n if (restoreFocus === 'popup') {\n // If the element is removed on pointerdown, focus tries to move it,\n // but since it's removed at the same time, focus gets lost as it\n // happens after the .focus() call above.\n // In this case, focus needs to be moved asynchronously.\n restoreFocusFrame.request(() => {\n floatingFocusElement.focus();\n });\n return;\n }\n }\n const tabbableContent = getTabbableContent();\n const prevTabbable = lastFocusedTabbableRef.current;\n const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // https://github.com/floating-ui/floating-ui/issues/3060\n if (dataRef.current.insideReactTree) {\n dataRef.current.insideReactTree = false;\n return;\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current && (\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n // For an \"untrapped\" typeable combobox (input role=combobox with\n // initialFocus=false), re-opening the popup and tabbing out should still close it even\n // when the previously focused element (e.g. the next tabbable outside the popup) is\n // focused again. Otherwise, the popup remains open on the second Tab sequence:\n // click input -> Tab (closes) -> click input -> Tab.\n // Allow closing when `isUntrappedTypeableCombobox` regardless of the previously focused element.\n isUntrappedTypeableCombobox || relatedTarget !== getPreviouslyFocusedElement())) {\n preventReturnFocusRef.current = true;\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event));\n }\n });\n }\n function markInsideReactTree() {\n if (pointerDownOutsideRef.current) {\n return;\n }\n dataRef.current.insideReactTree = true;\n blurTimeout.start(0, () => {\n dataRef.current.insideReactTree = false;\n });\n }\n const domReferenceElement = isHTMLElement(domReference) ? domReference : null;\n if (!floating && !domReferenceElement) {\n return undefined;\n }\n return mergeCleanups(domReferenceElement && addEventListener(domReferenceElement, 'focusout', handleFocusOutside), domReferenceElement && addEventListener(domReferenceElement, 'pointerdown', handlePointerDown), floating && addEventListener(floating, 'focusin', handleFocusIn), floating && addEventListener(floating, 'focusout', handleFocusOutside), floating && portalContext && addEventListener(floating, 'focusout', markInsideReactTree, true));\n }, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Hide everything outside the floating tree from assistive tech while open.\n React.useEffect(() => {\n if (disabled || !floating || !open) {\n return undefined;\n }\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute('portal')}]`) || []);\n const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];\n const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;\n const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];\n const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const ariaHiddenCleanup = markOthers(insideElements, {\n ariaHidden: modal || isUntrappedTypeableCombobox,\n mark: false\n });\n const markerInsideElements = [floating, ...portalNodes].filter(x => x != null);\n const markerCleanup = markOthers(markerInsideElements);\n return () => {\n markerCleanup();\n ariaHiddenCleanup();\n };\n }, [open, disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);\n\n // Focus the initial element when the floating element opens.\n useIsoLayoutEffect(() => {\n if (!open || disabled || !isHTMLElement(floatingFocusElement)) {\n return;\n }\n const doc = ownerDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const initialFocusValueOrFn = initialFocusRef.current;\n const resolvedInitialFocus = typeof initialFocusValueOrFn === 'function' ? initialFocusValueOrFn(openInteractionTypeRef.current || '') : initialFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedInitialFocus === undefined || resolvedInitialFocus === false) {\n return;\n }\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (focusAlreadyInsideFloatingEl) {\n return;\n }\n let focusableElements = null;\n const getDefaultFocusElement = () => {\n if (focusableElements == null) {\n focusableElements = getTabbableContent(floatingFocusElement);\n }\n return focusableElements[0] || floatingFocusElement;\n };\n let elToFocus;\n if (resolvedInitialFocus === true || resolvedInitialFocus === null) {\n elToFocus = getDefaultFocusElement();\n } else {\n elToFocus = resolveRef(resolvedInitialFocus);\n }\n elToFocus = elToFocus || getDefaultFocusElement();\n enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floatingFocusElement\n });\n });\n }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableContent, initialFocusRef, openInteractionTypeRef]);\n\n // Track return focus targets and restore focus on unmount/close.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n const doc = ownerDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n addPreviouslyFocusedElement(previouslyFocusedElement);\n\n // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n function onOpenChangeLocal(details) {\n if (!details.open) {\n closeTypeRef.current = getEventType(details.nativeEvent, lastInteractionTypeRef.current);\n }\n if (details.reason === REASONS.triggerHover && details.nativeEvent.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (details.reason !== REASONS.outsidePress) {\n return;\n }\n if (details.nested) {\n preventReturnFocusRef.current = false;\n } else if (isVirtualClick(details.nativeEvent) || isVirtualPointerEvent(details.nativeEvent)) {\n preventReturnFocusRef.current = false;\n } else {\n let isPreventScrollSupported = false;\n ownerDocument(floatingFocusElement).createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n if (isPreventScrollSupported) {\n preventReturnFocusRef.current = false;\n } else {\n preventReturnFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n function getReturnElement() {\n const returnFocusValueOrFn = returnFocusRef.current;\n let resolvedReturnFocusValue = typeof returnFocusValueOrFn === 'function' ? returnFocusValueOrFn(closeTypeRef.current) : returnFocusValueOrFn;\n\n // `null` should fallback to default behavior in case of an empty ref.\n if (resolvedReturnFocusValue === undefined || resolvedReturnFocusValue === false) {\n return null;\n }\n if (resolvedReturnFocusValue === null) {\n resolvedReturnFocusValue = true;\n }\n if (typeof resolvedReturnFocusValue === 'boolean') {\n const el = domReference || getPreviouslyFocusedElement();\n return el && el.isConnected ? el : null;\n }\n const fallback = domReference || getPreviouslyFocusedElement();\n return resolveRef(resolvedReturnFocusValue) || fallback || null;\n }\n return () => {\n events.off('openchange', onOpenChangeLocal);\n const activeEl = activeElement(doc);\n const insideElements = getResolvedInsideElements();\n const isFocusInsideFloatingTree = contains(floating, activeEl) || insideElements.some(element => element === activeEl || contains(element, activeEl)) || tree && getNodeChildren(tree.nodesRef.current, getNodeId(), false).some(node => contains(node.context?.elements.floating, activeEl));\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const returnFocusValueOrFn = returnFocusRef.current;\n const returnElement = getReturnElement();\n queueMicrotask(() => {\n // This is `returnElement`, if it's tabbable, or its first tabbable child.\n const tabbableReturnElement = getFirstTabbableElement(returnElement);\n const hasExplicitReturnFocus = typeof returnFocusValueOrFn !== 'boolean';\n if (returnFocusValueOrFn && !preventReturnFocusRef.current && isHTMLElement(tabbableReturnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n !hasExplicitReturnFocus && tabbableReturnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n tabbableReturnElement.focus({\n preventScroll: true\n });\n }\n preventReturnFocusRef.current = false;\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, events, tree, domReference, getNodeId, getResolvedInsideElements]);\n\n // Safari may randomly scroll to the bottom of the page if an input inside a popup has focus\n // when the popup unmounts from the DOM.\n // By blurring it before the popup unmounts, we can prevent this behavior.\n useIsoLayoutEffect(() => {\n if (!isWebKit || open || !floating) {\n return;\n }\n const activeEl = activeElement(ownerDocument(floating));\n if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {\n return;\n }\n if (contains(floating, activeEl)) {\n activeEl.blur();\n }\n }, [open, floating]);\n // Synchronize the `context` & `modal` value to the FloatingPortal context.\n // It will decide whether or not it needs to render its own guards.\n useIsoLayoutEffect(() => {\n if (disabled || !portalContext) {\n return undefined;\n }\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange: store.setOpen,\n domReference\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);\n\n // Keep the floating element tabIndex in sync and clear stale focus records.\n useIsoLayoutEffect(() => {\n if (disabled || !floatingFocusElement) {\n return undefined;\n }\n handleTabIndex(floatingFocusElement, orderRef);\n return () => {\n queueMicrotask(clearDisconnectedPreviouslyFocusedElements);\n };\n }, [disabled, floatingFocusElement, orderRef]);\n const shouldRenderGuards = !disabled && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedBeforeGuardRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableContent();\n enqueueFocus(els[els.length - 1]);\n } else if (portalContext?.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n } else {\n resolveRef(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();\n }\n }\n }\n }), children, shouldRenderGuards && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"inside\",\n ref: mergedAfterGuardRef,\n onFocus: event => {\n if (modal) {\n enqueueFocus(getTabbableContent()[0]);\n } else if (portalContext?.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n } else {\n resolveRef(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();\n }\n }\n }\n })]\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { EMPTY_OBJECT } from \"../../utils/constants.js\";\nimport { getTarget, isTypeableElement } from \"../utils/element.js\";\nimport { isClickLikeEvent, isMouseLikePointerType } from \"../utils/event.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nexport function useClick(context, props = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const dataRef = store.context.dataRef;\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n stickIfOpen = true,\n touchOpenDelay = 0,\n reason = REASONS.triggerPress\n } = props;\n const pointerTypeRef = React.useRef(undefined);\n const frame = useAnimationFrame();\n const touchOpenTimeout = useTimeout();\n const reference = React.useMemo(() => ({\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n const nativeEvent = event.nativeEvent;\n const open = store.select('open');\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0 || eventOption === 'click' || isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const openEvent = dataRef.current.openEvent;\n const openEventType = openEvent?.type;\n const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== event.currentTarget;\n const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? openEventType === 'click' || openEventType === 'mousedown' : true));\n\n // Animations sometimes won't run on a typeable element if using a rAF.\n // Focus is always set on these elements. For touch, we may delay opening.\n const target = getTarget(nativeEvent);\n if (isTypeableElement(target)) {\n const details = createChangeEventDetails(reason, nativeEvent, target);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n return;\n }\n\n // Capture the currentTarget before the rAF.\n // as React sets it to null after the event handler completes.\n const eventCurrentTarget = event.currentTarget;\n\n // Wait until focus is set on the element. This is an alternative to\n // `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.\n frame.request(() => {\n const details = createChangeEventDetails(reason, nativeEvent, eventCurrentTarget);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n });\n },\n onClick(event) {\n if (eventOption === 'mousedown-only') {\n return;\n }\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerType) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {\n return;\n }\n const open = store.select('open');\n const openEvent = dataRef.current.openEvent;\n const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== event.currentTarget;\n const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? isClickLikeEvent(openEvent) : true));\n const details = createChangeEventDetails(reason, event.nativeEvent, event.currentTarget);\n if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {\n touchOpenTimeout.start(touchOpenDelay, () => {\n store.setOpen(true, details);\n });\n } else {\n store.setOpen(nextOpen, details);\n }\n },\n onKeyDown() {\n pointerTypeRef.current = undefined;\n }\n }), [dataRef, eventOption, ignoreMouse, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay, reason]);\n return React.useMemo(() => enabled ? {\n reference\n } : EMPTY_OBJECT, [enabled, reference]);\n}","'use client';\n\nimport * as React from 'react';\nimport { getWindow } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { contains, getTarget } from \"../utils/element.js\";\nimport { isMouseLikePointerType } from \"../utils/event.js\";\nfunction createVirtualElement(domElement, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domElement || undefined,\n getBoundingClientRect() {\n const domRect = domElement?.getBoundingClientRect() || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(data.dataRef.current.openEvent?.type || '') && data.pointerType !== 'touch';\n let width = domRect.width;\n let height = domRect.height;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n width = 0;\n height = 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n width = data.axis === 'y' ? domRect.width : 0;\n height = data.axis === 'x' ? domRect.height : 0;\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n height = data.axis === 'x' ? domRect.height : height;\n width = data.axis === 'y' ? domRect.width : width;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nexport function useClientPoint(context, props = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floating = store.useState('floatingElement');\n const domReference = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const {\n enabled = true,\n axis = 'both'\n } = props;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const setReference = useStableCallback((newX, newY, referenceElement) => {\n if (initialRef.current) {\n return;\n }\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n store.set('positionReference', createVirtualElement(referenceElement ?? domReference, {\n x: newX,\n y: newY,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useStableCallback(event => {\n if (!open) {\n setReference(event.clientX, event.clientY, event.currentTarget);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n const addListener = React.useCallback(() => {\n if (!openCheck || !enabled) {\n return undefined;\n }\n const win = getWindow(floating);\n function handleMouseMove(event) {\n const target = getTarget(event);\n if (!contains(floating, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n cleanupListenerRef.current?.();\n cleanupListenerRef.current = null;\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n const cleanup = () => {\n cleanupListenerRef.current?.();\n cleanupListenerRef.current = null;\n };\n cleanupListenerRef.current = addEventListener(win, 'mousemove', handleMouseMove);\n return cleanup;\n }\n store.set('positionReference', domReference);\n return undefined;\n }, [openCheck, enabled, floating, dataRef, domReference, store, setReference]);\n React.useEffect(() => {\n return addListener();\n }, [addListener, reactive]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n const reference = React.useMemo(() => {\n function setPointerTypeRef(event) {\n setPointerType(event.pointerType);\n }\n return {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n };\n }, [handleReferenceEnterOrMove]);\n return React.useMemo(() => enabled ? {\n reference,\n trigger: reference\n } : {}, [enabled, reference]);\n}","'use client';\n\nimport * as React from 'react';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot, isWebKit } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.js\";\nimport { isReactEvent } from \"../utils/event.js\";\nimport { getNodeChildren } from \"../utils/nodes.js\";\n\n/* eslint-disable no-underscore-dangle */\n\nimport { useFloatingTree } from \"../components/FloatingTree.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { createAttribute } from \"../utils/createAttribute.js\";\nconst bubbleHandlerKeys = {\n intentional: 'onClick',\n sloppy: 'onPointerDown'\n};\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(context, props = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef\n } = store.context;\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n referencePressEvent = 'sloppy',\n bubbles,\n externalTree\n } = props;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const isReferencePressEnabled = useStableCallback(referencePress);\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n if (!escapeKeyBubbles) {\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n if (child.context?.open && !child.context.dataRef.current.__escapeKeyBubbles) {\n shouldDismiss = false;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return undefined;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const compositionTimeout = new Timeout();\n const preventedPressSuppressionTimeout = new Timeout();\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n isWebKit() ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement')) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // In intentional mode, a press that starts inside and ends outside gets\n // one suppressed outside click. Run this after inside-target checks so\n // inside clicks don't consume the one-shot suppression.\n if (getOutsidePressEvent() === 'intentional' && suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n if (child.context?.open && !child.context.dataRef.current.__outsidePressBubbles) {\n shouldDismiss = false;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'))) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'))) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n if (event.type === 'pointerdown') {\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'))) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'))) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const doc = ownerDocument(floatingElement);\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, true), addEventListener(doc, 'touchmove', handleTouchMoveCapture, true), addEventListener(doc, 'touchend', handleTouchEndCapture, true)));\n return () => {\n unsubscribe();\n compositionTimeout.clear();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, tree, store, cancelDismissOnEndTimeout]);\n React.useEffect(clearInsideReactTree, [outsidePress, clearInsideReactTree]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n [bubbleHandlerKeys[referencePressEvent]]: event => {\n if (!isReferencePressEnabled()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n },\n ...(referencePressEvent !== 'intentional' && {\n onClick(event) {\n if (!isReferencePressEnabled()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n }\n })\n }), [closeOnEscapeKeyDown, store, referencePressEvent, isReferencePressEnabled]);\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => {\n const result = offset$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => {\n const result = shift$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => {\n const result = limitShift$1(options);\n return {\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => {\n const result = flip$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => {\n const result = size$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => {\n const result = autoPlacement$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => {\n const result = hide$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => {\n const result = inline$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => {\n const result = arrow$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n","import _formatErrorMessage from \"../formatErrorMessage.js\";\n/**\n * The NoOptionalParams type is a utility type that checks if a function has optional or default parameters.\n * If the function has optional or default parameters, it returns a string literal type with an error message.\n * Otherwise, it returns the original function type.\n *\n * This is used to enforce that the combiner function passed to createSelector does not have optional or default parameters,\n * as memoization relies on the Function.length property, which does not account for optional or default parameters.\n */\n\n/**\n * Creates a selector function that can be used to derive values from the store's state.\n *\n * The combiner function can have up to three additional parameters, but it **cannot have optional or default parameters**.\n *\n * This function accepts up to six functions and combines them into a single selector function.\n * The resulting selector will take the state from the combined selectors and any additional parameters required by the combiner.\n *\n * The return type of the resulting selector is determined by the return type of the combiner function.\n *\n * @example\n * const selector = createSelector(\n * (state) => state.disabled\n * );\n *\n * @example\n * const selector = createSelector(\n * (state) => state.disabled,\n * (state) => state.open,\n * (disabled, open) => ({ disabled, open })\n * );\n */\n/* eslint-disable id-denylist */\nexport const createSelector = (a, b, c, d, e, f, ...other) => {\n if (other.length > 0) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Unsupported number of selectors' : _formatErrorMessage(1));\n }\n let selector;\n if (a && b && c && d && e && f) {\n selector = (state, a1, a2, a3) => {\n const va = a(state, a1, a2, a3);\n const vb = b(state, a1, a2, a3);\n const vc = c(state, a1, a2, a3);\n const vd = d(state, a1, a2, a3);\n const ve = e(state, a1, a2, a3);\n return f(va, vb, vc, vd, ve, a1, a2, a3);\n };\n } else if (a && b && c && d && e) {\n selector = (state, a1, a2, a3) => {\n const va = a(state, a1, a2, a3);\n const vb = b(state, a1, a2, a3);\n const vc = c(state, a1, a2, a3);\n const vd = d(state, a1, a2, a3);\n return e(va, vb, vc, vd, a1, a2, a3);\n };\n } else if (a && b && c && d) {\n selector = (state, a1, a2, a3) => {\n const va = a(state, a1, a2, a3);\n const vb = b(state, a1, a2, a3);\n const vc = c(state, a1, a2, a3);\n return d(va, vb, vc, a1, a2, a3);\n };\n } else if (a && b && c) {\n selector = (state, a1, a2, a3) => {\n const va = a(state, a1, a2, a3);\n const vb = b(state, a1, a2, a3);\n return c(va, vb, a1, a2, a3);\n };\n } else if (a && b) {\n selector = (state, a1, a2, a3) => {\n const va = a(state, a1, a2, a3);\n return b(va, a1, a2, a3);\n };\n } else if (a) {\n selector = a;\n } else {\n throw /* minify-error-disabled */new Error('Missing arguments');\n }\n return selector;\n};\n/* eslint-enable id-denylist */","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject)\n isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"The result function returned its own inputs without modification. e.g\\n`createSelector([state => state.todos], todos => todos)`\\nThis could lead to inefficient memoization and unnecessary re-renders.\\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"An input selector returned a different result when passed same arguments.\\nThis means your output selector will likely run more frequently than intended.\\nAvoid returning a new reference inside your input selector, e.g.\\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = /* @__PURE__ */ Symbol(\"NOT_FOUND\");\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue)\n return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult;\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? new Ref(result) : result;\n }\n }\n terminatedNode.s = TERMINATED;\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun)\n firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map","import _formatErrorMessage from \"../formatErrorMessage.js\";\nimport { lruMemoize, createSelectorCreator } from 'reselect';\n/* eslint-disable no-underscore-dangle */ // __cacheKey__\n\nconst reselectCreateSelector = createSelectorCreator({\n memoize: lruMemoize,\n memoizeOptions: {\n maxSize: 1,\n equalityCheck: Object.is\n }\n});\nexport const createSelectorMemoized = (...selectors) => {\n const cache = new WeakMap();\n let nextCacheId = 1;\n const combiner = selectors[selectors.length - 1];\n const nSelectors = selectors.length - 1 || 1;\n // (s1, s2, ..., sN, a1, a2, a3) => { ... }\n const argsLength = combiner.length - nSelectors;\n if (argsLength > 3) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Unsupported number of arguments' : _formatErrorMessage(2));\n }\n const selector = (state, a1, a2, a3) => {\n let cacheKey = state.__cacheKey__;\n if (!cacheKey) {\n cacheKey = {\n id: nextCacheId\n };\n state.__cacheKey__ = cacheKey;\n nextCacheId += 1;\n }\n let fn = cache.get(cacheKey);\n if (!fn) {\n let reselectArgs = selectors;\n const selectorArgs = [undefined, undefined, undefined];\n switch (argsLength) {\n case 0:\n break;\n case 1:\n {\n reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], combiner];\n break;\n }\n case 2:\n {\n reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], combiner];\n break;\n }\n case 3:\n {\n reselectArgs = [...selectors.slice(0, -1), () => selectorArgs[0], () => selectorArgs[1], () => selectorArgs[2], combiner];\n break;\n }\n default:\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Unsupported number of arguments' : _formatErrorMessage(2));\n }\n fn = reselectCreateSelector(...reselectArgs);\n fn.selectorArgs = selectorArgs;\n cache.set(cacheKey, fn);\n }\n fn.selectorArgs[0] = a1;\n fn.selectorArgs[1] = a2;\n fn.selectorArgs[2] = a3;\n switch (argsLength) {\n case 0:\n return fn(state);\n case 1:\n return fn(state, a1);\n case 2:\n return fn(state, a1, a2);\n case 3:\n return fn(state, a1, a2, a3);\n default:\n throw /* minify-error-disabled */new Error('unreachable');\n }\n };\n return selector;\n};","/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.js\";\nconst hooks = [];\nlet currentInstance = undefined;\nexport function getInstance() {\n return currentInstance;\n}\nexport function setInstance(instance) {\n currentInstance = instance;\n}\nexport function register(hook) {\n hooks.push(hook);\n}\nexport function fastComponent(fn) {\n const FastComponent = (props, forwardedRef) => {\n const instance = useRefWithInit(createInstance).current;\n let result;\n try {\n currentInstance = instance;\n for (const hook of hooks) {\n hook.before(instance);\n }\n result = fn(props, forwardedRef);\n for (const hook of hooks) {\n hook.after(instance);\n }\n instance.didInitialize = true;\n } finally {\n currentInstance = undefined;\n }\n return result;\n };\n FastComponent.displayName = fn.displayName || fn.name;\n return FastComponent;\n}\nexport function fastComponentRef(fn) {\n return /*#__PURE__*/React.forwardRef(fastComponent(fn));\n}\nfunction createInstance() {\n return {\n didInitialize: false\n };\n}","import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.js\";\nimport { register, getInstance } from \"../fastHooks.js\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (hook.didChange || !Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n hook.didChange = false;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3),\n didChange: false\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.didChange = true;\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}","import { useStore } from \"./useStore.js\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}","/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.js\";\nimport { useStore } from \"./useStore.js\";\nimport { useStableCallback } from \"../useStableCallback.js\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.js\";\nimport { NOOP } from \"../empty.js\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n useIsoLayoutEffect(() => {\n if (this.state[key] !== value) {\n this.set(key, value);\n }\n }, [key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(this.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n super.setState({\n ...this.state,\n [key]: controlled\n });\n }\n }, [key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${isControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${isControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a function that forces a rerender.\n */\nexport function useForcedRerendering() {\n const [, setState] = React.useState({});\n return React.useCallback(() => {\n setState({});\n }, []);\n}","import { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { createEventEmitter } from \"../utils/createEventEmitter.js\";\nimport { isClickLikeEvent } from \"../utils.js\";\nconst selectors = {\n open: createSelector(state => state.open),\n transitionStatus: createSelector(state => state.transitionStatus),\n domReferenceElement: createSelector(state => state.domReferenceElement),\n referenceElement: createSelector(state => state.positionReference ?? state.referenceElement),\n floatingElement: createSelector(state => state.floatingElement),\n floatingId: createSelector(state => state.floatingId)\n};\nexport class FloatingRootStore extends ReactStore {\n constructor(options) {\n const {\n syncOnly,\n nested,\n onOpenChange,\n triggerElements,\n ...initialState\n } = options;\n super({\n ...initialState,\n positionReference: initialState.referenceElement,\n domReferenceElement: initialState.referenceElement\n }, {\n onOpenChange,\n dataRef: {\n current: {}\n },\n events: createEventEmitter(),\n nested,\n triggerElements\n }, selectors);\n this.syncOnly = syncOnly;\n }\n\n /**\n * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.\n */\n syncOpenEvent = (newOpen, event) => {\n if (!newOpen || !this.state.open ||\n // Prevent a pending hover-open from overwriting a click-open event, while allowing\n // click events to upgrade a hover-open.\n event != null && isClickLikeEvent(event)) {\n this.context.dataRef.current.openEvent = newOpen ? event : undefined;\n }\n };\n\n /**\n * Runs the root-owned side effects for an open state change.\n */\n dispatchOpenChange = (newOpen, eventDetails) => {\n this.syncOpenEvent(newOpen, eventDetails.event);\n const details = {\n open: newOpen,\n reason: eventDetails.reason,\n nativeEvent: eventDetails.event,\n nested: this.context.nested,\n triggerElement: eventDetails.trigger\n };\n this.context.events.emit('openchange', details);\n };\n\n /**\n * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.\n *\n * @param newOpen The new open state.\n * @param eventDetails Details about the event that triggered the open state change.\n */\n setOpen = (newOpen, eventDetails) => {\n if (this.syncOnly) {\n this.context.onOpenChange?.(newOpen, eventDetails);\n return;\n }\n this.dispatchOpenChange(newOpen, eventDetails);\n this.context.onOpenChange?.(newOpen, eventDetails);\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTransitionStatus } from \"../useTransitionStatus.js\";\nimport { useOpenChangeComplete } from \"../useOpenChangeComplete.js\";\n/**\n * Returns a callback ref that registers/unregisters the trigger element in the store.\n *\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n // Keep track of the currently registered element to unregister it on unmount or id change.\n const registeredElementIdRef = React.useRef(null);\n const registeredElementRef = React.useRef(null);\n return React.useCallback(element => {\n if (id === undefined) {\n return;\n }\n if (registeredElementIdRef.current !== null) {\n const registeredId = registeredElementIdRef.current;\n const registeredElement = registeredElementRef.current;\n const currentElement = store.context.triggerElements.getById(registeredId);\n if (registeredElement && currentElement === registeredElement) {\n store.context.triggerElements.delete(registeredId);\n }\n registeredElementIdRef.current = null;\n registeredElementRef.current = null;\n }\n if (element !== null) {\n registeredElementIdRef.current = id;\n registeredElementRef.current = element;\n store.context.triggerElements.add(id, element);\n }\n }, [store, id]);\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElement The trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (!element || !store.select('open')) {\n return;\n }\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n store.update({\n activeTriggerElement: element,\n ...stateUpdates\n });\n return;\n }\n if (activeTriggerId == null) {\n // This runs when popup is open, but no active trigger is set.\n // It can happen when using controlled mode and the trigger is mounted after opening or if `triggerId` prop is not set explicitly.\n // In such cases the first trigger to run this code becomes the active trigger (store.select('activeTriggerId') should not return null after that).\n // This is mostly for compatibility with contained triggers where no explicit `triggerId` was required in controlled mode.\n store.update({\n activeTriggerId: triggerId,\n activeTriggerElement: element,\n ...stateUpdates\n });\n }\n });\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n store.update({\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Ensures that when there's only one trigger element registered, it is set as the active trigger.\n * This allows controlled popups to work correctly without an explicit triggerId, maintaining compatibility\n * with the contained triggers.\n *\n * This should be called on the Root part.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n */\nexport function useImplicitActiveTrigger(store) {\n const open = store.useState('open');\n useIsoLayoutEffect(() => {\n if (open && !store.select('activeTriggerId') && store.context.triggerElements.size === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n store.update({\n activeTriggerId: implicitTriggerId,\n activeTriggerElement: implicitTriggerElement\n });\n }\n }\n }, [open, store]);\n}\n\n/**\n * Mangages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted` and `transitionStatus` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n *\n * @returns A function to forcibly unmount the popup.\n */\nexport function useOpenStateTransitions(open, store, onUnmount) {\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n store.useSyncedValues({\n mounted,\n transitionStatus\n });\n const forceUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n });\n const preventUnmountingOnClose = store.useState('preventUnmountingOnClose');\n useOpenChangeComplete({\n enabled: !preventUnmountingOnClose,\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}","/**\n * Data structure to keep track of popup trigger elements by their IDs.\n * Uses both a set of Elements and a map of IDs to Elements for efficient lookups.\n */\nexport class PopupTriggerMap {\n constructor() {\n this.elementsSet = new Set();\n this.idMap = new Map();\n }\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n const existingElement = this.idMap.get(id);\n if (existingElement === element) {\n return;\n }\n if (existingElement !== undefined) {\n // We assume that the same element won't be registered under multiple ids.\n // This is safe considering how useTriggerRegistration is implemented.\n this.elementsSet.delete(existingElement);\n }\n this.elementsSet.add(element);\n this.idMap.set(id, element);\n if (process.env.NODE_ENV !== 'production') {\n if (this.elementsSet.size !== this.idMap.size) {\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n }\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n const element = this.idMap.get(id);\n if (element) {\n this.elementsSet.delete(element);\n this.idMap.delete(id);\n }\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n return this.elementsSet.has(element);\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.elementsSet) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.elementsSet.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}","import { PopupTriggerMap } from \"../../utils/popups/index.js\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.js\";\nexport function getEmptyRootContext() {\n return new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements: new PopupTriggerMap(),\n floatingId: '',\n syncOnly: false,\n nested: false,\n onOpenChange: undefined\n });\n}","import { createSelector } from '@base-ui/utils/store';\nimport { getEmptyRootContext } from \"../../floating-ui-react/utils/getEmptyRootContext.js\";\nimport { EMPTY_OBJECT } from \"../constants.js\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState() {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: getEmptyRootContext(),\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nconst activeTriggerIdSelector = createSelector(state => state.triggerIdProp ?? state.activeTriggerId);\nexport const popupStoreSelectors = {\n open: createSelector(state => state.openProp ?? state.open),\n mounted: createSelector(state => state.mounted),\n transitionStatus: createSelector(state => state.transitionStatus),\n floatingRootContext: createSelector(state => state.floatingRootContext),\n preventUnmountingOnClose: createSelector(state => state.preventUnmountingOnClose),\n payload: createSelector(state => state.payload),\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: createSelector(state => state.mounted ? state.activeTriggerElement : null),\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId),\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.open),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: createSelector((state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted),\n triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps),\n popupProps: createSelector(state => state.popupProps),\n popupElement: createSelector(state => state.popupElement),\n positionerElement: createSelector(state => state.positionerElement)\n};","'use client';\n\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useId } from '@base-ui/utils/useId';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.js\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.js\";\nimport { PopupTriggerMap } from \"../../utils/popups/index.js\";\nexport function useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange,\n elements = {}\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== 'production') {\n const optionDomReference = elements.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n console.error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `context.setPositionReference()`', 'instead.');\n }\n }\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n onOpenChange,\n referenceElement: elements.reference ?? null,\n floatingElement: elements.floating ?? null,\n triggerElements: new PopupTriggerMap(),\n floatingId,\n syncOnly: false,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId\n };\n\n // Only sync elements that are defined to avoid overwriting existing ones\n if (elements.reference !== undefined) {\n valuesToSync.referenceElement = elements.reference;\n valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null;\n }\n if (elements.floating !== undefined) {\n valuesToSync.floatingElement = elements.floating;\n }\n store.update(valuesToSync);\n }, [open, floatingId, elements.reference, elements.floating, store]);\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { useFloating as usePosition } from '@floating-ui/react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFloatingTree } from \"../components/FloatingTree.js\";\nimport { useFloatingRootContext } from \"./useFloatingRootContext.js\";\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/useFloating\n */\nexport function useFloating(options = {}) {\n const {\n nodeId,\n externalTree\n } = options;\n const internalRootStore = useFloatingRootContext(options);\n const rootContext = options.rootContext || internalRootStore;\n const rootContextElements = {\n reference: rootContext.useState('referenceElement'),\n floating: rootContext.useState('floatingElement'),\n domReference: rootContext.useState('domReferenceElement')\n };\n const [positionReference, setPositionReferenceRaw] = React.useState(null);\n const domReferenceRef = React.useRef(null);\n const tree = useFloatingTree(externalTree);\n useIsoLayoutEffect(() => {\n if (rootContextElements.domReference) {\n domReferenceRef.current = rootContextElements.domReference;\n }\n }, [rootContextElements.domReference]);\n const position = usePosition({\n ...options,\n elements: {\n ...rootContextElements,\n ...(positionReference && {\n reference: positionReference\n })\n }\n });\n const setPositionReference = React.useCallback(node => {\n const computedPositionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n getClientRects: () => node.getClientRects(),\n contextElement: node\n } : node;\n // Store the positionReference in state if the DOM reference is specified externally via the\n // `elements.reference` option. This ensures that it won't be overridden on future renders.\n setPositionReferenceRaw(computedPositionReference);\n position.refs.setReference(computedPositionReference);\n }, [position.refs]);\n const [localDomReference, setLocalDomReference] = React.useState(undefined);\n const [localFloatingElement, setLocalFloatingElement] = React.useState(null);\n rootContext.useSyncedValue('referenceElement', localDomReference ?? null);\n const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null;\n rootContext.useSyncedValue('domReferenceElement', localDomReference === undefined ? rootContextElements.domReference : localDomReferenceElement);\n rootContext.useSyncedValue('floatingElement', localFloatingElement);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setLocalDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs, setLocalDomReference]);\n const setFloating = React.useCallback(node => {\n setLocalFloatingElement(node);\n position.refs.setFloating(node);\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setFloating,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setFloating, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: rootContextElements.domReference\n }), [position.elements, rootContextElements.domReference]);\n const open = rootContext.useState('open');\n const floatingId = rootContext.useState('floatingId');\n const context = React.useMemo(() => ({\n ...position,\n dataRef: rootContext.context.dataRef,\n open,\n onOpenChange: rootContext.setOpen,\n events: rootContext.context.events,\n floatingId,\n refs,\n elements,\n nodeId,\n rootStore: rootContext\n }), [position, refs, elements, nodeId, rootContext, open, floatingId]);\n useIsoLayoutEffect(() => {\n rootContext.context.dataRef.current.floatingContext = context;\n const node = tree?.nodesRef.current.find(n => n.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements,\n rootStore: rootContext\n }), [position, refs, elements, context, rootContext]);\n}","'use client';\n\nimport { useId } from '@base-ui/utils/useId';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.js\";\nimport { FloatingRootStore } from \"../components/FloatingRootStore.js\";\n/**\n * Initializes a FloatingRootStore that is kept in sync with the provided PopupStore.\n * The new instance is created only once and updated on every render.\n */\nexport function useSyncedFloatingRootContext(options) {\n const {\n popupStore,\n treatPopupAsFloatingElement = false,\n onOpenChange\n } = options;\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const open = popupStore.useState('open');\n const referenceElement = popupStore.useState('activeTriggerElement');\n const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');\n const triggerElements = popupStore.context.triggerElements;\n const store = useRefWithInit(() => new FloatingRootStore({\n open,\n transitionStatus: undefined,\n referenceElement,\n floatingElement,\n triggerElements,\n onOpenChange,\n floatingId,\n syncOnly: true,\n nested\n })).current;\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId,\n referenceElement,\n floatingElement\n };\n if (isElement(referenceElement)) {\n valuesToSync.domReferenceElement = referenceElement;\n }\n if (store.state.positionReference === store.state.referenceElement) {\n valuesToSync.positionReference = referenceElement;\n }\n store.update(valuesToSync);\n }, [open, floatingId, referenceElement, floatingElement, store]);\n\n // TODO: When `setOpen` is a part of the PopupStore API, we don't need to sync it.\n store.context.onOpenChange = onOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { getWindow, isElement, isHTMLElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { isMac, isSafari } from '@base-ui/utils/detectBrowser';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains, getTarget, isTargetInsideEnabledTrigger, isTypeableElement, matchesFocusVisible } from \"../utils/element.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { createAttribute } from \"../utils/createAttribute.js\";\nconst isMacSafari = isMac && isSafari;\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nexport function useFocus(context, props = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const {\n events,\n dataRef\n } = store.context;\n const {\n enabled = true,\n delay\n } = props;\n const blockFocusRef = React.useRef(false);\n // Track which reference should be blocked from re-opening after Escape/press dismissal.\n const blockedReferenceRef = React.useRef(null);\n const timeout = useTimeout();\n const keyboardModalityRef = React.useRef(true);\n React.useEffect(() => {\n const domReference = store.select('domReferenceElement');\n if (!enabled) {\n return undefined;\n }\n const win = getWindow(domReference);\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n const currentDomReference = store.select('domReferenceElement');\n if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {\n blockFocusRef.current = true;\n }\n }\n function onKeyDown() {\n keyboardModalityRef.current = true;\n }\n function onPointerDown() {\n keyboardModalityRef.current = false;\n }\n return mergeCleanups(addEventListener(win, 'blur', onBlur), isMacSafari && addEventListener(win, 'keydown', onKeyDown, true), isMacSafari && addEventListener(win, 'pointerdown', onPointerDown, true));\n }, [store, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onOpenChangeLocal(details) {\n if (details.reason === REASONS.triggerPress || details.reason === REASONS.escapeKey) {\n const referenceElement = store.select('domReferenceElement');\n if (isElement(referenceElement)) {\n blockedReferenceRef.current = referenceElement;\n blockFocusRef.current = true;\n }\n }\n }\n events.on('openchange', onOpenChangeLocal);\n return () => {\n events.off('openchange', onOpenChangeLocal);\n };\n }, [events, enabled, store]);\n const reference = React.useMemo(() => ({\n onMouseLeave() {\n blockFocusRef.current = false;\n blockedReferenceRef.current = null;\n },\n onFocus(event) {\n const focusTarget = event.currentTarget;\n if (blockFocusRef.current) {\n if (blockedReferenceRef.current === focusTarget) {\n return;\n }\n blockFocusRef.current = false;\n blockedReferenceRef.current = null;\n }\n const target = getTarget(event.nativeEvent);\n if (isElement(target)) {\n // Safari fails to match `:focus-visible` if focus was initially\n // outside the document.\n if (isMacSafari && !event.relatedTarget) {\n if (!keyboardModalityRef.current && !isTypeableElement(target)) {\n return;\n }\n } else if (!matchesFocusVisible(target)) {\n return;\n }\n }\n const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);\n const {\n nativeEvent,\n currentTarget\n } = event;\n const delayValue = typeof delay === 'function' ? delay() : delay;\n if (store.select('open') && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === undefined) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));\n return;\n }\n timeout.start(delayValue, () => {\n if (blockFocusRef.current) {\n return;\n }\n store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));\n });\n },\n onBlur(event) {\n blockFocusRef.current = false;\n blockedReferenceRef.current = null;\n const relatedTarget = event.relatedTarget;\n const nativeEvent = event.nativeEvent;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeout.start(0, () => {\n const domReference = store.select('domReferenceElement');\n const activeEl = activeElement(ownerDocument(domReference));\n\n // Focus left the page, keep it open.\n if (!relatedTarget && activeEl === domReference) {\n return;\n }\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n // We can not rely on relatedTarget to point to the correct element\n // as it will only point to the shadow host of the newly focused element\n // and not the element that actually has received focus if it is located\n // inside a shadow root.\n if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {\n return;\n }\n\n // If the next focused element is one of the triggers, do not close\n // the floating element. The focus handler of that trigger will\n // handle the open state.\n const nextFocusedElement = relatedTarget ?? activeEl;\n if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerFocus, nativeEvent));\n });\n }\n }), [dataRef, store, timeout, delay]);\n return React.useMemo(() => enabled ? {\n reference,\n trigger: reference\n } : {}, [enabled, reference]);\n}","'use client';\n\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { isInteractiveElement } from \"../utils.js\";\nexport { isInteractiveElement };\nexport class HoverInteraction {\n constructor() {\n this.pointerType = undefined;\n this.interactedInside = false;\n this.handler = undefined;\n this.blockMouseMove = true;\n this.performedPointerEventsMutation = false;\n this.pointerEventsScopeElement = null;\n this.pointerEventsReferenceElement = null;\n this.pointerEventsFloatingElement = null;\n this.restTimeoutPending = false;\n this.openChangeTimeout = new Timeout();\n this.restTimeout = new Timeout();\n this.handleCloseOptions = undefined;\n }\n static create() {\n return new HoverInteraction();\n }\n dispose = () => {\n this.openChangeTimeout.clear();\n this.restTimeout.clear();\n };\n disposeEffect = () => {\n return this.dispose;\n };\n}\nconst pointerEventsMutationOwnerByScopeElement = new WeakMap();\nexport function clearSafePolygonPointerEventsMutation(instance) {\n if (!instance.performedPointerEventsMutation) {\n return;\n }\n const scopeElement = instance.pointerEventsScopeElement;\n if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {\n instance.pointerEventsScopeElement?.style.removeProperty('pointer-events');\n instance.pointerEventsReferenceElement?.style.removeProperty('pointer-events');\n instance.pointerEventsFloatingElement?.style.removeProperty('pointer-events');\n pointerEventsMutationOwnerByScopeElement.delete(scopeElement);\n }\n instance.performedPointerEventsMutation = false;\n instance.pointerEventsScopeElement = null;\n instance.pointerEventsReferenceElement = null;\n instance.pointerEventsFloatingElement = null;\n}\nexport function applySafePolygonPointerEventsMutation(instance, options) {\n const {\n scopeElement,\n referenceElement,\n floatingElement\n } = options;\n const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);\n if (existingOwner && existingOwner !== instance) {\n clearSafePolygonPointerEventsMutation(existingOwner);\n }\n clearSafePolygonPointerEventsMutation(instance);\n instance.performedPointerEventsMutation = true;\n instance.pointerEventsScopeElement = scopeElement;\n instance.pointerEventsReferenceElement = referenceElement;\n instance.pointerEventsFloatingElement = floatingElement;\n pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);\n scopeElement.style.pointerEvents = 'none';\n referenceElement.style.pointerEvents = 'auto';\n floatingElement.style.pointerEvents = 'auto';\n}\nexport function useHoverInteractionSharedState(store) {\n const instance = useRefWithInit(HoverInteraction.create).current;\n const data = store.context.dataRef.current;\n if (!data.hoverInteractionState) {\n data.hoverInteractionState = instance;\n }\n useOnMount(data.hoverInteractionState.disposeEffect);\n return data.hoverInteractionState;\n}","'use client';\n\nimport * as React from 'react';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { contains, getTarget, isTargetInsideEnabledTrigger } from \"../utils/element.js\";\nimport { getNodeChildren } from \"../utils/nodes.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.js\";\nimport { applySafePolygonPointerEventsMutation, clearSafePolygonPointerEventsMutation, isInteractiveElement, useHoverInteractionSharedState } from \"./useHoverInteractionSharedState.js\";\nimport { getDelay, isClickLikeOpenEvent as isClickLikeOpenEventShared } from \"./useHoverShared.js\";\n/**\n * Provides hover interactions that should be attached to the floating element.\n */\nexport function useHoverFloatingInteraction(context, parameters = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const {\n dataRef\n } = store.context;\n const {\n enabled = true,\n closeDelay: closeDelayProp = 0,\n nodeId: nodeIdProp\n } = parameters;\n const instance = useHoverInteractionSharedState(store);\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const isClickLikeOpenEvent = useStableCallback(() => {\n return isClickLikeOpenEventShared(dataRef.current.openEvent?.type, instance.interactedInside);\n });\n const isHoverOpen = useStableCallback(() => {\n const type = dataRef.current.openEvent?.type;\n return type?.includes('mouse') && type !== 'mousedown';\n });\n const isRelatedTargetInsideEnabledTrigger = useStableCallback(target => {\n return isTargetInsideEnabledTrigger(target, store.context.triggerElements);\n });\n const closeWithDelay = React.useCallback(event => {\n const closeDelay = getDelay(closeDelayProp, 'close', instance.pointerType);\n const close = () => {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n };\n if (closeDelay) {\n instance.openChangeTimeout.start(closeDelay, close);\n } else {\n instance.openChangeTimeout.clear();\n close();\n }\n }, [closeDelayProp, store, instance, tree]);\n const clearPointerEvents = useStableCallback(() => {\n clearSafePolygonPointerEventsMutation(instance);\n });\n const handleInteractInside = useStableCallback(event => {\n const target = getTarget(event);\n if (!isInteractiveElement(target)) {\n instance.interactedInside = false;\n return;\n }\n instance.interactedInside = target?.closest('[aria-haspopup]') != null;\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n instance.pointerType = undefined;\n instance.restTimeoutPending = false;\n instance.interactedInside = false;\n clearPointerEvents();\n }\n }, [open, instance, clearPointerEvents]);\n React.useEffect(() => {\n return clearPointerEvents;\n }, [clearPointerEvents]);\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return undefined;\n }\n if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {\n const ref = domReferenceElement;\n const floatingEl = floatingElement;\n const doc = ownerDocument(floatingElement);\n const parentFloating = tree?.nodesRef.current.find(node => node.id === parentId)?.context?.elements.floating;\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n const scopeElement = instance.handleCloseOptions?.getScope?.() ?? instance.pointerEventsScopeElement ?? parentFloating ?? ref.closest('[data-rootownerid]') ?? doc.body;\n applySafePolygonPointerEventsMutation(instance, {\n scopeElement,\n referenceElement: ref,\n floatingElement: floatingEl\n });\n return () => {\n clearPointerEvents();\n };\n }\n return undefined;\n }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);\n const childClosedTimeout = useTimeout();\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onFloatingMouseEnter() {\n instance.openChangeTimeout.clear();\n childClosedTimeout.clear();\n tree?.events.off('floating.closed', onNodeClosed);\n clearPointerEvents();\n }\n function onFloatingMouseLeave(event) {\n if (tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0) {\n tree.events.on('floating.closed', onNodeClosed);\n return;\n }\n if (isRelatedTargetInsideEnabledTrigger(event.relatedTarget)) {\n // If the mouse is leaving the reference element to another trigger, don't explicitly close the popup\n // as it will be moved.\n return;\n }\n const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;\n const relatedTarget = event.relatedTarget;\n const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some(node => contains(node.context?.elements.floating, relatedTarget));\n if (isMovingIntoDescendantFloating) {\n return;\n }\n\n // If the safePolygon handler is active, let it handle the close logic.\n if (instance.handler) {\n instance.handler(event);\n return;\n }\n clearPointerEvents();\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event);\n }\n }\n function onNodeClosed(event) {\n if (!tree || !parentId || getNodeChildren(tree.nodesRef.current, parentId).length > 0) {\n return;\n }\n // Allow the mouseenter event to fire in case child was closed because mouse moved into parent.\n childClosedTimeout.start(0, () => {\n tree.events.off('floating.closed', onNodeClosed);\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree.events.emit('floating.closed', event);\n });\n }\n const floating = floatingElement;\n return mergeCleanups(floating && addEventListener(floating, 'mouseenter', onFloatingMouseEnter), floating && addEventListener(floating, 'mouseleave', onFloatingMouseLeave), floating && addEventListener(floating, 'pointerdown', handleInteractInside, true), () => {\n tree?.events.off('floating.closed', onNodeClosed);\n });\n }, [enabled, floatingElement, store, dataRef, nodeIdProp, isClickLikeOpenEvent, isRelatedTargetInsideEnabledTrigger, closeWithDelay, clearPointerEvents, handleInteractInside, instance, tree, parentId, childClosedTimeout]);\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { contains, getTarget, isTargetInsideEnabledTrigger } from \"../utils/element.js\";\nimport { isMouseLikePointerType } from \"../utils/event.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useFloatingTree } from \"../components/FloatingTree.js\";\nimport { applySafePolygonPointerEventsMutation, clearSafePolygonPointerEventsMutation, useHoverInteractionSharedState } from \"./useHoverInteractionSharedState.js\";\nimport { getDelay, getRestMs, isClickLikeOpenEvent as isClickLikeOpenEventShared } from \"./useHoverShared.js\";\nconst EMPTY_REF = {\n current: null\n};\n\n/**\n * Provides hover interactions that should be attached to reference or trigger\n * elements.\n */\nexport function useHoverReferenceInteraction(context, props = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const {\n dataRef,\n events\n } = store.context;\n const {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true,\n triggerElementRef = EMPTY_REF,\n externalTree,\n isActiveTrigger = true,\n getHandleCloseContext,\n isClosing\n } = props;\n const tree = useFloatingTree(externalTree);\n const instance = useHoverInteractionSharedState(store);\n const isHoverCloseActiveRef = React.useRef(false);\n const handleCloseRef = useValueAsRef(handleClose);\n const delayRef = useValueAsRef(delay);\n const restMsRef = useValueAsRef(restMs);\n const enabledRef = useValueAsRef(enabled);\n const isClosingRef = useValueAsRef(isClosing);\n if (isActiveTrigger) {\n // eslint-disable-next-line no-underscore-dangle\n instance.handleCloseOptions = handleCloseRef.current?.__options;\n }\n const isClickLikeOpenEvent = useStableCallback(() => {\n return isClickLikeOpenEventShared(dataRef.current.openEvent?.type, instance.interactedInside);\n });\n const isRelatedTargetInsideEnabledTrigger = useStableCallback(target => {\n return isTargetInsideEnabledTrigger(target, store.context.triggerElements);\n });\n const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {\n const allTriggers = store.context.triggerElements;\n\n // Fast path for normal usage where handlers are attached directly to triggers.\n if (allTriggers.hasElement(currentTarget)) {\n return !currentDomReference || !contains(currentDomReference, currentTarget);\n }\n\n // Fallback for delegated/wrapper usage where currentTarget may be outside the trigger map.\n if (!isElement(target)) {\n return false;\n }\n const targetElement = target;\n return allTriggers.hasMatchingElement(trigger => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));\n });\n const closeWithDelay = useStableCallback((event, runElseBranch = true) => {\n const closeDelay = getDelay(delayRef.current, 'close', instance.pointerType);\n if (closeDelay) {\n instance.openChangeTimeout.start(closeDelay, () => {\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n });\n } else if (runElseBranch) {\n instance.openChangeTimeout.clear();\n store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event));\n tree?.events.emit('floating.closed', event);\n }\n });\n const cleanupMouseMoveHandler = useStableCallback(() => {\n if (!instance.handler) {\n return;\n }\n const doc = ownerDocument(store.select('domReferenceElement'));\n doc.removeEventListener('mousemove', instance.handler);\n instance.handler = undefined;\n });\n const clearPointerEvents = useStableCallback(() => {\n clearSafePolygonPointerEventsMutation(instance);\n });\n React.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);\n\n // When closing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n function onOpenChangeLocal(details) {\n if (!details.open) {\n isHoverCloseActiveRef.current = details.reason === REASONS.triggerHover;\n cleanupMouseMoveHandler();\n instance.openChangeTimeout.clear();\n instance.restTimeout.clear();\n instance.blockMouseMove = true;\n instance.restTimeoutPending = false;\n } else {\n isHoverCloseActiveRef.current = false;\n }\n }\n events.on('openchange', onOpenChangeLocal);\n return () => {\n events.off('openchange', onOpenChangeLocal);\n };\n }, [enabled, events, instance, cleanupMouseMoveHandler]);\n React.useEffect(() => {\n if (!enabled) {\n return undefined;\n }\n const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select('domReferenceElement') : null);\n if (!isElement(trigger)) {\n return undefined;\n }\n function onMouseEnter(event) {\n instance.openChangeTimeout.clear();\n instance.blockMouseMove = false;\n if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {\n return;\n }\n\n // Only rest delay is set; there's no fallback delay.\n // This will be handled by `onMouseMove`.\n const restMsValue = getRestMs(restMsRef.current);\n const openDelay = getDelay(delayRef.current, 'open', instance.pointerType);\n const eventTarget = getTarget(event);\n const currentTarget = event.currentTarget ?? null;\n const currentDomReference = store.select('domReferenceElement');\n let triggerNode = currentTarget;\n\n // Wrapper/delegated mode: resolve the actual trigger from the event target.\n if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) {\n for (const triggerElement of store.context.triggerElements.elements()) {\n if (contains(triggerElement, eventTarget)) {\n triggerNode = triggerElement;\n break;\n }\n }\n }\n\n // Wrapper/delegated mode fallback: if the wrapper contains the active trigger,\n // treat this as re-entering that active trigger.\n if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {\n triggerNode = currentDomReference;\n }\n const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);\n const isOpen = store.select('open');\n const isInClosingTransition = isClosingRef.current?.() ?? store.select('transitionStatus') === 'ending';\n const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;\n const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;\n const isRestOnlyDelay = restMsValue > 0 && !openDelay;\n const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;\n const shouldOpen = !isOpen || isOverInactive;\n\n // Open immediately when moving between triggers while open, or during\n // a hover-driven close transition (including same-trigger re-entry).\n if (shouldOpenImmediately) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n return;\n }\n if (isRestOnlyDelay) {\n return;\n }\n if (openDelay) {\n instance.openChangeTimeout.start(openDelay, () => {\n if (shouldOpen) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n });\n } else if (shouldOpen) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, event, triggerNode));\n }\n }\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n clearPointerEvents();\n return;\n }\n cleanupMouseMoveHandler();\n const domReferenceElement = store.select('domReferenceElement');\n const doc = ownerDocument(domReferenceElement);\n instance.restTimeout.clear();\n instance.restTimeoutPending = false;\n const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();\n const ignoreRelatedTargetTrigger = isRelatedTargetInsideEnabledTrigger(event.relatedTarget);\n if (ignoreRelatedTargetTrigger) {\n return;\n }\n if (handleCloseRef.current && handleCloseContextBase) {\n if (!store.select('open')) {\n instance.openChangeTimeout.clear();\n }\n const currentTrigger = triggerElementRef.current;\n instance.handler = handleCloseRef.current({\n ...handleCloseContextBase,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (enabledRef.current && !isClickLikeOpenEvent() && currentTrigger === store.select('domReferenceElement')) {\n closeWithDelay(event, true);\n }\n }\n });\n doc.addEventListener('mousemove', instance.handler);\n instance.handler(event);\n return;\n }\n const shouldClose = instance.pointerType === 'touch' ? !contains(store.select('floatingElement'), event.relatedTarget) : true;\n if (shouldClose) {\n closeWithDelay(event);\n }\n }\n if (move) {\n return mergeCleanups(addEventListener(trigger, 'mousemove', onMouseEnter, {\n once: true\n }), addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave));\n }\n return mergeCleanups(addEventListener(trigger, 'mouseenter', onMouseEnter), addEventListener(trigger, 'mouseleave', onMouseLeave));\n }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, closeWithDelay, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent, isRelatedTargetInsideEnabledTrigger, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef]);\n return React.useMemo(() => {\n if (!enabled) {\n return undefined;\n }\n function setPointerRef(event) {\n instance.pointerType = event.pointerType;\n }\n return {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove(event) {\n const {\n nativeEvent\n } = event;\n const trigger = event.currentTarget;\n const currentDomReference = store.select('domReferenceElement');\n const currentOpen = store.select('open');\n const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);\n if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {\n return;\n }\n if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {\n const floatingElement = store.select('floatingElement');\n if (floatingElement) {\n const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;\n applySafePolygonPointerEventsMutation(instance, {\n scopeElement,\n referenceElement: trigger,\n floatingElement\n });\n }\n }\n const restMsValue = getRestMs(restMsRef.current);\n if (currentOpen && !isOverInactive || restMsValue === 0) {\n return;\n }\n if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {\n return;\n }\n instance.restTimeout.clear();\n function handleMouseMove() {\n instance.restTimeoutPending = false;\n\n // A delayed hover open should not override a click-like open that happened\n // while the hover delay was pending.\n if (isClickLikeOpenEvent()) {\n return;\n }\n const latestOpen = store.select('open');\n if (!instance.blockMouseMove && (!latestOpen || isOverInactive)) {\n store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, nativeEvent, trigger));\n }\n }\n if (instance.pointerType === 'touch') {\n ReactDOM.flushSync(() => {\n handleMouseMove();\n });\n } else if (isOverInactive && currentOpen) {\n handleMouseMove();\n } else {\n instance.restTimeoutPending = true;\n instance.restTimeout.start(restMsValue, handleMouseMove);\n }\n }\n };\n }, [enabled, instance, isClickLikeOpenEvent, isOverInactiveTrigger, mouseOnly, store, restMsRef]);\n}","import * as React from 'react';\nimport { ACTIVE_KEY, FOCUSABLE_ATTRIBUTE, SELECTED_KEY } from \"../utils/constants.js\";\n/**\n * Merges an array of interaction hooks' props into prop getters, allowing\n * event handler functions to be composed together without overwriting one\n * another.\n * @see https://floating-ui.com/docs/useInteractions\n */\nexport function useInteractions(propsList = []) {\n const referenceDeps = propsList.map(key => key?.reference);\n const floatingDeps = propsList.map(key => key?.floating);\n const itemDeps = propsList.map(key => key?.item);\n const triggerDeps = propsList.map(key => key?.trigger);\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n referenceDeps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n floatingDeps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n itemDeps);\n const getTriggerProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'trigger'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n triggerDeps);\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps,\n getTriggerProps\n }), [getReferenceProps, getFloatingProps, getItemProps, getTriggerProps]);\n}\n\n/* eslint-disable guard-for-in */\n\nfunction mergeProps(userProps, propsList, elementKey) {\n const eventHandlers = new Map();\n const isItem = elementKey === 'item';\n const outputProps = {};\n if (elementKey === 'floating') {\n outputProps.tabIndex = -1;\n outputProps[FOCUSABLE_ATTRIBUTE] = '';\n }\n for (const key in userProps) {\n if (isItem && userProps) {\n if (key === ACTIVE_KEY || key === SELECTED_KEY) {\n continue;\n }\n }\n outputProps[key] = userProps[key];\n }\n for (let i = 0; i < propsList.length; i += 1) {\n let props;\n const propsOrGetProps = propsList[i]?.[elementKey];\n if (typeof propsOrGetProps === 'function') {\n props = userProps ? propsOrGetProps(userProps) : null;\n } else {\n props = propsOrGetProps;\n }\n if (!props) {\n continue;\n }\n mutablyMergeProps(outputProps, props, isItem, eventHandlers);\n }\n mutablyMergeProps(outputProps, userProps, isItem, eventHandlers);\n return outputProps;\n}\nfunction mutablyMergeProps(outputProps, props, isItem, eventHandlers) {\n for (const key in props) {\n const value = props[key];\n if (isItem && (key === ACTIVE_KEY || key === SELECTED_KEY)) {\n continue;\n }\n if (!key.startsWith('on')) {\n outputProps[key] = value;\n } else {\n if (!eventHandlers.has(key)) {\n eventHandlers.set(key, []);\n }\n if (typeof value === 'function') {\n eventHandlers.get(key)?.push(value);\n outputProps[key] = (...args) => {\n return eventHandlers.get(key)?.map(fn => fn(...args)).find(val => val !== undefined);\n };\n }\n }\n }\n}","export function isMouseWithinBounds(event) {\n const targetRect = event.currentTarget.getBoundingClientRect();\n\n // Safari randomly fires `mouseleave` incorrectly when the item is\n // aligned to the trigger. This is a workaround to prevent the highlight\n // from being removed while the cursor is still within the bounds of the item.\n // https://github.com/mui/base-ui/issues/869\n const isWithinBounds = targetRect.top + 1 <= event.clientY && event.clientY <= targetRect.bottom - 1 && targetRect.left + 1 <= event.clientX && event.clientX <= targetRect.right - 1;\n return isWithinBounds;\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { isMouseWithinBounds } from '@base-ui/utils/isMouseWithinBounds';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains, getTarget, isTypeableCombobox, getFloatingFocusElement } from \"../utils/element.js\";\nimport { isVirtualClick, isVirtualPointerEvent, stopEvent } from \"../utils/event.js\";\nimport { isIndexOutOfListBounds, getMinListIndex, getMaxListIndex, getGridNavigatedIndex, isListIndexDisabled, createGridCellMap, getGridCellIndices, getGridCellIndexOfCorner, findNonDisabledListIndex } from \"../utils/composite.js\";\nimport { useFloatingParentNodeId, useFloatingTree } from \"../components/FloatingTree.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { enqueueFocus } from \"../utils/enqueueFocus.js\";\nimport { ARROW_UP, ARROW_DOWN, ARROW_RIGHT, ARROW_LEFT } from \"../utils/constants.js\";\nexport const ESCAPE = 'Escape';\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl, cols) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n if (orientation === 'both' || orientation === 'horizontal' && cols && cols > 1) {\n return key === ESCAPE;\n }\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nexport function useListNavigation(context, props) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const domReferenceElement = store.useState('domReferenceElement');\n const dataRef = store.context.dataRef;\n const {\n listRef,\n activeIndex,\n onNavigate: onNavigateProp = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loopFocus = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n parentOrientation,\n cols = 1,\n id,\n resetOnPointerLeave = true,\n externalTree\n } = props;\n if (process.env.NODE_ENV !== 'production') {\n if (allowEscape) {\n if (!loopFocus) {\n console.warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n console.warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && cols > 1) {\n console.warn('In grid list navigation mode (`cols` > 1), the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const floatingFocusElement = getFloatingFocusElement(floatingElement);\n const floatingFocusElementRef = useValueAsRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree(externalTree);\n useIsoLayoutEffect(() => {\n dataRef.current.orientation = orientation;\n }, [dataRef, orientation]);\n const typeableComboboxReference = isTypeableCombobox(domReferenceElement);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex ?? -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const onNavigate = useStableCallback(event => {\n onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);\n });\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousMountedRef = React.useRef(!!floatingElement);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocusRef = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const cancelQueuedFocusRef = React.useRef(null);\n const disabledIndicesRef = useValueAsRef(disabledIndices);\n const latestOpenRef = useValueAsRef(open);\n const selectedIndexRef = useValueAsRef(selectedIndex);\n const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);\n const focusItem = useStableCallback(() => {\n function runFocus(item) {\n if (virtual) {\n tree?.events.emit('virtualfocus', item);\n } else {\n cancelQueuedFocusRef.current = enqueueFocus(item, {\n sync: forceSyncFocusRef.current,\n preventScroll: true\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n const forceScrollIntoView = forceScrollIntoViewRef.current;\n if (initialItem) {\n runFocus(initialItem);\n }\n const scheduler = forceSyncFocusRef.current ? v => v() : requestAnimationFrame;\n scheduler(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) {\n return;\n }\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const shouldScrollIntoView =\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView?.({\n block: 'nearest',\n inline: 'nearest'\n });\n }\n });\n });\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (open && floatingElement) {\n indexRef.current = selectedIndex ?? -1;\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate();\n }\n } else if (previousMountedRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function.\n indexRef.current = -1;\n previousOnNavigateRef.current();\n }\n }, [enabled, open, floatingElement, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n useIsoLayoutEffect(() => {\n if (!enabled) {\n return;\n }\n if (!open) {\n forceSyncFocusRef.current = false;\n return;\n }\n if (!floatingElement) {\n return;\n }\n if (activeIndex == null) {\n forceSyncFocusRef.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem();\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? requestAnimationFrame : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs += 1;\n } else {\n // initially focus the first non-disabled item\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);\n keyRef.current = null;\n onNavigate();\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem();\n forceScrollIntoViewRef.current = false;\n }\n }, [enabled, open, floatingElement, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n useIsoLayoutEffect(() => {\n if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = nodes.find(node => node.id === parentId)?.context?.elements.floating;\n const activeEl = activeElement(ownerDocument(floatingElement));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floatingElement, tree, parentId, virtual]);\n useIsoLayoutEffect(() => {\n previousOnNavigateRef.current = onNavigate;\n previousOpenRef.current = open;\n previousMountedRef.current = !!floatingElement;\n });\n useIsoLayoutEffect(() => {\n if (!open) {\n keyRef.current = null;\n focusItemOnOpenRef.current = focusItemOnOpen;\n }\n }, [open, focusItemOnOpen]);\n const hasActiveIndex = activeIndex != null;\n const syncCurrentTarget = useStableCallback(event => {\n if (!latestOpenRef.current) {\n return;\n }\n const index = listRef.current.indexOf(event.currentTarget);\n if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {\n indexRef.current = index;\n onNavigate(event);\n }\n });\n const item = React.useMemo(() => {\n const itemProps = {\n onFocus(event) {\n forceSyncFocusRef.current = true;\n syncCurrentTarget(event);\n },\n onClick: ({\n currentTarget\n }) => currentTarget.focus({\n preventScroll: true\n }),\n // Safari\n onMouseMove(event) {\n forceSyncFocusRef.current = true;\n forceScrollIntoViewRef.current = false;\n if (focusItemOnHover) {\n syncCurrentTarget(event);\n }\n },\n onPointerLeave(event) {\n if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === 'touch') {\n return;\n }\n forceSyncFocusRef.current = true;\n const relatedTarget = event.relatedTarget;\n if (isMouseWithinBounds(event)) {\n return;\n }\n if (!focusItemOnHover || listRef.current.includes(relatedTarget)) {\n return;\n }\n if (!resetOnPointerLeaveRef.current) {\n return;\n }\n cancelQueuedFocusRef.current?.();\n cancelQueuedFocusRef.current = null;\n indexRef.current = -1;\n onNavigate(event);\n if (!virtual) {\n const floatingFocusEl = floatingFocusElementRef.current;\n const activeEl = activeElement(ownerDocument(floatingFocusEl));\n if (floatingFocusEl && contains(floatingFocusEl, activeEl)) {\n floatingFocusEl.focus({\n preventScroll: true\n });\n }\n }\n }\n };\n return itemProps;\n }, [syncCurrentTarget, latestOpenRef, floatingFocusElementRef, focusItemOnHover, listRef, onNavigate, resetOnPointerLeaveRef, virtual]);\n const getParentOrientation = React.useCallback(() => {\n return parentOrientation ?? tree?.nodesRef.current.find(node => node.id === parentId)?.context?.dataRef?.current.orientation;\n }, [parentId, tree, parentOrientation]);\n const commonOnKeyDown = useStableCallback(event => {\n isPointerModalityRef.current = false;\n forceSyncFocusRef.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, cols)) {\n // If the nested list's close key is also the parent navigation key,\n // let the parent navigate. Otherwise, stop propagating the event.\n if (!isMainOrientationKey(event.key, getParentOrientation())) {\n stopEvent(event);\n }\n store.setOpen(false, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n if (virtual) {\n tree?.events.emit('virtualfocus', domReferenceElement);\n } else {\n domReferenceElement.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinListIndex(listRef, disabledIndices);\n const maxIndex = getMaxListIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(event);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(event);\n }\n }\n\n // Grid navigation.\n if (cols > 1) {\n const sizes = Array.from({\n length: listRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = createGridCellMap(sizes, cols, false);\n const minGridIndex = cellMap.findIndex(index => index != null && !isListIndexDisabled(listRef.current, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(listRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const index = cellMap[getGridNavigatedIndex(cellMap.map(itemIndex => itemIndex != null ? listRef.current[itemIndex] : null), {\n event,\n orientation,\n loopFocus,\n rtl,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getGridCellIndices([...((typeof disabledIndices !== 'function' ? disabledIndices : null) || listRef.current.map((_, listIndex) => isListIndexDisabled(listRef.current, listIndex, disabledIndices) ? listIndex : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getGridCellIndexOfCorner(indexRef.current > maxIndex ? minIndex : indexRef.current, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction\n // we're moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n // eslint-disable-next-line no-nested-ternary\n event.key === ARROW_DOWN ? 'bl' : event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT) ? 'tr' : 'tl'),\n stopEvent: true\n })];\n if (index != null) {\n indexRef.current = index;\n onNavigate(event);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(event);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loopFocus) {\n if (currentIndex >= maxIndex) {\n if (allowEscape && currentIndex !== listRef.current.length) {\n indexRef.current = -1;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = minIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else if (loopFocus) {\n if (currentIndex <= minIndex) {\n if (allowEscape && currentIndex !== -1) {\n indexRef.current = listRef.current.length;\n } else {\n // Give time for virtualizers to update the listRef.\n forceSyncFocusRef.current = false;\n indexRef.current = maxIndex;\n }\n } else {\n indexRef.current = findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n }\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n if (isIndexOutOfListBounds(listRef.current, indexRef.current)) {\n indexRef.current = -1;\n }\n onNavigate(event);\n }\n });\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': `${id}-${activeIndex}`\n };\n }, [virtual, open, hasActiveIndex, id, activeIndex]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!typeableComboboxReference ? ariaActiveDescendantProp : {}),\n onKeyDown(event) {\n // Close submenu on Shift+Tab\n if (event.key === 'Tab' && event.shiftKey && open && !virtual) {\n // If the event originated from within a nested element (e.g., a Dialog opened from\n // within the menu), don't close the menu. The nested element has its own focus\n // management and should handle the Tab key.\n const target = getTarget(event.nativeEvent);\n if (target && !contains(floatingFocusElementRef.current, target)) {\n return;\n }\n stopEvent(event);\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n if (isHTMLElement(domReferenceElement)) {\n domReferenceElement.focus();\n }\n return;\n }\n commonOnKeyDown(event);\n },\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, floatingFocusElementRef, orientation, typeableComboboxReference, store, open, virtual, domReferenceElement]);\n const trigger = React.useMemo(() => {\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = !virtual;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n onKeyDown(event) {\n // non-reactive open state (to prevent re-creation of the handler)\n const currentOpen = store.select('open');\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && currentOpen) {\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!currentOpen && !openOnArrowKeyDown && isArrowKey) {\n return undefined;\n }\n if (isNavigationKey) {\n const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());\n keyRef.current = nested && isParentMainKey ? null : event.key;\n }\n if (nested) {\n if (isParentCrossOpenKey) {\n stopEvent(event);\n if (currentOpen) {\n indexRef.current = getMinListIndex(listRef, disabledIndicesRef.current);\n onNavigate(event);\n } else {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n }\n }\n return undefined;\n }\n if (isMainKey) {\n if (selectedIndexRef.current != null) {\n indexRef.current = selectedIndexRef.current;\n }\n stopEvent(event);\n if (!currentOpen && openOnArrowKeyDown) {\n store.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent, event.currentTarget));\n } else {\n commonOnKeyDown(event);\n }\n if (currentOpen) {\n onNavigate(event);\n }\n }\n return undefined;\n },\n onFocus(event) {\n if (store.select('open') && !virtual) {\n indexRef.current = -1;\n onNavigate(event);\n }\n },\n onPointerDown: checkVirtualPointer,\n onPointerEnter: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [commonOnKeyDown, disabledIndicesRef, focusItemOnOpen, listRef, nested, onNavigate, store, openOnArrowKeyDown, orientation, getParentOrientation, rtl, selectedIndexRef, virtual]);\n const reference = React.useMemo(() => {\n return {\n ...ariaActiveDescendantProp,\n ...trigger\n };\n }, [ariaActiveDescendantProp, trigger]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item,\n trigger\n } : {}, [enabled, reference, floating, trigger, item]);\n}","import * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { getFloatingFocusElement } from \"../utils/element.js\";\nimport { useFloatingParentNodeId } from \"../components/FloatingTree.js\";\nimport { EMPTY_OBJECT } from \"../../utils/constants.js\";\nconst componentRoleToAriaRoleMap = new Map([['select', 'listbox'], ['combobox', 'listbox'], ['label', false]]);\n\n/**\n * Adds base screen reader props to the reference and floating elements for a\n * given floating element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nexport function useRole(context, props = {}) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const open = store.useState('open');\n const defaultFloatingId = store.useState('floatingId');\n const domReference = store.useState('domReferenceElement');\n const floatingElement = store.useState('floatingElement');\n const {\n role = 'dialog'\n } = props;\n const defaultReferenceId = useId();\n const referenceId = domReference?.id || defaultReferenceId;\n const floatingId = React.useMemo(() => getFloatingFocusElement(floatingElement)?.id || defaultFloatingId, [floatingElement, defaultFloatingId]);\n const ariaRole = componentRoleToAriaRoleMap.get(role) ?? role;\n const parentId = useFloatingParentNodeId();\n const isNested = parentId != null;\n const trigger = React.useMemo(() => {\n if (ariaRole === 'tooltip' || role === 'label') {\n return EMPTY_OBJECT;\n }\n return {\n 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,\n 'aria-expanded': 'false',\n ...(ariaRole === 'listbox' && {\n role: 'combobox'\n }),\n ...(ariaRole === 'menu' && isNested && {\n role: 'menuitem'\n }),\n ...(role === 'select' && {\n 'aria-autocomplete': 'none'\n }),\n ...(role === 'combobox' && {\n 'aria-autocomplete': 'list'\n })\n };\n }, [ariaRole, isNested, role]);\n const reference = React.useMemo(() => {\n if (ariaRole === 'tooltip' || role === 'label') {\n return {\n [`aria-${role === 'label' ? 'labelledby' : 'describedby'}`]: open ? floatingId : undefined\n };\n }\n const triggerProps = trigger;\n return {\n ...triggerProps,\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-controls': open ? floatingId : undefined,\n ...(ariaRole === 'menu' && {\n id: referenceId\n })\n };\n }, [ariaRole, floatingId, open, referenceId, role, trigger]);\n const floating = React.useMemo(() => {\n const floatingProps = {\n id: floatingId,\n ...(ariaRole && {\n role: ariaRole\n })\n };\n if (ariaRole === 'tooltip' || role === 'label') {\n return floatingProps;\n }\n return {\n ...floatingProps,\n ...(ariaRole === 'menu' && {\n 'aria-labelledby': referenceId\n })\n };\n }, [ariaRole, floatingId, referenceId, role]);\n const item = React.useCallback(({\n active,\n selected\n }) => {\n const commonProps = {\n role: 'option',\n ...(active && {\n id: `${floatingId}-fui-option`\n })\n };\n\n // For `menu`, we are unable to tell if the item is a `menuitemradio`\n // or `menuitemcheckbox`. For backwards-compatibility reasons, also\n // avoid defaulting to `menuitem` as it may overwrite custom role props.\n switch (role) {\n case 'select':\n case 'combobox':\n return {\n ...commonProps,\n 'aria-selected': selected\n };\n default:\n }\n return {};\n }, [floatingId, role]);\n return React.useMemo(() => ({\n reference,\n floating,\n item,\n trigger\n }), [reference, floating, trigger, item]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { contains } from \"../utils/element.js\";\nimport { stopEvent } from \"../utils/event.js\";\nimport { isElementVisible } from \"../utils/composite.js\";\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nexport function useTypeahead(context, props) {\n const store = 'rootStore' in context ? context.rootStore : context;\n const dataRef = store.context.dataRef;\n const open = store.useState('open');\n const {\n listRef,\n elementsRef,\n activeIndex,\n onMatch: onMatchProp,\n onTypingChange,\n enabled = true,\n resetMs = 750,\n selectedIndex = null\n } = props;\n const timeout = useTimeout();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef(selectedIndex ?? activeIndex ?? -1);\n const matchIndexRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!open && selectedIndex !== null) {\n return;\n }\n timeout.clear();\n matchIndexRef.current = null;\n if (stringRef.current !== '') {\n stringRef.current = '';\n }\n }, [open, selectedIndex, timeout]);\n useIsoLayoutEffect(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n }, [open, selectedIndex, activeIndex]);\n const setTypingChange = useStableCallback(value => {\n if (value) {\n if (!dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange?.(value);\n }\n } else if (dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange?.(value);\n }\n });\n const onKeyDown = useStableCallback(event => {\n function isVisible(index) {\n const element = elementsRef?.current[index];\n return !element || isElementVisible(element);\n }\n function getMatchingIndex(list, string, startIndex = 0) {\n if (list.length === 0) {\n return -1;\n }\n const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;\n const lowerString = string.toLocaleLowerCase();\n for (let offset = 0; offset < list.length; offset += 1) {\n const index = (normalizedStartIndex + offset) % list.length;\n const text = list[index];\n if (!text?.toLocaleLowerCase().startsWith(lowerString) || !isVisible(index)) {\n continue;\n }\n return index;\n }\n return -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && event.key === ' ') {\n // Space should continue the in-progress typeahead session.\n stopEvent(event);\n setTypingChange(true);\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== ' ') {\n setTypingChange(false);\n }\n }\n if (listContent == null ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n setTypingChange(true);\n }\n\n // Capture whether this is a new typing session before mutating the string.\n const isNewSession = stringRef.current === '';\n if (isNewSession) {\n prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => text ? text[0]?.toLocaleLowerCase() !== text[1]?.toLocaleLowerCase() : true);\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n timeout.start(resetMs, () => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n setTypingChange(false);\n });\n\n // Compute the starting index for this search.\n // If this is a new typing session (string is empty), base it on the current\n // selection/active item; otherwise continue from the last matched index.\n const prevIndex = isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current;\n const startIndex = (prevIndex ?? 0) + 1;\n const index = getMatchingIndex(listContent, stringRef.current, startIndex);\n if (index !== -1) {\n onMatchProp?.(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n setTypingChange(false);\n }\n });\n const onBlur = useStableCallback(event => {\n const next = event.relatedTarget;\n const currentDomReferenceElement = store.select('domReferenceElement');\n const currentFloatingElement = store.select('floatingElement');\n const withinReference = contains(currentDomReferenceElement, next);\n const withinFloating = contains(currentFloatingElement, next);\n\n // Keep the session if focus moves within the composite (reference <-> floating).\n if (withinReference || withinFloating) {\n return;\n }\n\n // End the current typing session when focus leaves the composite entirely.\n timeout.clear();\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n setTypingChange(false);\n });\n const reference = React.useMemo(() => ({\n onKeyDown,\n onBlur\n }), [onKeyDown, onBlur]);\n const floating = React.useMemo(() => {\n return {\n onKeyDown,\n onBlur\n };\n }, [onKeyDown, onBlur]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}","import { isElement } from '@floating-ui/utils/dom';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { contains, getTarget } from \"./utils/element.js\";\nimport { getNodeChildren } from \"./utils/nodes.js\";\n\n/* eslint-disable no-nested-ternary */\n\nconst CURSOR_SPEED_THRESHOLD = 0.1;\nconst CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;\nconst POLYGON_BUFFER = 0.5;\nfunction hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {\n return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;\n}\nfunction isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {\n let isInsideValue = false;\n if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {\n isInsideValue = !isInsideValue;\n }\n if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {\n isInsideValue = !isInsideValue;\n }\n return isInsideValue;\n}\nfunction isInsideRect(pointX, pointY, rect) {\n return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;\n}\nfunction isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {\n const minX = Math.min(x1, x2);\n const maxX = Math.max(x1, x2);\n const minY = Math.min(y1, y2);\n const maxY = Math.max(y1, y2);\n return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safepolygon\n */\nexport function safePolygon(options = {}) {\n const {\n blockPointerEvents = false\n } = options;\n const timeout = new Timeout();\n const fn = ({\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n }) => {\n const side = placement?.split('-')[0];\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = typeof performance !== 'undefined' ? performance.now() : 0;\n function isCursorMovingSlowly(nextX, nextY) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = nextX;\n lastY = nextY;\n lastCursorTime = currentTime;\n return false;\n }\n const deltaX = nextX - lastX;\n const deltaY = nextY - lastY;\n const distanceSquared = deltaX * deltaX + deltaY * deltaY;\n const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;\n lastX = nextX;\n lastY = nextY;\n lastCursorTime = currentTime;\n return distanceSquared < thresholdSquared;\n }\n function close() {\n timeout.clear();\n onClose();\n }\n return function onMouseMove(event) {\n timeout.clear();\n const domReference = elements.domReference;\n const floating = elements.floating;\n if (!domReference || !floating || side == null || x == null || y == null) {\n return undefined;\n }\n const {\n clientX,\n clientY\n } = event;\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(floating, target);\n const isOverReferenceEl = contains(domReference, target);\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return undefined;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n if (!isLeave) {\n hasLanded = true;\n return undefined;\n }\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {\n return undefined;\n }\n function hasOpenChildNode() {\n return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);\n }\n function closeIfNoOpenChild() {\n if (!hasOpenChildNode()) {\n close();\n }\n }\n\n // If any nested child is open, abort.\n if (hasOpenChildNode()) {\n return undefined;\n }\n const refRect = domReference.getBoundingClientRect();\n const rect = floating.getBoundingClientRect();\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n closeIfNoOpenChild();\n return undefined;\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let isInsideTroughRect = false;\n switch (side) {\n case 'top':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);\n break;\n case 'bottom':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);\n break;\n case 'left':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);\n break;\n case 'right':\n isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);\n break;\n default:\n }\n if (isInsideTroughRect) {\n return undefined;\n }\n if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {\n closeIfNoOpenChild();\n return undefined;\n }\n if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {\n closeIfNoOpenChild();\n return undefined;\n }\n let isInsidePolygon = false;\n switch (side) {\n case 'top':\n {\n const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointY = y + POLYGON_BUFFER + 1;\n const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;\n const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);\n break;\n }\n case 'bottom':\n {\n const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;\n const cursorPointY = y - POLYGON_BUFFER;\n const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;\n const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);\n break;\n }\n case 'left':\n {\n const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointX = x + POLYGON_BUFFER + 1;\n const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;\n const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);\n break;\n }\n case 'right':\n {\n const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;\n const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;\n const cursorPointX = x - POLYGON_BUFFER;\n const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;\n const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;\n isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);\n break;\n }\n default:\n }\n if (!isInsidePolygon) {\n closeIfNoOpenChild();\n } else if (!hasLanded) {\n timeout.start(40, closeIfNoOpenChild);\n }\n return undefined;\n };\n };\n\n // eslint-disable-next-line no-underscore-dangle\n fn.__options = {\n ...options,\n blockPointerEvents\n };\n return fn;\n}","'use client';\n\nimport * as React from 'react';\n/**\n * Provides a cross-browser way to determine the type of the pointer used to click.\n * Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.\n * Additionally, this implementation detects if the click was triggered by the keyboard.\n *\n * @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.\n */\nexport function useEnhancedClickHandler(handler) {\n const lastClickInteractionTypeRef = React.useRef('');\n const handlePointerDown = React.useCallback(event => {\n if (event.defaultPrevented) {\n return;\n }\n lastClickInteractionTypeRef.current = event.pointerType;\n handler(event, event.pointerType);\n }, [handler]);\n const handleClick = React.useCallback(event => {\n // event.detail has the number of clicks performed on the element. 0 means it was triggered by the keyboard.\n if (event.detail === 0) {\n handler(event, 'keyboard');\n return;\n }\n if ('pointerType' in event) {\n // Chrome and Edge correctly use PointerEvent\n handler(event, event.pointerType);\n } else {\n handler(event, lastClickInteractionTypeRef.current);\n }\n lastClickInteractionTypeRef.current = '';\n }, [handler]);\n return {\n onClick: handleClick,\n onPointerDown: handlePointerDown\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nexport function useValueChanged(value, onChange) {\n const valueRef = React.useRef(value);\n const onChangeCallback = useStableCallback(onChange);\n useIsoLayoutEffect(() => {\n if (valueRef.current === value) {\n return;\n }\n onChangeCallback(valueRef.current);\n }, [value, onChangeCallback]);\n useIsoLayoutEffect(() => {\n valueRef.current = value;\n }, [value]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';\nimport { isIOS } from '@base-ui/utils/detectBrowser';\nimport { useValueChanged } from \"./useValueChanged.js\";\n\n/**\n * Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.\n *\n * @param open The open state of the component.\n */\nexport function useOpenInteractionType(open) {\n const [openMethod, setOpenMethod] = React.useState(null);\n const handleTriggerClick = useStableCallback((_, interactionType) => {\n if (!open) {\n setOpenMethod(interactionType || (\n // On iOS Safari, the hitslop around touch targets means tapping outside an element's\n // bounds does not fire `pointerdown` but does fire `mousedown`. The `interactionType`\n // will be \"\" in that case.\n isIOS ? 'touch' : ''));\n }\n });\n useValueChanged(open, previousOpen => {\n if (previousOpen && !open) {\n setOpenMethod(null);\n }\n });\n const {\n onClick,\n onPointerDown\n } = useEnhancedClickHandler(handleTriggerClick);\n return React.useMemo(() => ({\n openMethod,\n triggerProps: {\n onClick,\n onPointerDown\n }\n }), [openMethod, onClick, onPointerDown]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useDismiss, useInteractions, useRole, useSyncedFloatingRootContext } from \"../../floating-ui-react/index.js\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.js\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions } from \"../../utils/popups/index.js\";\nexport function useDialogRoot(params) {\n const {\n store,\n parentContext,\n actionsRef,\n isDrawer\n } = params;\n const open = store.useState('open');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const modal = store.useState('modal');\n const popupElement = store.useState('popupElement');\n const {\n openMethod,\n triggerProps\n } = useOpenInteractionType(open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store);\n const createDialogEventDetails = useStableCallback(reason => {\n const details = createChangeEventDetails(reason);\n details.preventUnmountOnClose = () => {\n store.set('preventUnmountingOnClose', true);\n };\n return details;\n });\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createDialogEventDetails(REASONS.imperativeAction));\n }, [store, createDialogEventDetails]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n const floatingRootContext = useSyncedFloatingRootContext({\n popupStore: store,\n onOpenChange: store.setOpen,\n treatPopupAsFloatingElement: true\n });\n const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React.useState(0);\n const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React.useState(0);\n const isTopmost = ownNestedOpenDialogs === 0;\n const role = useRole(floatingRootContext);\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent() {\n if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {\n return 'intentional';\n }\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n return {\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n };\n },\n outsidePress(event) {\n if (!store.context.outsidePressEnabledRef.current) {\n return false;\n }\n\n // For mouse events, only accept left button (button 0)\n // For touch events, a single touch is equivalent to left button\n if ('button' in event && event.button !== 0) {\n return false;\n }\n if ('touches' in event && event.touches.length !== 1) {\n return false;\n }\n const target = getTarget(event);\n if (isTopmost && !disablePointerDismissal) {\n const eventTarget = target;\n // Only close if the click occurred on the dialog's owning backdrop.\n // This supports multiple modal dialogs that aren't nested in the React tree:\n // https://github.com/mui/base-ui/issues/1320\n if (modal) {\n return store.context.internalBackdropRef.current || store.context.backdropRef.current ? store.context.internalBackdropRef.current === eventTarget || store.context.backdropRef.current === eventTarget || contains(eventTarget, popupElement) && !eventTarget?.hasAttribute('data-base-ui-portal') : true;\n }\n return true;\n }\n return false;\n },\n escapeKey: isTopmost\n });\n useScrollLock(open && modal === true, popupElement);\n const {\n getReferenceProps,\n getFloatingProps,\n getTriggerProps\n } = useInteractions([role, dismiss]);\n\n // Listen for nested open/close events on this store to maintain the counts.\n store.useContextCallback('onNestedDialogOpen', (dialogCount, drawerCount) => {\n setOwnNestedOpenDialogs(dialogCount);\n setOwnNestedOpenDrawers(drawerCount);\n });\n store.useContextCallback('onNestedDialogClose', () => {\n setOwnNestedOpenDialogs(0);\n setOwnNestedOpenDrawers(0);\n });\n\n // Notify parent of our open/close state using parent callbacks, if any\n React.useEffect(() => {\n if (parentContext?.onNestedDialogOpen && open) {\n parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));\n }\n if (parentContext?.onNestedDialogClose && !open) {\n parentContext.onNestedDialogClose();\n }\n return () => {\n if (parentContext?.onNestedDialogClose && open) {\n parentContext.onNestedDialogClose();\n }\n };\n }, [isDrawer, open, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);\n const activeTriggerProps = React.useMemo(() => getReferenceProps(triggerProps), [getReferenceProps, triggerProps]);\n const inactiveTriggerProps = React.useMemo(() => getTriggerProps(triggerProps), [getTriggerProps, triggerProps]);\n const popupProps = React.useMemo(() => getFloatingProps(), [getFloatingProps]);\n store.useSyncedValues({\n openMethod,\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n floatingRootContext,\n nestedOpenDialogCount: ownNestedOpenDialogs,\n nestedOpenDrawerCount: ownNestedOpenDrawers\n });\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogRootContext.displayName = \"DialogRootContext\";\nexport function useDialogRootContext(optional) {\n const dialogRootContext = React.useContext(DialogRootContext);\n if (optional === false && dialogRootContext === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.' : _formatErrorMessage(27));\n }\n return dialogRootContext;\n}","import * as React from 'react';\nimport { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.js\";\nconst selectors = {\n ...popupStoreSelectors,\n modal: createSelector(state => state.modal),\n nested: createSelector(state => state.nested),\n nestedOpenDialogCount: createSelector(state => state.nestedOpenDialogCount),\n nestedOpenDrawerCount: createSelector(state => state.nestedOpenDrawerCount),\n disablePointerDismissal: createSelector(state => state.disablePointerDismissal),\n openMethod: createSelector(state => state.openMethod),\n descriptionElementId: createSelector(state => state.descriptionElementId),\n titleElementId: createSelector(state => state.titleElementId),\n viewportElement: createSelector(state => state.viewportElement),\n role: createSelector(state => state.role)\n};\nexport class DialogStore extends ReactStore {\n constructor(initialState) {\n super(createInitialState(initialState), {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n outsidePressEnabledRef: {\n current: true\n },\n triggerElements: new PopupTriggerMap(),\n onOpenChange: undefined,\n onOpenChangeComplete: undefined\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {\n // When closing the dialog, pass the old trigger to the onOpenChange event\n // so it's not reset too early (potentially causing focus issues in controlled scenarios).\n eventDetails.trigger = this.state.activeTriggerElement ?? undefined;\n }\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const updatedState = {\n open: nextOpen\n };\n\n // If a popup is closing, the `trigger` may be null.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n const newTriggerId = eventDetails.trigger?.id ?? null;\n if (newTriggerId || nextOpen) {\n updatedState.activeTriggerId = newTriggerId;\n updatedState.activeTriggerElement = eventDetails.trigger ?? null;\n }\n this.update(updatedState);\n };\n static useStore(externalStore, initialState) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const internalStore = useRefWithInit(() => {\n return new DialogStore(initialState);\n }).current;\n return externalStore ?? internalStore;\n }\n}\nfunction createInitialState(initialState = {}) {\n return {\n ...createInitialPopupStoreState(),\n modal: true,\n disablePointerDismissal: false,\n popupElement: null,\n viewportElement: null,\n descriptionElementId: undefined,\n titleElementId: undefined,\n openMethod: null,\n nested: false,\n nestedOpenDialogCount: 0,\n nestedOpenDrawerCount: 0,\n role: 'dialog',\n ...initialState\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useDialogRoot } from \"./useDialogRoot.js\";\nimport { DialogRootContext, useDialogRootContext } from \"./DialogRootContext.js\";\nimport { DialogStore } from \"../store/DialogStore.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const IsDrawerContext = /*#__PURE__*/React.createContext(false);\n\n/**\n * Groups all parts of the dialog.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nif (process.env.NODE_ENV !== \"production\") IsDrawerContext.displayName = \"IsDrawerContext\";\nexport function DialogRoot(props) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n disablePointerDismissal = false,\n modal = true,\n actionsRef,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const parentDialogRootContext = useDialogRootContext(true);\n const isDrawer = React.useContext(IsDrawerContext);\n const nested = Boolean(parentDialogRootContext);\n const store = DialogStore.useStore(handle?.store, {\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n modal,\n disablePointerDismissal,\n nested\n });\n\n // Support initially open state when uncontrolled\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen === true) {\n store.update({\n open: true,\n activeTriggerId: defaultTriggerIdProp\n });\n }\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useSyncedValues({\n disablePointerDismissal,\n nested,\n modal\n });\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const payload = store.useState('payload');\n useDialogRoot({\n store,\n actionsRef,\n parentContext: parentDialogRootContext?.store.context,\n isDrawer,\n onOpenChange,\n triggerIdProp\n });\n const contextValue = React.useMemo(() => ({\n store\n }), [store]);\n return /*#__PURE__*/_jsx(IsDrawerContext.Provider, {\n value: false,\n children: /*#__PURE__*/_jsx(DialogRootContext.Provider, {\n value: contextValue,\n children: typeof children === 'function' ? children({\n payload\n }) : children\n })\n });\n}","import { TransitionStatusDataAttributes } from \"./stateAttributesMapping.js\";\nexport let CommonPopupDataAttributes = function (CommonPopupDataAttributes) {\n /**\n * Present when the popup is open.\n */\n CommonPopupDataAttributes[\"open\"] = \"data-open\";\n /**\n * Present when the popup is closed.\n */\n CommonPopupDataAttributes[\"closed\"] = \"data-closed\";\n /**\n * Present when the popup is animating in.\n */\n CommonPopupDataAttributes[CommonPopupDataAttributes[\"startingStyle\"] = TransitionStatusDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the popup is animating out.\n */\n CommonPopupDataAttributes[CommonPopupDataAttributes[\"endingStyle\"] = TransitionStatusDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the anchor is hidden.\n */\n CommonPopupDataAttributes[\"anchorHidden\"] = \"data-anchor-hidden\";\n /**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type { 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\n CommonPopupDataAttributes[\"side\"] = \"data-side\";\n /**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\n CommonPopupDataAttributes[\"align\"] = \"data-align\";\n return CommonPopupDataAttributes;\n}({});\nexport let CommonTriggerDataAttributes = /*#__PURE__*/function (CommonTriggerDataAttributes) {\n /**\n * Present when the popup is open.\n */\n CommonTriggerDataAttributes[\"popupOpen\"] = \"data-popup-open\";\n /**\n * Present when a pressable trigger is pressed.\n */\n CommonTriggerDataAttributes[\"pressed\"] = \"data-pressed\";\n return CommonTriggerDataAttributes;\n}({});\nconst TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: ''\n};\nconst PRESSABLE_TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: '',\n [CommonTriggerDataAttributes.pressed]: ''\n};\nconst POPUP_OPEN_HOOK = {\n [CommonPopupDataAttributes.open]: ''\n};\nconst POPUP_CLOSED_HOOK = {\n [CommonPopupDataAttributes.closed]: ''\n};\nconst ANCHOR_HIDDEN_HOOK = {\n [CommonPopupDataAttributes.anchorHidden]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const pressableTriggerOpenStateMapping = {\n open(value) {\n if (value) {\n return PRESSABLE_TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const popupStateMapping = {\n open(value) {\n if (value) {\n return POPUP_OPEN_HOOK;\n }\n return POPUP_CLOSED_HOOK;\n },\n anchorHidden(value) {\n if (value) {\n return ANCHOR_HIDDEN_HOOK;\n }\n return null;\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};\n\n/**\n * An overlay displayed beneath the popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n forceRender = false,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useDialogRootContext();\n const open = store.useState('open');\n const nested = store.useState('nested');\n const mounted = store.useState('mounted');\n const transitionStatus = store.useState('transitionStatus');\n const state = {\n open,\n transitionStatus\n };\n return useRenderElement('div', componentProps, {\n state,\n ref: [store.context.backdropRef, forwardedRef],\n stateAttributesMapping,\n props: [{\n role: 'presentation',\n hidden: !mounted,\n style: {\n userSelect: 'none',\n WebkitUserSelect: 'none'\n }\n }, elementProps],\n enabled: forceRender || !nested\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogBackdrop.displayName = \"DialogBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\n\n/**\n * A button that closes the dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogClose = /*#__PURE__*/React.forwardRef(function DialogClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useDialogRootContext();\n const open = store.useState('open');\n function handleClick(event) {\n if (open) {\n store.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent));\n }\n }\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [{\n onClick: handleClick\n }, elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogClose.displayName = \"DialogClose\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\n/**\n * A paragraph with additional information about the dialog.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogDescription = /*#__PURE__*/React.forwardRef(function DialogDescription(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useDialogRootContext();\n const id = useBaseUiId(idProp);\n store.useSyncedValueWithCleanup('descriptionElementId', id);\n return useRenderElement('p', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogDescription.displayName = \"DialogDescription\";","export let DialogPopupCssVars = /*#__PURE__*/function (DialogPopupCssVars) {\n /**\n * Indicates how many dialogs are nested within.\n * @type {number}\n */\n DialogPopupCssVars[\"nestedDialogs\"] = \"--nested-dialogs\";\n return DialogPopupCssVars;\n}({});","import { CommonPopupDataAttributes } from \"../../utils/popupStateMapping.js\";\nexport let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {\n /**\n * Present when the dialog is open.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"open\"] = CommonPopupDataAttributes.open] = \"open\";\n /**\n * Present when the dialog is closed.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"closed\"] = CommonPopupDataAttributes.closed] = \"closed\";\n /**\n * Present when the dialog is animating in.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"startingStyle\"] = CommonPopupDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the dialog is animating out.\n */\n DialogPopupDataAttributes[DialogPopupDataAttributes[\"endingStyle\"] = CommonPopupDataAttributes.endingStyle] = \"endingStyle\";\n /**\n * Present when the dialog is nested within another dialog.\n */\n DialogPopupDataAttributes[\"nested\"] = \"data-nested\";\n /**\n * Present when the dialog has other open dialogs nested within it.\n */\n DialogPopupDataAttributes[\"nestedDialogOpen\"] = \"data-nested-dialog-open\";\n return DialogPopupDataAttributes;\n}({});","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const DialogPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") DialogPortalContext.displayName = \"DialogPortalContext\";\nexport function useDialogPortalContext() {\n const value = React.useContext(DialogPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Portal> is missing.' : _formatErrorMessage(26));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.js\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { DialogPopupCssVars } from \"./DialogPopupCssVars.js\";\nimport { DialogPopupDataAttributes } from \"./DialogPopupDataAttributes.js\";\nimport { useDialogPortalContext } from \"../portal/DialogPortalContext.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { COMPOSITE_KEYS } from \"../../composite/composite.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping,\n nestedDialogOpen(value) {\n return value ? {\n [DialogPopupDataAttributes.nestedDialogOpen]: ''\n } : null;\n }\n};\n\n/**\n * A container for the dialog contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {\n const {\n className,\n finalFocus,\n initialFocus,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useDialogRootContext();\n const descriptionElementId = store.useState('descriptionElementId');\n const disablePointerDismissal = store.useState('disablePointerDismissal');\n const floatingRootContext = store.useState('floatingRootContext');\n const rootPopupProps = store.useState('popupProps');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const nested = store.useState('nested');\n const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const titleElementId = store.useState('titleElementId');\n const transitionStatus = store.useState('transitionStatus');\n const role = store.useState('role');\n useDialogPortalContext();\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n function defaultInitialFocus(interactionType) {\n if (interactionType === 'touch') {\n return store.context.popupRef.current;\n }\n return true;\n }\n const resolvedInitialFocus = initialFocus === undefined ? defaultInitialFocus : initialFocus;\n const nestedDialogOpen = nestedOpenDialogCount > 0;\n const state = {\n open,\n nested,\n transitionStatus,\n nestedDialogOpen\n };\n const element = useRenderElement('div', componentProps, {\n state,\n props: [rootPopupProps, {\n 'aria-labelledby': titleElementId ?? undefined,\n 'aria-describedby': descriptionElementId ?? undefined,\n role,\n tabIndex: -1,\n hidden: !mounted,\n onKeyDown(event) {\n if (COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n style: {\n [DialogPopupCssVars.nestedDialogs]: nestedOpenDialogCount\n }\n }, elementProps],\n ref: [forwardedRef, store.context.popupRef, store.useStateSetter('popupElement')],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n openInteractionType: openMethod,\n disabled: !mounted,\n closeOnFocusOut: !disablePointerDismissal,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n modal: modal !== false,\n restoreFocus: \"popup\",\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPopup.displayName = \"DialogPopup\";","import { isReactVersionAtLeast } from \"./reactVersion.js\";\nexport function inertValue(value) {\n if (isReactVersionAtLeast(19)) {\n return value;\n }\n // compatibility with React < 19\n return value ? 'true' : undefined;\n}","import * as React from 'react';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const InternalBackdrop = /*#__PURE__*/React.forwardRef(function InternalBackdrop(props, ref) {\n const {\n cutout,\n ...otherProps\n } = props;\n let clipPath;\n if (cutout) {\n const rect = cutout.getBoundingClientRect();\n clipPath = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${rect.left}px ${rect.top}px,${rect.left}px ${rect.bottom}px,${rect.right}px ${rect.bottom}px,${rect.right}px ${rect.top}px,${rect.left}px ${rect.top}px)`;\n }\n return /*#__PURE__*/_jsx(\"div\", {\n ref: ref,\n role: \"presentation\"\n // Ensures Floating UI's outside press detection runs, as it considers\n // it an element that existed when the popup rendered.\n ,\n \"data-base-ui-inert\": \"\",\n ...otherProps,\n style: {\n position: 'fixed',\n inset: 0,\n userSelect: 'none',\n WebkitUserSelect: 'none',\n clipPath\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") InternalBackdrop.displayName = \"InternalBackdrop\";","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { FloatingPortal } from \"../../floating-ui-react/index.js\";\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { DialogPortalContext } from \"./DialogPortalContext.js\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const DialogPortal = /*#__PURE__*/React.forwardRef(function DialogPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const {\n store\n } = useDialogRootContext();\n const mounted = store.useState('mounted');\n const modal = store.useState('modal');\n const open = store.useState('open');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(DialogPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsxs(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps,\n children: [mounted && modal === true && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: store.context.internalBackdropRef,\n inert: inertValue(!open)\n }), props.children]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogPortal.displayName = \"DialogPortal\";","'use client';\n\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\n/**\n * A heading that labels the dialog.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useDialogRootContext();\n const id = useBaseUiId(idProp);\n store.useSyncedValueWithCleanup('titleElementId', id);\n return useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogTitle.displayName = \"DialogTitle\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useDialogRootContext } from \"../root/DialogRootContext.js\";\nimport { useButton } from \"../../use-button/useButton.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../utils/constants.js\";\nimport { useTriggerDataForwarding } from \"../../utils/popups/index.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useClick, useInteractions } from \"../../floating-ui-react/index.js\";\n\n/**\n * A button that opens the dialog.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)\n */\nexport const DialogTrigger = /*#__PURE__*/React.forwardRef(function DialogTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n nativeButton = true,\n id: idProp,\n payload,\n handle,\n style,\n ...elementProps\n } = componentProps;\n const dialogRootContext = useDialogRootContext(true);\n const store = handle?.store ?? dialogRootContext?.store;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.' : _formatErrorMessage(79));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const floatingContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const click = useClick(floatingContext, {\n enabled: floatingContext != null\n });\n const localInteractionProps = useInteractions([click]);\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n return useRenderElement('button', componentProps, {\n state,\n ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],\n props: [localInteractionProps.getReferenceProps(), rootTriggerProps, {\n [CLICK_TRIGGER_IDENTIFIER]: '',\n id: thisTriggerId\n }, elementProps, getButtonProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n});\nif (process.env.NODE_ENV !== \"production\") DialogTrigger.displayName = \"DialogTrigger\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxRootContext.displayName = \"ComboboxRootContext\";\nexport const ComboboxFloatingContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxFloatingContext.displayName = \"ComboboxFloatingContext\";\nexport const ComboboxDerivedItemsContext = /*#__PURE__*/React.createContext(undefined);\n// `inputValue` can't be placed in the store.\n// https://github.com/mui/base-ui/issues/2703\nif (process.env.NODE_ENV !== \"production\") ComboboxDerivedItemsContext.displayName = \"ComboboxDerivedItemsContext\";\nexport const ComboboxInputValueContext = /*#__PURE__*/React.createContext('');\nif (process.env.NODE_ENV !== \"production\") ComboboxInputValueContext.displayName = \"ComboboxInputValueContext\";\nexport function useComboboxRootContext() {\n const context = React.useContext(ComboboxRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(22));\n }\n return context;\n}\nexport function useComboboxFloatingContext() {\n const context = React.useContext(ComboboxFloatingContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(23));\n }\n return context;\n}\nexport function useComboboxDerivedItemsContext() {\n const context = React.useContext(ComboboxDerivedItemsContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.' : _formatErrorMessage(24));\n }\n return context;\n}\nexport function useComboboxInputValueContext() {\n return React.useContext(ComboboxInputValueContext);\n}","export const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);\nexport function compareItemEquality(itemValue, selectedValue, comparer) {\n if (itemValue == null || selectedValue == null) {\n return Object.is(itemValue, selectedValue);\n }\n return comparer(itemValue, selectedValue);\n}\nexport function selectedValueIncludes(selectedValues, itemValue, comparer) {\n if (!selectedValues || selectedValues.length === 0) {\n return false;\n }\n return selectedValues.some(selectedValue => {\n if (selectedValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function findItemIndex(itemValues, selectedValue, comparer) {\n if (!itemValues || itemValues.length === 0) {\n return -1;\n }\n return itemValues.findIndex(itemValue => {\n if (itemValue === undefined) {\n return false;\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n });\n}\nexport function removeItem(selectedValues, itemValue, comparer) {\n return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));\n}","export function serializeValue(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { serializeValue } from \"./serializeValue.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function isGroupedItems(items) {\n return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];\n}\n\n/**\n * Checks if the items array contains an item with a null value that has a non-null label.\n */\nexport function hasNullItemLabel(items) {\n if (!Array.isArray(items)) {\n return items != null && 'null' in items;\n }\n const arrayItems = items;\n if (isGroupedItems(arrayItems)) {\n for (const group of arrayItems) {\n for (const item of group.items) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n }\n return false;\n }\n for (const item of arrayItems) {\n if (item && item.value == null && item.label != null) {\n return true;\n }\n }\n return false;\n}\nexport function stringifyAsLabel(item, itemToStringLabel) {\n if (itemToStringLabel && item != null) {\n return itemToStringLabel(item) ?? '';\n }\n if (item && typeof item === 'object') {\n if ('label' in item && item.label != null) {\n return String(item.label);\n }\n if ('value' in item) {\n return String(item.value);\n }\n }\n return serializeValue(item);\n}\nexport function stringifyAsValue(item, itemToStringValue) {\n if (itemToStringValue && item != null) {\n return itemToStringValue(item) ?? '';\n }\n if (item && typeof item === 'object' && 'value' in item && 'label' in item) {\n return serializeValue(item.value);\n }\n return serializeValue(item);\n}\nexport function resolveSelectedLabel(value, items, itemToStringLabel) {\n function fallback() {\n return stringifyAsLabel(value, itemToStringLabel);\n }\n if (itemToStringLabel && value != null) {\n return itemToStringLabel(value);\n }\n\n // Custom object with explicit label takes precedence\n if (value && typeof value === 'object' && 'label' in value && value.label != null) {\n return value.label;\n }\n\n // Items provided as plain record map\n if (items && !Array.isArray(items)) {\n return items[value] ?? fallback();\n }\n\n // Items provided as array (flat or grouped)\n if (Array.isArray(items)) {\n const arrayItems = items;\n const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;\n if (value == null || typeof value !== 'object') {\n const match = flatItems.find(item => item.value === value);\n if (match && match.label != null) {\n return match.label;\n }\n return fallback();\n }\n\n // Object without explicit label: try matching by its `value` property\n if ('value' in value) {\n const match = flatItems.find(item => item && item.value === value.value);\n if (match && match.label != null) {\n return match.label;\n }\n }\n }\n return fallback();\n}\nexport function resolveMultipleLabels(values, items, itemToStringLabel) {\n return values.reduce((acc, value, index) => {\n if (index > 0) {\n acc.push(', ');\n }\n acc.push(/*#__PURE__*/_jsx(React.Fragment, {\n children: resolveSelectedLabel(value, items, itemToStringLabel)\n }, index));\n return acc;\n }, []);\n}","import { createSelector } from '@base-ui/utils/store';\nimport { compareItemEquality } from \"../utils/itemEquality.js\";\nimport { hasNullItemLabel } from \"../utils/resolveValueLabel.js\";\nexport const selectors = {\n id: createSelector(state => state.id),\n labelId: createSelector(state => state.labelId),\n items: createSelector(state => state.items),\n selectedValue: createSelector(state => state.selectedValue),\n hasSelectionChips: createSelector(state => {\n const selectedValue = state.selectedValue;\n return Array.isArray(selectedValue) && selectedValue.length > 0;\n }),\n hasSelectedValue: createSelector(state => {\n const {\n selectedValue,\n selectionMode\n } = state;\n if (selectedValue == null) {\n return false;\n }\n if (selectionMode === 'multiple' && Array.isArray(selectedValue)) {\n return selectedValue.length > 0;\n }\n return true;\n }),\n hasNullItemLabel: createSelector((state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n }),\n open: createSelector(state => state.open),\n mounted: createSelector(state => state.mounted),\n forceMounted: createSelector(state => state.forceMounted),\n inline: createSelector(state => state.inline),\n activeIndex: createSelector(state => state.activeIndex),\n selectedIndex: createSelector(state => state.selectedIndex),\n isActive: createSelector((state, index) => state.activeIndex === index),\n isSelected: createSelector((state, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const selectedValue = state.selectedValue;\n if (Array.isArray(selectedValue)) {\n return selectedValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n return compareItemEquality(itemValue, selectedValue, comparer);\n }),\n transitionStatus: createSelector(state => state.transitionStatus),\n popupProps: createSelector(state => state.popupProps),\n inputProps: createSelector(state => state.inputProps),\n triggerProps: createSelector(state => state.triggerProps),\n getItemProps: createSelector(state => state.getItemProps),\n positionerElement: createSelector(state => state.positionerElement),\n listElement: createSelector(state => state.listElement),\n triggerElement: createSelector(state => state.triggerElement),\n inputElement: createSelector(state => state.inputElement),\n inputGroupElement: createSelector(state => state.inputGroupElement),\n popupSide: createSelector(state => state.popupSide),\n openMethod: createSelector(state => state.openMethod),\n inputInsidePopup: createSelector(state => state.inputInsidePopup),\n selectionMode: createSelector(state => state.selectionMode),\n name: createSelector(state => state.name),\n form: createSelector(state => state.form),\n disabled: createSelector(state => state.disabled),\n readOnly: createSelector(state => state.readOnly),\n required: createSelector(state => state.required),\n grid: createSelector(state => state.grid),\n virtualized: createSelector(state => state.virtualized),\n itemToStringLabel: createSelector(state => state.itemToStringLabel),\n isItemEqualToValue: createSelector(state => state.isItemEqualToValue),\n modal: createSelector(state => state.modal),\n autoHighlight: createSelector(state => state.autoHighlight),\n submitOnItemClick: createSelector(state => state.submitOnItemClick)\n};","export let FieldControlDataAttributes = /*#__PURE__*/function (FieldControlDataAttributes) {\n /**\n * Present when the field is disabled.\n */\n FieldControlDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the field is in valid state.\n */\n FieldControlDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the field is in invalid state.\n */\n FieldControlDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the field has been touched.\n */\n FieldControlDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the field's value has changed.\n */\n FieldControlDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the field is filled.\n */\n FieldControlDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the field control is focused.\n */\n FieldControlDataAttributes[\"focused\"] = \"data-focused\";\n return FieldControlDataAttributes;\n}({});","import { FieldControlDataAttributes } from \"../control/FieldControlDataAttributes.js\";\nexport const DEFAULT_VALIDITY_STATE = {\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: null,\n valueMissing: false\n};\nexport const DEFAULT_FIELD_STATE_ATTRIBUTES = {\n valid: null,\n touched: false,\n dirty: false,\n filled: false,\n focused: false\n};\nexport const DEFAULT_FIELD_ROOT_STATE = {\n disabled: false,\n ...DEFAULT_FIELD_STATE_ATTRIBUTES\n};\nexport const fieldValidityMapping = {\n valid(value) {\n if (value === null) {\n return null;\n }\n if (value) {\n return {\n [FieldControlDataAttributes.valid]: ''\n };\n }\n return {\n [FieldControlDataAttributes.invalid]: ''\n };\n }\n};","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { NOOP } from \"../../utils/noop.js\";\nimport { DEFAULT_FIELD_ROOT_STATE, DEFAULT_FIELD_STATE_ATTRIBUTES, DEFAULT_VALIDITY_STATE } from \"../utils/constants.js\";\nimport { EMPTY_OBJECT } from \"../../utils/constants.js\";\nexport const FieldRootContext = /*#__PURE__*/React.createContext({\n invalid: undefined,\n name: undefined,\n validityData: {\n state: DEFAULT_VALIDITY_STATE,\n errors: [],\n error: '',\n value: '',\n initialValue: null\n },\n setValidityData: NOOP,\n disabled: undefined,\n touched: DEFAULT_FIELD_STATE_ATTRIBUTES.touched,\n setTouched: NOOP,\n dirty: DEFAULT_FIELD_STATE_ATTRIBUTES.dirty,\n setDirty: NOOP,\n filled: DEFAULT_FIELD_STATE_ATTRIBUTES.filled,\n setFilled: NOOP,\n focused: DEFAULT_FIELD_STATE_ATTRIBUTES.focused,\n setFocused: NOOP,\n validate: () => null,\n validationMode: 'onSubmit',\n validationDebounceTime: 0,\n shouldValidateOnChange: () => false,\n state: DEFAULT_FIELD_ROOT_STATE,\n markedDirtyRef: {\n current: false\n },\n registerFieldControl: NOOP,\n validation: {\n getValidationProps: (props = EMPTY_OBJECT) => props,\n getInputValidationProps: (props = EMPTY_OBJECT) => props,\n inputRef: {\n current: null\n },\n commit: async () => {}\n }\n});\nif (process.env.NODE_ENV !== \"production\") FieldRootContext.displayName = \"FieldRootContext\";\nexport function useFieldRootContext(optional = true) {\n const context = React.useContext(FieldRootContext);\n if (context.setValidityData === NOOP && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.' : _formatErrorMessage(28));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useFieldRootContext } from \"./FieldRootContext.js\";\nexport function useRegisterFieldControl(controlRef, params) {\n const {\n enabled = true,\n getValue,\n id,\n value\n } = params;\n const {\n registerFieldControl\n } = useFieldRootContext();\n const sourceRef = React.useRef(null);\n if (!sourceRef.current) {\n sourceRef.current = Symbol();\n }\n useIsoLayoutEffect(() => {\n const source = sourceRef.current;\n if (!source || !enabled) {\n return undefined;\n }\n registerFieldControl(source, {\n controlRef,\n getValue,\n id,\n value\n });\n return () => {\n registerFieldControl(source, undefined);\n };\n }, [controlRef, enabled, getValue, id, registerFieldControl, value]);\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../utils/noop.js\";\nexport const FormContext = /*#__PURE__*/React.createContext({\n formRef: {\n current: {\n fields: new Map()\n }\n },\n errors: {},\n clearErrors: NOOP,\n validationMode: 'onSubmit',\n submitAttemptedRef: {\n current: false\n }\n});\nif (process.env.NODE_ENV !== \"production\") FormContext.displayName = \"FormContext\";\nexport function useFormContext() {\n return React.useContext(FormContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { NOOP } from \"../utils/noop.js\";\n/**\n * A context for providing [labelable elements](https://html.spec.whatwg.org/multipage/forms.html#category-label)\\\n * with an accessible name (label) and description.\n */\nexport const LabelableContext = /*#__PURE__*/React.createContext({\n controlId: undefined,\n registerControlId: NOOP,\n labelId: undefined,\n setLabelId: NOOP,\n messageIds: [],\n setMessageIds: NOOP,\n getDescriptionProps: externalProps => externalProps\n});\nif (process.env.NODE_ENV !== \"production\") LabelableContext.displayName = \"LabelableContext\";\nexport function useLabelableContext() {\n return React.useContext(LabelableContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { isElement } from '@floating-ui/utils/dom';\nimport { NOOP } from \"../utils/noop.js\";\nimport { useBaseUiId } from \"../utils/useBaseUiId.js\";\nimport { useLabelableContext } from \"./LabelableContext.js\";\nexport function useLabelableId(params = {}) {\n const {\n id,\n implicit = false,\n controlRef\n } = params;\n const {\n controlId,\n registerControlId\n } = useLabelableContext();\n const defaultId = useBaseUiId(id);\n const controlIdForEffect = implicit ? controlId : undefined;\n const controlSourceRef = useRefWithInit(() => Symbol('labelable-control'));\n const hasRegisteredRef = React.useRef(false);\n const hadExplicitIdRef = React.useRef(id != null);\n const unregisterControlId = useStableCallback(() => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSourceRef.current, undefined);\n });\n useIsoLayoutEffect(() => {\n if (registerControlId === NOOP) {\n return undefined;\n }\n let nextId;\n if (implicit) {\n const elem = controlRef?.current;\n if (isElement(elem) && elem.closest('label') != null) {\n nextId = id ?? null;\n } else {\n nextId = controlIdForEffect ?? defaultId;\n }\n } else if (id != null) {\n hadExplicitIdRef.current = true;\n nextId = id;\n } else if (hadExplicitIdRef.current) {\n nextId = defaultId;\n } else {\n unregisterControlId();\n return undefined;\n }\n if (nextId === undefined) {\n unregisterControlId();\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, nextId);\n return undefined;\n }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]);\n React.useEffect(() => {\n return unregisterControlId;\n }, [unregisterControlId]);\n return controlId ?? defaultId;\n}","import { stringifyAsLabel } from \"../../../utils/resolveValueLabel.js\";\n/**\n * Enhanced filter using Intl.Collator for more robust string matching.\n * Uses the provided `itemToStringLabel` function if available, otherwise falls back to:\n * • When `item` is an object with a `value` property, that property is used.\n * • When `item` is a primitive (e.g. `string`), it is used directly.\n */\nexport function createCollatorItemFilter(collatorFilter, itemToStringLabel) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n const itemString = stringifyAsLabel(item, itemToStringLabel);\n return collatorFilter.contains(itemString, query);\n };\n}\n\n/**\n * Enhanced filter for single selection mode using Intl.Collator that shows all items\n * when query is empty or matches the current selection, making it easier to browse options.\n */\nexport function createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue) {\n return (item, query) => {\n if (item == null) {\n return false;\n }\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToStringLabel);\n const selectedString = selectedValue != null ? stringifyAsLabel(selectedValue, itemToStringLabel) : '';\n\n // Handle case-insensitive matching consistently\n if (selectedString && collatorFilter.contains(selectedString, query) && selectedString.length === query.length) {\n return true;\n }\n return collatorFilter.contains(itemString, query);\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { createCollatorItemFilter, createSingleSelectionCollatorFilter } from \"./index.js\";\nimport { stringifyAsLabel } from \"../../../utils/resolveValueLabel.js\";\nconst filterCache = new Map();\nfunction stringifyLocale(locale) {\n if (Array.isArray(locale)) {\n return locale.map(value => stringifyLocale(value)).join(',');\n }\n if (locale == null) {\n return '';\n }\n return String(locale);\n}\nfunction getFilter(options = {}) {\n const mergedOptions = {\n usage: 'search',\n sensitivity: 'base',\n ignorePunctuation: true,\n ...options\n };\n const cacheKey = `${stringifyLocale(options.locale)}|${JSON.stringify(mergedOptions)}`;\n const cachedFilter = filterCache.get(cacheKey);\n if (cachedFilter) {\n return cachedFilter;\n }\n const collator = new Intl.Collator(options.locale, mergedOptions);\n const filter = {\n contains(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n for (let i = 0; i <= itemString.length - query.length; i += 1) {\n if (collator.compare(itemString.slice(i, i + query.length), query) === 0) {\n return true;\n }\n }\n return false;\n },\n startsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n return collator.compare(itemString.slice(0, query.length), query) === 0;\n },\n endsWith(item, query, itemToString) {\n if (!query) {\n return true;\n }\n const itemString = stringifyAsLabel(item, itemToString);\n const queryLength = query.length;\n return itemString.length >= queryLength && collator.compare(itemString.slice(itemString.length - queryLength), query) === 0;\n }\n };\n filterCache.set(cacheKey, filter);\n return filter;\n}\n\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport const useCoreFilter = getFilter;\n/**\n * Matches items against a query using `Intl.Collator` for robust string matching.\n */\nexport function useComboboxFilter(options = {}) {\n const {\n multiple = false,\n value,\n ...collatorOptions\n } = options;\n const coreFilter = getFilter(collatorOptions);\n const contains = React.useCallback((item, query, itemToString) => {\n if (multiple) {\n return createCollatorItemFilter(coreFilter, itemToString)(item, query);\n }\n return createSingleSelectionCollatorFilter(coreFilter, itemToString, value)(item, query);\n }, [coreFilter, value, multiple]);\n return React.useMemo(() => ({\n contains,\n startsWith: coreFilter.startsWith,\n endsWith: coreFilter.endsWith\n }), [contains, coreFilter]);\n}","export const NO_ACTIVE_VALUE = Symbol('none');\nexport const INITIAL_LAST_HIGHLIGHT = {\n value: NO_ACTIVE_VALUE,\n index: -1\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { Store, useStore } from '@base-ui/utils/store';\nimport { useDismiss, useFloatingRootContext, useInteractions, useListNavigation, useClick } from \"../../floating-ui-react/index.js\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.js\";\nimport { createChangeEventDetails, createGenericEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { ComboboxFloatingContext, ComboboxDerivedItemsContext, ComboboxRootContext, ComboboxInputValueContext } from \"./ComboboxRootContext.js\";\nimport { selectors } from \"../store.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../../field/root/useRegisterFieldControl.js\";\nimport { useFormContext } from \"../../form/FormContext.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { createCollatorItemFilter, createSingleSelectionCollatorFilter } from \"./utils/index.js\";\nimport { useCoreFilter } from \"./utils/useFilter.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from \"../../utils/constants.js\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.js\";\nimport { useValueChanged } from \"../../utils/useValueChanged.js\";\nimport { NOOP } from \"../../utils/noop.js\";\nimport { stringifyAsLabel, stringifyAsValue, isGroupedItems } from \"../../utils/resolveValueLabel.js\";\nimport { compareItemEquality, defaultItemEquality, findItemIndex, removeItem, selectedValueIncludes } from \"../../utils/itemEquality.js\";\nimport { INITIAL_LAST_HIGHLIGHT, NO_ACTIVE_VALUE } from \"./utils/constants.js\";\n\n/**\n * @internal\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function AriaCombobox(props) {\n const {\n id: idProp,\n onOpenChangeComplete: onOpenChangeCompleteProp,\n defaultSelectedValue = null,\n selectedValue: selectedValueProp,\n onSelectedValueChange,\n defaultInputValue: defaultInputValueProp,\n inputValue: inputValueProp,\n open: openProp,\n defaultOpen = false,\n selectionMode = 'none',\n onItemHighlighted: onItemHighlightedProp,\n name: nameProp,\n form,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n inputRef: inputRefProp,\n grid = false,\n items,\n filteredItems: filteredItemsProp,\n filter: filterProp,\n openOnInputClick = true,\n autoHighlight = false,\n keepHighlight = false,\n highlightItemOnHover = true,\n loopFocus = true,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n virtualized = false,\n inline: inlineProp = false,\n fillInputOnItemPress = true,\n modal = false,\n limit = -1,\n autoComplete = 'list',\n formAutoComplete,\n locale,\n submitOnItemClick = false\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n validityData,\n shouldValidateOnChange,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const id = useLabelableId({\n id: idProp\n });\n const collatorFilter = useCoreFilter({\n locale\n });\n const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React.useState(false);\n const [closeQuery, setCloseQuery] = React.useState(null);\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const inputRef = React.useRef(null);\n const startDismissRef = React.useRef(null);\n const endDismissRef = React.useRef(null);\n const emptyRef = React.useRef(null);\n const keyboardActiveRef = React.useRef(true);\n const hadInputClearRef = React.useRef(false);\n const chipsContainerRef = React.useRef(null);\n const clearRef = React.useRef(null);\n const selectionEventRef = React.useRef(null);\n const lastHighlightRef = React.useRef(INITIAL_LAST_HIGHLIGHT);\n const pendingQueryHighlightRef = React.useRef(null);\n\n /**\n * Contains the currently visible list of item values post-filtering.\n */\n const valuesRef = React.useRef([]);\n /**\n * Contains all item values in a stable, unfiltered order.\n * This is only used when `items` prop is not provided.\n * It accumulates values on first mount and does not remove them on unmount due to\n * filtering, providing a stable index for selected value tracking.\n */\n const allValuesRef = React.useRef([]);\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const multiple = selectionMode === 'multiple';\n const single = selectionMode === 'single';\n const hasInputValue = inputValueProp !== undefined || defaultInputValueProp !== undefined;\n const hasItems = items !== undefined;\n const hasFilteredItemsProp = filteredItemsProp !== undefined;\n let autoHighlightMode;\n if (autoHighlight === 'always') {\n autoHighlightMode = 'always';\n } else {\n autoHighlightMode = autoHighlight ? 'input-change' : false;\n }\n const [selectedValue, setSelectedValueUnwrapped] = useControlled({\n controlled: selectedValueProp,\n default: multiple ? defaultSelectedValue ?? EMPTY_ARRAY : defaultSelectedValue,\n name: 'Combobox',\n state: 'selectedValue'\n });\n const filter = React.useMemo(() => {\n if (filterProp === null) {\n return () => true;\n }\n if (filterProp !== undefined) {\n return filterProp;\n }\n if (single && !queryChangedAfterOpen) {\n return createSingleSelectionCollatorFilter(collatorFilter, itemToStringLabel, selectedValue);\n }\n return createCollatorItemFilter(collatorFilter, itemToStringLabel);\n }, [filterProp, single, selectedValue, queryChangedAfterOpen, collatorFilter, itemToStringLabel]);\n\n // If neither inputValue nor defaultInputValue are provided, derive it from the\n // selected value for single mode so the input reflects the selection on mount.\n const initialDefaultInputValue = useRefWithInit(() => {\n if (hasInputValue) {\n return defaultInputValueProp ?? '';\n }\n if (single) {\n return stringifyAsLabel(selectedValue, itemToStringLabel);\n }\n return '';\n }).current;\n const [inputValue, setInputValueUnwrapped] = useControlled({\n controlled: inputValueProp,\n default: initialDefaultInputValue,\n name: 'Combobox',\n state: 'inputValue'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Combobox',\n state: 'open'\n });\n const isGrouped = isGroupedItems(items);\n const query = closeQuery ?? (inputValue === '' ? '' : String(inputValue).trim());\n const selectedLabelString = single ? stringifyAsLabel(selectedValue, itemToStringLabel) : '';\n const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== '' && selectedLabelString !== '' && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);\n const filterQuery = shouldBypassFiltering ? '' : query;\n const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;\n const flatItems = React.useMemo(() => {\n if (!items) {\n return EMPTY_ARRAY;\n }\n if (isGrouped) {\n return items.flatMap(group => group.items);\n }\n return items;\n }, [items, isGrouped]);\n const filteredItems = React.useMemo(() => {\n if (filteredItemsProp && !shouldIgnoreExternalFiltering) {\n return filteredItemsProp;\n }\n if (!items) {\n return EMPTY_ARRAY;\n }\n if (isGrouped) {\n const groupedItems = items;\n const resultingGroups = [];\n let currentCount = 0;\n for (const group of groupedItems) {\n if (limit > -1 && currentCount >= limit) {\n break;\n }\n const candidateItems = filterQuery === '' ? group.items : group.items.filter(item => filter(item, filterQuery, itemToStringLabel));\n if (candidateItems.length === 0) {\n continue;\n }\n const remainingLimit = limit > -1 ? limit - currentCount : Infinity;\n const itemsToTake = candidateItems.slice(0, remainingLimit);\n if (itemsToTake.length > 0) {\n const newGroup = {\n ...group,\n items: itemsToTake\n };\n resultingGroups.push(newGroup);\n currentCount += itemsToTake.length;\n }\n }\n return resultingGroups;\n }\n if (filterQuery === '') {\n return limit > -1 ? flatItems.slice(0, limit) :\n // The cast here is done as `flatItems` is readonly.\n // valuesRef.current, a mutable ref, can be set to `flatFilteredItems`, which may\n // reference this exact readonly value, creating a mutation risk.\n // However, <Combobox.Item> can never mutate this value as the mutating effect\n // bails early when `items` is provided, and this is only ever returned\n // when `items` is provided due to the early return at the top of this hook.\n flatItems;\n }\n const limitedItems = [];\n for (const item of flatItems) {\n if (limit > -1 && limitedItems.length >= limit) {\n break;\n }\n if (filter(item, filterQuery, itemToStringLabel)) {\n limitedItems.push(item);\n }\n }\n return limitedItems;\n }, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, itemToStringLabel, flatItems]);\n const flatFilteredItems = React.useMemo(() => {\n if (isGrouped) {\n const groups = filteredItems;\n return groups.flatMap(g => g.items);\n }\n return filteredItems;\n }, [filteredItems, isGrouped]);\n const store = useRefWithInit(() => new Store({\n id,\n labelId: undefined,\n selectedValue,\n open,\n filter,\n query,\n items,\n selectionMode,\n listRef,\n labelsRef,\n popupRef,\n emptyRef,\n inputRef,\n startDismissRef,\n endDismissRef,\n keyboardActiveRef,\n chipsContainerRef,\n clearRef,\n valuesRef,\n allValuesRef,\n selectionEventRef,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n isGrouped,\n virtualized,\n openOnInputClick,\n itemToStringLabel,\n isItemEqualToValue,\n modal,\n autoHighlight: autoHighlightMode,\n submitOnItemClick,\n hasInputValue,\n mounted: false,\n forceMounted: false,\n transitionStatus: 'idle',\n inline: inlineProp,\n activeIndex: null,\n selectedIndex: null,\n popupProps: {},\n inputProps: {},\n triggerProps: {},\n positionerElement: null,\n listElement: null,\n triggerElement: null,\n inputElement: null,\n inputGroupElement: null,\n popupSide: null,\n openMethod: null,\n inputInsidePopup: true,\n onOpenChangeComplete: onOpenChangeCompleteProp || NOOP,\n // Placeholder callbacks replaced on first render\n setOpen: NOOP,\n setInputValue: NOOP,\n setSelectedValue: NOOP,\n setIndices: NOOP,\n onItemHighlighted: NOOP,\n handleSelection: NOOP,\n getItemProps: () => EMPTY_OBJECT,\n forceMount: NOOP,\n requestSubmit: NOOP\n })).current;\n const fieldRawValue = selectionMode === 'none' ? inputValue : selectedValue;\n const fieldStringValue = React.useMemo(() => {\n if (selectionMode === 'none') {\n return fieldRawValue;\n }\n if (Array.isArray(selectedValue)) {\n return selectedValue.map(value => stringifyAsValue(value, itemToStringValue));\n }\n return stringifyAsValue(selectedValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]);\n const onItemHighlighted = useStableCallback(onItemHighlightedProp);\n const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const inputElement = useStore(store, selectors.inputElement);\n const inputGroupElement = useStore(store, selectors.inputGroupElement);\n const inline = useStore(store, selectors.inline);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const triggerRef = useValueAsRef(triggerElement);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const {\n openMethod,\n triggerProps\n } = useOpenInteractionType(open);\n const getFieldValue = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(inputInsidePopup ? triggerRef : inputRef, {\n id,\n value: fieldRawValue,\n getValue: getFieldValue\n });\n const forceMount = useStableCallback(() => {\n if (items) {\n // Ensure typeahead works on a closed list.\n labelsRef.current = flatFilteredItems.map(item => stringifyAsLabel(item, itemToStringLabel));\n } else {\n store.set('forceMounted', true);\n }\n });\n const initialSelectedValueRef = React.useRef(selectedValue);\n useIsoLayoutEffect(() => {\n // Ensure the values and labels are registered for programmatic value changes.\n if (selectedValue !== initialSelectedValueRef.current) {\n forceMount();\n }\n }, [forceMount, selectedValue]);\n const setIndices = useStableCallback(options => {\n store.update(options);\n const type = options.type || 'none';\n if (options.activeIndex === undefined) {\n return;\n }\n if (options.activeIndex === null) {\n if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {\n lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;\n onItemHighlighted(undefined, createGenericEventDetails(type, undefined, {\n index: -1\n }));\n }\n } else {\n const activeValue = valuesRef.current[options.activeIndex];\n lastHighlightRef.current = {\n value: activeValue,\n index: options.activeIndex\n };\n onItemHighlighted(activeValue, createGenericEventDetails(type, undefined, {\n index: options.activeIndex\n }));\n }\n });\n const setInputValue = useStableCallback((next, eventDetails) => {\n hadInputClearRef.current = eventDetails.reason === REASONS.inputClear;\n props.onInputValueChange?.(next, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n\n // If user is typing, ensure we don't auto-highlight on open due to a race\n // with the post-open effect that sets this flag.\n if (eventDetails.reason === REASONS.inputChange) {\n const event = eventDetails.event;\n const inputType = event.inputType;\n // Treat composition commits as typed input; autofill may omit `inputType` or\n // report `insertReplacementText`.\n const isTypedInput = event.type === 'compositionend' || inputType != null && inputType !== '' && inputType !== 'insertReplacementText';\n if (isTypedInput) {\n const hasQuery = next.trim() !== '';\n if (hasQuery) {\n setQueryChangedAfterOpen(true);\n }\n // Defer index updates until after the filtered items have been derived to ensure\n // `onItemHighlighted` receives the latest item.\n pendingQueryHighlightRef.current = {\n hasQuery\n };\n if (hasQuery && autoHighlightMode && store.state.activeIndex == null) {\n store.set('activeIndex', 0);\n }\n }\n }\n setInputValueUnwrapped(next);\n });\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n if (open === nextOpen) {\n return;\n }\n\n // If the `Empty` component is not used, the positioner or popup should be hidden\n // with CSS. In this case, allow the Escape key to bubble to close a parent popup\n // if there are no items to show.\n if (eventDetails.reason === 'escape-key' && hasItems && flatFilteredItems.length === 0 && !store.state.emptyRef.current) {\n eventDetails.allowPropagation();\n }\n props.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n if (!nextOpen && queryChangedAfterOpen) {\n if (single) {\n if (!inline) {\n setCloseQuery(query);\n }\n // Avoid a flicker when closing the popup with an empty query.\n if (query === '') {\n setQueryChangedAfterOpen(false);\n }\n } else if (multiple) {\n if (inline || inputInsidePopup) {\n setIndices({\n activeIndex: null\n });\n } else {\n // Freeze the current query so filtering remains stable while exiting.\n setCloseQuery(query);\n }\n // Clear the input immediately on close while retaining filtering via closeQuery for exit animations\n // if the input is outside the popup.\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));\n }\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && inputInsidePopup && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n }\n });\n const setSelectedValue = useStableCallback((nextValue, eventDetails) => {\n // Cast to `any` due to conditional value type (single vs. multiple).\n // The runtime implementation already ensures the correct value shape.\n onSelectedValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setSelectedValueUnwrapped(nextValue);\n const shouldFillInput = selectionMode === 'none' && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup;\n if (shouldFillInput) {\n setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event));\n }\n if (single && nextValue != null && eventDetails.reason !== REASONS.inputChange && queryChangedAfterOpen && !inline) {\n setCloseQuery(query);\n }\n });\n const handleSelection = useStableCallback((event, passedValue) => {\n let itemValue = passedValue;\n if (itemValue === undefined) {\n if (activeIndex === null) {\n return;\n }\n itemValue = valuesRef.current[activeIndex];\n }\n const targetEl = getTarget(event);\n const overrideEvent = selectionEventRef.current ?? event;\n selectionEventRef.current = null;\n const eventDetails = createChangeEventDetails(REASONS.itemPress, overrideEvent);\n\n // Let the link handle the click.\n const href = targetEl?.closest('a')?.getAttribute('href');\n if (href) {\n if (href.startsWith('#')) {\n setOpen(false, eventDetails);\n }\n return;\n }\n if (multiple) {\n const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];\n const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, store.state.isItemEqualToValue);\n const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, store.state.isItemEqualToValue) : [...currentSelectedValue, itemValue];\n setSelectedValue(nextValue, eventDetails);\n const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== '' : false;\n if (!wasFiltering) {\n return;\n }\n if (store.state.inputInsidePopup) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));\n } else {\n setOpen(false, eventDetails);\n }\n } else {\n setSelectedValue(itemValue, eventDetails);\n setOpen(false, eventDetails);\n }\n });\n const requestSubmit = useStableCallback(() => {\n if (!store.state.submitOnItemClick) {\n return;\n }\n const formElement = validation.inputRef.current?.form ?? store.state.inputElement?.form;\n if (formElement && typeof formElement.requestSubmit === 'function') {\n formElement.requestSubmit();\n }\n });\n const handleUnmount = useStableCallback(() => {\n setMounted(false);\n onOpenChangeComplete?.(false);\n setQueryChangedAfterOpen(false);\n setCloseQuery(null);\n if (selectionMode === 'none') {\n setIndices({\n activeIndex: null,\n selectedIndex: null\n });\n } else {\n setIndices({\n activeIndex: null\n });\n }\n\n // Multiple selection mode:\n // If the user typed a filter and didn't select in multiple mode, clear the input\n // after close completes to avoid mid-exit flicker and start fresh on next open.\n if (multiple && inputRef.current && inputRef.current.value !== '' && !hadInputClearRef.current) {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n\n // Single selection mode:\n // - If input is rendered inside the popup, clear it so the next open is blank\n // - If input is outside the popup, sync it to the selected value\n if (single) {\n if (store.state.inputInsidePopup) {\n if (inputRef.current && inputRef.current.value !== '') {\n setInputValue('', createChangeEventDetails(REASONS.inputClear));\n }\n } else {\n const stringVal = stringifyAsLabel(selectedValue, itemToStringLabel);\n if (inputRef.current && inputRef.current.value !== stringVal) {\n // If no selection was made, treat this as clearing the typed filter.\n const reason = stringVal === '' ? REASONS.inputClear : REASONS.none;\n setInputValue(stringVal, createChangeEventDetails(reason));\n }\n }\n }\n });\n\n // Support composing the Dialog component around an inline combobox.\n // `[role=\"dialog\"]` is more interoperable than using a context, e.g. it can work\n // with third-party modal libraries, though the limitation is that the closest\n // `role=dialog` part must be the animated element.\n const resolvedPopupRef = React.useMemo(() => {\n if (inline && positionerElement) {\n return {\n current: positionerElement.closest('[role=\"dialog\"]')\n };\n }\n return popupRef;\n }, [inline, positionerElement]);\n useOpenChangeComplete({\n enabled: !props.actionsRef,\n open,\n ref: resolvedPopupRef,\n onComplete() {\n if (!open) {\n handleUnmount();\n }\n }\n });\n React.useImperativeHandle(props.actionsRef, () => ({\n unmount: handleUnmount\n }), [handleUnmount]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n if (open || selectionMode === 'none') {\n return;\n }\n const registry = items ? flatItems : allValuesRef.current;\n if (multiple) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const lastValue = currentValue[currentValue.length - 1];\n const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);\n setIndices({\n selectedIndex: lastIndex === -1 ? null : lastIndex\n });\n } else {\n const index = findItemIndex(registry, selectedValue, isItemEqualToValue);\n setIndices({\n selectedIndex: index === -1 ? null : index\n });\n }\n }, [open, selectedValue, items, selectionMode, flatItems, multiple, isItemEqualToValue, setIndices]);\n useIsoLayoutEffect(() => {\n if (items) {\n valuesRef.current = flatFilteredItems;\n listRef.current.length = flatFilteredItems.length;\n }\n }, [items, flatFilteredItems]);\n useIsoLayoutEffect(() => {\n const pendingHighlight = pendingQueryHighlightRef.current;\n if (pendingHighlight) {\n if (pendingHighlight.hasQuery) {\n if (autoHighlightMode) {\n store.set('activeIndex', 0);\n }\n } else if (autoHighlightMode === 'always') {\n store.set('activeIndex', 0);\n }\n pendingQueryHighlightRef.current = null;\n }\n if (!open && !inline) {\n return;\n }\n const shouldUseFlatFilteredItems = hasItems || hasFilteredItemsProp;\n const candidateItems = shouldUseFlatFilteredItems ? flatFilteredItems : valuesRef.current;\n const storeActiveIndex = store.state.activeIndex;\n if (storeActiveIndex == null) {\n if (autoHighlightMode === 'always' && candidateItems.length > 0) {\n store.set('activeIndex', 0);\n return;\n }\n if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {\n lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;\n store.state.onItemHighlighted(undefined, createGenericEventDetails(REASONS.none, undefined, {\n index: -1\n }));\n }\n return;\n }\n if (storeActiveIndex >= candidateItems.length) {\n if (lastHighlightRef.current !== INITIAL_LAST_HIGHLIGHT) {\n lastHighlightRef.current = INITIAL_LAST_HIGHLIGHT;\n store.state.onItemHighlighted(undefined, createGenericEventDetails(REASONS.none, undefined, {\n index: -1\n }));\n }\n store.set('activeIndex', null);\n return;\n }\n const itemValue = candidateItems[storeActiveIndex];\n const previouslyHighlightedItemValue = lastHighlightRef.current.value;\n const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);\n if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {\n lastHighlightRef.current = {\n value: itemValue,\n index: storeActiveIndex\n };\n store.state.onItemHighlighted(itemValue, createGenericEventDetails(REASONS.none, undefined, {\n index: storeActiveIndex\n }));\n }\n }, [activeIndex, autoHighlightMode, hasFilteredItemsProp, hasItems, flatFilteredItems, inline, open, store]);\n useIsoLayoutEffect(() => {\n if (selectionMode === 'none') {\n setFilled(String(inputValue) !== '');\n return;\n }\n setFilled(multiple ? Array.isArray(selectedValue) && selectedValue.length > 0 : selectedValue != null);\n }, [setFilled, selectionMode, inputValue, selectedValue, multiple]);\n\n // Ensures that the active index is not set to 0 when the list is empty.\n // This avoids needing to press ArrowDown twice under certain conditions.\n React.useEffect(() => {\n if (hasItems && autoHighlightMode && flatFilteredItems.length === 0) {\n setIndices({\n activeIndex: null\n });\n }\n }, [hasItems, autoHighlightMode, flatFilteredItems.length, setIndices]);\n useValueChanged(query, () => {\n if (!open || query === '' || query === String(initialDefaultInputValue)) {\n return;\n }\n setQueryChangedAfterOpen(true);\n });\n useValueChanged(selectedValue, () => {\n if (selectionMode === 'none') {\n return;\n }\n clearErrors(name);\n setDirty(selectedValue !== validityData.initialValue);\n if (shouldValidateOnChange()) {\n validation.commit(selectedValue);\n } else {\n validation.commit(selectedValue, true);\n }\n if (single && !hasInputValue && !inputInsidePopup) {\n const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);\n if (inputValue !== nextInputValue) {\n setInputValue(nextInputValue, createChangeEventDetails(REASONS.none));\n }\n }\n });\n useValueChanged(inputValue, () => {\n if (selectionMode !== 'none') {\n return;\n }\n clearErrors(name);\n setDirty(inputValue !== validityData.initialValue);\n if (shouldValidateOnChange()) {\n validation.commit(inputValue);\n } else {\n validation.commit(inputValue, true);\n }\n });\n useValueChanged(items, () => {\n if (!single || hasInputValue || inputInsidePopup || queryChangedAfterOpen) {\n return;\n }\n const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);\n if (inputValue !== nextInputValue) {\n setInputValue(nextInputValue, createChangeEventDetails(REASONS.none));\n }\n });\n const floatingRootContext = useFloatingRootContext({\n open: inline ? true : open,\n onOpenChange: setOpen,\n elements: {\n reference: inputInsidePopup ? triggerElement : inputElement,\n floating: positionerElement\n }\n });\n let ariaHasPopup;\n let ariaExpanded;\n if (!inline) {\n ariaHasPopup = grid ? 'grid' : 'listbox';\n ariaExpanded = open ? 'true' : 'false';\n }\n const role = React.useMemo(() => {\n const isPlainInput = inputElement?.tagName === 'INPUT';\n // During SSR and initial hydration, the input ref is not available yet.\n // Assume an input-like control so combobox ARIA attributes are present.\n const shouldTreatAsInput = inputElement == null || isPlainInput;\n const shouldApplyAria = shouldTreatAsInput || open;\n const reference = shouldTreatAsInput ? {\n autoComplete: 'off',\n spellCheck: 'false',\n autoCorrect: 'off',\n autoCapitalize: 'none'\n } : {};\n if (shouldApplyAria) {\n reference.role = 'combobox';\n reference['aria-expanded'] = ariaExpanded;\n reference['aria-haspopup'] = ariaHasPopup;\n reference['aria-controls'] = open ? listElement?.id : undefined;\n reference['aria-autocomplete'] = autoComplete;\n }\n return {\n reference,\n floating: {\n role: 'presentation'\n }\n };\n }, [inputElement, open, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete]);\n const click = useClick(floatingRootContext, {\n enabled: !readOnly && !disabled && openOnInputClick,\n event: 'mousedown-only',\n toggle: false,\n // Apply a small delay for touch to let mobile viewport/keyboard positioning settle.\n // This avoids top-bottom flip flickers if the preferred position is \"top\" when first tapping.\n touchOpenDelay: inputInsidePopup ? 0 : 100,\n reason: REASONS.inputPress\n });\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !readOnly && !disabled && !inline,\n outsidePressEvent: {\n mouse: 'sloppy',\n // The visual viewport (affected by the mobile software keyboard) can be\n // somewhat small. The user may want to scroll the screen to see more of\n // the popup.\n touch: 'intentional'\n },\n // Without a popup, let the Escape key bubble the event up to other popups' handlers.\n bubbles: inline ? true : undefined,\n outsidePress(event) {\n const target = getTarget(event);\n return !contains(triggerElement, target) && !contains(clearRef.current, target) && !contains(chipsContainerRef.current, target) && !contains(inputGroupElement, target);\n }\n });\n const listNavigation = useListNavigation(floatingRootContext, {\n enabled: !readOnly && !disabled,\n id,\n listRef,\n activeIndex,\n selectedIndex,\n virtual: true,\n loopFocus,\n allowEscape: loopFocus && !autoHighlightMode,\n focusItemOnOpen: queryChangedAfterOpen || selectionMode === 'none' && !autoHighlightMode ? false : 'auto',\n focusItemOnHover: highlightItemOnHover,\n resetOnPointerLeave: !keepHighlight,\n // `cols` > 1 enables grid navigation.\n // Since <Combobox.Row> infers column sizes (and is required when building a grid),\n // it works correctly even with a value of `2`.\n // Floating UI tests don't require `role=\"row\"` wrappers, so retains the number API.\n cols: grid ? 2 : 1,\n orientation: grid ? 'horizontal' : undefined,\n disabledIndices: EMPTY_ARRAY,\n onNavigate(nextActiveIndex, event) {\n // Retain the highlight only while actually transitioning out or closed.\n if (!event && !open || transitionStatus === 'ending') {\n return;\n }\n if (!event) {\n setIndices({\n activeIndex: nextActiveIndex\n });\n } else {\n setIndices({\n activeIndex: nextActiveIndex,\n type: keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n }\n });\n const {\n getReferenceProps,\n getFloatingProps,\n getItemProps\n } = useInteractions([role, click, dismiss, listNavigation]);\n useOnFirstRender(() => {\n store.update({\n inline: inlineProp,\n popupProps: getFloatingProps(),\n inputProps: getReferenceProps(),\n triggerProps,\n getItemProps,\n setOpen,\n setInputValue,\n setSelectedValue,\n setIndices,\n onItemHighlighted,\n handleSelection,\n forceMount,\n requestSubmit\n });\n });\n useIsoLayoutEffect(() => {\n store.update({\n id,\n selectedValue,\n open,\n mounted,\n transitionStatus,\n items,\n inline: inlineProp,\n popupProps: getFloatingProps(),\n inputProps: getReferenceProps(),\n triggerProps,\n openMethod,\n getItemProps,\n selectionMode,\n name,\n form,\n disabled,\n readOnly,\n required,\n grid,\n isGrouped,\n virtualized,\n onOpenChangeComplete,\n openOnInputClick,\n itemToStringLabel,\n modal,\n autoHighlight: autoHighlightMode,\n isItemEqualToValue,\n submitOnItemClick,\n hasInputValue,\n requestSubmit\n });\n }, [store, id, selectedValue, open, mounted, transitionStatus, items, getFloatingProps, getReferenceProps, getItemProps, openMethod, triggerProps, selectionMode, name, disabled, readOnly, required, validation, grid, isGrouped, virtualized, onOpenChangeComplete, openOnInputClick, itemToStringLabel, modal, isItemEqualToValue, submitOnItemClick, hasInputValue, inlineProp, requestSubmit, autoHighlightMode, form]);\n const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);\n const itemsContextValue = React.useMemo(() => ({\n query,\n hasItems,\n filteredItems,\n flatFilteredItems\n }), [query, hasItems, filteredItems, flatFilteredItems]);\n const serializedValue = React.useMemo(() => {\n if (Array.isArray(fieldRawValue)) {\n return '';\n }\n return stringifyAsValue(fieldRawValue, itemToStringValue);\n }, [fieldRawValue, itemToStringValue]);\n const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;\n const hiddenInputName = multiple || selectionMode === 'none' ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(selectedValue) || !name) {\n return null;\n }\n return selectedValue.map(value => {\n const currentSerializedValue = stringifyAsValue(value, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue\n }, currentSerializedValue);\n });\n }, [multiple, selectedValue, form, name, itemToStringValue]);\n const children = /*#__PURE__*/_jsxs(React.Fragment, {\n children: [props.children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getInputValidationProps({\n // Move focus when the hidden input is focused.\n onFocus() {\n if (inputInsidePopup) {\n triggerElement?.focus();\n return;\n }\n (inputRef.current || triggerElement)?.focus();\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n function handleChange() {\n // Browser autofill only writes a single scalar value.\n if (multiple) {\n return;\n }\n if (selectionMode === 'none') {\n setDirty(nextValue !== validityData.initialValue);\n setInputValue(nextValue, details);\n if (shouldValidateOnChange()) {\n validation.commit(nextValue);\n }\n return;\n }\n const matchingValue = valuesRef.current.find(v => {\n // Try matching by value first (e.g., \"US\" for country code)\n const candidateValue = stringifyAsValue(v, itemToStringValue);\n if (candidateValue.toLowerCase() === nextValue.toLowerCase()) {\n return true;\n }\n // Also try matching by label for browser autofill compatibility\n // (browsers autofill with displayed text like \"United States\", not the underlying value)\n const candidateLabel = stringifyAsLabel(v, itemToStringLabel);\n if (candidateLabel.toLowerCase() === nextValue.toLowerCase()) {\n return true;\n }\n return false;\n });\n if (matchingValue != null) {\n setDirty(matchingValue !== validityData.initialValue);\n setSelectedValue?.(matchingValue, details);\n if (shouldValidateOnChange()) {\n validation.commit(matchingValue);\n }\n }\n }\n if (items) {\n handleChange();\n } else {\n forceMount();\n queueMicrotask(handleChange);\n }\n }\n }),\n id: id && hiddenInputName == null ? `${id}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: formAutoComplete,\n disabled: disabled,\n required: required && !hasMultipleSelection,\n readOnly: readOnly,\n value: serializedValue,\n ref: hiddenInputRef,\n style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n });\n return /*#__PURE__*/_jsx(ComboboxRootContext.Provider, {\n value: store,\n children: /*#__PURE__*/_jsx(ComboboxFloatingContext.Provider, {\n value: floatingRootContext,\n children: /*#__PURE__*/_jsx(ComboboxDerivedItemsContext.Provider, {\n value: itemsContextValue,\n children: /*#__PURE__*/_jsx(ComboboxInputValueContext.Provider, {\n value: inputValue,\n children: children\n })\n })\n })\n });\n}","import { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { fieldValidityMapping } from \"../../field/utils/constants.js\";\nexport const triggerStateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n popupSide: side => side ? {\n 'data-popup-side': side\n } : null,\n listEmpty: empty => empty ? {\n 'data-list-empty': ''\n } : null\n};","import { ownerWindow } from '@base-ui/utils/owner';\nexport function getPseudoElementBounds(element) {\n const elementRect = element.getBoundingClientRect();\n\n // Avoid \"Not implemented: window.getComputedStyle(elt, pseudoElt)\"\n if (process.env.NODE_ENV !== 'production') {\n return elementRect;\n }\n const win = ownerWindow(element);\n const beforeStyles = win.getComputedStyle(element, '::before');\n const afterStyles = win.getComputedStyle(element, '::after');\n const hasPseudoElements = beforeStyles.content !== 'none' || afterStyles.content !== 'none';\n if (!hasPseudoElements) {\n return elementRect;\n }\n\n // Get dimensions of pseudo-elements\n const beforeWidth = parseFloat(beforeStyles.width) || 0;\n const beforeHeight = parseFloat(beforeStyles.height) || 0;\n const afterWidth = parseFloat(afterStyles.width) || 0;\n const afterHeight = parseFloat(afterStyles.height) || 0;\n\n // Calculate max dimensions including pseudo-elements\n const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);\n const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);\n\n // Calculate the differences to extend the bounds\n const widthDiff = totalWidth - elementRect.width;\n const heightDiff = totalHeight - elementRect.height;\n return {\n left: elementRect.left - widthDiff / 2,\n right: elementRect.right + widthDiff / 2,\n top: elementRect.top - heightDiff / 2,\n bottom: elementRect.bottom + heightDiff / 2\n };\n}","'use client';\n\nexport function getDefaultLabelId(id) {\n return id == null ? undefined : `${id}-label`;\n}\nexport function resolveAriaLabelledBy(fieldLabelId, localLabelId) {\n return fieldLabelId ?? localLabelId;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { useComboboxFloatingContext, useComboboxDerivedItemsContext, useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.js\";\nimport { selectors } from \"../store.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { stopEvent, contains, getTarget } from \"../../floating-ui-react/utils.js\";\nimport { getPseudoElementBounds } from \"../../utils/getPseudoElementBounds.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useClick, useTypeahead } from \"../../floating-ui-react/index.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.js\";\nconst BOUNDARY_OFFSET = 2;\n\n/**\n * A button that opens the popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n nativeButton = true,\n disabled: disabledProp = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const store = useComboboxRootContext();\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const required = useStore(store, selectors.required);\n const mounted = useStore(store, selectors.mounted);\n const popupSideValue = useStore(store, selectors.popupSide);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const triggerProps = useStore(store, selectors.triggerProps);\n const triggerElement = useStore(store, selectors.triggerElement);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const rootId = useStore(store, selectors.id);\n const comboboxLabelId = useStore(store, selectors.labelId);\n const open = useStore(store, selectors.open);\n const selectedValue = useStore(store, selectors.selectedValue);\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const floatingRootContext = useComboboxFloatingContext();\n const inputValue = useComboboxInputValueContext();\n const focusTimeout = useTimeout();\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const listEmpty = filteredItems.length === 0;\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n useLabelableId({\n id: inputInsidePopup ? idProp : undefined\n });\n const id = inputInsidePopup ? idProp ?? rootId : idProp;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, comboboxLabelId);\n const currentPointerTypeRef = React.useRef('');\n function trackPointerType(event) {\n currentPointerTypeRef.current = event.pointerType;\n }\n const domReference = floatingRootContext.useState('domReferenceElement');\n\n // Update the floating root context to use the trigger element when it differs from the current reference.\n // This ensures useClick and useTypeahead attach handlers to the correct element.\n React.useEffect(() => {\n if (!inputInsidePopup) {\n return;\n }\n if (triggerElement && triggerElement !== domReference) {\n floatingRootContext.set('domReferenceElement', triggerElement);\n }\n }, [triggerElement, domReference, floatingRootContext, inputInsidePopup]);\n const {\n reference: triggerTypeaheadProps\n } = useTypeahead(floatingRootContext, {\n enabled: !open && !readOnly && !comboboxDisabled && selectionMode === 'single',\n listRef: store.state.labelsRef,\n activeIndex,\n selectedIndex,\n onMatch(index) {\n const nextSelectedValue = store.state.valuesRef.current[index];\n if (nextSelectedValue !== undefined) {\n store.state.setSelectedValue(nextSelectedValue, createChangeEventDetails('none'));\n }\n }\n });\n const {\n reference: triggerClickProps\n } = useClick(floatingRootContext, {\n enabled: !readOnly && !comboboxDisabled,\n event: 'mousedown'\n });\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled\n });\n const state = {\n ...fieldState,\n open,\n disabled,\n popupSide,\n listEmpty,\n placeholder: selectionMode === 'none' ? false : !hasSelectedValue\n };\n const setTriggerElement = useStableCallback(element => {\n store.set('triggerElement', element);\n });\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef, setTriggerElement],\n state,\n props: [triggerProps, triggerClickProps, triggerTypeaheadProps, {\n id,\n tabIndex: inputInsidePopup ? 0 : -1,\n role: inputInsidePopup ? 'combobox' : undefined,\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': inputInsidePopup ? 'dialog' : 'listbox',\n 'aria-controls': open ? listElement?.id : undefined,\n 'aria-required': inputInsidePopup ? required || undefined : undefined,\n 'aria-labelledby': ariaLabelledBy,\n onPointerDown: trackPointerType,\n onPointerEnter: trackPointerType,\n onFocus() {\n setFocused(true);\n if (disabled || readOnly) {\n return;\n }\n focusTimeout.start(0, store.state.forceMount);\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n },\n onMouseDown(event) {\n if (disabled || readOnly) {\n return;\n }\n if (!inputInsidePopup) {\n floatingRootContext.set('domReferenceElement', event.currentTarget);\n }\n\n // Ensure items are registered for initial selection highlight.\n store.state.forceMount();\n if (currentPointerTypeRef.current !== 'touch') {\n store.state.inputRef.current?.focus();\n if (!inputInsidePopup) {\n event.preventDefault();\n }\n }\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerElement) {\n return;\n }\n const mouseUpTarget = getTarget(mouseEvent);\n const positioner = store.state.positionerElement;\n const list = store.state.listElement;\n if (contains(triggerElement, mouseUpTarget) || contains(positioner, mouseUpTarget) || contains(list, mouseUpTarget) || mouseUpTarget === triggerElement) {\n return;\n }\n const bounds = getPseudoElementBounds(triggerElement);\n const withinHorizontal = mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET;\n const withinVertical = mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET;\n if (withinHorizontal && withinVertical) {\n return;\n }\n store.state.setOpen(false, createChangeEventDetails('cancel-open', mouseEvent));\n }\n if (inputInsidePopup) {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n }\n },\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n stopEvent(event);\n store.state.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n store.state.inputRef.current?.focus();\n }\n }\n }, validation ? validation.getValidationProps(elementProps) : elementProps, getButtonProps],\n stateAttributesMapping: triggerStateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxTrigger.displayName = \"ComboboxTrigger\";","'use client';\n\nimport * as React from 'react';\nexport const ComboboxChipsContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipsContext.displayName = \"ComboboxChipsContext\";\nexport function useComboboxChipsContext() {\n return React.useContext(ComboboxChipsContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPositionerContext.displayName = \"ComboboxPositionerContext\";\nexport function useComboboxPositionerContext(optional) {\n const context = React.useContext(ComboboxPositionerContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component' : _formatErrorMessage(21));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useButton } from \"../../use-button/index.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * @internal\n */\nexport const ComboboxInternalDismissButton = /*#__PURE__*/React.forwardRef(function ComboboxInternalDismissButton(_, forwardedRef) {\n const store = useComboboxRootContext();\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: false\n });\n const mergedRef = useMergedRefs(forwardedRef, buttonRef);\n const handleDismiss = useStableCallback(event => {\n store.state.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent, event.currentTarget));\n });\n const dismissProps = getButtonProps({\n onClick: handleDismiss\n });\n return /*#__PURE__*/_jsx(\"span\", {\n ref: mergedRef,\n ...dismissProps,\n \"aria-label\": \"Dismiss\",\n tabIndex: undefined,\n style: visuallyHiddenInput\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInternalDismissButton.displayName = \"ComboboxInternalDismissButton\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { isAndroid, isFirefox } from '@base-ui/utils/detectBrowser';\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useComboboxDerivedItemsContext, useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { triggerStateAttributesMapping } from \"../utils/stateAttributesMapping.js\";\nimport { selectors } from \"../store.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { DEFAULT_FIELD_STATE_ATTRIBUTES } from \"../../field/utils/constants.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.js\";\nimport { stopEvent } from \"../../floating-ui-react/utils.js\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useDirection } from \"../../direction-provider/DirectionContext.js\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.js\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.js\";\n\n/**\n * A text input to search for items in the list.\n * Renders an `<input>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInput(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n disabled: fieldDisabled,\n setTouched,\n setFocused,\n validationMode,\n validation\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const comboboxChipsContext = useComboboxChipsContext();\n const positioning = useComboboxPositionerContext(true);\n const hasPositionerParent = Boolean(positioning);\n const store = useComboboxRootContext();\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n // `inputValue` can't be placed in the store.\n // https://github.com/mui/base-ui/issues/2703\n const inputValue = useComboboxInputValueContext();\n const direction = useDirection();\n const required = useStore(store, selectors.required);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const name = useStore(store, selectors.name);\n const form = useStore(store, selectors.form);\n const selectionMode = useStore(store, selectors.selectionMode);\n const autoHighlightMode = useStore(store, selectors.autoHighlight);\n const inputProps = useStore(store, selectors.inputProps);\n const triggerProps = useStore(store, selectors.triggerProps);\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const selectedValue = useStore(store, selectors.selectedValue);\n const popupSideValue = useStore(store, selectors.popupSide);\n const positionerElement = useStore(store, selectors.positionerElement);\n const rootId = useStore(store, selectors.id);\n const inline = useStore(store, selectors.inline);\n const modal = useStore(store, selectors.modal);\n const autoHighlightEnabled = Boolean(autoHighlightMode);\n const popupSide = mounted && positionerElement ? popupSideValue : null;\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const listEmpty = filteredItems.length === 0;\n const isInsidePopup = hasPositionerParent || inline;\n const focusManagerModal = !isInsidePopup || modal;\n const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : undefined));\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, undefined);\n const fieldStateForInput = hasPositionerParent ? DEFAULT_FIELD_STATE_ATTRIBUTES : fieldState;\n const [composingValue, setComposingValue] = React.useState(null);\n const isComposingRef = React.useRef(false);\n const lastActiveIndexRef = React.useRef(null);\n const shouldRestoreActiveIndexRef = React.useRef(false);\n const setInputElement = useStableCallback(element => {\n const nextIsInsidePopup = hasPositionerParent || store.state.inline;\n if (nextIsInsidePopup && !store.state.hasInputValue) {\n store.state.setInputValue('', createChangeEventDetails(REASONS.none));\n }\n store.update({\n inputElement: element,\n inputInsidePopup: nextIsInsidePopup\n });\n });\n const validationProps = hasPositionerParent || !validation ? elementProps : validation.getValidationProps(elementProps);\n const state = {\n ...fieldStateForInput,\n open,\n disabled,\n readOnly,\n popupSide,\n listEmpty\n };\n function handleKeyDown(event) {\n if (!comboboxChipsContext) {\n return undefined;\n }\n let nextIndex;\n const {\n highlightedChipIndex\n } = comboboxChipsContext;\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n if (highlightedChipIndex !== undefined) {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (highlightedChipIndex > 0) {\n nextIndex = highlightedChipIndex - 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (highlightedChipIndex < renderedChipsCount - 1) {\n nextIndex = highlightedChipIndex + 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n event.preventDefault();\n // Move highlight appropriately after removal.\n const computedNextIndex = highlightedChipIndex >= selectedValue.length - 1 ? selectedValue.length - 2 : highlightedChipIndex;\n // If the computed index is negative, treat it as no highlight.\n nextIndex = computedNextIndex >= 0 ? computedNextIndex : undefined;\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: 'keyboard'\n });\n }\n return nextIndex;\n }\n\n // Handle navigation when no chip is highlighted\n if (event.key === 'ArrowLeft' && (event.currentTarget.selectionStart ?? 0) === 0 && selectedValue.length > 0) {\n event.preventDefault();\n nextIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : undefined;\n } else if (event.key === 'Backspace' && event.currentTarget.value === '' && selectedValue.length > 0) {\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: 'keyboard'\n });\n event.preventDefault();\n }\n return nextIndex;\n }\n const element = useRenderElement('input', componentProps, {\n state,\n ref: [forwardedRef, store.state.inputRef, setInputElement],\n props: [inputProps, triggerProps, {\n type: 'text',\n value: componentProps.value ?? composingValue ?? inputValue,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n disabled,\n readOnly,\n required: selectionMode === 'none' ? required : undefined,\n form,\n ...(selectionMode === 'none' && name && {\n name\n }),\n id,\n onFocus() {\n setFocused(true);\n if (!inline || !shouldRestoreActiveIndexRef.current) {\n return;\n }\n shouldRestoreActiveIndexRef.current = false;\n const nextActiveIndex = lastActiveIndexRef.current;\n if (nextActiveIndex == null ||\n // `valuesRef` can be sparse, so guard against restoring a removed slot.\n !Object.hasOwn(store.state.valuesRef.current, nextActiveIndex)) {\n return;\n }\n store.state.setIndices({\n activeIndex: nextActiveIndex\n });\n },\n onBlur() {\n setTouched(true);\n setFocused(false);\n const activeIndex = store.state.activeIndex;\n if (inline && activeIndex !== null && autoHighlightMode !== 'always') {\n lastActiveIndexRef.current = activeIndex;\n shouldRestoreActiveIndexRef.current = true;\n store.state.setIndices({\n activeIndex: null\n });\n }\n if (validationMode === 'onBlur') {\n const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;\n validation.commit(valueToValidate);\n }\n },\n onCompositionStart(event) {\n if (isAndroid) {\n return;\n }\n isComposingRef.current = true;\n setComposingValue(event.currentTarget.value);\n },\n onCompositionEnd(event) {\n isComposingRef.current = false;\n const next = event.currentTarget.value;\n setComposingValue(null);\n store.state.setInputValue(next, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n },\n onChange(event) {\n // Autofill may not provide `inputType` (Chrome) or may report\n // `insertReplacementText` (Firefox).\n const inputType = event.nativeEvent.inputType;\n const autofillLikeInput = !inputType || inputType === 'insertReplacementText';\n const shouldOpenOnInput = isComposingRef.current || !autofillLikeInput;\n\n // During IME composition, avoid propagating controlled updates to prevent\n // filtering the options prematurely so `Empty` won't show incorrectly.\n // We can't rely on this check for Android due to how it handles composition\n // events with some keyboards (e.g. Samsung keyboard with predictive text on\n // treats all text as always-composing).\n // https://github.com/mui/base-ui/issues/2942\n if (isComposingRef.current) {\n const nextVal = event.currentTarget.value;\n setComposingValue(nextVal);\n if (nextVal === '' && !store.state.openOnInputClick && !store.state.inputInsidePopup) {\n store.state.setOpen(false, createChangeEventDetails(REASONS.inputClear, event.nativeEvent));\n }\n const trimmed = nextVal.trim();\n const shouldMaintainHighlight = autoHighlightEnabled && trimmed !== '';\n if (!readOnly && !disabled && trimmed) {\n if (shouldOpenOnInput) {\n store.state.setOpen(true, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n if (!autoHighlightEnabled) {\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n }\n }\n if (open && store.state.activeIndex !== null && !shouldMaintainHighlight) {\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n return;\n }\n store.state.setInputValue(event.currentTarget.value, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n const empty = event.currentTarget.value === '';\n const clearDetails = createChangeEventDetails(REASONS.inputClear, event.nativeEvent);\n if (empty && !store.state.inputInsidePopup) {\n if (selectionMode === 'single') {\n store.state.setSelectedValue(null, clearDetails);\n }\n if (!store.state.openOnInputClick) {\n store.state.setOpen(false, clearDetails);\n }\n }\n const trimmed = event.currentTarget.value.trim();\n if (!readOnly && !disabled && trimmed) {\n if (shouldOpenOnInput) {\n store.state.setOpen(true, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));\n // When autoHighlight is enabled, keep the highlight (will be set to 0 in root).\n if (!autoHighlightEnabled) {\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n }\n }\n\n // When the user types, ensure the list resets its highlight so that\n // virtual focus returns to the input (aria-activedescendant is\n // cleared).\n if (open && store.state.activeIndex !== null && !autoHighlightEnabled) {\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n },\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n if (event.ctrlKey || event.shiftKey || event.altKey || event.metaKey) {\n return;\n }\n store.state.keyboardActiveRef.current = true;\n const input = event.currentTarget;\n const scrollAmount = input.scrollWidth - input.clientWidth;\n const isRTL = direction === 'rtl';\n if (event.key === 'Home') {\n stopEvent(event);\n const cursor = isFirefox && isRTL ? input.value.length : 0;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = 0;\n return;\n }\n if (event.key === 'End') {\n stopEvent(event);\n const cursor = isFirefox && isRTL ? 0 : input.value.length;\n input.setSelectionRange(cursor, cursor);\n input.scrollLeft = isRTL ? -scrollAmount : scrollAmount;\n return;\n }\n if (!mounted && event.key === 'Escape') {\n const isClear = selectionMode === 'multiple' && Array.isArray(selectedValue) ? selectedValue.length === 0 : selectedValue === null;\n const details = createChangeEventDetails(REASONS.escapeKey, event.nativeEvent);\n const value = selectionMode === 'multiple' ? [] : null;\n store.state.setInputValue('', details);\n store.state.setSelectedValue(value, details);\n if (!isClear && !store.state.inline && !details.isPropagationAllowed) {\n event.stopPropagation();\n }\n return;\n }\n\n // Handle deletion when no chip is highlighted and the input is empty.\n if (comboboxChipsContext && event.key === 'Backspace' && input.value === '' && comboboxChipsContext.highlightedChipIndex === undefined && Array.isArray(selectedValue) && selectedValue.length > 0) {\n const renderedChipsCount = comboboxChipsContext.chipsRef.current.length;\n const removalIndex = renderedChipsCount > 0 ? renderedChipsCount - 1 : selectedValue.length - 1;\n const newValue = selectedValue.filter((_, index) => index !== removalIndex);\n // If the removed item was also the active (highlighted) item, clear highlight\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n store.state.setSelectedValue(newValue, createChangeEventDetails(REASONS.none, event.nativeEvent));\n return;\n }\n const hadHighlightedChip = comboboxChipsContext?.highlightedChipIndex !== undefined;\n const nextIndex = handleKeyDown(event);\n comboboxChipsContext?.setHighlightedChipIndex(nextIndex);\n if (nextIndex !== undefined) {\n comboboxChipsContext?.chipsRef.current[nextIndex]?.focus();\n } else if (hadHighlightedChip) {\n store.state.inputRef.current?.focus();\n }\n\n // event.isComposing\n if (event.which === 229) {\n return;\n }\n if (event.key === 'Enter' && open) {\n const activeIndex = store.state.activeIndex;\n const nativeEvent = event.nativeEvent;\n if (activeIndex === null) {\n if (inline) {\n return;\n }\n\n // Allow form submission when no item is highlighted.\n store.state.setOpen(false, createChangeEventDetails(REASONS.none, nativeEvent));\n return;\n }\n stopEvent(event);\n const listItem = store.state.listRef.current[activeIndex];\n if (listItem) {\n store.state.selectionEventRef.current = nativeEvent;\n listItem.click();\n store.state.selectionEventRef.current = null;\n }\n }\n },\n onPointerMove() {\n store.state.keyboardActiveRef.current = false;\n },\n onPointerDown() {\n store.state.keyboardActiveRef.current = false;\n }\n }, validationProps],\n stateAttributesMapping: triggerStateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [open && focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.state.startDismissRef\n }), element]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxInput.displayName = \"ComboboxInput\";","import { isElement } from '@floating-ui/utils/dom';\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { getTarget, isInteractiveElement } from \"../../floating-ui-react/utils/element.js\";\nexport function handleInputPress(event, store, disabled, readOnly, shouldIgnoreTarget) {\n if (event.baseUIHandlerPrevented || readOnly) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n const targetElement = isElement(target) ? target : null;\n if (targetElement !== event.currentTarget && (shouldIgnoreTarget?.(targetElement) || isInteractiveElement(targetElement))) {\n return;\n }\n event.preventDefault();\n if (disabled) {\n return;\n }\n store.state.inputRef.current?.focus();\n if (store.state.openOnInputClick) {\n store.state.setOpen(true, createChangeEventDetails(REASONS.inputPress, event.nativeEvent));\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useComboboxInputValueContext, useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { selectors } from \"../store.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nconst stateAttributesMapping = {\n ...transitionStatusMapping,\n ...triggerOpenStateMapping\n};\n\n/**\n * Clears the value when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxClear = /*#__PURE__*/React.forwardRef(function ComboboxClear(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n keepMounted = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n disabled: fieldDisabled\n } = useFieldRootContext();\n const store = useComboboxRootContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const open = useStore(store, selectors.open);\n const selectedValue = useStore(store, selectors.selectedValue);\n const hasSelectionChips = useStore(store, selectors.hasSelectionChips);\n const inputValue = useComboboxInputValueContext();\n let visible = false;\n if (selectionMode === 'none') {\n visible = inputValue !== '';\n } else if (selectionMode === 'single') {\n visible = selectedValue != null;\n } else {\n visible = hasSelectionChips;\n }\n const disabled = fieldDisabled || comboboxDisabled || disabledProp;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled\n });\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(visible);\n const state = {\n disabled,\n open,\n transitionStatus\n };\n useOpenChangeComplete({\n open: visible,\n ref: store.state.clearRef,\n onComplete() {\n if (!visible) {\n setMounted(false);\n }\n }\n });\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef, store.state.clearRef],\n props: [{\n tabIndex: -1,\n children: 'x',\n // Avoid stealing focus from the input.\n onMouseDown(event) {\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n const keyboardActiveRef = store.state.keyboardActiveRef;\n store.state.setInputValue('', createChangeEventDetails(REASONS.clearPress, event.nativeEvent));\n if (selectionMode !== 'none') {\n store.state.setSelectedValue(Array.isArray(selectedValue) ? [] : null, createChangeEventDetails(REASONS.clearPress, event.nativeEvent));\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n } else {\n store.state.setIndices({\n activeIndex: null,\n type: keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n store.state.inputRef.current?.focus();\n }\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n const shouldRender = keepMounted || mounted;\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxClear.displayName = \"ComboboxClear\";","'use client';\n\nimport * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GroupCollectionContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") GroupCollectionContext.displayName = \"GroupCollectionContext\";\nexport function useGroupCollectionContext() {\n return React.useContext(GroupCollectionContext);\n}\nexport function GroupCollectionProvider(props) {\n const {\n children,\n items\n } = props;\n const contextValue = React.useMemo(() => ({\n items\n }), [items]);\n return /*#__PURE__*/_jsx(GroupCollectionContext.Provider, {\n value: contextValue,\n children: children\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.js\";\nimport { useGroupCollectionContext } from \"./GroupCollectionContext.js\";\n\n/**\n * Renders filtered list items.\n * Doesn't render its own HTML element.\n *\n * If rendering a flat list, pass a function child to the `List` component instead, which implicitly wraps it.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxCollection(props) {\n const {\n children\n } = props;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const groupContext = useGroupCollectionContext();\n const itemsToRender = groupContext ? groupContext.items : filteredItems;\n if (!itemsToRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: itemsToRender.map(children)\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useComboboxDerivedItemsContext, useComboboxFloatingContext, useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.js\";\nimport { selectors } from \"../store.js\";\nimport { ComboboxCollection } from \"../collection/ComboboxCollection.js\";\nimport { CompositeList } from \"../../composite/list/CompositeList.js\";\nimport { stopEvent } from \"../../floating-ui-react/utils.js\";\n\n/**\n * A list container for the items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxList = /*#__PURE__*/React.forwardRef(function ComboboxList(componentProps, forwardedRef) {\n var _ComboboxCollection;\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const floatingRootContext = useComboboxFloatingContext();\n const hasPositionerContext = Boolean(useComboboxPositionerContext(true));\n const {\n filteredItems,\n hasItems\n } = useComboboxDerivedItemsContext();\n const selectionMode = useStore(store, selectors.selectionMode);\n const grid = useStore(store, selectors.grid);\n const popupProps = useStore(store, selectors.popupProps);\n const virtualized = useStore(store, selectors.virtualized);\n const multiple = selectionMode === 'multiple';\n const empty = filteredItems.length === 0;\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const setListElement = useStableCallback(element => {\n store.set('listElement', element);\n });\n\n // Support \"closed template\" API: if children is a function, implicitly wrap it\n // with a Combobox.Collection that reads items from context/root.\n // Ensures this component's `popupProps` subscription does not cause <Combobox.Item>\n // to re-render on every active index change.\n const resolvedChildren = React.useMemo(() => {\n if (typeof children === 'function') {\n return _ComboboxCollection || (_ComboboxCollection = /*#__PURE__*/_jsx(ComboboxCollection, {\n children: children\n }));\n }\n return children;\n }, [children]);\n const state = {\n empty\n };\n const floatingId = floatingRootContext.useState('floatingId');\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, setListElement, hasPositionerContext ? null : setPositionerElement],\n props: [popupProps, {\n children: resolvedChildren,\n tabIndex: -1,\n id: floatingId,\n role: grid ? 'grid' : 'listbox',\n 'aria-multiselectable': multiple ? 'true' : undefined,\n onKeyDown(event) {\n if (store.state.disabled || store.state.readOnly) {\n return;\n }\n if (event.key === 'Enter') {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n // Allow form submission when no item is highlighted.\n return;\n }\n stopEvent(event);\n const nativeEvent = event.nativeEvent;\n const listItem = store.state.listRef.current[activeIndex];\n if (listItem) {\n store.state.selectionEventRef.current = nativeEvent;\n listItem.click();\n store.state.selectionEventRef.current = null;\n }\n }\n },\n onKeyDownCapture() {\n store.state.keyboardActiveRef.current = true;\n },\n onPointerMoveCapture() {\n store.state.keyboardActiveRef.current = false;\n }\n }, elementProps]\n });\n if (virtualized) {\n return element;\n }\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.state.listRef,\n labelsRef: hasItems ? undefined : store.state.labelsRef,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxList.displayName = \"ComboboxList\";","'use client';\n\nimport * as React from 'react';\nimport { isIOS } from '@base-ui/utils/detectBrowser';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\n\n// Word Joiner is invisible and zero-width, so it forces a text mutation without shifting layout.\nconst LIVE_REGION_MARKER = '\\u2060';\n// Safari VoiceOver needed roughly 200ms to reliably notice the initial polite live-region change.\nexport const INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY = 200;\nfunction findLastTextNode(root) {\n const walker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_TEXT);\n let lastTextNode = null;\n while (walker.nextNode()) {\n const textNode = walker.currentNode;\n if (textNode.nodeValue !== '') {\n lastTextNode = textNode;\n }\n }\n return lastTextNode;\n}\nexport function useInitialLiveRegionTextMutation() {\n const timeout = useTimeout();\n const rootRef = React.useRef(null);\n\n // Only the initial mounted announcement needs the marker; later text updates announce naturally.\n React.useEffect(() => {\n if (isIOS) {\n return undefined;\n }\n const root = rootRef.current;\n if (root == null) {\n return undefined;\n }\n const textNode = findLastTextNode(root);\n if (textNode == null) {\n return undefined;\n }\n const originalValue = textNode.nodeValue ?? '';\n const markedValue = `${originalValue}${LIVE_REGION_MARKER}`;\n textNode.nodeValue = markedValue;\n timeout.start(INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY, () => {\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n });\n return () => {\n timeout.clear();\n if (textNode.nodeValue === markedValue) {\n textNode.nodeValue = originalValue;\n }\n };\n }, [rootRef, timeout]);\n return rootRef;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxPortalContext.displayName = \"ComboboxPortalContext\";\nexport function useComboboxPortalContext() {\n const context = React.useContext(ComboboxPortalContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Combobox.Portal> is missing.' : _formatErrorMessage(20));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.js\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { ComboboxPortalContext } from \"./ComboboxPortalContext.js\";\nimport { selectors } from \"../store.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxPortal = /*#__PURE__*/React.forwardRef(function ComboboxPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useComboboxRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMounted = useStore(store, selectors.forceMounted);\n const shouldRender = mounted || keepMounted || forceMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(ComboboxPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPortal.displayName = \"ComboboxPortal\";","import { clamp, evaluate, getAlignment, getAlignmentAxis, getAxisLength, getPaddingObject } from '@floating-ui/utils';\n/**\n * Fork of the original `arrow` middleware from Floating UI that allows\n * configuring the offset parent.\n */\nexport const baseArrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0,\n offsetParent = 'real'\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = offsetParent === 'real' ? await platform.getOffsetParent?.(element) : elements.floating;\n let clientSize = elements.floating[clientProp] || rects.floating[length];\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await platform.isElement?.(arrowOffsetParent))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n // eslint-disable-next-line no-nested-ternary\n const alignmentOffset = shouldAddOffset ? center < min ? center - min : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nexport const arrow = (options, deps) => ({\n ...baseArrow(options),\n options: [options, deps]\n});","import { hide as nativeHide } from '@floating-ui/react-dom';\nexport const hide = {\n name: 'hide',\n async fn(state) {\n const {\n width,\n height,\n x,\n y\n } = state.rects.reference;\n const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0;\n const nativeHideResult = await nativeHide().fn(state);\n return {\n data: {\n referenceHidden: nativeHideResult.data?.referenceHidden || anchorHidden\n }\n };\n }\n};","import { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { getSide } from '@floating-ui/utils';\nexport const DEFAULT_SIDES = {\n sideX: 'left',\n sideY: 'top'\n};\nexport const adaptiveOrigin = {\n name: 'adaptiveOrigin',\n async fn(state) {\n const {\n x: rawX,\n y: rawY,\n rects: {\n floating: floatRect\n },\n elements: {\n floating\n },\n platform,\n strategy,\n placement\n } = state;\n const win = ownerWindow(floating);\n const styles = win.getComputedStyle(floating);\n const hasTransition = styles.transitionDuration !== '0s' && styles.transitionDuration !== '';\n if (!hasTransition) {\n return {\n x: rawX,\n y: rawY,\n data: DEFAULT_SIDES\n };\n }\n const offsetParent = await platform.getOffsetParent?.(floating);\n let offsetDimensions = {\n width: 0,\n height: 0\n };\n\n // For fixed strategy, prefer visualViewport if available\n if (strategy === 'fixed' && win?.visualViewport) {\n offsetDimensions = {\n width: win.visualViewport.width,\n height: win.visualViewport.height\n };\n } else if (offsetParent === win) {\n const doc = ownerDocument(floating);\n offsetDimensions = {\n width: doc.documentElement.clientWidth,\n height: doc.documentElement.clientHeight\n };\n } else if (await platform.isElement?.(offsetParent)) {\n offsetDimensions = await platform.getDimensions(offsetParent);\n }\n const currentSide = getSide(placement);\n let x = rawX;\n let y = rawY;\n if (currentSide === 'left') {\n x = offsetDimensions.width - (rawX + floatRect.width);\n }\n if (currentSide === 'top') {\n y = offsetDimensions.height - (rawY + floatRect.height);\n }\n const sideX = currentSide === 'left' ? 'right' : DEFAULT_SIDES.sideX;\n const sideY = currentSide === 'top' ? 'bottom' : DEFAULT_SIDES.sideY;\n return {\n x,\n y,\n data: {\n sideX,\n sideY\n }\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { getSide, getAlignment, getSideAxis } from '@floating-ui/utils';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { autoUpdate, flip, limitShift, offset, shift, useFloating, size } from \"../floating-ui-react/index.js\";\nimport { useDirection } from \"../direction-provider/DirectionContext.js\";\nimport { arrow } from \"../floating-ui-react/middleware/arrow.js\";\nimport { hide } from \"./hideMiddleware.js\";\nimport { DEFAULT_SIDES } from \"./adaptiveOriginMiddleware.js\";\nfunction getLogicalSide(sideParam, renderedSide, isRtl) {\n const isLogicalSideParam = sideParam === 'inline-start' || sideParam === 'inline-end';\n const logicalRight = isRtl ? 'inline-start' : 'inline-end';\n const logicalLeft = isRtl ? 'inline-end' : 'inline-start';\n return {\n top: 'top',\n right: isLogicalSideParam ? logicalRight : 'right',\n bottom: 'bottom',\n left: isLogicalSideParam ? logicalLeft : 'left'\n }[renderedSide];\n}\nfunction getOffsetData(state, sideParam, isRtl) {\n const {\n rects,\n placement\n } = state;\n const data = {\n side: getLogicalSide(sideParam, getSide(placement), isRtl),\n align: getAlignment(placement) || 'center',\n anchor: {\n width: rects.reference.width,\n height: rects.reference.height\n },\n positioner: {\n width: rects.floating.width,\n height: rects.floating.height\n }\n };\n return data;\n}\n/**\n * Provides standardized anchor positioning behavior for floating elements. Wraps Floating UI's\n * `useFloating` hook.\n */\nexport function useAnchorPositioning(params) {\n const {\n // Public parameters\n anchor,\n positionMethod = 'absolute',\n side: sideParam = 'bottom',\n sideOffset = 0,\n align = 'center',\n alignOffset = 0,\n collisionBoundary,\n collisionPadding: collisionPaddingParam = 5,\n sticky = false,\n arrowPadding = 5,\n disableAnchorTracking = false,\n // Private parameters\n keepMounted = false,\n floatingRootContext,\n mounted,\n collisionAvoidance,\n shiftCrossAxis = false,\n nodeId,\n adaptiveOrigin,\n lazyFlip = false,\n externalTree\n } = params;\n const [mountSide, setMountSide] = React.useState(null);\n if (!mounted && mountSide !== null) {\n setMountSide(null);\n }\n const collisionAvoidanceSide = collisionAvoidance.side || 'flip';\n const collisionAvoidanceAlign = collisionAvoidance.align || 'flip';\n const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || 'end';\n const anchorFn = typeof anchor === 'function' ? anchor : undefined;\n const anchorFnCallback = useStableCallback(anchorFn);\n const anchorDep = anchorFn ? anchorFnCallback : anchor;\n const anchorValueRef = useValueAsRef(anchor);\n const mountedRef = useValueAsRef(mounted);\n const direction = useDirection();\n const isRtl = direction === 'rtl';\n const side = mountSide || {\n top: 'top',\n right: 'right',\n bottom: 'bottom',\n left: 'left',\n 'inline-end': isRtl ? 'left' : 'right',\n 'inline-start': isRtl ? 'right' : 'left'\n }[sideParam];\n const placement = align === 'center' ? side : `${side}-${align}`;\n let collisionPadding = collisionPaddingParam;\n\n // Create a bias to the preferred side.\n // On iOS, when the mobile software keyboard opens, the input is exactly centered\n // in the viewport, but this can cause it to flip to the top undesirably.\n const bias = 1;\n const biasTop = sideParam === 'bottom' ? bias : 0;\n const biasBottom = sideParam === 'top' ? bias : 0;\n const biasLeft = sideParam === 'right' ? bias : 0;\n const biasRight = sideParam === 'left' ? bias : 0;\n if (typeof collisionPadding === 'number') {\n collisionPadding = {\n top: collisionPadding + biasTop,\n right: collisionPadding + biasRight,\n bottom: collisionPadding + biasBottom,\n left: collisionPadding + biasLeft\n };\n } else if (collisionPadding) {\n collisionPadding = {\n top: (collisionPadding.top || 0) + biasTop,\n right: (collisionPadding.right || 0) + biasRight,\n bottom: (collisionPadding.bottom || 0) + biasBottom,\n left: (collisionPadding.left || 0) + biasLeft\n };\n }\n const commonCollisionProps = {\n boundary: collisionBoundary === 'clipping-ancestors' ? 'clippingAncestors' : collisionBoundary,\n padding: collisionPadding\n };\n\n // Using a ref assumes that the arrow element is always present in the DOM for the lifetime of the\n // popup. If this assumption ends up being false, we can switch to state to manage the arrow's\n // presence.\n const arrowRef = React.useRef(null);\n\n // Keep these reactive if they're not functions\n const sideOffsetRef = useValueAsRef(sideOffset);\n const alignOffsetRef = useValueAsRef(alignOffset);\n const sideOffsetDep = typeof sideOffset !== 'function' ? sideOffset : 0;\n const alignOffsetDep = typeof alignOffset !== 'function' ? alignOffset : 0;\n const middleware = [offset(state => {\n const data = getOffsetData(state, sideParam, isRtl);\n const sideAxis = typeof sideOffsetRef.current === 'function' ? sideOffsetRef.current(data) : sideOffsetRef.current;\n const alignAxis = typeof alignOffsetRef.current === 'function' ? alignOffsetRef.current(data) : alignOffsetRef.current;\n return {\n mainAxis: sideAxis,\n crossAxis: alignAxis,\n alignmentAxis: alignAxis\n };\n }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])];\n const shiftDisabled = collisionAvoidanceAlign === 'none' && collisionAvoidanceSide !== 'shift';\n const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === 'shift');\n const flipMiddleware = collisionAvoidanceSide === 'none' ? null : flip({\n ...commonCollisionProps,\n // Ensure the popup flips if it's been limited by its --available-height and it resizes.\n // Since the size() padding is smaller than the flip() padding, flip() will take precedence.\n padding: {\n top: collisionPadding.top + bias,\n right: collisionPadding.right + bias,\n bottom: collisionPadding.bottom + bias,\n left: collisionPadding.left + bias\n },\n mainAxis: !shiftCrossAxis && collisionAvoidanceSide === 'flip',\n crossAxis: collisionAvoidanceAlign === 'flip' ? 'alignment' : false,\n fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide\n });\n const shiftMiddleware = shiftDisabled ? null : shift(data => {\n const html = ownerDocument(data.elements.floating).documentElement;\n return {\n ...commonCollisionProps,\n // Use the Layout Viewport to avoid shifting around when pinch-zooming\n // for context menus.\n rootBoundary: shiftCrossAxis ? {\n x: 0,\n y: 0,\n width: html.clientWidth,\n height: html.clientHeight\n } : undefined,\n mainAxis: collisionAvoidanceAlign !== 'none',\n crossAxis: crossAxisShiftEnabled,\n limiter: sticky || shiftCrossAxis ? undefined : limitShift(limitData => {\n if (!arrowRef.current) {\n return {};\n }\n const {\n width,\n height\n } = arrowRef.current.getBoundingClientRect();\n const sideAxis = getSideAxis(getSide(limitData.placement));\n const arrowSize = sideAxis === 'y' ? width : height;\n const offsetAmount = sideAxis === 'y' ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;\n return {\n offset: arrowSize / 2 + offsetAmount / 2\n };\n })\n };\n }, [commonCollisionProps, sticky, shiftCrossAxis, collisionPadding, collisionAvoidanceAlign]);\n\n // https://floating-ui.com/docs/flip#combining-with-shift\n if (collisionAvoidanceSide === 'shift' || collisionAvoidanceAlign === 'shift' || align === 'center') {\n middleware.push(shiftMiddleware, flipMiddleware);\n } else {\n middleware.push(flipMiddleware, shiftMiddleware);\n }\n middleware.push(size({\n ...commonCollisionProps,\n apply({\n elements: {\n floating\n },\n availableWidth,\n availableHeight,\n rects\n }) {\n if (!mountedRef.current) {\n return;\n }\n const floatingStyle = floating.style;\n floatingStyle.setProperty('--available-width', `${availableWidth}px`);\n floatingStyle.setProperty('--available-height', `${availableHeight}px`);\n\n // Snap anchor dimensions to device pixels to ensure the popup's visual width matches the anchor's one.\n const dpr = ownerWindow(floating).devicePixelRatio || 1;\n const {\n x,\n y,\n width,\n height\n } = rects.reference;\n const anchorWidth = (Math.round((x + width) * dpr) - Math.round(x * dpr)) / dpr;\n const anchorHeight = (Math.round((y + height) * dpr) - Math.round(y * dpr)) / dpr;\n floatingStyle.setProperty('--anchor-width', `${anchorWidth}px`);\n floatingStyle.setProperty('--anchor-height', `${anchorHeight}px`);\n }\n }), arrow(() => ({\n // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,\n // we'll create a fake element.\n element: arrowRef.current || ownerDocument(arrowRef.current).createElement('div'),\n padding: arrowPadding,\n offsetParent: 'floating'\n }), [arrowPadding]), {\n name: 'transformOrigin',\n fn(state) {\n const {\n elements,\n middlewareData,\n placement: renderedPlacement,\n rects,\n y\n } = state;\n const currentRenderedSide = getSide(renderedPlacement);\n const currentRenderedAxis = getSideAxis(currentRenderedSide);\n const arrowEl = arrowRef.current;\n const arrowX = middlewareData.arrow?.x || 0;\n const arrowY = middlewareData.arrow?.y || 0;\n const arrowWidth = arrowEl?.clientWidth || 0;\n const arrowHeight = arrowEl?.clientHeight || 0;\n const transformX = arrowX + arrowWidth / 2;\n const transformY = arrowY + arrowHeight / 2;\n const shiftY = Math.abs(middlewareData.shift?.y || 0);\n const halfAnchorHeight = rects.reference.height / 2;\n const sideOffsetValue = typeof sideOffset === 'function' ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;\n const isOverlappingAnchor = shiftY > sideOffsetValue;\n const adjacentTransformOrigin = {\n top: `${transformX}px calc(100% + ${sideOffsetValue}px)`,\n bottom: `${transformX}px ${-sideOffsetValue}px`,\n left: `calc(100% + ${sideOffsetValue}px) ${transformY}px`,\n right: `${-sideOffsetValue}px ${transformY}px`\n }[currentRenderedSide];\n const overlapTransformOrigin = `${transformX}px ${rects.reference.y + halfAnchorHeight - y}px`;\n elements.floating.style.setProperty('--transform-origin', crossAxisShiftEnabled && currentRenderedAxis === 'y' && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin);\n return {};\n }\n }, hide, adaptiveOrigin);\n useIsoLayoutEffect(() => {\n // Ensure positioning doesn't run initially for `keepMounted` elements that\n // aren't initially open.\n if (!mounted && floatingRootContext) {\n floatingRootContext.update({\n referenceElement: null,\n floatingElement: null,\n domReferenceElement: null,\n positionReference: null\n });\n }\n }, [mounted, floatingRootContext]);\n const autoUpdateOptions = React.useMemo(() => ({\n elementResize: !disableAnchorTracking && typeof ResizeObserver !== 'undefined',\n layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== 'undefined'\n }), [disableAnchorTracking]);\n const {\n refs,\n elements,\n x,\n y,\n middlewareData,\n update,\n placement: renderedPlacement,\n context,\n isPositioned,\n floatingStyles: originalFloatingStyles\n } = useFloating({\n rootContext: floatingRootContext,\n open: keepMounted ? mounted : undefined,\n placement,\n middleware,\n strategy: positionMethod,\n whileElementsMounted: keepMounted ? undefined : (...args) => autoUpdate(...args, autoUpdateOptions),\n nodeId,\n externalTree\n });\n const {\n sideX,\n sideY\n } = middlewareData.adaptiveOrigin || DEFAULT_SIDES;\n\n // Default to `fixed` when not positioned to prevent `autoFocus` scroll jumps.\n // This ensures the popup is inside the viewport initially before it gets positioned.\n const resolvedPosition = isPositioned ? positionMethod : 'fixed';\n const floatingStyles = React.useMemo(() => {\n const base = adaptiveOrigin ? {\n position: resolvedPosition,\n [sideX]: x,\n [sideY]: y\n } : {\n position: resolvedPosition,\n ...originalFloatingStyles\n };\n if (!isPositioned) {\n base.opacity = 0;\n }\n return base;\n }, [adaptiveOrigin, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);\n const registeredPositionReferenceRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (!mounted) {\n return;\n }\n const anchorValue = anchorValueRef.current;\n const resolvedAnchor = typeof anchorValue === 'function' ? anchorValue() : anchorValue;\n const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;\n const finalAnchor = unwrappedElement || null;\n if (finalAnchor !== registeredPositionReferenceRef.current) {\n refs.setPositionReference(finalAnchor);\n registeredPositionReferenceRef.current = finalAnchor;\n }\n }, [mounted, refs, anchorDep, anchorValueRef]);\n React.useEffect(() => {\n if (!mounted) {\n return;\n }\n const anchorValue = anchorValueRef.current;\n\n // Refs from parent components are set after useLayoutEffect runs and are available in useEffect.\n // Therefore, if the anchor is a ref, we need to update the position reference in useEffect.\n if (typeof anchorValue === 'function') {\n return;\n }\n if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {\n refs.setPositionReference(anchorValue.current);\n registeredPositionReferenceRef.current = anchorValue.current;\n }\n }, [mounted, refs, anchorDep, anchorValueRef]);\n React.useEffect(() => {\n if (keepMounted && mounted && elements.domReference && elements.floating) {\n return autoUpdate(elements.domReference, elements.floating, update, autoUpdateOptions);\n }\n return undefined;\n }, [keepMounted, mounted, elements, update, autoUpdateOptions]);\n const renderedSide = getSide(renderedPlacement);\n const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);\n const renderedAlign = getAlignment(renderedPlacement) || 'center';\n const anchorHidden = Boolean(middlewareData.hide?.referenceHidden);\n\n /**\n * Locks the flip (makes it \"sticky\") so it doesn't prefer a given placement\n * and flips back lazily, not eagerly. Ideal for filtered lists that change\n * the size of the popup dynamically to avoid unwanted flipping when typing.\n */\n useIsoLayoutEffect(() => {\n if (lazyFlip && mounted && isPositioned) {\n setMountSide(renderedSide);\n }\n }, [lazyFlip, mounted, isPositioned, renderedSide]);\n const arrowStyles = React.useMemo(() => ({\n position: 'absolute',\n top: middlewareData.arrow?.y,\n left: middlewareData.arrow?.x\n }), [middlewareData.arrow]);\n const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;\n return React.useMemo(() => ({\n positionerStyles: floatingStyles,\n arrowStyles,\n arrowRef,\n arrowUncentered,\n side: logicalRenderedSide,\n align: renderedAlign,\n physicalSide: renderedSide,\n anchorHidden,\n refs,\n context,\n isPositioned,\n update\n }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update]);\n}\nfunction isRef(param) {\n return param != null && 'current' in param;\n}","import { DISABLED_TRANSITIONS_STYLE, EMPTY_OBJECT } from \"./constants.js\";\nexport function getDisabledMountTransitionStyles(transitionStatus) {\n return transitionStatus === 'starting' ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;\n}","'use client';\n\nimport { popupStateMapping } from \"./popupStateMapping.js\";\nimport { useRenderElement } from \"./useRenderElement.js\";\nimport { getDisabledMountTransitionStyles } from \"./getDisabledMountTransitionStyles.js\";\n/**\n * Renders the shared outer Positioner element used by popup components.\n * Applies the common role, hidden state, transition styles, state attributes, and optional inert styling.\n */\nexport function usePositioner(componentProps, state, {\n styles,\n transitionStatus,\n props,\n refs,\n hidden,\n inert = false\n}) {\n const style = {\n ...styles\n };\n if (inert) {\n style.pointerEvents = 'none';\n }\n return useRenderElement('div', componentProps, {\n state,\n ref: refs,\n props: [{\n role: 'presentation',\n hidden,\n style\n }, getDisabledMountTransitionStyles(transitionStatus), props],\n stateAttributesMapping: popupStateMapping\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useScrollLock } from '@base-ui/utils/useScrollLock';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\n\n// Touch-opened popups normally avoid scroll locking so users can still swipe outside to dismiss.\n// This hook re-enables scroll lock only when the popup is effectively full-width.\n// Treat popups with up to 20px of total horizontal gutter as full-width so common ~10px side\n// padding still locks scroll, since that leaves too little outside space for a reliable swipe.\nconst VIEWPORT_WIDTH_TOLERANCE_PX = 20;\n\n/**\n * Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when\n * enabled. For touch opens, scroll lock is applied only when the positioner width is effectively\n * viewport-sized.\n */\nexport function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {\n const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React.useState(false);\n useIsoLayoutEffect(() => {\n if (!enabled || !touchOpen || positionerElement == null) {\n setTouchOpenShouldLockScroll(false);\n return;\n }\n const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;\n const popupWidth = positionerElement.offsetWidth;\n setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);\n }, [enabled, touchOpen, positionerElement]);\n useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useComboboxFloatingContext, useComboboxRootContext, useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.js\";\nimport { ComboboxPositionerContext } from \"./ComboboxPositionerContext.js\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.js\";\nimport { useComboboxPortalContext } from \"../portal/ComboboxPortalContext.js\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../utils/constants.js\";\nimport { selectors } from \"../store.js\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.js\";\nimport { usePositioner } from \"../../utils/usePositioner.js\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.js\";\n\n/**\n * Positions the popup against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ComboboxPositioner = /*#__PURE__*/React.forwardRef(function ComboboxPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n positionMethod = 'absolute',\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style: styleProp,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const floatingRootContext = useComboboxFloatingContext();\n const keepMounted = useComboboxPortalContext();\n const modal = useStore(store, selectors.modal);\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const openMethod = useStore(store, selectors.openMethod);\n const positionerElement = useStore(store, selectors.positionerElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const inputElement = useStore(store, selectors.inputElement);\n const inputGroupElement = useStore(store, selectors.inputGroupElement);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const empty = filteredItems.length === 0;\n const resolvedAnchor = anchor ?? (inputInsidePopup ? triggerElement : inputGroupElement ?? inputElement);\n const positioning = useAnchorPositioning({\n anchor: resolvedAnchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n lazyFlip: true\n });\n useAnchoredPopupScrollLock(open && modal, openMethod === 'touch', positionerElement, triggerElement);\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n empty\n };\n useIsoLayoutEffect(() => {\n store.set('popupSide', positioning.side);\n }, [store, positioning.side]);\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n return /*#__PURE__*/_jsxs(ComboboxPositionerContext.Provider, {\n value: positioning,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: inputGroupElement ?? inputElement ?? triggerElement\n }), element]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPositioner.displayName = \"ComboboxPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingFocusManager } from \"../../floating-ui-react/index.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useComboboxFloatingContext, useComboboxRootContext, useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.js\";\nimport { selectors } from \"../store.js\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useComboboxPositionerContext } from \"../positioner/ComboboxPositionerContext.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { contains, getTarget } from \"../../floating-ui-react/utils.js\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.js\";\nimport { ComboboxInternalDismissButton } from \"../utils/ComboboxInternalDismissButton.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxPopup = /*#__PURE__*/React.forwardRef(function ComboboxPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n initialFocus,\n finalFocus,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const positioning = useComboboxPositionerContext();\n const floatingRootContext = useComboboxFloatingContext();\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const mounted = useStore(store, selectors.mounted);\n const open = useStore(store, selectors.open);\n const openMethod = useStore(store, selectors.openMethod);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const inputInsidePopup = useStore(store, selectors.inputInsidePopup);\n const inputElement = useStore(store, selectors.inputElement);\n const modal = useStore(store, selectors.modal);\n const empty = filteredItems.length === 0;\n useOpenChangeComplete({\n open,\n ref: store.state.popupRef,\n onComplete() {\n if (open) {\n store.state.onOpenChangeComplete(true);\n }\n }\n });\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n transitionStatus,\n empty\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.state.popupRef],\n props: [{\n role: inputInsidePopup ? 'dialog' : 'presentation',\n tabIndex: -1,\n onFocus(event) {\n const target = getTarget(event.nativeEvent);\n if (openMethod !== 'touch' && (contains(store.state.listElement, target) || target === event.currentTarget)) {\n store.state.inputRef.current?.focus();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n const computedDefaultInitialFocus = inputInsidePopup ? interactionType => interactionType === 'touch' ? store.state.popupRef.current : inputElement : false;\n const resolvedInitialFocus = initialFocus === undefined ? computedDefaultInitialFocus : initialFocus;\n let resolvedFinalFocus;\n if (finalFocus != null) {\n resolvedFinalFocus = finalFocus;\n } else {\n resolvedFinalFocus = inputInsidePopup ? undefined : false;\n }\n const focusManagerModal = !inputInsidePopup || modal;\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n disabled: !mounted,\n modal: focusManagerModal,\n openInteractionType: openMethod,\n initialFocus: resolvedInitialFocus,\n returnFocus: resolvedFinalFocus,\n getInsideElements: () => [store.state.startDismissRef.current, store.state.endDismissRef.current],\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [element, focusManagerModal && /*#__PURE__*/_jsx(ComboboxInternalDismissButton, {\n ref: store.state.endDismissRef\n })]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxPopup.displayName = \"ComboboxPopup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxGroupContext.displayName = \"ComboboxGroupContext\";\nexport function useComboboxGroupContext() {\n const context = React.useContext(ComboboxGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxGroupContext is missing. ComboboxGroup parts must be placed within <Combobox.Group>.' : _formatErrorMessage(18));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { ComboboxGroupContext } from \"./ComboboxGroupContext.js\";\nimport { GroupCollectionProvider } from \"../collection/GroupCollectionContext.js\";\n\n/**\n * Groups related items with the corresponding label.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxGroup = /*#__PURE__*/React.forwardRef(function ComboboxGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n items,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState();\n const contextValue = React.useMemo(() => ({\n labelId,\n setLabelId,\n items\n }), [labelId, setLabelId, items]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n role: 'group',\n 'aria-labelledby': labelId\n }, elementProps]\n });\n const wrappedElement = /*#__PURE__*/_jsx(ComboboxGroupContext.Provider, {\n value: contextValue,\n children: element\n });\n if (items) {\n return /*#__PURE__*/_jsx(GroupCollectionProvider, {\n items: items,\n children: wrappedElement\n });\n }\n return wrappedElement;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxGroup.displayName = \"ComboboxGroup\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useComboboxGroupContext } from \"../group/ComboboxGroupContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxGroupLabel = /*#__PURE__*/React.forwardRef(function ComboboxGroupLabel(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n ...elementProps\n } = componentProps;\n const {\n setLabelId\n } = useComboboxGroupContext();\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(undefined);\n };\n }, [id, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxGroupLabel.displayName = \"ComboboxGroupLabel\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxItemContext.displayName = \"ComboboxItemContext\";\nexport function useComboboxItemContext() {\n const context = React.useContext(ComboboxItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.' : _formatErrorMessage(19));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nexport const ComboboxRowContext = /*#__PURE__*/React.createContext(false);\nif (process.env.NODE_ENV !== \"production\") ComboboxRowContext.displayName = \"ComboboxRowContext\";\nexport function useComboboxRowContext() {\n return React.useContext(ComboboxRowContext);\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useComboboxRootContext, useComboboxDerivedItemsContext } from \"../root/ComboboxRootContext.js\";\nimport { useCompositeListItem, IndexGuessBehavior } from \"../../composite/list/useCompositeListItem.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { ComboboxItemContext } from \"./ComboboxItemContext.js\";\nimport { selectors } from \"../store.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { useComboboxRowContext } from \"../row/ComboboxRowContext.js\";\nimport { compareItemEquality, findItemIndex } from \"../../utils/itemEquality.js\";\n\n/**\n * An individual item in the list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function ComboboxItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n value: itemValue = null,\n index: indexProp,\n disabled = false,\n nativeButton = false,\n style,\n ...elementProps\n } = componentProps;\n const didPointerDownRef = React.useRef(false);\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n index: indexProp,\n textRef,\n indexGuessBehavior: IndexGuessBehavior.GuessFromOrder\n });\n const store = useComboboxRootContext();\n const isRow = useComboboxRowContext();\n const {\n flatFilteredItems,\n hasItems\n } = useComboboxDerivedItemsContext();\n const open = useStore(store, selectors.open);\n const selectionMode = useStore(store, selectors.selectionMode);\n const readOnly = useStore(store, selectors.readOnly);\n const virtualized = useStore(store, selectors.virtualized);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const selectable = selectionMode !== 'none';\n const index = indexProp ?? (virtualized ? findItemIndex(flatFilteredItems, itemValue, isItemEqualToValue) : listItem.index);\n const hasRegistered = listItem.index !== -1;\n const rootId = useStore(store, selectors.id);\n const highlighted = useStore(store, selectors.isActive, index);\n const matchesSelectedValue = useStore(store, selectors.isSelected, itemValue);\n const getItemProps = useStore(store, selectors.getItemProps);\n const itemRef = React.useRef(null);\n const id = rootId != null && hasRegistered ? `${rootId}-${index}` : undefined;\n const selected = matchesSelectedValue && selectable;\n useIsoLayoutEffect(() => {\n const shouldRun = hasRegistered && (virtualized || indexProp != null);\n if (!shouldRun) {\n return undefined;\n }\n const list = store.state.listRef.current;\n list[index] = itemRef.current;\n return () => {\n delete list[index];\n };\n }, [hasRegistered, virtualized, index, indexProp, store]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered || hasItems) {\n return undefined;\n }\n const visibleMap = store.state.valuesRef.current;\n visibleMap[index] = itemValue;\n\n // Stable registry that doesn't depend on filtering. Assume that no\n // filtering had occurred at this point; otherwise, an `items` prop is\n // required.\n if (selectionMode !== 'none') {\n store.state.allValuesRef.current.push(itemValue);\n }\n return () => {\n delete visibleMap[index];\n };\n }, [hasRegistered, hasItems, index, itemValue, store, selectionMode]);\n useIsoLayoutEffect(() => {\n if (!open) {\n didPointerDownRef.current = false;\n return;\n }\n if (!hasRegistered || hasItems) {\n return;\n }\n const selectedValue = store.state.selectedValue;\n const lastSelectedValue = Array.isArray(selectedValue) ? selectedValue[selectedValue.length - 1] : selectedValue;\n if (compareItemEquality(itemValue, lastSelectedValue, isItemEqualToValue)) {\n store.set('selectedIndex', index);\n }\n }, [hasRegistered, hasItems, open, store, index, itemValue, isItemEqualToValue]);\n const state = {\n disabled,\n selected,\n highlighted\n };\n const rootProps = getItemProps({\n active: highlighted,\n selected\n });\n rootProps.id = undefined;\n rootProps.onFocus = undefined;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n function commitSelection(nativeEvent) {\n function selectItem() {\n store.state.handleSelection(nativeEvent, itemValue);\n }\n if (store.state.submitOnItemClick) {\n ReactDOM.flushSync(selectItem);\n store.state.requestSubmit();\n } else {\n selectItem();\n }\n }\n const defaultProps = {\n id,\n role: isRow ? 'gridcell' : 'option',\n 'aria-selected': selectable ? selected : undefined,\n // Focusable items steal focus from the input upon mouseup.\n // Warn if the user renders a natively focusable element like `<button>`,\n // as it should be a `<div>` instead.\n tabIndex: undefined,\n onPointerDownCapture(event) {\n didPointerDownRef.current = true;\n event.preventDefault();\n },\n onMouseDown(event) {\n // iOS Safari can emit a synthetic mousedown for touch taps without a preceding\n // pointerdown. Prevent default here too so tapping an item does not blur the input.\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n commitSelection(event.nativeEvent);\n },\n onMouseUp(event) {\n const pointerStartedOnItem = didPointerDownRef.current;\n didPointerDownRef.current = false;\n if (disabled || readOnly || event.button !== 0 || pointerStartedOnItem || !highlighted) {\n return;\n }\n commitSelection(event.nativeEvent);\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [rootProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n textRef\n }), [selected, textRef]);\n return /*#__PURE__*/_jsx(ComboboxItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") ComboboxItem.displayName = \"ComboboxItem\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useComboboxDerivedItemsContext, useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { useInitialLiveRegionTextMutation } from \"../utils/useInitialLiveRegionTextMutation.js\";\n\n/**\n * Renders its children only when the list is empty.\n * Requires the `items` prop on the root component.\n * Announces changes politely to screen readers.\n * This component's root element must remain mounted in the DOM to announce\n * changes consistently across screen readers. Avoid hiding or removing the\n * component itself with `display: none`, `hidden`, `aria-hidden`, or conditional\n * rendering. Prefer updating or conditionally rendering its children instead.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxEmpty = /*#__PURE__*/React.forwardRef(function ComboboxEmpty(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n filteredItems\n } = useComboboxDerivedItemsContext();\n const store = useComboboxRootContext();\n const emptyRef = useInitialLiveRegionTextMutation();\n const children = filteredItems.length === 0 ? childrenProp : null;\n return useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.state.emptyRef, emptyRef],\n props: [{\n children,\n role: 'status',\n 'aria-live': 'polite',\n 'aria-atomic': true\n }, elementProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxEmpty.displayName = \"ComboboxEmpty\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../utils/useRenderElement.js\";\n\n/**\n * A separator element accessible to screen readers.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Separator](https://base-ui.com/react/components/separator)\n */\nexport const Separator = /*#__PURE__*/React.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {\n const {\n className,\n render,\n orientation = 'horizontal',\n style,\n ...elementProps\n } = componentProps;\n const state = {\n orientation\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'separator',\n 'aria-orientation': orientation\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") Separator.displayName = \"Separator\";","'use client';\n\nimport * as React from 'react';\nimport { useButton } from \"../use-button/useButton.js\";\nimport { useRenderElement } from \"../utils/useRenderElement.js\";\n/**\n * A button component that can be used to trigger actions.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Button](https://base-ui.com/react/components/button)\n */\nexport const Button = /*#__PURE__*/React.forwardRef(function Button(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n focusableWhenDisabled = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled,\n native: nativeButton\n });\n const state = {\n disabled\n };\n return useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef],\n props: [elementProps, getButtonProps]\n });\n});\nif (process.env.NODE_ENV !== \"production\") Button.displayName = \"Button\";","export let CheckboxRootDataAttributes = /*#__PURE__*/function (CheckboxRootDataAttributes) {\n /**\n * Present when the checkbox is checked.\n */\n CheckboxRootDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the checkbox is not checked.\n */\n CheckboxRootDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the checkbox is in an indeterminate state.\n */\n CheckboxRootDataAttributes[\"indeterminate\"] = \"data-indeterminate\";\n /**\n * Present when the checkbox is disabled.\n */\n CheckboxRootDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the checkbox is readonly.\n */\n CheckboxRootDataAttributes[\"readonly\"] = \"data-readonly\";\n /**\n * Present when the checkbox is required.\n */\n CheckboxRootDataAttributes[\"required\"] = \"data-required\";\n /**\n * Present when the checkbox is in valid state (when wrapped in Field.Root).\n */\n CheckboxRootDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the checkbox is in invalid state (when wrapped in Field.Root).\n */\n CheckboxRootDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the checkbox has been touched (when wrapped in Field.Root).\n */\n CheckboxRootDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the checkbox's value has changed (when wrapped in Field.Root).\n */\n CheckboxRootDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the checkbox is checked (when wrapped in Field.Root).\n */\n CheckboxRootDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the checkbox is focused (when wrapped in Field.Root).\n */\n CheckboxRootDataAttributes[\"focused\"] = \"data-focused\";\n return CheckboxRootDataAttributes;\n}({});","'use client';\n\nimport * as React from 'react';\nimport { CheckboxRootDataAttributes } from \"../root/CheckboxRootDataAttributes.js\";\nimport { fieldValidityMapping } from \"../../field/utils/constants.js\";\nexport function useStateAttributesMapping(state) {\n return React.useMemo(() => ({\n checked(value) {\n if (state.indeterminate) {\n // `data-indeterminate` is already handled by the `indeterminate` prop.\n return {};\n }\n if (value) {\n return {\n [CheckboxRootDataAttributes.checked]: ''\n };\n }\n return {\n [CheckboxRootDataAttributes.unchecked]: ''\n };\n },\n ...fieldValidityMapping\n }), [state.indeterminate]);\n}","'use client';\n\nimport * as React from 'react';\nexport const FieldItemContext = /*#__PURE__*/React.createContext({\n disabled: false\n});\nif (process.env.NODE_ENV !== \"production\") FieldItemContext.displayName = \"FieldItemContext\";\nexport function useFieldItemContext() {\n const context = React.useContext(FieldItemContext);\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../utils/useBaseUiId.js\";\n\n/**\n * @internal\n */\nexport function useAriaLabelledBy(explicitAriaLabelledBy, labelId, labelSourceRef, enableFallback = true, labelSourceId) {\n const [fallbackAriaLabelledBy, setFallbackAriaLabelledBy] = React.useState();\n const generatedLabelId = useBaseUiId(labelSourceId ? `${labelSourceId}-label` : undefined);\n const ariaLabelledBy = explicitAriaLabelledBy ?? labelId ?? fallbackAriaLabelledBy;\n\n // Fallback for <span> controls labelled by wrapping/sibling native <label>.\n // Run after every commit so DOM association changes (e.g. label mount/unmount)\n // are reflected even when props/state deps are unchanged.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(() => {\n const nextAriaLabelledBy = explicitAriaLabelledBy || labelId || !enableFallback ? undefined : getAriaLabelledBy(labelSourceRef.current, generatedLabelId);\n if (fallbackAriaLabelledBy !== nextAriaLabelledBy) {\n setFallbackAriaLabelledBy(nextAriaLabelledBy);\n }\n });\n return ariaLabelledBy;\n}\nfunction getAriaLabelledBy(labelSource, generatedLabelId) {\n const label = findAssociatedLabel(labelSource);\n if (!label) {\n return undefined;\n }\n if (!label.id && generatedLabelId) {\n label.id = generatedLabelId;\n }\n return label.id || undefined;\n}\nfunction findAssociatedLabel(labelSource) {\n if (!labelSource) {\n return undefined;\n }\n\n // Fast path before the expensive `.labels` read.\n const parent = labelSource.parentElement;\n if (parent && parent.tagName === 'LABEL') {\n return parent;\n }\n const controlId = labelSource.id;\n if (controlId) {\n const nextSibling = labelSource.nextElementSibling;\n if (nextSibling && nextSibling.htmlFor === controlId) {\n return nextSibling;\n }\n }\n const labels = labelSource.labels;\n return labels && labels[0];\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CheckboxGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CheckboxGroupContext.displayName = \"CheckboxGroupContext\";\nexport function useCheckboxGroupContext(optional = true) {\n const context = React.useContext(CheckboxGroupContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.' : _formatErrorMessage(3));\n }\n return context;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const CheckboxRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CheckboxRootContext.displayName = \"CheckboxRootContext\";\nexport function useCheckboxRootContext() {\n const context = React.useContext(CheckboxRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.' : _formatErrorMessage(14));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { NOOP } from \"../../utils/noop.js\";\nimport { useStateAttributesMapping } from \"../utils/useStateAttributesMapping.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { useButton } from \"../../use-button/useButton.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../../field/root/useRegisterFieldControl.js\";\nimport { useFieldItemContext } from \"../../field/item/FieldItemContext.js\";\nimport { useFormContext } from \"../../form/FormContext.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { useAriaLabelledBy } from \"../../labelable-provider/useAriaLabelledBy.js\";\nimport { useCheckboxGroupContext } from \"../../checkbox-group/CheckboxGroupContext.js\";\nimport { CheckboxRootContext } from \"./CheckboxRootContext.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useValueChanged } from \"../../utils/useValueChanged.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PARENT_CHECKBOX = 'data-parent';\n\n/**\n * Represents the checkbox itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)\n */\nexport const CheckboxRoot = /*#__PURE__*/React.forwardRef(function CheckboxRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked = false,\n 'aria-labelledby': ariaLabelledByProp,\n disabled: disabledProp = false,\n form,\n id: idProp,\n indeterminate = false,\n inputRef: inputRefProp,\n name: nameProp,\n onCheckedChange: onCheckedChangeProp,\n parent = false,\n readOnly = false,\n render,\n required = false,\n uncheckedValue,\n value: valueProp,\n nativeButton = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n disabled: rootDisabled,\n name: fieldName,\n setDirty,\n setFilled,\n setFocused,\n setTouched,\n state: fieldState,\n validationMode,\n validityData,\n shouldValidateOnChange,\n validation: localValidation\n } = useFieldRootContext();\n const fieldItemContext = useFieldItemContext();\n const {\n labelId,\n controlId,\n registerControlId,\n getDescriptionProps\n } = useLabelableContext();\n const groupContext = useCheckboxGroupContext();\n const parentContext = groupContext?.parent;\n const isGroupedWithParent = parentContext && groupContext.allValues;\n const disabled = rootDisabled || fieldItemContext.disabled || groupContext?.disabled || disabledProp;\n const name = fieldName ?? nameProp;\n const value = valueProp ?? name;\n const id = useBaseUiId();\n const parentId = useBaseUiId();\n let inputId = controlId;\n if (isGroupedWithParent) {\n inputId = parent ? parentId : `${parentContext.id}-${value}`;\n } else if (idProp) {\n inputId = idProp;\n }\n let groupProps = {};\n if (isGroupedWithParent) {\n if (parent) {\n groupProps = groupContext.parent.getParentProps();\n } else if (value) {\n groupProps = groupContext.parent.getChildProps(value);\n }\n }\n const onCheckedChange = useStableCallback(onCheckedChangeProp);\n const {\n checked: groupChecked = checkedProp,\n indeterminate: groupIndeterminate = indeterminate,\n onCheckedChange: groupOnChange,\n ...otherGroupProps\n } = groupProps;\n const groupValue = groupContext?.value;\n const setGroupValue = groupContext?.setValue;\n const defaultGroupValue = groupContext?.defaultValue;\n const controlRef = React.useRef(null);\n const controlSourceRef = useRefWithInit(() => Symbol('checkbox-control'));\n const hasRegisteredRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const validation = groupContext?.validation ?? localValidation;\n const [checked, setCheckedState] = useControlled({\n controlled: value && groupValue && !parent ? groupValue.includes(value) : groupChecked,\n default: value && defaultGroupValue && !parent ? defaultGroupValue.includes(value) : defaultChecked,\n name: 'Checkbox',\n state: 'checked'\n });\n\n // can't use useLabelableId because of optional groupContext and/or parent\n useIsoLayoutEffect(() => {\n if (registerControlId === NOOP) {\n return undefined;\n }\n hasRegisteredRef.current = true;\n registerControlId(controlSourceRef.current, inputId);\n return undefined;\n }, [inputId, groupContext, registerControlId, parent, controlSourceRef]);\n React.useEffect(() => {\n const controlSource = controlSourceRef.current;\n return () => {\n if (!hasRegisteredRef.current || registerControlId === NOOP) {\n return;\n }\n hasRegisteredRef.current = false;\n registerControlId(controlSource, undefined);\n };\n }, [registerControlId, controlSourceRef]);\n useRegisterFieldControl(controlRef, {\n enabled: !groupContext,\n id,\n value: checked\n });\n const inputRef = React.useRef(null);\n const mergedInputRef = useMergedRefs(inputRefProp, inputRef, validation.inputRef);\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, inputId ?? undefined);\n useIsoLayoutEffect(() => {\n if (inputRef.current) {\n inputRef.current.indeterminate = groupIndeterminate;\n if (checked) {\n setFilled(true);\n }\n }\n }, [checked, groupIndeterminate, setFilled]);\n useValueChanged(checked, () => {\n if (groupContext && !parent) {\n return;\n }\n clearErrors(name);\n setFilled(checked);\n setDirty(checked !== validityData.initialValue);\n if (shouldValidateOnChange()) {\n validation.commit(checked);\n } else {\n validation.commit(checked, true);\n }\n });\n const inputProps = mergeProps({\n checked,\n disabled,\n form,\n // parent checkboxes unset `name` to be excluded from form submission\n name: parent ? undefined : name,\n // Set `id` to stop Chrome warning about an unassociated input.\n // When using a native button, the `id` is applied to the button instead.\n id: nativeButton ? undefined : inputId ?? undefined,\n required,\n ref: mergedInputRef,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n groupOnChange?.(nextChecked, details);\n onCheckedChange(nextChecked, details);\n if (details.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n if (value && groupValue && setGroupValue && !parent && !isGroupedWithParent) {\n const nextGroupValue = nextChecked ? [...groupValue, value] : groupValue.filter(item => item !== value);\n setGroupValue(nextGroupValue, details);\n }\n },\n onFocus() {\n controlRef.current?.focus();\n }\n },\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n valueProp !== undefined ? {\n value: (groupContext ? checked && valueProp : valueProp) || ''\n } : EMPTY_OBJECT, getDescriptionProps, groupContext ? validation.getValidationProps : validation.getInputValidationProps);\n const computedChecked = isGroupedWithParent ? Boolean(groupChecked) : checked;\n const computedIndeterminate = isGroupedWithParent ? groupIndeterminate || indeterminate : indeterminate;\n React.useEffect(() => {\n if (!parentContext || !value) {\n return undefined;\n }\n const disabledStates = parentContext.disabledStatesRef.current;\n disabledStates.set(value, disabled);\n return () => {\n disabledStates.delete(value);\n };\n }, [parentContext, disabled, value]);\n const state = React.useMemo(() => ({\n ...fieldState,\n checked: computedChecked,\n disabled,\n readOnly,\n required,\n indeterminate: computedIndeterminate\n }), [fieldState, computedChecked, disabled, readOnly, required, computedIndeterminate]);\n const stateAttributesMapping = useStateAttributesMapping(state);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [buttonRef, controlRef, forwardedRef, groupContext?.registerControlRef],\n props: [{\n id: nativeButton ? inputId ?? undefined : id,\n role: 'checkbox',\n 'aria-checked': groupIndeterminate ? 'mixed' : checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n [PARENT_CHECKBOX]: parent ? '' : undefined,\n onFocus() {\n setFocused(true);\n },\n onBlur() {\n const inputEl = inputRef.current;\n if (!inputEl) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(groupContext ? groupValue : inputEl.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n inputRef.current?.dispatchEvent(new PointerEvent('click', {\n bubbles: true,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n }));\n }\n }, getDescriptionProps, validation.getValidationProps, elementProps, otherGroupProps, getButtonProps],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(CheckboxRootContext.Provider, {\n value: state,\n children: [element, !checked && !groupContext && name && !parent && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") CheckboxRoot.displayName = \"CheckboxRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useCheckboxRootContext } from \"../root/CheckboxRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useStateAttributesMapping } from \"../utils/useStateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { fieldValidityMapping } from \"../../field/utils/constants.js\";\n\n/**\n * Indicates whether the checkbox is ticked.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)\n */\nexport const CheckboxIndicator = /*#__PURE__*/React.forwardRef(function CheckboxIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const rootState = useCheckboxRootContext();\n const rendered = rootState.checked || rootState.indeterminate;\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(rendered);\n const indicatorRef = React.useRef(null);\n const state = {\n ...rootState,\n transitionStatus\n };\n useOpenChangeComplete({\n open: rendered,\n ref: indicatorRef,\n onComplete() {\n if (!rendered) {\n setMounted(false);\n }\n }\n });\n const baseStateAttributesMapping = useStateAttributesMapping(rootState);\n const stateAttributesMapping = React.useMemo(() => ({\n ...baseStateAttributesMapping,\n ...transitionStatusMapping,\n ...fieldValidityMapping\n }), [baseStateAttributesMapping]);\n const shouldRender = keepMounted || mounted;\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n stateAttributesMapping,\n props: elementProps\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") CheckboxIndicator.displayName = \"CheckboxIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { AriaCombobox } from \"./AriaCombobox.js\";\n\n/**\n * Groups all parts of the combobox.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function ComboboxRoot(props) {\n const {\n multiple = false,\n defaultValue,\n value,\n onValueChange,\n autoComplete,\n ...other\n } = props;\n return /*#__PURE__*/_jsx(AriaCombobox, {\n ...other,\n selectionMode: multiple ? 'multiple' : 'single',\n selectedValue: value,\n defaultSelectedValue: defaultValue,\n onSelectedValueChange: onValueChange,\n formAutoComplete: autoComplete\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { useComboboxItemContext } from \"../item/ComboboxItemContext.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\n\n/**\n * Indicates whether the item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxItemIndicator = /*#__PURE__*/React.forwardRef(function ComboboxItemIndicator(componentProps, forwardedRef) {\n const keepMounted = componentProps.keepMounted ?? false;\n const {\n selected\n } = useComboboxItemContext();\n const shouldRender = keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return /*#__PURE__*/_jsx(Inner, {\n ...componentProps,\n ref: forwardedRef\n });\n});\n\n/** The core implementation of the indicator is split here to avoid paying the hooks\n * costs unless the element needs to be mounted. */\nif (process.env.NODE_ENV !== \"production\") ComboboxItemIndicator.displayName = \"ComboboxItemIndicator\";\nconst Inner = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((componentProps, forwardedRef) => {\n const {\n render,\n className,\n style,\n keepMounted,\n ...elementProps\n } = componentProps;\n const {\n selected\n } = useComboboxItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") Inner.displayName = \"Inner\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { ComboboxChipsContext } from \"./ComboboxChipsContext.js\";\nimport { CompositeList } from \"../../composite/list/CompositeList.js\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { selectors } from \"../store.js\";\nimport { EMPTY_OBJECT } from \"../../utils/constants.js\";\nimport { handleInputPress } from \"../utils/handleInputPress.js\";\n\n/**\n * A container for the chips in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChips = /*#__PURE__*/React.forwardRef(function ComboboxChips(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const open = useStore(store, selectors.open);\n const hasSelectionChips = useStore(store, selectors.hasSelectionChips);\n const [highlightedChipIndex, setHighlightedChipIndex] = React.useState(undefined);\n if (open && highlightedChipIndex !== undefined) {\n setHighlightedChipIndex(undefined);\n }\n const chipsRef = React.useRef([]);\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.state.chipsContainerRef],\n // NVDA enters browse mode instead of staying in focus mode when navigating with\n // arrow keys inside a container unless it has a toolbar role.\n props: [hasSelectionChips ? {\n role: 'toolbar'\n } : EMPTY_OBJECT, {\n onMouseDown(event) {\n handleInputPress(event, store, store.state.disabled, store.state.readOnly);\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n highlightedChipIndex,\n setHighlightedChipIndex,\n chipsRef\n }), [highlightedChipIndex, setHighlightedChipIndex, chipsRef]);\n return /*#__PURE__*/_jsx(ComboboxChipsContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: chipsRef,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChips.displayName = \"ComboboxChips\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ComboboxChipContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ComboboxChipContext.displayName = \"ComboboxChipContext\";\nexport function useComboboxChipContext() {\n const context = React.useContext(ComboboxChipContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'useComboboxChipContext must be used within a ComboboxChip' : _formatErrorMessage(17));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useComboboxChipsContext } from \"../chips/ComboboxChipsContext.js\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { useCompositeListItem } from \"../../composite/list/useCompositeListItem.js\";\nimport { ComboboxChipContext } from \"./ComboboxChipContext.js\";\nimport { stopEvent } from \"../../floating-ui-react/utils.js\";\nimport { selectors } from \"../store.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\n\n/**\n * An individual chip that represents a value in a multiselectable input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ComboboxChip = /*#__PURE__*/React.forwardRef(function ComboboxChip(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n setHighlightedChipIndex,\n chipsRef\n } = useComboboxChipsContext();\n const disabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const selectedValue = useStore(store, selectors.selectedValue);\n const {\n ref,\n index\n } = useCompositeListItem();\n function handleKeyDown(event) {\n let nextIndex = index;\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (index > 0) {\n nextIndex = index - 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (index < chipsRef.current.length - 1) {\n nextIndex = index + 1;\n } else {\n nextIndex = undefined;\n }\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const computedNextIndex = index >= selectedValue.length - 1 ? selectedValue.length - 2 : index;\n nextIndex = computedNextIndex >= 0 ? computedNextIndex : undefined;\n stopEvent(event);\n store.state.setIndices({\n activeIndex: null,\n selectedIndex: null,\n type: 'keyboard'\n });\n store.state.setSelectedValue(selectedValue.filter((_, i) => i !== index), createChangeEventDetails(REASONS.none, event.nativeEvent));\n } else if (event.key === 'Enter' || event.key === ' ') {\n stopEvent(event);\n nextIndex = undefined;\n } else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n stopEvent(event);\n store.state.setOpen(true, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));\n nextIndex = undefined;\n } else if (\n // Check for printable characters (letters, numbers, symbols)\n event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n nextIndex = undefined;\n }\n return nextIndex;\n }\n const state = {\n disabled\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, ref],\n state,\n props: [{\n tabIndex: -1,\n 'aria-disabled': disabled || undefined,\n 'aria-readonly': readOnly || undefined,\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n const nextIndex = handleKeyDown(event);\n ReactDOM.flushSync(() => {\n setHighlightedChipIndex(nextIndex);\n });\n if (nextIndex === undefined) {\n store.state.inputRef.current?.focus();\n } else {\n chipsRef.current[nextIndex]?.focus();\n }\n }\n }, elementProps]\n });\n const contextValue = React.useMemo(() => ({\n index\n }), [index]);\n return /*#__PURE__*/_jsx(ComboboxChipContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChip.displayName = \"ComboboxChip\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useComboboxRootContext } from \"../root/ComboboxRootContext.js\";\nimport { useComboboxChipContext } from \"../chip/ComboboxChipContext.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { stopEvent } from \"../../floating-ui-react/utils.js\";\nimport { selectors } from \"../store.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { findItemIndex } from \"../../utils/itemEquality.js\";\n\n/**\n * A button to remove a chip.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Combobox](https://base-ui.com/react/components/combobox)\n */\nexport const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function ComboboxChipRemove(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const store = useComboboxRootContext();\n const {\n index\n } = useComboboxChipContext();\n const comboboxDisabled = useStore(store, selectors.disabled);\n const readOnly = useStore(store, selectors.readOnly);\n const selectedValue = useStore(store, selectors.selectedValue);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const disabled = comboboxDisabled || disabledProp;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n native: nativeButton,\n disabled: disabled || readOnly,\n focusableWhenDisabled: true\n });\n const state = {\n disabled\n };\n function clearActiveIndexForRemovedItem(removedItem) {\n const activeIndex = store.state.activeIndex;\n if (activeIndex == null) {\n return;\n }\n\n // Try current visible list first; if not found, it's filtered out.\n // No need to clear highlight in that case since it can't equal activeIndex.\n const removedIndex = findItemIndex(store.state.valuesRef.current, removedItem, isItemEqualToValue);\n if (removedIndex !== -1 && activeIndex === removedIndex) {\n store.state.setIndices({\n activeIndex: null,\n type: store.state.keyboardActiveRef.current ? 'keyboard' : 'pointer'\n });\n }\n }\n function removeChip(event) {\n const eventDetails = createChangeEventDetails(REASONS.chipRemovePress, event.nativeEvent);\n const removedItem = selectedValue[index];\n clearActiveIndexForRemovedItem(removedItem);\n store.state.setSelectedValue(selectedValue.filter((_, i) => i !== index), eventDetails);\n store.state.inputRef.current?.focus();\n return eventDetails;\n }\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n tabIndex: -1,\n onMouseDown(event) {\n event.preventDefault();\n },\n onClick(event) {\n if (disabled || readOnly) {\n return;\n }\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n },\n onKeyDown(event) {\n if (disabled || readOnly) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n const eventDetails = removeChip(event);\n if (!eventDetails.isPropagationAllowed) {\n stopEvent(event);\n }\n }\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ComboboxChipRemove.displayName = \"ComboboxChipRemove\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ContextMenuRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ContextMenuRootContext.displayName = \"ContextMenuRootContext\";\nexport function useContextMenuRootContext(optional = true) {\n const context = React.useContext(ContextMenuRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ContextMenuRootContext is missing. ContextMenu parts must be placed within <ContextMenu.Root>.' : _formatErrorMessage(25));\n }\n return context;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuPositionerContext.displayName = \"MenuPositionerContext\";\nexport function useMenuPositionerContext(optional) {\n const context = React.useContext(MenuPositionerContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuPositionerContext is missing. MenuPositioner parts must be placed within <Menu.Positioner>.' : _formatErrorMessage(33));\n }\n return context;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuRootContext.displayName = \"MenuRootContext\";\nexport function useMenuRootContext(optional) {\n const context = React.useContext(MenuRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>.' : _formatErrorMessage(36));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.js\";\n\n/**\n * Displays an element positioned against the menu anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuArrow = /*#__PURE__*/React.forwardRef(function MenuArrow(componentProps, forwardedRef) {\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = useMenuPositionerContext();\n const open = store.useState('open');\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered\n };\n return useRenderElement('div', componentProps, {\n ref: [arrowRef, forwardedRef],\n stateAttributesMapping: popupStateMapping,\n state,\n props: {\n style: arrowStyles,\n 'aria-hidden': true,\n ...elementProps\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuArrow.displayName = \"MenuArrow\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuCheckboxItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuCheckboxItemContext.displayName = \"MenuCheckboxItemContext\";\nexport function useMenuCheckboxItemContext() {\n const context = React.useContext(MenuCheckboxItemContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuCheckboxItemContext is missing. MenuCheckboxItem parts must be placed within <Menu.CheckboxItem>.' : _formatErrorMessage(30));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { isMac } from '@base-ui/utils/detectBrowser';\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.js\";\n/**\n * Returns common props shared by all menu item types.\n * This hook extracts the shared logic for id, role, tabIndex, onKeyDown,\n * onMouseMove, onClick, and onMouseUp handlers.\n */\nexport function useMenuItemCommonProps(params) {\n const {\n closeOnClick,\n highlighted,\n id,\n nodeId,\n store,\n typingRef,\n itemRef,\n itemMetadata\n } = params;\n const {\n events: menuEvents\n } = store.useState('floatingTreeRoot');\n const contextMenuContext = useContextMenuRootContext(true);\n const isContextMenu = contextMenuContext !== undefined;\n return React.useMemo(() => ({\n id,\n role: 'menuitem',\n tabIndex: highlighted ? 0 : -1,\n onKeyDown(event) {\n if (event.key === ' ' && typingRef?.current) {\n event.preventDefault();\n }\n },\n onMouseMove(event) {\n if (!nodeId) {\n return;\n }\n\n // Inform the floating tree that a menu item within this menu was hovered/moved over\n // so unrelated descendant submenus can be closed.\n menuEvents.emit('itemhover', {\n nodeId,\n target: event.currentTarget\n });\n },\n onClick(event) {\n if (closeOnClick) {\n menuEvents.emit('close', {\n domEvent: event,\n reason: REASONS.itemPress\n });\n }\n },\n onMouseUp(event) {\n if (contextMenuContext) {\n const initialCursorPoint = contextMenuContext.initialCursorPointRef.current;\n contextMenuContext.initialCursorPointRef.current = null;\n if (isContextMenu && initialCursorPoint && Math.abs(event.clientX - initialCursorPoint.x) <= 1 && Math.abs(event.clientY - initialCursorPoint.y) <= 1) {\n return;\n }\n\n // On non-macOS platforms, this mouseup belongs to the right-click gesture\n // that opened the context menu, so it must not activate an item.\n if (isContextMenu && !isMac && event.button === 2) {\n return;\n }\n }\n if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {\n // This fires whenever the user clicks on the trigger, moves the cursor, and releases it over the item.\n // We trigger the click and override the `closeOnClick` preference to always close the menu.\n if (!itemMetadata || itemMetadata.type === 'regular-item') {\n itemRef.current.click();\n }\n }\n }\n }), [closeOnClick, highlighted, id, menuEvents, nodeId, store, typingRef, itemRef, contextMenuContext, isContextMenu, itemMetadata]);\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useButton } from \"../../use-button/index.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { useMenuItemCommonProps } from \"./useMenuItemCommonProps.js\";\nexport const REGULAR_ITEM = {\n type: 'regular-item'\n};\nexport function useMenuItem(params) {\n const {\n closeOnClick,\n disabled = false,\n highlighted,\n id,\n store,\n typingRef = store.context.typingRef,\n nativeButton,\n itemMetadata,\n nodeId\n } = params;\n const itemRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n const commonProps = useMenuItemCommonProps({\n closeOnClick,\n highlighted,\n id,\n nodeId,\n store,\n typingRef,\n itemRef,\n itemMetadata\n });\n const getItemProps = React.useCallback(externalProps => {\n return mergeProps(commonProps, {\n onMouseEnter() {\n if (itemMetadata.type !== 'submenu-trigger') {\n return;\n }\n itemMetadata.setActive();\n }\n }, externalProps, getButtonProps);\n }, [commonProps, getButtonProps, itemMetadata]);\n const mergedRef = useMergedRefs(itemRef, buttonRef);\n return React.useMemo(() => ({\n getItemProps,\n itemRef: mergedRef\n }), [getItemProps, mergedRef]);\n}","export let MenuCheckboxItemDataAttributes = /*#__PURE__*/function (MenuCheckboxItemDataAttributes) {\n /**\n * Present when the menu checkbox item is checked.\n */\n MenuCheckboxItemDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the menu checkbox item is not checked.\n */\n MenuCheckboxItemDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the menu checkbox item is disabled.\n */\n MenuCheckboxItemDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the menu checkbox item is highlighted.\n */\n MenuCheckboxItemDataAttributes[\"highlighted\"] = \"data-highlighted\";\n return MenuCheckboxItemDataAttributes;\n}({});","import { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { MenuCheckboxItemDataAttributes } from \"../checkbox-item/MenuCheckboxItemDataAttributes.js\";\nexport const itemMapping = {\n checked(value) {\n if (value) {\n return {\n [MenuCheckboxItemDataAttributes.checked]: ''\n };\n }\n return {\n [MenuCheckboxItemDataAttributes.unchecked]: ''\n };\n },\n ...transitionStatusMapping\n};","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { MenuCheckboxItemContext } from \"./MenuCheckboxItemContext.js\";\nimport { REGULAR_ITEM, useMenuItem } from \"../item/useMenuItem.js\";\nimport { useCompositeListItem } from \"../../composite/list/useCompositeListItem.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.js\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * A menu item that toggles a setting on or off.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuCheckboxItem = /*#__PURE__*/React.forwardRef(function MenuCheckboxItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n nativeButton = false,\n disabled = false,\n closeOnClick = false,\n checked: checkedProp,\n defaultChecked,\n onCheckedChange,\n style,\n ...elementProps\n } = componentProps;\n const listItem = useCompositeListItem({\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const [checked, setChecked] = useControlled({\n controlled: checkedProp,\n default: defaultChecked ?? false,\n name: 'MenuCheckboxItem',\n state: 'checked'\n });\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n nativeButton,\n nodeId: menuPositionerContext?.context.nodeId,\n itemMetadata: REGULAR_ITEM\n });\n const state = React.useMemo(() => ({\n disabled,\n highlighted,\n checked\n }), [disabled, highlighted, checked]);\n const handleClick = useStableCallback(event => {\n const details = {\n ...createChangeEventDetails(REASONS.itemPress, event.nativeEvent),\n preventUnmountOnClose: () => {}\n };\n onCheckedChange?.(!checked, details);\n if (details.isCanceled) {\n return;\n }\n setChecked(currentlyChecked => !currentlyChecked);\n });\n const element = useRenderElement('div', componentProps, {\n state,\n stateAttributesMapping: itemMapping,\n props: [itemProps, {\n role: 'menuitemcheckbox',\n 'aria-checked': checked,\n onClick: handleClick\n }, elementProps, getItemProps],\n ref: [itemRef, forwardedRef, listItem.ref]\n });\n return /*#__PURE__*/_jsx(MenuCheckboxItemContext.Provider, {\n value: state,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuCheckboxItem.displayName = \"MenuCheckboxItem\";","'use client';\n\nimport * as React from 'react';\nimport { useMenuCheckboxItemContext } from \"../checkbox-item/MenuCheckboxItemContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\n\n/**\n * Indicates whether the checkbox item is ticked.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuCheckboxItemIndicator = /*#__PURE__*/React.forwardRef(function MenuCheckboxItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const item = useMenuCheckboxItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(item.checked);\n useOpenChangeComplete({\n open: item.checked,\n ref: indicatorRef,\n onComplete() {\n if (!item.checked) {\n setMounted(false);\n }\n }\n });\n const state = {\n checked: item.checked,\n disabled: item.disabled,\n highlighted: item.highlighted,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, indicatorRef],\n stateAttributesMapping: itemMapping,\n props: {\n 'aria-hidden': true,\n ...elementProps\n },\n enabled: keepMounted || item.checked\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") MenuCheckboxItemIndicator.displayName = \"MenuCheckboxItemIndicator\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuGroupContext.displayName = \"MenuGroupContext\";\nexport function useMenuGroupRootContext() {\n const context = React.useContext(MenuGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuGroupRootContext is missing. Menu group parts must be used within <Menu.Group>.' : _formatErrorMessage(31));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { MenuGroupContext } from \"./MenuGroupContext.js\";\n\n/**\n * Groups related menu items with the corresponding label.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuGroup = /*#__PURE__*/React.forwardRef(function MenuGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState(undefined);\n const context = React.useMemo(() => ({\n setLabelId\n }), [setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: {\n role: 'group',\n 'aria-labelledby': labelId,\n ...elementProps\n }\n });\n return /*#__PURE__*/_jsx(MenuGroupContext.Provider, {\n value: context,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuGroup.displayName = \"MenuGroup\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useMenuGroupRootContext } from \"../group/MenuGroupContext.js\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuGroupLabel = /*#__PURE__*/React.forwardRef(function MenuGroupLabelComponent(componentProps, forwardedRef) {\n const {\n className,\n render,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const id = useBaseUiId(idProp);\n const {\n setLabelId\n } = useMenuGroupRootContext();\n useIsoLayoutEffect(() => {\n setLabelId(id);\n return () => {\n setLabelId(undefined);\n };\n }, [setLabelId, id]);\n return useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: {\n id,\n role: 'presentation',\n ...elementProps\n }\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuGroupLabel.displayName = \"MenuGroupLabel\";","'use client';\n\nimport * as React from 'react';\nimport { REGULAR_ITEM, useMenuItem } from \"./useMenuItem.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useCompositeListItem } from \"../../composite/list/useCompositeListItem.js\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.js\";\n\n/**\n * An individual interactive item in the menu.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n nativeButton = false,\n disabled = false,\n closeOnClick = true,\n style,\n ...elementProps\n } = componentProps;\n const listItem = useCompositeListItem({\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n nativeButton,\n nodeId: menuPositionerContext?.context.nodeId,\n itemMetadata: REGULAR_ITEM\n });\n const state = {\n disabled,\n highlighted\n };\n return useRenderElement('div', componentProps, {\n state,\n props: [itemProps, elementProps, getItemProps],\n ref: [itemRef, forwardedRef, listItem.ref]\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuItem.displayName = \"MenuItem\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToolbarRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToolbarRootContext.displayName = \"ToolbarRootContext\";\nexport function useToolbarRootContext(optional) {\n const context = React.useContext(ToolbarRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' : _formatErrorMessage(69));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { FloatingFocusManager, useHoverFloatingInteraction } from \"../../floating-ui-react/index.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.js\";\nimport { COMPOSITE_KEYS } from \"../../composite/composite.js\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the menu items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuPopup = /*#__PURE__*/React.forwardRef(function MenuPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const {\n side,\n align\n } = useMenuPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const open = store.useState('open');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const mounted = store.useState('mounted');\n const instantType = store.useState('instantType');\n const triggerElement = store.useState('activeTriggerElement');\n const parent = store.useState('parent');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const rootId = store.useState('rootId');\n const floatingContext = store.useState('floatingRootContext');\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const closeDelay = store.useState('closeDelay');\n const activeTriggerElement = store.useState('activeTriggerElement');\n const isContextMenu = parent.type === 'context-menu';\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n React.useEffect(() => {\n function handleClose(event) {\n store.setOpen(false, createChangeEventDetails(event.reason, event.domEvent));\n }\n floatingTreeRoot.events.on('close', handleClose);\n return () => {\n floatingTreeRoot.events.off('close', handleClose);\n };\n }, [floatingTreeRoot.events, store]);\n const hoverEnabled = store.useState('hoverEnabled');\n const disabled = store.useState('disabled');\n useHoverFloatingInteraction(floatingContext, {\n enabled: hoverEnabled && !disabled && !isContextMenu && parent.type !== 'menubar',\n closeDelay\n });\n const state = {\n transitionStatus,\n side,\n align,\n open,\n nested: parent.type === 'menu',\n instant: instantType\n };\n const setPopupElement = React.useCallback(element => {\n store.set('popupElement', element);\n }, [store]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n stateAttributesMapping,\n props: [popupProps, {\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps, {\n 'data-rootownerid': rootId\n }]\n });\n let returnFocus = parent.type === undefined || isContextMenu;\n if (triggerElement || parent.type === 'menubar' && lastOpenChangeReason !== REASONS.outsidePress) {\n returnFocus = true;\n }\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingContext,\n modal: isContextMenu,\n disabled: !mounted,\n returnFocus: finalFocus === undefined ? returnFocus : finalFocus,\n initialFocus: parent.type !== 'menu',\n restoreFocus: true,\n externalTree: parent.type !== 'menubar' ? floatingTreeRoot : undefined,\n previousFocusableElement: activeTriggerElement,\n nextFocusableElement: parent.type === undefined ? store.context.triggerFocusTargetRef : undefined,\n beforeContentFocusGuardRef: parent.type === undefined ? store.context.beforeContentFocusGuardRef : undefined,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuPopup.displayName = \"MenuPopup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuPortalContext.displayName = \"MenuPortalContext\";\nexport function useMenuPortalContext() {\n const value = React.useContext(MenuPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Menu.Portal> is missing.' : _formatErrorMessage(32));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { MenuPortalContext } from \"./MenuPortalContext.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuPortal = /*#__PURE__*/React.forwardRef(function MenuPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const {\n store\n } = useMenuRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(MenuPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuPortal.displayName = \"MenuPortal\";","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { FloatingNode } from \"../../floating-ui-react/index.js\";\nimport { MenuPositionerContext } from \"./MenuPositionerContext.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.js\";\nimport { CompositeList } from \"../../composite/list/CompositeList.js\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.js\";\nimport { useMenuPortalContext } from \"../portal/MenuPortalContext.js\";\nimport { DROPDOWN_COLLISION_AVOIDANCE, POPUP_COLLISION_AVOIDANCE } from \"../../utils/constants.js\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { adaptiveOrigin } from \"../../utils/adaptiveOriginMiddleware.js\";\nimport { useAnimationsFinished } from \"../../utils/useAnimationsFinished.js\";\nimport { usePositioner } from \"../../utils/usePositioner.js\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.js\";\n\n/**\n * Positions the menu popup against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const MenuPositioner = /*#__PURE__*/React.forwardRef(function MenuPositioner(componentProps, forwardedRef) {\n const {\n anchor: anchorProp,\n positionMethod: positionMethodProp = 'absolute',\n className,\n render,\n side,\n align: alignProp,\n sideOffset: sideOffsetProp = 0,\n alignOffset: alignOffsetProp = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useMenuRootContext();\n const keepMounted = useMenuPortalContext();\n const contextMenuContext = useContextMenuRootContext(true);\n const parent = store.useState('parent');\n const floatingRootContext = store.useState('floatingRootContext');\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const mounted = store.useState('mounted');\n const open = store.useState('open');\n const modal = store.useState('modal');\n const openMethod = store.useState('openMethod');\n const triggerElement = store.useState('activeTriggerElement');\n const transitionStatus = store.useState('transitionStatus');\n const positionerElement = store.useState('positionerElement');\n const instantType = store.useState('instantType');\n const hasViewport = store.useState('hasViewport');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const floatingNodeId = store.useState('floatingNodeId');\n const floatingParentNodeId = store.useState('floatingParentNodeId');\n const domReference = floatingRootContext.useState('domReferenceElement');\n const previousTriggerRef = React.useRef(null);\n const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);\n let anchor = anchorProp;\n let sideOffset = sideOffsetProp;\n let alignOffset = alignOffsetProp;\n let align = alignProp;\n let collisionAvoidance = collisionAvoidanceProp;\n if (parent.type === 'context-menu') {\n anchor = anchorProp ?? parent.context?.anchor;\n align = align ?? 'start';\n if (!side && align !== 'center') {\n alignOffset = componentProps.alignOffset ?? 2;\n sideOffset = componentProps.sideOffset ?? -5;\n }\n }\n let computedSide = side;\n let computedAlign = align;\n if (parent.type === 'menu') {\n computedSide = computedSide ?? 'inline-end';\n computedAlign = computedAlign ?? 'start';\n collisionAvoidance = componentProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE;\n } else if (parent.type === 'menubar') {\n computedSide = computedSide ?? 'bottom';\n computedAlign = computedAlign ?? 'start';\n }\n const contextMenu = parent.type === 'context-menu';\n const positioner = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod: contextMenuContext ? 'fixed' : positionMethodProp,\n mounted,\n side: computedSide,\n sideOffset,\n align: computedAlign,\n alignOffset,\n arrowPadding: contextMenu ? 0 : arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n nodeId: floatingNodeId,\n keepMounted,\n disableAnchorTracking,\n collisionAvoidance,\n shiftCrossAxis: contextMenu && !('side' in collisionAvoidance && collisionAvoidance.side === 'flip'),\n externalTree: floatingTreeRoot,\n adaptiveOrigin: hasViewport ? adaptiveOrigin : undefined\n });\n React.useEffect(() => {\n function onMenuOpenChange(details) {\n if (details.open) {\n if (details.parentNodeId === floatingNodeId) {\n store.set('hoverEnabled', false);\n }\n if (details.nodeId !== floatingNodeId && details.parentNodeId === store.select('floatingParentNodeId')) {\n store.setOpen(false, createChangeEventDetails(REASONS.siblingOpen));\n }\n }\n }\n floatingTreeRoot.events.on('menuopenchange', onMenuOpenChange);\n return () => {\n floatingTreeRoot.events.off('menuopenchange', onMenuOpenChange);\n };\n }, [store, floatingTreeRoot.events, floatingNodeId]);\n React.useEffect(() => {\n if (store.select('floatingParentNodeId') == null) {\n return undefined;\n }\n function onParentClose(details) {\n if (details.open || details.nodeId !== store.select('floatingParentNodeId')) {\n return;\n }\n const reason = details.reason ?? REASONS.siblingOpen;\n store.setOpen(false, createChangeEventDetails(reason));\n }\n floatingTreeRoot.events.on('menuopenchange', onParentClose);\n return () => {\n floatingTreeRoot.events.off('menuopenchange', onParentClose);\n };\n }, [floatingTreeRoot.events, store]);\n const closeTimeout = useTimeout();\n\n // Clear pending close timeout when the menu closes.\n React.useEffect(() => {\n if (!open) {\n closeTimeout.clear();\n }\n }, [open, closeTimeout]);\n\n // Close unrelated child submenus when hovering a different item in the parent menu.\n React.useEffect(() => {\n function onItemHover(event) {\n // If an item within our parent menu is hovered, and this menu's trigger is not that item,\n // close this submenu. This ensures hovering a different item in the parent closes other branches.\n if (!open || event.nodeId !== store.select('floatingParentNodeId')) {\n return;\n }\n if (event.target && triggerElement && triggerElement !== event.target) {\n const delay = store.select('closeDelay');\n if (delay > 0) {\n if (!closeTimeout.isStarted()) {\n closeTimeout.start(delay, () => {\n store.setOpen(false, createChangeEventDetails(REASONS.siblingOpen));\n });\n }\n } else {\n store.setOpen(false, createChangeEventDetails(REASONS.siblingOpen));\n }\n } else {\n // User re-hovered the submenu trigger, cancel pending close.\n closeTimeout.clear();\n }\n }\n floatingTreeRoot.events.on('itemhover', onItemHover);\n return () => {\n floatingTreeRoot.events.off('itemhover', onItemHover);\n };\n }, [floatingTreeRoot.events, open, triggerElement, store, closeTimeout]);\n React.useEffect(() => {\n const eventDetails = {\n open,\n nodeId: floatingNodeId,\n parentNodeId: floatingParentNodeId,\n reason: store.select('lastOpenChangeReason')\n };\n floatingTreeRoot.events.emit('menuopenchange', eventDetails);\n }, [floatingTreeRoot.events, open, store, floatingNodeId, floatingParentNodeId]);\n\n // Keep positioner transition behavior aligned with Popover when switching detached triggers.\n useIsoLayoutEffect(() => {\n const currentTrigger = domReference;\n const previousTrigger = previousTriggerRef.current;\n if (currentTrigger) {\n previousTriggerRef.current = currentTrigger;\n }\n if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {\n store.set('instantType', undefined);\n const abortController = new AbortController();\n runOnceAnimationsFinish(() => {\n store.set('instantType', 'trigger-change');\n }, abortController.signal);\n return () => {\n abortController.abort();\n };\n }\n return undefined;\n }, [domReference, runOnceAnimationsFinish, store]);\n const state = {\n open,\n side: positioner.side,\n align: positioner.align,\n anchorHidden: positioner.anchorHidden,\n nested: parent.type === 'menu',\n instant: instantType\n };\n const menubarModal = parent.type === 'menubar' && parent.context.modal;\n const popupModal = modal && lastOpenChangeReason !== REASONS.triggerHover;\n useAnchoredPopupScrollLock(open && (menubarModal || popupModal), openMethod === 'touch', positionerElement, triggerElement);\n const element = usePositioner(componentProps, state, {\n styles: positioner.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, store.useStateSetter('positionerElement')],\n hidden: !mounted,\n inert: !open\n });\n const shouldRenderBackdrop = mounted && parent.type !== 'menu' && (parent.type !== 'menubar' && modal && lastOpenChangeReason !== REASONS.triggerHover || parent.type === 'menubar' && parent.context.modal);\n\n // cuts a hole in the backdrop to allow pointer interaction with the menubar or dropdown menu trigger element\n let backdropCutout = null;\n if (parent.type === 'menubar') {\n backdropCutout = parent.context.contentElement;\n } else if (parent.type === undefined) {\n backdropCutout = triggerElement;\n }\n return /*#__PURE__*/_jsxs(MenuPositionerContext.Provider, {\n value: positioner,\n children: [shouldRenderBackdrop && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: parent.type === 'context-menu' || parent.type === 'nested-context-menu' ? parent.context.internalBackdropRef : null,\n inert: inertValue(!open),\n cutout: backdropCutout\n }), /*#__PURE__*/_jsx(FloatingNode, {\n id: floatingNodeId,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: store.context.itemDomElements,\n labelsRef: store.context.itemLabels,\n children: element\n })\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuPositioner.displayName = \"MenuPositioner\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuRadioGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuRadioGroupContext.displayName = \"MenuRadioGroupContext\";\nexport function useMenuRadioGroupContext() {\n const context = React.useContext(MenuRadioGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuRadioGroupContext is missing. MenuRadioGroup parts must be placed within <Menu.RadioGroup>.' : _formatErrorMessage(34));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { MenuRadioGroupContext } from \"./MenuRadioGroupContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups related radio items.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuRadioGroup = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function MenuRadioGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n value: valueProp,\n defaultValue,\n onValueChange: onValueChangeProp,\n disabled = false,\n style,\n ...elementProps\n } = componentProps;\n const [value, setValueUnwrapped] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: 'MenuRadioGroup'\n });\n const onValueChange = useStableCallback(onValueChangeProp);\n const setValue = useStableCallback((newValue, eventDetails) => {\n onValueChange?.(newValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValueUnwrapped(newValue);\n });\n const state = {\n disabled\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: {\n role: 'group',\n 'aria-disabled': disabled || undefined,\n ...elementProps\n }\n });\n const context = React.useMemo(() => ({\n value,\n setValue,\n disabled\n }), [value, setValue, disabled]);\n return /*#__PURE__*/_jsx(MenuRadioGroupContext.Provider, {\n value: context,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") MenuRadioGroup.displayName = \"MenuRadioGroup\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenuRadioItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuRadioItemContext.displayName = \"MenuRadioItemContext\";\nexport function useMenuRadioItemContext() {\n const context = React.useContext(MenuRadioItemContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenuRadioItemContext is missing. MenuRadioItem parts must be placed within <Menu.RadioItem>.' : _formatErrorMessage(35));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useMenuRadioGroupContext } from \"../radio-group/MenuRadioGroupContext.js\";\nimport { MenuRadioItemContext } from \"./MenuRadioItemContext.js\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.js\";\nimport { useCompositeListItem } from \"../../composite/list/useCompositeListItem.js\";\nimport { REGULAR_ITEM, useMenuItem } from \"../item/useMenuItem.js\";\nimport { useMenuPositionerContext } from \"../positioner/MenuPositionerContext.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\n\n/**\n * A menu item that works like a radio button in a given group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuRadioItem = /*#__PURE__*/React.forwardRef(function MenuRadioItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n label,\n nativeButton = false,\n disabled: disabledProp = false,\n closeOnClick = false,\n value,\n style,\n ...elementProps\n } = componentProps;\n const listItem = useCompositeListItem({\n label\n });\n const menuPositionerContext = useMenuPositionerContext(true);\n const id = useBaseUiId(idProp);\n const {\n store\n } = useMenuRootContext();\n const highlighted = store.useState('isActive', listItem.index);\n const itemProps = store.useState('itemProps');\n const {\n value: selectedValue,\n setValue: setSelectedValue,\n disabled: groupDisabled\n } = useMenuRadioGroupContext();\n const disabled = groupDisabled || disabledProp;\n const checked = selectedValue === value;\n const {\n getItemProps,\n itemRef\n } = useMenuItem({\n closeOnClick,\n disabled,\n highlighted,\n id,\n store,\n nativeButton,\n nodeId: menuPositionerContext?.context.nodeId,\n itemMetadata: REGULAR_ITEM\n });\n const state = React.useMemo(() => ({\n disabled,\n highlighted,\n checked\n }), [disabled, highlighted, checked]);\n const handleClick = useStableCallback(event => {\n const details = {\n ...createChangeEventDetails(REASONS.itemPress, event.nativeEvent),\n preventUnmountOnClose: () => {}\n };\n setSelectedValue(value, details);\n });\n const element = useRenderElement('div', componentProps, {\n state,\n stateAttributesMapping: itemMapping,\n props: [itemProps, {\n role: 'menuitemradio',\n 'aria-checked': checked,\n onClick: handleClick\n }, elementProps, getItemProps],\n ref: [itemRef, forwardedRef, listItem.ref]\n });\n return /*#__PURE__*/_jsx(MenuRadioItemContext.Provider, {\n value: state,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") MenuRadioItem.displayName = \"MenuRadioItem\";","'use client';\n\nimport * as React from 'react';\nimport { useMenuRadioItemContext } from \"../radio-item/MenuRadioItemContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { itemMapping } from \"../utils/stateAttributesMapping.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\n\n/**\n * Indicates whether the radio item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuRadioItemIndicator = /*#__PURE__*/React.forwardRef(function MenuRadioItemIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const item = useMenuRadioItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(item.checked);\n useOpenChangeComplete({\n open: item.checked,\n ref: indicatorRef,\n onComplete() {\n if (!item.checked) {\n setMounted(false);\n }\n }\n });\n const state = {\n checked: item.checked,\n disabled: item.disabled,\n highlighted: item.highlighted,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n state,\n stateAttributesMapping: itemMapping,\n ref: [forwardedRef, indicatorRef],\n props: {\n 'aria-hidden': true,\n ...elementProps\n },\n enabled: keepMounted || item.checked\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") MenuRadioItemIndicator.displayName = \"MenuRadioItemIndicator\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const MenubarContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") MenubarContext.displayName = \"MenubarContext\";\nexport function useMenubarContext(optional) {\n const context = React.useContext(MenubarContext);\n if (context === null && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: MenubarContext is missing. Menubar parts must be placed within <Menubar>.' : _formatErrorMessage(5));\n }\n return context;\n}","import * as React from 'react';\nimport { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"../../floating-ui-react/components/FloatingTreeStore.js\";\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.js\";\nconst selectors = {\n ...popupStoreSelectors,\n disabled: createSelector(state => state.parent.type === 'menubar' ? state.parent.context.disabled || state.disabled : state.disabled),\n modal: createSelector(state => (state.parent.type === undefined || state.parent.type === 'context-menu') && (state.modal ?? true)),\n openMethod: createSelector(state => state.openMethod),\n allowMouseEnter: createSelector(state => state.allowMouseEnter),\n stickIfOpen: createSelector(state => state.stickIfOpen),\n parent: createSelector(state => state.parent),\n rootId: createSelector(state => {\n if (state.parent.type === 'menu') {\n return state.parent.store.select('rootId');\n }\n return state.parent.type !== undefined ? state.parent.context.rootId : state.rootId;\n }),\n activeIndex: createSelector(state => state.activeIndex),\n isActive: createSelector((state, itemIndex) => state.activeIndex === itemIndex),\n hoverEnabled: createSelector(state => state.hoverEnabled),\n instantType: createSelector(state => state.instantType),\n lastOpenChangeReason: createSelector(state => state.openChangeReason),\n floatingTreeRoot: createSelector(state => {\n if (state.parent.type === 'menu') {\n return state.parent.store.select('floatingTreeRoot');\n }\n return state.floatingTreeRoot;\n }),\n floatingNodeId: createSelector(state => state.floatingNodeId),\n floatingParentNodeId: createSelector(state => state.floatingParentNodeId),\n itemProps: createSelector(state => state.itemProps),\n closeDelay: createSelector(state => state.closeDelay),\n hasViewport: createSelector(state => state.hasViewport),\n keyboardEventRelay: createSelector(state => {\n if (state.keyboardEventRelay) {\n return state.keyboardEventRelay;\n }\n if (state.parent.type === 'menu') {\n return state.parent.store.select('keyboardEventRelay');\n }\n return undefined;\n })\n};\nexport class MenuStore extends ReactStore {\n constructor(initialState) {\n super({\n ...createInitialState(),\n ...initialState\n }, {\n positionerRef: /*#__PURE__*/React.createRef(),\n popupRef: /*#__PURE__*/React.createRef(),\n typingRef: {\n current: false\n },\n itemDomElements: {\n current: []\n },\n itemLabels: {\n current: []\n },\n allowMouseUpTriggerRef: {\n current: false\n },\n triggerFocusTargetRef: /*#__PURE__*/React.createRef(),\n beforeContentFocusGuardRef: /*#__PURE__*/React.createRef(),\n onOpenChangeComplete: undefined,\n triggerElements: new PopupTriggerMap()\n }, selectors);\n\n // Set up propagation of state from parent menu if applicable.\n this.unsubscribeParentListener = this.observe('parent', parent => {\n this.unsubscribeParentListener?.();\n if (parent.type === 'menu') {\n let rootId = parent.store.select('rootId');\n let floatingTreeRoot = parent.store.select('floatingTreeRoot');\n let keyboardEventRelay = parent.store.select('keyboardEventRelay');\n this.unsubscribeParentListener = parent.store.subscribe(() => {\n const nextRootId = parent.store.select('rootId');\n const nextFloatingTreeRoot = parent.store.select('floatingTreeRoot');\n const nextKeyboardEventRelay = parent.store.select('keyboardEventRelay');\n if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) {\n return;\n }\n rootId = nextRootId;\n floatingTreeRoot = nextFloatingTreeRoot;\n keyboardEventRelay = nextKeyboardEventRelay;\n this.notifyAll();\n });\n this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;\n return;\n }\n if (parent.type !== undefined) {\n this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;\n }\n this.unsubscribeParentListener = null;\n });\n }\n setOpen(open, eventDetails) {\n this.state.floatingRootContext.context.events.emit('setOpen', {\n open,\n eventDetails\n });\n }\n static useStore(externalStore, initialState) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const internalStore = useRefWithInit(() => {\n return new MenuStore(initialState);\n }).current;\n return externalStore ?? internalStore;\n }\n unsubscribeParentListener = null;\n}\nfunction createInitialState() {\n return {\n ...createInitialPopupStoreState(),\n disabled: false,\n modal: true,\n openMethod: null,\n allowMouseEnter: false,\n stickIfOpen: true,\n parent: {\n type: undefined\n },\n rootId: undefined,\n activeIndex: null,\n hoverEnabled: true,\n instantType: undefined,\n openChangeReason: null,\n floatingTreeRoot: new FloatingTreeStore(),\n floatingNodeId: undefined,\n floatingParentNodeId: null,\n itemProps: EMPTY_OBJECT,\n keyboardEventRelay: undefined,\n closeDelay: 0,\n hasViewport: false\n };\n}","'use client';\n\nimport * as React from 'react';\nexport const MenuSubmenuRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") MenuSubmenuRootContext.displayName = \"MenuSubmenuRootContext\";\nexport function useMenuSubmenuRootContext() {\n return React.useContext(MenuSubmenuRootContext);\n}","'use client';\n\nimport * as React from 'react';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { EMPTY_ARRAY } from '@base-ui/utils/empty';\nimport { fastComponent } from '@base-ui/utils/fastHooks';\nimport { FloatingTree, useDismiss, useFloatingNodeId, useFloatingParentNodeId, useInteractions, useListNavigation, useRole, useTypeahead, useSyncedFloatingRootContext } from \"../../floating-ui-react/index.js\";\nimport { MenuRootContext, useMenuRootContext } from \"./MenuRootContext.js\";\nimport { useMenubarContext } from \"../../menubar/MenubarContext.js\";\nimport { TYPEAHEAD_RESET_MS } from \"../../utils/constants.js\";\nimport { useDirection } from \"../../direction-provider/DirectionContext.js\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { MenuStore } from \"../store/MenuStore.js\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions } from \"../../utils/popups/index.js\";\nimport { useMenuSubmenuRootContext } from \"../submenu-root/MenuSubmenuRootContext.js\";\n\n/**\n * Groups all parts of the menu.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const MenuRoot = fastComponent(function MenuRoot(props) {\n const {\n children,\n open: openProp,\n onOpenChange,\n onOpenChangeComplete,\n defaultOpen = false,\n disabled: disabledProp = false,\n modal: modalProp,\n loopFocus = true,\n orientation = 'vertical',\n actionsRef,\n closeParentOnEsc = false,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n highlightItemOnHover = true\n } = props;\n const contextMenuContext = useContextMenuRootContext(true);\n const parentMenuRootContext = useMenuRootContext(true);\n const menubarContext = useMenubarContext(true);\n const isSubmenu = useMenuSubmenuRootContext();\n const parentFromContext = React.useMemo(() => {\n if (isSubmenu && parentMenuRootContext) {\n return {\n type: 'menu',\n store: parentMenuRootContext.store\n };\n }\n if (menubarContext) {\n return {\n type: 'menubar',\n context: menubarContext\n };\n }\n\n // Ensure this is not a Menu nested inside ContextMenu.Trigger.\n // ContextMenu parentContext is always undefined as ContextMenu.Root is instantiated with\n // <MenuRootContext.Provider value={undefined}>\n if (contextMenuContext && !parentMenuRootContext) {\n return {\n type: 'context-menu',\n context: contextMenuContext\n };\n }\n return {\n type: undefined\n };\n }, [contextMenuContext, parentMenuRootContext, menubarContext, isSubmenu]);\n const store = MenuStore.useStore(handle?.store, {\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp,\n parent: parentFromContext\n });\n\n // Support initially open state when uncontrolled\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen === true) {\n store.update({\n open: true,\n activeTriggerId: defaultTriggerIdProp\n });\n }\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const floatingTreeRoot = store.useState('floatingTreeRoot');\n const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);\n const floatingParentNodeIdFromContext = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (contextMenuContext && !parentMenuRootContext) {\n // This is a context menu root.\n // It doesn't support detached triggers yet, so we have to sync the parent context manually.\n store.update({\n parent: {\n type: 'context-menu',\n context: contextMenuContext\n },\n floatingNodeId: floatingNodeIdFromContext,\n floatingParentNodeId: floatingParentNodeIdFromContext\n });\n } else if (parentMenuRootContext) {\n store.update({\n floatingNodeId: floatingNodeIdFromContext,\n floatingParentNodeId: floatingParentNodeIdFromContext\n });\n }\n }, [contextMenuContext, parentMenuRootContext, floatingNodeIdFromContext, floatingParentNodeIdFromContext, store]);\n const open = store.useState('open');\n const activeTriggerElement = store.useState('activeTriggerElement');\n const positionerElement = store.useState('positionerElement');\n const hoverEnabled = store.useState('hoverEnabled');\n const disabled = store.useState('disabled');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n const parent = store.useState('parent');\n const activeIndex = store.useState('activeIndex');\n const payload = store.useState('payload');\n const floatingParentNodeId = store.useState('floatingParentNodeId');\n const openEventRef = React.useRef(null);\n const nested = floatingParentNodeId != null;\n if (process.env.NODE_ENV !== 'production') {\n if (parent.type !== undefined && modalProp !== undefined) {\n console.warn('Base UI: The `modal` prop is not supported on nested menus. It will be ignored.');\n }\n }\n const {\n openMethod,\n triggerProps: interactionTypeProps\n } = useOpenInteractionType(open);\n store.useSyncedValues({\n disabled: disabledProp,\n modal: parent.type === undefined ? modalProp : undefined,\n openMethod,\n rootId: useId()\n });\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store, () => {\n store.update({\n allowMouseEnter: false,\n stickIfOpen: true\n });\n });\n const allowOutsidePressDismissalRef = React.useRef(parent.type !== 'context-menu');\n const allowOutsidePressDismissalTimeout = useTimeout();\n React.useEffect(() => {\n if (!open) {\n openEventRef.current = null;\n }\n if (parent.type !== 'context-menu') {\n return;\n }\n if (!open) {\n allowOutsidePressDismissalTimeout.clear();\n allowOutsidePressDismissalRef.current = false;\n return;\n }\n\n // With `mousedown` outside press events and long press touch input, there\n // needs to be a grace period after opening to ensure the dismissal event\n // doesn't fire immediately after open.\n allowOutsidePressDismissalTimeout.start(500, () => {\n allowOutsidePressDismissalRef.current = true;\n });\n }, [allowOutsidePressDismissalTimeout, open, parent.type]);\n useIsoLayoutEffect(() => {\n if (!open && !hoverEnabled) {\n store.set('hoverEnabled', true);\n }\n }, [open, hoverEnabled, store]);\n const allowTouchToCloseRef = React.useRef(true);\n const allowTouchToCloseTimeout = useTimeout();\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n const reason = eventDetails.reason;\n if (open === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) {\n return;\n }\n eventDetails.preventUnmountOnClose = () => {\n store.set('preventUnmountingOnClose', true);\n };\n\n // Do not immediately reset the activeTriggerId to allow\n // exit animations to play and focus to be returned correctly.\n if (!nextOpen && eventDetails.trigger == null) {\n eventDetails.trigger = activeTriggerElement ?? undefined;\n }\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const nativeEvent = eventDetails.event;\n if (nextOpen === false && nativeEvent?.type === 'click' && nativeEvent.pointerType === 'touch' && !allowTouchToCloseRef.current) {\n return;\n }\n\n // Workaround `enableFocusInside` in Floating UI setting `tabindex=0` of a non-highlighted\n // option upon close when tabbing out due to `keepMounted=true`:\n // https://github.com/floating-ui/floating-ui/pull/3004/files#diff-962a7439cdeb09ea98d4b622a45d517bce07ad8c3f866e089bda05f4b0bbd875R194-R199\n // This otherwise causes options to retain `tabindex=0` incorrectly when the popup is closed\n // when tabbing outside.\n if (!nextOpen && activeIndex !== null) {\n const activeOption = store.context.itemDomElements.current[activeIndex];\n // Wait for Floating UI's focus effect to have fired\n queueMicrotask(() => {\n activeOption?.setAttribute('tabindex', '-1');\n });\n }\n\n // Prevent the menu from closing on mobile devices that have a delayed click event.\n // In some cases the menu, when tapped, will fire the focus event first and then the click event.\n // Without this guard, the menu will close immediately after opening.\n if (nextOpen && reason === REASONS.triggerFocus) {\n allowTouchToCloseRef.current = false;\n allowTouchToCloseTimeout.start(300, () => {\n allowTouchToCloseRef.current = true;\n });\n } else {\n allowTouchToCloseRef.current = true;\n allowTouchToCloseTimeout.clear();\n }\n const isKeyboardClick = (reason === REASONS.triggerPress || reason === REASONS.itemPress) && nativeEvent.detail === 0 && nativeEvent?.isTrusted;\n const isDismissClose = !nextOpen && (reason === REASONS.escapeKey || reason == null);\n const updatedState = {\n open: nextOpen,\n openChangeReason: reason\n };\n openEventRef.current = eventDetails.event ?? null;\n\n // If a popup is closing, the `trigger` may be null.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n const newTriggerId = eventDetails.trigger?.id ?? null;\n if (newTriggerId || nextOpen) {\n updatedState.activeTriggerId = newTriggerId;\n updatedState.activeTriggerElement = eventDetails.trigger ?? null;\n }\n store.update(updatedState);\n if (parent.type === 'menubar' && (reason === REASONS.triggerFocus || reason === REASONS.focusOut || reason === REASONS.triggerHover || reason === REASONS.listNavigation || reason === REASONS.siblingOpen)) {\n store.set('instantType', 'group');\n } else if (isKeyboardClick || isDismissClose) {\n store.set('instantType', isKeyboardClick ? 'click' : 'dismiss');\n } else {\n store.set('instantType', undefined);\n }\n });\n const createMenuEventDetails = React.useCallback(reason => {\n const details = createChangeEventDetails(reason);\n details.preventUnmountOnClose = () => {\n store.set('preventUnmountingOnClose', true);\n };\n return details;\n }, [store]);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createMenuEventDetails(REASONS.imperativeAction));\n }, [store, createMenuEventDetails]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n let ctx;\n if (parent.type === 'context-menu') {\n ctx = parent.context;\n }\n React.useImperativeHandle(ctx?.positionerRef, () => positionerElement, [positionerElement]);\n React.useImperativeHandle(ctx?.actionsRef, () => ({\n setOpen\n }), [setOpen]);\n const floatingRootContext = useSyncedFloatingRootContext({\n popupStore: store,\n onOpenChange: setOpen\n });\n const floatingEvents = floatingRootContext.context.events;\n React.useEffect(() => {\n const handleSetOpenEvent = ({\n open: nextOpen,\n eventDetails\n }) => setOpen(nextOpen, eventDetails);\n floatingEvents.on('setOpen', handleSetOpenEvent);\n return () => {\n floatingEvents?.off('setOpen', handleSetOpenEvent);\n };\n }, [floatingEvents, setOpen]);\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled,\n bubbles: {\n escapeKey: closeParentOnEsc && parent.type === 'menu'\n },\n outsidePress() {\n if (parent.type !== 'context-menu' || openEventRef.current?.type === 'contextmenu') {\n return true;\n }\n return allowOutsidePressDismissalRef.current;\n },\n externalTree: nested ? floatingTreeRoot : undefined\n });\n const role = useRole(floatingRootContext, {\n role: 'menu'\n });\n const direction = useDirection();\n const setActiveIndex = React.useCallback(index => {\n if (store.select('activeIndex') === index) {\n return;\n }\n store.set('activeIndex', index);\n }, [store]);\n const listNavigation = useListNavigation(floatingRootContext, {\n enabled: !disabled,\n listRef: store.context.itemDomElements,\n activeIndex,\n nested: parent.type !== undefined,\n loopFocus,\n orientation,\n parentOrientation: parent.type === 'menubar' ? parent.context.orientation : undefined,\n rtl: direction === 'rtl',\n disabledIndices: EMPTY_ARRAY,\n onNavigate: setActiveIndex,\n openOnArrowKeyDown: parent.type !== 'context-menu',\n externalTree: nested ? floatingTreeRoot : undefined,\n focusItemOnHover: highlightItemOnHover\n });\n const onTypingChange = React.useCallback(nextTyping => {\n store.context.typingRef.current = nextTyping;\n }, [store]);\n const typeahead = useTypeahead(floatingRootContext, {\n listRef: store.context.itemLabels,\n elementsRef: store.context.itemDomElements,\n activeIndex,\n resetMs: TYPEAHEAD_RESET_MS,\n onMatch: index => {\n if (open && index !== activeIndex) {\n store.set('activeIndex', index);\n }\n },\n onTypingChange\n });\n const {\n getReferenceProps,\n getFloatingProps,\n getItemProps,\n getTriggerProps\n } = useInteractions([dismiss, role, listNavigation, typeahead]);\n const activeTriggerProps = React.useMemo(() => {\n const mergedProps = mergeProps(getReferenceProps(), {\n onMouseMove() {\n store.set('allowMouseEnter', true);\n }\n }, interactionTypeProps);\n delete mergedProps.role;\n return mergedProps;\n }, [getReferenceProps, store, interactionTypeProps]);\n const inactiveTriggerProps = React.useMemo(() => {\n const triggerProps = getTriggerProps();\n if (!triggerProps) {\n return triggerProps;\n }\n const mergedProps = mergeProps(triggerProps, interactionTypeProps);\n delete mergedProps.role;\n delete mergedProps['aria-controls'];\n return mergedProps;\n }, [getTriggerProps, interactionTypeProps]);\n const popupProps = React.useMemo(() => getFloatingProps({\n onMouseMove() {\n store.set('allowMouseEnter', true);\n if (parent.type === 'menu') {\n store.set('hoverEnabled', false);\n }\n },\n onClick() {\n if (store.select('hoverEnabled')) {\n store.set('hoverEnabled', false);\n }\n },\n onKeyDown(event) {\n // The Menubar's CompositeRoot captures keyboard events via\n // event delegation. This works well when Menu.Root is nested inside Menubar,\n // but with detached triggers we need to manually forward the event to the CompositeRoot.\n const relay = store.select('keyboardEventRelay');\n if (relay && !event.isPropagationStopped()) {\n relay(event);\n }\n }\n }), [getFloatingProps, parent.type, store]);\n const itemProps = React.useMemo(() => getItemProps(), [getItemProps]);\n store.useSyncedValues({\n floatingRootContext,\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n itemProps\n });\n const context = React.useMemo(() => ({\n store,\n parent: parentFromContext\n }), [store, parentFromContext]);\n const content = /*#__PURE__*/_jsx(MenuRootContext.Provider, {\n value: context,\n children: typeof children === 'function' ? children({\n payload\n }) : children\n });\n if (parent.type === undefined || parent.type === 'context-menu') {\n // set up a FloatingTree to provide the context to nested menus\n return /*#__PURE__*/_jsx(FloatingTree, {\n externalTree: floatingTreeRoot,\n children: content\n });\n }\n return content;\n});\nif (process.env.NODE_ENV !== \"production\") MenuRoot.displayName = \"MenuRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useCompositeRootContext } from \"../root/CompositeRootContext.js\";\nimport { useCompositeListItem } from \"../list/useCompositeListItem.js\";\nexport function useCompositeItem(params = {}) {\n const {\n highlightItemOnHover,\n highlightedIndex,\n onHighlightedIndexChange\n } = useCompositeRootContext();\n const {\n ref,\n index\n } = useCompositeListItem(params);\n const isHighlighted = highlightedIndex === index;\n const itemRef = React.useRef(null);\n const mergedRef = useMergedRefs(ref, itemRef);\n const compositeProps = React.useMemo(() => ({\n tabIndex: isHighlighted ? 0 : -1,\n onFocus() {\n onHighlightedIndexChange(index);\n },\n onMouseMove() {\n const item = itemRef.current;\n if (!highlightItemOnHover || !item) {\n return;\n }\n const disabled = item.hasAttribute('disabled') || item.ariaDisabled === 'true';\n if (!isHighlighted && !disabled) {\n item.focus();\n }\n }\n }), [isHighlighted, onHighlightedIndexChange, index, highlightItemOnHover]);\n return {\n compositeProps,\n compositeRef: mergedRef,\n index\n };\n}","'use client';\n\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useCompositeItem } from \"./useCompositeItem.js\";\nimport { EMPTY_OBJECT, EMPTY_ARRAY } from \"../../utils/constants.js\";\n/**\n * @internal\n */\nexport function CompositeItem(componentProps) {\n const {\n render,\n className,\n style,\n state = EMPTY_OBJECT,\n props = EMPTY_ARRAY,\n refs = EMPTY_ARRAY,\n metadata,\n stateAttributesMapping,\n tag = 'div',\n ...elementProps\n } = componentProps;\n const {\n compositeProps,\n compositeRef\n } = useCompositeItem({\n metadata\n });\n return useRenderElement(tag, componentProps, {\n state,\n ref: [...refs, compositeRef],\n props: [compositeProps, ...props, elementProps],\n stateAttributesMapping\n });\n}","import { getParentNode, isHTMLElement, isLastTraversableNode } from '@floating-ui/utils/dom';\nexport function findRootOwnerId(node) {\n if (isHTMLElement(node) && node.hasAttribute('data-rootownerid')) {\n return node.getAttribute('data-rootownerid') ?? undefined;\n }\n if (isLastTraversableNode(node)) {\n return undefined;\n }\n return findRootOwnerId(getParentNode(node));\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { contains, getNextTabbable, getTabbableAfterElement, getTabbableBeforeElement, isOutsideEvent } from \"../../floating-ui-react/utils.js\";\nimport { createChangeEventDetails } from \"../createBaseUIEventDetails.js\";\nimport { REASONS } from \"../reasons.js\";\n\n/**\n * Minimal store interface required by the focus guard hook.\n * Both PopoverStore and MenuStore satisfy this interface.\n */\n\n/**\n * Provides focus guard handlers for popup triggers (Popover, Menu).\n *\n * When the popup is open, invisible focus guard elements are placed before and after\n * the trigger. These handlers close the popup and move focus to the appropriate\n * tabbable element when the guards receive focus (i.e. when the user tabs out).\n */\nexport function useTriggerFocusGuards(store, triggerElementRef) {\n const preFocusGuardRef = React.useRef(null);\n const handlePreFocusGuardFocus = useStableCallback(event => {\n ReactDOM.flushSync(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent, event.currentTarget));\n });\n const previousTabbable = getTabbableBeforeElement(preFocusGuardRef.current);\n previousTabbable?.focus();\n });\n const handleFocusTargetFocus = useStableCallback(event => {\n const positionerElement = store.select('positionerElement');\n if (positionerElement && isOutsideEvent(event, positionerElement)) {\n store.context.beforeContentFocusGuardRef.current?.focus();\n } else {\n ReactDOM.flushSync(() => {\n store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent, event.currentTarget));\n });\n let nextTabbable = getTabbableAfterElement(store.context.triggerFocusTargetRef.current || triggerElementRef.current);\n while (nextTabbable !== null && contains(positionerElement, nextTabbable)) {\n const prevTabbable = nextTabbable;\n nextTabbable = getNextTabbable(nextTabbable);\n if (nextTabbable === prevTabbable) {\n break;\n }\n }\n nextTabbable?.focus();\n }\n });\n return {\n preFocusGuardRef,\n handlePreFocusGuardFocus,\n handleFocusTargetFocus\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { EMPTY_OBJECT } from \"./constants.js\";\n\n/**\n * Returns `click` and `mousedown` handlers that fix the behavior of triggers of popups that are toggled by different events.\n * For example, a button that opens a popup on mousedown and closes it on click.\n * This hook prevents the popup from closing immediately after the mouse button is released.\n */\nexport function useMixedToggleClickHandler(params) {\n const {\n enabled = true,\n mouseDownAction,\n open\n } = params;\n const ignoreClickRef = React.useRef(false);\n return React.useMemo(() => {\n if (!enabled) {\n return EMPTY_OBJECT;\n }\n return {\n onMouseDown: event => {\n if (mouseDownAction === 'open' && !open || mouseDownAction === 'close' && open) {\n ignoreClickRef.current = true;\n ownerDocument(event.currentTarget).addEventListener('click', () => {\n ignoreClickRef.current = false;\n }, {\n once: true\n });\n }\n },\n onClick: event => {\n if (ignoreClickRef.current) {\n ignoreClickRef.current = false;\n event.preventBaseUIHandler();\n }\n }\n };\n }, [enabled, mouseDownAction, open]);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { fastComponentRef } from '@base-ui/utils/fastHooks';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { safePolygon, useClick, useFloatingTree, useFocus, useHoverReferenceInteraction, useInteractions, useFloatingNodeId, useFloatingParentNodeId } from \"../../floating-ui-react/index.js\";\nimport { FloatingTreeStore } from \"../../floating-ui-react/components/FloatingTreeStore.js\";\nimport { contains } from \"../../floating-ui-react/utils.js\";\nimport { useMenuRootContext } from \"../root/MenuRootContext.js\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useButton } from \"../../use-button/useButton.js\";\nimport { getPseudoElementBounds } from \"../../utils/getPseudoElementBounds.js\";\nimport { CompositeItem } from \"../../composite/item/CompositeItem.js\";\nimport { useCompositeRootContext } from \"../../composite/root/CompositeRootContext.js\";\nimport { findRootOwnerId } from \"../utils/findRootOwnerId.js\";\nimport { useTriggerDataForwarding } from \"../../utils/popups/index.js\";\nimport { useTriggerFocusGuards } from \"../../utils/popups/useTriggerFocusGuards.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useMixedToggleClickHandler } from \"../../utils/useMixedToggleClickHandler.js\";\nimport { useContextMenuRootContext } from \"../../context-menu/root/ContextMenuRootContext.js\";\nimport { useMenubarContext } from \"../../menubar/MenubarContext.js\";\nimport { PATIENT_CLICK_THRESHOLD } from \"../../utils/constants.js\";\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst BOUNDARY_OFFSET = 2;\n\n/**\n * A button that opens the menu.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)\n */\nexport const MenuTrigger = fastComponentRef(function MenuTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n nativeButton = true,\n id: idProp,\n openOnHover: openOnHoverProp,\n delay = 100,\n closeDelay = 0,\n handle,\n payload,\n style,\n ...elementProps\n } = componentProps;\n const rootContext = useMenuRootContext(true);\n const store = handle?.store ?? rootContext?.store;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Menu.Trigger> must be either used within a <Menu.Root> component or provided with a handle.' : _formatErrorMessage(85));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const floatingRootContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const parent = useMenuParent();\n const compositeRootContext = useCompositeRootContext(true);\n const floatingTreeRootFromContext = useFloatingTree();\n const floatingTreeRoot = React.useMemo(() => {\n return floatingTreeRootFromContext ?? new FloatingTreeStore();\n }, [floatingTreeRootFromContext]);\n const floatingNodeId = useFloatingNodeId(floatingTreeRoot);\n const floatingParentNodeId = useFloatingParentNodeId();\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n closeDelay,\n parent,\n floatingTreeRoot,\n floatingNodeId,\n floatingParentNodeId,\n keyboardEventRelay: compositeRootContext?.relayKeyboardEvent\n });\n const isInMenubar = parent.type === 'menubar';\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp || rootDisabled || isInMenubar && parent.context.disabled;\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n React.useEffect(() => {\n if (!isOpenedByThisTrigger && parent.type === undefined) {\n store.context.allowMouseUpTriggerRef.current = false;\n }\n }, [store, isOpenedByThisTrigger, parent.type]);\n const triggerRef = React.useRef(null);\n const allowMouseUpTriggerTimeout = useTimeout();\n const handleDocumentMouseUp = useStableCallback(mouseEvent => {\n if (!triggerRef.current) {\n return;\n }\n allowMouseUpTriggerTimeout.clear();\n store.context.allowMouseUpTriggerRef.current = false;\n const mouseUpTarget = mouseEvent.target;\n if (contains(triggerRef.current, mouseUpTarget) || contains(store.select('positionerElement'), mouseUpTarget) || mouseUpTarget === triggerRef.current) {\n return;\n }\n if (mouseUpTarget != null && findRootOwnerId(mouseUpTarget) === store.select('rootId')) {\n return;\n }\n const bounds = getPseudoElementBounds(triggerRef.current);\n if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {\n return;\n }\n floatingTreeRoot.events.emit('close', {\n domEvent: mouseEvent,\n reason: REASONS.cancelOpen\n });\n });\n React.useEffect(() => {\n if (isOpenedByThisTrigger && store.select('lastOpenChangeReason') === REASONS.triggerHover) {\n const doc = ownerDocument(triggerRef.current);\n doc.addEventListener('mouseup', handleDocumentMouseUp, {\n once: true\n });\n }\n }, [isOpenedByThisTrigger, handleDocumentMouseUp, store]);\n const parentMenubarHasSubmenuOpen = isInMenubar && parent.context.hasSubmenuOpen;\n const openOnHover = openOnHoverProp ?? parentMenubarHasSubmenuOpen;\n const hoverProps = useHoverReferenceInteraction(floatingRootContext, {\n enabled: openOnHover && !disabled && parent.type !== 'context-menu' && (!isInMenubar || parentMenubarHasSubmenuOpen && !isMountedByThisTrigger),\n handleClose: safePolygon({\n blockPointerEvents: !isInMenubar\n }),\n mouseOnly: true,\n move: false,\n restMs: parent.type === undefined ? delay : undefined,\n delay: {\n close: closeDelay\n },\n triggerElementRef,\n externalTree: floatingTreeRoot,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending'\n });\n\n // Whether to ignore clicks to open the menu.\n // `lastOpenChangeReason` doesn't need to be reactive here, as we need to run this\n // only when `isOpenedByThisTrigger` changes.\n const stickIfOpen = useStickIfOpen(isOpenedByThisTrigger, store.select('lastOpenChangeReason'));\n const click = useClick(floatingRootContext, {\n enabled: !disabled && parent.type !== 'context-menu',\n event: isOpenedByThisTrigger && isInMenubar ? 'click' : 'mousedown',\n toggle: true,\n ignoreMouse: false,\n stickIfOpen: parent.type === undefined ? stickIfOpen : false\n });\n const focus = useFocus(floatingRootContext, {\n enabled: !disabled && parentMenubarHasSubmenuOpen\n });\n const mixedToggleHandlers = useMixedToggleClickHandler({\n open: isOpenedByThisTrigger,\n enabled: isInMenubar,\n mouseDownAction: 'open'\n });\n const localInteractionProps = useInteractions([click, focus]);\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n const ref = [triggerRef, forwardedRef, buttonRef, registerTrigger, triggerElementRef];\n const props = [localInteractionProps.getReferenceProps(), hoverProps ?? EMPTY_OBJECT, rootTriggerProps, {\n 'aria-haspopup': 'menu',\n id: thisTriggerId,\n onMouseDown: event => {\n if (store.select('open')) {\n return;\n }\n\n // mousedown -> mouseup on menu item should not trigger it within 200ms.\n allowMouseUpTriggerTimeout.start(200, () => {\n store.context.allowMouseUpTriggerRef.current = true;\n });\n const doc = ownerDocument(event.currentTarget);\n doc.addEventListener('mouseup', handleDocumentMouseUp, {\n once: true\n });\n }\n }, isInMenubar ? {\n role: 'menuitem'\n } : {}, mixedToggleHandlers, elementProps, getButtonProps];\n const {\n preFocusGuardRef,\n handlePreFocusGuardFocus,\n handleFocusTargetFocus\n } = useTriggerFocusGuards(store, triggerElementRef);\n const element = useRenderElement('button', componentProps, {\n enabled: !isInMenubar,\n stateAttributesMapping: pressableTriggerOpenStateMapping,\n state,\n ref,\n props\n });\n if (isInMenubar) {\n return /*#__PURE__*/_jsx(CompositeItem, {\n tag: \"button\",\n render: render,\n className: className,\n style: style,\n state: state,\n refs: ref,\n props: props,\n stateAttributesMapping: pressableTriggerOpenStateMapping\n });\n }\n\n // A fragment with key is required to ensure that the `element` is mounted to the same DOM node\n // regardless of whether the focus guards are rendered or not.\n\n if (isOpenedByThisTrigger) {\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(FocusGuard, {\n ref: preFocusGuardRef,\n onFocus: handlePreFocusGuardFocus\n }, `${thisTriggerId}-pre-focus-guard`), /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId), /*#__PURE__*/_jsx(FocusGuard, {\n ref: store.context.triggerFocusTargetRef,\n onFocus: handleFocusTargetFocus\n }, `${thisTriggerId}-post-focus-guard`)]\n });\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId);\n});\nif (process.env.NODE_ENV !== \"production\") MenuTrigger.displayName = \"MenuTrigger\";\n/**\n * Determines whether to ignore clicks after a hover-open.\n */\nfunction useStickIfOpen(open, openReason) {\n const stickIfOpenTimeout = useTimeout();\n const [stickIfOpen, setStickIfOpen] = React.useState(false);\n useIsoLayoutEffect(() => {\n if (open && openReason === 'trigger-hover') {\n // Only allow \"patient\" clicks to close the menu if it's open.\n // If they clicked within 500ms of the menu opening, keep it open.\n setStickIfOpen(true);\n stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {\n setStickIfOpen(false);\n });\n } else if (!open) {\n stickIfOpenTimeout.clear();\n setStickIfOpen(false);\n }\n }, [open, openReason, stickIfOpenTimeout]);\n return stickIfOpen;\n}\nfunction useMenuParent() {\n const contextMenuContext = useContextMenuRootContext(true);\n const parentContext = useMenuRootContext(true);\n const menubarContext = useMenubarContext(true);\n const parent = React.useMemo(() => {\n if (menubarContext) {\n return {\n type: 'menubar',\n context: menubarContext\n };\n }\n\n // Ensure this is not a Menu nested inside ContextMenu.Trigger.\n // ContextMenu parentContext is always undefined as ContextMenu.Root is instantiated with\n // <MenuRootContext.Provider value={undefined}>\n if (contextMenuContext && !parentContext) {\n return {\n type: 'context-menu',\n context: contextMenuContext\n };\n }\n return {\n type: undefined\n };\n }, [contextMenuContext, parentContext, menubarContext]);\n return parent;\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * Returns a previous value of its argument.\n * @param value Current value.\n * @returns Previous value, or null if there is no previous value.\n */\nexport function usePreviousValue(value) {\n const [state, setState] = React.useState({\n current: value,\n previous: null\n });\n if (value !== state.current) {\n setState({\n current: value,\n previous: state.current\n });\n }\n return state.previous;\n}","import { round } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement } from '@floating-ui/utils/dom';\nexport function getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height\n };\n}","'use client';\n\nimport * as React from 'react';\n/**\n * @internal\n */\nexport const CSPContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") CSPContext.displayName = \"CSPContext\";\nconst DEFAULT_CSP_CONTEXT_VALUE = {\n disableStyleElements: false\n};\n\n/**\n * @internal\n */\nexport function useCSPContext() {\n return React.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;\n}","export function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const FieldsetRootContext = /*#__PURE__*/React.createContext({\n legendId: undefined,\n setLegendId: () => {},\n disabled: undefined\n});\nif (process.env.NODE_ENV !== \"production\") FieldsetRootContext.displayName = \"FieldsetRootContext\";\nexport function useFieldsetRootContext(optional = false) {\n const context = React.useContext(FieldsetRootContext);\n if (!context && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.' : _formatErrorMessage(86));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useFieldRootContext } from \"../root/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../root/useRegisterFieldControl.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { fieldValidityMapping } from \"../utils/constants.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { activeElement } from \"../../floating-ui-react/utils.js\";\n\n/**\n * The form control to label and validate.\n * Renders an `<input>` element.\n *\n * You can omit this part and use any Base UI input component instead. For example,\n * [Input](https://base-ui.com/react/components/input), [Checkbox](https://base-ui.com/react/components/checkbox),\n * or [Select](https://base-ui.com/react/components/select), among others, will work with Field out of the box.\n *\n * Documentation: [Base UI Field](https://base-ui.com/react/components/field)\n */\nexport const FieldControl = /*#__PURE__*/React.forwardRef(function FieldControl(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n name: nameProp,\n value: valueProp,\n disabled: disabledProp = false,\n onValueChange,\n defaultValue,\n autoFocus = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState,\n name: fieldName,\n disabled: fieldDisabled,\n setTouched,\n setDirty,\n validityData,\n setFocused,\n setFilled,\n validationMode,\n validation\n } = useFieldRootContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const state = {\n ...fieldState,\n disabled\n };\n const {\n labelId\n } = useLabelableContext();\n const id = useLabelableId({\n id: idProp\n });\n useIsoLayoutEffect(() => {\n const hasExternalValue = valueProp != null;\n if (validation.inputRef.current?.value || hasExternalValue && valueProp !== '') {\n setFilled(true);\n } else if (hasExternalValue && valueProp === '') {\n setFilled(false);\n }\n }, [validation.inputRef, setFilled, valueProp]);\n const inputRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {\n setFocused(true);\n }\n }, [autoFocus, setFocused]);\n const [valueUnwrapped] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: 'FieldControl',\n state: 'value'\n });\n const isControlled = valueProp !== undefined;\n const value = isControlled ? valueUnwrapped : undefined;\n const getFieldValue = useStableCallback(() => validation.inputRef.current?.value);\n useRegisterFieldControl(validation.inputRef, {\n id,\n value,\n getValue: getFieldValue\n });\n const element = useRenderElement('input', componentProps, {\n ref: [forwardedRef, inputRef],\n state,\n props: [{\n id,\n disabled,\n name,\n ref: validation.inputRef,\n 'aria-labelledby': labelId,\n autoFocus,\n ...(isControlled ? {\n value\n } : {\n defaultValue\n }),\n onChange(event) {\n const inputValue = event.currentTarget.value;\n onValueChange?.(inputValue, createChangeEventDetails(REASONS.none, event.nativeEvent));\n setDirty(inputValue !== validityData.initialValue);\n setFilled(inputValue !== '');\n },\n onFocus() {\n setFocused(true);\n },\n onBlur(event) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(event.currentTarget.value);\n }\n },\n onKeyDown(event) {\n if (event.currentTarget.tagName === 'INPUT' && event.key === 'Enter') {\n setTouched(true);\n validation.commit(event.currentTarget.value);\n }\n }\n }, validation.getInputValidationProps(), elementProps],\n stateAttributesMapping: fieldValidityMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") FieldControl.displayName = \"FieldControl\";","'use client';\n\nimport * as React from 'react';\nimport { Field } from \"../field/index.js\";\n\n/**\n * A native input element that automatically works with [Field](https://base-ui.com/react/components/field).\n * Renders an `<input>` element.\n *\n * Documentation: [Base UI Input](https://base-ui.com/react/components/input)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const Input = /*#__PURE__*/React.forwardRef(function Input(props, forwardedRef) {\n return /*#__PURE__*/_jsx(Field.Control, {\n ref: forwardedRef,\n ...props\n });\n});\nif (process.env.NODE_ENV !== \"production\") Input.displayName = \"Input\";","export const ACTIVE_COMPOSITE_ITEM = 'data-composite-item-active';","'use client';\n\nimport * as React from 'react';\nimport { isElementDisabled } from '@base-ui/utils/isElementDisabled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { ALL_KEYS, ARROW_DOWN, ARROW_KEYS, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, END, HOME, HORIZONTAL_KEYS, HORIZONTAL_KEYS_WITH_EXTRA_KEYS, MODIFIER_KEYS, VERTICAL_KEYS, VERTICAL_KEYS_WITH_EXTRA_KEYS, createGridCellMap, findNonDisabledListIndex, getGridCellIndexOfCorner, getGridCellIndices, getGridNavigatedIndex, getMaxListIndex, getMinListIndex, isListIndexDisabled, isIndexOutOfListBounds, isNativeInput, scrollIntoViewIfNeeded } from \"../composite.js\";\nimport { ACTIVE_COMPOSITE_ITEM } from \"../constants.js\";\nimport { getTarget } from \"../../floating-ui-react/utils.js\";\nconst EMPTY_ARRAY = [];\nexport function useCompositeRoot(params) {\n const {\n itemSizes,\n cols = 1,\n loopFocus = true,\n onLoop,\n dense = false,\n orientation = 'both',\n direction,\n highlightedIndex: externalHighlightedIndex,\n onHighlightedIndexChange: externalSetHighlightedIndex,\n rootRef: externalRef,\n enableHomeAndEndKeys = false,\n stopEventPropagation = false,\n disabledIndices,\n modifierKeys = EMPTY_ARRAY\n } = params;\n const [internalHighlightedIndex, internalSetHighlightedIndex] = React.useState(0);\n const isGrid = cols > 1;\n const rootRef = React.useRef(null);\n const mergedRef = useMergedRefs(rootRef, externalRef);\n const elementsRef = React.useRef([]);\n const hasSetDefaultIndexRef = React.useRef(false);\n const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;\n const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {\n (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);\n if (shouldScrollIntoView) {\n const newActiveItem = elementsRef.current[index];\n scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);\n }\n });\n const onMapChange = useStableCallback(map => {\n if (map.size === 0 || hasSetDefaultIndexRef.current) {\n return;\n }\n hasSetDefaultIndexRef.current = true;\n const sortedElements = Array.from(map.keys());\n const activeItem = sortedElements.find(compositeElement => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;\n // Set the default highlighted index of an arbitrary composite item.\n const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;\n if (activeIndex !== -1) {\n onHighlightedIndexChange(activeIndex);\n }\n scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);\n });\n const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {\n if (!onLoop) {\n return nextIndex;\n }\n return onLoop?.(event, prevIndex, nextIndex, elementsRef);\n });\n const props = React.useMemo(() => ({\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ref: mergedRef,\n onFocus(event) {\n const element = rootRef.current;\n const target = getTarget(event.nativeEvent);\n if (!element || target == null || !isNativeInput(target)) {\n return;\n }\n target.setSelectionRange(0, target.value.length ?? 0);\n },\n onKeyDown(event) {\n const RELEVANT_KEYS = enableHomeAndEndKeys ? ALL_KEYS : ARROW_KEYS;\n if (!RELEVANT_KEYS.has(event.key)) {\n return;\n }\n if (isModifierKeySet(event, modifierKeys)) {\n return;\n }\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const isRtl = direction === 'rtl';\n const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;\n const forwardKey = {\n horizontal: horizontalForwardKey,\n vertical: ARROW_DOWN,\n both: horizontalForwardKey\n }[orientation];\n const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;\n const backwardKey = {\n horizontal: horizontalBackwardKey,\n vertical: ARROW_UP,\n both: horizontalBackwardKey\n }[orientation];\n const target = getTarget(event.nativeEvent);\n if (target != null && isNativeInput(target) && !isElementDisabled(target)) {\n const selectionStart = target.selectionStart;\n const selectionEnd = target.selectionEnd;\n const textContent = target.value ?? '';\n // return to native textbox behavior when\n // 1 - Shift is held to make a text selection, or if there already is a text selection\n if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {\n return;\n }\n // 2 - arrow-ing forward and not in the last position of the text\n if (event.key !== backwardKey && selectionStart < textContent.length) {\n return;\n }\n // 3 -arrow-ing backward and not in the first position of the text\n if (event.key !== forwardKey && selectionStart > 0) {\n return;\n }\n }\n let nextIndex = highlightedIndex;\n const minIndex = getMinListIndex(elementsRef, disabledIndices);\n const maxIndex = getMaxListIndex(elementsRef, disabledIndices);\n if (isGrid) {\n const sizes = itemSizes || Array.from({\n length: elementsRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = createGridCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);\n nextIndex = cellMap[getGridNavigatedIndex(cellMap.map(itemIndex => itemIndex != null ? elementsRef.current[itemIndex] : null), {\n event,\n orientation,\n loopFocus,\n onLoop: wrappedOnLoop,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getGridCellIndices([...(disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef.current, index) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getGridCellIndexOfCorner(highlightedIndex > maxIndex ? minIndex : highlightedIndex, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction we're\n // moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n // eslint-disable-next-line no-nested-ternary\n event.key === ARROW_DOWN ? 'bl' : event.key === ARROW_RIGHT ? 'tr' : 'tl'),\n rtl: isRtl\n })]; // navigated cell will never be nullish\n }\n const forwardKeys = {\n horizontal: [horizontalForwardKey],\n vertical: [ARROW_DOWN],\n both: [horizontalForwardKey, ARROW_DOWN]\n }[orientation];\n const backwardKeys = {\n horizontal: [horizontalBackwardKey],\n vertical: [ARROW_UP],\n both: [horizontalBackwardKey, ARROW_UP]\n }[orientation];\n const preventedKeys = isGrid ? RELEVANT_KEYS : {\n horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,\n vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,\n both: RELEVANT_KEYS\n }[orientation];\n if (enableHomeAndEndKeys) {\n if (event.key === HOME) {\n nextIndex = minIndex;\n } else if (event.key === END) {\n nextIndex = maxIndex;\n }\n }\n if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {\n if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {\n nextIndex = minIndex;\n if (onLoop) {\n nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);\n }\n } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {\n nextIndex = maxIndex;\n if (onLoop) {\n nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);\n }\n } else {\n nextIndex = findNonDisabledListIndex(elementsRef.current, {\n startingIndex: nextIndex,\n decrement: backwardKeys.includes(event.key),\n disabledIndices\n });\n }\n }\n if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {\n if (stopEventPropagation) {\n event.stopPropagation();\n }\n if (preventedKeys.has(event.key)) {\n event.preventDefault();\n }\n onHighlightedIndexChange(nextIndex, true);\n\n // Wait for FocusManager `returnFocus` to execute.\n queueMicrotask(() => {\n elementsRef.current[nextIndex]?.focus();\n });\n }\n }\n }), [cols, dense, direction, disabledIndices, elementsRef, enableHomeAndEndKeys, highlightedIndex, isGrid, itemSizes, loopFocus, onLoop, wrappedOnLoop, mergedRef, modifierKeys, onHighlightedIndexChange, orientation, stopEventPropagation]);\n return React.useMemo(() => ({\n props,\n highlightedIndex,\n onHighlightedIndexChange,\n elementsRef,\n disabledIndices,\n onMapChange,\n relayKeyboardEvent: props.onKeyDown\n }), [props, highlightedIndex, onHighlightedIndexChange, elementsRef, disabledIndices, onMapChange]);\n}\nfunction isModifierKeySet(event, ignoredModifierKeys) {\n for (const key of MODIFIER_KEYS.values()) {\n if (ignoredModifierKeys.includes(key)) {\n continue;\n }\n if (event.getModifierState(key)) {\n return true;\n }\n }\n return false;\n}","'use client';\n\nimport * as React from 'react';\nimport { CompositeList } from \"../list/CompositeList.js\";\nimport { useCompositeRoot } from \"./useCompositeRoot.js\";\nimport { CompositeRootContext } from \"./CompositeRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useDirection } from \"../../direction-provider/DirectionContext.js\";\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from \"../../utils/constants.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * @internal\n */\nexport function CompositeRoot(componentProps) {\n const {\n render,\n className,\n style,\n refs = EMPTY_ARRAY,\n props = EMPTY_ARRAY,\n state = EMPTY_OBJECT,\n stateAttributesMapping,\n highlightedIndex: highlightedIndexProp,\n onHighlightedIndexChange: onHighlightedIndexChangeProp,\n orientation,\n dense,\n itemSizes,\n loopFocus,\n onLoop,\n cols,\n enableHomeAndEndKeys,\n onMapChange: onMapChangeProp,\n stopEventPropagation = true,\n rootRef,\n disabledIndices,\n modifierKeys,\n highlightItemOnHover = false,\n tag = 'div',\n ...elementProps\n } = componentProps;\n const direction = useDirection();\n const {\n props: defaultProps,\n highlightedIndex,\n onHighlightedIndexChange,\n elementsRef,\n onMapChange: onMapChangeUnwrapped,\n relayKeyboardEvent\n } = useCompositeRoot({\n itemSizes,\n cols,\n loopFocus,\n onLoop,\n dense,\n orientation,\n highlightedIndex: highlightedIndexProp,\n onHighlightedIndexChange: onHighlightedIndexChangeProp,\n rootRef,\n stopEventPropagation,\n enableHomeAndEndKeys,\n direction,\n disabledIndices,\n modifierKeys\n });\n const element = useRenderElement(tag, componentProps, {\n state,\n ref: refs,\n props: [defaultProps, ...props, elementProps],\n stateAttributesMapping\n });\n const contextValue = React.useMemo(() => ({\n highlightedIndex,\n onHighlightedIndexChange,\n highlightItemOnHover,\n relayKeyboardEvent\n }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);\n return /*#__PURE__*/_jsx(CompositeRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: elementsRef,\n onMapChange: newMap => {\n onMapChangeProp?.(newMap);\n onMapChangeUnwrapped(newMap);\n },\n children: element\n })\n });\n}","export const cache = new Map();\nexport function getFormatter(locale, options) {\n const optionsString = JSON.stringify({\n locale,\n options\n });\n const cachedFormatter = cache.get(optionsString);\n if (cachedFormatter) {\n return cachedFormatter;\n }\n const formatter = new Intl.NumberFormat(locale, options);\n cache.set(optionsString, formatter);\n return formatter;\n}\nexport function formatNumber(value, locale, options) {\n if (value == null) {\n return '';\n }\n return getFormatter(locale, options).format(value);\n}\nexport function formatNumberMaxPrecision(value, locale, options) {\n return formatNumber(value, locale, {\n ...options,\n maximumFractionDigits: 20\n });\n}\nexport function formatNumberValue(value, locale, format) {\n if (value == null) {\n return '';\n }\n if (!format) {\n return formatNumber(value / 100, locale, {\n style: 'percent'\n });\n }\n return formatNumber(value, locale, format);\n}","export function valueToPercent(value, min, max) {\n return (value - min) * 100 / (max - min);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const PopoverRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") PopoverRootContext.displayName = \"PopoverRootContext\";\nexport function usePopoverRootContext(optional) {\n const context = React.useContext(PopoverRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.' : _formatErrorMessage(47));\n }\n return context;\n}","/* eslint-disable react-hooks/rules-of-hooks */\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { ReactStore, createSelector } from '@base-ui/utils/store';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.js\";\nimport { PATIENT_CLICK_THRESHOLD } from \"../../utils/constants.js\";\nfunction createInitialState() {\n return {\n ...createInitialPopupStoreState(),\n disabled: false,\n modal: false,\n focusManagerModal: false,\n instantType: undefined,\n openMethod: null,\n openChangeReason: null,\n titleElementId: undefined,\n descriptionElementId: undefined,\n stickIfOpen: true,\n nested: false,\n openOnHover: false,\n closeDelay: 0,\n hasViewport: false\n };\n}\nconst selectors = {\n ...popupStoreSelectors,\n disabled: createSelector(state => state.disabled),\n instantType: createSelector(state => state.instantType),\n openMethod: createSelector(state => state.openMethod),\n openChangeReason: createSelector(state => state.openChangeReason),\n modal: createSelector(state => state.modal),\n focusManagerModal: createSelector(state => state.focusManagerModal),\n stickIfOpen: createSelector(state => state.stickIfOpen),\n titleElementId: createSelector(state => state.titleElementId),\n descriptionElementId: createSelector(state => state.descriptionElementId),\n openOnHover: createSelector(state => state.openOnHover),\n closeDelay: createSelector(state => state.closeDelay),\n hasViewport: createSelector(state => state.hasViewport)\n};\nexport class PopoverStore extends ReactStore {\n constructor(initialState) {\n const initial = {\n ...createInitialState(),\n ...initialState\n };\n if (initial.open && initialState?.mounted === undefined) {\n initial.mounted = true;\n }\n super(initial, {\n popupRef: /*#__PURE__*/React.createRef(),\n backdropRef: /*#__PURE__*/React.createRef(),\n internalBackdropRef: /*#__PURE__*/React.createRef(),\n onOpenChange: undefined,\n onOpenChangeComplete: undefined,\n triggerFocusTargetRef: /*#__PURE__*/React.createRef(),\n beforeContentFocusGuardRef: /*#__PURE__*/React.createRef(),\n stickIfOpenTimeout: new Timeout(),\n triggerElements: new PopupTriggerMap()\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n const isHover = eventDetails.reason === REASONS.triggerHover;\n const isKeyboardClick = eventDetails.reason === REASONS.triggerPress && eventDetails.event.detail === 0;\n const isDismissClose = !nextOpen && (eventDetails.reason === REASONS.escapeKey || eventDetails.reason == null);\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const updatedState = {\n open: nextOpen,\n openChangeReason: eventDetails.reason\n };\n\n // If a popup is closing, the `trigger` may be null.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n const newTriggerId = eventDetails.trigger?.id ?? null;\n if (newTriggerId || nextOpen) {\n updatedState.activeTriggerId = newTriggerId;\n updatedState.activeTriggerElement = eventDetails.trigger ?? null;\n }\n this.update(updatedState);\n };\n if (isHover) {\n // Only allow \"patient\" clicks to close the popover if it's open.\n // If they clicked within 500ms of the popover opening, keep it open.\n this.set('stickIfOpen', true);\n this.context.stickIfOpenTimeout.start(PATIENT_CLICK_THRESHOLD, () => {\n this.set('stickIfOpen', false);\n });\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n if (isKeyboardClick || isDismissClose) {\n this.set('instantType', isKeyboardClick ? 'click' : 'dismiss');\n } else if (eventDetails.reason === REASONS.focusOut) {\n this.set('instantType', 'focus');\n } else {\n this.set('instantType', undefined);\n }\n };\n static useStore(externalStore, initialState) {\n const internalStore = useRefWithInit(() => {\n return new PopoverStore(initialState);\n }).current;\n const store = externalStore ?? internalStore;\n useOnMount(internalStore.disposeEffect);\n return store;\n }\n disposeEffect = () => {\n return this.context.stickIfOpenTimeout.disposeEffect();\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useDismiss, useInteractions, useRole, FloatingTree, useFloatingParentNodeId, useSyncedFloatingRootContext } from \"../../floating-ui-react/index.js\";\nimport { PopoverRootContext, usePopoverRootContext } from \"./PopoverRootContext.js\";\nimport { PopoverStore } from \"../store/PopoverStore.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions } from \"../../utils/popups/index.js\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction PopoverRootComponent({\n props\n}) {\n const {\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onOpenChangeComplete,\n modal = false,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null\n } = props;\n const store = PopoverStore.useStore(handle?.store, {\n modal,\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp\n });\n\n // Support initially open state when uncontrolled\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen === true) {\n store.update({\n open: true,\n activeTriggerId: defaultTriggerIdProp\n });\n }\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n const open = store.useState('open');\n const payload = store.useState('payload');\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const {\n openMethod,\n triggerProps: interactionTypeTriggerProps\n } = useOpenInteractionType(open);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount\n } = useOpenStateTransitions(open, store, () => {\n store.update({\n stickIfOpen: true,\n openChangeReason: null\n });\n });\n React.useEffect(() => {\n if (!open) {\n store.context.stickIfOpenTimeout.clear();\n }\n }, [store, open]);\n const createPopoverEventDetails = React.useCallback(reason => {\n const details = createChangeEventDetails(reason);\n details.preventUnmountOnClose = () => {\n store.set('preventUnmountingOnClose', true);\n };\n return details;\n }, [store]);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createPopoverEventDetails(REASONS.imperativeAction));\n }, [store, createPopoverEventDetails]);\n React.useImperativeHandle(props.actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n const floatingRootContext = useSyncedFloatingRootContext({\n popupStore: store,\n onOpenChange: store.setOpen\n });\n const dismiss = useDismiss(floatingRootContext, {\n outsidePressEvent: {\n // Ensure `aria-hidden` on outside elements is removed immediately\n // on outside press when trapping focus.\n mouse: modal === 'trap-focus' ? 'sloppy' : 'intentional',\n touch: 'sloppy'\n }\n });\n const role = useRole(floatingRootContext);\n const {\n getReferenceProps,\n getFloatingProps,\n getTriggerProps\n } = useInteractions([dismiss, role]);\n const activeTriggerProps = React.useMemo(() => {\n return getReferenceProps(interactionTypeTriggerProps);\n }, [getReferenceProps, interactionTypeTriggerProps]);\n const inactiveTriggerProps = React.useMemo(() => {\n return getTriggerProps(interactionTypeTriggerProps);\n }, [getTriggerProps, interactionTypeTriggerProps]);\n const popupProps = React.useMemo(() => {\n return getFloatingProps();\n }, [getFloatingProps]);\n store.useSyncedValues({\n modal,\n openMethod,\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps,\n floatingRootContext,\n nested: useFloatingParentNodeId() != null\n });\n const popoverContext = React.useMemo(() => ({\n store\n }), [store]);\n return /*#__PURE__*/_jsx(PopoverRootContext.Provider, {\n value: popoverContext,\n children: typeof children === 'function' ? children({\n payload\n }) : children\n });\n}\n\n/**\n * Groups all parts of the popover.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport function PopoverRoot(props) {\n if (usePopoverRootContext(true)) {\n return /*#__PURE__*/_jsx(PopoverRootComponent, {\n props: props\n });\n }\n return /*#__PURE__*/_jsx(FloatingTree, {\n children: /*#__PURE__*/_jsx(PopoverRootComponent, {\n props: props\n })\n });\n}","export const OPEN_DELAY = 300;","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { useButton } from \"../../use-button/useButton.js\";\nimport { triggerOpenStateMapping, pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { CLICK_TRIGGER_IDENTIFIER } from \"../../utils/constants.js\";\nimport { safePolygon, useClick, useHoverReferenceInteraction, useInteractions } from \"../../floating-ui-react/index.js\";\nimport { OPEN_DELAY } from \"../utils/constants.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useTriggerDataForwarding } from \"../../utils/popups/index.js\";\nimport { useTriggerFocusGuards } from \"../../utils/popups/useTriggerFocusGuards.js\";\n\n/**\n * A button that opens the popover.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PopoverTrigger = /*#__PURE__*/React.forwardRef(function PopoverTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n nativeButton = true,\n handle,\n payload,\n openOnHover = false,\n delay = OPEN_DELAY,\n closeDelay = 0,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const rootContext = usePopoverRootContext(true);\n const store = handle?.store ?? rootContext?.store;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.' : _formatErrorMessage(74));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const floatingContext = store.useState('floatingRootContext');\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const triggerElementRef = React.useRef(null);\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n disabled,\n openOnHover,\n closeDelay\n });\n const openReason = store.useState('openChangeReason');\n const stickIfOpen = store.useState('stickIfOpen');\n const openMethod = store.useState('openMethod');\n const focusManagerModal = store.useState('focusManagerModal');\n const hoverProps = useHoverReferenceInteraction(floatingContext, {\n enabled: floatingContext != null && openOnHover && (openMethod !== 'touch' || openReason !== REASONS.triggerPress),\n mouseOnly: true,\n move: false,\n handleClose: safePolygon(),\n restMs: delay,\n delay: {\n close: closeDelay\n },\n triggerElementRef,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending'\n });\n const click = useClick(floatingContext, {\n enabled: floatingContext != null,\n stickIfOpen\n });\n const localProps = useInteractions([click]);\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n const state = {\n disabled,\n open: isOpenedByThisTrigger\n };\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const stateAttributesMapping = React.useMemo(() => ({\n open(value) {\n if (value && openReason === REASONS.triggerPress) {\n return pressableTriggerOpenStateMapping.open(value);\n }\n return triggerOpenStateMapping.open(value);\n }\n }), [openReason]);\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],\n props: [localProps.getReferenceProps(), hoverProps, rootTriggerProps, {\n [CLICK_TRIGGER_IDENTIFIER]: '',\n id: thisTriggerId\n }, elementProps, getButtonProps],\n stateAttributesMapping\n });\n const {\n preFocusGuardRef,\n handlePreFocusGuardFocus,\n handleFocusTargetFocus\n } = useTriggerFocusGuards(store, triggerElementRef);\n\n // A fragment with key is required to ensure that the `element` is mounted to the same DOM node\n // regardless of whether the focus guards are rendered or not.\n\n if (isTriggerActive && !focusManagerModal) {\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(FocusGuard, {\n ref: preFocusGuardRef,\n onFocus: handlePreFocusGuardFocus\n }), /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId), /*#__PURE__*/_jsx(FocusGuard, {\n ref: store.context.triggerFocusTargetRef,\n onFocus: handleFocusTargetFocus\n })]\n });\n }\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: element\n }, thisTriggerId);\n});\nif (process.env.NODE_ENV !== \"production\") PopoverTrigger.displayName = \"PopoverTrigger\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const PopoverPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") PopoverPortalContext.displayName = \"PopoverPortalContext\";\nexport function usePopoverPortalContext() {\n const value = React.useContext(PopoverPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Popover.Portal> is missing.' : _formatErrorMessage(45));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { FloatingPortal } from \"../../floating-ui-react/index.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { PopoverPortalContext } from \"./PopoverPortalContext.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const PopoverPortal = /*#__PURE__*/React.forwardRef(function PopoverPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const {\n store\n } = usePopoverRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(PopoverPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverPortal.displayName = \"PopoverPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const PopoverPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") PopoverPositionerContext.displayName = \"PopoverPositionerContext\";\nexport function usePopoverPositionerContext() {\n const context = React.useContext(PopoverPositionerContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.' : _formatErrorMessage(46));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { FloatingNode, useFloatingNodeId } from \"../../floating-ui-react/index.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { PopoverPositionerContext } from \"./PopoverPositionerContext.js\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.js\";\nimport { usePopoverPortalContext } from \"../portal/PopoverPortalContext.js\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { POPUP_COLLISION_AVOIDANCE } from \"../../utils/constants.js\";\nimport { useAnimationsFinished } from \"../../utils/useAnimationsFinished.js\";\nimport { adaptiveOrigin } from \"../../utils/adaptiveOriginMiddleware.js\";\nimport { usePositioner } from \"../../utils/usePositioner.js\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.js\";\n\n/**\n * Positions the popover against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const PopoverPositioner = /*#__PURE__*/React.forwardRef(function PopoverPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n positionMethod = 'absolute',\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance = POPUP_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const keepMounted = usePopoverPortalContext();\n const nodeId = useFloatingNodeId();\n const floatingRootContext = store.useState('floatingRootContext');\n const mounted = store.useState('mounted');\n const open = store.useState('open');\n const openReason = store.useState('openChangeReason');\n const triggerElement = store.useState('activeTriggerElement');\n const modal = store.useState('modal');\n const openMethod = store.useState('openMethod');\n const positionerElement = store.useState('positionerElement');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const hasViewport = store.useState('hasViewport');\n const prevTriggerElementRef = React.useRef(null);\n const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking,\n keepMounted,\n nodeId,\n collisionAvoidance,\n adaptiveOrigin: hasViewport ? adaptiveOrigin : undefined\n });\n const domReference = floatingRootContext.useState('domReferenceElement');\n\n // When the current trigger element changes, enable transitions on the\n // positioner temporarily\n useIsoLayoutEffect(() => {\n const currentTriggerElement = domReference;\n const prevTriggerElement = prevTriggerElementRef.current;\n if (currentTriggerElement) {\n prevTriggerElementRef.current = currentTriggerElement;\n }\n if (prevTriggerElement && currentTriggerElement && currentTriggerElement !== prevTriggerElement) {\n store.set('instantType', undefined);\n const ac = new AbortController();\n runOnceAnimationsFinish(() => {\n store.set('instantType', 'trigger-change');\n }, ac.signal);\n return () => {\n ac.abort();\n };\n }\n return undefined;\n }, [domReference, runOnceAnimationsFinish, store]);\n const state = {\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n instant: instantType\n };\n useAnchoredPopupScrollLock(open && modal === true && openReason !== REASONS.triggerHover, openMethod === 'touch', positionerElement, triggerElement);\n const setPositionerElement = React.useCallback(element => {\n store.set('positionerElement', element);\n }, [store]);\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n return /*#__PURE__*/_jsxs(PopoverPositionerContext.Provider, {\n value: positioning,\n children: [mounted && modal === true && openReason !== REASONS.triggerHover && /*#__PURE__*/_jsx(InternalBackdrop, {\n ref: store.context.internalBackdropRef,\n inert: inertValue(!open),\n cutout: triggerElement\n }), /*#__PURE__*/_jsx(FloatingNode, {\n id: nodeId,\n children: element\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverPositioner.displayName = \"PopoverPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst ClosePartContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ClosePartContext.displayName = \"ClosePartContext\";\nexport function useClosePartCount() {\n const [closePartCount, setClosePartCount] = React.useState(0);\n const register = useStableCallback(() => {\n setClosePartCount(count => count + 1);\n return () => {\n setClosePartCount(count => Math.max(0, count - 1));\n };\n });\n const context = React.useMemo(() => ({\n register\n }), [register]);\n return {\n context,\n hasClosePart: closePartCount > 0\n };\n}\nexport function ClosePartProvider(props) {\n const {\n value,\n children\n } = props;\n return /*#__PURE__*/_jsx(ClosePartContext.Provider, {\n value: value,\n children: children\n });\n}\nexport function useClosePartRegistration() {\n const context = React.useContext(ClosePartContext);\n useIsoLayoutEffect(() => {\n return context?.register();\n }, [context]);\n}","'use client';\n\nimport * as React from 'react';\nimport { isHTMLElement } from '@floating-ui/utils/dom';\nimport { FloatingFocusManager, useHoverFloatingInteraction } from \"../../floating-ui-react/index.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { usePopoverPositionerContext } from \"../positioner/PopoverPositionerContext.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { COMPOSITE_KEYS } from \"../../composite/composite.js\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.js\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.js\";\nimport { ClosePartProvider, useClosePartCount } from \"../../utils/closePart.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the popover contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverPopup = /*#__PURE__*/React.forwardRef(function PopoverPopup(componentProps, forwardedRef) {\n const {\n className,\n render,\n initialFocus,\n finalFocus,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const positioner = usePopoverPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const {\n context: closePartContext,\n hasClosePart\n } = useClosePartCount();\n const open = store.useState('open');\n const openMethod = store.useState('openMethod');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const titleId = store.useState('titleElementId');\n const descriptionId = store.useState('descriptionElementId');\n const modal = store.useState('modal');\n const mounted = store.useState('mounted');\n const openReason = store.useState('openChangeReason');\n const activeTriggerElement = store.useState('activeTriggerElement');\n const floatingContext = store.useState('floatingRootContext');\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const disabled = store.useState('disabled');\n const openOnHover = store.useState('openOnHover');\n const closeDelay = store.useState('closeDelay');\n useHoverFloatingInteraction(floatingContext, {\n enabled: openOnHover && !disabled,\n closeDelay\n });\n\n // Default initial focus logic:\n // If opened by touch, focus the popup element to prevent the virtual keyboard from opening\n // (this is required for Android specifically as iOS handles this automatically).\n function defaultInitialFocus(interactionType) {\n if (interactionType === 'touch') {\n return store.context.popupRef.current;\n }\n return true;\n }\n const resolvedInitialFocus = initialFocus === undefined ? defaultInitialFocus : initialFocus;\n const state = {\n open,\n side: positioner.side,\n align: positioner.align,\n instant: instantType,\n transitionStatus\n };\n const focusManagerModal = modal !== false && hasClosePart;\n store.useSyncedValue('focusManagerModal', focusManagerModal);\n const setPopupElement = React.useCallback(element => {\n store.set('popupElement', element);\n }, [store]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, setPopupElement],\n props: [popupProps, {\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n onKeyDown(event) {\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n }\n }, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingContext,\n openInteractionType: openMethod,\n modal: focusManagerModal,\n disabled: !mounted || openReason === REASONS.triggerHover,\n initialFocus: resolvedInitialFocus,\n returnFocus: finalFocus,\n restoreFocus: \"popup\",\n previousFocusableElement: isHTMLElement(activeTriggerElement) ? activeTriggerElement : undefined,\n nextFocusableElement: store.context.triggerFocusTargetRef,\n beforeContentFocusGuardRef: store.context.beforeContentFocusGuardRef,\n children: /*#__PURE__*/_jsx(ClosePartProvider, {\n value: closePartContext,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") PopoverPopup.displayName = \"PopoverPopup\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverPositionerContext } from \"../positioner/PopoverPositionerContext.js\";\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * Displays an element positioned against the popover anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverArrow = /*#__PURE__*/React.forwardRef(function PopoverArrow(componentProps, forwardedRef) {\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = usePopoverRootContext();\n const open = store.useState('open');\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = usePopoverPositionerContext();\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, arrowRef],\n props: [{\n style: arrowStyles,\n 'aria-hidden': true\n }, elementProps],\n stateAttributesMapping: popupStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverArrow.displayName = \"PopoverArrow\";","'use client';\n\nimport * as React from 'react';\nimport { usePopoverRootContext } from \"../root/PopoverRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useClosePartRegistration } from \"../../utils/closePart.js\";\n\n/**\n * A button that closes the popover.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Popover](https://base-ui.com/react/components/popover)\n */\nexport const PopoverClose = /*#__PURE__*/React.forwardRef(function PopoverClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n buttonRef,\n getButtonProps\n } = useButton({\n disabled,\n focusableWhenDisabled: false,\n native: nativeButton\n });\n const {\n store\n } = usePopoverRootContext();\n useClosePartRegistration();\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n props: [{\n onClick(event) {\n store.setOpen(false, createChangeEventDetails(REASONS.closePress, event.nativeEvent, event.currentTarget));\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") PopoverClose.displayName = \"PopoverClose\";","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { useFloatingPortalNode } from \"../floating-ui-react/index.js\";\n\n/**\n * `FloatingPortal` includes tabbable logic handling for focus management.\n * For components that don't need tabbable logic, use `FloatingPortalLite`.\n * @internal\n */\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const FloatingPortalLite = /*#__PURE__*/React.forwardRef(function FloatingPortalLite(componentProps, forwardedRef) {\n const {\n children,\n container,\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n portalNode,\n portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n if (!portalSubtree && !portalNode) {\n return null;\n }\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode)]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortalLite.displayName = \"FloatingPortalLite\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\n/**\n * @internal\n */\nexport const ProgressRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ProgressRootContext.displayName = \"ProgressRootContext\";\nexport function useProgressRootContext() {\n const context = React.useContext(ProgressRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ProgressRootContext is missing. Progress parts must be placed within <Progress.Root>.' : _formatErrorMessage(51));\n }\n return context;\n}","export let ProgressRootDataAttributes = /*#__PURE__*/function (ProgressRootDataAttributes) {\n /**\n * Present when the progress has completed.\n */\n ProgressRootDataAttributes[\"complete\"] = \"data-complete\";\n /**\n * Present when the progress is in indeterminate state.\n */\n ProgressRootDataAttributes[\"indeterminate\"] = \"data-indeterminate\";\n /**\n * Present while the progress is progressing.\n */\n ProgressRootDataAttributes[\"progressing\"] = \"data-progressing\";\n return ProgressRootDataAttributes;\n}({});","import { ProgressRootDataAttributes } from \"./ProgressRootDataAttributes.js\";\nexport const progressStateAttributesMapping = {\n status(value) {\n if (value === 'progressing') {\n return {\n [ProgressRootDataAttributes.progressing]: ''\n };\n }\n if (value === 'complete') {\n return {\n [ProgressRootDataAttributes.complete]: ''\n };\n }\n if (value === 'indeterminate') {\n return {\n [ProgressRootDataAttributes.indeterminate]: ''\n };\n }\n return null;\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\nimport { formatNumberValue } from \"../../utils/formatNumber.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { ProgressRootContext } from \"./ProgressRootContext.js\";\nimport { progressStateAttributesMapping } from \"./stateAttributesMapping.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction getDefaultAriaValueText(formattedValue, value) {\n if (value == null) {\n return 'indeterminate progress';\n }\n return formattedValue || `${value}%`;\n}\n\n/**\n * Groups all parts of the progress bar and provides the task completion status to screen readers.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)\n */\nexport const ProgressRoot = /*#__PURE__*/React.forwardRef(function ProgressRoot(componentProps, forwardedRef) {\n const {\n format,\n getAriaValueText = getDefaultAriaValueText,\n locale,\n max = 100,\n min = 0,\n value,\n render,\n className,\n children,\n style,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState();\n const formatOptionsRef = useValueAsRef(format);\n let status = 'indeterminate';\n if (Number.isFinite(value)) {\n status = value === max ? 'complete' : 'progressing';\n }\n const formattedValue = formatNumberValue(value, locale, formatOptionsRef.current);\n const state = React.useMemo(() => ({\n status\n }), [status]);\n const defaultProps = {\n 'aria-labelledby': labelId,\n 'aria-valuemax': max,\n 'aria-valuemin': min,\n 'aria-valuenow': value ?? undefined,\n 'aria-valuetext': getAriaValueText(formattedValue, value),\n role: 'progressbar',\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [children, /*#__PURE__*/_jsx(\"span\", {\n role: \"presentation\",\n style: visuallyHidden,\n children: \"x\"\n })]\n })\n };\n const contextValue = React.useMemo(() => ({\n formattedValue,\n max,\n min,\n setLabelId,\n state,\n status,\n value\n }), [formattedValue, max, min, setLabelId, state, status, value]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [defaultProps, elementProps],\n stateAttributesMapping: progressStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(ProgressRootContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ProgressRoot.displayName = \"ProgressRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useProgressRootContext } from \"../root/ProgressRootContext.js\";\nimport { progressStateAttributesMapping } from \"../root/stateAttributesMapping.js\";\n/**\n * Contains the progress bar indicator.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)\n */\nexport const ProgressTrack = /*#__PURE__*/React.forwardRef(function ProgressTrack(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n state\n } = useProgressRootContext();\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: elementProps,\n stateAttributesMapping: progressStateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ProgressTrack.displayName = \"ProgressTrack\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { valueToPercent } from \"../../utils/valueToPercent.js\";\nimport { useProgressRootContext } from \"../root/ProgressRootContext.js\";\nimport { progressStateAttributesMapping } from \"../root/stateAttributesMapping.js\";\n/**\n * Visualizes the completion status of the task.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Progress](https://base-ui.com/react/components/progress)\n */\nexport const ProgressIndicator = /*#__PURE__*/React.forwardRef(function ProgressIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n max,\n min,\n value,\n state\n } = useProgressRootContext();\n const percentageValue = Number.isFinite(value) && value !== null ? valueToPercent(value, min, max) : null;\n const getStyles = React.useCallback(() => {\n if (percentageValue == null) {\n return {};\n }\n return {\n insetInlineStart: 0,\n height: 'inherit',\n width: `${percentageValue}%`\n };\n }, [percentageValue]);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n style: getStyles()\n }, elementProps],\n stateAttributesMapping: progressStateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ProgressIndicator.displayName = \"ProgressIndicator\";","export let RadioRootDataAttributes = /*#__PURE__*/function (RadioRootDataAttributes) {\n /**\n * Present when the radio is checked.\n */\n RadioRootDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the radio is not checked.\n */\n RadioRootDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the radio is disabled.\n */\n RadioRootDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the radio is readonly.\n */\n RadioRootDataAttributes[\"readonly\"] = \"data-readonly\";\n /**\n * Present when the radio is required.\n */\n RadioRootDataAttributes[\"required\"] = \"data-required\";\n /**\n * Present when the radio is in valid state (when wrapped in Field.Root).\n */\n RadioRootDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the radio is in invalid state (when wrapped in Field.Root).\n */\n RadioRootDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the radio has been touched (when wrapped in Field.Root).\n */\n RadioRootDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the radio's value has changed (when wrapped in Field.Root).\n */\n RadioRootDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the radio is checked (when wrapped in Field.Root).\n */\n RadioRootDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the radio is focused (when wrapped in Field.Root).\n */\n RadioRootDataAttributes[\"focused\"] = \"data-focused\";\n return RadioRootDataAttributes;\n}({});","import { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { fieldValidityMapping } from \"../../field/utils/constants.js\";\nimport { RadioRootDataAttributes } from \"../root/RadioRootDataAttributes.js\";\nexport const stateAttributesMapping = {\n checked(value) {\n if (value) {\n return {\n [RadioRootDataAttributes.checked]: ''\n };\n }\n return {\n [RadioRootDataAttributes.unchecked]: ''\n };\n },\n ...transitionStatusMapping,\n ...fieldValidityMapping\n};","'use client';\n\nimport * as React from 'react';\nexport const RadioGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") RadioGroupContext.displayName = \"RadioGroupContext\";\nexport function useRadioGroupContext() {\n return React.useContext(RadioGroupContext);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const RadioRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") RadioRootContext.displayName = \"RadioRootContext\";\nexport function useRadioRootContext() {\n const value = React.useContext(RadioRootContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: RadioRootContext is missing. Radio parts must be placed within <Radio.Root>.' : _formatErrorMessage(52));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { EMPTY_OBJECT } from \"../../utils/constants.js\";\nimport { NOOP } from \"../../utils/noop.js\";\nimport { stateAttributesMapping } from \"../utils/stateAttributesMapping.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { ACTIVE_COMPOSITE_ITEM } from \"../../composite/constants.js\";\nimport { CompositeItem } from \"../../composite/item/CompositeItem.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useFieldItemContext } from \"../../field/item/FieldItemContext.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { useAriaLabelledBy } from \"../../labelable-provider/useAriaLabelledBy.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { useRadioGroupContext } from \"../../radio-group/RadioGroupContext.js\";\nimport { serializeValue } from \"../../utils/serializeValue.js\";\nimport { RadioRootContext } from \"./RadioRootContext.js\";\n\n/**\n * Represents the radio button itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const RadioRoot = /*#__PURE__*/React.forwardRef(function RadioRoot(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp = false,\n readOnly: readOnlyProp = false,\n required: requiredProp = false,\n 'aria-labelledby': ariaLabelledByProp,\n value,\n inputRef: inputRefProp,\n nativeButton = false,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const groupContext = useRadioGroupContext();\n const {\n disabled: disabledGroup,\n readOnly: readOnlyGroup,\n required: requiredGroup,\n form: formGroup,\n checkedValue,\n touched = false,\n validation,\n name\n } = groupContext ?? {};\n const setCheckedValue = groupContext?.setCheckedValue ?? NOOP;\n const setTouched = groupContext?.setTouched ?? NOOP;\n const registerControlRef = groupContext?.registerControlRef ?? NOOP;\n const registerInputRef = groupContext?.registerInputRef ?? NOOP;\n const {\n setDirty,\n validityData,\n setTouched: setFieldTouched,\n setFilled,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const fieldItemContext = useFieldItemContext();\n const {\n labelId,\n getDescriptionProps\n } = useLabelableContext();\n const disabled = fieldDisabled || fieldItemContext.disabled || disabledGroup || disabledProp;\n const readOnly = readOnlyGroup || readOnlyProp;\n const required = requiredGroup || requiredProp;\n const form = formGroup;\n const checked = groupContext ? checkedValue === value : value === '';\n const serializedValue = React.useMemo(() => serializeValue(value), [value]);\n const radioRef = React.useRef(null);\n const inputRef = React.useRef(null);\n const handleControlRef = useStableCallback(element => {\n if (!element) {\n return;\n }\n registerControlRef(element, disabled);\n });\n const mergedInputRef = useMergedRefs(inputRefProp, inputRef, registerInputRef);\n useIsoLayoutEffect(() => {\n if (inputRef.current?.checked) {\n setFilled(true);\n }\n }, [setFilled]);\n useIsoLayoutEffect(() => {\n if (!inputRef.current) {\n return;\n }\n if (disabled && checked) {\n registerInputRef(null);\n return;\n }\n if (radioRef.current) {\n registerControlRef(radioRef.current, disabled);\n }\n registerInputRef(inputRef.current);\n }, [checked, disabled, registerControlRef, registerInputRef]);\n const id = useBaseUiId();\n const inputId = useLabelableId({\n id: idProp,\n implicit: false,\n controlRef: radioRef\n });\n const hiddenInputId = nativeButton ? undefined : inputId;\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);\n const rootProps = {\n role: 'radio',\n 'aria-checked': checked,\n 'aria-required': required || undefined,\n 'aria-readonly': readOnly || undefined,\n 'aria-labelledby': ariaLabelledBy,\n [ACTIVE_COMPOSITE_ITEM]: checked ? '' : undefined,\n id: nativeButton ? inputId : id,\n onKeyDown(event) {\n if (event.key === 'Enter') {\n event.preventDefault();\n }\n },\n onClick(event) {\n if (event.defaultPrevented || disabled || readOnly) {\n return;\n }\n event.preventDefault();\n inputRef.current?.dispatchEvent(new PointerEvent('click', {\n bubbles: true,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n }));\n },\n onFocus(event) {\n if (event.defaultPrevented || disabled || readOnly || !touched) {\n return;\n }\n inputRef.current?.click();\n setTouched(false);\n }\n };\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const inputProps = {\n type: 'radio',\n ref: mergedInputRef,\n form,\n id: hiddenInputId,\n name,\n tabIndex: -1,\n style: name ? visuallyHiddenInput : visuallyHidden,\n 'aria-hidden': true,\n ...(value !== undefined ? {\n value: serializedValue\n } : EMPTY_OBJECT),\n disabled,\n checked,\n required,\n readOnly,\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (disabled || readOnly || value === undefined) {\n return;\n }\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n if (details.isCanceled) {\n return;\n }\n setFieldTouched(true);\n setDirty(value !== validityData.initialValue);\n setFilled(true);\n setCheckedValue(value, details);\n },\n onFocus() {\n radioRef.current?.focus();\n }\n };\n const state = React.useMemo(() => ({\n ...fieldState,\n required,\n disabled,\n readOnly,\n checked\n }), [fieldState, disabled, readOnly, checked, required]);\n const contextValue = state;\n const isRadioGroup = groupContext !== undefined;\n const refs = [forwardedRef, radioRef, buttonRef, handleControlRef];\n const props = [rootProps, getDescriptionProps, validation?.getValidationProps ?? EMPTY_OBJECT, elementProps, getButtonProps];\n const element = useRenderElement('span', componentProps, {\n enabled: !isRadioGroup,\n state,\n ref: refs,\n props,\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(RadioRootContext.Provider, {\n value: contextValue,\n children: [isRadioGroup ? /*#__PURE__*/_jsx(CompositeItem, {\n tag: \"span\",\n render: render,\n className: className,\n style: style,\n state: state,\n refs: refs,\n props: props,\n stateAttributesMapping: stateAttributesMapping\n }) : element, /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") RadioRoot.displayName = \"RadioRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useRadioRootContext } from \"../root/RadioRootContext.js\";\nimport { stateAttributesMapping } from \"../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\n\n/**\n * Indicates whether the radio button is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Radio](https://base-ui.com/react/components/radio)\n */\nexport const RadioIndicator = /*#__PURE__*/React.forwardRef(function RadioIndicator(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const rootState = useRadioRootContext();\n const rendered = rootState.checked;\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(rendered);\n const state = {\n ...rootState,\n transitionStatus\n };\n const indicatorRef = React.useRef(null);\n const shouldRender = keepMounted || mounted;\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: elementProps,\n stateAttributesMapping\n });\n useOpenChangeComplete({\n open: rendered,\n ref: indicatorRef,\n onComplete() {\n if (!rendered) {\n setMounted(false);\n }\n }\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") RadioIndicator.displayName = \"RadioIndicator\";","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useBaseUiId } from \"../utils/useBaseUiId.js\";\nimport { contains } from \"../floating-ui-react/utils.js\";\nimport { SHIFT } from \"../composite/composite.js\";\nimport { CompositeRoot } from \"../composite/root/CompositeRoot.js\";\nimport { useFieldRootContext } from \"../field/root/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../field/root/useRegisterFieldControl.js\";\nimport { fieldValidityMapping } from \"../field/utils/constants.js\";\nimport { useFieldsetRootContext } from \"../fieldset/root/FieldsetRootContext.js\";\nimport { useFormContext } from \"../form/FormContext.js\";\nimport { useLabelableContext } from \"../labelable-provider/LabelableContext.js\";\nimport { useValueChanged } from \"../utils/useValueChanged.js\";\nimport { RadioGroupContext } from \"./RadioGroupContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MODIFIER_KEYS = [SHIFT];\n\n/**\n * Provides a shared state to a series of radio buttons.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Radio Group](https://base-ui.com/react/components/radio)\n */\nexport const RadioGroup = /*#__PURE__*/React.forwardRef(function RadioGroup(componentProps, forwardedRef) {\n const {\n render,\n className,\n disabled: disabledProp,\n readOnly,\n required,\n onValueChange: onValueChangeProp,\n value: externalValue,\n defaultValue,\n form,\n name: nameProp,\n inputRef: inputRefProp,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched: setFieldTouched,\n setFocused,\n shouldValidateOnChange,\n validationMode,\n name: fieldName,\n disabled: fieldDisabled,\n state: fieldState,\n validation,\n setDirty,\n setFilled,\n validityData\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const {\n clearErrors\n } = useFormContext();\n const fieldsetContext = useFieldsetRootContext(true);\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const id = useBaseUiId(idProp);\n const [checkedValue, setCheckedValueUnwrapped] = useControlled({\n controlled: externalValue,\n default: defaultValue,\n name: 'RadioGroup',\n state: 'value'\n });\n const onValueChange = useStableCallback(onValueChangeProp);\n const setCheckedValue = useStableCallback((value, eventDetails) => {\n onValueChange(value, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedValueUnwrapped(value);\n });\n const controlRef = React.useRef(null);\n const groupInputRef = React.useRef(null);\n const firstEnabledInputRef = React.useRef(null);\n function setInputRef(hiddenInput) {\n let cleanup = undefined;\n if (inputRefProp) {\n if (typeof inputRefProp === 'function') {\n cleanup = inputRefProp(hiddenInput);\n } else {\n inputRefProp.current = hiddenInput;\n }\n }\n groupInputRef.current = hiddenInput;\n validation.inputRef.current = hiddenInput;\n return cleanup;\n }\n const registerControlRef = useStableCallback((element, isDisabled = false) => {\n if (!element) {\n return;\n }\n if (isDisabled) {\n if (controlRef.current === element) {\n controlRef.current = null;\n }\n return;\n }\n if (controlRef.current == null) {\n controlRef.current = element;\n }\n });\n const registerInputRef = useStableCallback(input => {\n if (!input || input.disabled) {\n return undefined;\n }\n if (!firstEnabledInputRef.current) {\n firstEnabledInputRef.current = input;\n }\n const currentInput = groupInputRef.current;\n if (input.checked || currentInput == null || currentInput.disabled) {\n return setInputRef(input);\n }\n return undefined;\n });\n const getFieldValue = useStableCallback(() => checkedValue ?? null);\n useRegisterFieldControl(controlRef, {\n id,\n value: checkedValue,\n getValue: getFieldValue\n });\n useValueChanged(checkedValue, () => {\n clearErrors(name);\n setDirty(checkedValue !== validityData.initialValue);\n setFilled(checkedValue != null);\n if (shouldValidateOnChange()) {\n validation.commit(checkedValue);\n } else {\n validation.commit(checkedValue, true);\n }\n const fallbackInput = firstEnabledInputRef.current;\n if (checkedValue == null && fallbackInput && !fallbackInput.disabled) {\n setInputRef(fallbackInput);\n }\n });\n const [touched, setTouched] = React.useState(false);\n const ariaLabelledby = elementProps['aria-labelledby'] ?? labelId ?? fieldsetContext?.legendId;\n const state = {\n ...fieldState,\n disabled: disabled ?? false,\n required: required ?? false,\n readOnly: readOnly ?? false\n };\n const contextValue = React.useMemo(() => ({\n ...fieldState,\n checkedValue,\n disabled,\n form,\n validation,\n name,\n onValueChange,\n readOnly,\n registerControlRef,\n registerInputRef,\n required,\n setCheckedValue,\n setTouched,\n touched\n }), [checkedValue, disabled, form, validation, fieldState, name, onValueChange, readOnly, registerControlRef, registerInputRef, required, setCheckedValue, setTouched, touched]);\n const defaultProps = {\n role: 'radiogroup',\n 'aria-required': required || undefined,\n 'aria-disabled': disabled || undefined,\n 'aria-readonly': readOnly || undefined,\n 'aria-labelledby': ariaLabelledby,\n onFocus() {\n setFocused(true);\n },\n onBlur(event) {\n if (!contains(event.currentTarget, event.relatedTarget)) {\n setFieldTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(checkedValue);\n }\n }\n },\n onKeyDownCapture(event) {\n if (event.key.startsWith('Arrow')) {\n setFieldTouched(true);\n setTouched(true);\n setFocused(true);\n }\n }\n };\n return /*#__PURE__*/_jsx(RadioGroupContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsx(CompositeRoot, {\n render: render,\n className: className,\n style: style,\n state: state,\n props: [defaultProps, validation.getValidationProps, elementProps],\n refs: [forwardedRef],\n stateAttributesMapping: fieldValidityMapping,\n enableHomeAndEndKeys: false,\n modifierKeys: MODIFIER_KEYS\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") RadioGroup.displayName = \"RadioGroup\";","import { jsx as _jsx } from \"react/jsx-runtime\";\nconst DISABLE_SCROLLBAR_CLASS_NAME = 'base-ui-disable-scrollbar';\nexport const styleDisableScrollbar = {\n className: DISABLE_SCROLLBAR_CLASS_NAME,\n getElement(nonce) {\n return /*#__PURE__*/_jsx(\"style\", {\n nonce: nonce,\n href: DISABLE_SCROLLBAR_CLASS_NAME,\n precedence: \"base-ui:low\",\n children: `.${DISABLE_SCROLLBAR_CLASS_NAME}{scrollbar-width:none}.${DISABLE_SCROLLBAR_CLASS_NAME}::-webkit-scrollbar{display:none}`\n });\n }\n};\nif (process.env.NODE_ENV !== \"production\") styleDisableScrollbar.getElement.displayName = \"styleDisableScrollbar.getElement\";","import { clamp } from \"./clamp.js\";\nexport const SCROLL_EDGE_TOLERANCE_PX = 1;\nexport function getMaxScrollOffset(scrollSize, clientSize) {\n return Math.max(0, scrollSize - clientSize);\n}\nexport function normalizeScrollOffset(value, max) {\n if (max <= 0) {\n return 0;\n }\n const clamped = clamp(value, 0, max);\n const startDistance = clamped;\n const endDistance = max - clamped;\n const withinStartTolerance = startDistance <= SCROLL_EDGE_TOLERANCE_PX;\n const withinEndTolerance = endDistance <= SCROLL_EDGE_TOLERANCE_PX;\n if (withinStartTolerance && withinEndTolerance) {\n return startDistance <= endDistance ? 0 : max;\n }\n if (withinStartTolerance) {\n return 0;\n }\n if (withinEndTolerance) {\n return max;\n }\n return clamped;\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectRootContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") SelectRootContext.displayName = \"SelectRootContext\";\nexport const SelectFloatingContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") SelectFloatingContext.displayName = \"SelectFloatingContext\";\nexport function useSelectRootContext() {\n const context = React.useContext(SelectRootContext);\n if (context === null) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(60));\n }\n return context;\n}\nexport function useSelectFloatingContext() {\n const context = React.useContext(SelectFloatingContext);\n if (context === null) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.' : _formatErrorMessage(61));\n }\n return context;\n}","import { createSelector } from '@base-ui/utils/store';\nimport { compareItemEquality } from \"../utils/itemEquality.js\";\nimport { hasNullItemLabel, stringifyAsValue } from \"../utils/resolveValueLabel.js\";\nexport const selectors = {\n id: createSelector(state => state.id),\n labelId: createSelector(state => state.labelId),\n modal: createSelector(state => state.modal),\n multiple: createSelector(state => state.multiple),\n items: createSelector(state => state.items),\n itemToStringLabel: createSelector(state => state.itemToStringLabel),\n itemToStringValue: createSelector(state => state.itemToStringValue),\n isItemEqualToValue: createSelector(state => state.isItemEqualToValue),\n value: createSelector(state => state.value),\n hasSelectedValue: createSelector(state => {\n const {\n value,\n multiple,\n itemToStringValue\n } = state;\n if (value == null) {\n return false;\n }\n if (multiple && Array.isArray(value)) {\n return value.length > 0;\n }\n return stringifyAsValue(value, itemToStringValue) !== '';\n }),\n hasNullItemLabel: createSelector((state, enabled) => {\n return enabled ? hasNullItemLabel(state.items) : false;\n }),\n open: createSelector(state => state.open),\n mounted: createSelector(state => state.mounted),\n forceMount: createSelector(state => state.forceMount),\n transitionStatus: createSelector(state => state.transitionStatus),\n openMethod: createSelector(state => state.openMethod),\n activeIndex: createSelector(state => state.activeIndex),\n selectedIndex: createSelector(state => state.selectedIndex),\n isActive: createSelector((state, index) => state.activeIndex === index),\n isSelected: createSelector((state, index, itemValue) => {\n const comparer = state.isItemEqualToValue;\n const storeValue = state.value;\n if (state.multiple) {\n return Array.isArray(storeValue) && storeValue.some(selectedItem => compareItemEquality(itemValue, selectedItem, comparer));\n }\n\n // `selectedIndex` is only updated after the items mount for the first time,\n // the value check avoids a re-render for the initially selected item.\n if (state.selectedIndex === index && state.selectedIndex !== null) {\n return true;\n }\n return compareItemEquality(itemValue, storeValue, comparer);\n }),\n isSelectedByFocus: createSelector((state, index) => {\n return state.selectedIndex === index;\n }),\n popupProps: createSelector(state => state.popupProps),\n triggerProps: createSelector(state => state.triggerProps),\n triggerElement: createSelector(state => state.triggerElement),\n positionerElement: createSelector(state => state.positionerElement),\n listElement: createSelector(state => state.listElement),\n scrollUpArrowVisible: createSelector(state => state.scrollUpArrowVisible),\n scrollDownArrowVisible: createSelector(state => state.scrollDownArrowVisible),\n hasScrollArrows: createSelector(state => state.hasScrollArrows)\n};","'use client';\n\nimport * as React from 'react';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { usePreviousValue } from '@base-ui/utils/usePreviousValue';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore, Store } from '@base-ui/utils/store';\nimport { useClick, useDismiss, useFloatingRootContext, useInteractions, useListNavigation, useTypeahead } from \"../../floating-ui-react/index.js\";\nimport { SelectRootContext, SelectFloatingContext } from \"./SelectRootContext.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../../field/root/useRegisterFieldControl.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { selectors } from \"../store.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useFormContext } from \"../../form/FormContext.js\";\nimport { stringifyAsLabel, stringifyAsValue } from \"../../utils/resolveValueLabel.js\";\nimport { EMPTY_ARRAY, EMPTY_OBJECT } from \"../../utils/constants.js\";\nimport { defaultItemEquality, findItemIndex } from \"../../utils/itemEquality.js\";\nimport { useValueChanged } from \"../../utils/useValueChanged.js\";\nimport { useOpenInteractionType } from \"../../utils/useOpenInteractionType.js\";\nimport { getMaxScrollOffset, normalizeScrollOffset } from \"../../utils/scrollEdges.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\n\n/**\n * Groups all parts of the select.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function SelectRoot(props) {\n const {\n id,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n name: nameProp,\n form,\n autoComplete,\n disabled: disabledProp = false,\n readOnly = false,\n required = false,\n modal = true,\n actionsRef,\n inputRef,\n onOpenChangeComplete,\n items,\n multiple = false,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue = defaultItemEquality,\n highlightItemOnHover = true,\n children\n } = props;\n const {\n clearErrors\n } = useFormContext();\n const {\n setDirty,\n setTouched,\n setFocused,\n shouldValidateOnChange,\n validityData,\n setFilled,\n name: fieldName,\n disabled: fieldDisabled,\n validation,\n validationMode\n } = useFieldRootContext();\n const generatedId = useLabelableId({\n id\n });\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const [value, setValueUnwrapped] = useControlled({\n controlled: valueProp,\n default: multiple ? defaultValue ?? EMPTY_ARRAY : defaultValue,\n name: 'Select',\n state: 'value'\n });\n const [open, setOpenUnwrapped] = useControlled({\n controlled: openProp,\n default: defaultOpen,\n name: 'Select',\n state: 'open'\n });\n const listRef = React.useRef([]);\n const labelsRef = React.useRef([]);\n const popupRef = React.useRef(null);\n const scrollHandlerRef = React.useRef(null);\n const scrollArrowsMountedCountRef = React.useRef(0);\n const valueRef = React.useRef(null);\n const valuesRef = React.useRef([]);\n const typingRef = React.useRef(false);\n const keyboardActiveRef = React.useRef(false);\n const selectedItemTextRef = React.useRef(null);\n const selectionRef = React.useRef({\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false\n });\n const alignItemWithTriggerActiveRef = React.useRef(false);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open);\n const {\n openMethod,\n triggerProps: interactionTypeProps\n } = useOpenInteractionType(open);\n const store = useRefWithInit(() => new Store({\n id: generatedId,\n labelId: undefined,\n modal,\n multiple,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n value,\n open,\n mounted,\n transitionStatus,\n items,\n forceMount: false,\n openMethod: null,\n activeIndex: null,\n selectedIndex: null,\n popupProps: {},\n triggerProps: {},\n triggerElement: null,\n positionerElement: null,\n listElement: null,\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false,\n hasScrollArrows: false\n })).current;\n const activeIndex = useStore(store, selectors.activeIndex);\n const selectedIndex = useStore(store, selectors.selectedIndex);\n const triggerElement = useStore(store, selectors.triggerElement);\n const positionerElement = useStore(store, selectors.positionerElement);\n const previousOpenMethod = usePreviousValue(openMethod);\n const renderedOpenMethod = openMethod ?? previousOpenMethod;\n const serializedValue = React.useMemo(() => {\n if (multiple && Array.isArray(value) && value.length === 0) {\n return '';\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const fieldStringValue = React.useMemo(() => {\n if (multiple && Array.isArray(value)) {\n return value.map(currentValue => stringifyAsValue(currentValue, itemToStringValue));\n }\n return stringifyAsValue(value, itemToStringValue);\n }, [multiple, value, itemToStringValue]);\n const controlRef = useValueAsRef(store.state.triggerElement);\n const getFieldValue = useStableCallback(() => fieldStringValue);\n useRegisterFieldControl(controlRef, {\n id: generatedId,\n value,\n getValue: getFieldValue\n });\n const initialValueRef = React.useRef(value);\n useIsoLayoutEffect(() => {\n // Ensure the values and labels are registered for programmatic value changes.\n if (value !== initialValueRef.current) {\n store.set('forceMount', true);\n }\n }, [store, value]);\n useIsoLayoutEffect(() => {\n setFilled(multiple ? Array.isArray(value) && value.length > 0 : value != null);\n }, [multiple, value, setFilled]);\n useIsoLayoutEffect(function syncSelectedIndex() {\n if (open) {\n return;\n }\n const registry = valuesRef.current;\n if (multiple) {\n const currentValue = Array.isArray(value) ? value : [];\n if (currentValue.length === 0) {\n store.set('selectedIndex', null);\n return;\n }\n const lastValue = currentValue[currentValue.length - 1];\n const lastIndex = findItemIndex(registry, lastValue, isItemEqualToValue);\n store.set('selectedIndex', lastIndex === -1 ? null : lastIndex);\n return;\n }\n const index = findItemIndex(registry, value, isItemEqualToValue);\n store.set('selectedIndex', index === -1 ? null : index);\n }, [multiple, open, value, valuesRef, isItemEqualToValue, store]);\n useValueChanged(value, () => {\n clearErrors(name);\n setDirty(value !== validityData.initialValue);\n if (shouldValidateOnChange()) {\n validation.commit(value);\n } else {\n validation.commit(value, true);\n }\n });\n const setOpen = useStableCallback((nextOpen, eventDetails) => {\n onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setOpenUnwrapped(nextOpen);\n if (!nextOpen && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n }\n\n // The active index will sync to the last selected index on the next open.\n // Workaround `enableFocusInside` in Floating UI setting `tabindex=0` of a non-highlighted\n // option upon close when tabbing out due to `keepMounted=true`:\n // https://github.com/floating-ui/floating-ui/pull/3004/files#diff-962a7439cdeb09ea98d4b622a45d517bce07ad8c3f866e089bda05f4b0bbd875R194-R199\n // This otherwise causes options to retain `tabindex=0` incorrectly when the popup is closed\n // when tabbing outside.\n if (!nextOpen && store.state.activeIndex !== null) {\n const activeOption = listRef.current[store.state.activeIndex];\n // Wait for Floating UI's focus effect to have fired\n queueMicrotask(() => {\n activeOption?.setAttribute('tabindex', '-1');\n });\n }\n });\n const handleUnmount = useStableCallback(() => {\n setMounted(false);\n store.update({\n activeIndex: null,\n openMethod: null\n });\n onOpenChangeComplete?.(false);\n });\n useOpenChangeComplete({\n enabled: !actionsRef,\n open,\n ref: popupRef,\n onComplete() {\n if (!open) {\n handleUnmount();\n }\n }\n });\n React.useImperativeHandle(actionsRef, () => ({\n unmount: handleUnmount\n }), [handleUnmount]);\n const setValue = useStableCallback((nextValue, eventDetails) => {\n onValueChange?.(nextValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValueUnwrapped(nextValue);\n });\n const handleScrollArrowVisibility = useStableCallback(() => {\n const scroller = store.state.listElement || popupRef.current;\n if (!scroller) {\n return;\n }\n const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);\n const shouldShowUp = scrollTop > 0;\n const shouldShowDown = scrollTop < maxScrollTop;\n if (store.state.scrollUpArrowVisible !== shouldShowUp) {\n store.set('scrollUpArrowVisible', shouldShowUp);\n }\n if (store.state.scrollDownArrowVisible !== shouldShowDown) {\n store.set('scrollDownArrowVisible', shouldShowDown);\n }\n });\n const floatingContext = useFloatingRootContext({\n open,\n onOpenChange: setOpen,\n elements: {\n reference: triggerElement,\n floating: positionerElement\n }\n });\n const click = useClick(floatingContext, {\n enabled: !readOnly && !disabled,\n event: 'mousedown'\n });\n const dismiss = useDismiss(floatingContext, {\n bubbles: false\n });\n const listNavigation = useListNavigation(floatingContext, {\n enabled: !readOnly && !disabled,\n listRef,\n activeIndex,\n selectedIndex,\n disabledIndices: EMPTY_ARRAY,\n onNavigate(nextActiveIndex) {\n // Retain the highlight while transitioning out.\n if (nextActiveIndex === null && !open) {\n return;\n }\n store.set('activeIndex', nextActiveIndex);\n },\n focusItemOnHover: highlightItemOnHover\n });\n const typeahead = useTypeahead(floatingContext, {\n enabled: !readOnly && !disabled && (open || !multiple),\n listRef: labelsRef,\n activeIndex,\n selectedIndex,\n onMatch(index) {\n if (open) {\n store.set('activeIndex', index);\n } else {\n setValue(valuesRef.current[index], createChangeEventDetails('none'));\n }\n },\n onTypingChange(typing) {\n typingRef.current = typing;\n }\n });\n const {\n getReferenceProps,\n getFloatingProps,\n getItemProps\n } = useInteractions([click, dismiss, listNavigation, typeahead]);\n const mergedTriggerProps = React.useMemo(() => {\n return mergeProps(getReferenceProps(), interactionTypeProps, generatedId ? {\n id: generatedId\n } : EMPTY_OBJECT);\n }, [getReferenceProps, interactionTypeProps, generatedId]);\n useOnFirstRender(() => {\n store.update({\n popupProps: getFloatingProps(),\n triggerProps: mergedTriggerProps\n });\n });\n useIsoLayoutEffect(() => {\n store.update({\n id: generatedId,\n modal,\n multiple,\n value,\n open,\n mounted,\n transitionStatus,\n popupProps: getFloatingProps(),\n triggerProps: mergedTriggerProps,\n items,\n itemToStringLabel,\n itemToStringValue,\n isItemEqualToValue,\n openMethod: renderedOpenMethod\n });\n }, [store, generatedId, modal, multiple, value, open, mounted, transitionStatus, getFloatingProps, mergedTriggerProps, items, itemToStringLabel, itemToStringValue, isItemEqualToValue, renderedOpenMethod]);\n const contextValue = React.useMemo(() => ({\n store,\n name,\n required,\n disabled,\n readOnly,\n multiple,\n itemToStringLabel,\n itemToStringValue,\n highlightItemOnHover,\n setValue,\n setOpen,\n listRef,\n popupRef,\n scrollHandlerRef,\n handleScrollArrowVisibility,\n scrollArrowsMountedCountRef,\n getItemProps,\n events: floatingContext.context.events,\n valueRef,\n valuesRef,\n labelsRef,\n typingRef,\n selectionRef,\n selectedItemTextRef,\n validation,\n onOpenChangeComplete,\n keyboardActiveRef,\n alignItemWithTriggerActiveRef,\n initialValueRef\n }), [store, name, required, disabled, readOnly, multiple, itemToStringLabel, itemToStringValue, highlightItemOnHover, setValue, setOpen, getItemProps, floatingContext.context.events, validation, onOpenChangeComplete, handleScrollArrowVisibility]);\n const ref = useMergedRefs(inputRef, validation.inputRef);\n const hasMultipleSelection = multiple && Array.isArray(value) && value.length > 0;\n const hiddenInputName = multiple ? undefined : name;\n const hiddenInputs = React.useMemo(() => {\n if (!multiple || !Array.isArray(value) || !name) {\n return null;\n }\n return value.map(v => {\n const currentSerializedValue = stringifyAsValue(v, itemToStringValue);\n return /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: currentSerializedValue\n }, currentSerializedValue);\n });\n }, [multiple, value, form, name, itemToStringValue]);\n return /*#__PURE__*/_jsx(SelectRootContext.Provider, {\n value: contextValue,\n children: /*#__PURE__*/_jsxs(SelectFloatingContext.Provider, {\n value: floatingContext,\n children: [children, /*#__PURE__*/_jsx(\"input\", {\n ...validation.getInputValidationProps({\n onFocus() {\n // Move focus to the trigger element when the hidden input is focused.\n store.state.triggerElement?.focus({\n // Supported in Chrome from 144 (January 2026)\n focusVisible: true\n });\n },\n // Handle browser autofill.\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n const nextValue = event.currentTarget.value;\n const details = createChangeEventDetails(REASONS.none, event.nativeEvent);\n function handleChange() {\n if (multiple) {\n // Browser autofill only writes a single scalar value.\n return;\n }\n\n // Handle single selection: match against registered values using serialization\n const matchingValue = valuesRef.current.find(v => {\n // Try matching by value first (e.g., \"US\" for country code)\n const candidateValue = stringifyAsValue(v, itemToStringValue);\n if (candidateValue.toLowerCase() === nextValue.toLowerCase()) {\n return true;\n }\n // Also try matching by label for browser autofill compatibility\n // (browsers autofill with displayed text like \"United States\", not the underlying value)\n const candidateLabel = stringifyAsLabel(v, itemToStringLabel);\n if (candidateLabel.toLowerCase() === nextValue.toLowerCase()) {\n return true;\n }\n return false;\n });\n if (matchingValue != null) {\n setDirty(matchingValue !== validityData.initialValue);\n setValue(matchingValue, details);\n if (shouldValidateOnChange()) {\n validation.commit(matchingValue);\n }\n }\n }\n store.set('forceMount', true);\n queueMicrotask(handleChange);\n }\n }),\n id: generatedId && hiddenInputName == null ? `${generatedId}-hidden-input` : undefined,\n form: form,\n name: hiddenInputName,\n autoComplete: autoComplete,\n value: serializedValue,\n disabled: disabled,\n required: required && !hasMultipleSelection,\n readOnly: readOnly,\n ref: ref,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n \"aria-hidden\": true,\n suppressHydrationWarning: true\n }), hiddenInputs]\n })\n });\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { pressableTriggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { fieldValidityMapping } from \"../../field/utils/constants.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { selectors } from \"../store.js\";\nimport { getPseudoElementBounds } from \"../../utils/getPseudoElementBounds.js\";\nimport { contains, getFloatingFocusElement } from \"../../floating-ui-react/utils.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { resolveAriaLabelledBy } from \"../../utils/resolveAriaLabelledBy.js\";\nconst BOUNDARY_OFFSET = 2;\nconst SELECTED_DELAY = 400;\nconst UNSELECTED_DELAY = 200;\nconst stateAttributesMapping = {\n ...pressableTriggerOpenStateMapping,\n ...fieldValidityMapping,\n value: () => null\n};\n\n/**\n * A button that opens the select popup.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectTrigger = /*#__PURE__*/React.forwardRef(function SelectTrigger(componentProps, forwardedRef) {\n const {\n render,\n className,\n id: idProp,\n disabled: disabledProp = false,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n setTouched,\n setFocused,\n validationMode,\n state: fieldState,\n disabled: fieldDisabled\n } = useFieldRootContext();\n const {\n labelId: fieldLabelId\n } = useLabelableContext();\n const {\n store,\n setOpen,\n selectionRef,\n validation,\n readOnly,\n required,\n alignItemWithTriggerActiveRef,\n disabled: selectDisabled,\n keyboardActiveRef\n } = useSelectRootContext();\n const disabled = fieldDisabled || selectDisabled || disabledProp;\n const open = useStore(store, selectors.open);\n const value = useStore(store, selectors.value);\n const triggerProps = useStore(store, selectors.triggerProps);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const rootId = useStore(store, selectors.id);\n const selectLabelId = useStore(store, selectors.labelId);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && open;\n const hasNullItemLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const id = idProp ?? rootId;\n const ariaLabelledBy = resolveAriaLabelledBy(fieldLabelId, selectLabelId);\n useLabelableId({\n id\n });\n const positionerRef = useValueAsRef(positionerElement);\n const triggerRef = React.useRef(null);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const setTriggerElement = useStableCallback(element => {\n store.set('triggerElement', element);\n });\n const mergedRef = useMergedRefs(forwardedRef, triggerRef, buttonRef, setTriggerElement);\n const timeoutFocus = useTimeout();\n const timeoutMouseDown = useTimeout();\n const selectedDelayTimeout = useTimeout();\n const unselectedDelayTimeout = useTimeout();\n React.useEffect(() => {\n if (open) {\n const hasSelectedItemInList = hasSelectedValue || hasNullItemLabel;\n const shouldDelayUnselectedMouseUpLonger = !hasSelectedItemInList;\n\n // When there is no selected item in the list (placeholder-only selects), a mousedown\n // on the trigger followed by a quick mouseup over the first option can accidentally select\n // within 200ms. Delay unselected mouseup to match the safer 400ms window.\n if (shouldDelayUnselectedMouseUpLonger) {\n selectedDelayTimeout.start(SELECTED_DELAY, () => {\n selectionRef.current.allowUnselectedMouseUp = true;\n selectionRef.current.allowSelectedMouseUp = true;\n });\n } else {\n // mousedown -> move to unselected item -> mouseup should not select within 200ms.\n unselectedDelayTimeout.start(UNSELECTED_DELAY, () => {\n selectionRef.current.allowUnselectedMouseUp = true;\n\n // mousedown -> mouseup on selected item should not select within 400ms.\n selectedDelayTimeout.start(UNSELECTED_DELAY, () => {\n selectionRef.current.allowSelectedMouseUp = true;\n });\n });\n }\n return () => {\n selectedDelayTimeout.clear();\n unselectedDelayTimeout.clear();\n };\n }\n selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false\n };\n timeoutMouseDown.clear();\n return undefined;\n }, [open, hasSelectedValue, hasNullItemLabel, selectionRef, timeoutMouseDown, selectedDelayTimeout, unselectedDelayTimeout]);\n const ariaControlsId = React.useMemo(() => {\n return listElement?.id ?? getFloatingFocusElement(positionerElement)?.id;\n }, [listElement, positionerElement]);\n const props = mergeProps(triggerProps, {\n id,\n role: 'combobox',\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': 'listbox',\n 'aria-controls': open ? ariaControlsId : undefined,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n tabIndex: disabled ? -1 : 0,\n ref: mergedRef,\n onFocus(event) {\n setFocused(true);\n\n // The popup element shouldn't obscure the focused trigger.\n if (open && alignItemWithTriggerActiveRef.current) {\n setOpen(false, createChangeEventDetails(REASONS.none, event.nativeEvent));\n }\n\n // Saves a re-render on initial click: `forceMount === true` mounts\n // the items before `open === true`. We could sync those cycles better\n // without a timeout, but this is enough for now.\n //\n // XXX: might be causing `act()` warnings.\n timeoutFocus.start(0, () => {\n store.set('forceMount', true);\n });\n },\n onBlur(event) {\n // If focus is moving into the popup, don't count it as a blur.\n if (contains(positionerElement, event.relatedTarget)) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(value);\n }\n },\n onPointerMove() {\n keyboardActiveRef.current = false;\n },\n onKeyDown() {\n keyboardActiveRef.current = true;\n },\n onMouseDown(event) {\n if (open) {\n return;\n }\n const doc = ownerDocument(event.currentTarget);\n function handleMouseUp(mouseEvent) {\n if (!triggerRef.current) {\n return;\n }\n const mouseUpTarget = mouseEvent.target;\n\n // Early return if clicked on trigger element or its children\n if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget) || mouseUpTarget === triggerRef.current) {\n return;\n }\n const bounds = getPseudoElementBounds(triggerRef.current);\n if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {\n return;\n }\n setOpen(false, createChangeEventDetails(REASONS.cancelOpen, mouseEvent));\n }\n\n // Firefox can fire this upon mousedown\n timeoutMouseDown.start(0, () => {\n doc.addEventListener('mouseup', handleMouseUp, {\n once: true\n });\n });\n }\n }, validation.getValidationProps, elementProps, getButtonProps);\n\n // ensure nested useButton does not overwrite the combobox role:\n // <Toolbar.Button render={<Select.Trigger />} />\n props.role = 'combobox';\n const state = {\n ...fieldState,\n open,\n disabled,\n value,\n readOnly,\n placeholder: !hasSelectedValue\n };\n return useRenderElement('button', componentProps, {\n ref: [forwardedRef, triggerRef],\n state,\n stateAttributesMapping,\n props\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectTrigger.displayName = \"SelectTrigger\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { resolveMultipleLabels, resolveSelectedLabel } from \"../../utils/resolveValueLabel.js\";\nimport { selectors } from \"../store.js\";\nconst stateAttributesMapping = {\n value: () => null\n};\n\n/**\n * A text label of the currently selected item.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectValue = /*#__PURE__*/React.forwardRef(function SelectValue(componentProps, forwardedRef) {\n const {\n className,\n render,\n children: childrenProp,\n placeholder,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n valueRef\n } = useSelectRootContext();\n const value = useStore(store, selectors.value);\n const items = useStore(store, selectors.items);\n const itemToStringLabel = useStore(store, selectors.itemToStringLabel);\n const hasSelectedValue = useStore(store, selectors.hasSelectedValue);\n const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;\n const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);\n const state = {\n value,\n placeholder: !hasSelectedValue\n };\n let children = null;\n if (typeof childrenProp === 'function') {\n children = childrenProp(value);\n } else if (childrenProp != null) {\n children = childrenProp;\n } else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {\n children = placeholder;\n } else if (Array.isArray(value)) {\n children = resolveMultipleLabels(value, items, itemToStringLabel);\n } else {\n children = resolveSelectedLabel(value, items, itemToStringLabel);\n }\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, valueRef],\n props: [{\n children\n }, elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectValue.displayName = \"SelectValue\";","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { selectors } from \"../store.js\";\n\n/**\n * An icon that indicates that the trigger button opens a select popup.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectIcon = /*#__PURE__*/React.forwardRef(function SelectIcon(componentProps, forwardedRef) {\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n store\n } = useSelectRootContext();\n const open = useStore(store, selectors.open);\n const state = {\n open\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n 'aria-hidden': true,\n children: '▼'\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectIcon.displayName = \"SelectIcon\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectPortalContext.displayName = \"SelectPortalContext\";\nexport function useSelectPortalContext() {\n const value = React.useContext(SelectPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Select.Portal> is missing.' : _formatErrorMessage(58));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStore } from '@base-ui/utils/store';\nimport { FloatingPortal } from \"../../floating-ui-react/index.js\";\nimport { SelectPortalContext } from \"./SelectPortalContext.js\";\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { selectors } from \"../store.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectPortal = /*#__PURE__*/React.forwardRef(function SelectPortal(portalProps, forwardedRef) {\n const {\n store\n } = useSelectRootContext();\n const mounted = useStore(store, selectors.mounted);\n const forceMount = useStore(store, selectors.forceMount);\n const shouldRender = mounted || forceMount;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(SelectPortalContext.Provider, {\n value: true,\n children: /*#__PURE__*/_jsx(FloatingPortal, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPortal.displayName = \"SelectPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectPositionerContext.displayName = \"SelectPositionerContext\";\nexport function useSelectPositionerContext() {\n const context = React.useContext(SelectPositionerContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.' : _formatErrorMessage(59));\n }\n return context;\n}","export function clearStyles(element, originalStyles) {\n if (element) {\n Object.assign(element.style, originalStyles);\n }\n}\nexport const LIST_FUNCTIONAL_STYLES = {\n position: 'relative',\n maxHeight: '100%',\n overflowX: 'hidden',\n overflowY: 'auto'\n};","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext, useSelectFloatingContext } from \"../root/SelectRootContext.js\";\nimport { CompositeList } from \"../../composite/list/CompositeList.js\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.js\";\nimport { SelectPositionerContext } from \"./SelectPositionerContext.js\";\nimport { InternalBackdrop } from \"../../utils/InternalBackdrop.js\";\nimport { DROPDOWN_COLLISION_AVOIDANCE } from \"../../utils/constants.js\";\nimport { clearStyles } from \"../popup/utils.js\";\nimport { selectors } from \"../store.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { findItemIndex, selectedValueIncludes } from \"../../utils/itemEquality.js\";\nimport { usePositioner } from \"../../utils/usePositioner.js\";\nimport { useAnchoredPopupScrollLock } from \"../../utils/useAnchoredPopupScrollLock.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst FIXED = {\n position: 'fixed'\n};\n\n/**\n * Positions the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPositioner = /*#__PURE__*/React.forwardRef(function SelectPositioner(componentProps, forwardedRef) {\n const {\n anchor,\n positionMethod = 'absolute',\n className,\n render,\n side = 'bottom',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking,\n alignItemWithTrigger = true,\n collisionAvoidance = DROPDOWN_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const {\n store,\n listRef,\n labelsRef,\n alignItemWithTriggerActiveRef,\n selectedItemTextRef,\n valuesRef,\n initialValueRef,\n popupRef,\n setValue\n } = useSelectRootContext();\n const floatingRootContext = useSelectFloatingContext();\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const modal = useStore(store, selectors.modal);\n const value = useStore(store, selectors.value);\n const openMethod = useStore(store, selectors.openMethod);\n const positionerElement = useStore(store, selectors.positionerElement);\n const triggerElement = useStore(store, selectors.triggerElement);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const scrollUpArrowRef = React.useRef(null);\n const scrollDownArrowRef = React.useRef(null);\n const [controlledAlignItemWithTrigger, setControlledAlignItemWithTrigger] = React.useState(alignItemWithTrigger);\n const alignItemWithTriggerActive = mounted && controlledAlignItemWithTrigger && openMethod !== 'touch';\n if (!mounted && controlledAlignItemWithTrigger !== alignItemWithTrigger) {\n setControlledAlignItemWithTrigger(alignItemWithTrigger);\n }\n useIsoLayoutEffect(() => {\n if (!mounted) {\n if (selectors.scrollUpArrowVisible(store.state)) {\n store.set('scrollUpArrowVisible', false);\n }\n if (selectors.scrollDownArrowVisible(store.state)) {\n store.set('scrollDownArrowVisible', false);\n }\n }\n }, [store, mounted]);\n React.useImperativeHandle(alignItemWithTriggerActiveRef, () => alignItemWithTriggerActive);\n useAnchoredPopupScrollLock((alignItemWithTriggerActive || modal) && open, openMethod === 'touch', positionerElement, triggerElement);\n const positioning = useAnchorPositioning({\n anchor,\n floatingRootContext,\n positionMethod,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n disableAnchorTracking: disableAnchorTracking ?? alignItemWithTriggerActive,\n collisionAvoidance,\n keepMounted: true\n });\n const renderedSide = alignItemWithTriggerActive ? 'none' : positioning.side;\n const positionerStyles = alignItemWithTriggerActive ? FIXED : positioning.positionerStyles;\n const state = {\n open,\n side: renderedSide,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden\n };\n const setPositionerElement = useStableCallback(element => {\n store.set('positionerElement', element);\n });\n const element = usePositioner(componentProps, state, {\n styles: positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, setPositionerElement],\n hidden: !mounted,\n inert: !open\n });\n const prevMapSizeRef = React.useRef(0);\n const onMapChange = useStableCallback(map => {\n if (map.size === 0 && prevMapSizeRef.current === 0) {\n return;\n }\n if (valuesRef.current.length === 0) {\n return;\n }\n const prevSize = prevMapSizeRef.current;\n prevMapSizeRef.current = map.size;\n if (map.size === prevSize) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.none);\n if (prevSize !== 0 && !store.state.multiple && value !== null) {\n const selectedValueIndex = findItemIndex(valuesRef.current, value, isItemEqualToValue);\n if (selectedValueIndex === -1) {\n const initialSelectedValue = initialValueRef.current;\n const hasInitial = initialSelectedValue != null && findItemIndex(valuesRef.current, initialSelectedValue, isItemEqualToValue) !== -1;\n const nextValue = hasInitial ? initialSelectedValue : null;\n setValue(nextValue, eventDetails);\n if (nextValue === null) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (prevSize !== 0 && store.state.multiple && Array.isArray(value)) {\n const hasVisibleItem = selectedItemValue => findItemIndex(valuesRef.current, selectedItemValue, isItemEqualToValue) !== -1;\n const nextValue = value.filter(selectedItemValue => hasVisibleItem(selectedItemValue));\n if (nextValue.length !== value.length || nextValue.some(selectedItemValue => !selectedValueIncludes(value, selectedItemValue, isItemEqualToValue))) {\n setValue(nextValue, eventDetails);\n if (nextValue.length === 0) {\n store.set('selectedIndex', null);\n selectedItemTextRef.current = null;\n }\n }\n }\n if (open && alignItemWithTriggerActive) {\n store.update({\n scrollUpArrowVisible: false,\n scrollDownArrowVisible: false\n });\n const stylesToClear = {\n height: ''\n };\n clearStyles(positionerElement, stylesToClear);\n clearStyles(popupRef.current, stylesToClear);\n }\n });\n const contextValue = React.useMemo(() => ({\n ...positioning,\n side: renderedSide,\n alignItemWithTriggerActive,\n setControlledAlignItemWithTrigger,\n scrollUpArrowRef,\n scrollDownArrowRef\n }), [positioning, renderedSide, alignItemWithTriggerActive, setControlledAlignItemWithTrigger]);\n return /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: listRef,\n labelsRef: labelsRef,\n onMapChange: onMapChange,\n children: /*#__PURE__*/_jsxs(SelectPositionerContext.Provider, {\n value: contextValue,\n children: [mounted && modal && /*#__PURE__*/_jsx(InternalBackdrop, {\n inert: inertValue(!open),\n cutout: triggerElement\n }), element]\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPositioner.displayName = \"SelectPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { rectToClientRect } from '@floating-ui/utils';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { isWebKit } from '@base-ui/utils/detectBrowser';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStore } from '@base-ui/utils/store';\nimport { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';\nimport { FloatingFocusManager, platform as floatingPlatform } from \"../../floating-ui-react/index.js\";\nimport { useSelectFloatingContext, useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.js\";\nimport { styleDisableScrollbar } from \"../../utils/styles.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { selectors } from \"../store.js\";\nimport { clearStyles, LIST_FUNCTIONAL_STYLES } from \"./utils.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useToolbarRootContext } from \"../../toolbar/root/ToolbarRootContext.js\";\nimport { COMPOSITE_KEYS } from \"../../composite/composite.js\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.js\";\nimport { clamp } from \"../../utils/clamp.js\";\nimport { getMaxScrollOffset, SCROLL_EDGE_TOLERANCE_PX } from \"../../utils/scrollEdges.js\";\nimport { useCSPContext } from \"../../csp-provider/CSPContext.js\";\nimport { useDirection } from \"../../direction-provider/DirectionContext.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the select list.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectPopup = /*#__PURE__*/React.forwardRef(function SelectPopup(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n finalFocus,\n ...elementProps\n } = componentProps;\n const {\n store,\n popupRef,\n onOpenChangeComplete,\n setOpen,\n valueRef,\n selectedItemTextRef,\n keyboardActiveRef,\n multiple,\n handleScrollArrowVisibility,\n scrollHandlerRef,\n listRef,\n highlightItemOnHover\n } = useSelectRootContext();\n const {\n side,\n align,\n alignItemWithTriggerActive,\n isPositioned,\n setControlledAlignItemWithTrigger,\n scrollDownArrowRef,\n scrollUpArrowRef\n } = useSelectPositionerContext();\n const insideToolbar = useToolbarRootContext(true) != null;\n const floatingRootContext = useSelectFloatingContext();\n const direction = useDirection();\n const {\n nonce,\n disableStyleElements\n } = useCSPContext();\n const id = useStore(store, selectors.id);\n const open = useStore(store, selectors.open);\n const mounted = useStore(store, selectors.mounted);\n const popupProps = useStore(store, selectors.popupProps);\n const transitionStatus = useStore(store, selectors.transitionStatus);\n const triggerElement = useStore(store, selectors.triggerElement);\n const positionerElement = useStore(store, selectors.positionerElement);\n const listElement = useStore(store, selectors.listElement);\n const reachedMaxHeightRef = React.useRef(false);\n const initialPlacedRef = React.useRef(false);\n const originalPositionerStylesRef = React.useRef({});\n const scrollArrowFrame = useAnimationFrame();\n const handleScroll = useStableCallback(scroller => {\n if (!positionerElement || !popupRef.current || !initialPlacedRef.current) {\n return;\n }\n if (reachedMaxHeightRef.current || !alignItemWithTriggerActive) {\n handleScrollArrowVisibility();\n return;\n }\n const isTopPositioned = positionerElement.style.top === '0px';\n const isBottomPositioned = positionerElement.style.bottom === '0px';\n if (!isTopPositioned && !isBottomPositioned) {\n handleScrollArrowVisibility();\n return;\n }\n const scale = getScale(positionerElement);\n const currentHeight = normalizeSize(positionerElement.getBoundingClientRect().height, 'y', scale);\n const doc = ownerDocument(positionerElement);\n const positionerStyles = getComputedStyle(positionerElement);\n const marginTop = parseFloat(positionerStyles.marginTop);\n const marginBottom = parseFloat(positionerStyles.marginBottom);\n const maxPopupHeight = getMaxPopupHeight(getComputedStyle(popupRef.current));\n const maxAvailableHeight = Math.min(doc.documentElement.clientHeight - marginTop - marginBottom, maxPopupHeight);\n const scrollTop = scroller.scrollTop;\n const maxScrollTop = getMaxScrollTop(scroller);\n let nextPositionerHeight = 0;\n let nextScrollTop = null;\n let setReachedMax = false;\n let scrollToMax = false;\n const setHeight = height => {\n positionerElement.style.height = `${height}px`;\n };\n const handleSmallDiff = (diff, targetScrollTop) => {\n const heightDelta = clamp(diff, 0, maxAvailableHeight - currentHeight);\n if (heightDelta > 0) {\n // Consume the remaining scroll in height.\n setHeight(currentHeight + heightDelta);\n }\n scroller.scrollTop = targetScrollTop;\n if (maxAvailableHeight - (currentHeight + heightDelta) <= SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility();\n };\n const diff = isTopPositioned ? maxScrollTop - scrollTop : scrollTop;\n const nextHeight = Math.min(currentHeight + diff, maxAvailableHeight);\n nextPositionerHeight = nextHeight;\n if (diff <= SCROLL_EDGE_TOLERANCE_PX) {\n handleSmallDiff(diff, isTopPositioned ? maxScrollTop : 0);\n return;\n }\n if (maxAvailableHeight - nextHeight > SCROLL_EDGE_TOLERANCE_PX) {\n if (isTopPositioned) {\n scrollToMax = true;\n } else {\n nextScrollTop = 0;\n }\n } else {\n setReachedMax = true;\n if (isBottomPositioned && scrollTop < maxScrollTop) {\n const overshoot = currentHeight + diff - maxAvailableHeight;\n nextScrollTop = scrollTop - (diff - overshoot);\n }\n }\n nextPositionerHeight = Math.ceil(nextPositionerHeight);\n if (nextPositionerHeight !== 0) {\n setHeight(nextPositionerHeight);\n }\n if (scrollToMax || nextScrollTop != null) {\n // Recompute bounds after resizing (clientHeight likely changed).\n const nextMaxScrollTop = getMaxScrollTop(scroller);\n const target = scrollToMax ? nextMaxScrollTop : clamp(nextScrollTop, 0, nextMaxScrollTop);\n\n // Avoid adjustments that re-trigger scroll events forever.\n if (Math.abs(scroller.scrollTop - target) > SCROLL_EDGE_TOLERANCE_PX) {\n scroller.scrollTop = target;\n }\n }\n if (setReachedMax || nextPositionerHeight >= maxAvailableHeight - SCROLL_EDGE_TOLERANCE_PX) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility();\n });\n React.useImperativeHandle(scrollHandlerRef, () => handleScroll, [handleScroll]);\n useOpenChangeComplete({\n open,\n ref: popupRef,\n onComplete() {\n if (open) {\n onOpenChangeComplete?.(true);\n }\n }\n });\n const state = {\n open,\n transitionStatus,\n side,\n align\n };\n useIsoLayoutEffect(() => {\n if (!positionerElement || !popupRef.current || Object.keys(originalPositionerStylesRef.current).length) {\n return;\n }\n originalPositionerStylesRef.current = {\n top: positionerElement.style.top || '0',\n left: positionerElement.style.left || '0',\n right: positionerElement.style.right,\n height: positionerElement.style.height,\n bottom: positionerElement.style.bottom,\n minHeight: positionerElement.style.minHeight,\n maxHeight: positionerElement.style.maxHeight,\n marginTop: positionerElement.style.marginTop,\n marginBottom: positionerElement.style.marginBottom\n };\n }, [popupRef, positionerElement]);\n useIsoLayoutEffect(() => {\n if (open || alignItemWithTriggerActive) {\n return;\n }\n initialPlacedRef.current = false;\n reachedMaxHeightRef.current = false;\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n }, [open, alignItemWithTriggerActive, positionerElement, popupRef]);\n useIsoLayoutEffect(() => {\n const popupElement = popupRef.current;\n\n // Wait for Floating UI's first positioning pass before reading DOM geometry.\n // We replace the final coordinates for aligned selects, but still need middleware\n // like `size()` to set CSS variables such as `--anchor-width`.\n if (!open || !triggerElement || !positionerElement || !popupElement || alignItemWithTriggerActive && !isPositioned || store.state.transitionStatus === 'ending') {\n return;\n }\n if (!alignItemWithTriggerActive) {\n initialPlacedRef.current = true;\n scrollArrowFrame.request(handleScrollArrowVisibility);\n popupElement.style.removeProperty('--transform-origin');\n return;\n }\n\n // Ensure we remove any transforms that can affect the location of the popup\n // and therefore the calculations.\n const restoreTransformStyles = unsetTransformStyles(popupElement);\n popupElement.style.removeProperty('--transform-origin');\n try {\n const textElement = selectedItemTextRef.current;\n const valueElement = valueRef.current;\n const positionerStyles = getComputedStyle(positionerElement);\n const popupStyles = getComputedStyle(popupElement);\n const doc = ownerDocument(triggerElement);\n const win = ownerWindow(positionerElement);\n const scale = getScale(triggerElement);\n const triggerRect = normalizeRect(triggerElement.getBoundingClientRect(), scale);\n const positionerRect = normalizeRect(positionerElement.getBoundingClientRect(), scale);\n const triggerHeight = triggerRect.height;\n const scroller = listElement || popupElement;\n const scrollHeight = scroller.scrollHeight;\n const borderBottom = parseFloat(popupStyles.borderBottomWidth);\n const marginTop = parseFloat(positionerStyles.marginTop) || 10;\n const marginBottom = parseFloat(positionerStyles.marginBottom) || 10;\n const minHeight = parseFloat(positionerStyles.minHeight) || 100;\n const maxPopupHeight = getMaxPopupHeight(popupStyles);\n const paddingLeft = 5;\n const paddingRight = 5;\n const triggerCollisionThreshold = 20;\n const viewportHeight = doc.documentElement.clientHeight - marginTop - marginBottom;\n const viewportWidth = doc.documentElement.clientWidth;\n const availableSpaceBeneathTrigger = viewportHeight - triggerRect.bottom + triggerHeight;\n let textRect;\n let alignedLeft = direction === 'rtl' ? triggerRect.right - positionerRect.width : triggerRect.left;\n let offsetY = 0;\n if (textElement && valueElement) {\n const valueRect = normalizeRect(valueElement.getBoundingClientRect(), scale);\n textRect = normalizeRect(textElement.getBoundingClientRect(), scale);\n alignedLeft = positionerRect.left + (direction === 'rtl' ? valueRect.right - textRect.right : valueRect.left - textRect.left);\n const valueCenterFromTriggerTop = valueRect.top - triggerRect.top + valueRect.height / 2;\n const textCenterFromPositionerTop = textRect.top - positionerRect.top + textRect.height / 2;\n offsetY = textCenterFromPositionerTop - valueCenterFromTriggerTop;\n }\n const idealHeight = availableSpaceBeneathTrigger + offsetY + marginBottom + borderBottom;\n let height = Math.min(viewportHeight, idealHeight);\n const maxHeight = viewportHeight - marginTop - marginBottom;\n const scrollTop = idealHeight - height;\n const maxRight = viewportWidth - paddingRight;\n positionerElement.style.left = `${clamp(alignedLeft, paddingLeft, maxRight - positionerRect.width)}px`;\n positionerElement.style.height = `${height}px`;\n positionerElement.style.maxHeight = 'auto';\n positionerElement.style.marginTop = `${marginTop}px`;\n positionerElement.style.marginBottom = `${marginBottom}px`;\n popupElement.style.height = '100%';\n const maxScrollTop = getMaxScrollTop(scroller);\n const isTopPositioned = scrollTop >= maxScrollTop - SCROLL_EDGE_TOLERANCE_PX;\n if (isTopPositioned) {\n height = Math.min(viewportHeight, positionerRect.height) - (scrollTop - maxScrollTop);\n }\n\n // When the trigger is too close to the top or bottom of the viewport, or the minHeight is\n // reached, we fallback to aligning the popup to the trigger as the UX is poor otherwise.\n const fallbackToAlignPopupToTrigger = triggerRect.top < triggerCollisionThreshold || triggerRect.bottom > viewportHeight - triggerCollisionThreshold || Math.ceil(height) + SCROLL_EDGE_TOLERANCE_PX < Math.min(scrollHeight, minHeight);\n\n // Safari doesn't position the popup correctly when pinch-zoomed.\n const isPinchZoomed = (win.visualViewport?.scale ?? 1) !== 1 && isWebKit;\n if (fallbackToAlignPopupToTrigger || isPinchZoomed) {\n initialPlacedRef.current = true;\n clearStyles(positionerElement, originalPositionerStylesRef.current);\n setControlledAlignItemWithTrigger(false);\n return;\n }\n const initialHeight = Math.max(minHeight, height);\n if (isTopPositioned) {\n const topOffset = Math.max(0, viewportHeight - idealHeight);\n positionerElement.style.top = positionerRect.height >= maxHeight ? '0' : `${topOffset}px`;\n positionerElement.style.height = `${height}px`;\n scroller.scrollTop = getMaxScrollTop(scroller);\n } else {\n positionerElement.style.bottom = '0';\n scroller.scrollTop = scrollTop;\n }\n if (textRect) {\n const popupTop = positionerRect.top;\n const popupHeight = positionerRect.height;\n const textCenterY = textRect.top + textRect.height / 2;\n const transformOriginY = popupHeight > 0 ? (textCenterY - popupTop) / popupHeight * 100 : 50;\n const clampedY = clamp(transformOriginY, 0, 100);\n popupElement.style.setProperty('--transform-origin', `50% ${clampedY}%`);\n }\n if (initialHeight === viewportHeight || height >= maxPopupHeight) {\n reachedMaxHeightRef.current = true;\n }\n handleScrollArrowVisibility();\n if (highlightItemOnHover && store.state.selectedIndex === null && store.state.activeIndex === null && listRef.current[0] != null) {\n store.set('activeIndex', 0);\n }\n initialPlacedRef.current = true;\n } finally {\n restoreTransformStyles();\n }\n }, [store, open, positionerElement, triggerElement, valueRef, selectedItemTextRef, popupRef, handleScrollArrowVisibility, alignItemWithTriggerActive, setControlledAlignItemWithTrigger, scrollArrowFrame, scrollDownArrowRef, scrollUpArrowRef, listElement, listRef, highlightItemOnHover, direction, isPositioned]);\n React.useEffect(() => {\n if (!alignItemWithTriggerActive || !positionerElement || !open) {\n return undefined;\n }\n const win = ownerWindow(positionerElement);\n function handleResize(event) {\n setOpen(false, createChangeEventDetails(REASONS.windowResize, event));\n }\n return addEventListener(win, 'resize', handleResize);\n }, [setOpen, alignItemWithTriggerActive, positionerElement, open]);\n const defaultProps = {\n ...(listElement ? {\n role: 'presentation',\n 'aria-orientation': undefined\n } : {\n role: 'listbox',\n 'aria-multiselectable': multiple || undefined,\n id: `${id}-list`\n }),\n onKeyDown(event) {\n keyboardActiveRef.current = true;\n if (insideToolbar && COMPOSITE_KEYS.has(event.key)) {\n event.stopPropagation();\n }\n },\n onMouseMove() {\n keyboardActiveRef.current = false;\n },\n onScroll(event) {\n if (listElement) {\n return;\n }\n handleScroll(event.currentTarget);\n },\n ...(alignItemWithTriggerActive && {\n style: listElement ? {\n height: '100%'\n } : LIST_FUNCTIONAL_STYLES\n })\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, popupRef],\n state,\n stateAttributesMapping,\n props: [popupProps, defaultProps, getDisabledMountTransitionStyles(transitionStatus), {\n className: !listElement && alignItemWithTriggerActive ? styleDisableScrollbar.className : undefined\n }, elementProps]\n });\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!disableStyleElements && styleDisableScrollbar.getElement(nonce), /*#__PURE__*/_jsx(FloatingFocusManager, {\n context: floatingRootContext,\n modal: false,\n disabled: !mounted,\n returnFocus: finalFocus,\n restoreFocus: true,\n children: element\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectPopup.displayName = \"SelectPopup\";\nfunction getMaxPopupHeight(popupStyles) {\n const maxHeightStyle = popupStyles.maxHeight || '';\n return maxHeightStyle.endsWith('px') ? parseFloat(maxHeightStyle) || Infinity : Infinity;\n}\nfunction getMaxScrollTop(scroller) {\n return getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n}\nfunction getScale(element) {\n // The platform API is async-capable, but the DOM platform returns a plain scale object.\n return floatingPlatform.getScale(element);\n}\nfunction normalizeSize(size, axis, scale) {\n return size / scale[axis];\n}\nfunction normalizeRect(rect, scale) {\n return rectToClientRect({\n x: normalizeSize(rect.x, 'x', scale),\n y: normalizeSize(rect.y, 'y', scale),\n width: normalizeSize(rect.width, 'x', scale),\n height: normalizeSize(rect.height, 'y', scale)\n });\n}\nconst TRANSFORM_STYLE_RESETS = [['transform', 'none'], ['scale', '1'], ['translate', '0 0']];\nfunction unsetTransformStyles(popupElement) {\n const {\n style\n } = popupElement;\n const originalStyles = {};\n for (const [property, value] of TRANSFORM_STYLE_RESETS) {\n originalStyles[property] = style.getPropertyValue(property);\n style.setProperty(property, value, 'important');\n }\n return () => {\n for (const [property] of TRANSFORM_STYLE_RESETS) {\n const originalValue = originalStyles[property];\n if (originalValue) {\n style.setProperty(property, originalValue);\n } else {\n style.removeProperty(property);\n }\n }\n };\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectItemContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectItemContext.displayName = \"SelectItemContext\";\nexport function useSelectItemContext() {\n const context = React.useContext(SelectItemContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.' : _formatErrorMessage(57));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useValueAsRef } from '@base-ui/utils/useValueAsRef';\nimport { useStore } from '@base-ui/utils/store';\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { useCompositeListItem, IndexGuessBehavior } from \"../../composite/list/useCompositeListItem.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { SelectItemContext } from \"./SelectItemContext.js\";\nimport { selectors } from \"../store.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { compareItemEquality, removeItem } from \"../../utils/itemEquality.js\";\n\n/**\n * An individual option in the select popup.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItem(componentProps, forwardedRef) {\n const {\n render,\n className,\n value: itemValue = null,\n label,\n disabled = false,\n nativeButton = false,\n style,\n ...elementProps\n } = componentProps;\n const textRef = React.useRef(null);\n const listItem = useCompositeListItem({\n label,\n textRef,\n indexGuessBehavior: IndexGuessBehavior.GuessFromOrder\n });\n const {\n store,\n getItemProps,\n setOpen,\n setValue,\n selectionRef,\n typingRef,\n valuesRef,\n multiple,\n selectedItemTextRef\n } = useSelectRootContext();\n const highlighted = useStore(store, selectors.isActive, listItem.index);\n const selected = useStore(store, selectors.isSelected, listItem.index, itemValue);\n const selectedByFocus = useStore(store, selectors.isSelectedByFocus, listItem.index);\n const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);\n const index = listItem.index;\n const hasRegistered = index !== -1;\n const itemRef = React.useRef(null);\n const indexRef = useValueAsRef(index);\n useIsoLayoutEffect(() => {\n if (!hasRegistered) {\n return undefined;\n }\n const values = valuesRef.current;\n values[index] = itemValue;\n return () => {\n delete values[index];\n };\n }, [hasRegistered, index, itemValue, valuesRef]);\n useIsoLayoutEffect(() => {\n if (!hasRegistered) {\n return;\n }\n const selectedValue = store.state.value;\n let selectedCandidate = selectedValue;\n if (multiple && Array.isArray(selectedValue) && selectedValue.length > 0) {\n selectedCandidate = selectedValue[selectedValue.length - 1];\n }\n if (selectedCandidate !== undefined && compareItemEquality(itemValue, selectedCandidate, isItemEqualToValue)) {\n store.set('selectedIndex', index);\n // Make sure SelectPopup can measure the selected item on first open.\n // SelectItemText can still update this ref later when focus moves.\n if (textRef.current) {\n selectedItemTextRef.current = textRef.current;\n }\n }\n }, [hasRegistered, index, multiple, isItemEqualToValue, store, itemValue, selectedItemTextRef]);\n const state = {\n disabled,\n selected,\n highlighted\n };\n const rootProps = getItemProps({\n active: highlighted,\n selected\n });\n rootProps.id = undefined;\n const lastKeyRef = React.useRef(null);\n const pointerTypeRef = React.useRef('mouse');\n const didPointerDownRef = React.useRef(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n focusableWhenDisabled: true,\n native: nativeButton,\n composite: true\n });\n function commitSelection(event) {\n const selectedValue = store.state.value;\n if (multiple) {\n const currentValue = Array.isArray(selectedValue) ? selectedValue : [];\n const nextValue = selected ? removeItem(currentValue, itemValue, isItemEqualToValue) : [...currentValue, itemValue];\n setValue(nextValue, createChangeEventDetails(REASONS.itemPress, event));\n } else {\n setValue(itemValue, createChangeEventDetails(REASONS.itemPress, event));\n setOpen(false, createChangeEventDetails(REASONS.itemPress, event));\n }\n }\n const defaultProps = {\n role: 'option',\n 'aria-selected': selected,\n tabIndex: highlighted ? 0 : -1,\n onTouchStart() {\n selectionRef.current = {\n allowSelectedMouseUp: false,\n allowUnselectedMouseUp: false\n };\n },\n onKeyDown(event) {\n lastKeyRef.current = event.key;\n store.set('activeIndex', index);\n if (event.key === ' ' && typingRef.current) {\n event.preventDefault();\n }\n },\n onClick(event) {\n didPointerDownRef.current = false;\n\n // Prevent double commit on {Enter}\n if (event.type === 'keydown' && lastKeyRef.current === null) {\n return;\n }\n if (disabled || event.type === 'keydown' && lastKeyRef.current === ' ' && typingRef.current || pointerTypeRef.current !== 'touch' && !highlighted) {\n return;\n }\n lastKeyRef.current = null;\n commitSelection(event.nativeEvent);\n },\n onPointerEnter(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n didPointerDownRef.current = true;\n },\n onMouseUp() {\n if (disabled) {\n return;\n }\n\n // Regular click (pointerdown on this element) if didPointerDownRef is set, otherwise drag-to-select\n if (didPointerDownRef.current) {\n didPointerDownRef.current = false;\n return;\n }\n const disallowSelectedMouseUp = !selectionRef.current.allowSelectedMouseUp && selected;\n const disallowUnselectedMouseUp = !selectionRef.current.allowUnselectedMouseUp && !selected;\n if (disallowSelectedMouseUp || disallowUnselectedMouseUp || pointerTypeRef.current !== 'touch' && !highlighted) {\n return;\n }\n itemRef.current?.click();\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [buttonRef, forwardedRef, listItem.ref, itemRef],\n state,\n props: [rootProps, defaultProps, elementProps, getButtonProps]\n });\n const contextValue = React.useMemo(() => ({\n selected,\n indexRef,\n textRef,\n selectedByFocus,\n hasRegistered\n }), [selected, indexRef, textRef, selectedByFocus, hasRegistered]);\n return /*#__PURE__*/_jsx(SelectItemContext.Provider, {\n value: contextValue,\n children: element\n });\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItem.displayName = \"SelectItem\";","'use client';\n\nimport * as React from 'react';\nimport { useSelectItemContext } from \"../item/SelectItemContext.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\n\n/**\n * Indicates whether the select item is selected.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectItemIndicator = /*#__PURE__*/React.forwardRef(function SelectItemIndicator(componentProps, forwardedRef) {\n const keepMounted = componentProps.keepMounted ?? false;\n const {\n selected\n } = useSelectItemContext();\n const shouldRender = keepMounted || selected;\n if (!shouldRender) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return /*#__PURE__*/_jsx(Inner, {\n ...componentProps,\n ref: forwardedRef\n });\n});\n\n/** The core implementation of the indicator is split here to avoid paying the hooks\n * costs unless the element needs to be mounted. */\nif (process.env.NODE_ENV !== \"production\") SelectItemIndicator.displayName = \"SelectItemIndicator\";\nconst Inner = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef((componentProps, forwardedRef) => {\n const {\n render,\n className,\n style,\n keepMounted,\n ...elementProps\n } = componentProps;\n const {\n selected\n } = useSelectItemContext();\n const indicatorRef = React.useRef(null);\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(selected);\n const state = {\n selected,\n transitionStatus\n };\n const element = useRenderElement('span', componentProps, {\n ref: [forwardedRef, indicatorRef],\n state,\n props: [{\n 'aria-hidden': true,\n children: '✔️'\n }, elementProps],\n stateAttributesMapping: transitionStatusMapping\n });\n useOpenChangeComplete({\n open: selected,\n ref: indicatorRef,\n onComplete() {\n if (!selected) {\n setMounted(false);\n }\n }\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") Inner.displayName = \"Inner\";","'use client';\n\nimport * as React from 'react';\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { useSelectItemContext } from \"../item/SelectItemContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * A text label of the select item.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectItemText = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRef(function SelectItemText(componentProps, forwardedRef) {\n const {\n indexRef,\n textRef,\n selectedByFocus,\n hasRegistered\n } = useSelectItemContext();\n const {\n selectedItemTextRef\n } = useSelectRootContext();\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const localRef = React.useCallback(node => {\n if (!node || !hasRegistered) {\n return;\n }\n const hasNoSelectedItemText = selectedItemTextRef.current === null || !selectedItemTextRef.current.isConnected;\n if (selectedByFocus || hasNoSelectedItemText && indexRef.current === 0) {\n selectedItemTextRef.current = node;\n }\n }, [selectedItemTextRef, indexRef, selectedByFocus, hasRegistered]);\n const element = useRenderElement('div', componentProps, {\n ref: [localRef, forwardedRef, textRef],\n props: elementProps\n });\n return element;\n}));\nif (process.env.NODE_ENV !== \"production\") SelectItemText.displayName = \"SelectItemText\";","'use client';\n\nimport * as React from 'react';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { useStore } from '@base-ui/utils/store';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useSelectRootContext } from \"../root/SelectRootContext.js\";\nimport { useSelectPositionerContext } from \"../positioner/SelectPositionerContext.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { getMaxScrollOffset, normalizeScrollOffset, SCROLL_EDGE_TOLERANCE_PX } from \"../../utils/scrollEdges.js\";\nimport { selectors } from \"../store.js\";\n\n/**\n * @internal\n */\nexport const SelectScrollArrow = /*#__PURE__*/React.forwardRef(function SelectScrollArrow(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n direction,\n keepMounted = false,\n ...elementProps\n } = componentProps;\n const isUp = direction === 'up';\n const {\n store,\n popupRef,\n listRef,\n handleScrollArrowVisibility,\n scrollArrowsMountedCountRef\n } = useSelectRootContext();\n const {\n side,\n scrollDownArrowRef,\n scrollUpArrowRef\n } = useSelectPositionerContext();\n const visibleSelector = isUp ? selectors.scrollUpArrowVisible : selectors.scrollDownArrowVisible;\n const stateVisible = useStore(store, visibleSelector);\n const openMethod = useStore(store, selectors.openMethod);\n\n // Scroll arrows are disabled for touch modality as they are a hover-only element.\n const visible = stateVisible && openMethod !== 'touch';\n const timeout = useTimeout();\n const scrollArrowRef = isUp ? scrollUpArrowRef : scrollDownArrowRef;\n const {\n transitionStatus,\n setMounted\n } = useTransitionStatus(visible);\n useIsoLayoutEffect(() => {\n scrollArrowsMountedCountRef.current += 1;\n if (!store.state.hasScrollArrows) {\n store.set('hasScrollArrows', true);\n }\n return () => {\n scrollArrowsMountedCountRef.current = Math.max(0, scrollArrowsMountedCountRef.current - 1);\n if (scrollArrowsMountedCountRef.current === 0 && store.state.hasScrollArrows) {\n store.set('hasScrollArrows', false);\n }\n };\n }, [store, scrollArrowsMountedCountRef]);\n useOpenChangeComplete({\n open: visible,\n ref: scrollArrowRef,\n onComplete() {\n if (!visible) {\n setMounted(false);\n }\n }\n });\n const state = {\n direction,\n visible,\n side,\n transitionStatus\n };\n const defaultProps = {\n 'aria-hidden': true,\n children: isUp ? '▲' : '▼',\n style: {\n position: 'absolute'\n },\n onMouseMove(event) {\n if (event.movementX === 0 && event.movementY === 0 || timeout.isStarted()) {\n return;\n }\n store.set('activeIndex', null);\n function scrollNextItem() {\n const scroller = store.state.listElement ?? popupRef.current;\n if (!scroller) {\n return;\n }\n store.set('activeIndex', null);\n handleScrollArrowVisibility();\n const maxScrollTop = getMaxScrollOffset(scroller.scrollHeight, scroller.clientHeight);\n const scrollTop = normalizeScrollOffset(scroller.scrollTop, maxScrollTop);\n const isScrolledToEdge = scrollTop === (isUp ? 0 : maxScrollTop);\n const items = listRef.current;\n if (scrollTop !== scroller.scrollTop) {\n scroller.scrollTop = scrollTop;\n }\n\n // Fallback when there are no items registered yet.\n if (items.length === 0) {\n store.set(isUp ? 'scrollUpArrowVisible' : 'scrollDownArrowVisible', !isScrolledToEdge);\n }\n if (isScrolledToEdge) {\n timeout.clear();\n return;\n }\n if (items.length > 0) {\n const scrollArrowHeight = scrollArrowRef.current?.offsetHeight || 0;\n scroller.scrollTop = getTargetScrollTop(items, isUp, scrollTop, scroller.clientHeight, scrollArrowHeight, maxScrollTop);\n }\n timeout.start(40, scrollNextItem);\n }\n timeout.start(40, scrollNextItem);\n },\n onMouseLeave() {\n timeout.clear();\n }\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, scrollArrowRef],\n state,\n props: [defaultProps, elementProps]\n });\n const shouldRender = visible || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectScrollArrow.displayName = \"SelectScrollArrow\";\nfunction getTargetScrollTop(items, isUp, scrollTop, clientHeight, scrollArrowHeight, maxScrollTop) {\n if (isUp) {\n let firstVisibleIndex = 0;\n const visibleTop = scrollTop + scrollArrowHeight - SCROLL_EDGE_TOLERANCE_PX;\n for (let i = 0; i < items.length; i += 1) {\n const item = items[i];\n if (item && item.offsetTop >= visibleTop) {\n firstVisibleIndex = i;\n break;\n }\n }\n const targetIndex = Math.max(0, firstVisibleIndex - 1);\n const targetItem = items[targetIndex];\n return targetIndex < firstVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop - scrollArrowHeight, maxScrollTop) : 0;\n }\n let lastVisibleIndex = items.length - 1;\n const visibleBottom = scrollTop + clientHeight - scrollArrowHeight + SCROLL_EDGE_TOLERANCE_PX;\n for (let i = 0; i < items.length; i += 1) {\n const item = items[i];\n if (item && item.offsetTop + item.offsetHeight > visibleBottom) {\n lastVisibleIndex = Math.max(0, i - 1);\n break;\n }\n }\n const targetIndex = Math.min(items.length - 1, lastVisibleIndex + 1);\n const targetItem = items[targetIndex];\n return targetIndex > lastVisibleIndex && targetItem ? normalizeScrollOffset(targetItem.offsetTop + targetItem.offsetHeight - clientHeight + scrollArrowHeight, maxScrollTop) : maxScrollTop;\n}","'use client';\n\nimport * as React from 'react';\nimport { SelectScrollArrow } from \"../scroll-arrow/SelectScrollArrow.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * An element that scrolls the select popup down when hovered. Does not render when using touch input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectScrollDownArrow = /*#__PURE__*/React.forwardRef(function SelectScrollDownArrow(props, forwardedRef) {\n return /*#__PURE__*/_jsx(SelectScrollArrow, {\n ...props,\n ref: forwardedRef,\n direction: \"down\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectScrollDownArrow.displayName = \"SelectScrollDownArrow\";","'use client';\n\nimport * as React from 'react';\nimport { SelectScrollArrow } from \"../scroll-arrow/SelectScrollArrow.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * An element that scrolls the select popup up when hovered. Does not render when using touch input.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectScrollUpArrow = /*#__PURE__*/React.forwardRef(function SelectScrollUpArrow(props, forwardedRef) {\n return /*#__PURE__*/_jsx(SelectScrollArrow, {\n ...props,\n ref: forwardedRef,\n direction: \"up\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectScrollUpArrow.displayName = \"SelectScrollUpArrow\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SelectGroupContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SelectGroupContext.displayName = \"SelectGroupContext\";\nexport function useSelectGroupContext() {\n const context = React.useContext(SelectGroupContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.' : _formatErrorMessage(56));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { SelectGroupContext } from \"./SelectGroupContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * Groups related select items with the corresponding label.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SelectGroup = /*#__PURE__*/React.forwardRef(function SelectGroup(componentProps, forwardedRef) {\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const [labelId, setLabelId] = React.useState();\n const contextValue = React.useMemo(() => ({\n labelId,\n setLabelId\n }), [labelId, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n role: 'group',\n 'aria-labelledby': labelId\n }, elementProps]\n });\n return /*#__PURE__*/_jsx(SelectGroupContext.Provider, {\n value: contextValue,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroup.displayName = \"SelectGroup\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useSelectGroupContext } from \"../group/SelectGroupContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * An accessible label that is automatically associated with its parent group.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Select](https://base-ui.com/react/components/select)\n */\nexport const SelectGroupLabel = /*#__PURE__*/React.forwardRef(function SelectGroupLabel(componentProps, forwardedRef) {\n const {\n className,\n render,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const {\n setLabelId\n } = useSelectGroupContext();\n const id = useBaseUiId(idProp);\n useIsoLayoutEffect(() => {\n setLabelId(id);\n }, [id, setLabelId]);\n const element = useRenderElement('div', componentProps, {\n ref: forwardedRef,\n props: [{\n id\n }, elementProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") SelectGroupLabel.displayName = \"SelectGroupLabel\";","import { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { NOOP } from \"./noop.js\";\nfunction subscribe() {\n return NOOP;\n}\nfunction getSnapshot() {\n return false;\n}\nfunction getServerSnapshot() {\n return true;\n}\n\n/**\n * Returns `true` while React is hydrating server-rendered markup and `false`\n * for fresh client-only mounts.\n */\nexport function useIsHydrating() {\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const SwitchRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") SwitchRootContext.displayName = \"SwitchRootContext\";\nexport function useSwitchRootContext() {\n const context = React.useContext(SwitchRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>.' : _formatErrorMessage(63));\n }\n return context;\n}","export let SwitchRootDataAttributes = /*#__PURE__*/function (SwitchRootDataAttributes) {\n /**\n * Present when the switch is checked.\n */\n SwitchRootDataAttributes[\"checked\"] = \"data-checked\";\n /**\n * Present when the switch is not checked.\n */\n SwitchRootDataAttributes[\"unchecked\"] = \"data-unchecked\";\n /**\n * Present when the switch is disabled.\n */\n SwitchRootDataAttributes[\"disabled\"] = \"data-disabled\";\n /**\n * Present when the switch is readonly.\n */\n SwitchRootDataAttributes[\"readonly\"] = \"data-readonly\";\n /**\n * Present when the switch is required.\n */\n SwitchRootDataAttributes[\"required\"] = \"data-required\";\n /**\n * Present when the switch is in valid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"valid\"] = \"data-valid\";\n /**\n * Present when the switch is in invalid state (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"invalid\"] = \"data-invalid\";\n /**\n * Present when the switch has been touched (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"touched\"] = \"data-touched\";\n /**\n * Present when the switch's value has changed (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"dirty\"] = \"data-dirty\";\n /**\n * Present when the switch is active (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"filled\"] = \"data-filled\";\n /**\n * Present when the switch is focused (when wrapped in Field.Root).\n */\n SwitchRootDataAttributes[\"focused\"] = \"data-focused\";\n return SwitchRootDataAttributes;\n}({});","import { fieldValidityMapping } from \"../field/utils/constants.js\";\nimport { SwitchRootDataAttributes } from \"./root/SwitchRootDataAttributes.js\";\nexport const stateAttributesMapping = {\n ...fieldValidityMapping,\n checked(value) {\n if (value) {\n return {\n [SwitchRootDataAttributes.checked]: ''\n };\n }\n return {\n [SwitchRootDataAttributes.unchecked]: ''\n };\n }\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useMergedRefs } from '@base-ui/utils/useMergedRefs';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { mergeProps } from \"../../merge-props/index.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { SwitchRootContext } from \"./SwitchRootContext.js\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { useRegisterFieldControl } from \"../../field/root/useRegisterFieldControl.js\";\nimport { useFormContext } from \"../../form/FormContext.js\";\nimport { useLabelableContext } from \"../../labelable-provider/LabelableContext.js\";\nimport { useAriaLabelledBy } from \"../../labelable-provider/useAriaLabelledBy.js\";\nimport { useLabelableId } from \"../../labelable-provider/useLabelableId.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { useValueChanged } from \"../../utils/useValueChanged.js\";\n\n/**\n * Represents the switch itself.\n * Renders a `<span>` element and a hidden `<input>` beside.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const SwitchRoot = /*#__PURE__*/React.forwardRef(function SwitchRoot(componentProps, forwardedRef) {\n const {\n checked: checkedProp,\n className,\n defaultChecked,\n 'aria-labelledby': ariaLabelledByProp,\n form,\n id: idProp,\n inputRef: externalInputRef,\n name: nameProp,\n nativeButton = false,\n onCheckedChange: onCheckedChangeProp,\n readOnly = false,\n required = false,\n disabled: disabledProp = false,\n render,\n uncheckedValue,\n value,\n style,\n ...elementProps\n } = componentProps;\n const {\n clearErrors\n } = useFormContext();\n const {\n state: fieldState,\n setTouched,\n setDirty,\n validityData,\n setFilled,\n setFocused,\n shouldValidateOnChange,\n validationMode,\n disabled: fieldDisabled,\n name: fieldName,\n validation\n } = useFieldRootContext();\n const {\n labelId\n } = useLabelableContext();\n const disabled = fieldDisabled || disabledProp;\n const name = fieldName ?? nameProp;\n const onCheckedChange = useStableCallback(onCheckedChangeProp);\n const inputRef = React.useRef(null);\n const handleInputRef = useMergedRefs(inputRef, externalInputRef, validation.inputRef);\n const switchRef = React.useRef(null);\n const id = useBaseUiId();\n const controlId = useLabelableId({\n id: idProp,\n implicit: false,\n controlRef: switchRef\n });\n const hiddenInputId = nativeButton ? undefined : controlId;\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'Switch',\n state: 'checked'\n });\n useRegisterFieldControl(switchRef, {\n id,\n value: checked\n });\n useIsoLayoutEffect(() => {\n if (inputRef.current) {\n setFilled(inputRef.current.checked);\n }\n }, [inputRef, setFilled]);\n useValueChanged(checked, () => {\n clearErrors(name);\n setDirty(checked !== validityData.initialValue);\n setFilled(checked);\n if (shouldValidateOnChange()) {\n validation.commit(checked);\n } else {\n validation.commit(checked, true);\n }\n });\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);\n const rootProps = {\n id: nativeButton ? controlId : id,\n role: 'switch',\n 'aria-checked': checked,\n 'aria-readonly': readOnly || undefined,\n 'aria-required': required || undefined,\n 'aria-labelledby': ariaLabelledBy,\n onFocus() {\n if (!disabled) {\n setFocused(true);\n }\n },\n onBlur() {\n const element = inputRef.current;\n if (!element || disabled) {\n return;\n }\n setTouched(true);\n setFocused(false);\n if (validationMode === 'onBlur') {\n validation.commit(element.checked);\n }\n },\n onClick(event) {\n if (readOnly || disabled) {\n return;\n }\n event.preventDefault();\n inputRef.current?.dispatchEvent(new PointerEvent('click', {\n bubbles: true,\n shiftKey: event.shiftKey,\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n metaKey: event.metaKey\n }));\n }\n };\n const inputProps = React.useMemo(() => mergeProps({\n checked,\n disabled,\n form,\n id: hiddenInputId,\n name,\n required,\n style: name ? visuallyHiddenInput : visuallyHidden,\n tabIndex: -1,\n type: 'checkbox',\n 'aria-hidden': true,\n ref: handleInputRef,\n onChange(event) {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n if (readOnly) {\n event.preventDefault();\n return;\n }\n const nextChecked = event.currentTarget.checked;\n const eventDetails = createChangeEventDetails(REASONS.none, event.nativeEvent);\n onCheckedChange?.(nextChecked, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setCheckedState(nextChecked);\n },\n onFocus() {\n switchRef.current?.focus();\n }\n }, validation.getInputValidationProps,\n // React <19 sets an empty value if `undefined` is passed explicitly\n // To avoid this, we only set the value if it's defined\n value !== undefined ? {\n value\n } : EMPTY_OBJECT), [checked, disabled, form, handleInputRef, hiddenInputId, name, onCheckedChange, readOnly, required, setCheckedState, validation, value]);\n const state = React.useMemo(() => ({\n ...fieldState,\n checked,\n disabled,\n readOnly,\n required\n }), [fieldState, checked, disabled, readOnly, required]);\n const element = useRenderElement('span', componentProps, {\n state,\n ref: [forwardedRef, switchRef, buttonRef],\n props: [rootProps, validation.getValidationProps, elementProps, getButtonProps],\n stateAttributesMapping\n });\n return /*#__PURE__*/_jsxs(SwitchRootContext.Provider, {\n value: state,\n children: [element, !checked && name && uncheckedValue !== undefined && /*#__PURE__*/_jsx(\"input\", {\n type: \"hidden\",\n form: form,\n name: name,\n value: uncheckedValue\n }), /*#__PURE__*/_jsx(\"input\", {\n ...inputProps,\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchRoot.displayName = \"SwitchRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useSwitchRootContext } from \"../root/SwitchRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useFieldRootContext } from \"../../field/root/FieldRootContext.js\";\nimport { stateAttributesMapping } from \"../stateAttributesMapping.js\";\n\n/**\n * The movable part of the switch that indicates whether the switch is on or off.\n * Renders a `<span>`.\n *\n * Documentation: [Base UI Switch](https://base-ui.com/react/components/switch)\n */\nexport const SwitchThumb = /*#__PURE__*/React.forwardRef(function SwitchThumb(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n ...elementProps\n } = componentProps;\n const {\n state: fieldState\n } = useFieldRootContext();\n const state = useSwitchRootContext();\n const extendedState = {\n ...fieldState,\n ...state\n };\n return useRenderElement('span', componentProps, {\n state: extendedState,\n ref: forwardedRef,\n stateAttributesMapping,\n props: elementProps\n });\n});\nif (process.env.NODE_ENV !== \"production\") SwitchThumb.displayName = \"SwitchThumb\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\n/**\n * @internal\n */\nexport const TabsRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TabsRootContext.displayName = \"TabsRootContext\";\nexport function useTabsRootContext() {\n const context = React.useContext(TabsRootContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>.' : _formatErrorMessage(64));\n }\n return context;\n}","export let TabsRootDataAttributes = /*#__PURE__*/function (TabsRootDataAttributes) {\n /**\n * Indicates the direction of the activation (based on the previous active tab).\n * @type {'left' | 'right' | 'up' | 'down' | 'none'}\n */\n TabsRootDataAttributes[\"activationDirection\"] = \"data-activation-direction\";\n /**\n * Indicates the orientation of the tabs.\n * @type {'horizontal' | 'vertical'}\n */\n TabsRootDataAttributes[\"orientation\"] = \"data-orientation\";\n return TabsRootDataAttributes;\n}({});","import { TabsRootDataAttributes } from \"./TabsRootDataAttributes.js\";\nexport const tabsStateAttributesMapping = {\n tabActivationDirection: dir => ({\n [TabsRootDataAttributes.activationDirection]: dir\n })\n};","'use client';\n\nimport * as React from 'react';\nimport { useControlled } from '@base-ui/utils/useControlled';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { CompositeList } from \"../../composite/list/CompositeList.js\";\nimport { TabsRootContext } from \"./TabsRootContext.js\";\nimport { tabsStateAttributesMapping } from \"./stateAttributesMapping.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n/**\n * Groups the tabs and the corresponding panels.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsRoot = /*#__PURE__*/React.forwardRef(function TabsRoot(componentProps, forwardedRef) {\n const {\n className,\n defaultValue: defaultValueProp = 0,\n onValueChange: onValueChangeProp,\n orientation = 'horizontal',\n render,\n value: valueProp,\n style,\n ...elementProps\n } = componentProps;\n\n // Track whether the user explicitly provided a `defaultValue` prop.\n // Used to determine if we should honor a disabled tab selection.\n const hasExplicitDefaultValueProp = Object.hasOwn(componentProps, 'defaultValue');\n const tabPanelRefs = React.useRef([]);\n const [mountedTabPanels, setMountedTabPanels] = React.useState(() => new Map());\n const [value, setValue] = useControlled({\n controlled: valueProp,\n default: defaultValueProp,\n name: 'Tabs',\n state: 'value'\n });\n const isControlled = valueProp !== undefined;\n const [tabMap, setTabMap] = React.useState(() => new Map());\n\n // Used for activation direction detection via tab element positions.\n const getTabElementBySelectedValue = React.useCallback(selectedValue => {\n if (selectedValue === undefined) {\n return null;\n }\n for (const [tabElement, tabMetadata] of tabMap.entries()) {\n if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) {\n return tabElement;\n }\n }\n return null;\n }, [tabMap]);\n const [activationDirectionState, setActivationDirectionState] = React.useState(() => ({\n previousValue: value,\n tabActivationDirection: 'none'\n }));\n const {\n previousValue,\n tabActivationDirection: committedTabActivationDirection\n } = activationDirectionState;\n let tabActivationDirection = committedTabActivationDirection;\n let directionComputationIncomplete = false;\n\n // Compute activation direction during render when value changes so children see\n // the correct direction on their very first render after the selection update.\n // The previous value snapshot is stored in state and synced after commit.\n // https://github.com/mui/base-ui/issues/3873\n if (previousValue !== value) {\n tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap);\n\n // When a new tab is added and selected in the same controlled update,\n // the tab element may not yet be registered in tabMap, so direction was\n // computed from a value-based fallback. Keep the previous value snapshot\n // stale so we re-compute from DOM positions once tabMap is up to date.\n directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null;\n }\n const nextPreviousValue = directionComputationIncomplete ? previousValue : value;\n const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;\n useIsoLayoutEffect(() => {\n if (!shouldSyncActivationDirectionState) {\n return;\n }\n setActivationDirectionState({\n previousValue: nextPreviousValue,\n tabActivationDirection\n });\n }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);\n const onValueChange = useStableCallback((newValue, eventDetails) => {\n const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);\n eventDetails.activationDirection = activationDirection;\n onValueChangeProp?.(newValue, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n setValue(newValue);\n });\n const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {\n setMountedTabPanels(prev => {\n if (prev.get(panelValue) === panelId) {\n return prev;\n }\n const next = new Map(prev);\n next.set(panelValue, panelId);\n return next;\n });\n });\n const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {\n setMountedTabPanels(prev => {\n if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) {\n return prev;\n }\n const next = new Map(prev);\n next.delete(panelValue);\n return next;\n });\n });\n\n // get the `id` attribute of <Tabs.Panel> to set as the value of `aria-controls` on <Tabs.Tab>\n const getTabPanelIdByValue = React.useCallback(tabValue => {\n return mountedTabPanels.get(tabValue);\n }, [mountedTabPanels]);\n\n // get the `id` attribute of <Tabs.Tab> to set as the value of `aria-labelledby` on <Tabs.Panel>\n const getTabIdByPanelValue = React.useCallback(tabPanelValue => {\n for (const tabMetadata of tabMap.values()) {\n if (tabPanelValue === tabMetadata?.value) {\n return tabMetadata?.id;\n }\n }\n return undefined;\n }, [tabMap]);\n const tabsContextValue = React.useMemo(() => ({\n getTabElementBySelectedValue,\n getTabIdByPanelValue,\n getTabPanelIdByValue,\n onValueChange,\n orientation,\n registerMountedTabPanel,\n setTabMap,\n unregisterMountedTabPanel,\n tabActivationDirection,\n value\n }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, unregisterMountedTabPanel, tabActivationDirection, value]);\n const selectedTabMetadata = React.useMemo(() => {\n for (const tabMetadata of tabMap.values()) {\n if (tabMetadata != null && tabMetadata.value === value) {\n return tabMetadata;\n }\n }\n return undefined;\n }, [tabMap, value]);\n\n // Find the first non-disabled tab value.\n // Used as a fallback when the current selection is disabled or missing.\n const firstEnabledTabValue = React.useMemo(() => {\n for (const tabMetadata of tabMap.values()) {\n if (tabMetadata != null && !tabMetadata.disabled) {\n return tabMetadata.value;\n }\n }\n return undefined;\n }, [tabMap]);\n\n // Automatically switch to the first enabled tab when:\n // - The current selection is disabled (and wasn't explicitly set via defaultValue)\n // - The current selection is missing (tab was removed from DOM)\n // Falls back to null if all tabs are disabled.\n useIsoLayoutEffect(() => {\n if (isControlled || tabMap.size === 0) {\n return;\n }\n const selectionIsDisabled = selectedTabMetadata?.disabled;\n const selectionIsMissing = selectedTabMetadata == null && value !== null;\n const shouldHonorExplicitDefaultSelection = hasExplicitDefaultValueProp && selectionIsDisabled && value === defaultValueProp;\n if (shouldHonorExplicitDefaultSelection) {\n return;\n }\n if (!selectionIsDisabled && !selectionIsMissing) {\n return;\n }\n const fallbackValue = firstEnabledTabValue ?? null;\n if (value === fallbackValue) {\n return;\n }\n setValue(fallbackValue);\n setActivationDirectionState(prev => {\n if (prev.tabActivationDirection === 'none') {\n return prev;\n }\n return {\n ...prev,\n tabActivationDirection: 'none'\n };\n });\n }, [defaultValueProp, firstEnabledTabValue, hasExplicitDefaultValueProp, isControlled, selectedTabMetadata, setValue, tabMap, value]);\n const state = {\n orientation,\n tabActivationDirection\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: forwardedRef,\n props: elementProps,\n stateAttributesMapping: tabsStateAttributesMapping\n });\n return /*#__PURE__*/_jsx(TabsRootContext.Provider, {\n value: tabsContextValue,\n children: /*#__PURE__*/_jsx(CompositeList, {\n elementsRef: tabPanelRefs,\n children: element\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TabsRoot.displayName = \"TabsRoot\";\nfunction computeActivationDirection(oldValue, newValue, orientation, tabMap) {\n if (oldValue == null || newValue == null) {\n return 'none';\n }\n let oldTab = null;\n let newTab = null;\n for (const [tabElement, tabMetadata] of tabMap.entries()) {\n if (tabMetadata == null) {\n continue;\n }\n const tabValue = tabMetadata.value ?? tabMetadata.index;\n if (oldValue === tabValue) {\n oldTab = tabElement;\n }\n if (newValue === tabValue) {\n newTab = tabElement;\n }\n if (oldTab != null && newTab != null) {\n break;\n }\n }\n if (oldTab == null || newTab == null) {\n // Fallback for dynamic tabs: when a tab element isn't registered yet\n // (e.g. added and selected in the same update), infer direction from\n // the values themselves. Works for comparable types (numbers, strings).\n if (oldTab !== newTab && (typeof oldValue === 'number' || typeof oldValue === 'string') && typeof oldValue === typeof newValue) {\n if (orientation === 'horizontal') {\n return newValue > oldValue ? 'right' : 'left';\n }\n return newValue > oldValue ? 'down' : 'up';\n }\n return 'none';\n }\n const oldRect = oldTab.getBoundingClientRect();\n const newRect = newTab.getBoundingClientRect();\n if (orientation === 'horizontal') {\n if (newRect.left < oldRect.left) {\n return 'left';\n }\n if (newRect.left > oldRect.left) {\n return 'right';\n }\n } else {\n if (newRect.top < oldRect.top) {\n return 'up';\n }\n if (newRect.top > oldRect.top) {\n return 'down';\n }\n }\n return 'none';\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TabsListContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TabsListContext.displayName = \"TabsListContext\";\nexport function useTabsListContext() {\n const context = React.useContext(TabsListContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>.' : _formatErrorMessage(65));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useButton } from \"../../use-button/index.js\";\nimport { ACTIVE_COMPOSITE_ITEM } from \"../../composite/constants.js\";\nimport { useCompositeItem } from \"../../composite/item/useCompositeItem.js\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.js\";\nimport { useTabsListContext } from \"../list/TabsListContext.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { activeElement, contains } from \"../../floating-ui-react/utils.js\";\n\n/**\n * An individual interactive tab button that toggles the corresponding panel.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsTab = /*#__PURE__*/React.forwardRef(function TabsTab(componentProps, forwardedRef) {\n const {\n className,\n disabled = false,\n render,\n value,\n id: idProp,\n nativeButton = true,\n style,\n ...elementProps\n } = componentProps;\n const {\n value: activeTabValue,\n getTabPanelIdByValue,\n orientation\n } = useTabsRootContext();\n const {\n activateOnFocus,\n highlightedTabIndex,\n onTabActivation,\n registerTabResizeObserverElement,\n setHighlightedTabIndex,\n tabsListElement\n } = useTabsListContext();\n const id = useBaseUiId(idProp);\n const tabMetadata = React.useMemo(() => ({\n disabled,\n id,\n value\n }), [disabled, id, value]);\n const {\n compositeProps,\n compositeRef,\n index\n // hook is used instead of the CompositeItem component\n // because the index is needed for Tab internals\n } = useCompositeItem({\n metadata: tabMetadata\n });\n const active = value === activeTabValue;\n const isNavigatingRef = React.useRef(false);\n const tabElementRef = React.useRef(null);\n React.useEffect(() => {\n const tabElement = tabElementRef.current;\n if (!tabElement) {\n return undefined;\n }\n return registerTabResizeObserverElement(tabElement);\n }, [registerTabResizeObserverElement]);\n\n // Keep the highlighted item in sync with the currently active tab\n // when the value prop changes externally (controlled mode)\n useIsoLayoutEffect(() => {\n if (isNavigatingRef.current) {\n isNavigatingRef.current = false;\n return;\n }\n if (!(active && index > -1 && highlightedTabIndex !== index)) {\n return;\n }\n\n // If focus is currently within the tabs list, don't override the roving\n // focus highlight. This keeps keyboard navigation relative to the focused\n // item after an external/asynchronous selection change.\n const listElement = tabsListElement;\n if (listElement != null) {\n const activeEl = activeElement(ownerDocument(listElement));\n if (activeEl && contains(listElement, activeEl)) {\n return;\n }\n }\n\n // Don't highlight disabled tabs to prevent them from interfering with keyboard navigation.\n // Keyboard focus (tabIndex) should remain on an enabled tab even when a disabled tab is selected.\n if (!disabled) {\n setHighlightedTabIndex(index);\n }\n }, [active, index, highlightedTabIndex, setHighlightedTabIndex, disabled, tabsListElement]);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton,\n focusableWhenDisabled: true\n });\n const tabPanelId = getTabPanelIdByValue(value);\n const isPressingRef = React.useRef(false);\n const isMainButtonRef = React.useRef(false);\n function onClick(event) {\n if (active || disabled) {\n return;\n }\n onTabActivation(value, createChangeEventDetails(REASONS.none, event.nativeEvent, undefined, {\n activationDirection: 'none'\n }));\n }\n function onFocus(event) {\n if (active) {\n return;\n }\n\n // Only highlight enabled tabs when focused (disabled tabs remain focusable via focusableWhenDisabled).\n if (index > -1 && !disabled) {\n setHighlightedTabIndex(index);\n }\n if (disabled) {\n return;\n }\n if (activateOnFocus && (!isPressingRef.current ||\n // keyboard or touch focus\n isPressingRef.current && isMainButtonRef.current) // mouse focus\n ) {\n onTabActivation(value, createChangeEventDetails(REASONS.none, event.nativeEvent, undefined, {\n activationDirection: 'none'\n }));\n }\n }\n function onPointerDown(event) {\n if (active || disabled) {\n return;\n }\n isPressingRef.current = true;\n function handlePointerUp() {\n isPressingRef.current = false;\n isMainButtonRef.current = false;\n }\n if (!event.button || event.button === 0) {\n isMainButtonRef.current = true;\n const doc = ownerDocument(event.currentTarget);\n doc.addEventListener('pointerup', handlePointerUp, {\n once: true\n });\n }\n }\n const state = {\n disabled,\n active,\n orientation\n };\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, buttonRef, compositeRef, tabElementRef],\n props: [compositeProps, {\n role: 'tab',\n 'aria-controls': tabPanelId,\n 'aria-selected': active,\n id,\n onClick,\n onFocus,\n onPointerDown,\n [ACTIVE_COMPOSITE_ITEM]: active ? '' : undefined,\n onKeyDownCapture() {\n isNavigatingRef.current = true;\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TabsTab.displayName = \"TabsTab\";","// This file is autogenerated. Do not edit it directly.\n// To update it, modify the corresponding source file and run `pnpm inline-scripts`.\n\n// prettier-ignore\nexport const script = '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\\'[role=\"tablist\"]\\');if(!e)return;const i=e.querySelector(\"[data-active]\");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c(\"left\",o),c(\"right\",n),c(\"top\",h),c(\"bottom\",l),c(\"width\",r),c(\"height\",f),r>0&&f>0&&t.removeAttribute(\"hidden\")}();';","export let TabsIndicatorCssVars = /*#__PURE__*/function (TabsIndicatorCssVars) {\n /**\n * Indicates the distance on the left side from the parent's container if the tab is active.\n * @type {number}\n */\n TabsIndicatorCssVars[\"activeTabLeft\"] = \"--active-tab-left\";\n /**\n * Indicates the distance on the right side from the parent's container if the tab is active.\n * @type {number}\n */\n TabsIndicatorCssVars[\"activeTabRight\"] = \"--active-tab-right\";\n /**\n * Indicates the distance on the top side from the parent's container if the tab is active.\n * @type {number}\n */\n TabsIndicatorCssVars[\"activeTabTop\"] = \"--active-tab-top\";\n /**\n * Indicates the distance on the bottom side from the parent's container if the tab is active.\n * @type {number}\n */\n TabsIndicatorCssVars[\"activeTabBottom\"] = \"--active-tab-bottom\";\n /**\n * Indicates the width of the tab if it is active.\n * @type {number}\n */\n TabsIndicatorCssVars[\"activeTabWidth\"] = \"--active-tab-width\";\n /**\n * Indicates the height of the tab if it is active.\n * @type {number}\n */\n TabsIndicatorCssVars[\"activeTabHeight\"] = \"--active-tab-height\";\n return TabsIndicatorCssVars;\n}({});","'use client';\n\nimport * as React from 'react';\nimport { useForcedRerendering } from '@base-ui/utils/useForcedRerendering';\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { getCssDimensions } from \"../../utils/getCssDimensions.js\";\nimport { useIsHydrating } from \"../../utils/useIsHydrating.js\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.js\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.js\";\nimport { useTabsListContext } from \"../list/TabsListContext.js\";\nimport { script as prehydrationScript } from \"./prehydrationScript.min.js\";\nimport { TabsIndicatorCssVars } from \"./TabsIndicatorCssVars.js\";\nimport { useCSPContext } from \"../../csp-provider/CSPContext.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...tabsStateAttributesMapping,\n activeTabPosition: () => null,\n activeTabSize: () => null\n};\n\n/**\n * A visual indicator that can be styled to match the position of the currently active tab.\n * Renders a `<span>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsIndicator = /*#__PURE__*/React.forwardRef(function TabIndicator(componentProps, forwardedRef) {\n const {\n className,\n render,\n renderBeforeHydration = false,\n style: styleProp,\n ...elementProps\n } = componentProps;\n const {\n nonce\n } = useCSPContext();\n const {\n getTabElementBySelectedValue,\n orientation,\n tabActivationDirection,\n value\n } = useTabsRootContext();\n const {\n tabsListElement,\n registerIndicatorUpdateListener\n } = useTabsListContext();\n const isHydrating = useIsHydrating();\n const rerender = useForcedRerendering();\n React.useEffect(() => {\n return registerIndicatorUpdateListener(rerender);\n }, [registerIndicatorUpdateListener, rerender]);\n let left = 0;\n let right = 0;\n let top = 0;\n let bottom = 0;\n let width = 0;\n let height = 0;\n let isTabSelected = false;\n if (value != null && tabsListElement != null) {\n const activeTab = getTabElementBySelectedValue(value);\n isTabSelected = true;\n if (activeTab != null) {\n const {\n width: computedWidth,\n height: computedHeight\n } = getCssDimensions(activeTab);\n const {\n width: tabListWidth,\n height: tabListHeight\n } = getCssDimensions(tabsListElement);\n const tabRect = activeTab.getBoundingClientRect();\n const tabsListRect = tabsListElement.getBoundingClientRect();\n const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;\n const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;\n const hasNonZeroScale = Math.abs(scaleX) > Number.EPSILON && Math.abs(scaleY) > Number.EPSILON;\n if (hasNonZeroScale) {\n const tabLeftDelta = tabRect.left - tabsListRect.left;\n const tabTopDelta = tabRect.top - tabsListRect.top;\n left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;\n top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;\n } else {\n left = activeTab.offsetLeft;\n top = activeTab.offsetTop;\n }\n width = computedWidth;\n height = computedHeight;\n right = tabsListElement.scrollWidth - left - width;\n bottom = tabsListElement.scrollHeight - top - height;\n }\n }\n const activeTabPosition = React.useMemo(() => isTabSelected ? {\n left,\n right,\n top,\n bottom\n } : null, [left, right, top, bottom, isTabSelected]);\n const activeTabSize = React.useMemo(() => isTabSelected ? {\n width,\n height\n } : null, [width, height, isTabSelected]);\n const style = React.useMemo(() => {\n if (!isTabSelected) {\n return undefined;\n }\n return {\n [TabsIndicatorCssVars.activeTabLeft]: `${left}px`,\n [TabsIndicatorCssVars.activeTabRight]: `${right}px`,\n [TabsIndicatorCssVars.activeTabTop]: `${top}px`,\n [TabsIndicatorCssVars.activeTabBottom]: `${bottom}px`,\n [TabsIndicatorCssVars.activeTabWidth]: `${width}px`,\n [TabsIndicatorCssVars.activeTabHeight]: `${height}px`\n };\n }, [left, right, top, bottom, width, height, isTabSelected]);\n const displayIndicator = isTabSelected && width > 0 && height > 0;\n const state = {\n orientation,\n activeTabPosition,\n activeTabSize,\n tabActivationDirection\n };\n const element = useRenderElement('span', componentProps, {\n state,\n ref: forwardedRef,\n props: [{\n role: 'presentation',\n style,\n hidden: !displayIndicator // do not display the indicator before the layout is settled\n }, elementProps, {\n suppressHydrationWarning: true\n }],\n stateAttributesMapping\n });\n if (value == null) {\n return null;\n }\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [element, isHydrating && renderBeforeHydration && /*#__PURE__*/_jsx(\"script\", {\n nonce: nonce\n // eslint-disable-next-line react/no-danger\n ,\n dangerouslySetInnerHTML: {\n __html: prehydrationScript\n },\n suppressHydrationWarning: true\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") TabsIndicator.displayName = \"TabsIndicator\";","import { TransitionStatusDataAttributes } from \"../../utils/stateAttributesMapping.js\";\nexport let TabsPanelDataAttributes = function (TabsPanelDataAttributes) {\n /**\n * Indicates the index of the tab panel.\n */\n TabsPanelDataAttributes[\"index\"] = \"data-index\";\n /**\n * Indicates the direction of the activation (based on the previous active tab).\n * @type {'left' | 'right' | 'up' | 'down' | 'none'}\n */\n TabsPanelDataAttributes[\"activationDirection\"] = \"data-activation-direction\";\n /**\n * Indicates the orientation of the tabs.\n * @type {'horizontal' | 'vertical'}\n */\n TabsPanelDataAttributes[\"orientation\"] = \"data-orientation\";\n /**\n * Present when the panel is hidden.\n */\n TabsPanelDataAttributes[\"hidden\"] = \"data-hidden\";\n /**\n * Present when the panel is animating in.\n */\n TabsPanelDataAttributes[TabsPanelDataAttributes[\"startingStyle\"] = TransitionStatusDataAttributes.startingStyle] = \"startingStyle\";\n /**\n * Present when the panel is animating out.\n */\n TabsPanelDataAttributes[TabsPanelDataAttributes[\"endingStyle\"] = TransitionStatusDataAttributes.endingStyle] = \"endingStyle\";\n return TabsPanelDataAttributes;\n}({});","'use client';\n\nimport * as React from 'react';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useTransitionStatus } from \"../../utils/useTransitionStatus.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useCompositeListItem } from \"../../composite/list/useCompositeListItem.js\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.js\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.js\";\nimport { TabsPanelDataAttributes } from \"./TabsPanelDataAttributes.js\";\nconst stateAttributesMapping = {\n ...tabsStateAttributesMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A panel displayed when the corresponding tab is active.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nexport const TabsPanel = /*#__PURE__*/React.forwardRef(function TabPanel(componentProps, forwardedRef) {\n const {\n className,\n value,\n render,\n keepMounted = false,\n style,\n ...elementProps\n } = componentProps;\n const {\n value: selectedValue,\n getTabIdByPanelValue,\n orientation,\n tabActivationDirection,\n registerMountedTabPanel,\n unregisterMountedTabPanel\n } = useTabsRootContext();\n const id = useBaseUiId();\n const metadata = React.useMemo(() => ({\n id,\n value\n }), [id, value]);\n const {\n ref: listItemRef,\n index\n } = useCompositeListItem({\n metadata\n });\n const open = value === selectedValue;\n const {\n mounted,\n transitionStatus,\n setMounted\n } = useTransitionStatus(open);\n const hidden = !mounted;\n const correspondingTabId = getTabIdByPanelValue(value);\n const state = {\n hidden,\n orientation,\n tabActivationDirection,\n transitionStatus\n };\n const panelRef = React.useRef(null);\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, listItemRef, panelRef],\n props: [{\n 'aria-labelledby': correspondingTabId,\n hidden,\n id,\n role: 'tabpanel',\n tabIndex: open ? 0 : -1,\n inert: inertValue(!open),\n [TabsPanelDataAttributes.index]: index\n }, elementProps],\n stateAttributesMapping\n });\n useOpenChangeComplete({\n open,\n ref: panelRef,\n onComplete() {\n if (!open) {\n setMounted(false);\n }\n }\n });\n useIsoLayoutEffect(() => {\n if (hidden && !keepMounted) {\n return undefined;\n }\n if (id == null) {\n return undefined;\n }\n registerMountedTabPanel(value, id);\n return () => {\n unregisterMountedTabPanel(value, id);\n };\n }, [hidden, keepMounted, value, id, registerMountedTabPanel, unregisterMountedTabPanel]);\n const shouldRender = keepMounted || mounted;\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TabsPanel.displayName = \"TabsPanel\";","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { CompositeRoot } from \"../../composite/root/CompositeRoot.js\";\nimport { tabsStateAttributesMapping } from \"../root/stateAttributesMapping.js\";\nimport { useTabsRootContext } from \"../root/TabsRootContext.js\";\nimport { TabsListContext } from \"./TabsListContext.js\";\nimport { EMPTY_ARRAY } from \"../../utils/constants.js\";\n\n/**\n * Groups the individual tab buttons.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TabsList = /*#__PURE__*/React.forwardRef(function TabsList(componentProps, forwardedRef) {\n const {\n activateOnFocus = false,\n className,\n loopFocus = true,\n render,\n style,\n ...elementProps\n } = componentProps;\n const {\n onValueChange,\n orientation,\n value,\n setTabMap,\n tabActivationDirection\n } = useTabsRootContext();\n const [highlightedTabIndex, setHighlightedTabIndex] = React.useState(0);\n const [tabsListElement, setTabsListElement] = React.useState(null);\n const indicatorUpdateListenersRef = React.useRef(new Set());\n const tabResizeObserverElementsRef = React.useRef(new Set());\n const resizeObserverRef = React.useRef(null);\n const notifyIndicatorUpdateListeners = useStableCallback(() => {\n indicatorUpdateListenersRef.current.forEach(listener => {\n listener();\n });\n });\n React.useEffect(() => {\n if (typeof ResizeObserver === 'undefined') {\n return undefined;\n }\n const resizeObserver = new ResizeObserver(() => {\n if (!indicatorUpdateListenersRef.current.size) {\n return;\n }\n notifyIndicatorUpdateListeners();\n });\n resizeObserverRef.current = resizeObserver;\n if (tabsListElement) {\n resizeObserver.observe(tabsListElement);\n }\n tabResizeObserverElementsRef.current.forEach(element => {\n resizeObserver.observe(element);\n });\n return () => {\n resizeObserver.disconnect();\n resizeObserverRef.current = null;\n };\n }, [tabsListElement, notifyIndicatorUpdateListeners]);\n const registerIndicatorUpdateListener = useStableCallback(listener => {\n indicatorUpdateListenersRef.current.add(listener);\n return () => {\n indicatorUpdateListenersRef.current.delete(listener);\n };\n });\n const registerTabResizeObserverElement = useStableCallback(element => {\n tabResizeObserverElementsRef.current.add(element);\n resizeObserverRef.current?.observe(element);\n return () => {\n tabResizeObserverElementsRef.current.delete(element);\n resizeObserverRef.current?.unobserve(element);\n };\n });\n const onTabActivation = useStableCallback((newValue, eventDetails) => {\n if (newValue !== value) {\n onValueChange(newValue, eventDetails);\n }\n });\n const state = {\n orientation,\n tabActivationDirection\n };\n const defaultProps = {\n 'aria-orientation': orientation === 'vertical' ? 'vertical' : undefined,\n role: 'tablist'\n };\n const tabsListContextValue = React.useMemo(() => ({\n activateOnFocus,\n highlightedTabIndex,\n registerIndicatorUpdateListener,\n registerTabResizeObserverElement,\n onTabActivation,\n setHighlightedTabIndex,\n tabsListElement\n }), [activateOnFocus, highlightedTabIndex, registerIndicatorUpdateListener, registerTabResizeObserverElement, onTabActivation, setHighlightedTabIndex, tabsListElement]);\n return /*#__PURE__*/_jsx(TabsListContext.Provider, {\n value: tabsListContextValue,\n children: /*#__PURE__*/_jsx(CompositeRoot, {\n render: render,\n className: className,\n style: style,\n state: state,\n refs: [forwardedRef, setTabsListElement],\n props: [defaultProps, elementProps],\n stateAttributesMapping: tabsStateAttributesMapping,\n highlightedIndex: highlightedTabIndex,\n enableHomeAndEndKeys: true,\n loopFocus: loopFocus,\n orientation: orientation,\n onHighlightedIndexChange: setHighlightedTabIndex,\n onMapChange: setTabMap,\n disabledIndices: EMPTY_ARRAY\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TabsList.displayName = \"TabsList\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastContext.displayName = \"ToastContext\";\nexport function useToastProviderContext() {\n const context = React.useContext(ToastContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: useToastManager must be used within <Toast.Provider>.' : _formatErrorMessage(73));\n }\n return context;\n}","let counter = 0;\nexport function generateId(prefix) {\n counter += 1;\n return `${prefix}-${Math.random().toString(36).slice(2, 6)}-${counter}`;\n}","export function resolvePromiseOptions(options, result) {\n if (typeof options === 'string') {\n return {\n description: options\n };\n }\n if (typeof options === 'function') {\n const resolvedOptions = options(result);\n return typeof resolvedOptions === 'string' ? {\n description: resolvedOptions\n } : resolvedOptions;\n }\n return options;\n}","import { ReactStore, createSelector, createSelectorMemoized } from '@base-ui/utils/store';\nimport { generateId } from '@base-ui/utils/generateId';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { Timeout } from '@base-ui/utils/useTimeout';\nimport { resolvePromiseOptions } from \"./utils/resolvePromiseOptions.js\";\nimport { activeElement, contains, getTarget } from \"../floating-ui-react/utils.js\";\nimport { isFocusVisible } from \"./utils/focusVisible.js\";\nconst toastMapSelector = createSelectorMemoized(state => state.toasts, toasts => {\n const map = new Map();\n let visibleIndex = 0;\n let offsetY = 0;\n toasts.forEach((toast, toastIndex) => {\n const isEnding = toast.transitionStatus === 'ending';\n map.set(toast.id, {\n value: toast,\n domIndex: toastIndex,\n visibleIndex: isEnding ? -1 : visibleIndex,\n offsetY\n });\n offsetY += toast.height || 0;\n if (!isEnding) {\n visibleIndex += 1;\n }\n });\n return map;\n});\nexport const selectors = {\n toasts: createSelector(state => state.toasts),\n isEmpty: createSelector(state => state.toasts.length === 0),\n toast: createSelector(toastMapSelector, (toastMap, id) => toastMap.get(id)?.value),\n toastIndex: createSelector(toastMapSelector, (toastMap, id) => toastMap.get(id)?.domIndex ?? -1),\n toastOffsetY: createSelector(toastMapSelector, (toastMap, id) => toastMap.get(id)?.offsetY ?? 0),\n toastVisibleIndex: createSelector(toastMapSelector, (toastMap, id) => toastMap.get(id)?.visibleIndex ?? -1),\n hovering: createSelector(state => state.hovering),\n focused: createSelector(state => state.focused),\n expanded: createSelector(state => state.hovering || state.focused),\n expandedOrOutOfFocus: createSelector(state => state.hovering || state.focused || !state.isWindowFocused),\n prevFocusElement: createSelector(state => state.prevFocusElement)\n};\nexport class ToastStore extends ReactStore {\n timers = new Map();\n areTimersPaused = false;\n constructor(initialState) {\n super(initialState, {}, selectors);\n }\n setFocused(focused) {\n this.set('focused', focused);\n }\n setHovering(hovering) {\n this.set('hovering', hovering);\n }\n setIsWindowFocused(isWindowFocused) {\n this.set('isWindowFocused', isWindowFocused);\n }\n setPrevFocusElement(prevFocusElement) {\n this.set('prevFocusElement', prevFocusElement);\n }\n setViewport = viewport => {\n this.set('viewport', viewport);\n };\n disposeEffect = () => {\n return () => {\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n };\n };\n removeToast(toastId, behavior = {}) {\n const index = selectors.toastIndex(this.state, toastId);\n if (index === -1) {\n return;\n }\n const toast = this.state.toasts[index];\n if (!behavior.skipOnRemove) {\n toast?.onRemove?.();\n }\n const newToasts = [...this.state.toasts];\n newToasts.splice(index, 1);\n this.setToasts(newToasts);\n }\n addToast = toast => {\n const {\n timeout,\n limit\n } = this.state;\n const id = toast.id || generateId('toast');\n if (toast.id) {\n const existingToast = selectors.toast(this.state, toast.id);\n if (existingToast) {\n if (existingToast.transitionStatus === 'ending') {\n this.removeToast(toast.id, {\n skipOnRemove: true\n });\n } else {\n const {\n id: ignoredId,\n transitionStatus: ignoredTransitionStatus,\n ...updates\n } = toast;\n this.updateToastInternal(toast.id, updates, {\n resetTimer: true,\n markUpdated: true\n });\n return toast.id;\n }\n }\n }\n const toastToAdd = {\n ...toast,\n id,\n updateKey: 0,\n transitionStatus: 'starting'\n };\n const updatedToasts = [toastToAdd, ...this.state.toasts];\n const activeToasts = updatedToasts.filter(t => t.transitionStatus !== 'ending');\n\n // Mark oldest toasts for removal when over limit\n if (activeToasts.length > limit) {\n const excessCount = activeToasts.length - limit;\n const oldestActiveToasts = activeToasts.slice(-excessCount);\n const limitedIds = new Set(oldestActiveToasts.map(t => t.id));\n this.setToasts(updatedToasts.map(t => {\n const limited = limitedIds.has(t.id);\n if (t.limited !== limited) {\n return {\n ...t,\n limited\n };\n }\n return t;\n }));\n } else {\n this.setToasts(updatedToasts.map(t => t.limited ? {\n ...t,\n limited: false\n } : t));\n }\n const duration = toastToAdd.timeout ?? timeout;\n if (toastToAdd.type !== 'loading' && duration > 0) {\n this.scheduleTimer(id, duration, () => this.closeToast(id));\n }\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n return id;\n };\n updateToast = (id, updates) => {\n this.updateToastInternal(id, updates, {\n markUpdated: true\n });\n };\n updateToastInternal = (id, updates, behavior = {}) => {\n const {\n timeout,\n toasts\n } = this.state;\n const prevToast = selectors.toast(this.state, id) ?? null;\n if (!prevToast) {\n return;\n }\n\n // Ignore updates for toasts that are already closing.\n // This prevents races where async updates (e.g. promise success/error)\n // can block a dismissal from completing.\n if (prevToast.transitionStatus === 'ending') {\n return;\n }\n const nextToast = {\n ...prevToast,\n ...updates,\n ...(behavior.markUpdated && {\n updateKey: (prevToast.updateKey ?? 0) + 1\n })\n };\n this.setToasts(toasts.map(toast => toast.id === id ? nextToast : toast));\n const nextTimeout = nextToast.timeout ?? timeout;\n const prevTimeout = prevToast?.timeout ?? timeout;\n const timeoutUpdated = Object.hasOwn(updates, 'timeout');\n const shouldHaveTimer = nextToast.transitionStatus !== 'ending' && nextToast.type !== 'loading' && nextTimeout > 0;\n const hasTimer = this.timers.has(id);\n const timeoutChanged = prevTimeout !== nextTimeout;\n const wasLoading = prevToast?.type === 'loading';\n if (!shouldHaveTimer && hasTimer) {\n const timer = this.timers.get(id);\n timer?.timeout?.clear();\n this.timers.delete(id);\n return;\n }\n\n // Schedule or reschedule timer if needed\n if (shouldHaveTimer && (!hasTimer || timeoutChanged || timeoutUpdated || wasLoading || behavior.resetTimer)) {\n const timer = this.timers.get(id);\n if (timer) {\n timer.timeout?.clear();\n this.timers.delete(id);\n }\n this.scheduleTimer(id, nextTimeout, () => this.closeToast(id));\n if (selectors.expandedOrOutOfFocus(this.state)) {\n this.pauseTimers();\n }\n }\n };\n closeToast = toastId => {\n const closeAll = toastId === undefined;\n const {\n limit,\n toasts\n } = this.state;\n let toastsToClose;\n if (closeAll) {\n toastsToClose = toasts;\n this.timers.forEach(timer => {\n timer.timeout?.clear();\n });\n this.timers.clear();\n } else {\n const toast = selectors.toast(this.state, toastId);\n if (!toast) {\n return;\n }\n toastsToClose = [toast];\n const timer = this.timers.get(toastId);\n if (timer?.timeout) {\n timer.timeout.clear();\n this.timers.delete(toastId);\n }\n }\n let activeIndex = 0;\n const newToasts = toasts.map(item => {\n if (closeAll || item.id === toastId) {\n return {\n ...item,\n transitionStatus: 'ending',\n height: 0\n };\n }\n if (item.transitionStatus === 'ending') {\n return item;\n }\n const isLimited = activeIndex >= limit;\n activeIndex += 1;\n return item.limited !== isLimited ? {\n ...item,\n limited: isLimited\n } : item;\n });\n const updates = {\n toasts: newToasts\n };\n if (closeAll || toasts.length === 1) {\n updates.hovering = false;\n updates.focused = false;\n }\n this.update(updates);\n toastsToClose.forEach(toast => {\n if (toast.transitionStatus !== 'ending') {\n toast.onClose?.();\n }\n });\n this.handleFocusManagement(toastId);\n };\n promiseToast = (promiseValue, options) => {\n // Create a loading toast (which does not auto-dismiss).\n const loadingOptions = resolvePromiseOptions(options.loading);\n const id = this.addToast({\n ...loadingOptions,\n type: 'loading'\n });\n const handledPromise = promiseValue.then(result => {\n const successOptions = resolvePromiseOptions(options.success, result);\n this.updateToast(id, {\n ...successOptions,\n type: 'success',\n timeout: successOptions.timeout\n });\n return result;\n }).catch(error => {\n const errorOptions = resolvePromiseOptions(options.error, error);\n this.updateToast(id, {\n ...errorOptions,\n type: 'error',\n timeout: errorOptions.timeout\n });\n return Promise.reject(error);\n });\n\n // Private API used exclusively by `Manager` to handoff the promise\n // back to the manager after it's handled here.\n if ({}.hasOwnProperty.call(options, 'setPromise')) {\n options.setPromise(handledPromise);\n }\n return handledPromise;\n };\n pauseTimers() {\n if (this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = true;\n this.timers.forEach(timer => {\n if (timer.timeout) {\n timer.timeout.clear();\n const elapsed = Date.now() - timer.start;\n const remaining = timer.delay - elapsed;\n timer.remaining = remaining > 0 ? remaining : 0;\n }\n });\n }\n resumeTimers() {\n if (!this.areTimersPaused) {\n return;\n }\n this.areTimersPaused = false;\n this.timers.forEach((timer, id) => {\n timer.remaining = timer.remaining > 0 ? timer.remaining : timer.delay;\n timer.timeout ??= Timeout.create();\n timer.timeout.start(timer.remaining, () => {\n this.timers.delete(id);\n timer.callback();\n });\n timer.start = Date.now();\n });\n }\n restoreFocusToPrevElement() {\n this.state.prevFocusElement?.focus({\n preventScroll: true\n });\n }\n handleDocumentPointerDown = event => {\n if (event.pointerType !== 'touch') {\n return;\n }\n const target = getTarget(event);\n if (contains(this.state.viewport, target)) {\n return;\n }\n this.resumeTimers();\n this.update({\n hovering: false,\n focused: false\n });\n };\n scheduleTimer(id, delay, callback) {\n const start = Date.now();\n const shouldStartActive = !selectors.expandedOrOutOfFocus(this.state);\n const currentTimeout = shouldStartActive ? Timeout.create() : undefined;\n currentTimeout?.start(delay, () => {\n this.timers.delete(id);\n callback();\n });\n this.timers.set(id, {\n timeout: currentTimeout,\n start: shouldStartActive ? start : 0,\n delay,\n remaining: delay,\n callback\n });\n }\n setToasts(newToasts) {\n const updates = {\n toasts: newToasts\n };\n if (newToasts.length === 0) {\n updates.hovering = false;\n updates.focused = false;\n }\n this.update(updates);\n }\n handleFocusManagement(toastId) {\n const activeEl = activeElement(ownerDocument(this.state.viewport));\n if (!this.state.viewport || !contains(this.state.viewport, activeEl) || !isFocusVisible(activeEl)) {\n return;\n }\n if (toastId === undefined) {\n this.restoreFocusToPrevElement();\n return;\n }\n const toasts = selectors.toasts(this.state);\n const currentIndex = selectors.toastIndex(this.state, toastId);\n let nextToast = null;\n\n // Try to find the next toast that isn't animating out\n let index = currentIndex + 1;\n while (index < toasts.length) {\n if (toasts[index].transitionStatus !== 'ending') {\n nextToast = toasts[index];\n break;\n }\n index += 1;\n }\n\n // Go backwards if no next toast is found\n if (!nextToast) {\n index = currentIndex - 1;\n while (index >= 0) {\n if (toasts[index].transitionStatus !== 'ending') {\n nextToast = toasts[index];\n break;\n }\n index -= 1;\n }\n }\n if (nextToast) {\n nextToast.ref?.current?.focus();\n } else {\n this.restoreFocusToPrevElement();\n }\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useOnMount } from '@base-ui/utils/useOnMount';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { ToastContext } from \"./ToastProviderContext.js\";\nimport { ToastStore } from \"../store.js\";\n\n/**\n * Provides a context for creating and managing toasts.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ToastProvider = function ToastProvider(props) {\n const {\n children,\n timeout = 5000,\n limit = 3,\n toastManager\n } = props;\n const store = useRefWithInit(() => new ToastStore({\n timeout,\n limit,\n viewport: null,\n toasts: [],\n hovering: false,\n focused: false,\n isWindowFocused: true,\n prevFocusElement: null\n })).current;\n useOnMount(store.disposeEffect);\n React.useEffect(function subscribeToToastManager() {\n if (!toastManager) {\n return undefined;\n }\n const unsubscribe = toastManager[' subscribe'](({\n action,\n options\n }) => {\n const id = options.id;\n if (action === 'promise' && options.promise) {\n store.promiseToast(options.promise, options);\n } else if (action === 'update' && id) {\n store.updateToast(id, options);\n } else if (action === 'close') {\n store.closeToast(id);\n } else {\n store.addToast(options);\n }\n });\n return unsubscribe;\n }, [store, timeout, toastManager]);\n store.useSyncedValues({\n timeout,\n limit\n });\n return /*#__PURE__*/_jsx(ToastContext.Provider, {\n value: store,\n children: children\n });\n};\nif (process.env.NODE_ENV !== \"production\") ToastProvider.displayName = \"ToastProvider\";","export let ToastViewportCssVars = /*#__PURE__*/function (ToastViewportCssVars) {\n /**\n * Indicates the height of the frontmost toast.\n * @type {number}\n */\n ToastViewportCssVars[\"frontmostHeight\"] = \"--toast-frontmost-height\";\n return ToastViewportCssVars;\n}({});","'use client';\n\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\nimport { useTimeout } from '@base-ui/utils/useTimeout';\nimport { activeElement, contains, getTarget } from \"../../floating-ui-react/utils.js\";\nimport { FocusGuard } from \"../../utils/FocusGuard.js\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { isFocusVisible } from \"../utils/focusVisible.js\";\nimport { ToastViewportCssVars } from \"./ToastViewportCssVars.js\";\n\n/**\n * A container viewport for toasts.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const ToastViewport = /*#__PURE__*/React.forwardRef(function ToastViewport(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const windowFocusTimeout = useTimeout();\n const handlingFocusGuardRef = React.useRef(false);\n const markedReadyForMouseLeaveRef = React.useRef(false);\n const touchActiveRef = React.useRef(false);\n const isEmpty = store.useState('isEmpty');\n const toasts = store.useState('toasts');\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n const prevFocusElement = store.useState('prevFocusElement');\n const frontmostHeight = toasts[0]?.height ?? 0;\n const hasTransitioningToasts = React.useMemo(() => toasts.some(toast => toast.transitionStatus === 'ending'), [toasts]);\n\n // Listen globally for F6 so we can force-focus the viewport.\n React.useEffect(() => {\n const viewport = store.state.viewport;\n if (!viewport) {\n return undefined;\n }\n function handleGlobalKeyDown(event) {\n if (isEmpty) {\n return;\n }\n if (event.key === 'F6' && getTarget(event) !== viewport) {\n event.preventDefault();\n store.setPrevFocusElement(activeElement(ownerDocument(viewport)));\n viewport?.focus({\n preventScroll: true\n });\n store.pauseTimers();\n store.setFocused(true);\n }\n }\n const win = ownerWindow(viewport);\n return addEventListener(win, 'keydown', handleGlobalKeyDown);\n }, [store, isEmpty]);\n React.useEffect(() => {\n const viewport = store.state.viewport;\n if (!viewport || isEmpty) {\n return undefined;\n }\n const win = ownerWindow(viewport);\n function handleWindowBlur(event) {\n if (getTarget(event) !== win) {\n return;\n }\n store.setIsWindowFocused(false);\n store.pauseTimers();\n }\n function handleWindowFocus(event) {\n if (event.relatedTarget) {\n return;\n }\n const target = getTarget(event);\n const activeEl = activeElement(ownerDocument(viewport));\n if (target === win || !contains(viewport, target) || !isFocusVisible(activeEl)) {\n store.resumeTimers();\n }\n\n // Wait for the `handleFocus` event to fire.\n windowFocusTimeout.start(0, () => store.setIsWindowFocused(true));\n }\n return mergeCleanups(addEventListener(win, 'blur', handleWindowBlur, true), addEventListener(win, 'focus', handleWindowFocus, true));\n }, [store, windowFocusTimeout,\n // `store.state.viewport` isn't available on the first render,\n // since the portal node hasn't yet been created.\n // By adding this dependency, we ensure the window listeners\n // are added when toasts have been created, once the ref is available.\n isEmpty]);\n React.useEffect(() => {\n const viewport = store.state.viewport;\n if (!viewport || isEmpty) {\n return undefined;\n }\n const doc = ownerDocument(viewport);\n return addEventListener(doc, 'pointerdown', store.handleDocumentPointerDown, true);\n }, [isEmpty, store]);\n function handleFocusGuard(event) {\n const viewport = store.state.viewport;\n if (!viewport) {\n return;\n }\n handlingFocusGuardRef.current = true;\n\n // If we're coming off the container, move to the first toast\n if (event.relatedTarget === viewport) {\n toasts[0]?.ref?.current?.focus();\n } else {\n store.restoreFocusToPrevElement();\n }\n }\n function handleKeyDown(event) {\n if (event.key === 'Tab' && event.shiftKey && getTarget(event.nativeEvent) === store.state.viewport) {\n event.preventDefault();\n store.restoreFocusToPrevElement();\n store.resumeTimers();\n }\n }\n function flushMouseLeave() {\n const hasEndingToasts = store.state.toasts.some(toast => toast.transitionStatus === 'ending');\n if (!store.state.isWindowFocused || hasEndingToasts || touchActiveRef.current || !markedReadyForMouseLeaveRef.current) {\n return;\n }\n\n // Once transitions have finished, see if a mouseleave was already triggered\n // but blocked from taking effect. If so, we can now safely resume timers and\n // collapse the viewport.\n store.resumeTimers();\n store.setHovering(false);\n markedReadyForMouseLeaveRef.current = false;\n }\n React.useEffect(flushMouseLeave, [hasTransitioningToasts, store]);\n function handleMouseEnter() {\n store.pauseTimers();\n store.setHovering(true);\n markedReadyForMouseLeaveRef.current = false;\n }\n function handleMouseLeave() {\n if (hasTransitioningToasts || touchActiveRef.current) {\n // When swiping to dismiss, wait until the transitions have settled\n // or the touch interaction ends to avoid collapsing mid-gesture.\n markedReadyForMouseLeaveRef.current = true;\n } else {\n store.resumeTimers();\n store.setHovering(false);\n }\n }\n function handlePointerDown(event) {\n if (event.pointerType === 'touch') {\n touchActiveRef.current = true;\n }\n }\n function handlePointerEnd(event) {\n if (event.pointerType !== 'touch') {\n return;\n }\n touchActiveRef.current = false;\n flushMouseLeave();\n }\n function handleFocus() {\n if (handlingFocusGuardRef.current) {\n handlingFocusGuardRef.current = false;\n return;\n }\n if (focused) {\n return;\n }\n\n // Only set focused when the active element is focus-visible.\n // This prevents the viewport from staying expanded when clicking inside without\n // keyboard navigation.\n if (isFocusVisible(activeElement(ownerDocument(store.state.viewport)))) {\n store.setFocused(true);\n store.pauseTimers();\n }\n }\n function handleBlur(event) {\n if (!focused || contains(store.state.viewport, event.relatedTarget)) {\n return;\n }\n store.setFocused(false);\n store.resumeTimers();\n }\n const defaultProps = {\n tabIndex: -1,\n role: 'region',\n 'aria-live': 'polite',\n 'aria-atomic': false,\n 'aria-relevant': 'additions text',\n 'aria-label': 'Notifications',\n onMouseEnter: handleMouseEnter,\n onMouseMove: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onKeyDown: handleKeyDown,\n onClick: handleFocus,\n onPointerDown: handlePointerDown,\n onPointerUp: handlePointerEnd,\n onPointerCancel: handlePointerEnd\n };\n const state = {\n expanded\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, store.setViewport],\n state,\n props: [defaultProps, {\n style: {\n [ToastViewportCssVars.frontmostHeight]: frontmostHeight ? `${frontmostHeight}px` : undefined\n }\n }, elementProps, {\n children: /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!isEmpty && prevFocusElement && /*#__PURE__*/_jsx(FocusGuard, {\n onFocus: handleFocusGuard\n }), children, !isEmpty && prevFocusElement && /*#__PURE__*/_jsx(FocusGuard, {\n onFocus: handleFocusGuard\n })]\n })\n }]\n });\n const highPriorityToasts = React.useMemo(() => toasts.filter(toast => toast.priority === 'high'), [toasts]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [!isEmpty && prevFocusElement && /*#__PURE__*/_jsx(FocusGuard, {\n onFocus: handleFocusGuard\n }), element, !focused && highPriorityToasts.length > 0 && /*#__PURE__*/_jsx(\"div\", {\n style: visuallyHidden,\n children: highPriorityToasts.map(toast => /*#__PURE__*/_jsxs(\"div\", {\n role: \"alert\",\n \"aria-atomic\": true,\n children: [/*#__PURE__*/_jsx(\"div\", {\n children: toast.title\n }), /*#__PURE__*/_jsx(\"div\", {\n children: toast.description\n })]\n }, toast.id))\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastViewport.displayName = \"ToastViewport\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const ToastRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") ToastRootContext.displayName = \"ToastRootContext\";\nexport function useToastRootContext() {\n const context = React.useContext(ToastRootContext);\n if (!context) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.' : _formatErrorMessage(66));\n }\n return context;\n}","export let ToastRootCssVars = /*#__PURE__*/function (ToastRootCssVars) {\n /**\n * Indicates the index of the toast in the list.\n * @type {number}\n */\n ToastRootCssVars[\"index\"] = \"--toast-index\";\n /**\n * Indicates the vertical pixels offset of the toast in the list when expanded.\n * @type {number}\n */\n ToastRootCssVars[\"offsetY\"] = \"--toast-offset-y\";\n /**\n * Indicates the measured natural height of the toast in pixels.\n * @type {number}\n */\n ToastRootCssVars[\"height\"] = \"--toast-height\";\n /**\n * Indicates the horizontal swipe movement of the toast.\n * @type {number}\n */\n ToastRootCssVars[\"swipeMovementX\"] = \"--toast-swipe-movement-x\";\n /**\n * Indicates the vertical swipe movement of the toast.\n * @type {number}\n */\n ToastRootCssVars[\"swipeMovementY\"] = \"--toast-swipe-movement-y\";\n return ToastRootCssVars;\n}({});","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { ownerDocument, ownerWindow } from '@base-ui/utils/owner';\nimport { inertValue } from '@base-ui/utils/inertValue';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { activeElement, contains, getTarget } from \"../../floating-ui-react/utils.js\";\nimport { ToastRootContext } from \"./ToastRootContext.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { ToastRootCssVars } from \"./ToastRootCssVars.js\";\nimport { BASE_UI_SWIPE_IGNORE_SELECTOR, LEGACY_SWIPE_IGNORE_SELECTOR } from \"../../utils/constants.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst stateAttributesMapping = {\n ...transitionStatusMapping,\n swipeDirection(value) {\n return value ? {\n 'data-swipe-direction': value\n } : null;\n }\n};\nconst SWIPE_THRESHOLD = 40;\nconst REVERSE_CANCEL_THRESHOLD = 10;\nconst OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;\nconst MIN_DRAG_THRESHOLD = 1;\nconst TOAST_SWIPE_IGNORE_SELECTOR = `${BASE_UI_SWIPE_IGNORE_SELECTOR},${LEGACY_SWIPE_IGNORE_SELECTOR}`;\nfunction getDisplacement(direction, deltaX, deltaY) {\n switch (direction) {\n case 'up':\n return -deltaY;\n case 'down':\n return deltaY;\n case 'left':\n return -deltaX;\n case 'right':\n return deltaX;\n default:\n return 0;\n }\n}\nfunction getElementTransform(element) {\n const computedStyle = ownerWindow(element).getComputedStyle(element);\n const transform = computedStyle.transform;\n let translateX = 0;\n let translateY = 0;\n let scale = 1;\n if (transform && transform !== 'none') {\n const matrix = transform.match(/matrix(?:3d)?\\(([^)]+)\\)/);\n if (matrix) {\n const values = matrix[1].split(', ').map(parseFloat);\n if (values.length === 6) {\n translateX = values[4];\n translateY = values[5];\n scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);\n } else if (values.length === 16) {\n translateX = values[12];\n translateY = values[13];\n scale = values[0];\n }\n }\n }\n return {\n x: translateX,\n y: translateY,\n scale\n };\n}\n\n/**\n * Groups all parts of an individual toast.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastRoot = /*#__PURE__*/React.forwardRef(function ToastRoot(componentProps, forwardedRef) {\n const {\n toast,\n render,\n className,\n swipeDirection = ['down', 'right'],\n style,\n ...elementProps\n } = componentProps;\n const isAnchored = toast.positionerProps?.anchor !== undefined;\n let swipeDirections = [];\n if (!isAnchored) {\n swipeDirections = Array.isArray(swipeDirection) ? swipeDirection : [swipeDirection];\n }\n const swipeEnabled = swipeDirections.length > 0;\n const store = useToastProviderContext();\n const [currentSwipeDirection, setCurrentSwipeDirection] = React.useState(undefined);\n const [isSwiping, setIsSwiping] = React.useState(false);\n const [isRealSwipe, setIsRealSwipe] = React.useState(false);\n const [dragDismissed, setDragDismissed] = React.useState(false);\n const [dragOffset, setDragOffset] = React.useState({\n x: 0,\n y: 0\n });\n const [initialTransform, setInitialTransform] = React.useState({\n x: 0,\n y: 0,\n scale: 1\n });\n const [titleId, setTitleId] = React.useState();\n const [descriptionId, setDescriptionId] = React.useState();\n const [lockedDirection, setLockedDirection] = React.useState(null);\n const rootRef = React.useRef(null);\n const dragStartPosRef = React.useRef({\n x: 0,\n y: 0\n });\n const initialTransformRef = React.useRef({\n x: 0,\n y: 0,\n scale: 1\n });\n const intendedSwipeDirectionRef = React.useRef(undefined);\n const maxSwipeDisplacementRef = React.useRef(0);\n const cancelledSwipeRef = React.useRef(false);\n const swipeCancelBaselineRef = React.useRef({\n x: 0,\n y: 0\n });\n const isFirstPointerMoveRef = React.useRef(false);\n const domIndex = store.useState('toastIndex', toast.id);\n const visibleIndex = store.useState('toastVisibleIndex', toast.id);\n const offsetY = store.useState('toastOffsetY', toast.id);\n const focused = store.useState('focused');\n const expanded = store.useState('expanded');\n useOpenChangeComplete({\n open: toast.transitionStatus !== 'ending',\n ref: rootRef,\n onComplete() {\n if (toast.transitionStatus === 'ending') {\n store.removeToast(toast.id);\n }\n }\n });\n\n /**\n * Recalculates the natural height of the toast and updates it in the toast manager.\n * @param flushSync Whether to flush the update synchronously. Use in observer\n * callbacks to avoid visual flickers.\n */\n const recalculateHeight = useStableCallback((flushSync = false) => {\n const element = rootRef.current;\n if (!element) {\n return;\n }\n const previousHeight = element.style.height;\n element.style.height = 'auto';\n const height = element.offsetHeight;\n element.style.height = previousHeight;\n function update() {\n store.updateToastInternal(toast.id, {\n ref: rootRef,\n height,\n ...(toast.transitionStatus === 'starting' ? {\n transitionStatus: undefined\n } : {})\n });\n }\n if (flushSync) {\n ReactDOM.flushSync(update);\n } else {\n update();\n }\n });\n useIsoLayoutEffect(recalculateHeight, [recalculateHeight]);\n function applyDirectionalDamping(deltaX, deltaY) {\n let newDeltaX = deltaX;\n let newDeltaY = deltaY;\n if (!swipeDirections.includes('left') && !swipeDirections.includes('right')) {\n newDeltaX = deltaX > 0 ? deltaX ** OPPOSITE_DIRECTION_DAMPING_FACTOR : -(Math.abs(deltaX) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n } else {\n if (!swipeDirections.includes('right') && deltaX > 0) {\n newDeltaX = deltaX ** OPPOSITE_DIRECTION_DAMPING_FACTOR;\n }\n if (!swipeDirections.includes('left') && deltaX < 0) {\n newDeltaX = -(Math.abs(deltaX) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n }\n }\n if (!swipeDirections.includes('up') && !swipeDirections.includes('down')) {\n newDeltaY = deltaY > 0 ? deltaY ** OPPOSITE_DIRECTION_DAMPING_FACTOR : -(Math.abs(deltaY) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n } else {\n if (!swipeDirections.includes('down') && deltaY > 0) {\n newDeltaY = deltaY ** OPPOSITE_DIRECTION_DAMPING_FACTOR;\n }\n if (!swipeDirections.includes('up') && deltaY < 0) {\n newDeltaY = -(Math.abs(deltaY) ** OPPOSITE_DIRECTION_DAMPING_FACTOR);\n }\n }\n return {\n x: newDeltaX,\n y: newDeltaY\n };\n }\n function handlePointerDown(event) {\n if (event.button !== 0) {\n return;\n }\n if (event.pointerType === 'touch') {\n store.pauseTimers();\n }\n const target = getTarget(event.nativeEvent);\n const isInteractiveElement = target ? target.closest(`button,a,input,textarea,[role=\"button\"],${TOAST_SWIPE_IGNORE_SELECTOR}`) : false;\n if (isInteractiveElement) {\n return;\n }\n cancelledSwipeRef.current = false;\n intendedSwipeDirectionRef.current = undefined;\n maxSwipeDisplacementRef.current = 0;\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n swipeCancelBaselineRef.current = dragStartPosRef.current;\n if (rootRef.current) {\n const transform = getElementTransform(rootRef.current);\n initialTransformRef.current = transform;\n setInitialTransform(transform);\n setDragOffset({\n x: transform.x,\n y: transform.y\n });\n }\n store.setHovering(true);\n setIsSwiping(true);\n setIsRealSwipe(false);\n setLockedDirection(null);\n isFirstPointerMoveRef.current = true;\n rootRef.current?.setPointerCapture(event.pointerId);\n }\n function handlePointerMove(event) {\n if (!isSwiping) {\n return;\n }\n\n // Prevent text selection on Safari\n event.preventDefault();\n if (isFirstPointerMoveRef.current) {\n // Adjust the starting position to the current position on the first move\n // to account for the delay between pointerdown and the first pointermove on iOS.\n dragStartPosRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n isFirstPointerMoveRef.current = false;\n }\n const {\n clientY,\n clientX,\n movementX,\n movementY\n } = event;\n if (movementY < 0 && clientY > swipeCancelBaselineRef.current.y || movementY > 0 && clientY < swipeCancelBaselineRef.current.y) {\n swipeCancelBaselineRef.current = {\n x: swipeCancelBaselineRef.current.x,\n y: clientY\n };\n }\n if (movementX < 0 && clientX > swipeCancelBaselineRef.current.x || movementX > 0 && clientX < swipeCancelBaselineRef.current.x) {\n swipeCancelBaselineRef.current = {\n x: clientX,\n y: swipeCancelBaselineRef.current.y\n };\n }\n const deltaX = clientX - dragStartPosRef.current.x;\n const deltaY = clientY - dragStartPosRef.current.y;\n const cancelDeltaY = clientY - swipeCancelBaselineRef.current.y;\n const cancelDeltaX = clientX - swipeCancelBaselineRef.current.x;\n if (!isRealSwipe) {\n const movementDistance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (movementDistance >= MIN_DRAG_THRESHOLD) {\n setIsRealSwipe(true);\n if (lockedDirection === null) {\n const hasHorizontal = swipeDirections.includes('left') || swipeDirections.includes('right');\n const hasVertical = swipeDirections.includes('up') || swipeDirections.includes('down');\n if (hasHorizontal && hasVertical) {\n const absX = Math.abs(deltaX);\n const absY = Math.abs(deltaY);\n setLockedDirection(absX > absY ? 'horizontal' : 'vertical');\n }\n }\n }\n }\n let candidate;\n if (!intendedSwipeDirectionRef.current) {\n if (lockedDirection === 'vertical') {\n if (deltaY > 0) {\n candidate = 'down';\n } else if (deltaY < 0) {\n candidate = 'up';\n }\n } else if (lockedDirection === 'horizontal') {\n if (deltaX > 0) {\n candidate = 'right';\n } else if (deltaX < 0) {\n candidate = 'left';\n }\n } else if (Math.abs(deltaX) >= Math.abs(deltaY)) {\n candidate = deltaX > 0 ? 'right' : 'left';\n } else {\n candidate = deltaY > 0 ? 'down' : 'up';\n }\n if (candidate && swipeDirections.includes(candidate)) {\n intendedSwipeDirectionRef.current = candidate;\n maxSwipeDisplacementRef.current = getDisplacement(candidate, deltaX, deltaY);\n setCurrentSwipeDirection(candidate);\n }\n } else {\n const direction = intendedSwipeDirectionRef.current;\n const currentDisplacement = getDisplacement(direction, cancelDeltaX, cancelDeltaY);\n if (currentDisplacement > SWIPE_THRESHOLD) {\n cancelledSwipeRef.current = false;\n setCurrentSwipeDirection(direction);\n } else if (!(swipeDirections.includes('left') && swipeDirections.includes('right')) && !(swipeDirections.includes('up') && swipeDirections.includes('down')) && maxSwipeDisplacementRef.current - currentDisplacement >= REVERSE_CANCEL_THRESHOLD) {\n // Mark that a change-of-mind has occurred\n cancelledSwipeRef.current = true;\n }\n }\n const dampedDelta = applyDirectionalDamping(deltaX, deltaY);\n let newOffsetX = initialTransformRef.current.x;\n let newOffsetY = initialTransformRef.current.y;\n if (lockedDirection === 'horizontal') {\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n newOffsetX += dampedDelta.x;\n }\n } else if (lockedDirection === 'vertical') {\n if (swipeDirections.includes('up') || swipeDirections.includes('down')) {\n newOffsetY += dampedDelta.y;\n }\n } else {\n if (swipeDirections.includes('left') || swipeDirections.includes('right')) {\n newOffsetX += dampedDelta.x;\n }\n if (swipeDirections.includes('up') || swipeDirections.includes('down')) {\n newOffsetY += dampedDelta.y;\n }\n }\n setDragOffset({\n x: newOffsetX,\n y: newOffsetY\n });\n }\n function handlePointerUp(event) {\n if (!isSwiping) {\n return;\n }\n setIsSwiping(false);\n setIsRealSwipe(false);\n setLockedDirection(null);\n rootRef.current?.releasePointerCapture(event.pointerId);\n if (cancelledSwipeRef.current) {\n setDragOffset({\n x: initialTransform.x,\n y: initialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n return;\n }\n let shouldClose = false;\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n let dismissDirection;\n for (const direction of swipeDirections) {\n switch (direction) {\n case 'right':\n if (deltaX > SWIPE_THRESHOLD) {\n shouldClose = true;\n dismissDirection = 'right';\n }\n break;\n case 'left':\n if (deltaX < -SWIPE_THRESHOLD) {\n shouldClose = true;\n dismissDirection = 'left';\n }\n break;\n case 'down':\n if (deltaY > SWIPE_THRESHOLD) {\n shouldClose = true;\n dismissDirection = 'down';\n }\n break;\n case 'up':\n if (deltaY < -SWIPE_THRESHOLD) {\n shouldClose = true;\n dismissDirection = 'up';\n }\n break;\n default:\n break;\n }\n if (shouldClose) {\n break;\n }\n }\n if (shouldClose) {\n setCurrentSwipeDirection(dismissDirection);\n setDragDismissed(true);\n store.closeToast(toast.id);\n } else {\n setDragOffset({\n x: initialTransform.x,\n y: initialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n }\n }\n function handlePointerCancel() {\n if (!isSwiping) {\n return;\n }\n setIsSwiping(false);\n setIsRealSwipe(false);\n setLockedDirection(null);\n setDragOffset({\n x: initialTransform.x,\n y: initialTransform.y\n });\n setCurrentSwipeDirection(undefined);\n }\n function handleKeyDown(event) {\n if (event.key === 'Escape') {\n if (!rootRef.current || !contains(rootRef.current, activeElement(ownerDocument(rootRef.current)))) {\n return;\n }\n store.closeToast(toast.id);\n }\n }\n React.useEffect(() => {\n if (!swipeEnabled) {\n return undefined;\n }\n const element = rootRef.current;\n if (!element) {\n return undefined;\n }\n function preventDefaultTouchStart(event) {\n if (contains(element, getTarget(event))) {\n event.preventDefault();\n }\n }\n return addEventListener(element, 'touchmove', preventDefaultTouchStart, {\n passive: false\n });\n }, [swipeEnabled]);\n function getDragStyles() {\n if (!isSwiping && dragOffset.x === initialTransform.x && dragOffset.y === initialTransform.y && !dragDismissed) {\n return {\n [ToastRootCssVars.swipeMovementX]: '0px',\n [ToastRootCssVars.swipeMovementY]: '0px'\n };\n }\n const deltaX = dragOffset.x - initialTransform.x;\n const deltaY = dragOffset.y - initialTransform.y;\n return {\n transition: isSwiping ? 'none' : undefined,\n // While swiping, freeze the element at its current visual transform so it doesn't snap to the\n // end position.\n transform: isSwiping ? `translateX(${dragOffset.x}px) translateY(${dragOffset.y}px) scale(${initialTransform.scale})` : undefined,\n [ToastRootCssVars.swipeMovementX]: `${deltaX}px`,\n [ToastRootCssVars.swipeMovementY]: `${deltaY}px`\n };\n }\n const isHighPriority = toast.priority === 'high';\n const defaultProps = {\n role: isHighPriority ? 'alertdialog' : 'dialog',\n tabIndex: 0,\n 'aria-modal': false,\n 'aria-labelledby': titleId,\n 'aria-describedby': descriptionId,\n 'aria-hidden': isHighPriority && !focused ? true : undefined,\n onPointerDown: swipeEnabled ? handlePointerDown : undefined,\n onPointerMove: swipeEnabled ? handlePointerMove : undefined,\n onPointerUp: swipeEnabled ? handlePointerUp : undefined,\n onPointerCancel: swipeEnabled ? handlePointerCancel : undefined,\n onKeyDown: handleKeyDown,\n inert: inertValue(toast.limited),\n style: {\n ...getDragStyles(),\n [ToastRootCssVars.index]: toast.transitionStatus === 'ending' ? domIndex : visibleIndex,\n [ToastRootCssVars.offsetY]: `${offsetY}px`,\n [ToastRootCssVars.height]: toast.height ? `${toast.height}px` : undefined\n }\n };\n const toastRoot = React.useMemo(() => ({\n rootRef,\n toast,\n titleId,\n setTitleId,\n descriptionId,\n setDescriptionId,\n swiping: isSwiping,\n swipeDirection: currentSwipeDirection,\n recalculateHeight,\n index: domIndex,\n visibleIndex,\n expanded\n }), [toast, titleId, descriptionId, isSwiping, currentSwipeDirection, recalculateHeight, domIndex, visibleIndex, expanded]);\n const state = {\n transitionStatus: toast.transitionStatus,\n expanded,\n limited: toast.limited || false,\n type: toast.type,\n swiping: toastRoot.swiping,\n swipeDirection: toastRoot.swipeDirection\n };\n const element = useRenderElement('div', componentProps, {\n ref: [forwardedRef, toastRoot.rootRef],\n state,\n stateAttributesMapping,\n props: [defaultProps, elementProps]\n });\n return /*#__PURE__*/_jsx(ToastRootContext.Provider, {\n value: toastRoot,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") ToastRoot.displayName = \"ToastRoot\";","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useToastRootContext } from \"../root/ToastRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * A description that describes the toast.\n * Can be used as the default message for the toast when no title is provided.\n * Renders a `<p>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastDescription = /*#__PURE__*/React.forwardRef(function ToastDescription(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n toast,\n setDescriptionId\n } = useToastRootContext();\n const children = childrenProp ?? toast.description;\n const shouldRender = Boolean(children);\n const id = useId(idProp);\n useIsoLayoutEffect(() => {\n if (!shouldRender) {\n return undefined;\n }\n setDescriptionId(id);\n return () => {\n setDescriptionId(undefined);\n };\n }, [shouldRender, id, setDescriptionId]);\n const state = {\n type: toast.type\n };\n const element = useRenderElement('p', componentProps, {\n ref: forwardedRef,\n state,\n props: {\n ...elementProps,\n id,\n children\n }\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ToastDescription.displayName = \"ToastDescription\";","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useId } from '@base-ui/utils/useId';\nimport { useToastRootContext } from \"../root/ToastRootContext.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * A title that labels the toast.\n * Renders an `<h2>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastTitle = /*#__PURE__*/React.forwardRef(function ToastTitle(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n id: idProp,\n children: childrenProp,\n ...elementProps\n } = componentProps;\n const {\n toast,\n setTitleId\n } = useToastRootContext();\n const children = childrenProp ?? toast.title;\n const shouldRender = Boolean(children);\n const id = useId(idProp);\n useIsoLayoutEffect(() => {\n if (!shouldRender) {\n return undefined;\n }\n setTitleId(id);\n return () => {\n setTitleId(undefined);\n };\n }, [shouldRender, id, setTitleId]);\n const state = {\n type: toast.type\n };\n const element = useRenderElement('h2', componentProps, {\n ref: forwardedRef,\n state,\n props: {\n ...elementProps,\n id,\n children\n }\n });\n if (!shouldRender) {\n return null;\n }\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ToastTitle.displayName = \"ToastTitle\";","'use client';\n\nimport * as React from 'react';\nimport { useToastRootContext } from \"../root/ToastRootContext.js\";\nimport { useToastProviderContext } from \"../provider/ToastProviderContext.js\";\nimport { useButton } from \"../../use-button/useButton.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\n\n/**\n * Closes the toast when clicked.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)\n */\nexport const ToastClose = /*#__PURE__*/React.forwardRef(function ToastClose(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n disabled,\n nativeButton = true,\n ...elementProps\n } = componentProps;\n const store = useToastProviderContext();\n const {\n toast\n } = useToastRootContext();\n const expanded = store.useState('expanded');\n const [hasFocus, setHasFocus] = React.useState(false);\n const {\n getButtonProps,\n buttonRef\n } = useButton({\n disabled,\n native: nativeButton\n });\n const state = {\n type: toast.type\n };\n const element = useRenderElement('button', componentProps, {\n ref: [forwardedRef, buttonRef],\n state,\n props: [{\n 'aria-hidden': !expanded && !hasFocus,\n onClick() {\n store.closeToast(toast.id);\n },\n onFocus() {\n setHasFocus(true);\n },\n onBlur() {\n setHasFocus(false);\n }\n }, elementProps, getButtonProps]\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") ToastClose.displayName = \"ToastClose\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { ToastContext } from \"./provider/ToastProviderContext.js\";\n/**\n * Returns the array of toasts and methods to manage them.\n */\nexport function useToastManager() {\n const store = React.useContext(ToastContext);\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: useToastManager must be used within <Toast.Provider>.' : _formatErrorMessage(73));\n }\n const toasts = store.useState('toasts');\n return React.useMemo(() => ({\n toasts,\n add: store.addToast,\n close: store.closeToast,\n update: store.updateToast,\n promise: store.promiseToast\n }), [toasts, store]);\n}","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipRootContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipRootContext.displayName = \"TooltipRootContext\";\nexport function useTooltipRootContext(optional) {\n const context = React.useContext(TooltipRootContext);\n if (context === undefined && !optional) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.' : _formatErrorMessage(72));\n }\n return context;\n}","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSelector, ReactStore } from '@base-ui/utils/store';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/index.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\nimport { createInitialPopupStoreState, popupStoreSelectors, PopupTriggerMap } from \"../../utils/popups/index.js\";\nconst selectors = {\n ...popupStoreSelectors,\n disabled: createSelector(state => state.disabled),\n instantType: createSelector(state => state.instantType),\n isInstantPhase: createSelector(state => state.isInstantPhase),\n trackCursorAxis: createSelector(state => state.trackCursorAxis),\n disableHoverablePopup: createSelector(state => state.disableHoverablePopup),\n lastOpenChangeReason: createSelector(state => state.openChangeReason),\n closeOnClick: createSelector(state => state.closeOnClick),\n closeDelay: createSelector(state => state.closeDelay),\n hasViewport: createSelector(state => state.hasViewport)\n};\nexport class TooltipStore extends ReactStore {\n constructor(initialState) {\n super({\n ...createInitialState(),\n ...initialState\n }, {\n popupRef: /*#__PURE__*/React.createRef(),\n onOpenChange: undefined,\n onOpenChangeComplete: undefined,\n triggerElements: new PopupTriggerMap()\n }, selectors);\n }\n setOpen = (nextOpen, eventDetails) => {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n eventDetails.preventUnmountOnClose = () => {\n this.set('preventUnmountingOnClose', true);\n };\n this.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const updatedState = {\n open: nextOpen,\n openChangeReason: reason\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (reason === REASONS.triggerHover) {\n updatedState.instantType = undefined;\n }\n\n // If a popup is closing, the `trigger` may be null.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n const newTriggerId = eventDetails.trigger?.id ?? null;\n if (newTriggerId || nextOpen) {\n updatedState.activeTriggerId = newTriggerId;\n updatedState.activeTriggerElement = eventDetails.trigger ?? null;\n }\n this.update(updatedState);\n };\n if (isHover) {\n // If a hover reason is provided, we need to flush the state synchronously. This ensures\n // `node.getAnimations()` knows about the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n };\n static useStore(externalStore, initialState) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const internalStore = useRefWithInit(() => {\n return new TooltipStore(initialState);\n }).current;\n const store = externalStore ?? internalStore;\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const floatingRootContext = useSyncedFloatingRootContext({\n popupStore: store,\n onOpenChange: store.setOpen\n });\n\n // It's safe to set this here because when this code runs for the first time,\n // nothing has had a chance to subscribe to the `store` yet.\n // For subsequent renders, the `floatingRootContext` reference remains the same,\n // so it's basically a no-op.\n store.state.floatingRootContext = floatingRootContext;\n return store;\n }\n}\nfunction createInitialState() {\n return {\n ...createInitialPopupStoreState(),\n disabled: false,\n instantType: undefined,\n isInstantPhase: false,\n trackCursorAxis: 'none',\n disableHoverablePopup: false,\n openChangeReason: null,\n closeOnClick: true,\n closeDelay: 0,\n hasViewport: false\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { fastComponent } from '@base-ui/utils/fastHooks';\nimport { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { TooltipRootContext } from \"./TooltipRootContext.js\";\nimport { useClientPoint, useDismiss, useInteractions } from \"../../floating-ui-react/index.js\";\nimport { createChangeEventDetails } from \"../../utils/createBaseUIEventDetails.js\";\nimport { useImplicitActiveTrigger, useOpenStateTransitions } from \"../../utils/popups/index.js\";\nimport { TooltipStore } from \"../store/TooltipStore.js\";\nimport { REASONS } from \"../../utils/reasons.js\";\n\n/**\n * Groups all parts of the tooltip.\n * Doesn't render its own HTML element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TooltipRoot = fastComponent(function TooltipRoot(props) {\n const {\n disabled = false,\n defaultOpen = false,\n open: openProp,\n disableHoverablePopup = false,\n trackCursorAxis = 'none',\n actionsRef,\n onOpenChange,\n onOpenChangeComplete,\n handle,\n triggerId: triggerIdProp,\n defaultTriggerId: defaultTriggerIdProp = null,\n children\n } = props;\n const store = TooltipStore.useStore(handle?.store, {\n open: defaultOpen,\n openProp,\n activeTriggerId: defaultTriggerIdProp,\n triggerIdProp\n });\n\n // Support initially open state when uncontrolled\n useOnFirstRender(() => {\n if (openProp === undefined && store.state.open === false && defaultOpen === true) {\n store.update({\n open: true,\n activeTriggerId: defaultTriggerIdProp\n });\n }\n });\n store.useControlledProp('openProp', openProp);\n store.useControlledProp('triggerIdProp', triggerIdProp);\n store.useContextCallback('onOpenChange', onOpenChange);\n store.useContextCallback('onOpenChangeComplete', onOpenChangeComplete);\n const openState = store.useState('open');\n const open = !disabled && openState;\n const activeTriggerId = store.useState('activeTriggerId');\n const payload = store.useState('payload');\n store.useSyncedValues({\n trackCursorAxis,\n disableHoverablePopup\n });\n useIsoLayoutEffect(() => {\n if (openState && disabled) {\n store.setOpen(false, createChangeEventDetails(REASONS.disabled));\n }\n }, [openState, disabled, store]);\n store.useSyncedValue('disabled', disabled);\n useImplicitActiveTrigger(store);\n const {\n forceUnmount,\n transitionStatus\n } = useOpenStateTransitions(open, store);\n const floatingRootContext = store.select('floatingRootContext');\n const isInstantPhase = store.useState('isInstantPhase');\n const instantType = store.useState('instantType');\n const lastOpenChangeReason = store.useState('lastOpenChangeReason');\n\n // Animations should be instant in two cases:\n // 1) Opening during the provider's instant phase (adjacent tooltip opens instantly)\n // 2) Closing because another tooltip opened (reason === 'none')\n // Otherwise, allow the animation to play. In particular, do not disable animations\n // during the 'ending' phase unless it's due to a sibling opening.\n const previousInstantTypeRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n if (transitionStatus === 'ending' && lastOpenChangeReason === REASONS.none || transitionStatus !== 'ending' && isInstantPhase) {\n // Capture the current instant type so we can restore it later\n // and set to 'delay' to disable animations while moving from one trigger to another\n // within a delay group.\n if (instantType !== 'delay') {\n previousInstantTypeRef.current = instantType;\n }\n store.set('instantType', 'delay');\n } else if (previousInstantTypeRef.current !== null) {\n store.set('instantType', previousInstantTypeRef.current);\n previousInstantTypeRef.current = null;\n }\n }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]);\n useIsoLayoutEffect(() => {\n if (open) {\n if (activeTriggerId == null) {\n store.set('payload', undefined);\n }\n }\n }, [store, activeTriggerId, open]);\n const handleImperativeClose = React.useCallback(() => {\n store.setOpen(false, createTooltipEventDetails(store, REASONS.imperativeAction));\n }, [store]);\n React.useImperativeHandle(actionsRef, () => ({\n unmount: forceUnmount,\n close: handleImperativeClose\n }), [forceUnmount, handleImperativeClose]);\n const dismiss = useDismiss(floatingRootContext, {\n enabled: !disabled,\n referencePress: () => store.select('closeOnClick')\n });\n const clientPoint = useClientPoint(floatingRootContext, {\n enabled: !disabled && trackCursorAxis !== 'none',\n axis: trackCursorAxis === 'none' ? undefined : trackCursorAxis\n });\n const {\n getReferenceProps,\n getFloatingProps,\n getTriggerProps\n } = useInteractions([dismiss, clientPoint]);\n const activeTriggerProps = React.useMemo(() => getReferenceProps(), [getReferenceProps]);\n const inactiveTriggerProps = React.useMemo(() => getTriggerProps(), [getTriggerProps]);\n const popupProps = React.useMemo(() => getFloatingProps(), [getFloatingProps]);\n store.useSyncedValues({\n activeTriggerProps,\n inactiveTriggerProps,\n popupProps\n });\n return /*#__PURE__*/_jsx(TooltipRootContext.Provider, {\n value: store,\n children: typeof children === 'function' ? children({\n payload\n }) : children\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipRoot.displayName = \"TooltipRoot\";\nfunction createTooltipEventDetails(store, reason) {\n const details = createChangeEventDetails(reason);\n details.preventUnmountOnClose = () => {\n store.set('preventUnmountingOnClose', true);\n };\n return details;\n}","'use client';\n\nimport * as React from 'react';\nexport const TooltipProviderContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipProviderContext.displayName = \"TooltipProviderContext\";\nexport function useTooltipProviderContext() {\n return React.useContext(TooltipProviderContext);\n}","import { CommonTriggerDataAttributes } from \"../../utils/popupStateMapping.js\";\nexport let TooltipTriggerDataAttributes = function (TooltipTriggerDataAttributes) {\n /**\n * Present when the corresponding tooltip is open.\n */\n TooltipTriggerDataAttributes[TooltipTriggerDataAttributes[\"popupOpen\"] = CommonTriggerDataAttributes.popupOpen] = \"popupOpen\";\n /**\n * Present when the trigger is disabled, either by the `disabled` prop or by a parent `<Tooltip.Root>` component.\n */\n TooltipTriggerDataAttributes[\"triggerDisabled\"] = \"data-trigger-disabled\";\n return TooltipTriggerDataAttributes;\n}({});","export const OPEN_DELAY = 600;","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nimport { fastComponentRef } from '@base-ui/utils/fastHooks';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.js\";\nimport { triggerOpenStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useTriggerDataForwarding } from \"../../utils/popups/index.js\";\nimport { useBaseUiId } from \"../../utils/useBaseUiId.js\";\nimport { useTooltipProviderContext } from \"../provider/TooltipProviderContext.js\";\nimport { safePolygon, useDelayGroup, useFocus, useHoverReferenceInteraction } from \"../../floating-ui-react/index.js\";\nimport { TooltipTriggerDataAttributes } from \"./TooltipTriggerDataAttributes.js\";\nimport { OPEN_DELAY } from \"../utils/constants.js\";\n\n/**\n * An element to attach the tooltip to.\n * Renders a `<button>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipTrigger = fastComponentRef(function TooltipTrigger(componentProps, forwardedRef) {\n const {\n className,\n render,\n handle,\n payload,\n disabled: disabledProp,\n delay,\n closeOnClick = true,\n closeDelay,\n id: idProp,\n style,\n ...elementProps\n } = componentProps;\n const rootContext = useTooltipRootContext(true);\n const store = handle?.store ?? rootContext;\n if (!store) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.' : _formatErrorMessage(82));\n }\n const thisTriggerId = useBaseUiId(idProp);\n const isTriggerActive = store.useState('isTriggerActive', thisTriggerId);\n const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);\n const floatingRootContext = store.useState('floatingRootContext');\n const triggerElementRef = React.useRef(null);\n const delayWithDefault = delay ?? OPEN_DELAY;\n const closeDelayWithDefault = closeDelay ?? 0;\n const {\n registerTrigger,\n isMountedByThisTrigger\n } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {\n payload,\n closeOnClick,\n closeDelay: closeDelayWithDefault\n });\n const providerContext = useTooltipProviderContext();\n const {\n delayRef,\n isInstantPhase,\n hasProvider\n } = useDelayGroup(floatingRootContext, {\n open: isOpenedByThisTrigger\n });\n store.useSyncedValue('isInstantPhase', isInstantPhase);\n const rootDisabled = store.useState('disabled');\n const disabled = disabledProp ?? rootDisabled;\n const trackCursorAxis = store.useState('trackCursorAxis');\n const disableHoverablePopup = store.useState('disableHoverablePopup');\n const hoverProps = useHoverReferenceInteraction(floatingRootContext, {\n enabled: !disabled,\n mouseOnly: true,\n move: false,\n handleClose: !disableHoverablePopup && trackCursorAxis !== 'both' ? safePolygon() : null,\n restMs() {\n const providerDelay = providerContext?.delay;\n const groupOpenValue = typeof delayRef.current === 'object' ? delayRef.current.open : undefined;\n let computedRestMs = delayWithDefault;\n if (hasProvider) {\n if (groupOpenValue !== 0) {\n computedRestMs = delay ?? providerDelay ?? delayWithDefault;\n } else {\n computedRestMs = 0;\n }\n }\n return computedRestMs;\n },\n delay() {\n const closeValue = typeof delayRef.current === 'object' ? delayRef.current.close : undefined;\n let computedCloseDelay = closeDelayWithDefault;\n if (closeDelay == null && hasProvider) {\n computedCloseDelay = closeValue;\n }\n return {\n close: computedCloseDelay\n };\n },\n triggerElementRef,\n isActiveTrigger: isTriggerActive,\n isClosing: () => store.select('transitionStatus') === 'ending'\n });\n const focusProps = useFocus(floatingRootContext, {\n enabled: !disabled\n }).reference;\n const state = {\n open: isOpenedByThisTrigger\n };\n const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);\n const element = useRenderElement('button', componentProps, {\n state,\n ref: [forwardedRef, registerTrigger, triggerElementRef],\n props: [hoverProps, focusProps, rootTriggerProps, {\n onPointerDown() {\n store.set('closeOnClick', closeOnClick);\n },\n id: thisTriggerId,\n [TooltipTriggerDataAttributes.triggerDisabled]: disabled ? '' : undefined\n }, elementProps],\n stateAttributesMapping: triggerOpenStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipTrigger.displayName = \"TooltipTrigger\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipPortalContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipPortalContext.displayName = \"TooltipPortalContext\";\nexport function useTooltipPortalContext() {\n const value = React.useContext(TooltipPortalContext);\n if (value === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: <Tooltip.Portal> is missing.' : _formatErrorMessage(70));\n }\n return value;\n}","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.js\";\nimport { TooltipPortalContext } from \"./TooltipPortalContext.js\";\nimport { FloatingPortalLite } from \"../../utils/FloatingPortalLite.js\";\n\n/**\n * A portal element that moves the popup to a different part of the DOM.\n * By default, the portal element is appended to `<body>`.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TooltipPortal = /*#__PURE__*/React.forwardRef(function TooltipPortal(props, forwardedRef) {\n const {\n keepMounted = false,\n ...portalProps\n } = props;\n const store = useTooltipRootContext();\n const mounted = store.useState('mounted');\n const shouldRender = mounted || keepMounted;\n if (!shouldRender) {\n return null;\n }\n return /*#__PURE__*/_jsx(TooltipPortalContext.Provider, {\n value: keepMounted,\n children: /*#__PURE__*/_jsx(FloatingPortalLite, {\n ref: forwardedRef,\n ...portalProps\n })\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPortal.displayName = \"TooltipPortal\";","'use client';\n\nimport _formatErrorMessage from \"@base-ui/utils/formatErrorMessage\";\nimport * as React from 'react';\nexport const TooltipPositionerContext = /*#__PURE__*/React.createContext(undefined);\nif (process.env.NODE_ENV !== \"production\") TooltipPositionerContext.displayName = \"TooltipPositionerContext\";\nexport function useTooltipPositionerContext() {\n const context = React.useContext(TooltipPositionerContext);\n if (context === undefined) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? 'Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.' : _formatErrorMessage(71));\n }\n return context;\n}","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.js\";\nimport { TooltipPositionerContext } from \"./TooltipPositionerContext.js\";\nimport { useAnchorPositioning } from \"../../utils/useAnchorPositioning.js\";\nimport { useTooltipPortalContext } from \"../portal/TooltipPortalContext.js\";\nimport { POPUP_COLLISION_AVOIDANCE } from \"../../utils/constants.js\";\nimport { adaptiveOrigin } from \"../../utils/adaptiveOriginMiddleware.js\";\nimport { usePositioner } from \"../../utils/usePositioner.js\";\n\n/**\n * Positions the tooltip against the trigger.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const TooltipPositioner = /*#__PURE__*/React.forwardRef(function TooltipPositioner(componentProps, forwardedRef) {\n const {\n render,\n className,\n anchor,\n positionMethod = 'absolute',\n side = 'top',\n align = 'center',\n sideOffset = 0,\n alignOffset = 0,\n collisionBoundary = 'clipping-ancestors',\n collisionPadding = 5,\n arrowPadding = 5,\n sticky = false,\n disableAnchorTracking = false,\n collisionAvoidance = POPUP_COLLISION_AVOIDANCE,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const keepMounted = useTooltipPortalContext();\n const open = store.useState('open');\n const mounted = store.useState('mounted');\n const trackCursorAxis = store.useState('trackCursorAxis');\n const disableHoverablePopup = store.useState('disableHoverablePopup');\n const floatingRootContext = store.useState('floatingRootContext');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const hasViewport = store.useState('hasViewport');\n const positioning = useAnchorPositioning({\n anchor,\n positionMethod,\n floatingRootContext,\n mounted,\n side,\n sideOffset,\n align,\n alignOffset,\n collisionBoundary,\n collisionPadding,\n sticky,\n arrowPadding,\n disableAnchorTracking,\n keepMounted,\n collisionAvoidance,\n adaptiveOrigin: hasViewport ? adaptiveOrigin : undefined\n });\n const state = React.useMemo(() => ({\n open,\n side: positioning.side,\n align: positioning.align,\n anchorHidden: positioning.anchorHidden,\n instant: trackCursorAxis !== 'none' ? 'tracking-cursor' : instantType\n }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);\n const element = usePositioner(componentProps, state, {\n styles: positioning.positionerStyles,\n transitionStatus,\n props: elementProps,\n refs: [forwardedRef, store.useStateSetter('positionerElement')],\n hidden: !mounted,\n inert: !open || trackCursorAxis === 'both' || disableHoverablePopup\n });\n return /*#__PURE__*/_jsx(TooltipPositionerContext.Provider, {\n value: positioning,\n children: element\n });\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPositioner.displayName = \"TooltipPositioner\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.js\";\nimport { useTooltipPositionerContext } from \"../positioner/TooltipPositionerContext.js\";\nimport { popupStateMapping as baseMapping } from \"../../utils/popupStateMapping.js\";\nimport { transitionStatusMapping } from \"../../utils/stateAttributesMapping.js\";\nimport { useOpenChangeComplete } from \"../../utils/useOpenChangeComplete.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { getDisabledMountTransitionStyles } from \"../../utils/getDisabledMountTransitionStyles.js\";\nimport { useHoverFloatingInteraction } from \"../../floating-ui-react/index.js\";\nconst stateAttributesMapping = {\n ...baseMapping,\n ...transitionStatusMapping\n};\n\n/**\n * A container for the tooltip contents.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipPopup = /*#__PURE__*/React.forwardRef(function TooltipPopup(componentProps, forwardedRef) {\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const {\n side,\n align\n } = useTooltipPositionerContext();\n const open = store.useState('open');\n const instantType = store.useState('instantType');\n const transitionStatus = store.useState('transitionStatus');\n const popupProps = store.useState('popupProps');\n const floatingContext = store.useState('floatingRootContext');\n useOpenChangeComplete({\n open,\n ref: store.context.popupRef,\n onComplete() {\n if (open) {\n store.context.onOpenChangeComplete?.(true);\n }\n }\n });\n const disabled = store.useState('disabled');\n const closeDelay = store.useState('closeDelay');\n useHoverFloatingInteraction(floatingContext, {\n enabled: !disabled,\n closeDelay\n });\n const state = {\n open,\n side,\n align,\n instant: instantType,\n transitionStatus\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, store.context.popupRef, store.useStateSetter('popupElement')],\n props: [popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],\n stateAttributesMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipPopup.displayName = \"TooltipPopup\";","'use client';\n\nimport * as React from 'react';\nimport { useTooltipPositionerContext } from \"../positioner/TooltipPositionerContext.js\";\nimport { popupStateMapping } from \"../../utils/popupStateMapping.js\";\nimport { useRenderElement } from \"../../utils/useRenderElement.js\";\nimport { useTooltipRootContext } from \"../root/TooltipRootContext.js\";\n\n/**\n * Displays an element positioned against the tooltip anchor.\n * Renders a `<div>` element.\n *\n * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)\n */\nexport const TooltipArrow = /*#__PURE__*/React.forwardRef(function TooltipArrow(componentProps, forwardedRef) {\n const {\n className,\n render,\n style,\n ...elementProps\n } = componentProps;\n const store = useTooltipRootContext();\n const open = store.useState('open');\n const instantType = store.useState('instantType');\n const {\n arrowRef,\n side,\n align,\n arrowUncentered,\n arrowStyles\n } = useTooltipPositionerContext();\n const state = {\n open,\n side,\n align,\n uncentered: arrowUncentered,\n instant: instantType\n };\n const element = useRenderElement('div', componentProps, {\n state,\n ref: [forwardedRef, arrowRef],\n props: [{\n style: arrowStyles,\n 'aria-hidden': true\n }, elementProps],\n stateAttributesMapping: popupStateMapping\n });\n return element;\n});\nif (process.env.NODE_ENV !== \"production\") TooltipArrow.displayName = \"TooltipArrow\";","import clsx from 'clsx'\nimport { Button as BaseButton } from '@base-ui/react'\nimport type { ButtonProps as BaseButtonProps } from '@base-ui/react'\nimport React from 'react'\n\n// Slack Button Variants\ntype ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost';\ntype ButtonSize = 'sm' | 'md' | 'lg';\n\nexport interface ButtonProps extends BaseButtonProps {\n variant?: ButtonVariant;\n size?: ButtonSize;\n fullWidth?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant = 'secondary', size = 'md', fullWidth, children, ...props }, ref) => {\n\n // Base styles tailored to match Slack\n const baseStyles = 'inline-flex items-center justify-center font-bold transition-all outline-none focus-visible:ring-2 focus-visible:ring-(--focus-ring) focus-visible:ring-offset-2 focus-visible:ring-offset-(--bg-primary) disabled:opacity-50 disabled:cursor-not-allowed select-none'\n\n const variants = {\n primary: 'bg-(--accent-action) text-(--accent-contrast) hover:bg-(--accent-action-hover) border border-transparent shadow-sm active:scale-[0.98]',\n secondary: 'bg-(--bg-secondary) text-(--text-primary) border border-(--border-active) hover:bg-(--bg-hover) hover:shadow-sm active:bg-(--bg-secondary)',\n danger: 'bg-(--danger) text-(--accent-contrast) hover:bg-(--danger-hover) border border-transparent shadow-sm',\n ghost: 'bg-transparent text-(--text-secondary) hover:bg-(--bg-hover) hover:text-(--text-primary)',\n }\n\n const sizes = {\n sm: 'h-7 px-3 text-[13px] rounded',\n md: 'h-9 px-4 text-[15px] rounded-md',\n lg: 'h-11 px-6 text-[18px] rounded-lg',\n }\n\n return (\n <BaseButton\n ref={ref}\n className={clsx(\n baseStyles,\n variants[variant],\n sizes[size],\n fullWidth && 'w-full',\n className,\n )}\n {...props}\n >\n {children}\n </BaseButton>\n )\n },\n)\n\nButton.displayName = 'Button'\n","import clsx from 'clsx'\nimport React from 'react'\n\nexport type AvatarStatus = 'online' | 'away' | 'dnd' | 'offline';\nexport type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nexport interface AvatarProps extends React.ComponentPropsWithoutRef<'div'> {\n src?: string;\n alt?: string;\n fallback?: string;\n size?: AvatarSize;\n status?: AvatarStatus;\n rounded?: boolean; // Slack uses rounded squares mostly\n}\n\nexport const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(\n ({ className, src, alt, fallback, size = 'md', status, rounded = true, ...props }, ref) => {\n\n const sizeClasses = {\n xs: 'h-5 w-5 text-[10px]',\n sm: 'h-6 w-6 text-xs',\n md: 'h-9 w-9 text-sm',\n lg: 'h-12 w-12 text-base',\n xl: 'h-16 w-16 text-lg',\n }\n\n const statusColors = {\n online: 'bg-[#2bac76]',\n away: 'bg-[#eca33d]', // Hollow circle usually, but filled for simplicity or specific icon\n dnd: 'bg-[#e01e5a]',\n offline: 'bg-(--text-muted)',\n }\n\n // Slack uses rounded-md for avatars usually\n const radiusClass = rounded ? 'rounded-md' : 'rounded-full'\n\n return (\n <div\n ref={ref}\n className={clsx('relative inline-block', className)}\n {...props}\n >\n <div\n className={clsx(\n 'overflow-hidden bg-(--bg-secondary) flex items-center justify-center font-medium text-(--text-secondary) select-none',\n sizeClasses[size],\n radiusClass,\n )}\n >\n {src ? (\n <img src={src} alt={alt} className=\"h-full w-full object-cover\"/>\n ) : (\n <span>{fallback || (alt ? alt.charAt(0).toUpperCase() : '?')}</span>\n )}\n </div>\n\n {status && status !== 'offline' && (\n <span\n className={clsx(\n 'absolute -bottom-0.5 -right-0.5 block h-2 w-2 rounded-full ring-2 ring-(--bg-primary)',\n statusColors[status],\n )}\n />\n )}\n </div>\n )\n },\n)\n\nAvatar.displayName = 'Avatar'\n","import clsx from 'clsx'\nimport React from 'react'\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n count?: number;\n dot?: boolean;\n variant?: 'danger' | 'neutral'; // Red for mentions, Gray for unread\n}\n\nexport const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, count, dot, variant = 'danger', children, ...props }, ref) => {\n\n const variants = {\n danger: 'bg-(--danger) text-(--accent-contrast)',\n neutral: 'bg-(--badge-neutral) text-(--accent-contrast)',\n }\n\n if (dot) {\n return (\n <span\n ref={ref}\n className={clsx(\n 'inline-block h-2 w-2 rounded-full',\n variants[variant],\n className,\n )}\n {...props}\n />\n )\n }\n\n return (\n <span\n ref={ref}\n className={clsx(\n 'inline-flex items-center justify-center rounded-full px-2 py-0.5 text-[11px] font-bold min-w-5',\n variants[variant],\n className,\n )}\n {...props}\n >\n {count !== undefined ? count : children}\n </span>\n )\n },\n)\n\nBadge.displayName = 'Badge'\n","import clsx from 'clsx'\nimport { Input as BaseInput } from '@base-ui/react'\nimport React from 'react'\n\nexport interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n label?: string;\n error?: string;\n fullWidth?: boolean;\n}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, label, error, fullWidth, id, ...props }, ref) => {\n const generatedId = React.useId()\n const inputId = id ?? generatedId\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full')}>\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-[14px] font-semibold text-(--text-primary)\"\n >\n {label}\n </label>\n )}\n\n <div className=\"relative\">\n <BaseInput\n ref={ref}\n id={inputId}\n className={clsx(\n 'appearance-none block w-full rounded-md border text-[15px] leading-[1.4] shadow-sm',\n 'px-3 py-2 bg-(--bg-primary) text-(--text-primary) placeholder-(--text-muted)',\n 'transition-[border-color,box-shadow,background-color] focus:outline-none',\n 'focus:border-(--accent)/70',\n 'disabled:bg-(--bg-primary) disabled:text-(--text-muted) disabled:cursor-not-allowed',\n error\n ? 'border-(--danger) focus:border-(--danger) focus:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n className,\n )}\n {...props}\n />\n </div>\n\n {error && (\n <span className=\"text-[12px] font-medium text-(--danger) flex items-center gap-1 leading-tight\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nInput.displayName = 'Input'\n","import clsx from 'clsx'\nimport { Button as BaseButton } from '@base-ui/react'\nimport type { ButtonProps as BaseButtonProps } from '@base-ui/react'\nimport React from 'react'\n\nexport interface IconButtonProps extends BaseButtonProps {\n size?: 'sm' | 'md' | 'lg';\n variant?: 'ghost' | 'filled';\n active?: boolean;\n}\n\nexport const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(\n ({ className, size = 'md', variant = 'ghost', active, children, ...props }, ref) => {\n\n // Icon Button Styles (usually meant for tooltips or toolbar actions)\n const baseStyles = 'inline-flex items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-(--focus-ring) disabled:opacity-50'\n\n const variants = {\n ghost: 'bg-transparent text-(--text-secondary) hover:bg-(--bg-hover) hover:text-(--text-primary)',\n filled: 'bg-(--bg-secondary) text-(--text-primary) hover:bg-(--bg-hover)',\n }\n\n const activeStyles = active ? 'bg-(--bg-hover) text-(--accent)' : ''\n\n const sizes = {\n sm: 'h-7 w-7 p-1',\n md: 'h-9 w-9 p-1.5',\n lg: 'h-11 w-11 p-2',\n }\n\n return (\n <BaseButton\n ref={ref}\n className={clsx(\n baseStyles,\n variants[variant],\n sizes[size],\n activeStyles,\n className,\n )}\n {...props}\n >\n {children}\n </BaseButton>\n )\n },\n)\n\nIconButton.displayName = 'IconButton'\n","import { Tooltip as BaseTooltip } from '@base-ui/react'\n\nexport interface TooltipProps {\n content: React.ReactNode;\n children: React.ReactNode;\n side?: 'top' | 'right' | 'bottom' | 'left';\n align?: 'start' | 'center' | 'end';\n delay?: number;\n}\n\nexport const Tooltip: React.FC<TooltipProps> = ({\n content,\n children,\n side = 'top',\n align = 'center',\n delay = 200,\n}) => {\n return (\n <BaseTooltipProvider delayDuration={delay}>\n <BaseTooltip.Trigger className=\"cursor-default appearance-none border-none bg-transparent p-0\">\n {children}\n </BaseTooltip.Trigger>\n <BaseTooltip.Portal>\n <BaseTooltip.Positioner side={side} align={align} sideOffset={5}>\n <BaseTooltip.Popup\n className=\"z-50 px-3 py-1.5 text-xs font-medium text-white bg-black rounded shadow-sm animate-in fade-in zoom-in-95 duration-200\"\n >\n {content}\n <BaseTooltip.Arrow className=\"fill-black\"/>\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n </BaseTooltipProvider>\n )\n}\n\n// Note: Base UI Tooltip structure might differ slightly in latest versions.\n// Adjusting to a safer generic implementation if needed or specific exports.\n// Assuming Context/Provider structure or Trigger/Content.\n// Checking docs or types would be ideal, but standard Radix/Base UI patterns usually involve Root, Trigger, Portal, Content.\n// Let's try the standard pattern:\nfunction BaseTooltipProvider ({ children }: { children: React.ReactNode, delayDuration?: number }) {\n // Base UI might not have a Provider, usually just Root.\n // Using any to bypass TS check for now if Root props are strict, as versions vary.\n return <BaseTooltip.Root>{children}</BaseTooltip.Root>\n}\n","import React, { createContext, useCallback, useContext, useMemo, useState } from 'react'\nimport { Popover as BasePopover } from '@base-ui/react'\nimport clsx from 'clsx'\n\nexport interface PopoverProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n modal?: boolean\n}\n\nexport interface PopoverTriggerProps {\n children?: React.ReactNode\n className?: string\n render?: React.ReactElement\n}\n\nexport interface PopoverContentProps {\n children: React.ReactNode\n className?: string\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n sideOffset?: number\n alignOffset?: number\n}\n\nexport interface PopoverCloseProps {\n children?: React.ReactNode\n className?: string\n render?: React.ReactElement\n}\n\nexport const Popover: React.FC<PopoverProps> = ({\n children,\n open,\n defaultOpen,\n onOpenChange,\n modal = false,\n}) => {\n return (\n <BasePopover.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n modal={modal}\n >\n {children}\n </BasePopover.Root>\n )\n}\n\nexport const PopoverTrigger = React.forwardRef<\n HTMLButtonElement,\n PopoverTriggerProps\n>(({ children, className, render }, ref) => {\n // Wrap with `contents` span to isolate the hidden accessibility <span> nodes\n // that @base-ui/react injects as siblings of the trigger. Without this wrapper,\n // those fixed-position spans become siblings in the parent container and break\n // Tailwind's `space-y-*` selectors (`:not(:last-child)`) causing layout shifts.\n if (render) {\n return (\n <span className=\"contents\">\n <BasePopover.Trigger\n ref={ref}\n className={clsx('outline-none', className)}\n render={render}\n />\n </span>\n )\n }\n\n return (\n <span className=\"contents\">\n <BasePopover.Trigger\n ref={ref}\n className={clsx('outline-none', className)}\n >\n {children}\n </BasePopover.Trigger>\n </span>\n )\n})\n\nPopoverTrigger.displayName = 'PopoverTrigger'\n\nexport const PopoverContent: React.FC<PopoverContentProps> = ({\n children,\n className,\n side = 'bottom',\n align = 'center',\n sideOffset = 8,\n alignOffset = 0,\n}) => {\n return (\n <BasePopover.Portal>\n <BasePopover.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n >\n <BasePopover.Popup\n className={clsx(\n 'z-50 min-w-50 max-w-90 rounded-lg border border-(--border-light) bg-(--bg-primary) shadow-lg',\n className\n )}\n >\n {children}\n <BasePopover.Arrow className=\"fill-(--bg-primary) stroke-(--border-light)\" />\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n )\n}\n\nPopoverContent.displayName = 'PopoverContent'\n\nexport const PopoverClose = React.forwardRef<\n HTMLButtonElement,\n PopoverCloseProps\n>(({ children, className, render }, ref) => {\n if (render) {\n return (\n <BasePopover.Close\n ref={ref}\n className={clsx('outline-none', className)}\n render={render}\n />\n )\n }\n\n return (\n <BasePopover.Close\n ref={ref}\n className={clsx('outline-none', className)}\n >\n {children}\n </BasePopover.Close>\n )\n})\n\nPopoverClose.displayName = 'PopoverClose'\n\n// Convenience components for common Popover content patterns\nexport const PopoverHeader: React.FC<{ children: React.ReactNode; className?: string }> = ({\n children,\n className,\n}) => {\n return (\n <div\n className={clsx(\n 'px-4 py-3 border-b border-(--border-light)',\n 'font-bold text-[15px] text-(--text-primary)',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport const PopoverBody: React.FC<{ children: React.ReactNode; className?: string }> = ({\n children,\n className,\n}) => {\n return (\n <div\n className={clsx(\n 'px-4 py-3',\n 'text-[15px] text-(--text-primary)',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport const PopoverFooter: React.FC<{ children: React.ReactNode; className?: string }> = ({\n children,\n className,\n}) => {\n return (\n <div\n className={clsx(\n 'px-4 py-3 border-t border-(--border-light)',\n 'flex items-center justify-end gap-2',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\n// ─── Imperative Popover API ───────────────────────────────────────────────────\n\nexport interface ImperativePopoverOptions {\n /** Content rendered inside the popover */\n content: React.ReactNode\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n sideOffset?: number\n alignOffset?: number\n className?: string\n}\n\nexport interface UseImperativePopoverReturn {\n /**\n * Show the popover anchored to the given element.\n * If already open on the same anchor, calling `show` again replaces the content.\n */\n show: (anchor: HTMLElement | null, options: ImperativePopoverOptions) => void\n /** Hide the currently open popover. */\n hide: () => void\n /**\n * Toggle the popover for the given anchor.\n * Closes it if the same anchor is already open; otherwise opens on the new anchor.\n */\n toggle: (anchor: HTMLElement | null, options: ImperativePopoverOptions) => void\n /** Whether the imperative popover is currently open. */\n isOpen: boolean\n}\n\ninterface ImperativePopoverState {\n open: boolean\n anchor: HTMLElement | null\n options: ImperativePopoverOptions\n}\n\nconst ImperativePopoverContext = createContext<UseImperativePopoverReturn | null>(null)\n\n/**\n * Provides the imperative popover API to all descendant components.\n * Only one popover is shown at a time (singleton).\n * Must wrap any component that calls `useImperativePopover()`.\n *\n * @example\n * ```tsx\n * // main.tsx\n * <ImperativePopoverProvider>\n * <App />\n * </ImperativePopoverProvider>\n *\n * // Any component\n * const popover = useImperativePopover()\n *\n * <button onClick={e => popover.show(e.currentTarget, { content: <MyPanel /> })}>\n * Open\n * </button>\n * ```\n */\nexport const ImperativePopoverProvider: React.FC<{ children: React.ReactNode }> = ({\n children,\n}) => {\n const [state, setState] = useState<ImperativePopoverState>({\n open: false,\n anchor: null,\n options: { content: null },\n })\n\n const show = useCallback(\n (anchor: HTMLElement | null, options: ImperativePopoverOptions) => {\n setState({ open: true, anchor, options })\n },\n [],\n )\n\n const hide = useCallback(() => {\n setState(prev => ({ ...prev, open: false }))\n }, [])\n\n const toggle = useCallback(\n (anchor: HTMLElement | null, options: ImperativePopoverOptions) => {\n setState(prev => {\n if (prev.open && prev.anchor === anchor) {\n return { ...prev, open: false }\n }\n return { open: true, anchor, options }\n })\n },\n [],\n )\n\n const value = useMemo<UseImperativePopoverReturn>(\n () => ({ show, hide, toggle, isOpen: state.open }),\n [show, hide, toggle, state.open],\n )\n\n return (\n <ImperativePopoverContext.Provider value={value}>\n {children}\n <ImperativePopoverPortal state={state} onClose={hide} />\n </ImperativePopoverContext.Provider>\n )\n}\n\nImperativePopoverProvider.displayName = 'ImperativePopoverProvider'\n\nfunction ImperativePopoverPortal({\n state,\n onClose,\n}: {\n state: ImperativePopoverState\n onClose: () => void\n}) {\n if (!state.open || !state.anchor) return null\n\n const { options } = state\n\n return (\n <BasePopover.Root open={state.open} onOpenChange={open => !open && onClose()}>\n <BasePopover.Portal>\n <BasePopover.Positioner\n anchor={state.anchor}\n side={options.side ?? 'bottom'}\n align={options.align ?? 'center'}\n sideOffset={options.sideOffset ?? 8}\n alignOffset={options.alignOffset ?? 0}\n className={'z-50'}\n >\n <BasePopover.Popup\n className={clsx(\n 'z-50 min-w-50 max-w-90 rounded-lg border border-(--border-light) bg-(--bg-primary) shadow-lg',\n options.className,\n )}\n >\n {options.content}\n <BasePopover.Arrow className=\"fill-(--bg-primary) stroke-(--border-light)\" />\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n </BasePopover.Root>\n )\n}\n\n/**\n * Returns imperative methods for showing a popover anchored to any element.\n *\n * Must be used inside `<ImperativePopoverProvider>`.\n *\n * @example\n * ```tsx\n * const popover = useImperativePopover()\n *\n * // Show on button click\n * <button onClick={e => popover.show(e.currentTarget, { content: <ProfileCard />, side: 'bottom' })}>\n * Profile\n * </button>\n *\n * // Toggle\n * <button onClick={e => popover.toggle(e.currentTarget, { content: <Settings /> })}>\n * Settings\n * </button>\n * ```\n */\nexport function useImperativePopover(): UseImperativePopoverReturn {\n const ctx = useContext(ImperativePopoverContext)\n if (!ctx) throw new Error('useImperativePopover must be used within <ImperativePopoverProvider>')\n return ctx\n}\n\n\n\n\n\n\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\n\nexport { mergeClasses };\n//# sourceMappingURL=mergeClasses.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=toKebabCase.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\n\nexport { toCamelCase };\n//# sourceMappingURL=toCamelCase.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { toCamelCase } from './toCamelCase.js';\n\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\n\nexport { toPascalCase };\n//# sourceMappingURL=toPascalCase.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n return false;\n};\n\nexport { hasA11yProp };\n//# sourceMappingURL=hasA11yProp.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { hasA11yProp } from './shared/src/utils/hasA11yProp.js';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n )\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses } from './shared/src/utils/mergeClasses.js';\nimport { toKebabCase } from './shared/src/utils/toKebabCase.js';\nimport { toPascalCase } from './shared/src/utils/toPascalCase.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]];\nconst ChevronDown = createLucideIcon(\"chevron-down\", __iconNode);\n\nexport { __iconNode, ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]];\nconst ChevronRight = createLucideIcon(\"chevron-right\", __iconNode);\n\nexport { __iconNode, ChevronRight as default };\n//# sourceMappingURL=chevron-right.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"m18 15-6-6-6 6\", key: \"153udz\" }]];\nconst ChevronUp = createLucideIcon(\"chevron-up\", __iconNode);\n\nexport { __iconNode, ChevronUp as default };\n//# sourceMappingURL=chevron-up.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M21.801 10A10 10 0 1 1 17 3.335\", key: \"yps3ct\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n];\nconst CircleCheckBig = createLucideIcon(\"circle-check-big\", __iconNode);\n\nexport { __iconNode, CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"m15 9-6 6\", key: \"1uzhvr\" }],\n [\"path\", { d: \"m9 9 6 6\", key: \"z0biqf\" }]\n];\nconst CircleX = createLucideIcon(\"circle-x\", __iconNode);\n\nexport { __iconNode, CircleX as default };\n//# sourceMappingURL=circle-x.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M12 16v-4\", key: \"1dtifu\" }],\n [\"path\", { d: \"M12 8h.01\", key: \"e9boi3\" }]\n];\nconst Info = createLucideIcon(\"info\", __iconNode);\n\nexport { __iconNode, Info as default };\n//# sourceMappingURL=info.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }]];\nconst Minus = createLucideIcon(\"minus\", __iconNode);\n\nexport { __iconNode, Minus as default };\n//# sourceMappingURL=minus.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n","import React from 'react'\nimport { Menu as BaseMenu } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { Check, ChevronRight } from 'lucide-react'\n\nexport interface MenuProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport interface MenuTriggerProps {\n children?: React.ReactNode\n className?: string\n render?: React.ReactElement\n}\n\nexport interface MenuContentProps {\n children: React.ReactNode\n className?: string\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n sideOffset?: number\n alignOffset?: number\n}\n\nexport interface MenuItemProps {\n children: React.ReactNode\n className?: string\n disabled?: boolean\n onSelect?: () => void\n destructive?: boolean\n}\n\nexport interface MenuCheckboxItemProps {\n children: React.ReactNode\n className?: string\n checked?: boolean\n onCheckedChange?: (checked: boolean) => void\n disabled?: boolean\n}\n\nexport interface MenuRadioGroupProps {\n children: React.ReactNode\n value?: string\n onValueChange?: (value: string) => void\n}\n\nexport interface MenuRadioItemProps {\n children: React.ReactNode\n value: string\n className?: string\n disabled?: boolean\n}\n\nexport interface MenuLabelProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface MenuSeparatorProps {\n className?: string\n}\n\nexport interface MenuSubProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport interface MenuSubTriggerProps {\n children: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport interface MenuSubContentProps {\n children: React.ReactNode\n className?: string\n}\n\nexport const Menu: React.FC<MenuProps> = ({\n children,\n open,\n defaultOpen,\n onOpenChange,\n}) => {\n return (\n <BaseMenu.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n >\n {children}\n </BaseMenu.Root>\n )\n}\n\nexport const MenuTrigger = React.forwardRef<HTMLButtonElement, MenuTriggerProps>(\n ({ children, className, render }, ref) => {\n if (render) {\n return (\n <span className=\"contents\">\n <BaseMenu.Trigger\n ref={ref}\n className={clsx('outline-none', className)}\n render={render}\n />\n </span>\n )\n }\n\n return (\n <span className=\"contents\">\n <BaseMenu.Trigger\n ref={ref}\n className={clsx('outline-none', className)}\n >\n {children}\n </BaseMenu.Trigger>\n </span>\n )\n }\n)\n\nMenuTrigger.displayName = 'MenuTrigger'\n\nexport const MenuContent = React.forwardRef<HTMLDivElement, MenuContentProps>(\n (\n {\n children,\n className,\n side = 'bottom',\n align = 'start',\n sideOffset = 4,\n alignOffset = 0,\n },\n ref\n ) => {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n >\n <BaseMenu.Popup\n ref={ref}\n className={clsx(\n 'z-50 min-w-45 max-w-80 rounded-md border border-(--border-light) bg-(--bg-primary) shadow-lg',\n 'py-1',\n className\n )}\n >\n {children}\n <BaseMenu.Arrow className=\"fill-(--bg-primary) stroke-(--border-light)\" />\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n )\n }\n)\n\nMenuContent.displayName = 'MenuContent'\n\nexport const MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(\n ({ children, className, disabled, onSelect, destructive }, ref) => {\n return (\n <BaseMenu.Item\n ref={ref}\n className={clsx(\n 'relative flex items-center gap-2 px-3 py-1.5 text-[15px] outline-none cursor-pointer select-none',\n 'text-(--text-primary) hover:bg-(--bg-hover)',\n 'data-highlighted:bg-(--bg-hover)',\n 'data-disabled:opacity-50 data-disabled:pointer-events-none',\n destructive && 'text-(--danger) hover:bg-red-50 dark:hover:bg-red-950/20',\n className\n )}\n disabled={disabled}\n onSelect={onSelect}\n >\n {children}\n </BaseMenu.Item>\n )\n }\n)\n\nMenuItem.displayName = 'MenuItem'\n\nexport const MenuCheckboxItem = React.forwardRef<\n HTMLDivElement,\n MenuCheckboxItemProps\n>(({ children, className, checked, onCheckedChange, disabled }, ref) => {\n return (\n <BaseMenu.CheckboxItem\n ref={ref}\n className={clsx(\n 'relative flex items-center gap-2 px-3 py-1.5 pl-8 text-[15px] outline-none cursor-pointer select-none',\n 'text-(--text-primary) hover:bg-(--bg-hover)',\n 'data-highlighted:bg-(--bg-hover)',\n 'data-disabled:opacity-50 data-disabled:pointer-events-none',\n className\n )}\n checked={checked}\n onCheckedChange={onCheckedChange}\n disabled={disabled}\n >\n <BaseMenu.CheckboxItemIndicator className=\"absolute left-2 flex items-center justify-center\">\n <Check className=\"w-4 h-4\" />\n </BaseMenu.CheckboxItemIndicator>\n {children}\n </BaseMenu.CheckboxItem>\n )\n})\n\nMenuCheckboxItem.displayName = 'MenuCheckboxItem'\n\nexport const MenuRadioGroup: React.FC<MenuRadioGroupProps> = ({\n children,\n value,\n onValueChange,\n}) => {\n return (\n <BaseMenu.RadioGroup value={value} onValueChange={onValueChange}>\n {children}\n </BaseMenu.RadioGroup>\n )\n}\n\nexport const MenuRadioItem = React.forwardRef<HTMLDivElement, MenuRadioItemProps>(\n ({ children, value, className, disabled }, ref) => {\n return (\n <BaseMenu.RadioItem\n ref={ref}\n value={value}\n className={clsx(\n 'relative flex items-center gap-2 px-3 py-1.5 pl-8 text-[15px] outline-none cursor-pointer select-none',\n 'text-(--text-primary) hover:bg-(--bg-hover)',\n 'data-highlighted:bg-(--bg-hover)',\n 'data-disabled:opacity-50 data-disabled:pointer-events-none',\n className\n )}\n disabled={disabled}\n >\n <BaseMenu.RadioItemIndicator className=\"absolute left-2 flex items-center justify-center\">\n <Check className=\"w-4 h-4\" />\n </BaseMenu.RadioItemIndicator>\n {children}\n </BaseMenu.RadioItem>\n )\n }\n)\n\nMenuRadioItem.displayName = 'MenuRadioItem'\n\nexport const MenuLabel: React.FC<MenuLabelProps> = ({ children, className }) => {\n return (\n <div\n className={clsx(\n 'px-3 py-2 text-xs font-semibold text-(--text-muted) uppercase tracking-wider',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport const MenuSeparator: React.FC<MenuSeparatorProps> = ({ className }) => {\n return (\n <BaseMenu.Separator\n className={clsx('my-1 h-px bg-(--border-light)', className)}\n />\n )\n}\n\nexport const MenuSub: React.FC<MenuSubProps> = ({\n children,\n open,\n defaultOpen,\n onOpenChange,\n}) => {\n return (\n <BaseMenu.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n >\n {children}\n </BaseMenu.Root>\n )\n}\n\nexport const MenuSubTrigger = React.forwardRef<HTMLButtonElement, MenuSubTriggerProps>(\n ({ children, className, disabled }, ref) => {\n return (\n <BaseMenu.Trigger\n ref={ref}\n className={clsx(\n 'relative flex items-center justify-between gap-2 px-3 py-2 text-[15px] outline-none cursor-pointer select-none',\n 'text-(--text-primary) hover:bg-(--bg-hover)',\n 'data-highlighted:bg-(--bg-hover)',\n 'data-disabled:opacity-50 data-disabled:pointer-events-none w-full',\n className\n )}\n disabled={disabled}\n >\n {children}\n <ChevronRight className=\"w-4 h-4 ml-auto\" />\n </BaseMenu.Trigger>\n )\n }\n)\n\nMenuSubTrigger.displayName = 'MenuSubTrigger'\n\nexport const MenuSubContent = React.forwardRef<HTMLDivElement, MenuSubContentProps>(\n ({ children, className }, ref) => {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner side=\"right\" align=\"start\" sideOffset={8}>\n <BaseMenu.Popup\n ref={ref}\n className={clsx(\n 'z-50 min-w-45 max-w-80 rounded-md border border-(--border-light) bg-(--bg-primary) shadow-lg',\n 'py-1',\n className\n )}\n >\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n )\n }\n)\n\nMenuSubContent.displayName = 'MenuSubContent'\n\n// Convenience component for menu items with icons\nexport const MenuItemWithIcon: React.FC<{\n icon?: React.ReactNode\n children: React.ReactNode\n shortcut?: string\n className?: string\n disabled?: boolean\n onSelect?: () => void\n destructive?: boolean\n}> = ({ icon, children, shortcut, className, disabled, onSelect, destructive }) => {\n return (\n <MenuItem\n className={className}\n disabled={disabled}\n onSelect={onSelect}\n destructive={destructive}\n >\n {icon && <span className=\"shrink-0\">{icon}</span>}\n <span className=\"flex-1\">{children}</span>\n {shortcut && (\n <span className=\"ml-auto text-xs text-(--text-muted)\">{shortcut}</span>\n )}\n </MenuItem>\n )\n}\n\n","import React from 'react'\nimport { Menu as BaseMenu } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { ChevronRight } from 'lucide-react'\nimport { MenuTrigger, MenuItem, MenuCheckboxItem, MenuRadioItem } from './Menu'\n\nexport interface ContextMenuProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport interface ContextMenuTriggerProps {\n children: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport interface ContextMenuContentProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface ContextMenuItemProps {\n children: React.ReactNode\n className?: string\n disabled?: boolean\n onSelect?: () => void\n destructive?: boolean\n}\n\nexport interface ContextMenuCheckboxItemProps {\n children: React.ReactNode\n className?: string\n checked?: boolean\n onCheckedChange?: (checked: boolean) => void\n disabled?: boolean\n}\n\nexport interface ContextMenuRadioGroupProps {\n children: React.ReactNode\n value?: string\n onValueChange?: (value: string) => void\n}\n\nexport interface ContextMenuRadioItemProps {\n children: React.ReactNode\n value: string\n className?: string\n disabled?: boolean\n}\n\nexport interface ContextMenuLabelProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface ContextMenuSeparatorProps {\n className?: string\n}\n\nexport interface ContextMenuSubProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport interface ContextMenuSubTriggerProps {\n children: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport interface ContextMenuSubContentProps {\n children: React.ReactNode\n className?: string\n}\n\n// Context for sharing anchor position between components\nconst ContextMenuContext = React.createContext<{\n anchorEl: VirtualElement | null\n setAnchorEl: (el: VirtualElement | null) => void\n} | null>(null)\n\ninterface VirtualElement {\n getBoundingClientRect: () => DOMRect\n}\n\nexport const ContextMenu: React.FC<ContextMenuProps> = ({\n children,\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n}) => {\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen ?? false)\n const [anchorEl, setAnchorEl] = React.useState<VirtualElement | null>(null)\n\n const open = controlledOpen ?? uncontrolledOpen\n const handleOpenChange = (newOpen: boolean) => {\n setUncontrolledOpen(newOpen)\n onOpenChange?.(newOpen)\n }\n\n return (\n <ContextMenuContext.Provider value={{ anchorEl, setAnchorEl }}>\n <BaseMenu.Root\n open={open}\n onOpenChange={handleOpenChange}\n >\n {children}\n </BaseMenu.Root>\n </ContextMenuContext.Provider>\n )\n}\n\nexport const ContextMenuTrigger = React.forwardRef<\n HTMLDivElement,\n ContextMenuTriggerProps\n>(({ children, className, disabled }, ref) => {\n const context = React.useContext(ContextMenuContext)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n\n const handleContextMenu = (e: React.MouseEvent) => {\n e.preventDefault()\n if (disabled) return\n\n // Create a virtual element at the mouse position\n const virtualEl: VirtualElement = {\n getBoundingClientRect: () => ({\n width: 0,\n height: 0,\n x: e.clientX,\n y: e.clientY,\n left: e.clientX,\n right: e.clientX,\n top: e.clientY,\n bottom: e.clientY,\n toJSON: () => ({}),\n } as DOMRect),\n }\n\n context?.setAnchorEl(virtualEl)\n\n // Programmatically trigger the menu\n if (triggerRef.current) {\n triggerRef.current.click()\n }\n }\n\n return (\n <div\n ref={ref}\n className={clsx('outline-none focus:outline-none', className)}\n onContextMenu={handleContextMenu}\n >\n {/* Hidden trigger button — must suppress all focus styles */}\n <MenuTrigger\n ref={triggerRef}\n className=\"!absolute !w-0 !h-0 !p-0 !m-0 !border-0 !outline-none !shadow-none !opacity-0 overflow-hidden pointer-events-none\"\n render={\n <button\n disabled={disabled}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n }\n />\n {children}\n </div>\n )\n})\n\nContextMenuTrigger.displayName = 'ContextMenuTrigger'\n\nexport const ContextMenuContent = React.forwardRef<\n HTMLDivElement,\n ContextMenuContentProps\n>(({ children, className }, ref) => {\n const context = React.useContext(ContextMenuContext)\n\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n anchor={context?.anchorEl || undefined}\n side=\"bottom\"\n align=\"start\"\n sideOffset={4}\n >\n <BaseMenu.Popup\n ref={ref}\n className={clsx(\n 'z-50 min-w-56 rounded-md border border-(--border-light) bg-(--bg-primary) shadow-lg',\n 'py-1 outline-0',\n className\n )}\n >\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n\n )\n})\n\nContextMenuContent.displayName = 'ContextMenuContent'\n\nexport const ContextMenuItem = React.forwardRef<HTMLDivElement, ContextMenuItemProps>(\n ({ children, className, disabled, onSelect, destructive }, ref) => {\n return (\n <MenuItem\n ref={ref}\n className={className}\n disabled={disabled}\n onSelect={onSelect}\n destructive={destructive}\n >\n {children}\n </MenuItem>\n )\n }\n)\n\nContextMenuItem.displayName = 'ContextMenuItem'\n\nexport const ContextMenuCheckboxItem = React.forwardRef<\n HTMLDivElement,\n ContextMenuCheckboxItemProps\n>(({ children, className, checked, onCheckedChange, disabled }, ref) => {\n return (\n <MenuCheckboxItem\n ref={ref}\n className={className}\n checked={checked}\n onCheckedChange={onCheckedChange}\n disabled={disabled}\n >\n {children}\n </MenuCheckboxItem>\n )\n})\n\nContextMenuCheckboxItem.displayName = 'ContextMenuCheckboxItem'\n\nexport const ContextMenuRadioGroup: React.FC<ContextMenuRadioGroupProps> = ({\n children,\n value,\n onValueChange,\n}) => {\n return (\n <BaseMenu.RadioGroup value={value} onValueChange={onValueChange}>\n {children}\n </BaseMenu.RadioGroup>\n )\n}\n\nexport const ContextMenuRadioItem = React.forwardRef<\n HTMLDivElement,\n ContextMenuRadioItemProps\n>(({ children, value, className, disabled }, ref) => {\n return (\n <MenuRadioItem\n ref={ref}\n value={value}\n className={className}\n disabled={disabled}\n >\n {children}\n </MenuRadioItem>\n )\n})\n\nContextMenuRadioItem.displayName = 'ContextMenuRadioItem'\n\nexport const ContextMenuLabel: React.FC<ContextMenuLabelProps> = ({\n children,\n className,\n}) => {\n return (\n <div\n className={clsx(\n 'px-3 py-2 text-xs font-semibold text-(--text-muted) uppercase tracking-wider',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport const ContextMenuSeparator: React.FC<ContextMenuSeparatorProps> = ({\n className,\n}) => {\n return (\n <BaseMenu.Separator\n className={clsx('my-1 h-px bg-(--border-light)', className)}\n />\n )\n}\n\nexport const ContextMenuSub: React.FC<ContextMenuSubProps> = ({\n children,\n open,\n defaultOpen,\n onOpenChange,\n}) => {\n return (\n <BaseMenu.Root\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n >\n {children}\n </BaseMenu.Root>\n )\n}\n\nexport const ContextMenuSubTrigger = React.forwardRef<\n HTMLButtonElement,\n ContextMenuSubTriggerProps\n>(({ children, className, disabled }, ref) => {\n return (\n <MenuTrigger\n ref={ref}\n className={clsx(\n 'relative flex items-center justify-between gap-2 px-3 py-2 text-[15px] cursor-pointer select-none',\n 'text-(--text-primary) hover:bg-(--bg-hover)',\n 'data-highlighted:bg-(--bg-hover)',\n 'data-disabled:opacity-50 data-disabled:pointer-events-none w-full',\n className\n )}\n render={\n <button disabled={disabled}>\n {children}\n <ChevronRight className=\"w-4 h-4 ml-auto\"/>\n </button>\n }\n />\n )\n})\n\nContextMenuSubTrigger.displayName = 'ContextMenuSubTrigger'\n\nexport const ContextMenuSubContent = React.forwardRef<\n HTMLDivElement,\n ContextMenuSubContentProps\n>(({ children, className }, ref) => {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner side=\"right\" align=\"start\" sideOffset={8}>\n <BaseMenu.Popup\n ref={ref}\n className={clsx(\n 'z-50 min-w-45 max-w-80 rounded-md border border-(--border-light) bg-(--bg-primary) shadow-lg',\n 'py-1',\n className\n )}\n >\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n )\n})\n\nContextMenuSubContent.displayName = 'ContextMenuSubContent'\n\n// Convenience component for context menu items with icons and shortcuts\nexport const ContextMenuItemWithIcon: React.FC<{\n icon?: React.ReactNode\n children: React.ReactNode\n shortcut?: string\n className?: string\n disabled?: boolean\n onSelect?: () => void\n destructive?: boolean\n}> = ({ icon, children, shortcut, className, disabled, onSelect, destructive }) => {\n return (\n <ContextMenuItem\n className={className}\n disabled={disabled}\n onSelect={onSelect}\n destructive={destructive}\n >\n {icon && <span className=\"shrink-0\">{icon}</span>}\n <span className=\"flex-1\">{children}</span>\n {shortcut && (\n <span className=\"ml-auto text-xs text-(--text-muted)\">{shortcut}</span>\n )}\n </ContextMenuItem>\n )\n}\n","import clsx from 'clsx'\nimport { Dialog as BaseDialog } from '@base-ui/react'\nimport React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\nimport { X } from 'lucide-react'\nimport { Button } from './Button'\n\nexport type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';\n\nexport interface DialogProps {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n title?: string;\n description?: string;\n children?: React.ReactNode;\n size?: DialogSize;\n showCloseButton?: boolean;\n className?: string;\n}\n\nexport const Dialog = ({\n open,\n onOpenChange,\n title,\n description,\n children,\n size = 'xl',\n showCloseButton = true,\n className,\n}: DialogProps) => {\n const sizeClasses = {\n sm: 'max-w-sm',\n md: 'max-w-md',\n lg: 'max-w-lg',\n xl: 'max-w-xl',\n '2xl': 'max-w-2xl',\n '3xl': 'max-w-3xl',\n '4xl': 'max-w-4xl',\n }\n\n return (\n <BaseDialog.Root open={open} onOpenChange={onOpenChange}>\n <BaseDialog.Portal>\n {/* Backdrop */}\n <BaseDialog.Backdrop\n className=\"fixed inset-0 bg-black/50 z-40 transition-opacity duration-200\"\n />\n\n {/* Dialog Content */}\n <BaseDialog.Popup\n className={clsx(\n 'fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'w-full',\n sizeClasses[size],\n 'bg-(--bg-primary) rounded-xl border border-(--border-gray)',\n 'transition-all duration-200',\n 'outline-none focus-visible:outline-none',\n className,\n )}\n >\n {/* Header */}\n {(title || showCloseButton) && (\n <div className=\"flex items-start justify-between p-6 border-b border-(--border-light)\">\n <div className=\"flex-1\">\n {title && (\n <BaseDialog.Title className=\"text-2xl font-black text-(--text-primary) leading-tight\">\n {title}\n </BaseDialog.Title>\n )}\n {description && (\n <BaseDialog.Description className=\"text-(--text-secondary) mt-2 text-sm\">\n {description}\n </BaseDialog.Description>\n )}\n </div>\n {showCloseButton && (\n <BaseDialog.Close\n className=\"ml-4 p-2 rounded hover:bg-(--bg-hover) text-(--text-secondary) hover:text-(--text-primary) transition-colors focus-visible:ring-2 focus-visible:ring-(--slack-blue) focus-visible:ring-offset-2 outline-none\"\n aria-label=\"Close dialog\"\n >\n <X className=\"w-5 h-5\"/>\n </BaseDialog.Close>\n )}\n </div>\n )}\n\n {/* Body */}\n <div className=\"p-6\">{children}</div>\n </BaseDialog.Popup>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n )\n}\n\nDialog.displayName = 'Dialog'\n\n// Sub-components for custom layouts\nexport const DialogHeader = ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div className={clsx('mb-4', className)}>{children}</div>\n)\n\nexport const DialogBody = ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div className={clsx('text-(--text-primary)', className)}>{children}</div>\n)\n\nexport const DialogFooter = ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div className={clsx('flex items-center justify-end gap-3 mt-6 pt-4 border-t border-(--border-light)', className)}>\n {children}\n </div>\n)\n\n// Trigger component for opening dialogs\nexport interface DialogTriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n}\n\nexport const DialogTrigger = React.forwardRef<HTMLButtonElement, DialogTriggerProps>(\n ({ children, asChild, ...props }, ref) => {\n if (asChild) {\n return <BaseDialog.Trigger ref={ref}>{children}</BaseDialog.Trigger>\n }\n\n return (\n <BaseDialog.Trigger ref={ref} {...props}>\n {children}\n </BaseDialog.Trigger>\n )\n },\n)\n\nDialogTrigger.displayName = 'DialogTrigger'\n\n// Re-export Close for custom usage\nexport const DialogClose = BaseDialog.Close\n\n// ─── Imperative Dialog API ────────────────────────────────────────────────────\n\nexport interface ShowDialogOptions {\n title?: string\n description?: string\n /** Custom content rendered inside the dialog body */\n content?: React.ReactNode\n size?: DialogSize\n showCloseButton?: boolean\n className?: string\n}\n\nexport interface ConfirmDialogOptions {\n title?: string\n description?: string\n content?: React.ReactNode\n size?: DialogSize\n confirmLabel?: string\n cancelLabel?: string\n confirmVariant?: 'primary' | 'danger' | 'secondary'\n}\n\nexport interface AlertDialogOptions {\n title?: string\n description?: string\n content?: React.ReactNode\n size?: DialogSize\n confirmLabel?: string\n}\n\nexport interface UseDialogReturn {\n /** Show a generic dialog. Resolves when the dialog is closed. */\n show: (options: ShowDialogOptions) => Promise<void>\n /** Show a confirm dialog. Resolves `true` when confirmed, `false` when cancelled. */\n confirm: (options: ConfirmDialogOptions) => Promise<boolean>\n /** Show an alert dialog with a single OK button. Resolves when dismissed. */\n alert: (options: AlertDialogOptions) => Promise<void>\n}\n\ninterface DialogEntry {\n id: string\n type: 'show' | 'confirm' | 'alert'\n title?: string\n description?: string\n content?: React.ReactNode\n size?: DialogSize\n showCloseButton?: boolean\n confirmLabel?: string\n cancelLabel?: string\n confirmVariant?: 'primary' | 'danger' | 'secondary'\n className?: string\n resolve: (value: boolean) => void\n}\n\nconst DialogImperativeContext = createContext<UseDialogReturn | null>(null)\n\n/**\n * Provides the imperative dialog API to all descendant components.\n * Must wrap any component that calls `useDialog()`.\n *\n * @example\n * ```tsx\n * // main.tsx\n * <DialogProvider>\n * <App />\n * </DialogProvider>\n *\n * // Any component\n * const { show, confirm, alert } = useDialog()\n * await confirm({ title: 'Delete?', confirmLabel: 'Delete', confirmVariant: 'danger' })\n * ```\n */\nexport const DialogProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const [dialogs, setDialogs] = useState<DialogEntry[]>([])\n\n const removeDialog = useCallback((id: string) => {\n setDialogs(prev => prev.filter(d => d.id !== id))\n }, [])\n\n const show = useCallback((options: ShowDialogOptions): Promise<void> => {\n return new Promise(resolve => {\n const id = Math.random().toString(36).slice(2, 9)\n setDialogs(prev => [\n ...prev,\n { ...options, id, type: 'show', resolve: () => resolve() },\n ])\n })\n }, [])\n\n const confirm = useCallback((options: ConfirmDialogOptions): Promise<boolean> => {\n return new Promise(resolve => {\n const id = Math.random().toString(36).slice(2, 9)\n setDialogs(prev => [...prev, { ...options, id, type: 'confirm', resolve }])\n })\n }, [])\n\n const alert = useCallback((options: AlertDialogOptions): Promise<void> => {\n return new Promise(resolve => {\n const id = Math.random().toString(36).slice(2, 9)\n setDialogs(prev => [\n ...prev,\n { ...options, id, type: 'alert', resolve: () => resolve() },\n ])\n })\n }, [])\n\n const value = useMemo<UseDialogReturn>(\n () => ({ show, confirm, alert }),\n [show, confirm, alert],\n )\n\n return (\n <DialogImperativeContext.Provider value={value}>\n {children}\n {dialogs.map(dialog => (\n <ImperativeDialogItem\n key={dialog.id}\n dialog={dialog}\n onRemove={() => removeDialog(dialog.id)}\n />\n ))}\n </DialogImperativeContext.Provider>\n )\n}\n\nDialogProvider.displayName = 'DialogProvider'\n\nfunction ImperativeDialogItem ({\n dialog,\n onRemove,\n}: {\n dialog: DialogEntry\n onRemove: () => void\n}) {\n const [open, setOpen] = useState(true)\n\n const handleClose = useCallback(\n (result: boolean) => {\n setOpen(false)\n dialog.resolve(result)\n // Allow close animation to finish before unmounting\n setTimeout(onRemove, 300)\n },\n [dialog, onRemove],\n )\n\n const commonProps = {\n open,\n title: dialog.title,\n description: dialog.description,\n size: dialog.size,\n className: dialog.className,\n }\n\n if (dialog.type === 'show') {\n return (\n <Dialog\n {...commonProps}\n showCloseButton={dialog.showCloseButton ?? true}\n onOpenChange={o => !o && handleClose(false)}\n >\n {dialog.content}\n </Dialog>\n )\n }\n\n if (dialog.type === 'confirm') {\n return (\n <Dialog\n {...commonProps}\n size={dialog.size ?? 'sm'}\n showCloseButton={false}\n onOpenChange={o => !o && handleClose(false)}\n >\n {dialog.content}\n <DialogFooter>\n <Button variant=\"secondary\" onClick={() => handleClose(false)}>\n {dialog.cancelLabel ?? 'Cancel'}\n </Button>\n <Button\n variant={dialog.confirmVariant ?? 'primary'}\n onClick={() => handleClose(true)}\n >\n {dialog.confirmLabel ?? 'Confirm'}\n </Button>\n </DialogFooter>\n </Dialog>\n )\n }\n\n // alert\n return (\n <Dialog\n {...commonProps}\n size={dialog.size ?? 'sm'}\n showCloseButton={false}\n onOpenChange={o => !o && handleClose(true)}\n >\n {dialog.content}\n <DialogFooter>\n <Button variant=\"primary\" onClick={() => handleClose(true)}>\n {dialog.confirmLabel ?? 'OK'}\n </Button>\n </DialogFooter>\n </Dialog>\n )\n}\n\n/**\n * Returns imperative methods for showing dialogs from anywhere in the component tree.\n *\n * Must be used inside `<DialogProvider>`.\n *\n * @example\n * ```tsx\n * const { show, confirm, alert } = useDialog()\n *\n * // Generic dialog\n * await show({ title: 'Welcome', content: <p>Hello world</p> })\n *\n * // Confirm\n * const ok = await confirm({ title: 'Delete item?', confirmLabel: 'Delete', confirmVariant: 'danger' })\n * if (ok) deleteItem()\n *\n * // Alert\n * await alert({ title: 'Error', description: 'Something went wrong.' })\n * ```\n */\nexport function useDialog (): UseDialogReturn {\n const ctx = useContext(DialogImperativeContext)\n if (!ctx) throw new Error('useDialog must be used within <DialogProvider>')\n return ctx\n}\n\n","import clsx from 'clsx'\nimport { Dialog as BaseDialog } from '@base-ui/react'\nimport React from 'react'\nimport { AlertTriangle, Info, CheckCircle, XCircle } from 'lucide-react'\nimport { Button } from './Button'\n\nexport type AlertDialogVariant = 'info' | 'success' | 'warning' | 'danger';\n\nexport interface AlertDialogProps {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n title: string;\n description?: string;\n children?: React.ReactNode;\n variant?: AlertDialogVariant;\n confirmText?: string;\n cancelText?: string;\n onConfirm?: () => void | Promise<void>;\n onCancel?: () => void;\n showCancel?: boolean;\n confirmButtonVariant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n className?: string;\n}\n\nconst variantConfig = {\n info: {\n icon: Info,\n iconClassName: 'text-(--slack-blue)',\n bgClassName: 'bg-(--slack-blue)/10',\n },\n success: {\n icon: CheckCircle,\n iconClassName: 'text-(--slack-green)',\n bgClassName: 'bg-(--slack-green)/10',\n },\n warning: {\n icon: AlertTriangle,\n iconClassName: 'text-[#E2A03F]',\n bgClassName: 'bg-[#E2A03F]/10',\n },\n danger: {\n icon: XCircle,\n iconClassName: 'text-(--danger)',\n bgClassName: 'bg-(--danger)/10',\n },\n}\n\nexport const AlertDialog = ({\n open,\n onOpenChange,\n title,\n description,\n children,\n variant = 'info',\n confirmText = 'Confirm',\n cancelText = 'Cancel',\n onConfirm,\n onCancel,\n showCancel = true,\n confirmButtonVariant,\n className,\n}: AlertDialogProps) => {\n const [isLoading, setIsLoading] = React.useState(false)\n const config = variantConfig[variant]\n const Icon = config.icon\n\n // Auto-map variant to button variant if not specified\n const buttonVariant = confirmButtonVariant ?? (variant === 'danger' ? 'danger' : 'primary')\n\n const handleConfirm = async () => {\n if (onConfirm) {\n setIsLoading(true)\n try {\n await onConfirm()\n onOpenChange?.(false)\n } catch (error) {\n console.error('AlertDialog confirm error:', error)\n } finally {\n setIsLoading(false)\n }\n } else {\n onOpenChange?.(false)\n }\n }\n\n const handleCancel = () => {\n onCancel?.()\n onOpenChange?.(false)\n }\n\n return (\n <BaseDialog.Root open={open} onOpenChange={onOpenChange}>\n <BaseDialog.Portal>\n {/* Backdrop */}\n <BaseDialog.Backdrop\n className=\"fixed inset-0 bg-black/50 z-40 transition-opacity duration-200\"\n />\n\n {/* Dialog Content */}\n <BaseDialog.Popup\n className={clsx(\n 'fixed left-[50%] top-[50%] z-50 translate-x-[-50%] translate-y-[-50%]',\n 'w-full max-w-md',\n 'bg-(--bg-primary) rounded-lg shadow-2xl border border-(--border-gray)',\n 'transition-all duration-200',\n 'outline-none focus-visible:outline-none',\n className,\n )}\n >\n {/* Content */}\n <div className=\"p-6\">\n {/* Icon and Title Section */}\n <div className=\"flex items-start gap-4 mb-4\">\n <div className={clsx('p-2 rounded-lg shrink-0', config.bgClassName)}>\n <Icon className={clsx('w-6 h-6', config.iconClassName)}/>\n </div>\n <div className=\"flex-1\">\n <BaseDialog.Title className=\"text-xl font-black text-(--text-primary) leading-tight\">\n {title}\n </BaseDialog.Title>\n {description && (\n <BaseDialog.Description className=\"text-(--text-secondary) mt-2 text-[15px] leading-relaxed\">\n {description}\n </BaseDialog.Description>\n )}\n </div>\n </div>\n\n {/* Custom Content */}\n {children && (\n <div className=\"mb-4 pl-14 text-(--text-primary) text-[15px] leading-relaxed\">\n {children}\n </div>\n )}\n\n {/* Action Buttons */}\n <div className=\"flex items-center justify-end gap-3 mt-6\">\n {showCancel && (\n <Button\n variant=\"secondary\"\n onClick={handleCancel}\n disabled={isLoading}\n >\n {cancelText}\n </Button>\n )}\n <Button\n variant={buttonVariant}\n onClick={handleConfirm}\n disabled={isLoading}\n >\n {isLoading ? 'Processing...' : confirmText}\n </Button>\n </div>\n </div>\n </BaseDialog.Popup>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n )\n}\n\nAlertDialog.displayName = 'AlertDialog'\n\n// Trigger component for opening alert dialogs\nexport interface AlertDialogTriggerProps extends React.ComponentPropsWithoutRef<'button'> {\n asChild?: boolean;\n}\n\nexport const AlertDialogTrigger = React.forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n ({ children, asChild, ...props }, ref) => {\n if (asChild) {\n return <BaseDialog.Trigger ref={ref}>{children}</BaseDialog.Trigger>\n }\n\n return (\n <BaseDialog.Trigger ref={ref} {...props}>\n {children}\n </BaseDialog.Trigger>\n )\n },\n)\n\nAlertDialogTrigger.displayName = 'AlertDialogTrigger'\n\n\n","import clsx from 'clsx'\nimport React from 'react'\n\n// Form Context for managing form state\ninterface FormContextValue {\n errors: Record<string, string>;\n touched: Record<string, boolean>;\n values: Record<string, any>;\n setFieldValue: (name: string, value: any) => void;\n setFieldTouched: (name: string, touched: boolean) => void;\n setFieldError: (name: string, error: string) => void;\n}\n\nconst FormContext = React.createContext<FormContextValue | null>(null)\n\nexport const useFormContext = () => {\n const context = React.useContext(FormContext)\n if (!context) {\n throw new Error('Form components must be used within a Form component')\n }\n return context\n}\n\n// Main Form Component\nexport interface FormProps extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n children: React.ReactNode;\n onSubmit: (values: Record<string, any>) => void | Promise<void>;\n initialValues?: Record<string, any>;\n validate?: (values: Record<string, any>) => Record<string, string>;\n}\n\nexport const Form = ({\n children,\n onSubmit,\n initialValues = {},\n validate,\n className,\n ...props\n}: FormProps) => {\n const [values, setValues] = React.useState<Record<string, any>>(initialValues)\n const [errors, setErrors] = React.useState<Record<string, string>>({})\n const [touched, setTouched] = React.useState<Record<string, boolean>>({})\n\n const setFieldValue = React.useCallback((name: string, value: any) => {\n setValues(prev => ({ ...prev, [name]: value }))\n }, [])\n\n const setFieldTouched = React.useCallback((name: string, isTouched: boolean) => {\n setTouched(prev => ({ ...prev, [name]: isTouched }))\n }, [])\n\n const setFieldError = React.useCallback((name: string, error: string) => {\n setErrors(prev => ({ ...prev, [name]: error }))\n }, [])\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault()\n\n // Validate all fields\n const validationErrors = validate?.(values) ?? {}\n setErrors(validationErrors)\n\n // Mark all fields as touched\n const allTouched = Object.keys(values).reduce((acc, key) => {\n acc[key] = true\n return acc\n }, {} as Record<string, boolean>)\n setTouched(allTouched)\n\n // If no errors, submit\n if (Object.keys(validationErrors).length === 0) {\n try {\n await onSubmit(values)\n } catch (error) {\n console.error('Form submission error:', error)\n }\n }\n }\n\n const contextValue: FormContextValue = {\n errors,\n touched,\n values,\n setFieldValue,\n setFieldTouched,\n setFieldError,\n }\n\n return (\n <FormContext.Provider value={contextValue}>\n <form onSubmit={handleSubmit} className={clsx('space-y-4', className)} {...props}>\n {children}\n </form>\n </FormContext.Provider>\n )\n}\n\nForm.displayName = 'Form'\n\n// FormField Component\nexport interface FormFieldProps {\n name: string;\n label?: string;\n children: (props: {\n value: any;\n onChange: (value: any) => void;\n onBlur: () => void;\n error?: string;\n touched: boolean;\n }) => React.ReactNode;\n required?: boolean;\n className?: string;\n}\n\nexport const FormField = ({ name, label, children, required, className }: FormFieldProps) => {\n const { values, errors, touched, setFieldValue, setFieldTouched } = useFormContext()\n\n const value = values[name] ?? ''\n const error = touched[name] ? errors[name] : undefined\n const isTouched = touched[name] ?? false\n\n const handleChange = (newValue: any) => {\n setFieldValue(name, newValue)\n }\n\n const handleBlur = () => {\n setFieldTouched(name, true)\n }\n\n return (\n <div className={clsx('flex flex-col gap-1.5', className)}>\n {label && (\n <label htmlFor={name} className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"text-(--danger) ml-1\">*</span>}\n </label>\n )}\n {children({ value, onChange: handleChange, onBlur: handleBlur, error, touched: isTouched })}\n </div>\n )\n}\n\nFormField.displayName = 'FormField'\n\n// FormInput Component - Wrapper around Input\nexport interface FormInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'value' | 'onChange'> {\n name: string;\n label?: string;\n required?: boolean;\n fullWidth?: boolean;\n}\n\nexport const FormInput = React.forwardRef<HTMLInputElement, FormInputProps>(\n ({ name, label, required, fullWidth, className, ...props }, ref) => {\n const { values, errors, touched, setFieldValue, setFieldTouched } = useFormContext()\n\n const value = values[name] ?? ''\n const error = touched[name] ? errors[name] : undefined\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setFieldValue(name, e.target.value)\n }\n\n const handleBlur = () => {\n setFieldTouched(name, true)\n }\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full')}>\n {label && (\n <label htmlFor={name} className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"text-(--danger) ml-1\">*</span>}\n </label>\n )}\n <input\n ref={ref}\n id={name}\n name={name}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n className={clsx(\n 'appearance-none block w-full rounded-md border text-[15px] leading-[1.4] shadow-sm',\n 'px-3 py-2 bg-(--bg-primary) text-(--text-primary) placeholder-(--text-muted)',\n 'transition-[border-color,box-shadow,background-color] focus:outline-none',\n 'focus:border-(--accent)/70',\n 'disabled:bg-(--bg-primary) disabled:text-(--text-muted) disabled:cursor-not-allowed',\n error\n ? 'border-(--danger) focus:border-(--danger) focus:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n className,\n )}\n {...props}\n />\n {error && (\n <span className=\"text-[12px] font-medium text-(--danger) flex items-center gap-1 leading-tight\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n }\n)\n\nFormInput.displayName = 'FormInput'\n\n// FormTextarea Component\nexport interface FormTextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'name' | 'value' | 'onChange'> {\n name: string;\n label?: string;\n required?: boolean;\n fullWidth?: boolean;\n}\n\nexport const FormTextarea = React.forwardRef<HTMLTextAreaElement, FormTextareaProps>(\n ({ name, label, required, fullWidth, className, ...props }, ref) => {\n const { values, errors, touched, setFieldValue, setFieldTouched } = useFormContext()\n\n const value = values[name] ?? ''\n const error = touched[name] ? errors[name] : undefined\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setFieldValue(name, e.target.value)\n }\n\n const handleBlur = () => {\n setFieldTouched(name, true)\n }\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full')}>\n {label && (\n <label htmlFor={name} className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"text-(--danger) ml-1\">*</span>}\n </label>\n )}\n <textarea\n ref={ref}\n id={name}\n name={name}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n className={clsx(\n 'appearance-none block w-full rounded-md border text-[15px] leading-[1.4] shadow-sm',\n 'px-3 py-2 bg-(--bg-primary) text-(--text-primary) placeholder-(--text-muted)',\n 'transition-[border-color,box-shadow,background-color] focus:outline-none',\n 'focus:border-(--accent)/70',\n 'disabled:bg-(--bg-primary) disabled:text-(--text-muted) disabled:cursor-not-allowed',\n 'resize-y min-h-20',\n error\n ? 'border-(--danger) focus:border-(--danger) focus:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n className,\n )}\n {...props}\n />\n {error && (\n <span className=\"text-[12px] font-medium text-(--danger) flex items-center gap-1 leading-tight\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n }\n)\n\nFormTextarea.displayName = 'FormTextarea'\n\n// FormSelect Component\nexport interface FormSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'name' | 'value' | 'onChange'> {\n name: string;\n label?: string;\n required?: boolean;\n fullWidth?: boolean;\n options: Array<{ value: string; label: string }>;\n}\n\nexport const FormSelect = React.forwardRef<HTMLSelectElement, FormSelectProps>(\n ({ name, label, required, fullWidth, options, className, ...props }, ref) => {\n const { values, errors, touched, setFieldValue, setFieldTouched } = useFormContext()\n\n const value = values[name] ?? ''\n const error = touched[name] ? errors[name] : undefined\n\n const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {\n setFieldValue(name, e.target.value)\n }\n\n const handleBlur = () => {\n setFieldTouched(name, true)\n }\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full')}>\n {label && (\n <label htmlFor={name} className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"text-(--danger) ml-1\">*</span>}\n </label>\n )}\n <select\n ref={ref}\n id={name}\n name={name}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n className={clsx(\n 'appearance-none block w-full rounded-md border text-[15px] leading-[1.4] shadow-sm',\n 'px-3 py-2 bg-(--bg-primary) text-(--text-primary)',\n 'transition-[border-color,box-shadow,background-color] focus:outline-none',\n 'focus:border-(--accent)/70',\n 'disabled:bg-(--bg-primary) disabled:text-(--text-muted) disabled:cursor-not-allowed',\n 'cursor-pointer',\n error\n ? 'border-(--danger) focus:border-(--danger) focus:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n className,\n )}\n {...props}\n >\n <option value=\"\">Select an option</option>\n {options.map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n {error && (\n <span className=\"text-[12px] font-medium text-(--danger) flex items-center gap-1 leading-tight\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n }\n)\n\nFormSelect.displayName = 'FormSelect'\n\n// FormCheckbox Component\nexport interface FormCheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'type' | 'checked' | 'onChange'> {\n name: string;\n label: string;\n}\n\nexport const FormCheckbox = React.forwardRef<HTMLInputElement, FormCheckboxProps>(\n ({ name, label, className, ...props }, ref) => {\n const { values, setFieldValue } = useFormContext()\n\n const checked = values[name] ?? false\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setFieldValue(name, e.target.checked)\n }\n\n return (\n <div className=\"flex items-center gap-2\">\n <input\n ref={ref}\n id={name}\n name={name}\n type=\"checkbox\"\n checked={checked}\n onChange={handleChange}\n className={clsx(\n 'w-4 h-4 rounded border-(--border-light) bg-(--bg-primary)',\n 'text-(--slack-blue) focus:ring-2 focus:ring-(--slack-blue) focus:ring-offset-1',\n 'cursor-pointer transition-colors',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n <label\n htmlFor={name}\n className=\"text-[15px] text-(--text-primary) cursor-pointer select-none\"\n >\n {label}\n </label>\n </div>\n )\n }\n)\n\nFormCheckbox.displayName = 'FormCheckbox'\n\n// FormActions Component - For submit and cancel buttons\nexport interface FormActionsProps {\n children: React.ReactNode;\n className?: string;\n}\n\nexport const FormActions = ({ children, className }: FormActionsProps) => {\n return (\n <div className={clsx('flex items-center justify-end gap-3 pt-4', className)}>\n {children}\n </div>\n )\n}\n\nFormActions.displayName = 'FormActions'\n\n\n\n\n","import React from 'react'\nimport { Select as BaseSelect } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react'\n\nexport interface SelectOption {\n value: string\n label: string\n disabled?: boolean\n}\n\nexport interface SelectGroup {\n label: string\n options: SelectOption[]\n}\n\nexport interface SelectProps {\n /** Option items (flat list or grouped) */\n options?: SelectOption[]\n groups?: SelectGroup[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string | null) => void\n placeholder?: string\n disabled?: boolean\n required?: boolean\n /** Label shown above the trigger */\n label?: string\n /** Error message shown below the trigger */\n error?: string\n /** Full width */\n fullWidth?: boolean\n className?: string\n id?: string\n}\n\nconst itemClass = clsx(\n 'relative flex cursor-default select-none items-center rounded px-3 py-1.5 text-[14px] text-(--text-primary)',\n 'data-[highlighted]:bg-(--bg-hover) data-[highlighted]:outline-none',\n 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed',\n)\n\nexport const Select = React.forwardRef<HTMLButtonElement, SelectProps>(\n (\n {\n options,\n groups,\n value,\n defaultValue,\n onValueChange,\n placeholder = 'Select an option',\n disabled,\n required,\n label,\n error,\n fullWidth,\n className,\n id,\n },\n ref,\n ) => {\n const generatedId = React.useId()\n const triggerId = id ?? generatedId\n const isControlled = value !== undefined\n const [internalValue, setInternalValue] = React.useState<string | null>(defaultValue ?? null)\n\n const allOptions = React.useMemo(\n () => (groups ? groups.flatMap((group) => group.options) : options ?? []),\n [groups, options],\n )\n\n const selectedValue = isControlled ? value ?? null : internalValue\n const selectedLabel = React.useMemo(\n () => allOptions.find((opt) => opt.value === selectedValue)?.label,\n [allOptions, selectedValue],\n )\n\n const handleValueChange = React.useCallback(\n (nextValue: string | null) => {\n if (!isControlled) {\n setInternalValue(nextValue)\n }\n\n onValueChange?.(nextValue)\n },\n [isControlled, onValueChange],\n )\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full')}>\n {label && (\n <label\n htmlFor={triggerId}\n className=\"text-[14px] font-semibold text-(--text-primary)\"\n >\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </label>\n )}\n\n <BaseSelect.Root\n value={isControlled ? value : undefined}\n defaultValue={isControlled ? undefined : defaultValue}\n onValueChange={handleValueChange}\n disabled={disabled}\n required={required}\n >\n <BaseSelect.Trigger\n id={triggerId}\n ref={ref}\n className={clsx(\n 'inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border px-3 text-[14px]',\n 'bg-(--bg-primary) text-(--text-primary)',\n 'transition-[border-color,box-shadow] outline-none',\n 'focus:border-(--accent)/70',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n error\n ? 'border-(--danger) focus:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n className,\n )}\n >\n <BaseSelect.Value\n className=\"flex-1 text-left data-[placeholder]:text-(--text-muted)\"\n placeholder={placeholder}\n >\n {selectedLabel}\n </BaseSelect.Value>\n <BaseSelect.Icon className=\"shrink-0 text-(--text-muted)\">\n <ChevronDown size={14} />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n\n <BaseSelect.Portal>\n <BaseSelect.Positioner sideOffset={4} className=\"z-50\">\n <BaseSelect.ScrollUpArrow className=\"flex h-5 w-full cursor-default items-center justify-center rounded-t-md bg-(--bg-primary) text-(--text-muted)\">\n <ChevronUp size={12} />\n </BaseSelect.ScrollUpArrow>\n\n <BaseSelect.Popup\n className={clsx(\n 'min-w-[var(--anchor-width)] overflow-auto rounded-lg border border-(--border-light) bg-(--bg-primary)',\n 'py-1 shadow-lg',\n )}\n >\n {groups\n ? groups.map((group) => (\n <BaseSelect.Group key={group.label}>\n <BaseSelect.GroupLabel className=\"px-3 py-1 text-[12px] font-semibold text-(--text-muted) uppercase tracking-wider\">\n {group.label}\n </BaseSelect.GroupLabel>\n {group.options.map((opt) => (\n <SelectItem key={opt.value} value={opt.value} disabled={opt.disabled}>\n {opt.label}\n </SelectItem>\n ))}\n </BaseSelect.Group>\n ))\n : options?.map((opt) => (\n <SelectItem key={opt.value} value={opt.value} disabled={opt.disabled}>\n {opt.label}\n </SelectItem>\n ))}\n </BaseSelect.Popup>\n\n <BaseSelect.ScrollDownArrow className=\"flex h-5 w-full cursor-default items-center justify-center rounded-b-md bg-(--bg-primary) text-(--text-muted)\">\n <ChevronDown size={12} />\n </BaseSelect.ScrollDownArrow>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n </BaseSelect.Root>\n\n {error && (\n <span className=\"flex items-center gap-1 text-[12px] font-medium leading-tight text-(--danger)\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nSelect.displayName = 'Select'\n\n// Internal SelectItem helper\nfunction SelectItem({\n value,\n disabled,\n children,\n}: {\n value: string\n disabled?: boolean\n children: React.ReactNode\n}) {\n return (\n <BaseSelect.Item value={value} disabled={disabled} className={itemClass}>\n <BaseSelect.ItemIndicator className=\"absolute right-3 flex items-center text-(--accent)\">\n <Check size={14} />\n </BaseSelect.ItemIndicator>\n <BaseSelect.ItemText>{children}</BaseSelect.ItemText>\n </BaseSelect.Item>\n )\n}\n","import React from 'react'\nimport { Checkbox as BaseCheckbox } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { Check, Minus } from 'lucide-react'\n\nexport interface CheckboxProps {\n checked?: boolean\n defaultChecked?: boolean\n onCheckedChange?: (checked: boolean) => void\n indeterminate?: boolean\n disabled?: boolean\n required?: boolean\n /** Label text shown next to the checkbox */\n label?: string\n /** Helper text shown below the label */\n description?: string\n /** Error message */\n error?: string\n name?: string\n value?: string\n id?: string\n className?: string\n}\n\nexport const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxProps>(\n (\n {\n checked,\n defaultChecked,\n onCheckedChange,\n indeterminate,\n disabled,\n required,\n label,\n description,\n error,\n name,\n value,\n id,\n className,\n },\n ref,\n ) => {\n const generatedId = React.useId()\n const checkboxId = id ?? generatedId\n\n const rootEl = (\n <BaseCheckbox.Root\n ref={ref}\n id={checkboxId}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange}\n indeterminate={indeterminate}\n disabled={disabled}\n required={required}\n name={name}\n value={value}\n className={clsx(\n 'relative flex h-4 w-4 shrink-0 items-center justify-center rounded',\n 'border-2 border-(--border-gray) bg-(--bg-primary)',\n 'transition-[background-color,border-color] outline-none',\n 'focus-visible:ring-2 focus-visible:ring-(--focus-ring) focus-visible:ring-offset-1',\n 'data-[checked]:border-(--accent) data-[checked]:bg-(--accent)',\n 'data-[indeterminate]:border-(--accent) data-[indeterminate]:bg-(--accent)',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n error && 'border-(--danger)',\n className,\n )}\n >\n <BaseCheckbox.Indicator className=\"flex items-center justify-center text-white\">\n {indeterminate ? <Minus size={10} strokeWidth={3} /> : <Check size={10} strokeWidth={3} />}\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n )\n\n if (!label) return rootEl\n\n return (\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-start gap-2\">\n {rootEl}\n <div className=\"flex flex-col\">\n <label\n htmlFor={checkboxId}\n className={clsx(\n 'text-[14px] leading-none text-(--text-primary) select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </label>\n {description && (\n <span className=\"mt-0.5 text-[12px] text-(--text-muted)\">{description}</span>\n )}\n </div>\n </div>\n {error && (\n <span className=\"flex items-center gap-1 text-[12px] font-medium leading-tight text-(--danger)\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nCheckbox.displayName = 'Checkbox'\n","import React from 'react'\nimport { Radio as BaseRadio, RadioGroup as BaseRadioGroup } from '@base-ui/react'\nimport clsx from 'clsx'\n\n// ── RadioGroup ────────────────────────────────────────────────────────────────\n\nexport interface RadioGroupProps {\n children: React.ReactNode\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n disabled?: boolean\n required?: boolean\n /** Group label shown above the radios */\n label?: string\n /** Error message */\n error?: string\n /** Arrange items horizontally instead of vertically */\n orientation?: 'horizontal' | 'vertical'\n className?: string\n}\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n children,\n value,\n defaultValue,\n onValueChange,\n disabled,\n required,\n label,\n error,\n orientation = 'vertical',\n className,\n },\n ref,\n ) => {\n return (\n <div className={clsx('flex flex-col gap-1.5', className)}>\n {label && (\n <span className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </span>\n )}\n\n <BaseRadioGroup\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n disabled={disabled}\n required={required}\n className={clsx(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap',\n )}\n >\n {children}\n </BaseRadioGroup>\n\n {error && (\n <span className=\"flex items-center gap-1 text-[12px] font-medium leading-tight text-(--danger)\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nRadioGroup.displayName = 'RadioGroup'\n\n// ── Radio ─────────────────────────────────────────────────────────────────────\n\nexport interface RadioProps {\n value: string\n disabled?: boolean\n /** Label text shown next to the radio */\n label?: string\n /** Helper text shown below the label */\n description?: string\n id?: string\n className?: string\n}\n\nexport const Radio = React.forwardRef<HTMLButtonElement, RadioProps>(\n ({ value, disabled, label, description, id, className }, ref) => {\n const generatedId = React.useId()\n const radioId = id ?? generatedId\n\n const radioEl = (\n <BaseRadio.Root\n ref={ref}\n id={radioId}\n value={value}\n disabled={disabled}\n className={clsx(\n 'relative flex h-4 w-4 shrink-0 items-center justify-center rounded-full',\n 'border-2 border-(--border-gray) bg-(--bg-primary)',\n 'transition-[background-color,border-color] outline-none',\n 'focus-visible:ring-2 focus-visible:ring-(--focus-ring) focus-visible:ring-offset-1',\n 'data-[checked]:border-(--accent)',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n >\n <BaseRadio.Indicator className=\"h-2 w-2 rounded-full bg-(--accent) data-[unchecked]:hidden\" />\n </BaseRadio.Root>\n )\n\n if (!label) return radioEl\n\n return (\n <div className=\"flex items-start gap-2\">\n {radioEl}\n <div className=\"flex flex-col\">\n <label\n htmlFor={radioId}\n className={clsx(\n 'text-[14px] leading-none text-(--text-primary) select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n </label>\n {description && (\n <span className=\"mt-0.5 text-[12px] text-(--text-muted)\">{description}</span>\n )}\n </div>\n </div>\n )\n },\n)\n\nRadio.displayName = 'Radio'\n","import React from 'react'\nimport { Switch as BaseSwitch } from '@base-ui/react'\nimport clsx from 'clsx'\n\nexport type SwitchSize = 'sm' | 'md' | 'lg'\n\nexport interface SwitchProps {\n checked?: boolean\n defaultChecked?: boolean\n onCheckedChange?: (checked: boolean) => void\n disabled?: boolean\n required?: boolean\n size?: SwitchSize\n /** Label text shown next to the switch */\n label?: string\n /** Helper text shown below the label */\n description?: string\n name?: string\n value?: string\n id?: string\n className?: string\n}\n\nconst rootSizes: Record<SwitchSize, string> = {\n sm: 'h-4 w-7',\n md: 'h-5 w-9',\n lg: 'h-6 w-11',\n}\n\nconst thumbSizes: Record<SwitchSize, string> = {\n sm: 'h-3 w-3 data-[checked]:translate-x-3',\n md: 'h-3.5 w-3.5 data-[checked]:translate-x-4',\n lg: 'h-4.5 w-4.5 data-[checked]:translate-x-5',\n}\n\nexport const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(\n (\n {\n checked,\n defaultChecked,\n onCheckedChange,\n disabled,\n required,\n size = 'md',\n label,\n description,\n name,\n value,\n id,\n className,\n },\n ref,\n ) => {\n const generatedId = React.useId()\n const switchId = id ?? generatedId\n\n const switchEl = (\n <BaseSwitch.Root\n ref={ref}\n id={switchId}\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange}\n disabled={disabled}\n required={required}\n name={name}\n value={value}\n className={clsx(\n 'relative inline-flex shrink-0 cursor-pointer items-center rounded-full p-0.5',\n 'border-2 border-transparent outline-none',\n 'transition-colors duration-200',\n 'bg-(--border-gray)',\n 'data-[checked]:bg-(--accent)',\n 'focus-visible:ring-2 focus-visible:ring-(--focus-ring) focus-visible:ring-offset-1',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n rootSizes[size],\n className,\n )}\n >\n <BaseSwitch.Thumb\n className={clsx(\n 'block rounded-full bg-white shadow-sm',\n 'transition-transform duration-200',\n 'translate-x-0',\n thumbSizes[size],\n )}\n />\n </BaseSwitch.Root>\n )\n\n if (!label) return switchEl\n\n return (\n <div className=\"flex items-start gap-3\">\n {switchEl}\n <div className=\"flex flex-col\">\n <label\n htmlFor={switchId}\n className={clsx(\n 'text-[14px] leading-none text-(--text-primary) select-none',\n disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </label>\n {description && (\n <span className=\"mt-0.5 text-[12px] text-(--text-muted)\">{description}</span>\n )}\n </div>\n </div>\n )\n },\n)\n\nSwitch.displayName = 'Switch'\n","import React from 'react'\nimport { Tabs as BaseTabs } from '@base-ui/react'\nimport clsx from 'clsx'\n\n// ── Tabs Root ─────────────────────────────────────────────────────────────────\n\nexport interface TabsProps {\n children: React.ReactNode\n value?: string | number\n defaultValue?: string | number\n onValueChange?: (value: string | number) => void\n orientation?: 'horizontal' | 'vertical'\n className?: string\n}\n\nexport const Tabs = React.forwardRef<HTMLDivElement, TabsProps>(\n ({ children, value, defaultValue, onValueChange, orientation = 'horizontal', className }, ref) => {\n return (\n <BaseTabs.Root\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onValueChange}\n orientation={orientation}\n className={clsx(\n 'flex',\n orientation === 'horizontal' ? 'flex-col' : 'flex-row gap-4',\n className,\n )}\n >\n {children}\n </BaseTabs.Root>\n )\n },\n)\n\nTabs.displayName = 'Tabs'\n\n// ── TabList ───────────────────────────────────────────────────────────────────\n\nexport interface TabListProps {\n children: React.ReactNode\n className?: string\n}\n\nexport const TabList = React.forwardRef<HTMLDivElement, TabListProps>(\n ({ children, className }, ref) => {\n return (\n <BaseTabs.List\n ref={ref}\n className={clsx(\n 'relative flex border-b border-(--border-light)',\n className,\n )}\n >\n {children}\n <BaseTabs.Indicator\n className={clsx(\n 'absolute bottom-0 left-0 h-0.5 bg-(--accent)',\n 'transition-[left,width] duration-200 ease-out',\n )}\n />\n </BaseTabs.List>\n )\n },\n)\n\nTabList.displayName = 'TabList'\n\n// ── Tab ───────────────────────────────────────────────────────────────────────\n\nexport interface TabProps {\n children: React.ReactNode\n value: string | number\n disabled?: boolean\n className?: string\n}\n\nexport const Tab = React.forwardRef<HTMLButtonElement, TabProps>(\n ({ children, value, disabled, className }, ref) => {\n return (\n <BaseTabs.Tab\n ref={ref}\n value={value}\n disabled={disabled}\n className={clsx(\n 'relative px-4 py-2.5 text-[14px] font-medium outline-none',\n 'text-(--text-secondary) transition-colors',\n 'hover:text-(--text-primary)',\n 'data-[selected]:text-(--accent)',\n 'focus-visible:ring-2 focus-visible:ring-(--focus-ring) focus-visible:ring-inset',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n >\n {children}\n </BaseTabs.Tab>\n )\n },\n)\n\nTab.displayName = 'Tab'\n\n// ── TabPanel ──────────────────────────────────────────────────────────────────\n\nexport interface TabPanelProps {\n children: React.ReactNode\n value: string | number\n keepMounted?: boolean\n className?: string\n}\n\nexport const TabPanel = React.forwardRef<HTMLDivElement, TabPanelProps>(\n ({ children, value, keepMounted = false, className }, ref) => {\n return (\n <BaseTabs.Panel\n ref={ref}\n value={value}\n keepMounted={keepMounted}\n className={clsx('pt-4 outline-none', className)}\n >\n {children}\n </BaseTabs.Panel>\n )\n },\n)\n\nTabPanel.displayName = 'TabPanel'\n","import React from 'react'\nimport { Progress as BaseProgress } from '@base-ui/react'\nimport clsx from 'clsx'\n\nexport type ProgressVariant = 'default' | 'success' | 'warning' | 'danger'\nexport type ProgressSize = 'sm' | 'md' | 'lg'\n\nexport interface ProgressProps {\n /** Current value (0–max). Omit for indeterminate state. */\n value?: number\n /** Maximum value. Defaults to 100. */\n max?: number\n variant?: ProgressVariant\n size?: ProgressSize\n /** Label shown above the bar */\n label?: string\n /** Show percentage text on the right */\n showValue?: boolean\n className?: string\n}\n\nconst variantColor: Record<ProgressVariant, string> = {\n default: 'bg-(--accent)',\n success: 'bg-(--slack-green)',\n warning: 'bg-amber-400',\n danger: 'bg-(--danger)',\n}\n\nconst trackSizes: Record<ProgressSize, string> = {\n sm: 'h-1',\n md: 'h-2',\n lg: 'h-3',\n}\n\nexport const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(\n (\n {\n value,\n max = 100,\n variant = 'default',\n size = 'md',\n label,\n showValue,\n className,\n },\n ref,\n ) => {\n return (\n <div className={clsx('flex flex-col gap-1.5', className)}>\n {(label || showValue) && (\n <div className=\"flex items-center justify-between gap-2\">\n {label && (\n <span className=\"text-[13px] font-medium text-(--text-secondary)\">{label}</span>\n )}\n {showValue && value !== undefined && (\n <span className=\"text-[12px] text-(--text-muted)\">\n {Math.round((value / max) * 100)}%\n </span>\n )}\n </div>\n )}\n\n <BaseProgress.Root\n ref={ref}\n value={value ?? null}\n max={max}\n className={clsx(\n 'w-full overflow-hidden rounded-full bg-(--bg-hover)',\n trackSizes[size],\n )}\n >\n <BaseProgress.Track className=\"relative h-full w-full\">\n <BaseProgress.Indicator\n className={clsx(\n 'h-full rounded-full transition-[width] duration-300 ease-out',\n variantColor[variant],\n // Indeterminate animation when value is null\n value === undefined &&\n 'w-1/3 animate-[progress-indeterminate_1.5s_ease-in-out_infinite]',\n )}\n />\n </BaseProgress.Track>\n </BaseProgress.Root>\n </div>\n )\n },\n)\n\nProgress.displayName = 'Progress'\n","import React, { createContext, useContext, useState } from 'react'\nimport { Toast as BaseToast } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { X, Info, CheckCircle, AlertTriangle, XCircle } from 'lucide-react'\n\n// ── Types ─────────────────────────────────────────────────────────────────────\n\nexport type ToastType = 'default' | 'info' | 'success' | 'warning' | 'error'\n\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right'\n\n// ── Position context ──────────────────────────────────────────────────────────\n\ninterface ToastPositionState {\n position: ToastPosition\n setPosition: (p: ToastPosition) => void\n}\n\nconst ToastPositionContext = createContext<ToastPositionState>({\n position: 'bottom-right',\n setPosition: () => {},\n})\n\nconst positionClasses: Record<ToastPosition, string> = {\n 'top-left': 'top-4 left-4 flex-col',\n 'top-center': 'top-4 left-1/2 -translate-x-1/2 flex-col',\n 'top-right': 'top-4 right-4 flex-col',\n 'bottom-left': 'bottom-4 left-4 flex-col-reverse',\n 'bottom-center':'bottom-4 left-1/2 -translate-x-1/2 flex-col-reverse',\n 'bottom-right': 'bottom-4 right-4 flex-col-reverse',\n}\n\n// ── ToastProvider ─────────────────────────────────────────────────────────────\n\nexport interface ToastProviderProps {\n children: React.ReactNode\n timeout?: number\n limit?: number\n /** Where toasts appear on screen. Defaults to `'bottom-right'`. */\n position?: ToastPosition\n}\n\n/**\n * Wrap your app (or part of it) with `ToastProvider` to enable toasts.\n * Then use the `useToast()` hook inside to add toasts.\n *\n * @example\n * // Positon can be set at provider level:\n * <ToastProvider position=\"top-center\">...</ToastProvider>\n *\n * // Or changed at runtime via the hook:\n * const { setPosition } = useToast()\n * setPosition('top-right')\n */\nexport const ToastProvider: React.FC<ToastProviderProps> = ({\n children,\n timeout = 5000,\n limit = 5,\n position: defaultPosition = 'bottom-right',\n}) => {\n const [position, setPosition] = useState<ToastPosition>(defaultPosition)\n\n return (\n <BaseToast.Provider timeout={timeout} limit={limit}>\n <ToastPositionContext.Provider value={{ position, setPosition }}>\n {children}\n <ToastViewport />\n </ToastPositionContext.Provider>\n </BaseToast.Provider>\n )\n}\n\n// ── useToast hook ─────────────────────────────────────────────────────────────\n\nexport interface ToastOptions {\n title?: React.ReactNode\n description?: React.ReactNode\n type?: ToastType\n timeout?: number\n /** Action button rendered inside the toast */\n action?: {\n label: string\n onClick: () => void\n }\n}\n\n/**\n * Hook to imperatively add, close and update toasts.\n * Also exposes `position` / `setPosition` for runtime position changes.\n *\n * Must be used inside `<ToastProvider>`.\n */\nexport function useToast() {\n const manager = BaseToast.useToastManager()\n const { position, setPosition } = useContext(ToastPositionContext)\n\n return {\n toast: (options: ToastOptions) =>\n manager.add({\n title: options.title,\n description: options.description,\n type: options.type ?? 'default',\n timeout: options.timeout,\n actionProps: options.action\n ? { children: options.action.label, onClick: options.action.onClick }\n : undefined,\n }),\n dismiss: manager.close,\n /** Current toast position */\n position,\n /** Dynamically change where toasts appear */\n setPosition,\n }\n}\n\n// ── ToastViewport (internal) ──────────────────────────────────────────────────\n\nfunction ToastViewport() {\n const { toasts } = BaseToast.useToastManager()\n const { position } = useContext(ToastPositionContext)\n\n return (\n <BaseToast.Viewport\n className={clsx(\n 'fixed z-[100] flex w-80 gap-2 outline-none',\n positionClasses[position],\n )}\n >\n {toasts.map((toast) => (\n <ToastItem key={toast.id} toast={toast} />\n ))}\n </BaseToast.Viewport>\n )\n}\n\n// ── ToastItem (internal) ──────────────────────────────────────────────────────\n\n/**\n * Per-type config — icon colors adapt to theme via dark: modifier.\n * Accent strip colors stay the same in both modes.\n */\nconst typeConfig: Record<\n ToastType,\n {\n icon: React.ReactNode\n titleClass: string\n surfaceClass: string\n actionClass: string\n closeClass: string\n }\n> = {\n default: {\n icon: null,\n titleClass: 'text-(--text-primary) dark:text-white',\n surfaceClass: 'bg-(--bg-primary) border-(--border-light) dark:bg-[#2c2f33] dark:border-transparent',\n actionClass: 'text-(--accent) hover:underline dark:text-white/85 dark:hover:text-white',\n closeClass: 'text-(--text-muted) hover:bg-(--bg-hover) hover:text-(--text-primary) dark:text-white/40 dark:hover:bg-white/10 dark:hover:text-white',\n },\n info: {\n icon: <Info size={14} className=\"text-[#1164A3] dark:text-[#5ba4cf]\" />,\n titleClass: 'text-[#1164A3] dark:text-[#5ba4cf]',\n surfaceClass: 'bg-[#F6FAFE] border-[#E3EFF9] dark:bg-[#102633] dark:border-[#1A4256]',\n actionClass: 'text-[#0F5A94] hover:underline hover:text-[#0B4673] dark:text-[#7AB7DE] dark:hover:text-[#A7D1EC]',\n closeClass: 'text-[#7C9BB4] hover:bg-[#E8F2FB] hover:text-[#1164A3] dark:text-[#8AA7BD] dark:hover:bg-[#173547] dark:hover:text-[#7AB7DE]',\n },\n success: {\n icon: <CheckCircle size={14} className=\"text-[#007a5a] dark:text-[#39c088]\" />,\n titleClass: 'text-[#007a5a] dark:text-[#39c088]',\n surfaceClass: 'bg-[#F4FBF7] border-[#DFF1E8] dark:bg-[#102A20] dark:border-[#1A4B39]',\n actionClass: 'text-[#0A6B51] hover:underline hover:text-[#08533F] dark:text-[#6FD4A3] dark:hover:text-[#96E6BB]',\n closeClass: 'text-[#7A9E91] hover:bg-[#E7F6EE] hover:text-[#007A5A] dark:text-[#89A99E] dark:hover:bg-[#18372C] dark:hover:text-[#6FD4A3]',\n },\n warning: {\n icon: <AlertTriangle size={14} className=\"text-amber-500 dark:text-amber-400\" />,\n titleClass: 'text-amber-500 dark:text-amber-400',\n surfaceClass: 'bg-[#FFFBF0] border-[#F7E9BF] dark:bg-[#3A2A09] dark:border-[#5C4514]',\n actionClass: 'text-[#B26A00] hover:underline hover:text-[#8B5300] dark:text-[#F0C46B] dark:hover:text-[#F5D697]',\n closeClass: 'text-[#AA9B73] hover:bg-[#FFF3D6] hover:text-[#B26A00] dark:text-[#A99668] dark:hover:bg-[#4B3810] dark:hover:text-[#F0C46B]',\n },\n error: {\n icon: <XCircle size={14} className=\"text-[#E01E5A] dark:text-[#e06082]\" />,\n titleClass: 'text-[#E01E5A] dark:text-[#e06082]',\n surfaceClass: 'bg-[#FEF6F8] border-[#F8E2E8] dark:bg-[#3A1822] dark:border-[#5E2735]',\n actionClass: 'text-[#C61B50] hover:underline hover:text-[#9E153F] dark:text-[#F08CA8] dark:hover:text-[#F5B0C2]',\n closeClass: 'text-[#B0929C] hover:bg-[#FBE8EE] hover:text-[#E01E5A] dark:text-[#A88E96] dark:hover:bg-[#4A1F2C] dark:hover:text-[#F08CA8]',\n },\n}\n\nfunction ToastItem({ toast }: { toast: BaseToast.Root.ToastObject }) {\n const type = (toast.type ?? 'default') as ToastType\n const config = typeConfig[type] ?? typeConfig.default\n\n return (\n <BaseToast.Root\n toast={toast}\n swipeDirection={[]}\n className={clsx(\n 'group relative flex w-full items-start gap-2.5 overflow-hidden',\n 'rounded-lg pl-3 pr-3 pt-3 pb-3',\n 'border border-(--border-light)',\n 'shadow-[0_2px_16px_rgba(0,0,0,0.08),0_1px_4px_rgba(0,0,0,0.05)]',\n 'dark:shadow-[0_4px_24px_rgba(0,0,0,0.45)]',\n 'data-[starting]:animate-[toast-slide-in_240ms_cubic-bezier(0.16,1,0.3,1)]',\n 'data-[ending]:animate-[toast-slide-out_180ms_ease-in_forwards]',\n config.surfaceClass,\n )}\n >\n {/* ── Icon ─────────────────────────────────────────── */}\n {config.icon && (\n <div className=\"flex h-5 shrink-0 items-center\">{config.icon}</div>\n )}\n\n {/* ── Content ──────────────────────────────────────── */}\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n {toast.title && (\n <BaseToast.Title\n className={clsx('text-[14px] font-semibold leading-snug', config.titleClass)}\n >\n {toast.title}\n </BaseToast.Title>\n )}\n {toast.description && (\n <BaseToast.Description\n className=\"text-[13px] leading-snug text-(--text-secondary) dark:text-white/65\"\n >\n {toast.description}\n </BaseToast.Description>\n )}\n {toast.actionProps && (\n <button\n {...toast.actionProps}\n className={clsx(\n 'mt-1.5 self-start rounded text-[13px] font-semibold outline-none transition-colors',\n config.actionClass,\n 'focus-visible:ring-1 focus-visible:ring-(--focus-ring) dark:focus-visible:ring-white/50',\n )}\n />\n )}\n </div>\n\n {/* ── Close button ─────────────────────────────────── */}\n <BaseToast.Close\n className={clsx(\n 'ml-0.5 shrink-0 rounded p-1 outline-none transition-colors',\n config.closeClass,\n 'focus-visible:ring-1 focus-visible:ring-(--focus-ring) dark:focus-visible:ring-white/50',\n )}\n >\n <X size={13} />\n </BaseToast.Close>\n </BaseToast.Root>\n )\n}\n","import React from 'react'\nimport clsx from 'clsx'\n\nexport type LoadingVariant = 'spinner' | 'dots' | 'bar'\nexport type LoadingSize = 'sm' | 'md' | 'lg'\n\nexport interface LoadingProps {\n variant?: LoadingVariant\n size?: LoadingSize\n /** Optional label shown next to the indicator */\n label?: string\n /** Center within its container */\n centered?: boolean\n className?: string\n /** Override color via Tailwind / CSS class */\n color?: string\n}\n\nconst spinnerSize: Record<LoadingSize, string> = {\n sm: 'w-4 h-4 border-2',\n md: 'w-6 h-6 border-2',\n lg: 'w-9 h-9 border-[3px]',\n}\n\nconst dotSize: Record<LoadingSize, string> = {\n sm: 'w-1.5 h-1.5',\n md: 'w-2.5 h-2.5',\n lg: 'w-3.5 h-3.5',\n}\n\nconst labelSize: Record<LoadingSize, string> = {\n sm: 'text-[12px]',\n md: 'text-[14px]',\n lg: 'text-[16px]',\n}\n\nconst barHeight: Record<LoadingSize, string> = {\n sm: 'h-0.5',\n md: 'h-1',\n lg: 'h-1.5',\n}\n\n// Spinner variant ─────────────────────────────────────────────────────────────\nconst Spinner: React.FC<{ size: LoadingSize; color?: string }> = ({ size, color }) => (\n <span\n role=\"status\"\n aria-label=\"Loading\"\n className={clsx(\n 'inline-block rounded-full animate-spin',\n 'border-current border-t-transparent',\n spinnerSize[size],\n color ?? 'text-(--accent)',\n )}\n />\n)\n\n// Dots variant ────────────────────────────────────────────────────────────────\nconst Dots: React.FC<{ size: LoadingSize; color?: string }> = ({ size, color }) => (\n <span role=\"status\" aria-label=\"Loading\" className=\"inline-flex items-center gap-1\">\n {[0, 1, 2].map((i) => (\n <span\n key={i}\n className={clsx(\n 'inline-block rounded-full animate-bounce',\n dotSize[size],\n color ?? 'bg-(--accent)',\n )}\n style={{ animationDelay: `${i * 0.15}s` }}\n />\n ))}\n </span>\n)\n\n// Bar variant ─────────────────────────────────────────────────────────────────\nconst Bar: React.FC<{ size: LoadingSize; color?: string }> = ({ size, color }) => (\n <span\n role=\"status\"\n aria-label=\"Loading\"\n className={clsx('relative block w-full overflow-hidden rounded-full bg-(--bg-hover)', barHeight[size])}\n >\n <span\n className={clsx(\n 'absolute inset-y-0 w-1/3 rounded-full',\n 'animate-[loading-bar_1.4s_ease-in-out_infinite]',\n color ?? 'bg-(--accent)',\n )}\n />\n </span>\n)\n\n// Main component ──────────────────────────────────────────────────────────────\nexport const Loading = React.forwardRef<HTMLDivElement, LoadingProps>(\n ({ variant = 'spinner', size = 'md', label, centered, className, color }, ref) => {\n const indicator =\n variant === 'dots' ? (\n <Dots size={size} color={color} />\n ) : variant === 'bar' ? (\n <Bar size={size} color={color} />\n ) : (\n <Spinner size={size} color={color} />\n )\n\n return (\n <div\n ref={ref}\n className={clsx(\n 'inline-flex items-center gap-2',\n centered && 'w-full justify-center',\n variant === 'bar' && 'w-full flex-col items-stretch gap-1.5',\n className,\n )}\n >\n {indicator}\n {label && (\n <span className={clsx('text-(--text-secondary)', labelSize[size])}>{label}</span>\n )}\n </div>\n )\n },\n)\n\nLoading.displayName = 'Loading'\n\n","import React from 'react'\nimport clsx from 'clsx'\nimport { ChevronDown, X, Check } from 'lucide-react'\n\nexport interface AutoCompleteOption {\n value: string\n label: string\n disabled?: boolean\n}\n\nexport interface AutoCompleteProps {\n options: AutoCompleteOption[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n /** Called when the raw input text changes */\n onInputChange?: (input: string) => void\n placeholder?: string\n disabled?: boolean\n required?: boolean\n /** Label shown above the input */\n label?: string\n /** Error message shown below the input */\n error?: string\n fullWidth?: boolean\n /** Show a clear button when a value is selected */\n clearable?: boolean\n /** Maximum dropdown height (Tailwind class) */\n maxHeight?: string\n /** No-results message */\n emptyMessage?: string\n className?: string\n id?: string\n}\n\nexport const AutoComplete = React.forwardRef<HTMLInputElement, AutoCompleteProps>(\n (\n {\n options,\n value: controlledValue,\n defaultValue = '',\n onValueChange,\n onInputChange,\n placeholder = 'Search…',\n disabled,\n required,\n label,\n error,\n fullWidth,\n clearable = true,\n maxHeight = 'max-h-60',\n emptyMessage = 'No results found',\n className,\n id,\n },\n ref,\n ) => {\n const generatedId = React.useId()\n const inputId = id ?? generatedId\n const listboxId = `${inputId}-listbox`\n\n // ── state ──────────────────────────────────────────────────────────────\n const isControlled = controlledValue !== undefined\n const [internalValue, setInternalValue] = React.useState<string>(defaultValue)\n const selectedValue = isControlled ? controlledValue : internalValue\n\n const [inputText, setInputText] = React.useState<string>(() => {\n const found = options.find((o) => o.value === (isControlled ? controlledValue : defaultValue))\n return found ? found.label : (isControlled ? controlledValue ?? '' : defaultValue)\n })\n const [open, setOpen] = React.useState(false)\n const [activeIndex, setActiveIndex] = React.useState<number>(-1)\n\n const containerRef = React.useRef<HTMLDivElement>(null)\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n // sync external label when controlled value changes\n React.useEffect(() => {\n if (isControlled) {\n const found = options.find((o) => o.value === controlledValue)\n setInputText(found ? found.label : controlledValue ?? '')\n }\n }, [controlledValue, isControlled, options])\n\n // ── filtered list ──────────────────────────────────────────────────────\n const filtered = React.useMemo(() => {\n const q = inputText.toLowerCase()\n return options.filter((o) => o.label.toLowerCase().includes(q))\n }, [options, inputText])\n\n // ── helpers ────────────────────────────────────────────────────────────\n const selectOption = (option: AutoCompleteOption) => {\n if (option.disabled) return\n setInputText(option.label)\n if (!isControlled) setInternalValue(option.value)\n onValueChange?.(option.value)\n setOpen(false)\n setActiveIndex(-1)\n }\n\n const clearSelection = (e: React.MouseEvent) => {\n e.stopPropagation()\n setInputText('')\n if (!isControlled) setInternalValue('')\n onValueChange?.('')\n onInputChange?.('')\n setOpen(false)\n inputRef.current?.focus()\n }\n\n // ── event handlers ─────────────────────────────────────────────────────\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const v = e.target.value\n setInputText(v)\n onInputChange?.(v)\n if (!isControlled) setInternalValue('')\n onValueChange?.('')\n setOpen(true)\n setActiveIndex(-1)\n }\n\n const handleInputFocus = () => {\n setOpen(true)\n }\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n const enabledItems = filtered.filter((o) => !o.disabled)\n switch (e.key) {\n case 'ArrowDown':\n e.preventDefault()\n setOpen(true)\n setActiveIndex((i) => Math.min(i + 1, enabledItems.length - 1))\n break\n case 'ArrowUp':\n e.preventDefault()\n setActiveIndex((i) => Math.max(i - 1, 0))\n break\n case 'Enter':\n e.preventDefault()\n if (open && activeIndex >= 0 && enabledItems[activeIndex]) {\n selectOption(enabledItems[activeIndex])\n }\n break\n case 'Escape':\n setOpen(false)\n setActiveIndex(-1)\n break\n case 'Tab':\n setOpen(false)\n break\n }\n }\n\n // close on outside click\n React.useEffect(() => {\n const onPointerDown = (e: PointerEvent) => {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false)\n // restore label if user blurs with partial text\n const matched = options.find((o) => o.value === selectedValue)\n if (matched) setInputText(matched.label)\n }\n }\n document.addEventListener('pointerdown', onPointerDown)\n return () => document.removeEventListener('pointerdown', onPointerDown)\n }, [options, selectedValue])\n\n const showClear = clearable && (inputText || selectedValue)\n\n return (\n <div\n ref={containerRef}\n className={clsx('relative flex flex-col gap-1.5', fullWidth && 'w-full', className)}\n >\n {/* Label */}\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-[14px] font-semibold text-(--text-primary)\"\n >\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </label>\n )}\n\n {/* Input row */}\n <div className=\"relative\">\n <input\n ref={(node) => {\n // forward ref + internal ref\n ;(inputRef as React.MutableRefObject<HTMLInputElement | null>).current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) (ref as React.MutableRefObject<HTMLInputElement | null>).current = node\n }}\n id={inputId}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-activedescendant={\n activeIndex >= 0 ? `${inputId}-option-${activeIndex}` : undefined\n }\n autoComplete=\"off\"\n disabled={disabled}\n required={required}\n placeholder={placeholder}\n value={inputText}\n onChange={handleInputChange}\n onFocus={handleInputFocus}\n onKeyDown={handleKeyDown}\n className={clsx(\n 'appearance-none block w-full rounded-md border text-[15px] leading-[1.4] shadow-sm',\n 'px-3 py-2 pr-9 bg-(--bg-primary) text-(--text-primary) placeholder-(--text-muted)',\n 'transition-[border-color,box-shadow,background-color] focus:outline-none',\n 'focus:border-(--accent)/70',\n 'disabled:bg-(--bg-primary) disabled:text-(--text-muted) disabled:cursor-not-allowed',\n error\n ? 'border-(--danger) focus:border-(--danger) focus:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n )}\n />\n\n {/* Trailing icons */}\n <span className=\"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2.5 gap-0.5\">\n {showClear && (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label=\"Clear\"\n onClick={clearSelection}\n className={clsx(\n 'pointer-events-auto p-0.5 rounded text-(--text-muted) hover:text-(--text-primary)',\n 'transition-colors',\n )}\n >\n <X size={14} />\n </button>\n )}\n <ChevronDown\n size={16}\n className={clsx(\n 'text-(--text-muted) transition-transform duration-150',\n open && 'rotate-180',\n )}\n />\n </span>\n </div>\n\n {/* Dropdown */}\n {open && (\n <div\n id={listboxId}\n role=\"listbox\"\n className={clsx(\n 'absolute left-0 right-0 z-50 mt-1 overflow-y-auto',\n 'rounded-md border border-(--border-light) bg-(--bg-primary) shadow-lg',\n 'py-1',\n maxHeight,\n label ? 'top-[calc(100%+2px)]' : 'top-[calc(100%+2px)]',\n )}\n style={{ top: label ? 'calc(1.5rem + 0.375rem + 2.25rem + 2px)' : 'calc(2.25rem + 2px)' }}\n >\n {filtered.length === 0 ? (\n <div className=\"px-3 py-2 text-[13px] text-(--text-muted)\">{emptyMessage}</div>\n ) : (\n filtered.map((option, index) => {\n const isSelected = option.value === selectedValue\n const isActive = index === activeIndex\n return (\n <div\n key={option.value}\n id={`${inputId}-option-${index}`}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled}\n onPointerDown={(e) => {\n e.preventDefault()\n selectOption(option)\n }}\n className={clsx(\n 'relative flex cursor-default select-none items-center px-3 py-1.5 text-[14px] rounded mx-1',\n 'transition-colors',\n isActive && 'bg-(--bg-hover) outline-none',\n isSelected && !isActive && 'bg-(--bg-hover)/60 font-medium',\n option.disabled && 'opacity-50 cursor-not-allowed',\n )}\n >\n <span className=\"flex-1\">{option.label}</span>\n {isSelected && (\n <Check size={14} className=\"ml-2 text-(--accent) shrink-0\" />\n )}\n </div>\n )\n })\n )}\n </div>\n )}\n\n {/* Error */}\n {error && (\n <span className=\"text-[12px] font-medium text-(--danger) flex items-center gap-1 leading-tight\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nAutoComplete.displayName = 'AutoComplete'\n\n","import React from 'react'\nimport { Combobox as BaseCombobox } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { Check, ChevronDown, X } from 'lucide-react'\n\n// ── Types ──────────────────────────────────────────────────────────────\n\nexport interface ComboboxOption {\n value: string\n label: string\n disabled?: boolean\n}\n\nexport interface ComboboxGroup {\n label: string\n options: ComboboxOption[]\n}\n\nexport interface ComboboxProps {\n /** Flat option list */\n options?: ComboboxOption[]\n /** Grouped option list (mutually exclusive with `options`) */\n groups?: ComboboxGroup[]\n /** Controlled selected value */\n value?: ComboboxOption | null\n /** Initial selected value (uncontrolled) */\n defaultValue?: ComboboxOption | null\n /** Callback when the selected value changes */\n onValueChange?: (value: ComboboxOption | null) => void\n /** Placeholder text shown in the input */\n placeholder?: string\n /** Whether the combobox is disabled */\n disabled?: boolean\n /** Whether a value is required */\n required?: boolean\n /** Label shown above the input */\n label?: string\n /** Error message shown below the input */\n error?: string\n /** Whether the combobox takes full width */\n fullWidth?: boolean\n /** Whether the user can clear the selected value */\n clearable?: boolean\n /** No-results message */\n emptyMessage?: string\n /** Additional CSS class on the outermost container */\n className?: string\n /** HTML id forwarded to the input */\n id?: string\n}\n\nexport interface ComboboxMultipleProps {\n /** Flat option list */\n options?: ComboboxOption[]\n /** Grouped option list */\n groups?: ComboboxGroup[]\n /** Controlled selected values */\n value?: ComboboxOption[]\n /** Initial selected values (uncontrolled) */\n defaultValue?: ComboboxOption[]\n /** Callback when selected values change */\n onValueChange?: (value: ComboboxOption[]) => void\n /** Placeholder text shown in the input */\n placeholder?: string\n /** Whether the combobox is disabled */\n disabled?: boolean\n /** Whether a value is required */\n required?: boolean\n /** Label shown above the input */\n label?: string\n /** Error message shown below the input */\n error?: string\n /** Whether the combobox takes full width */\n fullWidth?: boolean\n /** Whether the user can clear all selected values */\n clearable?: boolean\n /** No-results message */\n emptyMessage?: string\n /** Additional CSS class on the outermost container */\n className?: string\n /** HTML id forwarded to the input */\n id?: string\n}\n\n// ── Shared styles ──────────────────────────────────────────────────────\n\nconst inputGroupStyles = clsx(\n 'inline-flex w-full items-center rounded-md border',\n 'bg-(--bg-primary) text-(--text-primary)',\n 'transition-[border-color,box-shadow] outline-none',\n 'has-[:focus]:border-(--accent)/70',\n 'has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50',\n)\n\nconst inputStyles = clsx(\n 'flex-1 min-w-0 appearance-none bg-transparent text-[14px] leading-[1.4]',\n 'px-3 py-2 text-(--text-primary) placeholder-(--text-muted)',\n 'outline-none disabled:cursor-not-allowed',\n)\n\nconst popupStyles = clsx(\n 'min-w-[var(--anchor-width)] overflow-auto rounded-lg border border-(--border-light) bg-(--bg-primary)',\n 'py-1 shadow-lg',\n 'origin-[var(--transform-origin)]',\n 'transition-[transform,scale,opacity]',\n 'data-[starting-style]:scale-95 data-[starting-style]:opacity-0',\n 'data-[ending-style]:scale-95 data-[ending-style]:opacity-0',\n)\n\nconst itemStyles = clsx(\n 'relative flex cursor-default select-none items-center rounded px-3 py-1.5 text-[14px] text-(--text-primary) mx-1',\n 'data-[highlighted]:bg-(--bg-hover) data-[highlighted]:outline-none',\n 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed',\n)\n\n// ── Single-select Combobox ─────────────────────────────────────────────\n\nexport const Combobox = React.forwardRef<HTMLInputElement, ComboboxProps>(\n (\n {\n options,\n groups,\n value,\n defaultValue,\n onValueChange,\n placeholder = 'Search…',\n disabled,\n required,\n label,\n error,\n fullWidth,\n clearable = true,\n emptyMessage = 'No results found',\n className,\n id,\n },\n ref,\n ) => {\n const generatedId = React.useId()\n const inputId = id ?? generatedId\n\n // Build the flat items array that Base UI needs for filtering\n const items = React.useMemo<ComboboxOption[]>(() => {\n if (groups) return groups.flatMap((g) => g.options)\n return options ?? []\n }, [options, groups])\n\n // Build grouped items when `groups` is provided\n const groupedItems = React.useMemo(() => {\n if (!groups) return undefined\n return groups.map((g) => ({\n value: g.label,\n items: g.options,\n }))\n }, [groups])\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full', className)}>\n {label && (\n <label htmlFor={inputId} className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </label>\n )}\n\n <BaseCombobox.Root\n value={value}\n defaultValue={defaultValue}\n onValueChange={\n onValueChange\n ? (v: ComboboxOption | null) => onValueChange(v)\n : undefined\n }\n items={groupedItems ?? items}\n disabled={disabled}\n required={required}\n >\n {/* Input row — wraps input + action buttons */}\n <div\n className={clsx(\n inputGroupStyles,\n error\n ? 'border-(--danger) has-[:focus]:border-(--danger) has-[:focus]:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n )}\n >\n <BaseCombobox.Input\n ref={ref}\n id={inputId}\n placeholder={placeholder}\n className={inputStyles}\n />\n <div className=\"flex items-center pr-2 gap-0.5 shrink-0\">\n {clearable && (\n <BaseCombobox.Clear\n aria-label=\"Clear\"\n className={clsx(\n 'p-0.5 rounded text-(--text-muted) hover:text-(--text-primary)',\n 'transition-colors cursor-pointer',\n )}\n >\n <X size={14} />\n </BaseCombobox.Clear>\n )}\n <BaseCombobox.Trigger\n aria-label=\"Open\"\n className=\"p-0.5 rounded text-(--text-muted) hover:text-(--text-primary) transition-colors cursor-pointer\"\n >\n <ChevronDown size={16} />\n </BaseCombobox.Trigger>\n </div>\n </div>\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner sideOffset={4} className=\"z-50\">\n <BaseCombobox.Popup className={popupStyles}>\n <BaseCombobox.Empty className=\"px-3 py-2 text-[13px] text-(--text-muted)\">\n {emptyMessage}\n </BaseCombobox.Empty>\n\n <BaseCombobox.List className=\"outline-none max-h-60 overflow-y-auto\">\n {groups\n ? (group: { value: string; items: ComboboxOption[] }) => (\n <BaseCombobox.Group key={group.value}>\n <BaseCombobox.GroupLabel className=\"px-3 py-1 text-[12px] font-semibold text-(--text-muted) uppercase tracking-wider\">\n {group.value}\n </BaseCombobox.GroupLabel>\n {group.items.map((opt) => (\n <ComboboxItem key={opt.value} option={opt} />\n ))}\n </BaseCombobox.Group>\n )\n : (item: ComboboxOption) => (\n <ComboboxItem key={item.value} option={item} />\n )}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n\n {error && (\n <span className=\"flex items-center gap-1 text-[12px] font-medium leading-tight text-(--danger)\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nCombobox.displayName = 'Combobox'\n\n// ── Multiple-select Combobox ──────────────────────────────────────────\n\nexport const ComboboxMultiple = React.forwardRef<HTMLInputElement, ComboboxMultipleProps>(\n (\n {\n options,\n groups,\n value: valueProp,\n defaultValue,\n onValueChange,\n placeholder = 'Search…',\n disabled,\n required,\n label,\n error,\n fullWidth,\n clearable = true,\n emptyMessage = 'No results found',\n className,\n id,\n },\n ref,\n ) => {\n const generatedId = React.useId()\n const inputId = id ?? generatedId\n\n // Track selected values internally so we can render chips correctly\n const [internalValue, setInternalValue] = React.useState<ComboboxOption[]>(\n defaultValue ?? [],\n )\n const selectedValues = valueProp ?? internalValue\n\n const handleValueChange = React.useCallback(\n (v: ComboboxOption[]) => {\n if (valueProp === undefined) {\n setInternalValue(v)\n }\n onValueChange?.(v)\n },\n [valueProp, onValueChange],\n )\n\n const items = React.useMemo<ComboboxOption[]>(() => {\n if (groups) return groups.flatMap((g) => g.options)\n return options ?? []\n }, [options, groups])\n\n const groupedItems = React.useMemo(() => {\n if (!groups) return undefined\n return groups.map((g) => ({\n value: g.label,\n items: g.options,\n }))\n }, [groups])\n\n return (\n <div className={clsx('flex flex-col gap-1.5', fullWidth && 'w-full', className)}>\n {label && (\n <label htmlFor={inputId} className=\"text-[14px] font-semibold text-(--text-primary)\">\n {label}\n {required && <span className=\"ml-0.5 text-(--danger)\">*</span>}\n </label>\n )}\n\n <BaseCombobox.Root\n multiple\n value={selectedValues}\n onValueChange={handleValueChange}\n items={groupedItems ?? items}\n disabled={disabled}\n required={required}\n >\n {/* Input row with chips */}\n <div\n className={clsx(\n inputGroupStyles,\n 'flex-wrap gap-1 py-1',\n error\n ? 'border-(--danger) has-[:focus]:border-(--danger) has-[:focus]:shadow-[0_0_0_2px_var(--danger)]'\n : 'border-(--border-light) hover:border-(--text-primary)/30',\n )}\n >\n {selectedValues.length > 0 && (\n <BaseCombobox.Chips className=\"flex flex-wrap gap-1 pl-2\">\n {selectedValues.map((opt) => (\n <BaseCombobox.Chip\n key={opt.value}\n className={clsx(\n 'inline-flex items-center gap-1 rounded-md px-2 py-0.5',\n 'bg-(--bg-hover) text-(--text-primary) text-[12px] font-medium',\n 'border border-(--border-light)',\n )}\n >\n {opt.label}\n <BaseCombobox.ChipRemove\n className=\"rounded-sm p-0.5 hover:bg-(--bg-secondary) text-(--text-muted) hover:text-(--text-primary) transition-colors cursor-pointer\"\n aria-label={`Remove ${opt.label}`}\n >\n <X size={12} />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n ))}\n </BaseCombobox.Chips>\n )}\n\n <BaseCombobox.Input\n ref={ref}\n id={inputId}\n placeholder={placeholder}\n className={clsx(inputStyles, 'py-1.5')}\n />\n\n <div className=\"flex items-center pr-2 gap-0.5 shrink-0\">\n {clearable && (\n <BaseCombobox.Clear\n aria-label=\"Clear all\"\n className={clsx(\n 'p-0.5 rounded text-(--text-muted) hover:text-(--text-primary)',\n 'transition-colors cursor-pointer',\n )}\n >\n <X size={14} />\n </BaseCombobox.Clear>\n )}\n <BaseCombobox.Trigger\n aria-label=\"Open\"\n className=\"p-0.5 rounded text-(--text-muted) hover:text-(--text-primary) transition-colors cursor-pointer\"\n >\n <ChevronDown size={16} />\n </BaseCombobox.Trigger>\n </div>\n </div>\n\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner sideOffset={4} className=\"z-50\">\n <BaseCombobox.Popup className={popupStyles}>\n <BaseCombobox.Empty className=\"px-3 py-2 text-[13px] text-(--text-muted)\">\n {emptyMessage}\n </BaseCombobox.Empty>\n\n <BaseCombobox.List className=\"outline-none max-h-60 overflow-y-auto\">\n {groups\n ? (group: { value: string; items: ComboboxOption[] }) => (\n <BaseCombobox.Group key={group.value}>\n <BaseCombobox.GroupLabel className=\"px-3 py-1 text-[12px] font-semibold text-(--text-muted) uppercase tracking-wider\">\n {group.value}\n </BaseCombobox.GroupLabel>\n {group.items.map((opt) => (\n <ComboboxItem key={opt.value} option={opt} />\n ))}\n </BaseCombobox.Group>\n )\n : (item: ComboboxOption) => (\n <ComboboxItem key={item.value} option={item} />\n )}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n\n {error && (\n <span className=\"flex items-center gap-1 text-[12px] font-medium leading-tight text-(--danger)\">\n ⚠️ {error}\n </span>\n )}\n </div>\n )\n },\n)\n\nComboboxMultiple.displayName = 'ComboboxMultiple'\n\n// ── Internal helpers ──────────────────────────────────────────────────\n\n/** Renders a single selectable option inside the popup list. */\nfunction ComboboxItem({ option }: { option: ComboboxOption }) {\n return (\n <BaseCombobox.Item value={option} disabled={option.disabled} className={itemStyles}>\n <BaseCombobox.ItemIndicator className=\"absolute right-3 flex items-center text-(--accent)\">\n <Check size={14} />\n </BaseCombobox.ItemIndicator>\n <span className=\"flex-1\">{option.label}</span>\n </BaseCombobox.Item>\n )\n}\n\n\n","import React, {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react'\nimport { Menu as BaseMenu } from '@base-ui/react'\nimport clsx from 'clsx'\nimport { ChevronRight } from 'lucide-react'\n\n// ─── Shared Types ──────────────────────────────────────────────────────────────\n\nexport interface DropdownOption {\n value: string\n label: string\n /** Optional icon rendered before the label */\n icon?: React.ReactNode\n /** Show shortcut hint on the right */\n shortcut?: string\n disabled?: boolean\n /** Renders in red to indicate destructive action */\n destructive?: boolean\n}\n\nexport interface DropdownGroup {\n /** Group header label */\n label: string\n options: DropdownOption[]\n}\n\n// ─── Declarative API ───────────────────────────────────────────────────────────\n\nexport interface DropdownProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n /** Called when the user selects an option */\n onSelect?: (value: string) => void\n}\n\nexport interface DropdownTriggerProps {\n children?: React.ReactNode\n className?: string\n render?: React.ReactElement\n}\n\nexport interface DropdownContentProps {\n children: React.ReactNode\n className?: string\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n sideOffset?: number\n alignOffset?: number\n}\n\nexport interface DropdownItemProps {\n value: string\n children: React.ReactNode\n icon?: React.ReactNode\n shortcut?: string\n className?: string\n disabled?: boolean\n destructive?: boolean\n onSelect?: (value: string) => void\n}\n\nexport interface DropdownLabelProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface DropdownSeparatorProps {\n className?: string\n}\n\nexport interface DropdownGroupProps {\n label: string\n children: React.ReactNode\n className?: string\n}\n\n// Internal context so DropdownItem can call parent onSelect\nconst DropdownSelectContext = createContext<((value: string) => void) | undefined>(undefined)\n\nexport const Dropdown: React.FC<DropdownProps> = ({\n children,\n open,\n defaultOpen,\n onOpenChange,\n onSelect,\n}) => {\n return (\n <DropdownSelectContext.Provider value={onSelect}>\n <BaseMenu.Root open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {children}\n </BaseMenu.Root>\n </DropdownSelectContext.Provider>\n )\n}\nDropdown.displayName = 'Dropdown'\n\nexport const DropdownTrigger = React.forwardRef<HTMLButtonElement, DropdownTriggerProps>(\n ({ children, className, render }, ref) => {\n if (render) {\n return (\n <span className=\"contents\">\n <BaseMenu.Trigger ref={ref} className={clsx('outline-none', className)} render={render}/>\n </span>\n )\n }\n return (\n <span className=\"contents\">\n <BaseMenu.Trigger ref={ref} className={clsx('outline-none', className)}>\n {children}\n </BaseMenu.Trigger>\n </span>\n )\n },\n)\nDropdownTrigger.displayName = 'DropdownTrigger'\n\nexport const DropdownContent = React.forwardRef<HTMLDivElement, DropdownContentProps>(\n (\n {\n children,\n className,\n side = 'bottom',\n align = 'start',\n sideOffset = 4,\n alignOffset = 0,\n },\n ref,\n ) => {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n >\n <BaseMenu.Popup\n ref={ref}\n className={clsx(\n 'z-50 min-w-40 max-w-72 rounded-md border border-(--border-light) bg-(--bg-primary) py-1 shadow-lg',\n className,\n )}\n >\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n )\n },\n)\nDropdownContent.displayName = 'DropdownContent'\n\nexport const DropdownItem = React.forwardRef<HTMLDivElement, DropdownItemProps>(\n ({ value, children, icon, shortcut, className, disabled, destructive, onSelect }, ref) => {\n const contextOnSelect = useContext(DropdownSelectContext)\n\n const handleSelect = useCallback(() => {\n onSelect?.(value)\n contextOnSelect?.(value)\n }, [value, onSelect, contextOnSelect])\n\n return (\n <BaseMenu.Item\n ref={ref}\n className={clsx(\n 'relative flex items-center gap-2 px-3 py-1.5 text-[14px] outline-none cursor-pointer select-none',\n 'text-(--text-primary)',\n 'data-[highlighted]:bg-(--bg-hover)',\n 'data-[disabled]:opacity-50 data-[disabled]:pointer-events-none',\n destructive &&\n 'text-(--danger) data-[highlighted]:bg-red-50 dark:data-[highlighted]:bg-red-950/20',\n className,\n )}\n disabled={disabled}\n onSelect={handleSelect}\n >\n {icon && <span className=\"shrink-0 text-(--text-muted)\">{icon}</span>}\n <span className=\"flex-1\">{children}</span>\n {shortcut && (\n <span className=\"ml-auto text-[12px] text-(--text-muted)\">{shortcut}</span>\n )}\n </BaseMenu.Item>\n )\n },\n)\nDropdownItem.displayName = 'DropdownItem'\n\nexport const DropdownLabel: React.FC<DropdownLabelProps> = ({ children, className }) => (\n <div\n className={clsx(\n 'px-3 py-1.5 text-[11px] font-semibold text-(--text-muted) uppercase tracking-wider',\n className,\n )}\n >\n {children}\n </div>\n)\nDropdownLabel.displayName = 'DropdownLabel'\n\nexport const DropdownSeparator: React.FC<DropdownSeparatorProps> = ({ className }) => (\n <BaseMenu.Separator className={clsx('my-1 h-px bg-(--border-light)', className)}/>\n)\nDropdownSeparator.displayName = 'DropdownSeparator'\n\nexport const DropdownGroup: React.FC<DropdownGroupProps> = ({ label, children, className }) => (\n <BaseMenu.Group className={className}>\n <BaseMenu.GroupLabel className=\"px-3 py-1 text-[11px] font-semibold text-(--text-muted) uppercase tracking-wider\">\n {label}\n </BaseMenu.GroupLabel>\n {children}\n </BaseMenu.Group>\n)\nDropdownGroup.displayName = 'DropdownGroup'\n\n/** Convenience: render a list of DropdownOption objects inside a DropdownContent */\nexport const DropdownOptionList: React.FC<{\n options: DropdownOption[]\n onSelect?: (value: string) => void\n}> = ({ options, onSelect }) => (\n <>\n {options.map((opt) => (\n <DropdownItem\n key={opt.value}\n value={opt.value}\n icon={opt.icon}\n shortcut={opt.shortcut}\n disabled={opt.disabled}\n destructive={opt.destructive}\n onSelect={onSelect}\n >\n {opt.label}\n </DropdownItem>\n ))}\n </>\n)\n\n/** Convenience: render a list of DropdownGroup objects inside a DropdownContent */\nexport const DropdownGroupList: React.FC<{\n groups: DropdownGroup[]\n onSelect?: (value: string) => void\n}> = ({ groups, onSelect }) => (\n <>\n {groups.map((g, i) => (\n <React.Fragment key={g.label}>\n {i > 0 && <DropdownSeparator/>}\n <DropdownGroup label={g.label}>\n {g.options.map((opt) => (\n <DropdownItem\n key={opt.value}\n value={opt.value}\n icon={opt.icon}\n shortcut={opt.shortcut}\n disabled={opt.disabled}\n destructive={opt.destructive}\n onSelect={onSelect}\n >\n {opt.label}\n </DropdownItem>\n ))}\n </DropdownGroup>\n </React.Fragment>\n ))}\n </>\n)\n\n// Submenus (declarative only)\nexport interface DropdownSubProps {\n children: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\nexport interface DropdownSubTriggerProps {\n children: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport interface DropdownSubContentProps {\n children: React.ReactNode\n className?: string\n}\n\nexport const DropdownSub: React.FC<DropdownSubProps> = ({\n children,\n open,\n defaultOpen,\n onOpenChange,\n}) => (\n <BaseMenu.Root open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {children}\n </BaseMenu.Root>\n)\nDropdownSub.displayName = 'DropdownSub'\n\nexport const DropdownSubTrigger = React.forwardRef<HTMLButtonElement, DropdownSubTriggerProps>(\n ({ children, className, disabled }, ref) => (\n <BaseMenu.Trigger\n ref={ref}\n className={clsx(\n 'relative flex w-full items-center justify-between gap-2 px-3 py-1.5 text-[14px] outline-none cursor-pointer select-none',\n 'text-(--text-primary) data-[highlighted]:bg-(--bg-hover)',\n 'data-[disabled]:opacity-50 data-[disabled]:pointer-events-none',\n className,\n )}\n disabled={disabled}\n >\n {children}\n <ChevronRight className=\"ml-auto h-3.5 w-3.5 text-(--text-muted)\"/>\n </BaseMenu.Trigger>\n ),\n)\nDropdownSubTrigger.displayName = 'DropdownSubTrigger'\n\nexport const DropdownSubContent = React.forwardRef<HTMLDivElement, DropdownSubContentProps>(\n ({ children, className }, ref) => (\n <BaseMenu.Portal>\n <BaseMenu.Positioner side=\"right\" align=\"start\" sideOffset={8}>\n <BaseMenu.Popup\n ref={ref}\n className={clsx(\n 'z-50 min-w-40 max-w-72 rounded-md border border-(--border-light) bg-(--bg-primary) py-1 shadow-lg',\n className,\n )}\n >\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n ),\n)\nDropdownSubContent.displayName = 'DropdownSubContent'\n\n// ─── Imperative API ────────────────────────────────────────────────────────────\n\nexport interface DropdownShowOptions {\n /** Flat list of options (use `groups` for grouped layout) */\n options?: DropdownOption[]\n /** Grouped options (renders group headers + separators) */\n groups?: DropdownGroup[]\n /** Called when the user picks an option */\n onSelect?: (value: string) => void\n side?: 'top' | 'right' | 'bottom' | 'left'\n align?: 'start' | 'center' | 'end'\n sideOffset?: number\n alignOffset?: number\n className?: string\n}\n\nexport interface UseDropdownReturn {\n /**\n * Show the dropdown anchored to the given element.\n * Replaces any currently open dropdown.\n */\n show: (anchor: HTMLElement | null, options: DropdownShowOptions) => void\n /** Close the dropdown. */\n hide: () => void\n /**\n * Toggle the dropdown for the given anchor.\n * Closes if the same anchor is already open; otherwise opens on the new anchor.\n */\n toggle: (anchor: HTMLElement | null, options: DropdownShowOptions) => void\n /** Whether the dropdown is currently open. */\n isOpen: boolean\n}\n\ninterface DropdownState {\n open: boolean\n anchor: HTMLElement | null\n options: DropdownShowOptions\n}\n\nconst DropdownContext = createContext<UseDropdownReturn | null>(null)\n\n/**\n * Provides the imperative dropdown API to all descendant components.\n * Only one dropdown is shown at a time (singleton).\n *\n * @example\n * ```tsx\n * // main.tsx\n * <DropdownProvider>\n * <App />\n * </DropdownProvider>\n *\n * // Any component\n * const dropdown = useDropdown()\n *\n * <button onClick={e => dropdown.show(e.currentTarget, {\n * options: [\n * { value: 'edit', label: '编辑', icon: <Edit size={14} /> },\n * { value: 'delete', label: '删除', destructive: true },\n * ],\n * onSelect: (value) => handleAction(value),\n * })}>\n * 操作\n * </button>\n * ```\n */\nexport const DropdownProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const [state, setState] = useState<DropdownState>({\n open: false,\n anchor: null,\n options: {},\n })\n\n const show = useCallback((anchor: HTMLElement | null, options: DropdownShowOptions) => {\n setState({ open: true, anchor, options })\n }, [])\n\n const hide = useCallback(() => {\n setState((prev) => ({ ...prev, open: false }))\n }, [])\n\n const toggle = useCallback(\n (anchor: HTMLElement | null, options: DropdownShowOptions) => {\n setState((prev) => {\n if (prev.open && prev.anchor === anchor) {\n return { ...prev, open: false }\n }\n return { open: true, anchor, options }\n })\n },\n [],\n )\n\n const value = useMemo<UseDropdownReturn>(\n () => ({ show, hide, toggle, isOpen: state.open }),\n [show, hide, toggle, state.open],\n )\n\n return (\n <DropdownContext.Provider value={value}>\n {children}\n <ImperativeDropdownPortal state={state} onClose={hide}/>\n </DropdownContext.Provider>\n )\n}\nDropdownProvider.displayName = 'DropdownProvider'\n\nfunction ImperativeDropdownPortal ({\n state,\n onClose,\n}: {\n state: DropdownState\n onClose: () => void\n}) {\n if (!state.open || !state.anchor) return null\n\n const { options } = state\n\n const handleSelect = (value: string) => {\n options.onSelect?.(value)\n onClose()\n }\n\n return (\n <BaseMenu.Root open={state.open} onOpenChange={(open) => !open && onClose()}>\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n anchor={state.anchor}\n side={options.side ?? 'bottom'}\n align={options.align ?? 'start'}\n sideOffset={options.sideOffset ?? 4}\n alignOffset={options.alignOffset ?? 0}\n >\n <BaseMenu.Popup\n className={clsx(\n 'z-50 min-w-40 max-w-72 rounded-md border border-(--border-light) bg-(--bg-primary) py-1 shadow-lg',\n options.className,\n )}\n >\n {options.groups ? (\n <DropdownGroupList groups={options.groups} onSelect={handleSelect}/>\n ) : (\n <DropdownOptionList options={options.options ?? []} onSelect={handleSelect}/>\n )}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n </BaseMenu.Root>\n )\n}\n\n/**\n * Returns imperative methods for showing a dropdown anchored to any element.\n *\n * Must be used inside `<DropdownProvider>`.\n *\n * @example\n * ```tsx\n * const dropdown = useDropdown()\n *\n * // Show\n * <button onClick={e => dropdown.show(e.currentTarget, {\n * options: [{ value: 'copy', label: 'Copy' }, { value: 'paste', label: 'Paste' }],\n * onSelect: (v) => console.log(v),\n * })}>\n * Actions\n * </button>\n *\n * // Toggle (click again to close)\n * <button onClick={e => dropdown.toggle(e.currentTarget, { options, onSelect })}>\n * Toggle\n * </button>\n * ```\n */\nexport function useDropdown (): UseDropdownReturn {\n const ctx = useContext(DropdownContext)\n if (!ctx) throw new Error('useDropdown must be used within <DropdownProvider>')\n return ctx\n}\n"],"names":["r","f","n","o","clsx","set","error","messages","messageKey","useControlled","controlled","defaultProp","name","state","isControlled","React","valueState","setValue","value","defaultValue","serializeToDevModeString","setValueIfUncontrolled","newValue","input","nextId","seen","key","id","UNINITIALIZED","useRefWithInit","init","initArg","ref","useInsertionEffect","useSafeInsertionEffect","fn","useStableCallback","callback","stable","createStableCallback","assertNotCalled","args","noop","useIsoLayoutEffect","warn","CompositeListContext","useCompositeListContext","CompositeList","props","children","elementsRef","labelsRef","onMapChangeProp","onMapChange","nextIndexRef","listeners","createListeners","map","createMap","mapTick","setMapTick","lastTickRef","register","node","metadata","unregister","sortedMap","newMap","sortByDocumentPosition","index","mutationObserver","entries","diff","updateDiff","entry","_","subscribeMapChange","l","contextValue","_jsx","a","b","position","DirectionContext","useDirection","createFormatErrorMessage","baseUrl","prefix","code","url","arg","formatErrorMessage","useMergedRefs","c","d","forkRef","createForkRef","didChange","update","useMergedRefsN","refs","didChangeN","newRefs","instance","cleanupCallbacks","i","refCleanup","cleanupCallback","majorVersion","isReactVersionAtLeast","reactVersionToCheck","getReactElementRef","element","reactElement","propsWithRef","mergeObjects","getStateAttributesProps","customMapping","customProps","resolveClassName","className","resolveStyle","style","EMPTY_PROPS","mergeProps","e","createInitialMergedProps","merged","mergeInto","mergePropsN","inputProps","isPropsGetter","resolvePropsGetter","copyInitialProps","mutablyMergeInto","copiedProps","propName","propValue","isEventHandler","wrapEventHandler","mergedProps","externalProps","externalPropValue","mergeClassNames","mergeEventHandlers","code0","code1","code2","previousProps","ourHandler","theirHandler","event","isSyntheticEvent","baseUIEvent","makeEventPreventable","result","handler","ourClassName","theirClassName","NOOP","EMPTY_ARRAY","EMPTY_OBJECT","TYPEAHEAD_RESET_MS","PATIENT_CLICK_THRESHOLD","DISABLED_TRANSITIONS_STYLE","CLICK_TRIGGER_IDENTIFIER","BASE_UI_SWIPE_IGNORE_ATTRIBUTE","LEGACY_SWIPE_IGNORE_ATTRIBUTE","BASE_UI_SWIPE_IGNORE_SELECTOR","LEGACY_SWIPE_IGNORE_SELECTOR","DROPDOWN_COLLISION_AVOIDANCE","POPUP_COLLISION_AVOIDANCE","ownerVisuallyHidden","useRenderElement","componentProps","params","renderProp","outProps","useRenderElementProps","evaluateRenderProp","classNameProp","styleProp","stateAttributesMapping","enabled","stateProps","resolvedProps","resolveRenderFunctionProps","REACT_LAZY_TYPE","COMPONENT_IDENTIFIER_PATTERN","LOWERCASE_CHARACTER_PATTERN","render","warnIfRenderPropLooksLikeComponent","newElement","renderTag","_formatErrorMessage","renderFn","functionName","Tag","_createElement","none","triggerPress","triggerHover","triggerFocus","outsidePress","itemPress","closePress","clearPress","chipRemovePress","inputChange","inputClear","inputPress","focusOut","escapeKey","listNavigation","cancelOpen","siblingOpen","disabled","imperativeAction","windowResize","createChangeEventDetails","reason","trigger","customProperties","canceled","allowPropagation","custom","createGenericEventDetails","SafeReact","globalId","useGlobalId","idOverride","defaultId","setDefaultId","maybeReactUseId","useId","reactId","useBaseUiId","EMPTY","useOnMount","LAST_RAF","Scheduler","timestamp","currentCallbacks","currentCallbacksCount","didRAFChange","scheduler","AnimationFrame","useAnimationFrame","timeout","resolveRef","maybeRef","TransitionStatusDataAttributes","STARTING_HOOK","ENDING_HOOK","transitionStatusMapping","useAnimationsFinished","elementOrRef","waitForStartingStyleRemoved","treatAbortedAsFinished","frame","fnToExecute","signal","resolvedElement","done","ReactDOM","exec","animation","currentAnimations","startingStyleAttribute","attributeObserver","useTransitionStatus","open","enableIdleState","deferEndingState","transitionStatus","setTransitionStatus","mounted","setMounted","IndexGuessBehavior","useCompositeListItem","label","textRef","indexGuessBehavior","externalIndex","indexRef","setIndex","newIndex","componentRef","isLabelDefined","isElementDisabled","hasWindow","getNodeName","isNode","getWindow","_node$ownerDocument","getDocumentElement","_ref","isElement","isHTMLElement","isShadowRoot","isOverflowElement","overflow","overflowX","overflowY","display","getComputedStyle","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","elementOrCss","css","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","getNearestOverflowAncestor","parentNode","getOverflowAncestors","list","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","CompositeRootContext","useCompositeRootContext","optional","context","useFocusableWhenDisabled","parameters","focusableWhenDisabled","composite","tabIndexProp","isNativeButton","isFocusableComposite","isNonFocusableComposite","additionalProps","useButton","tabIndex","compositeProp","elementRef","compositeRootContext","isCompositeItem","focusableWhenDisabledProps","isButtonTag","isButtonElement","ownerStackMessage","updateDisabled","getButtonProps","externalOnClick","externalOnMouseDown","externalOnKeyUp","externalOnKeyDown","externalOnPointerDown","otherExternalProps","isCurrentTarget","currentTarget","isButton","isLink","isValidLinkElement","shouldClick","isEnterKey","isSpaceKey","role","isTextNavigationRole","buttonRef","elem","hasNavigator","nav","getNavigatorData","platform","getPlatform","userAgent","getUserAgent","isIOS","isFirefox","isSafari","isAndroid","isMac","isJSDOM","uaData","brand","version","FOCUSABLE_ATTRIBUTE","ACTIVE_KEY","SELECTED_KEY","TYPEABLE_SELECTOR","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","ARROW_DOWN","activeElement","doc","contains","parent","child","rootNode","next","getTarget","isTargetInsideEnabledTrigger","target","triggerElements","targetElement","isEventTargetWithin","eventAgain","isRootElement","isTypeableElement","isInteractiveElement","isTypeableCombobox","matchesFocusVisible","getFloatingFocusElement","floatingElement","getNodeChildren","nodes","onlyOpenChildren","getNodeAncestors","allAncestors","currentParentId","stopEvent","isReactEvent","isVirtualClick","isVirtualPointerEvent","isMouseLikePointerType","pointerType","strict","values","isClickLikeEvent","type","sides","min","max","round","floor","createCoords","v","oppositeSideMap","clamp","start","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","x","y","width","height","isDifferentGridRow","cols","prevRow","isIndexOutOfListBounds","getMinListIndex","listRef","disabledIndices","findNonDisabledListIndex","getMaxListIndex","startingIndex","decrement","amount","isListIndexDisabled","getGridNavigatedIndex","orientation","loopFocus","onLoop","minIndex","maxIndex","prevIndex","stop","nextIndex","verticalDirection","rows","rowIndexMap","hasRoleRow","visibleItemCount","currentRowEl","currentRowIndex","el","idx","rowEl","hasDomRows","inferredDomCols","row","rowLength","hasVirtualizedGaps","verticalCols","navigateVertically","currentRow","colInRow","step","nextRow","clampedCol","targetItemIndex","returnedItemIndex","targetRow","col","candidate","navigateVerticallyWithInferredRows","rowStep","lastRowStart","rowCount","rowStart","rowEnd","verticalCandidate","maxCol","offset","lastRow","createGridCellMap","sizes","dense","cellMap","startIndex","itemPlaced","targetCells","j","cell","getGridCellIndexOfCorner","corner","firstCellIndex","sizeItem","getGridCellIndices","indices","cellIndex","isElementVisible","ownerDocument","CANDIDATE_SELECTOR","getParentElement","assignedSlot","getDetailsSummary","details","isWithinOpenDetailsSummary","summary","isFocusableCandidate","nodeName","isFocusableElement","current","isSlot","getTabIndex","getNamedRadioInput","isTabbableRadio","candidates","checkedRadio","radio","getComposedChildren","container","assignedElements","appendCandidates","appendMatchingElements","selector","isTabbable","focusable","tabbable","getTabbableIn","dir","len","active","getNextTabbable","referenceElement","getPreviousTabbable","getTabbableNearElement","elementCount","getTabbableAfterElement","getTabbableBeforeElement","isOutsideEvent","containerElement","relatedTarget","disableFocusInside","enableFocusInside","elements","tabindex","HOME","END","HORIZONTAL_KEYS","HORIZONTAL_KEYS_WITH_EXTRA_KEYS","VERTICAL_KEYS","VERTICAL_KEYS_WITH_EXTRA_KEYS","ARROW_KEYS","ALL_KEYS","COMPOSITE_KEYS","SHIFT","CONTROL","ALT","META","MODIFIER_KEYS","isInputElement","isNativeInput","scrollIntoViewIfNeeded","scrollContainer","targetX","targetY","isOverflowingX","isOverflowingY","elementOffsetLeft","getOffset","containerStyles","getStyles","elementStyles","elementOffsetTop","ancestor","styles","addEventListener","listener","options","useOpenChangeComplete","onCompleteParam","onComplete","runOnceAnimationsFinish","abortController","useOnFirstRender","Timeout","delay","useTimeout","originalHtmlStyles","originalBodyStyles","originalHtmlScrollBehavior","hasInsetScrollbars","ownerWindow","supportsStableScrollbarGutter","html","body","originalScrollContainerOverflowY","originalHtmlStyleGutter","before","after","preventScrollOverlayScrollbars","elementToLock","originalElementToLockStyles","preventScrollInsetScrollbars","scrollTop","scrollLeft","updateGutterOnly","resizeFrame","lockScroll","htmlStyles","bodyStyles","scrollbarGutterValue","isScrollableY","isScrollableX","hasConstantOverflowY","hasConstantOverflowX","scrollbarWidth","scrollbarHeight","marginY","marginX","cleanup","handleResize","unsubscribeResize","ScrollLocker","htmlOverflowY","hasOverlayScrollbars","SCROLL_LOCKER","useScrollLock","resolveValue","getDelay","prop","getRestMs","isClickLikeOpenEvent","openEventType","interactedInside","FloatingDelayGroupContext","useDelayGroup","store","floatingId","groupContext","currentIdRef","delayRef","timeoutMs","initialDelayRef","currentContextRef","hasProvider","isInstantPhase","setIsInstantPhase","unset","closingId","prevContext","prevId","REASONS.none","mergeCleanups","cleanups","useValueAsRef","latest","createLatestRef","visuallyHiddenBase","visuallyHidden","visuallyHiddenInput","FocusGuard","setRole","createAttribute","rafId","enqueueFocus","preventScroll","cancelPrevious","sync","currentRafId","counters","markerName","uncontrolledElementsSets","markerCounterMap","lockCount","getUncontrolledElementsSet","controlAttribute","unwrapHost","correctElements","targets","correctedTarget","buildKeepSet","keep","collectOutsideElements","root","keepElements","stopElements","outside","walk","applyAttributeToOthers","uncorrectedAvoidElements","ariaHidden","inert","mark","markerIgnoreElements","counterMap","uncontrolledElementsSet","avoidElements","markerIgnoreTargets","markerIgnoreSet","markerTargets","hiddenElements","markedElements","currentUncontrolledElementsSet","ariaLiveElements","controlElements","attr","alreadyHidden","counterValue","markerValue","markOthers","PortalContext","usePortalContext","useFloatingPortalNode","containerProp","elementProps","uniqueId","parentPortalNode","setContainerElement","portalNode","setPortalNode","setPortalNodeRef","containerRef","resolvedContainer","portalElement","FloatingPortal","forwardedRef","renderGuards","portalSubtree","beforeOutsideRef","afterOutsideRef","beforeInsideRef","afterInsideRef","focusManagerState","setFocusManagerState","focusInsideDisabledRef","modal","shouldRenderGuards","onFocus","portalContextValue","_jsxs","domReference","REASONS.focusOut","createEventEmitter","data","FloatingTreeStore","FloatingNodeContext","FloatingTreeContext","useFloatingParentNodeId","useFloatingTree","externalTree","contextTree","useFloatingNodeId","tree","parentId","FloatingNode","FloatingTree","getEventType","lastInteractionType","LIST_LIMIT","previouslyFocusedElements","clearDisconnectedPreviouslyFocusedElements","addPreviouslyFocusedElement","getPreviouslyFocusedElement","getFirstTabbableElement","isFocusable","handleTabIndex","floatingFocusElement","orderRef","tabbableContent","dataTabIndex","FloatingFocusManager","initialFocus","returnFocus","restoreFocus","closeOnFocusOut","openInteractionType","nextFocusableElement","previousFocusableElement","beforeContentFocusGuardRef","getInsideElements","floating","events","dataRef","getNodeId","ignoreInitialFocus","isUntrappedTypeableCombobox","initialFocusRef","returnFocusRef","openInteractionTypeRef","portalContext","preventReturnFocusRef","isPointerDownRef","pointerDownOutsideRef","lastFocusedTabbableRef","closeTypeRef","lastInteractionTypeRef","beforeGuardRef","afterGuardRef","mergedBeforeGuardRef","mergedAfterGuardRef","blurTimeout","pointerDownTimeout","restoreFocusFrame","isInsidePortal","getTabbableContent","getResolvedInsideElements","onKeyDown","clearPointerDownOutside","onPointerDown","insideElements","pointerTargetInside","handlePointerDown","handleFocusIn","handleFocusOutside","nodeId","triggers","isRelatedFocusGuard","movedToUnrelatedNode","prevTabbable","nodeToFocus","markInsideReactTree","domReferenceElement","portalNodes","rootAncestorComboboxDomReference","ariaHiddenCleanup","markerInsideElements","markerCleanup","previouslyFocusedElement","initialFocusValueOrFn","resolvedInitialFocus","focusableElements","getDefaultFocusElement","elToFocus","onOpenChangeLocal","REASONS.triggerHover","REASONS.outsidePress","isPreventScrollSupported","getReturnElement","returnFocusValueOrFn","resolvedReturnFocusValue","fallback","activeEl","isFocusInsideFloatingTree","returnElement","tabbableReturnElement","hasExplicitReturnFocus","els","useClick","eventOption","toggle","ignoreMouse","stickIfOpen","touchOpenDelay","REASONS.triggerPress","pointerTypeRef","touchOpenTimeout","reference","nativeEvent","openEvent","hasClickedOnInactiveTrigger","nextOpen","eventCurrentTarget","createVirtualElement","domElement","offsetX","offsetY","isAutoUpdateEvent","domRect","isXAxis","isYAxis","canTrackCursorOnAutoUpdate","isMouseBasedEvent","useClientPoint","initialRef","cleanupListenerRef","setPointerType","reactive","setReactive","setReference","newX","newY","handleReferenceEnterOrMove","openCheck","addListener","handleMouseMove","setPointerTypeRef","bubbleHandlerKeys","alwaysFalse","normalizeProp","normalizable","useDismiss","outsidePressProp","outsidePressEvent","referencePress","referencePressEvent","bubbles","outsidePressFn","outsidePressEnabled","getOutsidePressEventProp","pressStartedInsideRef","pressStartPreventedRef","suppressNextOutsideClickRef","escapeKeyBubbles","outsidePressBubbles","touchStateRef","cancelDismissOnEndTimeout","clearInsideReactTreeTimeout","clearInsideReactTree","isComposingRef","currentPointerTypeRef","isReferencePressEnabled","closeOnEscapeKeyDown","shouldDismiss","native","eventDetails","REASONS.escapeKey","compositionTimeout","preventedPressSuppressionTimeout","handleCompositionStart","handleCompositionEnd","suppressImmediateOutsideClickAfterPreventedStart","resetPressStartState","getOutsidePressEvent","computedType","outsidePressEventValue","resolved","shouldIgnoreEvent","computedOutsidePressEvent","isEventWithinFloatingTree","targetIsInsideChildren","closeOnPressOutside","inertSelector","targetRoot","markers","targetRootAncestor","nextParent","marker","lastTraversableNode","scrollRe","canScrollX","canScrollY","isRTL","pressedVerticalScrollbar","pressedHorizontalScrollbar","handleTouchStart","touch","addTargetEventListenerOnce","unsubscribe","handleTouchStartCapture","closeOnPressOutsideCapture","targetEvent","handlePressEndCapture","pressStartedInsideDefaultPrevented","handleTouchMove","deltaX","deltaY","distance","handleTouchMoveCapture","handleTouchEnd","handleTouchEndCapture","markPressStartedInsideReactTree","markInsidePressStartPrevented","computeCoordsFromPlacement","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","detectOverflow","_await$platform$isEle","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","MAX_RESET_COUNT","computePosition","config","middleware","platformWithDetectOverflow","statefulPlacement","resetCount","middlewareData","currentMiddleware","nextX","nextY","reset","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflows","overflowsData","_middlewareData$flip2","_overflowsData$filter","nextPlacement","resetPlacement","_overflowsData$filter2","currentSideAxis","acc","getSideOffsets","isAnySideFullyClipped","hide","offsets","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","_middlewareData$offse","diffCoords","shift","limiter","mainAxisCoord","crossAxisCoord","minSide","maxSide","limitedCoords","limitShift","rawOffset","computedOffset","limitMin","limitMax","_middlewareData$offse2","isOriginSide","size","_state$middlewareData","_state$middlewareData2","apply","heightSide","widthSide","maximumClippingHeight","maximumClippingWidth","overflowAvailableHeight","overflowAvailableWidth","noShift","availableHeight","availableWidth","xMin","xMax","yMin","yMax","nextDimensions","getCssDimensions","getComputedStyle$1","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","left","top","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","SCROLLBAR_MAX","getViewportRect","visualViewport","visualViewportBased","windowScrollbarX","bodyMarginInline","clippingStableScrollbarWidth","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","cache","cachedResult","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","getClippingRect","clippingAncestors","firstRect","right","bottom","getDimensions","getRectRelativeToOffsetParent","setLeftRTLScrollbarOffset","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","rectsAreEqual","observeMove","onMove","io","timeoutId","_io","refresh","skip","threshold","elementRectForRootMargin","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","autoUpdate","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset$1","shift$1","flip$1","size$1","hide$1","limitShift$1","mergedOptions","platformWithCache","computePosition$1","isClient","useLayoutEffect","deepEqual","keys","getDPR","roundByDPR","dpr","useLatestRef","useFloating","externalReference","externalFloating","transform","whileElementsMounted","setData","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","referenceRef","setFloating","floatingRef","floatingEl","hasWhileElementsMounted","whileElementsMountedRef","platformRef","openRef","fullData","isMountedRef","floatingStyles","initialStyles","deps","createSelector","other","a1","a2","a3","va","vb","vc","vd","ve","runIdentityFunctionCheck","resultFunc","inputSelectorsResults","outputSelectorResult","isInputSameAsOutput","emptyObject","stack","runInputStabilityCheck","inputSelectorResultsObject","inputSelectorArgs","memoize","memoizeOptions","inputSelectorResults","inputSelectorResultsCopy","createAnEmptyObject","globalDevModeChecks","NOT_FOUND","assertIsFunction","func","errorMessage","assertIsObject","object","assertIsArrayOfFunctions","array","item","itemTypes","ensureIsArray","getDependencies","createSelectorArgs","dependencies","collectInputSelectorResults","getDevModeChecksExecutionInfo","firstRun","devModeChecks","identityFunctionCheck","inputStabilityCheck","createSingletonCache","equals","createLruCache","maxSize","get","cacheIndex","put","getEntries","clear","referenceEqualityCheck","createCacheKeyComparator","equalityCheck","prev","lruMemoize","equalityCheckOrOptions","providedOptions","resultEqualityCheck","comparator","resultsCount","memoized","matchingEntry","StrongRef","Ref","UNTERMINATED","TERMINATED","createCacheNode","weakMapMemoize","fnNode","lastResult","cacheNode","objectCache","objectNode","primitiveCache","primitiveNode","terminatedNode","lastResultValue","createSelectorCreator","memoizeOrOptions","memoizeOptionsFromArgs","createSelectorCreatorOptions","createSelector2","recomputations","dependencyRecomputations","directlyPassedOptions","combinedOptions","argsMemoize","argsMemoizeOptions","finalMemoizeOptions","finalArgsMemoizeOptions","memoizedResultFunc","createStructuredSelector","inputSelectorsObject","selectorCreator","inputSelectorKeys","composition","reselectCreateSelector","createSelectorMemoized","selectors","nextCacheId","combiner","nSelectors","argsLength","cacheKey","reselectArgs","selectorArgs","require$$0","is","objectIs","useState","useEffect","useDebugValue","useSyncExternalStore$2","subscribe","getSnapshot","_useState","inst","forceUpdate","checkIfSnapshotChanged","latestGetSnapshot","nextValue","useSyncExternalStore$1","shim","useSyncExternalStoreShim_production","didWarnOld18Alpha","didWarnUncachedGetSnapshot","cachedValue","useSyncExternalStoreShim_development","shimModule","require$$1","useSyncExternalStore","useRef","useMemo","withSelector_production","getServerSnapshot","isEqual","instRef","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","withSelector_development","withSelectorModule","hooks","currentInstance","getInstance","hook","fastComponent","FastComponent","createInstance","fastComponentRef","canUseRawUseSyncExternalStore","useStoreImplementation","useStoreFast","useStoreLegacy","useStore","useStoreR19","getSelection","onStoreChange","stores","unsubscribes","useSyncExternalStoreWithSelector","Store","newState","currentTick","changes","ReactStore","statePart","p","nextKeys","previouslyControlled","stableFunction","selectFn","prevValue","nextState","oldValue","useForcedRerendering","setState","FloatingRootStore","syncOnly","nested","onOpenChange","initialState","newOpen","useTriggerRegistration","registeredElementIdRef","registeredElementRef","registeredId","registeredElement","currentElement","useTriggerDataForwarding","triggerId","triggerElementRef","stateUpdates","isMountedByThisTrigger","baseRegisterTrigger","registerTrigger","activeTriggerId","useImplicitActiveTrigger","iteratorResult","implicitTriggerId","implicitTriggerElement","useOpenStateTransitions","onUnmount","forceUnmount","preventUnmountingOnClose","PopupTriggerMap","existingElement","predicate","getEmptyRootContext","createInitialPopupStoreState","activeTriggerIdSelector","popupStoreSelectors","isActive","useFloatingRootContext","optionDomReference","valuesToSync","internalRootStore","rootContext","rootContextElements","positionReference","setPositionReferenceRaw","domReferenceRef","usePosition","setPositionReference","computedPositionReference","localDomReference","setLocalDomReference","localFloatingElement","setLocalFloatingElement","localDomReferenceElement","useSyncedFloatingRootContext","popupStore","treatPopupAsFloatingElement","isMacSafari","useFocus","blockFocusRef","blockedReferenceRef","keyboardModalityRef","onBlur","currentDomReference","focusTarget","movedFromOtherEnabledTrigger","delayValue","REASONS.triggerFocus","movedToFocusGuard","HoverInteraction","pointerEventsMutationOwnerByScopeElement","clearSafePolygonPointerEventsMutation","scopeElement","applySafePolygonPointerEventsMutation","existingOwner","useHoverInteractionSharedState","useHoverFloatingInteraction","closeDelayProp","nodeIdProp","isClickLikeOpenEventShared","isHoverOpen","isRelatedTargetInsideEnabledTrigger","closeWithDelay","closeDelay","close","clearPointerEvents","handleInteractInside","parentFloating","childClosedTimeout","onFloatingMouseEnter","onNodeClosed","onFloatingMouseLeave","currentNodeId","EMPTY_REF","useHoverReferenceInteraction","handleClose","mouseOnly","restMs","move","isActiveTrigger","getHandleCloseContext","isClosing","isHoverCloseActiveRef","handleCloseRef","restMsRef","enabledRef","isClosingRef","isOverInactiveTrigger","allTriggers","runElseBranch","cleanupMouseMoveHandler","onMouseEnter","restMsValue","openDelay","eventTarget","triggerNode","triggerElement","isOverInactive","isOpen","isInClosingTransition","isHoverCloseTransition","isReenteringSameTriggerDuringCloseTransition","isRestOnlyDelay","shouldOpenImmediately","shouldOpen","onMouseLeave","handleCloseContextBase","currentTrigger","setPointerRef","currentOpen","latestOpen","useInteractions","propsList","referenceDeps","floatingDeps","itemDeps","triggerDeps","getReferenceProps","userProps","getFloatingProps","getItemProps","getTriggerProps","elementKey","eventHandlers","isItem","outputProps","propsOrGetProps","mutablyMergeProps","val","isMouseWithinBounds","targetRect","ESCAPE","doSwitch","vertical","horizontal","isMainOrientationKey","isMainOrientationToEndKey","isCrossOrientationOpenKey","isCrossOrientationCloseKey","useListNavigation","activeIndex","onNavigateProp","selectedIndex","allowEscape","virtual","focusItemOnOpen","focusItemOnHover","openOnArrowKeyDown","parentOrientation","resetOnPointerLeave","floatingFocusElementRef","typeableComboboxReference","focusItemOnOpenRef","keyRef","isPointerModalityRef","onNavigate","previousOnNavigateRef","previousMountedRef","previousOpenRef","forceSyncFocusRef","forceScrollIntoViewRef","cancelQueuedFocusRef","disabledIndicesRef","latestOpenRef","selectedIndexRef","resetOnPointerLeaveRef","focusItem","runFocus","initialItem","forceScrollIntoView","waitedItem","runs","waitForListPopulated","treeContainsActiveEl","hasActiveIndex","syncCurrentTarget","floatingFocusEl","getParentOrientation","commonOnKeyDown","REASONS.listNavigation","currentIndex","minGridIndex","maxGridIndex","foundIndex","itemIndex","listIndex","ariaActiveDescendantProp","checkVirtualMouse","checkVirtualPointer","isArrowKey","isParentCrossOpenKey","isMainKey","isNavigationKey","isParentMainKey","componentRoleToAriaRoleMap","useRole","defaultFloatingId","defaultReferenceId","referenceId","ariaRole","isNested","floatingProps","selected","commonProps","useTypeahead","onMatchProp","onTypingChange","resetMs","stringRef","prevIndexRef","matchIndexRef","setTypingChange","isVisible","getMatchingIndex","string","normalizedStartIndex","lowerString","listContent","isNewSession","text","currentDomReferenceElement","currentFloatingElement","withinReference","withinFloating","CURSOR_SPEED_THRESHOLD","CURSOR_SPEED_THRESHOLD_SQUARED","POLYGON_BUFFER","hasIntersectingEdge","pointX","pointY","xi","yi","xj","yj","isPointInQuadrilateral","x1","y1","x2","y2","x3","y3","x4","y4","isInsideValue","isInsideRect","isInsideAxisAlignedRect","minX","maxX","minY","maxY","safePolygon","blockPointerEvents","onClose","hasLanded","lastX","lastY","lastCursorTime","isCursorMovingSlowly","currentTime","elapsedTime","distanceSquared","thresholdSquared","clientX","clientY","isLeave","isOverFloatingEl","isOverReferenceEl","hasOpenChildNode","closeIfNoOpenChild","refRect","cursorLeaveFromRight","cursorLeaveFromBottom","isFloatingWider","isFloatingTaller","isInsideTroughRect","isInsidePolygon","cursorXOffset","cursorPointOneX","cursorPointTwoX","cursorPointY","commonYLeft","commonYRight","cursorYOffset","cursorPointOneY","cursorPointTwoY","cursorPointX","commonXTop","commonXBottom","useEnhancedClickHandler","lastClickInteractionTypeRef","useValueChanged","onChange","valueRef","onChangeCallback","useOpenInteractionType","openMethod","setOpenMethod","handleTriggerClick","interactionType","previousOpen","onClick","useDialogRoot","parentContext","actionsRef","isDrawer","disablePointerDismissal","popupElement","triggerProps","createDialogEventDetails","handleImperativeClose","REASONS.imperativeAction","floatingRootContext","ownNestedOpenDialogs","setOwnNestedOpenDialogs","ownNestedOpenDrawers","setOwnNestedOpenDrawers","isTopmost","dismiss","dialogCount","drawerCount","activeTriggerProps","inactiveTriggerProps","popupProps","DialogRootContext","useDialogRootContext","dialogRootContext","DialogStore","createInitialState","updatedState","newTriggerId","externalStore","internalStore","IsDrawerContext","DialogRoot","openProp","defaultOpen","onOpenChangeComplete","handle","triggerIdProp","defaultTriggerIdProp","parentDialogRootContext","payload","CommonPopupDataAttributes","CommonTriggerDataAttributes","TRIGGER_HOOK","PRESSABLE_TRIGGER_HOOK","POPUP_OPEN_HOOK","POPUP_CLOSED_HOOK","ANCHOR_HIDDEN_HOOK","triggerOpenStateMapping","pressableTriggerOpenStateMapping","popupStateMapping","baseMapping","DialogBackdrop","forceRender","DialogClose","nativeButton","handleClick","REASONS.closePress","DialogDescription","idProp","DialogPopupCssVars","DialogPopupDataAttributes","DialogPortalContext","useDialogPortalContext","DialogPopup","finalFocus","descriptionElementId","rootPopupProps","nestedOpenDialogCount","titleElementId","defaultInitialFocus","nestedDialogOpen","inertValue","InternalBackdrop","cutout","otherProps","clipPath","DialogPortal","keepMounted","portalProps","DialogTitle","DialogTrigger","thisTriggerId","floatingContext","isOpenedByThisTrigger","click","localInteractionProps","rootTriggerProps","ComboboxRootContext","ComboboxFloatingContext","ComboboxDerivedItemsContext","ComboboxInputValueContext","useComboboxRootContext","useComboboxFloatingContext","useComboboxDerivedItemsContext","useComboboxInputValueContext","defaultItemEquality","itemValue","selectedValue","compareItemEquality","comparer","selectedValueIncludes","selectedValues","findItemIndex","itemValues","removeItem","serializeValue","isGroupedItems","items","hasNullItemLabel","arrayItems","group","stringifyAsLabel","itemToStringLabel","stringifyAsValue","itemToStringValue","resolveSelectedLabel","flatItems","match","resolveMultipleLabels","selectionMode","selectedItem","FieldControlDataAttributes","DEFAULT_VALIDITY_STATE","DEFAULT_FIELD_STATE_ATTRIBUTES","DEFAULT_FIELD_ROOT_STATE","fieldValidityMapping","FieldRootContext","useFieldRootContext","useRegisterFieldControl","controlRef","getValue","registerFieldControl","sourceRef","source","FormContext","useFormContext","LabelableContext","useLabelableContext","useLabelableId","implicit","controlId","registerControlId","controlIdForEffect","controlSourceRef","hasRegisteredRef","hadExplicitIdRef","unregisterControlId","createCollatorItemFilter","collatorFilter","query","itemString","createSingleSelectionCollatorFilter","selectedString","filterCache","stringifyLocale","locale","getFilter","cachedFilter","collator","filter","itemToString","queryLength","useCoreFilter","NO_ACTIVE_VALUE","INITIAL_LAST_HIGHLIGHT","AriaCombobox","onOpenChangeCompleteProp","defaultSelectedValue","selectedValueProp","onSelectedValueChange","defaultInputValueProp","inputValueProp","onItemHighlightedProp","nameProp","form","disabledProp","readOnly","required","inputRefProp","grid","filteredItemsProp","filterProp","openOnInputClick","autoHighlight","keepHighlight","highlightItemOnHover","isItemEqualToValue","virtualized","inlineProp","fillInputOnItemPress","limit","autoComplete","formAutoComplete","submitOnItemClick","clearErrors","setDirty","validityData","shouldValidateOnChange","setFilled","fieldName","fieldDisabled","setTouched","setFocused","validationMode","validation","queryChangedAfterOpen","setQueryChangedAfterOpen","closeQuery","setCloseQuery","popupRef","inputRef","startDismissRef","endDismissRef","emptyRef","keyboardActiveRef","hadInputClearRef","chipsContainerRef","clearRef","selectionEventRef","lastHighlightRef","pendingQueryHighlightRef","valuesRef","allValuesRef","multiple","single","hasInputValue","hasItems","hasFilteredItemsProp","autoHighlightMode","setSelectedValueUnwrapped","initialDefaultInputValue","inputValue","setInputValueUnwrapped","setOpenUnwrapped","isGrouped","selectedLabelString","shouldBypassFiltering","filterQuery","shouldIgnoreExternalFiltering","filteredItems","groupedItems","resultingGroups","currentCount","candidateItems","remainingLimit","itemsToTake","newGroup","limitedItems","flatFilteredItems","g","fieldRawValue","fieldStringValue","onItemHighlighted","positionerElement","listElement","inputElement","inputGroupElement","inline","inputInsidePopup","triggerRef","getFieldValue","forceMount","initialSelectedValueRef","setIndices","activeValue","setInputValue","REASONS.inputClear","REASONS.inputChange","inputType","hasQuery","setOpen","valueToValidate","setSelectedValue","handleSelection","passedValue","targetEl","overrideEvent","REASONS.itemPress","href","currentSelectedValue","requestSubmit","formElement","handleUnmount","stringVal","resolvedPopupRef","registry","currentValue","lastValue","lastIndex","pendingHighlight","storeActiveIndex","previouslyHighlightedItemValue","isSameItem","nextInputValue","ariaHasPopup","ariaExpanded","isPlainInput","shouldTreatAsInput","shouldApplyAria","REASONS.inputPress","nextActiveIndex","hiddenInputRef","itemsContextValue","serializedValue","hasMultipleSelection","hiddenInputName","hiddenInputs","currentSerializedValue","handleChange","matchingValue","triggerStateAttributesMapping","empty","getPseudoElementBounds","elementRect","beforeStyles","afterStyles","beforeWidth","beforeHeight","afterWidth","afterHeight","totalWidth","totalHeight","widthDiff","heightDiff","resolveAriaLabelledBy","fieldLabelId","localLabelId","BOUNDARY_OFFSET","ComboboxTrigger","fieldState","comboboxDisabled","popupSideValue","rootId","comboboxLabelId","hasSelectedValue","focusTimeout","listEmpty","popupSide","ariaLabelledBy","trackPointerType","triggerTypeaheadProps","nextSelectedValue","triggerClickProps","setTriggerElement","handleMouseUp","mouseEvent","mouseUpTarget","positioner","bounds","withinHorizontal","withinVertical","ComboboxChipsContext","useComboboxChipsContext","ComboboxPositionerContext","useComboboxPositionerContext","ComboboxInternalDismissButton","mergedRef","handleDismiss","dismissProps","ComboboxInput","comboboxChipsContext","hasPositionerParent","autoHighlightEnabled","isInsidePopup","focusManagerModal","fieldStateForInput","composingValue","setComposingValue","lastActiveIndexRef","shouldRestoreActiveIndexRef","setInputElement","nextIsInsidePopup","validationProps","handleKeyDown","highlightedChipIndex","renderedChipsCount","computedNextIndex","autofillLikeInput","shouldOpenOnInput","nextVal","trimmed","shouldMaintainHighlight","clearDetails","scrollAmount","cursor","isClear","removalIndex","hadHighlightedChip","listItem","handleInputPress","shouldIgnoreTarget","ComboboxClear","hasSelectionChips","visible","REASONS.clearPress","GroupCollectionContext","useGroupCollectionContext","GroupCollectionProvider","ComboboxCollection","itemsToRender","ComboboxList","_ComboboxCollection","hasPositionerContext","setPositionerElement","setListElement","resolvedChildren","LIVE_REGION_MARKER","INITIAL_LIVE_REGION_TEXT_MUTATION_RESET_DELAY","findLastTextNode","walker","lastTextNode","textNode","useInitialLiveRegionTextMutation","rootRef","originalValue","markedValue","ComboboxPortalContext","useComboboxPortalContext","ComboboxPortal","forceMounted","baseArrow","arrowDimensions","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","center","shouldAddOffset","alignmentOffset","arrow","anchorHidden","nativeHide","DEFAULT_SIDES","adaptiveOrigin","rawX","rawY","floatRect","offsetDimensions","currentSide","sideX","sideY","getLogicalSide","sideParam","renderedSide","isRtl","isLogicalSideParam","getOffsetData","useAnchorPositioning","anchor","positionMethod","sideOffset","align","alignOffset","collisionBoundary","collisionPaddingParam","sticky","arrowPadding","disableAnchorTracking","collisionAvoidance","shiftCrossAxis","lazyFlip","mountSide","setMountSide","collisionAvoidanceSide","collisionAvoidanceAlign","collisionAvoidanceFallbackAxisSide","anchorFn","anchorFnCallback","anchorDep","anchorValueRef","mountedRef","collisionPadding","bias","biasTop","biasBottom","biasLeft","biasRight","commonCollisionProps","arrowRef","sideOffsetRef","alignOffsetRef","alignAxis","shiftDisabled","crossAxisShiftEnabled","flipMiddleware","shiftMiddleware","limitData","arrowSize","offsetAmount","floatingStyle","anchorWidth","anchorHeight","renderedPlacement","currentRenderedSide","currentRenderedAxis","arrowEl","arrowX","arrowY","arrowWidth","arrowHeight","transformX","transformY","shiftY","halfAnchorHeight","sideOffsetValue","isOverlappingAnchor","adjacentTransformOrigin","overlapTransformOrigin","autoUpdateOptions","isPositioned","originalFloatingStyles","resolvedPosition","base","registeredPositionReferenceRef","anchorValue","resolvedAnchor","finalAnchor","isRef","logicalRenderedSide","renderedAlign","arrowStyles","arrowUncentered","getDisabledMountTransitionStyles","usePositioner","hidden","VIEWPORT_WIDTH_TOLERANCE_PX","useAnchoredPopupScrollLock","touchOpen","touchOpenShouldLockScroll","setTouchOpenShouldLockScroll","viewportWidth","popupWidth","ComboboxPositioner","positioning","ComboboxPopup","resolvedFinalFocus","ComboboxGroupContext","useComboboxGroupContext","ComboboxGroup","labelId","setLabelId","wrappedElement","ComboboxGroupLabel","ComboboxItemContext","useComboboxItemContext","ComboboxRowContext","useComboboxRowContext","ComboboxItem","indexProp","didPointerDownRef","isRow","selectable","hasRegistered","highlighted","matchesSelectedValue","itemRef","visibleMap","lastSelectedValue","rootProps","commitSelection","selectItem","defaultProps","pointerStartedOnItem","ComboboxEmpty","childrenProp","Separator","Button","CheckboxRootDataAttributes","useStateAttributesMapping","FieldItemContext","useFieldItemContext","useAriaLabelledBy","explicitAriaLabelledBy","labelSourceRef","enableFallback","labelSourceId","fallbackAriaLabelledBy","setFallbackAriaLabelledBy","generatedLabelId","nextAriaLabelledBy","getAriaLabelledBy","labelSource","findAssociatedLabel","nextSibling","labels","CheckboxGroupContext","useCheckboxGroupContext","CheckboxRootContext","useCheckboxRootContext","PARENT_CHECKBOX","CheckboxRoot","checkedProp","defaultChecked","ariaLabelledByProp","indeterminate","onCheckedChangeProp","uncheckedValue","valueProp","rootDisabled","localValidation","fieldItemContext","getDescriptionProps","isGroupedWithParent","inputId","groupProps","onCheckedChange","groupChecked","groupIndeterminate","groupOnChange","otherGroupProps","groupValue","setGroupValue","defaultGroupValue","checked","setCheckedState","controlSource","mergedInputRef","nextChecked","nextGroupValue","computedChecked","computedIndeterminate","disabledStates","inputEl","CheckboxIndicator","rootState","rendered","indicatorRef","baseStateAttributesMapping","shouldRender","ComboboxRoot","onValueChange","ComboboxItemIndicator","Inner","ComboboxChips","setHighlightedChipIndex","chipsRef","ComboboxChipContext","useComboboxChipContext","ComboboxChip","ComboboxChipRemove","clearActiveIndexForRemovedItem","removedItem","removedIndex","removeChip","REASONS.chipRemovePress","ContextMenuRootContext","useContextMenuRootContext","MenuPositionerContext","useMenuPositionerContext","MenuRootContext","useMenuRootContext","MenuArrow","MenuCheckboxItemContext","useMenuCheckboxItemContext","useMenuItemCommonProps","closeOnClick","typingRef","itemMetadata","menuEvents","contextMenuContext","isContextMenu","initialCursorPoint","REGULAR_ITEM","useMenuItem","MenuCheckboxItemDataAttributes","itemMapping","MenuCheckboxItem","menuPositionerContext","itemProps","setChecked","currentlyChecked","MenuCheckboxItemIndicator","MenuGroupContext","useMenuGroupRootContext","MenuGroup","MenuGroupLabel","MenuItem","ToolbarRootContext","useToolbarRootContext","MenuPopup","insideToolbar","instantType","lastOpenChangeReason","floatingTreeRoot","activeTriggerElement","hoverEnabled","setPopupElement","MenuPortalContext","useMenuPortalContext","MenuPortal","MenuPositioner","anchorProp","positionMethodProp","alignProp","sideOffsetProp","alignOffsetProp","collisionAvoidanceProp","hasViewport","floatingNodeId","floatingParentNodeId","previousTriggerRef","computedSide","computedAlign","contextMenu","onMenuOpenChange","REASONS.siblingOpen","onParentClose","closeTimeout","onItemHover","previousTrigger","menubarModal","shouldRenderBackdrop","backdropCutout","MenuRadioGroupContext","useMenuRadioGroupContext","MenuRadioGroup","onValueChangeProp","setValueUnwrapped","MenuRadioItemContext","useMenuRadioItemContext","MenuRadioItem","groupDisabled","MenuRadioItemIndicator","MenubarContext","useMenubarContext","MenuStore","keyboardEventRelay","nextRootId","nextFloatingTreeRoot","nextKeyboardEventRelay","MenuSubmenuRootContext","useMenuSubmenuRootContext","MenuRoot","modalProp","closeParentOnEsc","parentMenuRootContext","menubarContext","isSubmenu","parentFromContext","floatingNodeIdFromContext","floatingParentNodeIdFromContext","openEventRef","interactionTypeProps","allowOutsidePressDismissalRef","allowOutsidePressDismissalTimeout","allowTouchToCloseRef","allowTouchToCloseTimeout","activeOption","isKeyboardClick","isDismissClose","createMenuEventDetails","ctx","floatingEvents","handleSetOpenEvent","setActiveIndex","nextTyping","typeahead","relay","content","useCompositeItem","highlightedIndex","onHighlightedIndexChange","isHighlighted","CompositeItem","tag","compositeProps","compositeRef","findRootOwnerId","useTriggerFocusGuards","preFocusGuardRef","handlePreFocusGuardFocus","handleFocusTargetFocus","nextTabbable","useMixedToggleClickHandler","mouseDownAction","ignoreClickRef","MenuTrigger","openOnHoverProp","isTriggerActive","useMenuParent","floatingTreeRootFromContext","isInMenubar","allowMouseUpTriggerTimeout","handleDocumentMouseUp","REASONS.cancelOpen","parentMenubarHasSubmenuOpen","hoverProps","useStickIfOpen","focus","mixedToggleHandlers","openReason","stickIfOpenTimeout","setStickIfOpen","usePreviousValue","CSPContext","DEFAULT_CSP_CONTEXT_VALUE","useCSPContext","FieldsetRootContext","useFieldsetRootContext","FieldControl","autoFocus","hasExternalValue","valueUnwrapped","Input","Field.Control","ACTIVE_COMPOSITE_ITEM","useCompositeRoot","itemSizes","externalHighlightedIndex","externalSetHighlightedIndex","externalRef","enableHomeAndEndKeys","stopEventPropagation","modifierKeys","internalHighlightedIndex","internalSetHighlightedIndex","isGrid","hasSetDefaultIndexRef","shouldScrollIntoView","newActiveItem","sortedElements","activeItem","compositeElement","wrappedOnLoop","RELEVANT_KEYS","isModifierKeySet","horizontalForwardKey","forwardKey","horizontalBackwardKey","backwardKey","selectionStart","selectionEnd","textContent","forwardKeys","backwardKeys","preventedKeys","ignoredModifierKeys","CompositeRoot","highlightedIndexProp","onHighlightedIndexChangeProp","onMapChangeUnwrapped","relayKeyboardEvent","getFormatter","optionsString","cachedFormatter","formatter","formatNumber","formatNumberValue","format","valueToPercent","PopoverRootContext","usePopoverRootContext","PopoverStore","initial","isHover","changeState","PopoverRootComponent","interactionTypeTriggerProps","createPopoverEventDetails","popoverContext","PopoverRoot","OPEN_DELAY","PopoverTrigger","openOnHover","localProps","PopoverPortalContext","usePopoverPortalContext","PopoverPortal","PopoverPositionerContext","usePopoverPositionerContext","PopoverPositioner","prevTriggerElementRef","currentTriggerElement","prevTriggerElement","ac","ClosePartContext","useClosePartCount","closePartCount","setClosePartCount","count","ClosePartProvider","useClosePartRegistration","PopoverPopup","closePartContext","hasClosePart","titleId","descriptionId","PopoverArrow","PopoverClose","FloatingPortalLite","ProgressRootContext","useProgressRootContext","ProgressRootDataAttributes","progressStateAttributesMapping","getDefaultAriaValueText","formattedValue","ProgressRoot","getAriaValueText","formatOptionsRef","status","ProgressTrack","ProgressIndicator","percentageValue","RadioRootDataAttributes","RadioGroupContext","useRadioGroupContext","RadioRootContext","useRadioRootContext","RadioRoot","readOnlyProp","requiredProp","disabledGroup","readOnlyGroup","requiredGroup","formGroup","checkedValue","touched","setCheckedValue","registerControlRef","registerInputRef","setFieldTouched","radioRef","handleControlRef","hiddenInputId","isRadioGroup","RadioIndicator","RadioGroup","externalValue","fieldsetContext","setCheckedValueUnwrapped","groupInputRef","firstEnabledInputRef","setInputRef","hiddenInput","isDisabled","currentInput","fallbackInput","ariaLabelledby","DISABLE_SCROLLBAR_CLASS_NAME","styleDisableScrollbar","nonce","SCROLL_EDGE_TOLERANCE_PX","getMaxScrollOffset","scrollSize","normalizeScrollOffset","clamped","startDistance","endDistance","withinStartTolerance","withinEndTolerance","SelectRootContext","SelectFloatingContext","useSelectRootContext","useSelectFloatingContext","storeValue","SelectRoot","generatedId","scrollHandlerRef","scrollArrowsMountedCountRef","selectedItemTextRef","selectionRef","alignItemWithTriggerActiveRef","previousOpenMethod","renderedOpenMethod","initialValueRef","handleScrollArrowVisibility","scroller","maxScrollTop","shouldShowUp","shouldShowDown","typing","mergedTriggerProps","SELECTED_DELAY","UNSELECTED_DELAY","SelectTrigger","selectDisabled","selectLabelId","shouldCheckNullItemLabel","positionerRef","timeoutFocus","timeoutMouseDown","selectedDelayTimeout","unselectedDelayTimeout","ariaControlsId","SelectValue","placeholder","hasNullLabel","SelectIcon","SelectPortalContext","SelectPortal","SelectPositionerContext","useSelectPositionerContext","clearStyles","originalStyles","LIST_FUNCTIONAL_STYLES","FIXED","SelectPositioner","alignItemWithTrigger","scrollUpArrowRef","scrollDownArrowRef","controlledAlignItemWithTrigger","setControlledAlignItemWithTrigger","alignItemWithTriggerActive","positionerStyles","prevMapSizeRef","prevSize","initialSelectedValue","hasVisibleItem","selectedItemValue","stylesToClear","SelectPopup","disableStyleElements","reachedMaxHeightRef","initialPlacedRef","originalPositionerStylesRef","scrollArrowFrame","handleScroll","isTopPositioned","isBottomPositioned","currentHeight","normalizeSize","marginTop","marginBottom","maxPopupHeight","getMaxPopupHeight","maxAvailableHeight","getMaxScrollTop","nextPositionerHeight","nextScrollTop","setReachedMax","scrollToMax","setHeight","handleSmallDiff","targetScrollTop","heightDelta","nextHeight","overshoot","nextMaxScrollTop","restoreTransformStyles","unsetTransformStyles","textElement","valueElement","popupStyles","triggerRect","normalizeRect","positionerRect","triggerHeight","scrollHeight","borderBottom","minHeight","paddingLeft","paddingRight","triggerCollisionThreshold","viewportHeight","availableSpaceBeneathTrigger","textRect","alignedLeft","valueRect","valueCenterFromTriggerTop","idealHeight","maxHeight","maxRight","fallbackToAlignPopupToTrigger","isPinchZoomed","initialHeight","topOffset","popupTop","popupHeight","textCenterY","transformOriginY","clampedY","REASONS.windowResize","maxHeightStyle","floatingPlatform","TRANSFORM_STYLE_RESETS","property","SelectItemContext","useSelectItemContext","SelectItem","selectedByFocus","selectedCandidate","lastKeyRef","disallowSelectedMouseUp","disallowUnselectedMouseUp","SelectItemIndicator","SelectItemText","localRef","hasNoSelectedItemText","SelectScrollArrow","isUp","visibleSelector","stateVisible","scrollArrowRef","scrollNextItem","isScrolledToEdge","scrollArrowHeight","getTargetScrollTop","clientHeight","firstVisibleIndex","visibleTop","targetIndex","targetItem","lastVisibleIndex","visibleBottom","SelectScrollDownArrow","SelectScrollUpArrow","SelectGroupContext","useSelectGroupContext","SelectGroup","SelectGroupLabel","useIsHydrating","SwitchRootContext","useSwitchRootContext","SwitchRootDataAttributes","SwitchRoot","externalInputRef","handleInputRef","switchRef","SwitchThumb","extendedState","TabsRootContext","useTabsRootContext","TabsRootDataAttributes","tabsStateAttributesMapping","TabsRoot","defaultValueProp","hasExplicitDefaultValueProp","tabPanelRefs","mountedTabPanels","setMountedTabPanels","tabMap","setTabMap","getTabElementBySelectedValue","tabElement","tabMetadata","activationDirectionState","setActivationDirectionState","previousValue","committedTabActivationDirection","tabActivationDirection","directionComputationIncomplete","computeActivationDirection","nextPreviousValue","shouldSyncActivationDirectionState","activationDirection","registerMountedTabPanel","panelValue","panelId","unregisterMountedTabPanel","getTabPanelIdByValue","tabValue","getTabIdByPanelValue","tabPanelValue","tabsContextValue","selectedTabMetadata","firstEnabledTabValue","selectionIsDisabled","selectionIsMissing","fallbackValue","oldTab","newTab","oldRect","newRect","TabsListContext","useTabsListContext","TabsTab","activeTabValue","activateOnFocus","highlightedTabIndex","onTabActivation","registerTabResizeObserverElement","setHighlightedTabIndex","tabsListElement","isNavigatingRef","tabElementRef","tabPanelId","isPressingRef","isMainButtonRef","handlePointerUp","script","TabsIndicatorCssVars","TabsIndicator","renderBeforeHydration","registerIndicatorUpdateListener","isHydrating","rerender","isTabSelected","activeTab","computedWidth","computedHeight","tabListWidth","tabListHeight","tabRect","tabsListRect","scaleX","scaleY","tabLeftDelta","tabTopDelta","activeTabPosition","activeTabSize","displayIndicator","prehydrationScript","TabsPanelDataAttributes","TabsPanel","listItemRef","correspondingTabId","panelRef","TabsList","setTabsListElement","indicatorUpdateListenersRef","tabResizeObserverElementsRef","resizeObserverRef","notifyIndicatorUpdateListeners","tabsListContextValue","ToastContext","useToastProviderContext","counter","generateId","resolvePromiseOptions","resolvedOptions","toastMapSelector","toasts","visibleIndex","toast","toastIndex","isEnding","toastMap","ToastStore","focused","hovering","isWindowFocused","prevFocusElement","viewport","timer","toastId","behavior","newToasts","existingToast","ignoredId","ignoredTransitionStatus","updates","toastToAdd","updatedToasts","activeToasts","t","excessCount","oldestActiveToasts","limitedIds","limited","duration","prevToast","nextToast","nextTimeout","prevTimeout","timeoutUpdated","shouldHaveTimer","hasTimer","timeoutChanged","wasLoading","closeAll","toastsToClose","isLimited","promiseValue","loadingOptions","handledPromise","successOptions","errorOptions","elapsed","remaining","shouldStartActive","currentTimeout","isFocusVisible","ToastProvider","toastManager","action","ToastViewportCssVars","ToastViewport","windowFocusTimeout","handlingFocusGuardRef","markedReadyForMouseLeaveRef","touchActiveRef","isEmpty","expanded","frontmostHeight","hasTransitioningToasts","handleGlobalKeyDown","handleWindowBlur","handleWindowFocus","handleFocusGuard","flushMouseLeave","hasEndingToasts","handleMouseEnter","handleMouseLeave","handlePointerEnd","handleFocus","handleBlur","highPriorityToasts","ToastRootContext","useToastRootContext","ToastRootCssVars","SWIPE_THRESHOLD","REVERSE_CANCEL_THRESHOLD","OPPOSITE_DIRECTION_DAMPING_FACTOR","MIN_DRAG_THRESHOLD","TOAST_SWIPE_IGNORE_SELECTOR","getDisplacement","getElementTransform","translateX","translateY","matrix","ToastRoot","swipeDirection","isAnchored","swipeDirections","swipeEnabled","currentSwipeDirection","setCurrentSwipeDirection","isSwiping","setIsSwiping","isRealSwipe","setIsRealSwipe","dragDismissed","setDragDismissed","dragOffset","setDragOffset","initialTransform","setInitialTransform","setTitleId","setDescriptionId","lockedDirection","setLockedDirection","dragStartPosRef","initialTransformRef","intendedSwipeDirectionRef","maxSwipeDisplacementRef","cancelledSwipeRef","swipeCancelBaselineRef","isFirstPointerMoveRef","domIndex","recalculateHeight","flushSync","previousHeight","applyDirectionalDamping","newDeltaX","newDeltaY","handlePointerMove","movementX","movementY","cancelDeltaY","cancelDeltaX","hasHorizontal","hasVertical","absX","absY","currentDisplacement","dampedDelta","newOffsetX","newOffsetY","shouldClose","dismissDirection","handlePointerCancel","preventDefaultTouchStart","getDragStyles","isHighPriority","toastRoot","ToastDescription","ToastTitle","ToastClose","hasFocus","setHasFocus","useToastManager","TooltipRootContext","useTooltipRootContext","TooltipStore","isFocusOpen","TooltipRoot","disableHoverablePopup","trackCursorAxis","openState","REASONS.disabled","previousInstantTypeRef","createTooltipEventDetails","clientPoint","TooltipProviderContext","useTooltipProviderContext","TooltipTriggerDataAttributes","TooltipTrigger","delayWithDefault","closeDelayWithDefault","providerContext","providerDelay","groupOpenValue","computedRestMs","closeValue","computedCloseDelay","focusProps","TooltipPortalContext","useTooltipPortalContext","TooltipPortal","TooltipPositionerContext","useTooltipPositionerContext","TooltipPositioner","TooltipPopup","TooltipArrow","variant","fullWidth","baseStyles","variants","jsx","BaseButton","Avatar","src","alt","rounded","sizeClasses","statusColors","radiusClass","jsxs","Badge","dot","BaseInput","IconButton","activeStyles","Tooltip","BaseTooltipProvider","BaseTooltip.Trigger","BaseTooltip.Portal","BaseTooltip.Positioner","BaseTooltip.Popup","BaseTooltip.Arrow","BaseTooltip.Root","Popover","BasePopover.Root","BasePopover.Trigger","PopoverContent","BasePopover.Portal","BasePopover.Positioner","BasePopover.Popup","BasePopover.Arrow","BasePopover.Close","PopoverHeader","PopoverBody","PopoverFooter","ImperativePopoverContext","createContext","ImperativePopoverProvider","show","useCallback","ImperativePopoverPortal","useImperativePopover","useContext","mergeClasses","classes","toKebabCase","toCamelCase","p1","p2","toPascalCase","camelCase","defaultAttributes","hasA11yProp","Icon","forwardRef","color","strokeWidth","absoluteStrokeWidth","iconNode","rest","createElement","attrs","createLucideIcon","iconName","Component","__iconNode","Check","ChevronDown","ChevronRight","ChevronUp","CircleCheckBig","CircleX","Info","Minus","TriangleAlert","X","Menu","BaseMenu.Root","BaseMenu.Trigger","MenuContent","BaseMenu.Portal","BaseMenu.Positioner","BaseMenu.Popup","BaseMenu.Arrow","onSelect","destructive","BaseMenu.Item","BaseMenu.CheckboxItem","BaseMenu.CheckboxItemIndicator","BaseMenu.RadioGroup","BaseMenu.RadioItem","BaseMenu.RadioItemIndicator","MenuLabel","MenuSeparator","BaseMenu.Separator","MenuSub","MenuSubTrigger","MenuSubContent","MenuItemWithIcon","icon","shortcut","ContextMenuContext","ContextMenu","controlledOpen","uncontrolledOpen","setUncontrolledOpen","anchorEl","setAnchorEl","handleOpenChange","ContextMenuTrigger","handleContextMenu","virtualEl","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","ContextMenuRadioGroup","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuSub","ContextMenuSubTrigger","ContextMenuSubContent","ContextMenuItemWithIcon","Dialog","title","description","showCloseButton","BaseDialog.Root","BaseDialog.Portal","BaseDialog.Backdrop","BaseDialog.Popup","BaseDialog.Title","BaseDialog.Description","BaseDialog.Close","DialogHeader","DialogBody","DialogFooter","asChild","BaseDialog.Trigger","DialogImperativeContext","DialogProvider","dialogs","setDialogs","removeDialog","resolve","confirm","alert","dialog","ImperativeDialogItem","onRemove","useDialog","variantConfig","CheckCircle","AlertTriangle","XCircle","AlertDialog","confirmText","cancelText","onConfirm","onCancel","showCancel","confirmButtonVariant","isLoading","setIsLoading","buttonVariant","handleConfirm","handleCancel","AlertDialogTrigger","Form","onSubmit","initialValues","validate","setValues","errors","setErrors","setFieldValue","isTouched","setFieldError","handleSubmit","validationErrors","allTouched","FormField","FormInput","FormTextarea","FormSelect","option","FormCheckbox","FormActions","itemClass","Select","groups","internalValue","setInternalValue","allOptions","selectedLabel","opt","handleValueChange","BaseSelect.Root","BaseSelect.Trigger","BaseSelect.Value","BaseSelect.Icon","BaseSelect.Portal","BaseSelect.Positioner","BaseSelect.ScrollUpArrow","BaseSelect.Popup","BaseSelect.Group","BaseSelect.GroupLabel","BaseSelect.ScrollDownArrow","BaseSelect.Item","BaseSelect.ItemIndicator","BaseSelect.ItemText","Checkbox","checkboxId","rootEl","BaseCheckbox.Root","BaseCheckbox.Indicator","BaseRadioGroup","Radio","radioId","radioEl","BaseRadio.Root","BaseRadio.Indicator","rootSizes","thumbSizes","Switch","switchId","switchEl","BaseSwitch.Root","BaseSwitch.Thumb","Tabs","BaseTabs.Root","TabList","BaseTabs.List","BaseTabs.Indicator","Tab","BaseTabs.Tab","TabPanel","BaseTabs.Panel","variantColor","trackSizes","Progress","showValue","BaseProgress.Root","BaseProgress.Track","BaseProgress.Indicator","ToastPositionContext","positionClasses","defaultPosition","setPosition","BaseToast.Provider","useToast","manager","BaseToast.useToastManager","BaseToast.Viewport","ToastItem","typeConfig","BaseToast.Root","BaseToast.Title","BaseToast.Description","BaseToast.Close","spinnerSize","dotSize","labelSize","barHeight","Spinner","Dots","Bar","Loading","centered","indicator","AutoComplete","controlledValue","onInputChange","clearable","emptyMessage","listboxId","inputText","setInputText","found","filtered","q","selectOption","clearSelection","handleInputChange","handleInputFocus","enabledItems","matched","showClear","isSelected","inputGroupStyles","inputStyles","itemStyles","Combobox","BaseCombobox.Root","BaseCombobox.Input","BaseCombobox.Clear","BaseCombobox.Trigger","BaseCombobox.Portal","BaseCombobox.Positioner","BaseCombobox.Popup","BaseCombobox.Empty","BaseCombobox.List","BaseCombobox.Group","BaseCombobox.GroupLabel","ComboboxMultiple","BaseCombobox.Chips","BaseCombobox.Chip","BaseCombobox.ChipRemove","BaseCombobox.Item","BaseCombobox.ItemIndicator","DropdownSelectContext","Dropdown","DropdownTrigger","DropdownContent","DropdownItem","contextOnSelect","handleSelect","DropdownLabel","DropdownSeparator","DropdownGroup","BaseMenu.Group","BaseMenu.GroupLabel","DropdownOptionList","Fragment","DropdownGroupList","DropdownSub","DropdownSubTrigger","DropdownSubContent","DropdownContext","DropdownProvider","ImperativeDropdownPortal","useDropdown"],"mappings":";;;;AAAA,SAASA,GAAE,GAAE;AAAC,MAAI,GAAEC,GAAEC,IAAE;AAAG,MAAa,OAAO,KAAjB,YAA8B,OAAO,KAAjB,SAAmB,CAAAA,KAAG;AAAA,WAAoB,OAAO,KAAjB,SAAmB,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAIC,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAEA,GAAE,IAAI,GAAE,CAAC,MAAIF,IAAED,GAAE,EAAE,CAAC,CAAC,OAAKE,MAAIA,KAAG,MAAKA,KAAGD;AAAA,EAAE,MAAM,MAAIA,KAAK,EAAE,GAAEA,CAAC,MAAIC,MAAIA,KAAG,MAAKA,KAAGD;AAAG,SAAOC;AAAC;AAAQ,SAASE,KA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A,CAAa,IAElE,gBAAA5T,EAACkU,MAAmB,SAASr0F,EAAQ,WAAW,CAAA,GAAI,UAAU+zF,EAAA,CAAa;AAAA,QAAA;AAAA,MAAA;AAAA,IAEjF;AAAA,EAAA,GAEJ,EAAA,CACF;AAEN;AAyBO,SAASe,KAAkC;AAChD,QAAM59B,IAAM2rB,GAAW8R,EAAe;AACtC,MAAI,CAACz9B,EAAK,OAAM,IAAI,MAAM,oDAAoD;AAC9E,SAAOA;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358]}
|