@iress-oss/ids-components 6.0.0-alpha.0 → 6.0.0-alpha.2
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/README.md +1 -1
- package/dist/Autocomplete-C5ubHBTi.js +358 -0
- package/dist/{Button-BXzmntRi.js → Button-mmhMLwp9.js} +89 -85
- package/dist/Provider-8wS70V56.js +64 -0
- package/dist/{TableProvider-D8SQKIG8.js → TableProvider-bdUNuoG-.js} +11 -21
- package/dist/components/Alert/Alert.js +34 -35
- package/dist/components/Alert/Alert.styles.js +15 -15
- package/dist/components/Alert/index.js +4 -5
- package/dist/components/Autocomplete/Autocomplete.js +17 -82
- package/dist/components/Autocomplete/Autocomplete.styles.js +1 -1
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +36 -35
- package/dist/components/Autocomplete/index.js +6 -4
- package/dist/components/Badge/Badge.js +3 -3
- package/dist/components/Badge/Badge.styles.js +5 -5
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/CloseButton/CloseButton.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.styles.js +1 -1
- package/dist/components/ButtonGroup/hooks/useButtonGroupItem.js +11 -12
- package/dist/components/Card/Card.js +2 -2
- package/dist/components/Card/Card.styles.js +17 -17
- package/dist/components/Checkbox/Checkbox.js +85 -86
- package/dist/components/Checkbox/Checkbox.styles.js +6 -6
- package/dist/components/CheckboxGroup/CheckboxGroup.js +69 -74
- package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +11 -11
- package/dist/components/CheckboxMark/CheckboxMark.js +2 -2
- package/dist/components/CheckboxMark/CheckboxMark.styles.js +2 -2
- package/dist/components/Col/Col.js +1 -1
- package/dist/components/Col/Col.styles.js +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/Container/Container.styles.js +4 -3
- package/dist/components/Divider/Divider.js +2 -2
- package/dist/components/Divider/Divider.styles.js +2 -2
- package/dist/components/Expander/Expander.js +46 -41
- package/dist/components/Expander/Expander.styles.js +5 -5
- package/dist/components/Field/Field.js +55 -54
- package/dist/components/Field/Field.styles.js +17 -10
- package/dist/components/Field/FieldGroup/FieldGroup.js +40 -40
- package/dist/components/Field/FieldGroup/FieldGroup.styles.js +6 -6
- package/dist/components/Field/components/FieldFooter.js +32 -32
- package/dist/components/Field/components/FieldHint.js +3 -3
- package/dist/components/Filter/Filter.js +213 -100
- package/dist/components/Filter/Filter.styles.js +4 -4
- package/dist/components/Filter/components/FilterResetButton.js +17 -18
- package/dist/components/Filter/components/FilterResultsDescriptor.js +6 -6
- package/dist/components/Filter/components/FilterSearch.js +18 -19
- package/dist/components/Filter/index.js +2 -2
- package/dist/components/Hide/Hide.js +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/Icon/Icon.styles.js +1 -1
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/Image.styles.js +1 -1
- package/dist/components/Inline/Inline.js +1 -1
- package/dist/components/Inline/Inline.styles.js +2 -2
- package/dist/components/Input/Input.js +102 -108
- package/dist/components/Input/Input.styles.js +8 -8
- package/dist/components/Input/InputBase/InputBase.js +23 -23
- package/dist/components/Label/Label.styles.js +4 -4
- package/dist/components/Label/LabelBase/LabelBase.js +32 -32
- package/dist/components/Link/Link.js +50 -51
- package/dist/components/Link/Link.styles.js +4 -3
- package/dist/components/Menu/Menu.js +51 -51
- package/dist/components/Menu/Menu.styles.js +12 -12
- package/dist/components/Menu/MenuDivider/MenuDivider.js +13 -13
- package/dist/components/Menu/MenuItem/MenuItem.js +144 -146
- package/dist/components/Menu/MenuItem/hooks/useMenuItemRole.js +5 -5
- package/dist/components/Menu/MenuText/MenuText.js +38 -38
- package/dist/components/Modal/Modal.js +115 -125
- package/dist/components/Modal/Modal.styles.js +22 -13
- package/dist/components/Modal/ModalProvider.js +20 -22
- package/dist/components/Modal/hooks/useModal.js +9 -7
- package/dist/components/Modal/hooks/useProviderModal.js +8 -8
- package/dist/components/Modal/index.js +7 -6
- package/dist/components/Panel/Panel.js +1 -1
- package/dist/components/Panel/Panel.styles.js +1 -1
- package/dist/components/Placeholder/Placeholder.js +14 -14
- package/dist/components/Placeholder/Placeholder.styles.js +1 -1
- package/dist/components/Popover/InputPopover/InputPopover.js +89 -14
- package/dist/components/Popover/InputPopover/InputPopoverActivator.js +31 -34
- package/dist/components/Popover/Popover.js +44 -43
- package/dist/components/Popover/Popover.styles.js +2 -2
- package/dist/components/Popover/components/NestedPopoverActivator.js +1 -1
- package/dist/components/Popover/components/PopoverActivator.js +48 -53
- package/dist/components/Popover/components/PopoverContent.js +33 -33
- package/dist/components/Popover/helpers/composeFloatingProps.js +23 -26
- package/dist/components/Popover/helpers/handlePopoverTabKey.js +11 -14
- package/dist/components/Popover/hooks/usePopover.js +79 -75
- package/dist/components/Popover/hooks/usePopoverActivatorInteractions.js +23 -26
- package/dist/components/Popover/hooks/usePopoverItem.js +16 -17
- package/dist/components/Popover/hooks/usePopoverNavigation.js +22 -22
- package/dist/components/Popover/index.js +6 -6
- package/dist/components/Progress/Progress.js +35 -41
- package/dist/components/Progress/Progress.styles.js +4 -4
- package/dist/components/Provider/Provider.js +12 -35
- package/dist/components/Provider/index.js +1 -1
- package/dist/components/Radio/Radio.js +86 -81
- package/dist/components/Radio/Radio.styles.js +6 -6
- package/dist/components/RadioGroup/RadioGroup.js +69 -77
- package/dist/components/RadioGroup/RadioGroup.styles.js +5 -5
- package/dist/components/Readonly/Readonly.js +44 -43
- package/dist/components/Readonly/Readonly.styles.js +12 -17
- package/dist/components/RichSelect/RichSelect.js +21 -86
- package/dist/components/RichSelect/RichSelect.styles.js +10 -10
- package/dist/components/RichSelect/SelectBody/SelectBody.js +23 -117
- package/dist/components/RichSelect/SelectBody/SelectBody.styles.js +1 -1
- package/dist/components/RichSelect/SelectCreate/SelectCreate.js +25 -114
- package/dist/components/RichSelect/SelectHeading/SelectHeading.js +67 -97
- package/dist/components/RichSelect/SelectLabel/SelectLabel.js +19 -19
- package/dist/components/RichSelect/SelectLabel/SelectLabel.styles.js +6 -6
- package/dist/components/RichSelect/SelectMenu/SelectMenu.js +69 -69
- package/dist/components/RichSelect/SelectMenu/SelectMenu.styles.js +1 -1
- package/dist/components/RichSelect/SelectMenu/SelectMenuItem.js +52 -46
- package/dist/components/RichSelect/SelectSearch/SelectSearch.js +43 -98
- package/dist/components/RichSelect/SelectSearch/SelectSearch.styles.js +1 -1
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.js +31 -32
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.styles.js +1 -1
- package/dist/components/RichSelect/SelectTags/SelectTags.js +159 -105
- package/dist/components/RichSelect/SelectTags/SelectTags.styles.js +4 -4
- package/dist/components/RichSelect/components/SelectActivator.js +63 -6
- package/dist/components/RichSelect/components/SelectOptions.js +201 -95
- package/dist/components/RichSelect/index.js +18 -15
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Row/Row.styles.js +1 -1
- package/dist/components/Select/Select.js +71 -71
- package/dist/components/Select/Select.styles.js +9 -9
- package/dist/components/Select/SelectOption/SelectOption.js +1 -1
- package/dist/components/Select/components/SelectControl.js +1 -1
- package/dist/components/Select/components/SelectReadonly.js +30 -33
- package/dist/components/Select/helpers/nodesToSelectOptions.js +19 -20
- package/dist/components/Skeleton/Skeleton.styles.js +2 -2
- package/dist/components/SkipLink/SkipLink.js +1 -1
- package/dist/components/SkipLink/SkipLink.styles.js +3 -3
- package/dist/components/Slideout/Slideout.js +161 -161
- package/dist/components/Slideout/Slideout.styles.js +8 -8
- package/dist/components/Slideout/SlideoutProvider.js +18 -20
- package/dist/components/Slideout/components/SlideoutInner.js +3 -3
- package/dist/components/Slideout/hooks/useProviderSlideout.js +8 -8
- package/dist/components/Slideout/hooks/usePushElement.js +27 -27
- package/dist/components/Slideout/hooks/useSlideout.js +11 -9
- package/dist/components/Slideout/index.js +7 -6
- package/dist/components/Slider/Slider.js +76 -76
- package/dist/components/Slider/Slider.styles.js +4 -4
- package/dist/components/Slider/components/SliderTicks.js +15 -16
- package/dist/components/Spinner/Spinner.styles.js +1 -1
- package/dist/components/Stack/Stack.js +1 -1
- package/dist/components/Stack/Stack.styles.js +4 -4
- package/dist/components/TabSet/Tab/Tab.js +88 -88
- package/dist/components/TabSet/Tab/Tab.styles.js +3 -3
- package/dist/components/TabSet/TabSet.js +80 -67
- package/dist/components/TabSet/TabSet.styles.js +4 -4
- package/dist/components/TabSet/TabSetProvider.js +43 -43
- package/dist/components/Table/Table.js +39 -39
- package/dist/components/Table/Table.styles.js +10 -8
- package/dist/components/Table/TableBody/TableBody.js +76 -76
- package/dist/components/Table/TableFormattedValue/TableFormattedValue.js +8 -18
- package/dist/components/Table/TableProvider.js +2 -2
- package/dist/components/Table/components/TableEmpty.js +8 -8
- package/dist/components/Table/components/TableHeader.js +31 -32
- package/dist/components/Table/components/TableHeaderCell.js +23 -24
- package/dist/components/Table/components/TableRows.js +38 -38
- package/dist/components/Table/components/TableSortButton.js +6 -6
- package/dist/components/Table/helpers/composeTableColumnDefs.js +1 -1
- package/dist/components/Table/helpers/composeTableInitialSorting.js +4 -4
- package/dist/components/Table/hooks/useTableColumnSort.js +12 -12
- package/dist/components/Table/hooks/useTableColumnStyles.js +13 -14
- package/dist/components/Table/index.js +2 -3
- package/dist/components/Tag/Tag.js +29 -32
- package/dist/components/Tag/Tag.styles.js +5 -6
- package/dist/components/Tag/TagInput/TagInput.js +120 -104
- package/dist/components/Tag/TagInput/TagInput.styles.js +26 -0
- package/dist/components/Text/Text.js +16 -36
- package/dist/components/Text/Text.styles.js +5 -4
- package/dist/components/Text/index.js +1 -2
- package/dist/components/Toaster/Toaster.js +59 -11
- package/dist/components/Toaster/Toaster.styles.js +2 -2
- package/dist/components/Toaster/ToasterProvider.js +49 -6
- package/dist/components/Toaster/components/Toast/Toast.js +46 -47
- package/dist/components/Toaster/components/Toast/Toast.styles.js +13 -13
- package/dist/components/Toaster/components/Toast/ToastAnimated.js +38 -37
- package/dist/components/Toaster/hooks/useToaster.js +24 -22
- package/dist/components/Toaster/index.js +5 -4
- package/dist/components/Toggle/Toggle.js +59 -54
- package/dist/components/Toggle/Toggle.styles.js +13 -13
- package/dist/components/Tooltip/Tooltip.js +2 -2
- package/dist/components/Tooltip/Tooltip.styles.js +2 -2
- package/dist/components/ValidationMessage/ValidationMessage.js +25 -26
- package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +5 -5
- package/dist/{composeTableColumnDefs-CeWqgpKW.js → composeTableColumnDefs-BfFBOARB.js} +99 -109
- package/dist/constants.js +10 -10
- package/dist/{create-recipe-BqEnhJ30.js → create-recipe-C-ASk1Hy.js} +11 -10
- package/dist/css-fGu_jDvv.js +228 -0
- package/dist/cva-JiDXAa83.js +63 -0
- package/dist/enums.js +7 -7
- package/dist/factory-oPXoMw9H.js +58 -0
- package/dist/{floating-ui.react-CPN4oQCc.js → floating-ui.react-BetVZ099.js} +1153 -1151
- package/dist/fuzzysort-DKAolWVP.js +397 -0
- package/dist/helpers/dom/closestCrossShadow.js +16 -17
- package/dist/helpers/dom/focusableElements.js +6 -6
- package/dist/helpers/dom/getActiveElement.js +5 -6
- package/dist/helpers/formatting/formatDateTime.js +9 -10
- package/dist/helpers/label-value/composeLabelValueDescriptor.js +8 -8
- package/dist/helpers/label-value/getQueryRangeExclusive.js +1 -1
- package/dist/helpers/label-value/getValueFromLabelValues.js +5 -6
- package/dist/helpers/label-value/highlightQueryInLabel.js +4 -7
- package/dist/helpers/label-value/highlightQueryInLabelValue.js +6 -5
- package/dist/helpers/label-value/searchLabelValues.js +1 -1
- package/dist/helpers/responsive/getResponsiveLayoutModifiers.js +4 -4
- package/dist/helpers/styling/iressCss.js +2 -2
- package/dist/helpers/styling/mapGutterToGap.js +7 -7
- package/dist/helpers/transition/getTransitionDuration.js +5 -8
- package/dist/hooks/useAriaRelationship.js +19 -21
- package/dist/hooks/useBreakpoint.js +8 -11
- package/dist/hooks/useControlledState.js +37 -35
- package/dist/{index-DlGwAtoO.js → index-CZ9ot38T.js} +107 -129
- package/dist/{index.esm-BdbWn-w_.js → index.esm-B6vzbp0e.js} +5 -5
- package/dist/{index.esm-BnSuefUA.js → index.esm-CL8gh5wr.js} +1 -5
- package/dist/is-valid-prop-Ce0wiweq.js +7 -0
- package/dist/main.js +298 -292
- package/dist/patterns/Form/Form.js +1 -1
- package/dist/patterns/Form/Form.styles.js +1 -1
- package/dist/patterns/Form/FormField/FormField.js +41 -44
- package/dist/patterns/Form/FormField/FormFieldset.js +41 -44
- package/dist/patterns/Form/FormField/helpers/getErrorTypeMessage.js +10 -10
- package/dist/patterns/Form/FormField/hooks/useFieldRenderProps.js +26 -26
- package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +55 -56
- package/dist/patterns/Form/HookForm/HookForm.js +72 -75
- package/dist/patterns/Form/components/LongForm.js +1 -1
- package/dist/patterns/Form/components/ShortForm.js +12 -12
- package/dist/patterns/Loading/Loading.styles.js +32 -20
- package/dist/patterns/Loading/LoadingSuspense.js +34 -34
- package/dist/patterns/Loading/components/ComponentLoading.js +42 -47
- package/dist/patterns/Loading/components/DefaultLoading.js +1 -1
- package/dist/patterns/Loading/components/LongLoading.js +45 -45
- package/dist/patterns/Loading/components/PageLoading.js +64 -64
- package/dist/patterns/Loading/components/StartUpLoading.js +61 -59
- package/dist/patterns/Loading/components/ValidateLoading.js +2 -2
- package/dist/patterns/Loading/hooks/useEstimatedProgressValue.js +8 -12
- package/dist/patterns/Loading/hooks/useShouldRenderLoading.js +14 -14
- package/dist/patterns/Loading/hooks/useShowIndicator.js +11 -11
- package/dist/patterns/Shadow/Shadow.js +22009 -0
- package/dist/patterns/Shadow/index.js +4 -0
- package/dist/src/components/Alert/Alert.d.ts +0 -1
- package/dist/src/components/Alert/Alert.styles.d.ts +2 -2
- package/dist/src/components/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/src/components/Autocomplete/hooks/useAutocompleteSearch.d.ts +1 -1
- package/dist/src/components/Autocomplete/index.d.ts +1 -0
- package/dist/src/components/Badge/Badge.styles.d.ts +2 -2
- package/dist/src/components/Card/Card.styles.d.ts +2 -2
- package/dist/src/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/src/components/Checkbox/Checkbox.styles.d.ts +3 -3
- package/dist/src/components/CheckboxGroup/CheckboxGroup.styles.d.ts +4 -4
- package/dist/src/components/Expander/Expander.styles.d.ts +2 -2
- package/dist/src/components/Field/Field.styles.d.ts +13 -6
- package/dist/src/components/Field/FieldGroup/FieldGroup.styles.d.ts +1 -1
- package/dist/src/components/Inline/Inline.d.ts +1 -2
- package/dist/src/components/Label/Label.styles.d.ts +1 -1
- package/dist/src/components/Menu/Menu.styles.d.ts +5 -5
- package/dist/src/components/Modal/Modal.styles.d.ts +8 -2
- package/dist/src/components/Modal/ModalProvider.d.ts +0 -16
- package/dist/src/components/Modal/hooks/useModal.d.ts +17 -0
- package/dist/src/components/Popover/Popover.styles.d.ts +1 -1
- package/dist/src/components/Popover/components/NestedPopoverActivator.d.ts +1 -1
- package/dist/src/components/Popover/hooks/usePopover.d.ts +4 -0
- package/dist/src/components/Popover/hooks/usePopoverNavigation.d.ts +1 -1
- package/dist/src/components/Radio/Radio.styles.d.ts +1 -1
- package/dist/src/components/RadioGroup/RadioGroup.styles.d.ts +4 -4
- package/dist/src/components/Readonly/Readonly.styles.d.ts +1 -1
- package/dist/src/components/RichSelect/RichSelect.d.ts +11 -1
- package/dist/src/components/RichSelect/RichSelect.styles.d.ts +7 -7
- package/dist/src/components/RichSelect/SelectBody/SelectBody.d.ts +1 -1
- package/dist/src/components/RichSelect/SelectMenu/SelectMenu.d.ts +2 -2
- package/dist/src/components/RichSelect/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/dist/src/components/RichSelect/SelectSearch/SelectSearch.d.ts +1 -1
- package/dist/src/components/RichSelect/SelectSearchInput/SelectSearchInput.d.ts +1 -2
- package/dist/src/components/RichSelect/SelectTags/SelectTags.d.ts +1 -1
- package/dist/src/components/RichSelect/SelectTags/SelectTags.styles.d.ts +1 -1
- package/dist/src/components/RichSelect/components/SelectOptions.d.ts +1 -1
- package/dist/src/components/Row/Row.d.ts +1 -2
- package/dist/src/components/Select/Select.styles.d.ts +7 -7
- package/dist/src/components/Skeleton/Skeleton.styles.d.ts +1 -1
- package/dist/src/components/Slideout/Slideout.styles.d.ts +2 -2
- package/dist/src/components/Slideout/SlideoutProvider.d.ts +0 -6
- package/dist/src/components/Slideout/hooks/useSlideout.d.ts +7 -0
- package/dist/src/components/Stack/Stack.d.ts +1 -2
- package/dist/src/components/TabSet/TabSet.d.ts +10 -1
- package/dist/src/components/Table/TableFormattedValue/TableFormattedValue.d.ts +2 -3
- package/dist/src/components/Table/helpers/composeTableColumnDefs.d.ts +1 -1
- package/dist/src/components/Tag/TagInput/TagInput.styles.d.ts +1 -0
- package/dist/src/components/Text/Text.d.ts +1 -2
- package/dist/src/components/Toaster/ToasterProvider.d.ts +0 -2
- package/dist/src/components/Toaster/components/Toast/Toast.d.ts +1 -2
- package/dist/src/components/Toaster/components/Toast/Toast.styles.d.ts +4 -4
- package/dist/src/components/Toaster/hooks/useToaster.d.ts +7 -6
- package/dist/src/components/Toggle/Toggle.d.ts +10 -2
- package/dist/src/components/Toggle/Toggle.styles.d.ts +4 -4
- package/dist/src/enums.d.ts +1 -9
- package/dist/src/interfaces.d.ts +9 -10
- package/dist/src/main.d.ts +1 -1
- package/dist/src/patterns/Form/hooks/useNoDefaultValueInForms.d.ts +1 -1
- package/dist/src/patterns/Loading/Loading.styles.d.ts +11 -10
- package/dist/src/patterns/Loading/components/PageLoading.d.ts +5 -1
- package/dist/src/patterns/Loading/components/StartUpLoading.d.ts +8 -3
- package/dist/src/patterns/Loading/components/ValidateLoading.d.ts +1 -1
- package/dist/src/patterns/Shadow/Shadow.d.ts +34 -0
- package/dist/src/patterns/Shadow/index.d.ts +1 -0
- package/dist/src/patterns/Shadow/meta/Thumbnail.d.ts +2 -0
- package/dist/src/patterns/Shadow/meta/index.d.ts +7 -0
- package/dist/src/styled-system/jsx/create-style-context.d.ts +54 -0
- package/dist/src/styled-system/jsx/index.d.ts +1 -0
- package/dist/src/styled-system/patterns/aspect-ratio.d.ts +0 -1
- package/dist/src/styled-system/patterns/bleed.d.ts +0 -1
- package/dist/src/styled-system/patterns/box.d.ts +0 -1
- package/dist/src/styled-system/patterns/center.d.ts +0 -1
- package/dist/src/styled-system/patterns/circle.d.ts +0 -1
- package/dist/src/styled-system/patterns/container.d.ts +0 -1
- package/dist/src/styled-system/patterns/cq.d.ts +0 -1
- package/dist/src/styled-system/patterns/divider.d.ts +0 -1
- package/dist/src/styled-system/patterns/flex.d.ts +0 -1
- package/dist/src/styled-system/patterns/float.d.ts +0 -1
- package/dist/src/styled-system/patterns/grid-item.d.ts +0 -1
- package/dist/src/styled-system/patterns/grid.d.ts +0 -1
- package/dist/src/styled-system/patterns/hstack.d.ts +0 -1
- package/dist/src/styled-system/patterns/link-overlay.d.ts +0 -1
- package/dist/src/styled-system/patterns/spacer.d.ts +0 -1
- package/dist/src/styled-system/patterns/square.d.ts +0 -1
- package/dist/src/styled-system/patterns/stack.d.ts +0 -1
- package/dist/src/styled-system/patterns/visually-hidden.d.ts +0 -1
- package/dist/src/styled-system/patterns/vstack.d.ts +0 -1
- package/dist/src/styled-system/patterns/wrap.d.ts +0 -1
- package/dist/src/styled-system/recipes/button.d.ts +4 -3
- package/dist/src/styled-system/recipes/table.d.ts +4 -1
- package/dist/src/styled-system/recipes/text.d.ts +3 -2
- package/dist/src/styled-system/tokens/tokens.d.ts +4 -4
- package/dist/src/styled-system/types/composition.d.ts +83 -23
- package/dist/src/styled-system/types/conditions.d.ts +15 -11
- package/dist/src/styled-system/types/jsx.d.ts +27 -10
- package/dist/src/styled-system/types/prop-type.d.ts +11 -4
- package/dist/src/styled-system/types/style-props.d.ts +14 -1
- package/dist/src/styled-system/types/system-types.d.ts +76 -0
- package/dist/src/types.d.ts +3 -1
- package/dist/style.css +1 -1
- package/dist/sva-OmxClA9g.js +34 -0
- package/package.json +68 -46
- package/dist/Filter-Bwk7SIlJ.js +0 -1103
- package/dist/InputPopover-BWWuoQZ2.js +0 -132
- package/dist/ToasterProvider-XqpAGfRs.js +0 -112
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/cva-B2x59Dph.js +0 -294
- package/dist/factory-DHLOr79I.js +0 -53
- package/dist/fuzzysort-eoXOpoo6.js +0 -395
- package/dist/helpers/utility/generateScopedName.js +0 -9
- package/dist/is-valid-prop-DFFvE05x.js +0 -7
- package/dist/panda.config.d.ts +0 -4
- package/dist/src/helpers/utility/generateScopedName.d.ts +0 -8
- package/dist/sva-TRyehFkb.js +0 -32
- package/dist/theme-preset/config-recipes/button.d.ts +0 -6
- package/dist/theme-preset/config-recipes/table.d.ts +0 -1
- package/dist/theme-preset/config-recipes/text.d.ts +0 -1
- package/dist/theme-preset/globalCss.d.ts +0 -1
- package/dist/theme-preset/index.d.ts +0 -2
- package/dist/theme-preset/staticCss.d.ts +0 -2
- package/dist/theme-preset/storybook.d.ts +0 -4
- package/dist/theme-preset/tokens/animationStyles.d.ts +0 -1
- package/dist/theme-preset/tokens/borders.d.ts +0 -50
- package/dist/theme-preset/tokens/breakpoints.d.ts +0 -8
- package/dist/theme-preset/tokens/colors.d.ts +0 -156
- package/dist/theme-preset/tokens/keyframes.d.ts +0 -1
- package/dist/theme-preset/tokens/layerStyles.d.ts +0 -40
- package/dist/theme-preset/tokens/radii.d.ts +0 -42
- package/dist/theme-preset/tokens/sizes.d.ts +0 -246
- package/dist/theme-preset/tokens/spacing.d.ts +0 -100
- package/dist/theme-preset/tokens/textStyles.d.ts +0 -5
- package/dist/theme-preset/tokens/zIndex.d.ts +0 -23
- package/dist/theme-preset/utilities/chevron.d.ts +0 -3
- package/dist/theme-preset/utilities/focusable.d.ts +0 -1
- package/dist/theme-preset/utilities/gutter.d.ts +0 -1
- package/dist/theme-preset/utilities/hide.d.ts +0 -1
- package/dist/theme-preset/utilities/noGutter.d.ts +0 -1
- package/dist/theme-preset/utilities/offset.d.ts +0 -75
- package/dist/theme-preset/utilities/sliderThumb.d.ts +0 -1
- package/dist/theme-preset/utilities/span.d.ts +0 -120
- package/dist/theme-preset/utilities/stretch.d.ts +0 -1
- package/dist/theme-preset/utilities/topLeftTriangle.d.ts +0 -2
- package/dist/typography--vGt_ztU.js +0 -12
- package/dist/vite.config.d.ts +0 -2
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.setup.d.ts +0 -0
- /package/{LICENSE.txt → LICENSE} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { useLayoutEffect as
|
|
3
|
-
import { t as At, i as
|
|
4
|
-
import { jsx as me, jsxs as
|
|
5
|
-
import * as
|
|
6
|
-
function
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { useLayoutEffect as Gn } from "react";
|
|
3
|
+
import { t as At, i as jn, f as Pr } from "./index.esm-CL8gh5wr.js";
|
|
4
|
+
import { jsx as me, jsxs as qn, Fragment as Dr } from "react/jsx-runtime";
|
|
5
|
+
import * as nn from "react-dom";
|
|
6
|
+
function St() {
|
|
7
7
|
return typeof window < "u";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function We(e) {
|
|
10
|
+
return rn(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
11
11
|
}
|
|
12
12
|
function pe(e) {
|
|
13
13
|
var t;
|
|
@@ -15,21 +15,21 @@ function pe(e) {
|
|
|
15
15
|
}
|
|
16
16
|
function Te(e) {
|
|
17
17
|
var t;
|
|
18
|
-
return (t = (
|
|
18
|
+
return (t = (rn(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function rn(e) {
|
|
21
|
+
return St() ? e instanceof Node || e instanceof pe(e).Node : !1;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
23
|
+
function Y(e) {
|
|
24
|
+
return St() ? e instanceof Element || e instanceof pe(e).Element : !1;
|
|
25
25
|
}
|
|
26
26
|
function ne(e) {
|
|
27
|
-
return
|
|
27
|
+
return St() ? e instanceof HTMLElement || e instanceof pe(e).HTMLElement : !1;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return !
|
|
29
|
+
function Jt(e) {
|
|
30
|
+
return !St() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof pe(e).ShadowRoot;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const Lr = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
33
33
|
function ut(e) {
|
|
34
34
|
const {
|
|
35
35
|
overflow: t,
|
|
@@ -37,15 +37,15 @@ function ut(e) {
|
|
|
37
37
|
overflowY: r,
|
|
38
38
|
display: o
|
|
39
39
|
} = we(e);
|
|
40
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !
|
|
40
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !Lr.has(o);
|
|
41
41
|
}
|
|
42
42
|
const kr = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
43
|
-
function
|
|
44
|
-
return kr.has(
|
|
43
|
+
function Fr(e) {
|
|
44
|
+
return kr.has(We(e));
|
|
45
45
|
}
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
-
return
|
|
46
|
+
const Nr = [":popover-open", ":modal"];
|
|
47
|
+
function Mt(e) {
|
|
48
|
+
return Nr.some((t) => {
|
|
49
49
|
try {
|
|
50
50
|
return e.matches(t);
|
|
51
51
|
} catch {
|
|
@@ -53,17 +53,17 @@ function St(e) {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
function
|
|
58
|
-
const t = Pt(), n =
|
|
59
|
-
return
|
|
56
|
+
const _r = ["transform", "translate", "scale", "rotate", "perspective"], Wr = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Vr = ["paint", "layout", "strict", "content"];
|
|
57
|
+
function on(e) {
|
|
58
|
+
const t = Pt(), n = Y(e) ? we(e) : e;
|
|
59
|
+
return _r.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Wr.some((r) => (n.willChange || "").includes(r)) || Vr.some((r) => (n.contain || "").includes(r));
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Kr(e) {
|
|
62
62
|
let t = Pe(e);
|
|
63
|
-
for (; ne(t) && !
|
|
64
|
-
if (
|
|
63
|
+
for (; ne(t) && !Me(t); ) {
|
|
64
|
+
if (on(t))
|
|
65
65
|
return t;
|
|
66
|
-
if (
|
|
66
|
+
if (Mt(t))
|
|
67
67
|
return null;
|
|
68
68
|
t = Pe(t);
|
|
69
69
|
}
|
|
@@ -72,15 +72,15 @@ function Wr(e) {
|
|
|
72
72
|
function Pt() {
|
|
73
73
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
74
74
|
}
|
|
75
|
-
const
|
|
76
|
-
function
|
|
77
|
-
return
|
|
75
|
+
const $r = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
76
|
+
function Me(e) {
|
|
77
|
+
return $r.has(We(e));
|
|
78
78
|
}
|
|
79
79
|
function we(e) {
|
|
80
80
|
return pe(e).getComputedStyle(e);
|
|
81
81
|
}
|
|
82
82
|
function Dt(e) {
|
|
83
|
-
return
|
|
83
|
+
return Y(e) ? {
|
|
84
84
|
scrollLeft: e.scrollLeft,
|
|
85
85
|
scrollTop: e.scrollTop
|
|
86
86
|
} : {
|
|
@@ -89,43 +89,43 @@ function Dt(e) {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function Pe(e) {
|
|
92
|
-
if (
|
|
92
|
+
if (We(e) === "html")
|
|
93
93
|
return e;
|
|
94
94
|
const t = (
|
|
95
95
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
96
96
|
e.assignedSlot || // DOM Element detected.
|
|
97
97
|
e.parentNode || // ShadowRoot detected.
|
|
98
|
-
|
|
98
|
+
Jt(e) && e.host || // Fallback.
|
|
99
99
|
Te(e)
|
|
100
100
|
);
|
|
101
|
-
return
|
|
101
|
+
return Jt(t) ? t.host : t;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Xn(e) {
|
|
104
104
|
const t = Pe(e);
|
|
105
|
-
return
|
|
105
|
+
return Me(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : ne(t) && ut(t) ? t : Xn(t);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function ke(e, t, n) {
|
|
108
108
|
var r;
|
|
109
109
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
110
|
-
const o =
|
|
110
|
+
const o = Xn(e), s = o === ((r = e.ownerDocument) == null ? void 0 : r.body), i = pe(o);
|
|
111
111
|
if (s) {
|
|
112
|
-
const c =
|
|
113
|
-
return t.concat(i, i.visualViewport || [], ut(o) ? o : [], c && n ?
|
|
112
|
+
const c = Qt(i);
|
|
113
|
+
return t.concat(i, i.visualViewport || [], ut(o) ? o : [], c && n ? ke(c) : []);
|
|
114
114
|
}
|
|
115
|
-
return t.concat(o,
|
|
115
|
+
return t.concat(o, ke(o, [], n));
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function Qt(e) {
|
|
118
118
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
119
119
|
}
|
|
120
|
-
const
|
|
120
|
+
const Br = ["top", "right", "bottom", "left"], pn = ["start", "end"], gn = /* @__PURE__ */ Br.reduce((e, t) => e.concat(t, t + "-" + pn[0], t + "-" + pn[1]), []), Je = Math.min, he = Math.max, xt = Math.round, je = Math.floor, Ee = (e) => ({
|
|
121
121
|
x: e,
|
|
122
122
|
y: e
|
|
123
|
-
}),
|
|
123
|
+
}), Hr = {
|
|
124
124
|
left: "right",
|
|
125
125
|
right: "left",
|
|
126
126
|
bottom: "top",
|
|
127
127
|
top: "bottom"
|
|
128
|
-
},
|
|
128
|
+
}, zr = {
|
|
129
129
|
start: "end",
|
|
130
130
|
end: "start"
|
|
131
131
|
};
|
|
@@ -135,60 +135,60 @@ function hn(e, t, n) {
|
|
|
135
135
|
function Qe(e, t) {
|
|
136
136
|
return typeof e == "function" ? e(t) : e;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function Ie(e) {
|
|
139
139
|
return e.split("-")[0];
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Ce(e) {
|
|
142
142
|
return e.split("-")[1];
|
|
143
143
|
}
|
|
144
144
|
function Yn(e) {
|
|
145
145
|
return e === "x" ? "y" : "x";
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function Jn(e) {
|
|
148
148
|
return e === "y" ? "height" : "width";
|
|
149
149
|
}
|
|
150
|
-
const
|
|
151
|
-
function
|
|
152
|
-
return
|
|
150
|
+
const Ur = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
151
|
+
function Se(e) {
|
|
152
|
+
return Ur.has(Ie(e)) ? "y" : "x";
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return Yn(
|
|
154
|
+
function Qn(e) {
|
|
155
|
+
return Yn(Se(e));
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Zn(e, t, n) {
|
|
158
158
|
n === void 0 && (n = !1);
|
|
159
|
-
const r =
|
|
159
|
+
const r = Ce(e), o = Qn(e), s = Jn(o);
|
|
160
160
|
let i = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
161
161
|
return t.reference[s] > t.floating[s] && (i = Et(i)), [i, Et(i)];
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Gr(e) {
|
|
164
164
|
const t = Et(e);
|
|
165
165
|
return [Rt(e), t, Rt(t)];
|
|
166
166
|
}
|
|
167
167
|
function Rt(e) {
|
|
168
|
-
return e.replace(/start|end/g, (t) =>
|
|
168
|
+
return e.replace(/start|end/g, (t) => zr[t]);
|
|
169
169
|
}
|
|
170
|
-
const vn = ["left", "right"], bn = ["right", "left"],
|
|
171
|
-
function
|
|
170
|
+
const vn = ["left", "right"], bn = ["right", "left"], jr = ["top", "bottom"], qr = ["bottom", "top"];
|
|
171
|
+
function Xr(e, t, n) {
|
|
172
172
|
switch (e) {
|
|
173
173
|
case "top":
|
|
174
174
|
case "bottom":
|
|
175
175
|
return n ? t ? bn : vn : t ? vn : bn;
|
|
176
176
|
case "left":
|
|
177
177
|
case "right":
|
|
178
|
-
return t ?
|
|
178
|
+
return t ? jr : qr;
|
|
179
179
|
default:
|
|
180
180
|
return [];
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
function Yr(e, t, n, r) {
|
|
184
|
-
const o =
|
|
185
|
-
let s =
|
|
184
|
+
const o = Ce(e);
|
|
185
|
+
let s = Xr(Ie(e), n === "start", r);
|
|
186
186
|
return o && (s = s.map((i) => i + "-" + o), t && (s = s.concat(s.map(Rt)))), s;
|
|
187
187
|
}
|
|
188
188
|
function Et(e) {
|
|
189
|
-
return e.replace(/left|right|bottom|top/g, (t) =>
|
|
189
|
+
return e.replace(/left|right|bottom|top/g, (t) => Hr[t]);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Jr(e) {
|
|
192
192
|
return {
|
|
193
193
|
top: 0,
|
|
194
194
|
right: 0,
|
|
@@ -197,15 +197,15 @@ function Xr(e) {
|
|
|
197
197
|
...e
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
return typeof e != "number" ?
|
|
200
|
+
function Qr(e) {
|
|
201
|
+
return typeof e != "number" ? Jr(e) : {
|
|
202
202
|
top: e,
|
|
203
203
|
right: e,
|
|
204
204
|
bottom: e,
|
|
205
205
|
left: e
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function Ct(e) {
|
|
209
209
|
const {
|
|
210
210
|
x: t,
|
|
211
211
|
y: n,
|
|
@@ -223,11 +223,11 @@ function It(e) {
|
|
|
223
223
|
y: n
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function sn() {
|
|
227
227
|
const e = navigator.userAgentData;
|
|
228
228
|
return e != null && e.platform ? e.platform : navigator.platform;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function er() {
|
|
231
231
|
const e = navigator.userAgentData;
|
|
232
232
|
return e && Array.isArray(e.brands) ? e.brands.map((t) => {
|
|
233
233
|
let {
|
|
@@ -237,20 +237,20 @@ function Zn() {
|
|
|
237
237
|
return n + "/" + r;
|
|
238
238
|
}).join(" ") : navigator.userAgent;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function tr() {
|
|
241
241
|
return /apple/i.test(navigator.vendor);
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function Zt() {
|
|
244
244
|
const e = /android/i;
|
|
245
|
-
return e.test(
|
|
245
|
+
return e.test(sn()) || e.test(er());
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
247
|
+
function Zr() {
|
|
248
|
+
return sn().toLowerCase().startsWith("mac") && !navigator.maxTouchPoints;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
250
|
+
function nr() {
|
|
251
|
+
return er().includes("jsdom/");
|
|
252
252
|
}
|
|
253
|
-
const yn = "data-floating-ui-focusable",
|
|
253
|
+
const yn = "data-floating-ui-focusable", eo = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])", Wt = "ArrowLeft", Vt = "ArrowRight", to = "ArrowUp", no = "ArrowDown";
|
|
254
254
|
function Re(e) {
|
|
255
255
|
let t = e.activeElement;
|
|
256
256
|
for (; ((n = t) == null || (n = n.shadowRoot) == null ? void 0 : n.activeElement) != null; ) {
|
|
@@ -265,7 +265,7 @@ function ce(e, t) {
|
|
|
265
265
|
const n = t.getRootNode == null ? void 0 : t.getRootNode();
|
|
266
266
|
if (e.contains(t))
|
|
267
267
|
return !0;
|
|
268
|
-
if (n &&
|
|
268
|
+
if (n && Jt(n)) {
|
|
269
269
|
let r = t;
|
|
270
270
|
for (; r; ) {
|
|
271
271
|
if (e === r)
|
|
@@ -278,7 +278,7 @@ function ce(e, t) {
|
|
|
278
278
|
function Ae(e) {
|
|
279
279
|
return "composedPath" in e ? e.composedPath()[0] : e.target;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Kt(e, t) {
|
|
282
282
|
if (t == null)
|
|
283
283
|
return !1;
|
|
284
284
|
if ("composedPath" in e)
|
|
@@ -286,27 +286,27 @@ function Wt(e, t) {
|
|
|
286
286
|
const n = e;
|
|
287
287
|
return n.target != null && t.contains(n.target);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function ro(e) {
|
|
290
290
|
return e.matches("html,body");
|
|
291
291
|
}
|
|
292
292
|
function le(e) {
|
|
293
|
-
return
|
|
293
|
+
return e?.ownerDocument || document;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
return ne(e) && e.matches(
|
|
295
|
+
function cn(e) {
|
|
296
|
+
return ne(e) && e.matches(eo);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
return e ? e.getAttribute("role") === "combobox" &&
|
|
298
|
+
function en(e) {
|
|
299
|
+
return e ? e.getAttribute("role") === "combobox" && cn(e) : !1;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
if (!e ||
|
|
301
|
+
function oo(e) {
|
|
302
|
+
if (!e || nr()) return !0;
|
|
303
303
|
try {
|
|
304
304
|
return e.matches(":focus-visible");
|
|
305
305
|
} catch {
|
|
306
306
|
return !0;
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function It(e) {
|
|
310
310
|
return e ? e.hasAttribute(yn) ? e : e.querySelector("[" + yn + "]") || e : null;
|
|
311
311
|
}
|
|
312
312
|
function $e(e, t, n) {
|
|
@@ -315,7 +315,7 @@ function $e(e, t, n) {
|
|
|
315
315
|
return o.parentId === t && (!n || ((s = o.context) == null ? void 0 : s.open));
|
|
316
316
|
}).flatMap((o) => [o, ...$e(e, o.id, n)]);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function io(e, t) {
|
|
319
319
|
let n, r = -1;
|
|
320
320
|
function o(s, i) {
|
|
321
321
|
i > r && (n = s, r = i), $e(e, s).forEach((a) => {
|
|
@@ -329,47 +329,47 @@ function wn(e, t) {
|
|
|
329
329
|
let r = [], o = (n = e.find((s) => s.id === t)) == null ? void 0 : n.parentId;
|
|
330
330
|
for (; o; ) {
|
|
331
331
|
const s = e.find((i) => i.id === o);
|
|
332
|
-
o = s
|
|
332
|
+
o = s?.parentId, s && (r = r.concat(s));
|
|
333
333
|
}
|
|
334
334
|
return r;
|
|
335
335
|
}
|
|
336
336
|
function de(e) {
|
|
337
337
|
e.preventDefault(), e.stopPropagation();
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function so(e) {
|
|
340
340
|
return "nativeEvent" in e;
|
|
341
341
|
}
|
|
342
|
-
function nr(e) {
|
|
343
|
-
return e.mozInputSource === 0 && e.isTrusted ? !0 : Qt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
344
|
-
}
|
|
345
342
|
function rr(e) {
|
|
346
|
-
return
|
|
343
|
+
return e.mozInputSource === 0 && e.isTrusted ? !0 : Zt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
344
|
+
}
|
|
345
|
+
function or(e) {
|
|
346
|
+
return nr() ? !1 : !Zt() && e.width === 0 && e.height === 0 || Zt() && e.width === 1 && e.height === 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
|
|
347
347
|
e.width < 1 && e.height < 1 && e.pressure === 0 && e.detail === 0 && e.pointerType === "touch";
|
|
348
348
|
}
|
|
349
349
|
function it(e, t) {
|
|
350
350
|
const n = ["mouse", "pen"];
|
|
351
351
|
return t || n.push("", void 0), n.includes(e);
|
|
352
352
|
}
|
|
353
|
-
var
|
|
354
|
-
},
|
|
355
|
-
const
|
|
356
|
-
...
|
|
353
|
+
var co = typeof document < "u", uo = function() {
|
|
354
|
+
}, X = co ? Gn : uo;
|
|
355
|
+
const lo = {
|
|
356
|
+
...d
|
|
357
357
|
};
|
|
358
358
|
function ye(e) {
|
|
359
|
-
const t =
|
|
360
|
-
return
|
|
359
|
+
const t = d.useRef(e);
|
|
360
|
+
return X(() => {
|
|
361
361
|
t.current = e;
|
|
362
362
|
}), t;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
364
|
+
const ao = lo.useInsertionEffect, fo = ao || ((e) => e());
|
|
365
365
|
function ie(e) {
|
|
366
|
-
const t =
|
|
366
|
+
const t = d.useRef(() => {
|
|
367
367
|
if (process.env.NODE_ENV !== "production")
|
|
368
368
|
throw new Error("Cannot call an event handler while rendering.");
|
|
369
369
|
});
|
|
370
|
-
return
|
|
370
|
+
return fo(() => {
|
|
371
371
|
t.current = e;
|
|
372
|
-
}),
|
|
372
|
+
}), d.useCallback(function() {
|
|
373
373
|
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
374
374
|
r[o] = arguments[o];
|
|
375
375
|
return t.current == null ? void 0 : t.current(...r);
|
|
@@ -386,7 +386,7 @@ function yt(e, t) {
|
|
|
386
386
|
disabledIndices: t
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function tn(e, t) {
|
|
390
390
|
return ue(e, {
|
|
391
391
|
decrement: !0,
|
|
392
392
|
startingIndex: e.current.length,
|
|
@@ -405,7 +405,7 @@ function ue(e, t) {
|
|
|
405
405
|
while (i >= 0 && i <= e.current.length - 1 && Be(e, i, o));
|
|
406
406
|
return i;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function ir(e, t) {
|
|
409
409
|
let {
|
|
410
410
|
event: n,
|
|
411
411
|
orientation: r,
|
|
@@ -414,65 +414,65 @@ function or(e, t) {
|
|
|
414
414
|
cols: i,
|
|
415
415
|
disabledIndices: c,
|
|
416
416
|
minIndex: a,
|
|
417
|
-
maxIndex:
|
|
418
|
-
prevIndex:
|
|
417
|
+
maxIndex: l,
|
|
418
|
+
prevIndex: u,
|
|
419
419
|
stopEvent: m = !1
|
|
420
|
-
} = t,
|
|
421
|
-
if (n.key ===
|
|
422
|
-
if (m && de(n),
|
|
423
|
-
|
|
424
|
-
else if (
|
|
425
|
-
startingIndex:
|
|
420
|
+
} = t, p = u;
|
|
421
|
+
if (n.key === to) {
|
|
422
|
+
if (m && de(n), u === -1)
|
|
423
|
+
p = l;
|
|
424
|
+
else if (p = ue(e, {
|
|
425
|
+
startingIndex: p,
|
|
426
426
|
amount: i,
|
|
427
427
|
decrement: !0,
|
|
428
428
|
disabledIndices: c
|
|
429
|
-
}), o && (
|
|
430
|
-
const
|
|
431
|
-
v ===
|
|
429
|
+
}), o && (u - i < a || p < 0)) {
|
|
430
|
+
const f = u % i, v = l % i, g = l - (v - f);
|
|
431
|
+
v === f ? p = l : p = v > f ? g : g - i;
|
|
432
432
|
}
|
|
433
|
-
qe(e,
|
|
433
|
+
qe(e, p) && (p = u);
|
|
434
434
|
}
|
|
435
|
-
if (n.key ===
|
|
436
|
-
startingIndex:
|
|
435
|
+
if (n.key === no && (m && de(n), u === -1 ? p = a : (p = ue(e, {
|
|
436
|
+
startingIndex: u,
|
|
437
437
|
amount: i,
|
|
438
438
|
disabledIndices: c
|
|
439
|
-
}), o &&
|
|
440
|
-
startingIndex:
|
|
439
|
+
}), o && u + i > l && (p = ue(e, {
|
|
440
|
+
startingIndex: u % i - i,
|
|
441
441
|
amount: i,
|
|
442
442
|
disabledIndices: c
|
|
443
|
-
}))), qe(e,
|
|
444
|
-
const
|
|
445
|
-
n.key === (s ?
|
|
446
|
-
startingIndex:
|
|
443
|
+
}))), qe(e, p) && (p = u)), r === "both") {
|
|
444
|
+
const f = je(u / i);
|
|
445
|
+
n.key === (s ? Wt : Vt) && (m && de(n), u % i !== i - 1 ? (p = ue(e, {
|
|
446
|
+
startingIndex: u,
|
|
447
447
|
disabledIndices: c
|
|
448
|
-
}), o && pt(
|
|
449
|
-
startingIndex:
|
|
448
|
+
}), o && pt(p, i, f) && (p = ue(e, {
|
|
449
|
+
startingIndex: u - u % i - 1,
|
|
450
450
|
disabledIndices: c
|
|
451
|
-
}))) : o && (
|
|
452
|
-
startingIndex:
|
|
451
|
+
}))) : o && (p = ue(e, {
|
|
452
|
+
startingIndex: u - u % i - 1,
|
|
453
453
|
disabledIndices: c
|
|
454
|
-
})), pt(
|
|
455
|
-
startingIndex:
|
|
454
|
+
})), pt(p, i, f) && (p = u)), n.key === (s ? Vt : Wt) && (m && de(n), u % i !== 0 ? (p = ue(e, {
|
|
455
|
+
startingIndex: u,
|
|
456
456
|
decrement: !0,
|
|
457
457
|
disabledIndices: c
|
|
458
|
-
}), o && pt(
|
|
459
|
-
startingIndex:
|
|
458
|
+
}), o && pt(p, i, f) && (p = ue(e, {
|
|
459
|
+
startingIndex: u + (i - u % i),
|
|
460
460
|
decrement: !0,
|
|
461
461
|
disabledIndices: c
|
|
462
|
-
}))) : o && (
|
|
463
|
-
startingIndex:
|
|
462
|
+
}))) : o && (p = ue(e, {
|
|
463
|
+
startingIndex: u + (i - u % i),
|
|
464
464
|
decrement: !0,
|
|
465
465
|
disabledIndices: c
|
|
466
|
-
})), pt(
|
|
467
|
-
const v = je(
|
|
468
|
-
qe(e,
|
|
469
|
-
startingIndex:
|
|
466
|
+
})), pt(p, i, f) && (p = u));
|
|
467
|
+
const v = je(l / i) === f;
|
|
468
|
+
qe(e, p) && (o && v ? p = n.key === (s ? Vt : Wt) ? l : ue(e, {
|
|
469
|
+
startingIndex: u - u % i - 1,
|
|
470
470
|
disabledIndices: c
|
|
471
|
-
}) :
|
|
471
|
+
}) : p = u);
|
|
472
472
|
}
|
|
473
|
-
return
|
|
473
|
+
return p;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function sr(e, t, n) {
|
|
476
476
|
const r = [];
|
|
477
477
|
let o = 0;
|
|
478
478
|
return e.forEach((s, i) => {
|
|
@@ -482,19 +482,19 @@ function ir(e, t, n) {
|
|
|
482
482
|
} = s;
|
|
483
483
|
if (c > t && process.env.NODE_ENV !== "production")
|
|
484
484
|
throw new Error("[Floating UI]: Invalid grid - item width at index " + i + " is greater than grid columns");
|
|
485
|
-
let
|
|
486
|
-
for (n && (o = 0); !
|
|
487
|
-
const
|
|
485
|
+
let l = !1;
|
|
486
|
+
for (n && (o = 0); !l; ) {
|
|
487
|
+
const u = [];
|
|
488
488
|
for (let m = 0; m < c; m++)
|
|
489
|
-
for (let
|
|
490
|
-
|
|
491
|
-
o % t + c <= t &&
|
|
489
|
+
for (let p = 0; p < a; p++)
|
|
490
|
+
u.push(o + m + p * t);
|
|
491
|
+
o % t + c <= t && u.every((m) => r[m] == null) ? (u.forEach((m) => {
|
|
492
492
|
r[m] = i;
|
|
493
|
-
}),
|
|
493
|
+
}), l = !0) : o++;
|
|
494
494
|
}
|
|
495
495
|
}), [...r];
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function cr(e, t, n, r, o) {
|
|
498
498
|
if (e === -1) return -1;
|
|
499
499
|
const s = n.indexOf(e), i = t[e];
|
|
500
500
|
switch (o) {
|
|
@@ -508,7 +508,7 @@ function sr(e, t, n, r, o) {
|
|
|
508
508
|
return n.lastIndexOf(e);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function ur(e, t) {
|
|
512
512
|
return t.flatMap((n, r) => e.includes(n) ? [r] : []);
|
|
513
513
|
}
|
|
514
514
|
function Be(e, t, n) {
|
|
@@ -528,23 +528,23 @@ const lt = () => ({
|
|
|
528
528
|
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
529
529
|
)
|
|
530
530
|
});
|
|
531
|
-
function
|
|
531
|
+
function lr(e, t) {
|
|
532
532
|
const n = At(e, lt()), r = n.length;
|
|
533
533
|
if (r === 0) return;
|
|
534
534
|
const o = Re(le(e)), s = n.indexOf(o), i = s === -1 ? t === 1 ? 0 : r - 1 : s + t;
|
|
535
535
|
return n[i];
|
|
536
536
|
}
|
|
537
|
-
function lr(e) {
|
|
538
|
-
return ur(le(e).body, 1) || e;
|
|
539
|
-
}
|
|
540
537
|
function ar(e) {
|
|
541
|
-
return
|
|
538
|
+
return lr(le(e).body, 1) || e;
|
|
539
|
+
}
|
|
540
|
+
function fr(e) {
|
|
541
|
+
return lr(le(e).body, -1) || e;
|
|
542
542
|
}
|
|
543
543
|
function ot(e, t) {
|
|
544
544
|
const n = t || e.currentTarget, r = e.relatedTarget;
|
|
545
545
|
return !r || !ce(n, r);
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function mo(e) {
|
|
548
548
|
At(e, lt()).forEach((n) => {
|
|
549
549
|
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
550
550
|
});
|
|
@@ -560,111 +560,111 @@ function Rn(e, t, n) {
|
|
|
560
560
|
reference: r,
|
|
561
561
|
floating: o
|
|
562
562
|
} = e;
|
|
563
|
-
const s =
|
|
564
|
-
let
|
|
563
|
+
const s = Se(t), i = Qn(t), c = Jn(i), a = Ie(t), l = s === "y", u = r.x + r.width / 2 - o.width / 2, m = r.y + r.height / 2 - o.height / 2, p = r[c] / 2 - o[c] / 2;
|
|
564
|
+
let f;
|
|
565
565
|
switch (a) {
|
|
566
566
|
case "top":
|
|
567
|
-
|
|
568
|
-
x:
|
|
567
|
+
f = {
|
|
568
|
+
x: u,
|
|
569
569
|
y: r.y - o.height
|
|
570
570
|
};
|
|
571
571
|
break;
|
|
572
572
|
case "bottom":
|
|
573
|
-
|
|
574
|
-
x:
|
|
573
|
+
f = {
|
|
574
|
+
x: u,
|
|
575
575
|
y: r.y + r.height
|
|
576
576
|
};
|
|
577
577
|
break;
|
|
578
578
|
case "right":
|
|
579
|
-
|
|
579
|
+
f = {
|
|
580
580
|
x: r.x + r.width,
|
|
581
581
|
y: m
|
|
582
582
|
};
|
|
583
583
|
break;
|
|
584
584
|
case "left":
|
|
585
|
-
|
|
585
|
+
f = {
|
|
586
586
|
x: r.x - o.width,
|
|
587
587
|
y: m
|
|
588
588
|
};
|
|
589
589
|
break;
|
|
590
590
|
default:
|
|
591
|
-
|
|
591
|
+
f = {
|
|
592
592
|
x: r.x,
|
|
593
593
|
y: r.y
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
|
-
switch (
|
|
596
|
+
switch (Ce(t)) {
|
|
597
597
|
case "start":
|
|
598
|
-
|
|
598
|
+
f[i] -= p * (n && l ? -1 : 1);
|
|
599
599
|
break;
|
|
600
600
|
case "end":
|
|
601
|
-
|
|
601
|
+
f[i] += p * (n && l ? -1 : 1);
|
|
602
602
|
break;
|
|
603
603
|
}
|
|
604
|
-
return
|
|
604
|
+
return f;
|
|
605
605
|
}
|
|
606
|
-
const
|
|
606
|
+
const po = async (e, t, n) => {
|
|
607
607
|
const {
|
|
608
608
|
placement: r = "bottom",
|
|
609
609
|
strategy: o = "absolute",
|
|
610
610
|
middleware: s = [],
|
|
611
611
|
platform: i
|
|
612
612
|
} = n, c = s.filter(Boolean), a = await (i.isRTL == null ? void 0 : i.isRTL(t));
|
|
613
|
-
let
|
|
613
|
+
let l = await i.getElementRects({
|
|
614
614
|
reference: e,
|
|
615
615
|
floating: t,
|
|
616
616
|
strategy: o
|
|
617
617
|
}), {
|
|
618
|
-
x:
|
|
618
|
+
x: u,
|
|
619
619
|
y: m
|
|
620
|
-
} = Rn(
|
|
621
|
-
for (let
|
|
620
|
+
} = Rn(l, r, a), p = r, f = {}, v = 0;
|
|
621
|
+
for (let g = 0; g < c.length; g++) {
|
|
622
622
|
const {
|
|
623
623
|
name: y,
|
|
624
624
|
fn: x
|
|
625
|
-
} = c[
|
|
625
|
+
} = c[g], {
|
|
626
626
|
x: b,
|
|
627
627
|
y: w,
|
|
628
|
-
data:
|
|
629
|
-
reset:
|
|
628
|
+
data: C,
|
|
629
|
+
reset: M
|
|
630
630
|
} = await x({
|
|
631
|
-
x:
|
|
631
|
+
x: u,
|
|
632
632
|
y: m,
|
|
633
633
|
initialPlacement: r,
|
|
634
|
-
placement:
|
|
634
|
+
placement: p,
|
|
635
635
|
strategy: o,
|
|
636
|
-
middlewareData:
|
|
637
|
-
rects:
|
|
636
|
+
middlewareData: f,
|
|
637
|
+
rects: l,
|
|
638
638
|
platform: i,
|
|
639
639
|
elements: {
|
|
640
640
|
reference: e,
|
|
641
641
|
floating: t
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
|
-
|
|
645
|
-
...
|
|
644
|
+
u = b ?? u, m = w ?? m, f = {
|
|
645
|
+
...f,
|
|
646
646
|
[y]: {
|
|
647
|
-
...
|
|
648
|
-
...
|
|
647
|
+
...f[y],
|
|
648
|
+
...C
|
|
649
649
|
}
|
|
650
|
-
},
|
|
650
|
+
}, M && v <= 50 && (v++, typeof M == "object" && (M.placement && (p = M.placement), M.rects && (l = M.rects === !0 ? await i.getElementRects({
|
|
651
651
|
reference: e,
|
|
652
652
|
floating: t,
|
|
653
653
|
strategy: o
|
|
654
|
-
}) :
|
|
655
|
-
x:
|
|
654
|
+
}) : M.rects), {
|
|
655
|
+
x: u,
|
|
656
656
|
y: m
|
|
657
|
-
} = Rn(
|
|
657
|
+
} = Rn(l, p, a)), g = -1);
|
|
658
658
|
}
|
|
659
659
|
return {
|
|
660
|
-
x:
|
|
660
|
+
x: u,
|
|
661
661
|
y: m,
|
|
662
|
-
placement:
|
|
662
|
+
placement: p,
|
|
663
663
|
strategy: o,
|
|
664
|
-
middlewareData:
|
|
664
|
+
middlewareData: f
|
|
665
665
|
};
|
|
666
666
|
};
|
|
667
|
-
async function
|
|
667
|
+
async function Lt(e, t) {
|
|
668
668
|
var n;
|
|
669
669
|
t === void 0 && (t = {});
|
|
670
670
|
const {
|
|
@@ -675,44 +675,44 @@ async function kt(e, t) {
|
|
|
675
675
|
elements: c,
|
|
676
676
|
strategy: a
|
|
677
677
|
} = e, {
|
|
678
|
-
boundary:
|
|
679
|
-
rootBoundary:
|
|
678
|
+
boundary: l = "clippingAncestors",
|
|
679
|
+
rootBoundary: u = "viewport",
|
|
680
680
|
elementContext: m = "floating",
|
|
681
|
-
altBoundary:
|
|
682
|
-
padding:
|
|
683
|
-
} = Qe(t, e), v =
|
|
681
|
+
altBoundary: p = !1,
|
|
682
|
+
padding: f = 0
|
|
683
|
+
} = Qe(t, e), v = Qr(f), y = c[p ? m === "floating" ? "reference" : "floating" : m], x = Ct(await s.getClippingRect({
|
|
684
684
|
element: (n = await (s.isElement == null ? void 0 : s.isElement(y))) == null || n ? y : y.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(c.floating)),
|
|
685
|
-
boundary:
|
|
686
|
-
rootBoundary:
|
|
685
|
+
boundary: l,
|
|
686
|
+
rootBoundary: u,
|
|
687
687
|
strategy: a
|
|
688
688
|
})), b = m === "floating" ? {
|
|
689
689
|
x: r,
|
|
690
690
|
y: o,
|
|
691
691
|
width: i.floating.width,
|
|
692
692
|
height: i.floating.height
|
|
693
|
-
} : i.reference, w = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)),
|
|
693
|
+
} : i.reference, w = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c.floating)), C = await (s.isElement == null ? void 0 : s.isElement(w)) ? await (s.getScale == null ? void 0 : s.getScale(w)) || {
|
|
694
694
|
x: 1,
|
|
695
695
|
y: 1
|
|
696
696
|
} : {
|
|
697
697
|
x: 1,
|
|
698
698
|
y: 1
|
|
699
|
-
},
|
|
699
|
+
}, M = Ct(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
700
700
|
elements: c,
|
|
701
701
|
rect: b,
|
|
702
702
|
offsetParent: w,
|
|
703
703
|
strategy: a
|
|
704
704
|
}) : b);
|
|
705
705
|
return {
|
|
706
|
-
top: (x.top -
|
|
707
|
-
bottom: (
|
|
708
|
-
left: (x.left -
|
|
709
|
-
right: (
|
|
706
|
+
top: (x.top - M.top + v.top) / C.y,
|
|
707
|
+
bottom: (M.bottom - x.bottom + v.bottom) / C.y,
|
|
708
|
+
left: (x.left - M.left + v.left) / C.x,
|
|
709
|
+
right: (M.right - x.right + v.right) / C.x
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
return (e ? [...n.filter((o) =>
|
|
712
|
+
function go(e, t, n) {
|
|
713
|
+
return (e ? [...n.filter((o) => Ce(o) === e), ...n.filter((o) => Ce(o) !== e)] : n.filter((o) => Ie(o) === o)).filter((o) => e ? Ce(o) === e || (t ? Rt(o) !== o : !1) : !0);
|
|
714
714
|
}
|
|
715
|
-
const
|
|
715
|
+
const ho = function(e) {
|
|
716
716
|
return e === void 0 && (e = {}), {
|
|
717
717
|
name: "autoPlacement",
|
|
718
718
|
options: e,
|
|
@@ -723,64 +723,64 @@ const go = function(e) {
|
|
|
723
723
|
middlewareData: i,
|
|
724
724
|
placement: c,
|
|
725
725
|
platform: a,
|
|
726
|
-
elements:
|
|
726
|
+
elements: l
|
|
727
727
|
} = t, {
|
|
728
|
-
crossAxis:
|
|
728
|
+
crossAxis: u = !1,
|
|
729
729
|
alignment: m,
|
|
730
|
-
allowedPlacements:
|
|
731
|
-
autoAlignment:
|
|
730
|
+
allowedPlacements: p = gn,
|
|
731
|
+
autoAlignment: f = !0,
|
|
732
732
|
...v
|
|
733
|
-
} = Qe(e, t),
|
|
733
|
+
} = Qe(e, t), g = m !== void 0 || p === gn ? go(m || null, f, p) : p, y = await Lt(t, v), x = ((n = i.autoPlacement) == null ? void 0 : n.index) || 0, b = g[x];
|
|
734
734
|
if (b == null)
|
|
735
735
|
return {};
|
|
736
|
-
const w =
|
|
736
|
+
const w = Zn(b, s, await (a.isRTL == null ? void 0 : a.isRTL(l.floating)));
|
|
737
737
|
if (c !== b)
|
|
738
738
|
return {
|
|
739
739
|
reset: {
|
|
740
|
-
placement:
|
|
740
|
+
placement: g[0]
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
|
-
const
|
|
743
|
+
const C = [y[Ie(b)], y[w[0]], y[w[1]]], M = [...((r = i.autoPlacement) == null ? void 0 : r.overflows) || [], {
|
|
744
744
|
placement: b,
|
|
745
|
-
overflows:
|
|
746
|
-
}],
|
|
747
|
-
if (
|
|
745
|
+
overflows: C
|
|
746
|
+
}], k = g[x + 1];
|
|
747
|
+
if (k)
|
|
748
748
|
return {
|
|
749
749
|
data: {
|
|
750
750
|
index: x + 1,
|
|
751
|
-
overflows:
|
|
751
|
+
overflows: M
|
|
752
752
|
},
|
|
753
753
|
reset: {
|
|
754
|
-
placement:
|
|
754
|
+
placement: k
|
|
755
755
|
}
|
|
756
756
|
};
|
|
757
|
-
const N =
|
|
758
|
-
const _ =
|
|
759
|
-
return [
|
|
757
|
+
const N = M.map((L) => {
|
|
758
|
+
const _ = Ce(L.placement);
|
|
759
|
+
return [L.placement, _ && u ? (
|
|
760
760
|
// Check along the mainAxis and main crossAxis side.
|
|
761
|
-
|
|
761
|
+
L.overflows.slice(0, 2).reduce((G, W) => G + W, 0)
|
|
762
762
|
) : (
|
|
763
763
|
// Check only the mainAxis.
|
|
764
|
-
|
|
765
|
-
),
|
|
766
|
-
}).sort((
|
|
764
|
+
L.overflows[0]
|
|
765
|
+
), L.overflows];
|
|
766
|
+
}).sort((L, _) => L[1] - _[1]), V = ((o = N.filter((L) => L[2].slice(
|
|
767
767
|
0,
|
|
768
768
|
// Aligned placements should not check their opposite crossAxis
|
|
769
769
|
// side.
|
|
770
|
-
|
|
770
|
+
Ce(L[0]) ? 2 : 3
|
|
771
771
|
).every((_) => _ <= 0))[0]) == null ? void 0 : o[0]) || N[0][0];
|
|
772
|
-
return
|
|
772
|
+
return V !== c ? {
|
|
773
773
|
data: {
|
|
774
774
|
index: x + 1,
|
|
775
|
-
overflows:
|
|
775
|
+
overflows: M
|
|
776
776
|
},
|
|
777
777
|
reset: {
|
|
778
|
-
placement:
|
|
778
|
+
placement: V
|
|
779
779
|
}
|
|
780
780
|
} : {};
|
|
781
781
|
}
|
|
782
782
|
};
|
|
783
|
-
},
|
|
783
|
+
}, vo = function(e) {
|
|
784
784
|
return e === void 0 && (e = {}), {
|
|
785
785
|
name: "flip",
|
|
786
786
|
options: e,
|
|
@@ -792,58 +792,58 @@ const go = function(e) {
|
|
|
792
792
|
rects: i,
|
|
793
793
|
initialPlacement: c,
|
|
794
794
|
platform: a,
|
|
795
|
-
elements:
|
|
795
|
+
elements: l
|
|
796
796
|
} = t, {
|
|
797
|
-
mainAxis:
|
|
797
|
+
mainAxis: u = !0,
|
|
798
798
|
crossAxis: m = !0,
|
|
799
|
-
fallbackPlacements:
|
|
800
|
-
fallbackStrategy:
|
|
799
|
+
fallbackPlacements: p,
|
|
800
|
+
fallbackStrategy: f = "bestFit",
|
|
801
801
|
fallbackAxisSideDirection: v = "none",
|
|
802
|
-
flipAlignment:
|
|
802
|
+
flipAlignment: g = !0,
|
|
803
803
|
...y
|
|
804
804
|
} = Qe(e, t);
|
|
805
805
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
806
806
|
return {};
|
|
807
|
-
const x =
|
|
808
|
-
!
|
|
809
|
-
const N = [c, ...
|
|
810
|
-
let
|
|
811
|
-
if (
|
|
812
|
-
const R =
|
|
813
|
-
|
|
807
|
+
const x = Ie(o), b = Se(c), w = Ie(c) === c, C = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), M = p || (w || !g ? [Et(c)] : Gr(c)), k = v !== "none";
|
|
808
|
+
!p && k && M.push(...Yr(c, g, v, C));
|
|
809
|
+
const N = [c, ...M], P = await Lt(t, y), V = [];
|
|
810
|
+
let L = ((r = s.flip) == null ? void 0 : r.overflows) || [];
|
|
811
|
+
if (u && V.push(P[x]), m) {
|
|
812
|
+
const R = Zn(o, i, C);
|
|
813
|
+
V.push(P[R[0]], P[R[1]]);
|
|
814
814
|
}
|
|
815
|
-
if (
|
|
815
|
+
if (L = [...L, {
|
|
816
816
|
placement: o,
|
|
817
|
-
overflows:
|
|
818
|
-
}], !
|
|
817
|
+
overflows: V
|
|
818
|
+
}], !V.every((R) => R <= 0)) {
|
|
819
819
|
var _, G;
|
|
820
820
|
const R = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, E = N[R];
|
|
821
|
-
if (E && (!(m === "alignment" ? b !==
|
|
821
|
+
if (E && (!(m === "alignment" ? b !== Se(E) : !1) || // We leave the current main axis only if every placement on that axis
|
|
822
822
|
// overflows the main axis.
|
|
823
|
-
|
|
823
|
+
L.every((h) => Se(h.placement) === b ? h.overflows[0] > 0 : !0)))
|
|
824
824
|
return {
|
|
825
825
|
data: {
|
|
826
826
|
index: R,
|
|
827
|
-
overflows:
|
|
827
|
+
overflows: L
|
|
828
828
|
},
|
|
829
829
|
reset: {
|
|
830
830
|
placement: E
|
|
831
831
|
}
|
|
832
832
|
};
|
|
833
|
-
let $ = (G =
|
|
833
|
+
let $ = (G = L.filter((T) => T.overflows[0] <= 0).sort((T, h) => T.overflows[1] - h.overflows[1])[0]) == null ? void 0 : G.placement;
|
|
834
834
|
if (!$)
|
|
835
|
-
switch (
|
|
835
|
+
switch (f) {
|
|
836
836
|
case "bestFit": {
|
|
837
|
-
var
|
|
838
|
-
const T = (
|
|
839
|
-
if (
|
|
840
|
-
const
|
|
841
|
-
return
|
|
837
|
+
var W;
|
|
838
|
+
const T = (W = L.filter((h) => {
|
|
839
|
+
if (k) {
|
|
840
|
+
const I = Se(h.placement);
|
|
841
|
+
return I === b || // Create a bias to the `y` side axis due to horizontal
|
|
842
842
|
// reading directions favoring greater width.
|
|
843
|
-
|
|
843
|
+
I === "y";
|
|
844
844
|
}
|
|
845
845
|
return !0;
|
|
846
|
-
}).map((h) => [h.placement, h.overflows.filter((
|
|
846
|
+
}).map((h) => [h.placement, h.overflows.filter((I) => I > 0).reduce((I, D) => I + D, 0)]).sort((h, I) => h[1] - I[1])[0]) == null ? void 0 : W[0];
|
|
847
847
|
T && ($ = T);
|
|
848
848
|
break;
|
|
849
849
|
}
|
|
@@ -861,16 +861,16 @@ const go = function(e) {
|
|
|
861
861
|
return {};
|
|
862
862
|
}
|
|
863
863
|
};
|
|
864
|
-
},
|
|
865
|
-
async function
|
|
864
|
+
}, bo = /* @__PURE__ */ new Set(["left", "top"]);
|
|
865
|
+
async function yo(e, t) {
|
|
866
866
|
const {
|
|
867
867
|
placement: n,
|
|
868
868
|
platform: r,
|
|
869
869
|
elements: o
|
|
870
|
-
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i =
|
|
870
|
+
} = e, s = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Ie(n), c = Ce(n), a = Se(n) === "y", l = bo.has(i) ? -1 : 1, u = s && a ? -1 : 1, m = Qe(t, e);
|
|
871
871
|
let {
|
|
872
|
-
mainAxis:
|
|
873
|
-
crossAxis:
|
|
872
|
+
mainAxis: p,
|
|
873
|
+
crossAxis: f,
|
|
874
874
|
alignmentAxis: v
|
|
875
875
|
} = typeof m == "number" ? {
|
|
876
876
|
mainAxis: m,
|
|
@@ -881,15 +881,15 @@ async function bo(e, t) {
|
|
|
881
881
|
crossAxis: m.crossAxis || 0,
|
|
882
882
|
alignmentAxis: m.alignmentAxis
|
|
883
883
|
};
|
|
884
|
-
return c && typeof v == "number" && (
|
|
885
|
-
x:
|
|
886
|
-
y:
|
|
884
|
+
return c && typeof v == "number" && (f = c === "end" ? v * -1 : v), a ? {
|
|
885
|
+
x: f * u,
|
|
886
|
+
y: p * l
|
|
887
887
|
} : {
|
|
888
|
-
x:
|
|
889
|
-
y:
|
|
888
|
+
x: p * l,
|
|
889
|
+
y: f * u
|
|
890
890
|
};
|
|
891
891
|
}
|
|
892
|
-
const
|
|
892
|
+
const wo = function(e) {
|
|
893
893
|
return e === void 0 && (e = 0), {
|
|
894
894
|
name: "offset",
|
|
895
895
|
options: e,
|
|
@@ -900,7 +900,7 @@ const yo = function(e) {
|
|
|
900
900
|
y: s,
|
|
901
901
|
placement: i,
|
|
902
902
|
middlewareData: c
|
|
903
|
-
} = t, a = await
|
|
903
|
+
} = t, a = await yo(t, e);
|
|
904
904
|
return i === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
|
|
905
905
|
x: o + a.x,
|
|
906
906
|
y: s + a.y,
|
|
@@ -911,7 +911,7 @@ const yo = function(e) {
|
|
|
911
911
|
};
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
|
-
},
|
|
914
|
+
}, xo = function(e) {
|
|
915
915
|
return e === void 0 && (e = {}), {
|
|
916
916
|
name: "shift",
|
|
917
917
|
options: e,
|
|
@@ -936,38 +936,38 @@ const yo = function(e) {
|
|
|
936
936
|
}
|
|
937
937
|
},
|
|
938
938
|
...a
|
|
939
|
-
} = Qe(e, t),
|
|
939
|
+
} = Qe(e, t), l = {
|
|
940
940
|
x: n,
|
|
941
941
|
y: r
|
|
942
|
-
},
|
|
943
|
-
let
|
|
942
|
+
}, u = await Lt(t, a), m = Se(Ie(o)), p = Yn(m);
|
|
943
|
+
let f = l[p], v = l[m];
|
|
944
944
|
if (s) {
|
|
945
|
-
const y =
|
|
946
|
-
|
|
945
|
+
const y = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", b = f + u[y], w = f - u[x];
|
|
946
|
+
f = hn(b, f, w);
|
|
947
947
|
}
|
|
948
948
|
if (i) {
|
|
949
|
-
const y = m === "y" ? "top" : "left", x = m === "y" ? "bottom" : "right", b = v +
|
|
949
|
+
const y = m === "y" ? "top" : "left", x = m === "y" ? "bottom" : "right", b = v + u[y], w = v - u[x];
|
|
950
950
|
v = hn(b, v, w);
|
|
951
951
|
}
|
|
952
|
-
const
|
|
952
|
+
const g = c.fn({
|
|
953
953
|
...t,
|
|
954
|
-
[
|
|
954
|
+
[p]: f,
|
|
955
955
|
[m]: v
|
|
956
956
|
});
|
|
957
957
|
return {
|
|
958
|
-
...
|
|
958
|
+
...g,
|
|
959
959
|
data: {
|
|
960
|
-
x:
|
|
961
|
-
y:
|
|
960
|
+
x: g.x - n,
|
|
961
|
+
y: g.y - r,
|
|
962
962
|
enabled: {
|
|
963
|
-
[
|
|
963
|
+
[p]: s,
|
|
964
964
|
[m]: i
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
969
|
};
|
|
970
|
-
},
|
|
970
|
+
}, Ro = function(e) {
|
|
971
971
|
return e === void 0 && (e = {}), {
|
|
972
972
|
name: "size",
|
|
973
973
|
options: e,
|
|
@@ -981,26 +981,26 @@ const yo = function(e) {
|
|
|
981
981
|
} = t, {
|
|
982
982
|
apply: a = () => {
|
|
983
983
|
},
|
|
984
|
-
...
|
|
985
|
-
} = Qe(e, t),
|
|
984
|
+
...l
|
|
985
|
+
} = Qe(e, t), u = await Lt(t, l), m = Ie(o), p = Ce(o), f = Se(o) === "y", {
|
|
986
986
|
width: v,
|
|
987
|
-
height:
|
|
987
|
+
height: g
|
|
988
988
|
} = s.floating;
|
|
989
989
|
let y, x;
|
|
990
|
-
m === "top" || m === "bottom" ? (y = m, x =
|
|
991
|
-
const b =
|
|
992
|
-
let N =
|
|
993
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (P = w), (r = t.middlewareData.shift) != null && r.enabled.y && (N = b),
|
|
994
|
-
const
|
|
995
|
-
|
|
990
|
+
m === "top" || m === "bottom" ? (y = m, x = p === (await (i.isRTL == null ? void 0 : i.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (x = m, y = p === "end" ? "top" : "bottom");
|
|
991
|
+
const b = g - u.top - u.bottom, w = v - u.left - u.right, C = Je(g - u[y], b), M = Je(v - u[x], w), k = !t.middlewareData.shift;
|
|
992
|
+
let N = C, P = M;
|
|
993
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (P = w), (r = t.middlewareData.shift) != null && r.enabled.y && (N = b), k && !p) {
|
|
994
|
+
const L = he(u.left, 0), _ = he(u.right, 0), G = he(u.top, 0), W = he(u.bottom, 0);
|
|
995
|
+
f ? P = v - 2 * (L !== 0 || _ !== 0 ? L + _ : he(u.left, u.right)) : N = g - 2 * (G !== 0 || W !== 0 ? G + W : he(u.top, u.bottom));
|
|
996
996
|
}
|
|
997
997
|
await a({
|
|
998
998
|
...t,
|
|
999
999
|
availableWidth: P,
|
|
1000
1000
|
availableHeight: N
|
|
1001
1001
|
});
|
|
1002
|
-
const
|
|
1003
|
-
return v !==
|
|
1002
|
+
const V = await i.getDimensions(c.floating);
|
|
1003
|
+
return v !== V.width || g !== V.height ? {
|
|
1004
1004
|
reset: {
|
|
1005
1005
|
rects: !0
|
|
1006
1006
|
}
|
|
@@ -1008,7 +1008,7 @@ const yo = function(e) {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
};
|
|
1010
1010
|
};
|
|
1011
|
-
function
|
|
1011
|
+
function dr(e) {
|
|
1012
1012
|
const t = we(e);
|
|
1013
1013
|
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
1014
1014
|
const o = ne(e), s = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, c = xt(n) !== s || xt(r) !== i;
|
|
@@ -1018,70 +1018,66 @@ function fr(e) {
|
|
|
1018
1018
|
$: c
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
|
-
function
|
|
1022
|
-
return
|
|
1021
|
+
function un(e) {
|
|
1022
|
+
return Y(e) ? e : e.contextElement;
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1025
|
-
const t =
|
|
1024
|
+
function Xe(e) {
|
|
1025
|
+
const t = un(e);
|
|
1026
1026
|
if (!ne(t))
|
|
1027
1027
|
return Ee(1);
|
|
1028
1028
|
const n = t.getBoundingClientRect(), {
|
|
1029
1029
|
width: r,
|
|
1030
1030
|
height: o,
|
|
1031
1031
|
$: s
|
|
1032
|
-
} =
|
|
1032
|
+
} = dr(t);
|
|
1033
1033
|
let i = (s ? xt(n.width) : n.width) / r, c = (s ? xt(n.height) : n.height) / o;
|
|
1034
1034
|
return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
1035
1035
|
x: i,
|
|
1036
1036
|
y: c
|
|
1037
1037
|
};
|
|
1038
1038
|
}
|
|
1039
|
-
const
|
|
1040
|
-
function
|
|
1039
|
+
const Eo = /* @__PURE__ */ Ee(0);
|
|
1040
|
+
function mr(e) {
|
|
1041
1041
|
const t = pe(e);
|
|
1042
|
-
return !Pt() || !t.visualViewport ?
|
|
1042
|
+
return !Pt() || !t.visualViewport ? Eo : {
|
|
1043
1043
|
x: t.visualViewport.offsetLeft,
|
|
1044
1044
|
y: t.visualViewport.offsetTop
|
|
1045
1045
|
};
|
|
1046
1046
|
}
|
|
1047
|
-
function
|
|
1047
|
+
function Co(e, t, n) {
|
|
1048
1048
|
return t === void 0 && (t = !1), !n || t && n !== pe(e) ? !1 : t;
|
|
1049
1049
|
}
|
|
1050
1050
|
function He(e, t, n, r) {
|
|
1051
1051
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
1052
|
-
const o = e.getBoundingClientRect(), s =
|
|
1052
|
+
const o = e.getBoundingClientRect(), s = un(e);
|
|
1053
1053
|
let i = Ee(1);
|
|
1054
|
-
t && (r ?
|
|
1055
|
-
const c =
|
|
1056
|
-
let a = (o.left + c.x) / i.x,
|
|
1054
|
+
t && (r ? Y(r) && (i = Xe(r)) : i = Xe(e));
|
|
1055
|
+
const c = Co(s, n, r) ? mr(s) : Ee(0);
|
|
1056
|
+
let a = (o.left + c.x) / i.x, l = (o.top + c.y) / i.y, u = o.width / i.x, m = o.height / i.y;
|
|
1057
1057
|
if (s) {
|
|
1058
|
-
const
|
|
1059
|
-
let v =
|
|
1060
|
-
for (;
|
|
1061
|
-
const y =
|
|
1062
|
-
a *= y.x,
|
|
1058
|
+
const p = pe(s), f = r && Y(r) ? pe(r) : r;
|
|
1059
|
+
let v = p, g = Qt(v);
|
|
1060
|
+
for (; g && r && f !== v; ) {
|
|
1061
|
+
const y = Xe(g), x = g.getBoundingClientRect(), b = we(g), w = x.left + (g.clientLeft + parseFloat(b.paddingLeft)) * y.x, C = x.top + (g.clientTop + parseFloat(b.paddingTop)) * y.y;
|
|
1062
|
+
a *= y.x, l *= y.y, u *= y.x, m *= y.y, a += w, l += C, v = pe(g), g = Qt(v);
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
return
|
|
1066
|
-
width:
|
|
1065
|
+
return Ct({
|
|
1066
|
+
width: u,
|
|
1067
1067
|
height: m,
|
|
1068
1068
|
x: a,
|
|
1069
|
-
y:
|
|
1069
|
+
y: l
|
|
1070
1070
|
});
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function kt(e, t) {
|
|
1073
1073
|
const n = Dt(e).scrollLeft;
|
|
1074
1074
|
return t ? t.left + n : He(Te(e)).left + n;
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1077
|
-
n
|
|
1078
|
-
const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
|
|
1079
|
-
// RTL <body> scrollbar.
|
|
1080
|
-
un(e, r)
|
|
1081
|
-
)), s = r.top + t.scrollTop;
|
|
1076
|
+
function pr(e, t) {
|
|
1077
|
+
const n = e.getBoundingClientRect(), r = n.left + t.scrollLeft - kt(e, n), o = n.top + t.scrollTop;
|
|
1082
1078
|
return {
|
|
1083
|
-
x:
|
|
1084
|
-
y:
|
|
1079
|
+
x: r,
|
|
1080
|
+
y: o
|
|
1085
1081
|
};
|
|
1086
1082
|
}
|
|
1087
1083
|
function Io(e) {
|
|
@@ -1091,32 +1087,32 @@ function Io(e) {
|
|
|
1091
1087
|
offsetParent: r,
|
|
1092
1088
|
strategy: o
|
|
1093
1089
|
} = e;
|
|
1094
|
-
const s = o === "fixed", i = Te(r), c = t ?
|
|
1090
|
+
const s = o === "fixed", i = Te(r), c = t ? Mt(t.floating) : !1;
|
|
1095
1091
|
if (r === i || c && s)
|
|
1096
1092
|
return n;
|
|
1097
1093
|
let a = {
|
|
1098
1094
|
scrollLeft: 0,
|
|
1099
1095
|
scrollTop: 0
|
|
1100
|
-
},
|
|
1101
|
-
const
|
|
1102
|
-
if ((m || !m && !s) && ((
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1096
|
+
}, l = Ee(1);
|
|
1097
|
+
const u = Ee(0), m = ne(r);
|
|
1098
|
+
if ((m || !m && !s) && ((We(r) !== "body" || ut(i)) && (a = Dt(r)), ne(r))) {
|
|
1099
|
+
const f = He(r);
|
|
1100
|
+
l = Xe(r), u.x = f.x + r.clientLeft, u.y = f.y + r.clientTop;
|
|
1105
1101
|
}
|
|
1106
|
-
const
|
|
1102
|
+
const p = i && !m && !s ? pr(i, a) : Ee(0);
|
|
1107
1103
|
return {
|
|
1108
|
-
width: n.width *
|
|
1109
|
-
height: n.height *
|
|
1110
|
-
x: n.x *
|
|
1111
|
-
y: n.y *
|
|
1104
|
+
width: n.width * l.x,
|
|
1105
|
+
height: n.height * l.y,
|
|
1106
|
+
x: n.x * l.x - a.scrollLeft * l.x + u.x + p.x,
|
|
1107
|
+
y: n.y * l.y - a.scrollTop * l.y + u.y + p.y
|
|
1112
1108
|
};
|
|
1113
1109
|
}
|
|
1114
|
-
function
|
|
1110
|
+
function To(e) {
|
|
1115
1111
|
return Array.from(e.getClientRects());
|
|
1116
1112
|
}
|
|
1117
|
-
function
|
|
1113
|
+
function Oo(e) {
|
|
1118
1114
|
const t = Te(e), n = Dt(e), r = e.ownerDocument.body, o = he(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), s = he(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
1119
|
-
let i = -n.scrollLeft +
|
|
1115
|
+
let i = -n.scrollLeft + kt(e);
|
|
1120
1116
|
const c = -n.scrollTop;
|
|
1121
1117
|
return we(r).direction === "rtl" && (i += he(t.clientWidth, r.clientWidth) - o), {
|
|
1122
1118
|
width: o,
|
|
@@ -1125,7 +1121,8 @@ function To(e) {
|
|
|
1125
1121
|
y: c
|
|
1126
1122
|
};
|
|
1127
1123
|
}
|
|
1128
|
-
|
|
1124
|
+
const En = 25;
|
|
1125
|
+
function Ao(e, t) {
|
|
1129
1126
|
const n = pe(e), r = Te(e), o = n.visualViewport;
|
|
1130
1127
|
let s = r.clientWidth, i = r.clientHeight, c = 0, a = 0;
|
|
1131
1128
|
if (o) {
|
|
@@ -1133,6 +1130,11 @@ function Oo(e, t) {
|
|
|
1133
1130
|
const u = Pt();
|
|
1134
1131
|
(!u || u && t === "fixed") && (c = o.offsetLeft, a = o.offsetTop);
|
|
1135
1132
|
}
|
|
1133
|
+
const l = kt(r);
|
|
1134
|
+
if (l <= 0) {
|
|
1135
|
+
const u = r.ownerDocument, m = u.body, p = getComputedStyle(m), f = u.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, v = Math.abs(r.clientWidth - m.clientWidth - f);
|
|
1136
|
+
v <= En && (s -= v);
|
|
1137
|
+
} else l <= En && (s += l);
|
|
1136
1138
|
return {
|
|
1137
1139
|
width: s,
|
|
1138
1140
|
height: i,
|
|
@@ -1140,26 +1142,26 @@ function Oo(e, t) {
|
|
|
1140
1142
|
y: a
|
|
1141
1143
|
};
|
|
1142
1144
|
}
|
|
1143
|
-
const
|
|
1145
|
+
const So = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1144
1146
|
function Mo(e, t) {
|
|
1145
|
-
const n = He(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = ne(e) ?
|
|
1147
|
+
const n = He(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, s = ne(e) ? Xe(e) : Ee(1), i = e.clientWidth * s.x, c = e.clientHeight * s.y, a = o * s.x, l = r * s.y;
|
|
1146
1148
|
return {
|
|
1147
1149
|
width: i,
|
|
1148
1150
|
height: c,
|
|
1149
1151
|
x: a,
|
|
1150
|
-
y:
|
|
1152
|
+
y: l
|
|
1151
1153
|
};
|
|
1152
1154
|
}
|
|
1153
|
-
function
|
|
1155
|
+
function Cn(e, t, n) {
|
|
1154
1156
|
let r;
|
|
1155
1157
|
if (t === "viewport")
|
|
1156
|
-
r =
|
|
1158
|
+
r = Ao(e, n);
|
|
1157
1159
|
else if (t === "document")
|
|
1158
|
-
r =
|
|
1159
|
-
else if (
|
|
1160
|
+
r = Oo(Te(e));
|
|
1161
|
+
else if (Y(t))
|
|
1160
1162
|
r = Mo(t, n);
|
|
1161
1163
|
else {
|
|
1162
|
-
const o =
|
|
1164
|
+
const o = mr(e);
|
|
1163
1165
|
r = {
|
|
1164
1166
|
x: t.x - o.x,
|
|
1165
1167
|
y: t.y - o.y,
|
|
@@ -1167,36 +1169,36 @@ function En(e, t, n) {
|
|
|
1167
1169
|
height: t.height
|
|
1168
1170
|
};
|
|
1169
1171
|
}
|
|
1170
|
-
return
|
|
1172
|
+
return Ct(r);
|
|
1171
1173
|
}
|
|
1172
|
-
function
|
|
1174
|
+
function gr(e, t) {
|
|
1173
1175
|
const n = Pe(e);
|
|
1174
|
-
return n === t || !
|
|
1176
|
+
return n === t || !Y(n) || Me(n) ? !1 : we(n).position === "fixed" || gr(n, t);
|
|
1175
1177
|
}
|
|
1176
|
-
function
|
|
1178
|
+
function Po(e, t) {
|
|
1177
1179
|
const n = t.get(e);
|
|
1178
1180
|
if (n)
|
|
1179
1181
|
return n;
|
|
1180
|
-
let r =
|
|
1182
|
+
let r = ke(e, [], !1).filter((c) => Y(c) && We(c) !== "body"), o = null;
|
|
1181
1183
|
const s = we(e).position === "fixed";
|
|
1182
1184
|
let i = s ? Pe(e) : e;
|
|
1183
|
-
for (;
|
|
1184
|
-
const c = we(i), a =
|
|
1185
|
-
!a && c.position === "fixed" && (o = null), (s ? !a && !o : !a && c.position === "static" && !!o &&
|
|
1185
|
+
for (; Y(i) && !Me(i); ) {
|
|
1186
|
+
const c = we(i), a = on(i);
|
|
1187
|
+
!a && c.position === "fixed" && (o = null), (s ? !a && !o : !a && c.position === "static" && !!o && So.has(o.position) || ut(i) && !a && gr(e, i)) ? r = r.filter((u) => u !== i) : o = c, i = Pe(i);
|
|
1186
1188
|
}
|
|
1187
1189
|
return t.set(e, r), r;
|
|
1188
1190
|
}
|
|
1189
|
-
function
|
|
1191
|
+
function Do(e) {
|
|
1190
1192
|
let {
|
|
1191
1193
|
element: t,
|
|
1192
1194
|
boundary: n,
|
|
1193
1195
|
rootBoundary: r,
|
|
1194
1196
|
strategy: o
|
|
1195
1197
|
} = e;
|
|
1196
|
-
const i = [...n === "clippingAncestors" ?
|
|
1197
|
-
const m =
|
|
1198
|
-
return
|
|
1199
|
-
},
|
|
1198
|
+
const i = [...n === "clippingAncestors" ? Mt(t) ? [] : Po(t, this._c) : [].concat(n), r], c = i[0], a = i.reduce((l, u) => {
|
|
1199
|
+
const m = Cn(t, u, o);
|
|
1200
|
+
return l.top = he(m.top, l.top), l.right = Je(m.right, l.right), l.bottom = Je(m.bottom, l.bottom), l.left = he(m.left, l.left), l;
|
|
1201
|
+
}, Cn(t, c, o));
|
|
1200
1202
|
return {
|
|
1201
1203
|
width: a.right - a.left,
|
|
1202
1204
|
height: a.bottom - a.top,
|
|
@@ -1204,11 +1206,11 @@ function Po(e) {
|
|
|
1204
1206
|
y: a.top
|
|
1205
1207
|
};
|
|
1206
1208
|
}
|
|
1207
|
-
function
|
|
1209
|
+
function Lo(e) {
|
|
1208
1210
|
const {
|
|
1209
1211
|
width: t,
|
|
1210
1212
|
height: n
|
|
1211
|
-
} =
|
|
1213
|
+
} = dr(e);
|
|
1212
1214
|
return {
|
|
1213
1215
|
width: t,
|
|
1214
1216
|
height: n
|
|
@@ -1221,24 +1223,24 @@ function ko(e, t, n) {
|
|
|
1221
1223
|
scrollTop: 0
|
|
1222
1224
|
};
|
|
1223
1225
|
const a = Ee(0);
|
|
1224
|
-
function
|
|
1225
|
-
a.x =
|
|
1226
|
+
function l() {
|
|
1227
|
+
a.x = kt(o);
|
|
1226
1228
|
}
|
|
1227
1229
|
if (r || !r && !s)
|
|
1228
|
-
if ((
|
|
1229
|
-
const
|
|
1230
|
-
a.x =
|
|
1231
|
-
} else o &&
|
|
1232
|
-
s && !r && o &&
|
|
1233
|
-
const
|
|
1230
|
+
if ((We(t) !== "body" || ut(o)) && (c = Dt(t)), r) {
|
|
1231
|
+
const f = He(t, !0, s, t);
|
|
1232
|
+
a.x = f.x + t.clientLeft, a.y = f.y + t.clientTop;
|
|
1233
|
+
} else o && l();
|
|
1234
|
+
s && !r && o && l();
|
|
1235
|
+
const u = o && !r && !s ? pr(o, c) : Ee(0), m = i.left + c.scrollLeft - a.x - u.x, p = i.top + c.scrollTop - a.y - u.y;
|
|
1234
1236
|
return {
|
|
1235
1237
|
x: m,
|
|
1236
|
-
y:
|
|
1238
|
+
y: p,
|
|
1237
1239
|
width: i.width,
|
|
1238
1240
|
height: i.height
|
|
1239
1241
|
};
|
|
1240
1242
|
}
|
|
1241
|
-
function
|
|
1243
|
+
function $t(e) {
|
|
1242
1244
|
return we(e).position === "static";
|
|
1243
1245
|
}
|
|
1244
1246
|
function In(e, t) {
|
|
@@ -1249,26 +1251,26 @@ function In(e, t) {
|
|
|
1249
1251
|
let n = e.offsetParent;
|
|
1250
1252
|
return Te(e) === n && (n = n.ownerDocument.body), n;
|
|
1251
1253
|
}
|
|
1252
|
-
function
|
|
1254
|
+
function hr(e, t) {
|
|
1253
1255
|
const n = pe(e);
|
|
1254
|
-
if (
|
|
1256
|
+
if (Mt(e))
|
|
1255
1257
|
return n;
|
|
1256
1258
|
if (!ne(e)) {
|
|
1257
1259
|
let o = Pe(e);
|
|
1258
|
-
for (; o && !
|
|
1259
|
-
if (
|
|
1260
|
+
for (; o && !Me(o); ) {
|
|
1261
|
+
if (Y(o) && !$t(o))
|
|
1260
1262
|
return o;
|
|
1261
1263
|
o = Pe(o);
|
|
1262
1264
|
}
|
|
1263
1265
|
return n;
|
|
1264
1266
|
}
|
|
1265
1267
|
let r = In(e, t);
|
|
1266
|
-
for (; r &&
|
|
1268
|
+
for (; r && Fr(r) && $t(r); )
|
|
1267
1269
|
r = In(r, t);
|
|
1268
|
-
return r &&
|
|
1270
|
+
return r && Me(r) && $t(r) && !on(r) ? n : r || Kr(e) || n;
|
|
1269
1271
|
}
|
|
1270
|
-
const
|
|
1271
|
-
const t = this.getOffsetParent ||
|
|
1272
|
+
const Fo = async function(e) {
|
|
1273
|
+
const t = this.getOffsetParent || hr, n = this.getDimensions, r = await n(e.floating);
|
|
1272
1274
|
return {
|
|
1273
1275
|
reference: ko(e.reference, await t(e.floating), e.strategy),
|
|
1274
1276
|
floating: {
|
|
@@ -1279,25 +1281,25 @@ const Lo = async function(e) {
|
|
|
1279
1281
|
}
|
|
1280
1282
|
};
|
|
1281
1283
|
};
|
|
1282
|
-
function
|
|
1284
|
+
function No(e) {
|
|
1283
1285
|
return we(e).direction === "rtl";
|
|
1284
1286
|
}
|
|
1285
|
-
const
|
|
1287
|
+
const _o = {
|
|
1286
1288
|
convertOffsetParentRelativeRectToViewportRelativeRect: Io,
|
|
1287
1289
|
getDocumentElement: Te,
|
|
1288
|
-
getClippingRect:
|
|
1289
|
-
getOffsetParent:
|
|
1290
|
-
getElementRects:
|
|
1291
|
-
getClientRects:
|
|
1292
|
-
getDimensions:
|
|
1293
|
-
getScale:
|
|
1294
|
-
isElement:
|
|
1295
|
-
isRTL:
|
|
1290
|
+
getClippingRect: Do,
|
|
1291
|
+
getOffsetParent: hr,
|
|
1292
|
+
getElementRects: Fo,
|
|
1293
|
+
getClientRects: To,
|
|
1294
|
+
getDimensions: Lo,
|
|
1295
|
+
getScale: Xe,
|
|
1296
|
+
isElement: Y,
|
|
1297
|
+
isRTL: No
|
|
1296
1298
|
};
|
|
1297
|
-
function
|
|
1299
|
+
function vr(e, t) {
|
|
1298
1300
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1299
1301
|
}
|
|
1300
|
-
function
|
|
1302
|
+
function Wo(e, t) {
|
|
1301
1303
|
let n = null, r;
|
|
1302
1304
|
const o = Te(e);
|
|
1303
1305
|
function s() {
|
|
@@ -1306,44 +1308,44 @@ function _o(e, t) {
|
|
|
1306
1308
|
}
|
|
1307
1309
|
function i(c, a) {
|
|
1308
1310
|
c === void 0 && (c = !1), a === void 0 && (a = 1), s();
|
|
1309
|
-
const
|
|
1310
|
-
left:
|
|
1311
|
+
const l = e.getBoundingClientRect(), {
|
|
1312
|
+
left: u,
|
|
1311
1313
|
top: m,
|
|
1312
|
-
width:
|
|
1313
|
-
height:
|
|
1314
|
-
} =
|
|
1315
|
-
if (c || t(), !
|
|
1314
|
+
width: p,
|
|
1315
|
+
height: f
|
|
1316
|
+
} = l;
|
|
1317
|
+
if (c || t(), !p || !f)
|
|
1316
1318
|
return;
|
|
1317
|
-
const v = je(m),
|
|
1318
|
-
rootMargin: -v + "px " + -
|
|
1319
|
+
const v = je(m), g = je(o.clientWidth - (u + p)), y = je(o.clientHeight - (m + f)), x = je(u), w = {
|
|
1320
|
+
rootMargin: -v + "px " + -g + "px " + -y + "px " + -x + "px",
|
|
1319
1321
|
threshold: he(0, Je(1, a)) || 1
|
|
1320
1322
|
};
|
|
1321
|
-
let
|
|
1322
|
-
function
|
|
1323
|
-
const N =
|
|
1323
|
+
let C = !0;
|
|
1324
|
+
function M(k) {
|
|
1325
|
+
const N = k[0].intersectionRatio;
|
|
1324
1326
|
if (N !== a) {
|
|
1325
|
-
if (!
|
|
1327
|
+
if (!C)
|
|
1326
1328
|
return i();
|
|
1327
1329
|
N ? i(!1, N) : r = setTimeout(() => {
|
|
1328
1330
|
i(!1, 1e-7);
|
|
1329
1331
|
}, 1e3);
|
|
1330
1332
|
}
|
|
1331
|
-
N === 1 && !
|
|
1333
|
+
N === 1 && !vr(l, e.getBoundingClientRect()) && i(), C = !1;
|
|
1332
1334
|
}
|
|
1333
1335
|
try {
|
|
1334
|
-
n = new IntersectionObserver(
|
|
1336
|
+
n = new IntersectionObserver(M, {
|
|
1335
1337
|
...w,
|
|
1336
1338
|
// Handle <iframe>s
|
|
1337
1339
|
root: o.ownerDocument
|
|
1338
1340
|
});
|
|
1339
1341
|
} catch {
|
|
1340
|
-
n = new IntersectionObserver(
|
|
1342
|
+
n = new IntersectionObserver(M, w);
|
|
1341
1343
|
}
|
|
1342
1344
|
n.observe(e);
|
|
1343
1345
|
}
|
|
1344
1346
|
return i(!0), s;
|
|
1345
1347
|
}
|
|
1346
|
-
function
|
|
1348
|
+
function Ci(e, t, n, r) {
|
|
1347
1349
|
r === void 0 && (r = {});
|
|
1348
1350
|
const {
|
|
1349
1351
|
ancestorScroll: o = !0,
|
|
@@ -1351,49 +1353,49 @@ function Ei(e, t, n, r) {
|
|
|
1351
1353
|
elementResize: i = typeof ResizeObserver == "function",
|
|
1352
1354
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1353
1355
|
animationFrame: a = !1
|
|
1354
|
-
} = r,
|
|
1355
|
-
|
|
1356
|
+
} = r, l = un(e), u = o || s ? [...l ? ke(l) : [], ...ke(t)] : [];
|
|
1357
|
+
u.forEach((x) => {
|
|
1356
1358
|
o && x.addEventListener("scroll", n, {
|
|
1357
1359
|
passive: !0
|
|
1358
1360
|
}), s && x.addEventListener("resize", n);
|
|
1359
1361
|
});
|
|
1360
|
-
const m =
|
|
1361
|
-
let
|
|
1362
|
-
i && (
|
|
1362
|
+
const m = l && c ? Wo(l, n) : null;
|
|
1363
|
+
let p = -1, f = null;
|
|
1364
|
+
i && (f = new ResizeObserver((x) => {
|
|
1363
1365
|
let [b] = x;
|
|
1364
|
-
b && b.target ===
|
|
1366
|
+
b && b.target === l && f && (f.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
|
|
1365
1367
|
var w;
|
|
1366
|
-
(w =
|
|
1368
|
+
(w = f) == null || w.observe(t);
|
|
1367
1369
|
})), n();
|
|
1368
|
-
}),
|
|
1369
|
-
let v,
|
|
1370
|
+
}), l && !a && f.observe(l), f.observe(t));
|
|
1371
|
+
let v, g = a ? He(e) : null;
|
|
1370
1372
|
a && y();
|
|
1371
1373
|
function y() {
|
|
1372
1374
|
const x = He(e);
|
|
1373
|
-
|
|
1375
|
+
g && !vr(g, x) && n(), g = x, v = requestAnimationFrame(y);
|
|
1374
1376
|
}
|
|
1375
1377
|
return n(), () => {
|
|
1376
1378
|
var x;
|
|
1377
|
-
|
|
1379
|
+
u.forEach((b) => {
|
|
1378
1380
|
o && b.removeEventListener("scroll", n), s && b.removeEventListener("resize", n);
|
|
1379
|
-
}), m
|
|
1381
|
+
}), m?.(), (x = f) == null || x.disconnect(), f = null, a && cancelAnimationFrame(v);
|
|
1380
1382
|
};
|
|
1381
1383
|
}
|
|
1382
|
-
const Vo =
|
|
1384
|
+
const Vo = wo, Ko = ho, $o = xo, Bo = vo, Ho = Ro, zo = (e, t, n) => {
|
|
1383
1385
|
const r = /* @__PURE__ */ new Map(), o = {
|
|
1384
|
-
platform:
|
|
1386
|
+
platform: _o,
|
|
1385
1387
|
...n
|
|
1386
1388
|
}, s = {
|
|
1387
1389
|
...o.platform,
|
|
1388
1390
|
_c: r
|
|
1389
1391
|
};
|
|
1390
|
-
return
|
|
1392
|
+
return po(e, t, {
|
|
1391
1393
|
...o,
|
|
1392
1394
|
platform: s
|
|
1393
1395
|
});
|
|
1394
1396
|
};
|
|
1395
|
-
var
|
|
1396
|
-
}, wt =
|
|
1397
|
+
var Uo = typeof document < "u", Go = function() {
|
|
1398
|
+
}, wt = Uo ? Gn : Go;
|
|
1397
1399
|
function Tt(e, t) {
|
|
1398
1400
|
if (e === t)
|
|
1399
1401
|
return !0;
|
|
@@ -1424,20 +1426,20 @@ function Tt(e, t) {
|
|
|
1424
1426
|
}
|
|
1425
1427
|
return e !== e && t !== t;
|
|
1426
1428
|
}
|
|
1427
|
-
function
|
|
1429
|
+
function br(e) {
|
|
1428
1430
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1429
1431
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const n =
|
|
1432
|
+
function Tn(e, t) {
|
|
1433
|
+
const n = br(e);
|
|
1432
1434
|
return Math.round(t * n) / n;
|
|
1433
1435
|
}
|
|
1434
|
-
function
|
|
1435
|
-
const t =
|
|
1436
|
+
function Bt(e) {
|
|
1437
|
+
const t = d.useRef(e);
|
|
1436
1438
|
return wt(() => {
|
|
1437
1439
|
t.current = e;
|
|
1438
1440
|
}), t;
|
|
1439
1441
|
}
|
|
1440
|
-
function
|
|
1442
|
+
function jo(e) {
|
|
1441
1443
|
e === void 0 && (e = {});
|
|
1442
1444
|
const {
|
|
1443
1445
|
placement: t = "bottom",
|
|
@@ -1450,67 +1452,67 @@ function Go(e) {
|
|
|
1450
1452
|
} = {},
|
|
1451
1453
|
transform: c = !0,
|
|
1452
1454
|
whileElementsMounted: a,
|
|
1453
|
-
open:
|
|
1454
|
-
} = e, [
|
|
1455
|
+
open: l
|
|
1456
|
+
} = e, [u, m] = d.useState({
|
|
1455
1457
|
x: 0,
|
|
1456
1458
|
y: 0,
|
|
1457
1459
|
strategy: n,
|
|
1458
1460
|
placement: t,
|
|
1459
1461
|
middlewareData: {},
|
|
1460
1462
|
isPositioned: !1
|
|
1461
|
-
}), [
|
|
1462
|
-
Tt(
|
|
1463
|
-
const [v,
|
|
1464
|
-
h !==
|
|
1465
|
-
}, []), w =
|
|
1463
|
+
}), [p, f] = d.useState(r);
|
|
1464
|
+
Tt(p, r) || f(r);
|
|
1465
|
+
const [v, g] = d.useState(null), [y, x] = d.useState(null), b = d.useCallback((h) => {
|
|
1466
|
+
h !== k.current && (k.current = h, g(h));
|
|
1467
|
+
}, []), w = d.useCallback((h) => {
|
|
1466
1468
|
h !== N.current && (N.current = h, x(h));
|
|
1467
|
-
}, []),
|
|
1468
|
-
if (!
|
|
1469
|
+
}, []), C = s || v, M = i || y, k = d.useRef(null), N = d.useRef(null), P = d.useRef(u), V = a != null, L = Bt(a), _ = Bt(o), G = Bt(l), W = d.useCallback(() => {
|
|
1470
|
+
if (!k.current || !N.current)
|
|
1469
1471
|
return;
|
|
1470
1472
|
const h = {
|
|
1471
1473
|
placement: t,
|
|
1472
1474
|
strategy: n,
|
|
1473
|
-
middleware:
|
|
1475
|
+
middleware: p
|
|
1474
1476
|
};
|
|
1475
|
-
_.current && (h.platform = _.current),
|
|
1477
|
+
_.current && (h.platform = _.current), zo(k.current, N.current, h).then((I) => {
|
|
1476
1478
|
const D = {
|
|
1477
|
-
...
|
|
1479
|
+
...I,
|
|
1478
1480
|
// The floating element's position may be recomputed while it's closed
|
|
1479
1481
|
// but still mounted (such as when transitioning out). To ensure
|
|
1480
1482
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
1481
1483
|
// setting it to `true` when `open === false` (must be specified).
|
|
1482
1484
|
isPositioned: G.current !== !1
|
|
1483
1485
|
};
|
|
1484
|
-
R.current && !Tt(P.current, D) && (P.current = D,
|
|
1486
|
+
R.current && !Tt(P.current, D) && (P.current = D, nn.flushSync(() => {
|
|
1485
1487
|
m(D);
|
|
1486
1488
|
}));
|
|
1487
1489
|
});
|
|
1488
|
-
}, [
|
|
1490
|
+
}, [p, t, n, _, G]);
|
|
1489
1491
|
wt(() => {
|
|
1490
|
-
|
|
1492
|
+
l === !1 && P.current.isPositioned && (P.current.isPositioned = !1, m((h) => ({
|
|
1491
1493
|
...h,
|
|
1492
1494
|
isPositioned: !1
|
|
1493
1495
|
})));
|
|
1494
|
-
}, [
|
|
1495
|
-
const R =
|
|
1496
|
+
}, [l]);
|
|
1497
|
+
const R = d.useRef(!1);
|
|
1496
1498
|
wt(() => (R.current = !0, () => {
|
|
1497
1499
|
R.current = !1;
|
|
1498
1500
|
}), []), wt(() => {
|
|
1499
|
-
if (
|
|
1500
|
-
if (
|
|
1501
|
-
return
|
|
1502
|
-
|
|
1503
|
-
}
|
|
1504
|
-
}, [
|
|
1505
|
-
const E =
|
|
1506
|
-
reference:
|
|
1501
|
+
if (C && (k.current = C), M && (N.current = M), C && M) {
|
|
1502
|
+
if (L.current)
|
|
1503
|
+
return L.current(C, M, W);
|
|
1504
|
+
W();
|
|
1505
|
+
}
|
|
1506
|
+
}, [C, M, W, L, V]);
|
|
1507
|
+
const E = d.useMemo(() => ({
|
|
1508
|
+
reference: k,
|
|
1507
1509
|
floating: N,
|
|
1508
1510
|
setReference: b,
|
|
1509
1511
|
setFloating: w
|
|
1510
|
-
}), [b, w]), $ =
|
|
1511
|
-
reference:
|
|
1512
|
-
floating:
|
|
1513
|
-
}), [
|
|
1512
|
+
}), [b, w]), $ = d.useMemo(() => ({
|
|
1513
|
+
reference: C,
|
|
1514
|
+
floating: M
|
|
1515
|
+
}), [C, M]), T = d.useMemo(() => {
|
|
1514
1516
|
const h = {
|
|
1515
1517
|
position: n,
|
|
1516
1518
|
left: 0,
|
|
@@ -1518,33 +1520,30 @@ function Go(e) {
|
|
|
1518
1520
|
};
|
|
1519
1521
|
if (!$.floating)
|
|
1520
1522
|
return h;
|
|
1521
|
-
const
|
|
1523
|
+
const I = Tn($.floating, u.x), D = Tn($.floating, u.y);
|
|
1522
1524
|
return c ? {
|
|
1523
1525
|
...h,
|
|
1524
|
-
transform: "translate(" +
|
|
1525
|
-
...
|
|
1526
|
+
transform: "translate(" + I + "px, " + D + "px)",
|
|
1527
|
+
...br($.floating) >= 1.5 && {
|
|
1526
1528
|
willChange: "transform"
|
|
1527
1529
|
}
|
|
1528
1530
|
} : {
|
|
1529
1531
|
position: n,
|
|
1530
|
-
left:
|
|
1532
|
+
left: I,
|
|
1531
1533
|
top: D
|
|
1532
1534
|
};
|
|
1533
|
-
}, [n, c, $.floating,
|
|
1534
|
-
return
|
|
1535
|
-
...
|
|
1536
|
-
update:
|
|
1535
|
+
}, [n, c, $.floating, u.x, u.y]);
|
|
1536
|
+
return d.useMemo(() => ({
|
|
1537
|
+
...u,
|
|
1538
|
+
update: W,
|
|
1537
1539
|
refs: E,
|
|
1538
1540
|
elements: $,
|
|
1539
1541
|
floatingStyles: T
|
|
1540
|
-
}), [
|
|
1542
|
+
}), [u, W, E, $, T]);
|
|
1541
1543
|
}
|
|
1542
1544
|
const Ii = (e, t) => ({
|
|
1543
1545
|
...Vo(e),
|
|
1544
1546
|
options: [e, t]
|
|
1545
|
-
}), Ci = (e, t) => ({
|
|
1546
|
-
...Ko(e),
|
|
1547
|
-
options: [e, t]
|
|
1548
1547
|
}), Ti = (e, t) => ({
|
|
1549
1548
|
...$o(e),
|
|
1550
1549
|
options: [e, t]
|
|
@@ -1552,11 +1551,14 @@ const Ii = (e, t) => ({
|
|
|
1552
1551
|
...Bo(e),
|
|
1553
1552
|
options: [e, t]
|
|
1554
1553
|
}), Ai = (e, t) => ({
|
|
1555
|
-
...
|
|
1554
|
+
...Ho(e),
|
|
1555
|
+
options: [e, t]
|
|
1556
|
+
}), Si = (e, t) => ({
|
|
1557
|
+
...Ko(e),
|
|
1556
1558
|
options: [e, t]
|
|
1557
1559
|
});
|
|
1558
|
-
function
|
|
1559
|
-
const t =
|
|
1560
|
+
function qo(e) {
|
|
1561
|
+
const t = d.useRef(void 0), n = d.useCallback((r) => {
|
|
1560
1562
|
const o = e.map((s) => {
|
|
1561
1563
|
if (s != null) {
|
|
1562
1564
|
if (typeof s == "function") {
|
|
@@ -1571,18 +1573,18 @@ function jo(e) {
|
|
|
1571
1573
|
}
|
|
1572
1574
|
});
|
|
1573
1575
|
return () => {
|
|
1574
|
-
o.forEach((s) => s
|
|
1576
|
+
o.forEach((s) => s?.());
|
|
1575
1577
|
};
|
|
1576
1578
|
}, e);
|
|
1577
|
-
return
|
|
1579
|
+
return d.useMemo(() => e.every((r) => r == null) ? null : (r) => {
|
|
1578
1580
|
t.current && (t.current(), t.current = void 0), r != null && (t.current = n(r));
|
|
1579
1581
|
}, e);
|
|
1580
1582
|
}
|
|
1581
|
-
function
|
|
1583
|
+
function Xo(e, t) {
|
|
1582
1584
|
const n = e.compareDocumentPosition(t);
|
|
1583
1585
|
return n & Node.DOCUMENT_POSITION_FOLLOWING || n & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING || n & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
1584
1586
|
}
|
|
1585
|
-
const
|
|
1587
|
+
const yr = /* @__PURE__ */ d.createContext({
|
|
1586
1588
|
register: () => {
|
|
1587
1589
|
},
|
|
1588
1590
|
unregister: () => {
|
|
@@ -1597,21 +1599,21 @@ function Yo(e) {
|
|
|
1597
1599
|
children: t,
|
|
1598
1600
|
elementsRef: n,
|
|
1599
1601
|
labelsRef: r
|
|
1600
|
-
} = e, [o, s] =
|
|
1601
|
-
s((
|
|
1602
|
-
}, []), c =
|
|
1603
|
-
s((
|
|
1604
|
-
const m = new Set(
|
|
1605
|
-
return m.delete(
|
|
1602
|
+
} = e, [o, s] = d.useState(() => /* @__PURE__ */ new Set()), i = d.useCallback((l) => {
|
|
1603
|
+
s((u) => new Set(u).add(l));
|
|
1604
|
+
}, []), c = d.useCallback((l) => {
|
|
1605
|
+
s((u) => {
|
|
1606
|
+
const m = new Set(u);
|
|
1607
|
+
return m.delete(l), m;
|
|
1606
1608
|
});
|
|
1607
|
-
}, []), a =
|
|
1608
|
-
const
|
|
1609
|
-
return Array.from(o.keys()).sort(
|
|
1610
|
-
|
|
1611
|
-
}),
|
|
1609
|
+
}, []), a = d.useMemo(() => {
|
|
1610
|
+
const l = /* @__PURE__ */ new Map();
|
|
1611
|
+
return Array.from(o.keys()).sort(Xo).forEach((m, p) => {
|
|
1612
|
+
l.set(m, p);
|
|
1613
|
+
}), l;
|
|
1612
1614
|
}, [o]);
|
|
1613
|
-
return /* @__PURE__ */ me(
|
|
1614
|
-
value:
|
|
1615
|
+
return /* @__PURE__ */ me(yr.Provider, {
|
|
1616
|
+
value: d.useMemo(() => ({
|
|
1615
1617
|
register: i,
|
|
1616
1618
|
unregister: c,
|
|
1617
1619
|
map: a,
|
|
@@ -1621,7 +1623,7 @@ function Yo(e) {
|
|
|
1621
1623
|
children: t
|
|
1622
1624
|
});
|
|
1623
1625
|
}
|
|
1624
|
-
function
|
|
1626
|
+
function Jo(e) {
|
|
1625
1627
|
e === void 0 && (e = {});
|
|
1626
1628
|
const {
|
|
1627
1629
|
label: t
|
|
@@ -1631,38 +1633,38 @@ function Xo(e) {
|
|
|
1631
1633
|
map: o,
|
|
1632
1634
|
elementsRef: s,
|
|
1633
1635
|
labelsRef: i
|
|
1634
|
-
} =
|
|
1635
|
-
if (
|
|
1636
|
-
var
|
|
1637
|
-
const
|
|
1638
|
-
i.current[c] =
|
|
1636
|
+
} = d.useContext(yr), [c, a] = d.useState(null), l = d.useRef(null), u = d.useCallback((m) => {
|
|
1637
|
+
if (l.current = m, c !== null && (s.current[c] = m, i)) {
|
|
1638
|
+
var p;
|
|
1639
|
+
const f = t !== void 0;
|
|
1640
|
+
i.current[c] = f ? t : (p = m?.textContent) != null ? p : null;
|
|
1639
1641
|
}
|
|
1640
1642
|
}, [c, s, i, t]);
|
|
1641
|
-
return
|
|
1642
|
-
const m =
|
|
1643
|
+
return X(() => {
|
|
1644
|
+
const m = l.current;
|
|
1643
1645
|
if (m)
|
|
1644
1646
|
return n(m), () => {
|
|
1645
1647
|
r(m);
|
|
1646
1648
|
};
|
|
1647
|
-
}, [n, r]),
|
|
1648
|
-
const m =
|
|
1649
|
+
}, [n, r]), X(() => {
|
|
1650
|
+
const m = l.current ? o.get(l.current) : null;
|
|
1649
1651
|
m != null && a(m);
|
|
1650
|
-
}, [o]),
|
|
1651
|
-
ref:
|
|
1652
|
+
}, [o]), d.useMemo(() => ({
|
|
1653
|
+
ref: u,
|
|
1652
1654
|
index: c ?? -1
|
|
1653
|
-
}), [c,
|
|
1655
|
+
}), [c, u]);
|
|
1654
1656
|
}
|
|
1655
|
-
const
|
|
1656
|
-
function
|
|
1657
|
-
return typeof e == "function" ? e(t) : e ? /* @__PURE__ */
|
|
1657
|
+
const Qo = "data-floating-ui-focusable", On = "active", An = "selected", Ne = "ArrowLeft", _e = "ArrowRight", st = "ArrowUp", Fe = "ArrowDown";
|
|
1658
|
+
function wr(e, t) {
|
|
1659
|
+
return typeof e == "function" ? e(t) : e ? /* @__PURE__ */ d.cloneElement(e, t) : /* @__PURE__ */ me("div", {
|
|
1658
1660
|
...t
|
|
1659
1661
|
});
|
|
1660
1662
|
}
|
|
1661
|
-
const
|
|
1663
|
+
const xr = /* @__PURE__ */ d.createContext({
|
|
1662
1664
|
activeIndex: 0,
|
|
1663
1665
|
onNavigate: () => {
|
|
1664
1666
|
}
|
|
1665
|
-
}),
|
|
1667
|
+
}), Rr = [Ne, _e], Er = [st, Fe], Ht = [...Rr, ...Er], Mi = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
1666
1668
|
const {
|
|
1667
1669
|
render: r,
|
|
1668
1670
|
orientation: o = "both",
|
|
@@ -1670,27 +1672,27 @@ const wr = /* @__PURE__ */ f.createContext({
|
|
|
1670
1672
|
rtl: i = !1,
|
|
1671
1673
|
cols: c = 1,
|
|
1672
1674
|
disabledIndices: a,
|
|
1673
|
-
activeIndex:
|
|
1674
|
-
onNavigate:
|
|
1675
|
+
activeIndex: l,
|
|
1676
|
+
onNavigate: u,
|
|
1675
1677
|
itemSizes: m,
|
|
1676
|
-
dense:
|
|
1677
|
-
...
|
|
1678
|
-
} = t, [v,
|
|
1678
|
+
dense: p = !1,
|
|
1679
|
+
...f
|
|
1680
|
+
} = t, [v, g] = d.useState(0), y = l ?? v, x = ie(u ?? g), b = d.useRef([]), w = r && typeof r != "function" ? r.props : {}, C = d.useMemo(() => ({
|
|
1679
1681
|
activeIndex: y,
|
|
1680
1682
|
onNavigate: x
|
|
1681
|
-
}), [y, x]),
|
|
1682
|
-
function
|
|
1683
|
-
if (!
|
|
1684
|
-
let
|
|
1685
|
-
const
|
|
1686
|
-
if (
|
|
1683
|
+
}), [y, x]), M = c > 1;
|
|
1684
|
+
function k(P) {
|
|
1685
|
+
if (!Ht.includes(P.key)) return;
|
|
1686
|
+
let V = y;
|
|
1687
|
+
const L = yt(b, a), _ = tn(b, a), G = i ? Ne : _e, W = i ? _e : Ne;
|
|
1688
|
+
if (M) {
|
|
1687
1689
|
const h = m || Array.from({
|
|
1688
1690
|
length: b.current.length
|
|
1689
1691
|
}, () => ({
|
|
1690
1692
|
width: 1,
|
|
1691
1693
|
height: 1
|
|
1692
|
-
})),
|
|
1693
|
-
current:
|
|
1694
|
+
})), I = sr(h, c, p), D = I.findIndex((O) => O != null && !Be(b, O, a)), ee = I.reduce((O, J, j) => J != null && !Be(b, J, a) ? j : O, -1), F = I[ir({
|
|
1695
|
+
current: I.map((O) => O ? b.current[O] : null)
|
|
1694
1696
|
}, {
|
|
1695
1697
|
event: P,
|
|
1696
1698
|
orientation: o,
|
|
@@ -1699,13 +1701,13 @@ const wr = /* @__PURE__ */ f.createContext({
|
|
|
1699
1701
|
cols: c,
|
|
1700
1702
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
1701
1703
|
// don't end up in them
|
|
1702
|
-
disabledIndices:
|
|
1704
|
+
disabledIndices: ur([...(typeof a != "function" ? a : null) || b.current.map((O, J) => Be(b, J, a) ? J : void 0), void 0], I),
|
|
1703
1705
|
minIndex: D,
|
|
1704
1706
|
maxIndex: ee,
|
|
1705
|
-
prevIndex:
|
|
1706
|
-
y > _ ?
|
|
1707
|
+
prevIndex: cr(
|
|
1708
|
+
y > _ ? L : y,
|
|
1707
1709
|
h,
|
|
1708
|
-
|
|
1710
|
+
I,
|
|
1709
1711
|
c,
|
|
1710
1712
|
// use a corner matching the edge closest to the direction we're
|
|
1711
1713
|
// moving in so we don't end up in the same item. Prefer
|
|
@@ -1713,88 +1715,88 @@ const wr = /* @__PURE__ */ f.createContext({
|
|
|
1713
1715
|
P.key === Fe ? "bl" : P.key === G ? "tr" : "tl"
|
|
1714
1716
|
)
|
|
1715
1717
|
})];
|
|
1716
|
-
F != null && (
|
|
1718
|
+
F != null && (V = F);
|
|
1717
1719
|
}
|
|
1718
1720
|
const R = {
|
|
1719
1721
|
horizontal: [G],
|
|
1720
1722
|
vertical: [Fe],
|
|
1721
1723
|
both: [G, Fe]
|
|
1722
1724
|
}[o], E = {
|
|
1723
|
-
horizontal: [
|
|
1725
|
+
horizontal: [W],
|
|
1724
1726
|
vertical: [st],
|
|
1725
|
-
both: [
|
|
1726
|
-
}[o], $ =
|
|
1727
|
-
horizontal:
|
|
1728
|
-
vertical:
|
|
1729
|
-
both:
|
|
1727
|
+
both: [W, st]
|
|
1728
|
+
}[o], $ = M ? Ht : {
|
|
1729
|
+
horizontal: Rr,
|
|
1730
|
+
vertical: Er,
|
|
1731
|
+
both: Ht
|
|
1730
1732
|
}[o];
|
|
1731
|
-
if (
|
|
1732
|
-
startingIndex:
|
|
1733
|
+
if (V === y && [...R, ...E].includes(P.key) && (s && V === _ && R.includes(P.key) ? V = L : s && V === L && E.includes(P.key) ? V = _ : V = ue(b, {
|
|
1734
|
+
startingIndex: V,
|
|
1733
1735
|
decrement: E.includes(P.key),
|
|
1734
1736
|
disabledIndices: a
|
|
1735
|
-
})),
|
|
1737
|
+
})), V !== y && !qe(b, V)) {
|
|
1736
1738
|
var T;
|
|
1737
|
-
P.stopPropagation(), $.includes(P.key) && P.preventDefault(), x(
|
|
1739
|
+
P.stopPropagation(), $.includes(P.key) && P.preventDefault(), x(V), (T = b.current[V]) == null || T.focus();
|
|
1738
1740
|
}
|
|
1739
1741
|
}
|
|
1740
1742
|
const N = {
|
|
1741
|
-
...
|
|
1743
|
+
...f,
|
|
1742
1744
|
...w,
|
|
1743
1745
|
ref: n,
|
|
1744
1746
|
"aria-orientation": o === "both" ? void 0 : o,
|
|
1745
1747
|
onKeyDown(P) {
|
|
1746
|
-
|
|
1748
|
+
f.onKeyDown == null || f.onKeyDown(P), w.onKeyDown == null || w.onKeyDown(P), k(P);
|
|
1747
1749
|
}
|
|
1748
1750
|
};
|
|
1749
|
-
return /* @__PURE__ */ me(
|
|
1750
|
-
value:
|
|
1751
|
+
return /* @__PURE__ */ me(xr.Provider, {
|
|
1752
|
+
value: C,
|
|
1751
1753
|
children: /* @__PURE__ */ me(Yo, {
|
|
1752
1754
|
elementsRef: b,
|
|
1753
|
-
children:
|
|
1755
|
+
children: wr(r, N)
|
|
1754
1756
|
})
|
|
1755
1757
|
});
|
|
1756
|
-
}),
|
|
1758
|
+
}), Pi = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
1757
1759
|
const {
|
|
1758
1760
|
render: r,
|
|
1759
1761
|
...o
|
|
1760
1762
|
} = t, s = r && typeof r != "function" ? r.props : {}, {
|
|
1761
1763
|
activeIndex: i,
|
|
1762
1764
|
onNavigate: c
|
|
1763
|
-
} =
|
|
1765
|
+
} = d.useContext(xr), {
|
|
1764
1766
|
ref: a,
|
|
1765
|
-
index:
|
|
1766
|
-
} =
|
|
1767
|
+
index: l
|
|
1768
|
+
} = Jo(), u = qo([a, n, s.ref]), m = i === l, p = {
|
|
1767
1769
|
...o,
|
|
1768
1770
|
...s,
|
|
1769
|
-
ref:
|
|
1771
|
+
ref: u,
|
|
1770
1772
|
tabIndex: m ? 0 : -1,
|
|
1771
1773
|
"data-active": m ? "" : void 0,
|
|
1772
|
-
onFocus(
|
|
1773
|
-
o.onFocus == null || o.onFocus(
|
|
1774
|
+
onFocus(f) {
|
|
1775
|
+
o.onFocus == null || o.onFocus(f), s.onFocus == null || s.onFocus(f), c(l);
|
|
1774
1776
|
}
|
|
1775
1777
|
};
|
|
1776
|
-
return
|
|
1777
|
-
}),
|
|
1778
|
-
...
|
|
1778
|
+
return wr(r, p);
|
|
1779
|
+
}), Zo = {
|
|
1780
|
+
...d
|
|
1779
1781
|
};
|
|
1780
|
-
let
|
|
1782
|
+
let Sn = !1, ei = 0;
|
|
1781
1783
|
const Mn = () => (
|
|
1782
1784
|
// Ensure the id is unique with multiple independent versions of Floating UI
|
|
1783
1785
|
// on <React 18
|
|
1784
|
-
"floating-ui-" + Math.random().toString(36).slice(2, 6) +
|
|
1786
|
+
"floating-ui-" + Math.random().toString(36).slice(2, 6) + ei++
|
|
1785
1787
|
);
|
|
1786
|
-
function
|
|
1787
|
-
const [e, t] =
|
|
1788
|
-
return
|
|
1788
|
+
function ti() {
|
|
1789
|
+
const [e, t] = d.useState(() => Sn ? Mn() : void 0);
|
|
1790
|
+
return X(() => {
|
|
1789
1791
|
e == null && t(Mn());
|
|
1790
|
-
}, []),
|
|
1791
|
-
|
|
1792
|
+
}, []), d.useEffect(() => {
|
|
1793
|
+
Sn = !0;
|
|
1792
1794
|
}, []), e;
|
|
1793
1795
|
}
|
|
1794
|
-
const
|
|
1796
|
+
const ni = Zo.useId, Ft = ni || ti;
|
|
1795
1797
|
let ct;
|
|
1796
1798
|
process.env.NODE_ENV !== "production" && (ct = /* @__PURE__ */ new Set());
|
|
1797
|
-
function
|
|
1799
|
+
function zt() {
|
|
1798
1800
|
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1799
1801
|
n[r] = arguments[r];
|
|
1800
1802
|
const o = "Floating UI: " + n.join(" ");
|
|
@@ -1803,7 +1805,7 @@ function Ht() {
|
|
|
1803
1805
|
(s = ct) == null || s.add(o), console.warn(o);
|
|
1804
1806
|
}
|
|
1805
1807
|
}
|
|
1806
|
-
function
|
|
1808
|
+
function ri() {
|
|
1807
1809
|
for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)
|
|
1808
1810
|
n[r] = arguments[r];
|
|
1809
1811
|
const o = "Floating UI: " + n.join(" ");
|
|
@@ -1812,7 +1814,7 @@ function ni() {
|
|
|
1812
1814
|
(s = ct) == null || s.add(o), console.error(o);
|
|
1813
1815
|
}
|
|
1814
1816
|
}
|
|
1815
|
-
function
|
|
1817
|
+
function Cr() {
|
|
1816
1818
|
const e = /* @__PURE__ */ new Map();
|
|
1817
1819
|
return {
|
|
1818
1820
|
emit(t, n) {
|
|
@@ -1828,30 +1830,30 @@ function Er() {
|
|
|
1828
1830
|
}
|
|
1829
1831
|
};
|
|
1830
1832
|
}
|
|
1831
|
-
const Ir = /* @__PURE__ */
|
|
1833
|
+
const Ir = /* @__PURE__ */ d.createContext(null), Tr = /* @__PURE__ */ d.createContext(null), Ze = () => {
|
|
1832
1834
|
var e;
|
|
1833
|
-
return ((e =
|
|
1834
|
-
}, et = () =>
|
|
1835
|
-
function
|
|
1836
|
-
const t =
|
|
1837
|
-
return
|
|
1835
|
+
return ((e = d.useContext(Ir)) == null ? void 0 : e.id) || null;
|
|
1836
|
+
}, et = () => d.useContext(Tr);
|
|
1837
|
+
function Di(e) {
|
|
1838
|
+
const t = Ft(), n = et(), o = Ze();
|
|
1839
|
+
return X(() => {
|
|
1838
1840
|
if (!t) return;
|
|
1839
1841
|
const s = {
|
|
1840
1842
|
id: t,
|
|
1841
1843
|
parentId: o
|
|
1842
1844
|
};
|
|
1843
|
-
return n
|
|
1844
|
-
n
|
|
1845
|
+
return n?.addNode(s), () => {
|
|
1846
|
+
n?.removeNode(s);
|
|
1845
1847
|
};
|
|
1846
1848
|
}, [n, t, o]), t;
|
|
1847
1849
|
}
|
|
1848
|
-
function
|
|
1850
|
+
function Li(e) {
|
|
1849
1851
|
const {
|
|
1850
1852
|
children: t,
|
|
1851
1853
|
id: n
|
|
1852
1854
|
} = e, r = Ze();
|
|
1853
1855
|
return /* @__PURE__ */ me(Ir.Provider, {
|
|
1854
|
-
value:
|
|
1856
|
+
value: d.useMemo(() => ({
|
|
1855
1857
|
id: n,
|
|
1856
1858
|
parentId: r
|
|
1857
1859
|
}), [n, r]),
|
|
@@ -1861,13 +1863,13 @@ function Di(e) {
|
|
|
1861
1863
|
function ki(e) {
|
|
1862
1864
|
const {
|
|
1863
1865
|
children: t
|
|
1864
|
-
} = e, n =
|
|
1866
|
+
} = e, n = d.useRef([]), r = d.useCallback((i) => {
|
|
1865
1867
|
n.current = [...n.current, i];
|
|
1866
|
-
}, []), o =
|
|
1868
|
+
}, []), o = d.useCallback((i) => {
|
|
1867
1869
|
n.current = n.current.filter((c) => c !== i);
|
|
1868
|
-
}, []), [s] =
|
|
1869
|
-
return /* @__PURE__ */ me(
|
|
1870
|
-
value:
|
|
1870
|
+
}, []), [s] = d.useState(() => Cr());
|
|
1871
|
+
return /* @__PURE__ */ me(Tr.Provider, {
|
|
1872
|
+
value: d.useMemo(() => ({
|
|
1871
1873
|
nodesRef: n,
|
|
1872
1874
|
addNode: r,
|
|
1873
1875
|
removeNode: o,
|
|
@@ -1882,22 +1884,22 @@ function ze(e) {
|
|
|
1882
1884
|
function ge(e) {
|
|
1883
1885
|
e.current !== -1 && (clearTimeout(e.current), e.current = -1);
|
|
1884
1886
|
}
|
|
1885
|
-
const
|
|
1886
|
-
function
|
|
1887
|
+
const Pn = /* @__PURE__ */ ze("safe-polygon");
|
|
1888
|
+
function Ut(e, t, n) {
|
|
1887
1889
|
if (n && !it(n))
|
|
1888
1890
|
return 0;
|
|
1889
1891
|
if (typeof e == "number")
|
|
1890
1892
|
return e;
|
|
1891
1893
|
if (typeof e == "function") {
|
|
1892
1894
|
const r = e();
|
|
1893
|
-
return typeof r == "number" ? r : r
|
|
1895
|
+
return typeof r == "number" ? r : r?.[t];
|
|
1894
1896
|
}
|
|
1895
|
-
return e
|
|
1897
|
+
return e?.[t];
|
|
1896
1898
|
}
|
|
1897
|
-
function
|
|
1899
|
+
function Gt(e) {
|
|
1898
1900
|
return typeof e == "function" ? e() : e;
|
|
1899
1901
|
}
|
|
1900
|
-
function
|
|
1902
|
+
function Fi(e, t) {
|
|
1901
1903
|
t === void 0 && (t = {});
|
|
1902
1904
|
const {
|
|
1903
1905
|
open: n,
|
|
@@ -1908,56 +1910,56 @@ function Li(e, t) {
|
|
|
1908
1910
|
} = e, {
|
|
1909
1911
|
enabled: c = !0,
|
|
1910
1912
|
delay: a = 0,
|
|
1911
|
-
handleClose:
|
|
1912
|
-
mouseOnly:
|
|
1913
|
+
handleClose: l = null,
|
|
1914
|
+
mouseOnly: u = !1,
|
|
1913
1915
|
restMs: m = 0,
|
|
1914
|
-
move:
|
|
1915
|
-
} = t,
|
|
1916
|
-
}),
|
|
1916
|
+
move: p = !0
|
|
1917
|
+
} = t, f = et(), v = Ze(), g = ye(l), y = ye(a), x = ye(n), b = ye(m), w = d.useRef(), C = d.useRef(-1), M = d.useRef(), k = d.useRef(-1), N = d.useRef(!0), P = d.useRef(!1), V = d.useRef(() => {
|
|
1918
|
+
}), L = d.useRef(!1), _ = ie(() => {
|
|
1917
1919
|
var T;
|
|
1918
1920
|
const h = (T = o.current.openEvent) == null ? void 0 : T.type;
|
|
1919
|
-
return
|
|
1921
|
+
return h?.includes("mouse") && h !== "mousedown";
|
|
1920
1922
|
});
|
|
1921
|
-
|
|
1923
|
+
d.useEffect(() => {
|
|
1922
1924
|
if (!c) return;
|
|
1923
1925
|
function T(h) {
|
|
1924
1926
|
let {
|
|
1925
|
-
open:
|
|
1927
|
+
open: I
|
|
1926
1928
|
} = h;
|
|
1927
|
-
|
|
1929
|
+
I || (ge(C), ge(k), N.current = !0, L.current = !1);
|
|
1928
1930
|
}
|
|
1929
1931
|
return s.on("openchange", T), () => {
|
|
1930
1932
|
s.off("openchange", T);
|
|
1931
1933
|
};
|
|
1932
|
-
}, [c, s]),
|
|
1933
|
-
if (!c || !
|
|
1934
|
-
function T(
|
|
1935
|
-
_() && r(!1,
|
|
1934
|
+
}, [c, s]), d.useEffect(() => {
|
|
1935
|
+
if (!c || !g.current || !n) return;
|
|
1936
|
+
function T(I) {
|
|
1937
|
+
_() && r(!1, I, "hover");
|
|
1936
1938
|
}
|
|
1937
1939
|
const h = le(i.floating).documentElement;
|
|
1938
1940
|
return h.addEventListener("mouseleave", T), () => {
|
|
1939
1941
|
h.removeEventListener("mouseleave", T);
|
|
1940
1942
|
};
|
|
1941
|
-
}, [i.floating, n, r, c,
|
|
1942
|
-
const G =
|
|
1943
|
-
h === void 0 && (h = !0),
|
|
1944
|
-
const D =
|
|
1945
|
-
D && !
|
|
1946
|
-
}, [y, r]),
|
|
1947
|
-
|
|
1943
|
+
}, [i.floating, n, r, c, g, _]);
|
|
1944
|
+
const G = d.useCallback(function(T, h, I) {
|
|
1945
|
+
h === void 0 && (h = !0), I === void 0 && (I = "hover");
|
|
1946
|
+
const D = Ut(y.current, "close", w.current);
|
|
1947
|
+
D && !M.current ? (ge(C), C.current = window.setTimeout(() => r(!1, T, I), D)) : h && (ge(C), r(!1, T, I));
|
|
1948
|
+
}, [y, r]), W = ie(() => {
|
|
1949
|
+
V.current(), M.current = void 0;
|
|
1948
1950
|
}), R = ie(() => {
|
|
1949
1951
|
if (P.current) {
|
|
1950
1952
|
const T = le(i.floating).body;
|
|
1951
|
-
T.style.pointerEvents = "", T.removeAttribute(
|
|
1953
|
+
T.style.pointerEvents = "", T.removeAttribute(Pn), P.current = !1;
|
|
1952
1954
|
}
|
|
1953
1955
|
}), E = ie(() => o.current.openEvent ? ["click", "mousedown"].includes(o.current.openEvent.type) : !1);
|
|
1954
|
-
|
|
1956
|
+
d.useEffect(() => {
|
|
1955
1957
|
if (!c) return;
|
|
1956
1958
|
function T(F) {
|
|
1957
|
-
if (ge(
|
|
1959
|
+
if (ge(C), N.current = !1, u && !it(w.current) || Gt(b.current) > 0 && !Ut(y.current, "open"))
|
|
1958
1960
|
return;
|
|
1959
|
-
const O =
|
|
1960
|
-
O ?
|
|
1961
|
+
const O = Ut(y.current, "open", w.current);
|
|
1962
|
+
O ? C.current = window.setTimeout(() => {
|
|
1961
1963
|
x.current || r(!0, F, "hover");
|
|
1962
1964
|
}, O) : n || r(!0, F, "hover");
|
|
1963
1965
|
}
|
|
@@ -1966,72 +1968,72 @@ function Li(e, t) {
|
|
|
1966
1968
|
R();
|
|
1967
1969
|
return;
|
|
1968
1970
|
}
|
|
1969
|
-
|
|
1971
|
+
V.current();
|
|
1970
1972
|
const O = le(i.floating);
|
|
1971
|
-
if (ge(
|
|
1972
|
-
n || ge(
|
|
1973
|
+
if (ge(k), L.current = !1, g.current && o.current.floatingContext) {
|
|
1974
|
+
n || ge(C), M.current = g.current({
|
|
1973
1975
|
...o.current.floatingContext,
|
|
1974
|
-
tree:
|
|
1976
|
+
tree: f,
|
|
1975
1977
|
x: F.clientX,
|
|
1976
1978
|
y: F.clientY,
|
|
1977
1979
|
onClose() {
|
|
1978
|
-
R(),
|
|
1980
|
+
R(), W(), E() || G(F, !0, "safe-polygon");
|
|
1979
1981
|
}
|
|
1980
1982
|
});
|
|
1981
|
-
const j =
|
|
1982
|
-
O.addEventListener("mousemove", j),
|
|
1983
|
+
const j = M.current;
|
|
1984
|
+
O.addEventListener("mousemove", j), V.current = () => {
|
|
1983
1985
|
O.removeEventListener("mousemove", j);
|
|
1984
1986
|
};
|
|
1985
1987
|
return;
|
|
1986
1988
|
}
|
|
1987
1989
|
(w.current === "touch" ? !ce(i.floating, F.relatedTarget) : !0) && G(F);
|
|
1988
1990
|
}
|
|
1989
|
-
function
|
|
1990
|
-
E() || o.current.floatingContext && (
|
|
1991
|
+
function I(F) {
|
|
1992
|
+
E() || o.current.floatingContext && (g.current == null || g.current({
|
|
1991
1993
|
...o.current.floatingContext,
|
|
1992
|
-
tree:
|
|
1994
|
+
tree: f,
|
|
1993
1995
|
x: F.clientX,
|
|
1994
1996
|
y: F.clientY,
|
|
1995
1997
|
onClose() {
|
|
1996
|
-
R(),
|
|
1998
|
+
R(), W(), E() || G(F);
|
|
1997
1999
|
}
|
|
1998
2000
|
})(F));
|
|
1999
2001
|
}
|
|
2000
2002
|
function D() {
|
|
2001
|
-
ge(
|
|
2003
|
+
ge(C);
|
|
2002
2004
|
}
|
|
2003
2005
|
function ee(F) {
|
|
2004
2006
|
E() || G(F, !1);
|
|
2005
2007
|
}
|
|
2006
|
-
if (
|
|
2008
|
+
if (Y(i.domReference)) {
|
|
2007
2009
|
const F = i.domReference, O = i.floating;
|
|
2008
|
-
return n && F.addEventListener("mouseleave",
|
|
2010
|
+
return n && F.addEventListener("mouseleave", I), p && F.addEventListener("mousemove", T, {
|
|
2009
2011
|
once: !0
|
|
2010
|
-
}), F.addEventListener("mouseenter", T), F.addEventListener("mouseleave", h), O && (O.addEventListener("mouseleave",
|
|
2011
|
-
n && F.removeEventListener("mouseleave",
|
|
2012
|
+
}), F.addEventListener("mouseenter", T), F.addEventListener("mouseleave", h), O && (O.addEventListener("mouseleave", I), O.addEventListener("mouseenter", D), O.addEventListener("mouseleave", ee)), () => {
|
|
2013
|
+
n && F.removeEventListener("mouseleave", I), p && F.removeEventListener("mousemove", T), F.removeEventListener("mouseenter", T), F.removeEventListener("mouseleave", h), O && (O.removeEventListener("mouseleave", I), O.removeEventListener("mouseenter", D), O.removeEventListener("mouseleave", ee));
|
|
2012
2014
|
};
|
|
2013
2015
|
}
|
|
2014
|
-
}, [i, c, e,
|
|
2016
|
+
}, [i, c, e, u, p, G, W, R, r, n, x, f, y, g, o, E, b]), X(() => {
|
|
2015
2017
|
var T;
|
|
2016
|
-
if (c && n && (T =
|
|
2018
|
+
if (c && n && (T = g.current) != null && (T = T.__options) != null && T.blockPointerEvents && _()) {
|
|
2017
2019
|
P.current = !0;
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
+
const I = i.floating;
|
|
2021
|
+
if (Y(i.domReference) && I) {
|
|
2020
2022
|
var h;
|
|
2021
2023
|
const D = le(i.floating).body;
|
|
2022
|
-
D.setAttribute(
|
|
2023
|
-
const ee = i.domReference, F =
|
|
2024
|
-
return F && (F.style.pointerEvents = ""), D.style.pointerEvents = "none", ee.style.pointerEvents = "auto",
|
|
2025
|
-
D.style.pointerEvents = "", ee.style.pointerEvents = "",
|
|
2024
|
+
D.setAttribute(Pn, "");
|
|
2025
|
+
const ee = i.domReference, F = f == null || (h = f.nodesRef.current.find((O) => O.id === v)) == null || (h = h.context) == null ? void 0 : h.elements.floating;
|
|
2026
|
+
return F && (F.style.pointerEvents = ""), D.style.pointerEvents = "none", ee.style.pointerEvents = "auto", I.style.pointerEvents = "auto", () => {
|
|
2027
|
+
D.style.pointerEvents = "", ee.style.pointerEvents = "", I.style.pointerEvents = "";
|
|
2026
2028
|
};
|
|
2027
2029
|
}
|
|
2028
2030
|
}
|
|
2029
|
-
}, [c, n, v, i,
|
|
2030
|
-
n || (w.current = void 0,
|
|
2031
|
-
}, [n,
|
|
2032
|
-
|
|
2033
|
-
}, [c, i.domReference,
|
|
2034
|
-
const $ =
|
|
2031
|
+
}, [c, n, v, i, f, g, _]), X(() => {
|
|
2032
|
+
n || (w.current = void 0, L.current = !1, W(), R());
|
|
2033
|
+
}, [n, W, R]), d.useEffect(() => () => {
|
|
2034
|
+
W(), ge(C), ge(k), R();
|
|
2035
|
+
}, [c, i.domReference, W, R]);
|
|
2036
|
+
const $ = d.useMemo(() => {
|
|
2035
2037
|
function T(h) {
|
|
2036
2038
|
w.current = h.pointerType;
|
|
2037
2039
|
}
|
|
@@ -2040,20 +2042,20 @@ function Li(e, t) {
|
|
|
2040
2042
|
onPointerEnter: T,
|
|
2041
2043
|
onMouseMove(h) {
|
|
2042
2044
|
const {
|
|
2043
|
-
nativeEvent:
|
|
2045
|
+
nativeEvent: I
|
|
2044
2046
|
} = h;
|
|
2045
2047
|
function D() {
|
|
2046
|
-
!N.current && !x.current && r(!0,
|
|
2048
|
+
!N.current && !x.current && r(!0, I, "hover");
|
|
2047
2049
|
}
|
|
2048
|
-
|
|
2050
|
+
u && !it(w.current) || n || Gt(b.current) === 0 || L.current && h.movementX ** 2 + h.movementY ** 2 < 2 || (ge(k), w.current === "touch" ? D() : (L.current = !0, k.current = window.setTimeout(D, Gt(b.current))));
|
|
2049
2051
|
}
|
|
2050
2052
|
};
|
|
2051
|
-
}, [
|
|
2052
|
-
return
|
|
2053
|
+
}, [u, r, n, x, b]);
|
|
2054
|
+
return d.useMemo(() => c ? {
|
|
2053
2055
|
reference: $
|
|
2054
2056
|
} : {}, [c, $]);
|
|
2055
2057
|
}
|
|
2056
|
-
let
|
|
2058
|
+
let Dn = 0;
|
|
2057
2059
|
function Ke(e, t) {
|
|
2058
2060
|
t === void 0 && (t = {});
|
|
2059
2061
|
const {
|
|
@@ -2061,62 +2063,62 @@ function Ke(e, t) {
|
|
|
2061
2063
|
cancelPrevious: r = !0,
|
|
2062
2064
|
sync: o = !1
|
|
2063
2065
|
} = t;
|
|
2064
|
-
r && cancelAnimationFrame(
|
|
2065
|
-
const s = () => e
|
|
2066
|
+
r && cancelAnimationFrame(Dn);
|
|
2067
|
+
const s = () => e?.focus({
|
|
2066
2068
|
preventScroll: n
|
|
2067
2069
|
});
|
|
2068
|
-
o ? s() :
|
|
2070
|
+
o ? s() : Dn = requestAnimationFrame(s);
|
|
2069
2071
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return
|
|
2072
|
+
function oi(e) {
|
|
2073
|
+
return e?.ownerDocument || document;
|
|
2072
2074
|
}
|
|
2073
|
-
const
|
|
2075
|
+
const Ye = {
|
|
2074
2076
|
inert: /* @__PURE__ */ new WeakMap(),
|
|
2075
2077
|
"aria-hidden": /* @__PURE__ */ new WeakMap(),
|
|
2076
2078
|
none: /* @__PURE__ */ new WeakMap()
|
|
2077
2079
|
};
|
|
2078
|
-
function
|
|
2079
|
-
return e === "inert" ?
|
|
2080
|
+
function Ln(e) {
|
|
2081
|
+
return e === "inert" ? Ye.inert : e === "aria-hidden" ? Ye["aria-hidden"] : Ye.none;
|
|
2080
2082
|
}
|
|
2081
|
-
let gt = /* @__PURE__ */ new WeakSet(), ht = {},
|
|
2082
|
-
const
|
|
2083
|
+
let gt = /* @__PURE__ */ new WeakSet(), ht = {}, jt = 0;
|
|
2084
|
+
const ii = () => typeof HTMLElement < "u" && "inert" in HTMLElement.prototype, Or = (e) => e && (e.host || Or(e.parentNode)), si = (e, t) => t.map((n) => {
|
|
2083
2085
|
if (e.contains(n))
|
|
2084
2086
|
return n;
|
|
2085
|
-
const r =
|
|
2087
|
+
const r = Or(n);
|
|
2086
2088
|
return e.contains(r) ? r : null;
|
|
2087
2089
|
}).filter((n) => n != null);
|
|
2088
|
-
function
|
|
2089
|
-
const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i =
|
|
2090
|
+
function ci(e, t, n, r) {
|
|
2091
|
+
const o = "data-floating-ui-inert", s = r ? "inert" : n ? "aria-hidden" : null, i = si(t, e), c = /* @__PURE__ */ new Set(), a = new Set(i), l = [];
|
|
2090
2092
|
ht[o] || (ht[o] = /* @__PURE__ */ new WeakMap());
|
|
2091
|
-
const
|
|
2092
|
-
i.forEach(m),
|
|
2093
|
-
function m(
|
|
2094
|
-
!
|
|
2093
|
+
const u = ht[o];
|
|
2094
|
+
i.forEach(m), p(t), c.clear();
|
|
2095
|
+
function m(f) {
|
|
2096
|
+
!f || c.has(f) || (c.add(f), f.parentNode && m(f.parentNode));
|
|
2095
2097
|
}
|
|
2096
|
-
function
|
|
2097
|
-
!
|
|
2098
|
-
if (
|
|
2098
|
+
function p(f) {
|
|
2099
|
+
!f || a.has(f) || [].forEach.call(f.children, (v) => {
|
|
2100
|
+
if (We(v) !== "script")
|
|
2099
2101
|
if (c.has(v))
|
|
2100
|
-
|
|
2102
|
+
p(v);
|
|
2101
2103
|
else {
|
|
2102
|
-
const
|
|
2103
|
-
x.set(v, b),
|
|
2104
|
+
const g = s ? v.getAttribute(s) : null, y = g !== null && g !== "false", x = Ln(s), b = (x.get(v) || 0) + 1, w = (u.get(v) || 0) + 1;
|
|
2105
|
+
x.set(v, b), u.set(v, w), l.push(v), b === 1 && y && gt.add(v), w === 1 && v.setAttribute(o, ""), !y && s && v.setAttribute(s, s === "inert" ? "" : "true");
|
|
2104
2106
|
}
|
|
2105
2107
|
});
|
|
2106
2108
|
}
|
|
2107
|
-
return
|
|
2108
|
-
|
|
2109
|
-
const v =
|
|
2110
|
-
v.set(
|
|
2111
|
-
}),
|
|
2109
|
+
return jt++, () => {
|
|
2110
|
+
l.forEach((f) => {
|
|
2111
|
+
const v = Ln(s), y = (v.get(f) || 0) - 1, x = (u.get(f) || 0) - 1;
|
|
2112
|
+
v.set(f, y), u.set(f, x), y || (!gt.has(f) && s && f.removeAttribute(s), gt.delete(f)), x || f.removeAttribute(o);
|
|
2113
|
+
}), jt--, jt || (Ye.inert = /* @__PURE__ */ new WeakMap(), Ye["aria-hidden"] = /* @__PURE__ */ new WeakMap(), Ye.none = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakSet(), ht = {});
|
|
2112
2114
|
};
|
|
2113
2115
|
}
|
|
2114
2116
|
function kn(e, t, n) {
|
|
2115
2117
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
2116
|
-
const r =
|
|
2117
|
-
return
|
|
2118
|
+
const r = oi(e[0]).body;
|
|
2119
|
+
return ci(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))), r, t, n);
|
|
2118
2120
|
}
|
|
2119
|
-
const
|
|
2121
|
+
const Nt = {
|
|
2120
2122
|
border: 0,
|
|
2121
2123
|
clip: "rect(0 0 0 0)",
|
|
2122
2124
|
height: "1px",
|
|
@@ -2128,10 +2130,10 @@ const Ft = {
|
|
|
2128
2130
|
width: "1px",
|
|
2129
2131
|
top: 0,
|
|
2130
2132
|
left: 0
|
|
2131
|
-
}, Ot = /* @__PURE__ */
|
|
2132
|
-
const [r, o] =
|
|
2133
|
-
|
|
2134
|
-
|
|
2133
|
+
}, Ot = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2134
|
+
const [r, o] = d.useState();
|
|
2135
|
+
X(() => {
|
|
2136
|
+
tr() && o("button");
|
|
2135
2137
|
}, []);
|
|
2136
2138
|
const s = {
|
|
2137
2139
|
ref: n,
|
|
@@ -2140,72 +2142,72 @@ const Ft = {
|
|
|
2140
2142
|
role: r,
|
|
2141
2143
|
"aria-hidden": r ? void 0 : !0,
|
|
2142
2144
|
[ze("focus-guard")]: "",
|
|
2143
|
-
style:
|
|
2145
|
+
style: Nt
|
|
2144
2146
|
};
|
|
2145
2147
|
return /* @__PURE__ */ me("span", {
|
|
2146
2148
|
...t,
|
|
2147
2149
|
...s
|
|
2148
2150
|
});
|
|
2149
|
-
}),
|
|
2150
|
-
function
|
|
2151
|
+
}), Ar = /* @__PURE__ */ d.createContext(null), Fn = /* @__PURE__ */ ze("portal");
|
|
2152
|
+
function ui(e) {
|
|
2151
2153
|
e === void 0 && (e = {});
|
|
2152
2154
|
const {
|
|
2153
2155
|
id: t,
|
|
2154
2156
|
root: n
|
|
2155
|
-
} = e, r =
|
|
2156
|
-
return
|
|
2157
|
-
s
|
|
2157
|
+
} = e, r = Ft(), o = Sr(), [s, i] = d.useState(null), c = d.useRef(null);
|
|
2158
|
+
return X(() => () => {
|
|
2159
|
+
s?.remove(), queueMicrotask(() => {
|
|
2158
2160
|
c.current = null;
|
|
2159
2161
|
});
|
|
2160
|
-
}, [s]),
|
|
2162
|
+
}, [s]), X(() => {
|
|
2161
2163
|
if (!r || c.current) return;
|
|
2162
2164
|
const a = t ? document.getElementById(t) : null;
|
|
2163
2165
|
if (!a) return;
|
|
2164
|
-
const u = document.createElement("div");
|
|
2165
|
-
u.id = r, u.setAttribute(Ln, ""), a.appendChild(u), c.current = u, i(u);
|
|
2166
|
-
}, [t, r]), Y(() => {
|
|
2167
|
-
if (n === null || !r || c.current) return;
|
|
2168
|
-
let a = n || (o == null ? void 0 : o.portalNode);
|
|
2169
|
-
a && !nn(a) && (a = a.current), a = a || document.body;
|
|
2170
|
-
let u = null;
|
|
2171
|
-
t && (u = document.createElement("div"), u.id = t, a.appendChild(u));
|
|
2172
2166
|
const l = document.createElement("div");
|
|
2173
|
-
l.id = r, l.setAttribute(
|
|
2167
|
+
l.id = r, l.setAttribute(Fn, ""), a.appendChild(l), c.current = l, i(l);
|
|
2168
|
+
}, [t, r]), X(() => {
|
|
2169
|
+
if (n === null || !r || c.current) return;
|
|
2170
|
+
let a = n || o?.portalNode;
|
|
2171
|
+
a && !rn(a) && (a = a.current), a = a || document.body;
|
|
2172
|
+
let l = null;
|
|
2173
|
+
t && (l = document.createElement("div"), l.id = t, a.appendChild(l));
|
|
2174
|
+
const u = document.createElement("div");
|
|
2175
|
+
u.id = r, u.setAttribute(Fn, ""), a = l || a, a.appendChild(u), c.current = u, i(u);
|
|
2174
2176
|
}, [t, n, r, o]), s;
|
|
2175
2177
|
}
|
|
2176
|
-
function
|
|
2178
|
+
function Ni(e) {
|
|
2177
2179
|
const {
|
|
2178
2180
|
children: t,
|
|
2179
2181
|
id: n,
|
|
2180
2182
|
root: r,
|
|
2181
2183
|
preserveTabOrder: o = !0
|
|
2182
|
-
} = e, s =
|
|
2184
|
+
} = e, s = ui({
|
|
2183
2185
|
id: n,
|
|
2184
2186
|
root: r
|
|
2185
|
-
}), [i, c] =
|
|
2187
|
+
}), [i, c] = d.useState(null), a = d.useRef(null), l = d.useRef(null), u = d.useRef(null), m = d.useRef(null), p = i?.modal, f = i?.open, v = (
|
|
2186
2188
|
// The FocusManager and therefore floating element are currently open/
|
|
2187
2189
|
// rendered.
|
|
2188
2190
|
!!i && // Guards are only for non-modal focus management.
|
|
2189
2191
|
!i.modal && // Don't render if unmount is transitioning.
|
|
2190
2192
|
i.open && o && !!(r || s)
|
|
2191
2193
|
);
|
|
2192
|
-
return
|
|
2193
|
-
if (!s || !o ||
|
|
2194
|
+
return d.useEffect(() => {
|
|
2195
|
+
if (!s || !o || p)
|
|
2194
2196
|
return;
|
|
2195
|
-
function
|
|
2196
|
-
s && ot(y) && (y.type === "focusin" ? xn :
|
|
2197
|
+
function g(y) {
|
|
2198
|
+
s && ot(y) && (y.type === "focusin" ? xn : mo)(s);
|
|
2197
2199
|
}
|
|
2198
|
-
return s.addEventListener("focusin",
|
|
2199
|
-
s.removeEventListener("focusin",
|
|
2200
|
+
return s.addEventListener("focusin", g, !0), s.addEventListener("focusout", g, !0), () => {
|
|
2201
|
+
s.removeEventListener("focusin", g, !0), s.removeEventListener("focusout", g, !0);
|
|
2200
2202
|
};
|
|
2201
|
-
}, [s, o,
|
|
2202
|
-
s && (
|
|
2203
|
-
}, [
|
|
2204
|
-
value:
|
|
2203
|
+
}, [s, o, p]), d.useEffect(() => {
|
|
2204
|
+
s && (f || xn(s));
|
|
2205
|
+
}, [f, s]), /* @__PURE__ */ qn(Ar.Provider, {
|
|
2206
|
+
value: d.useMemo(() => ({
|
|
2205
2207
|
preserveTabOrder: o,
|
|
2206
2208
|
beforeOutsideRef: a,
|
|
2207
|
-
afterOutsideRef:
|
|
2208
|
-
beforeInsideRef:
|
|
2209
|
+
afterOutsideRef: l,
|
|
2210
|
+
beforeInsideRef: u,
|
|
2209
2211
|
afterInsideRef: m,
|
|
2210
2212
|
portalNode: s,
|
|
2211
2213
|
setFocusManagerState: c
|
|
@@ -2213,76 +2215,76 @@ function Fi(e) {
|
|
|
2213
2215
|
children: [v && s && /* @__PURE__ */ me(Ot, {
|
|
2214
2216
|
"data-type": "outside",
|
|
2215
2217
|
ref: a,
|
|
2216
|
-
onFocus: (
|
|
2217
|
-
if (ot(
|
|
2218
|
+
onFocus: (g) => {
|
|
2219
|
+
if (ot(g, s)) {
|
|
2218
2220
|
var y;
|
|
2219
|
-
(y =
|
|
2221
|
+
(y = u.current) == null || y.focus();
|
|
2220
2222
|
} else {
|
|
2221
|
-
const x = i ? i.domReference : null, b =
|
|
2222
|
-
b
|
|
2223
|
+
const x = i ? i.domReference : null, b = fr(x);
|
|
2224
|
+
b?.focus();
|
|
2223
2225
|
}
|
|
2224
2226
|
}
|
|
2225
2227
|
}), v && s && /* @__PURE__ */ me("span", {
|
|
2226
2228
|
"aria-owns": s.id,
|
|
2227
|
-
style:
|
|
2228
|
-
}), s && /* @__PURE__ */
|
|
2229
|
+
style: Nt
|
|
2230
|
+
}), s && /* @__PURE__ */ nn.createPortal(t, s), v && s && /* @__PURE__ */ me(Ot, {
|
|
2229
2231
|
"data-type": "outside",
|
|
2230
|
-
ref:
|
|
2231
|
-
onFocus: (
|
|
2232
|
-
if (ot(
|
|
2232
|
+
ref: l,
|
|
2233
|
+
onFocus: (g) => {
|
|
2234
|
+
if (ot(g, s)) {
|
|
2233
2235
|
var y;
|
|
2234
2236
|
(y = m.current) == null || y.focus();
|
|
2235
2237
|
} else {
|
|
2236
|
-
const x = i ? i.domReference : null, b =
|
|
2237
|
-
b
|
|
2238
|
+
const x = i ? i.domReference : null, b = ar(x);
|
|
2239
|
+
b?.focus(), i?.closeOnFocusOut && i?.onOpenChange(!1, g.nativeEvent, "focus-out");
|
|
2238
2240
|
}
|
|
2239
2241
|
}
|
|
2240
2242
|
})]
|
|
2241
2243
|
});
|
|
2242
2244
|
}
|
|
2243
|
-
const
|
|
2244
|
-
function
|
|
2245
|
-
return
|
|
2245
|
+
const Sr = () => d.useContext(Ar);
|
|
2246
|
+
function Nn(e) {
|
|
2247
|
+
return d.useMemo(() => (t) => {
|
|
2246
2248
|
e.forEach((n) => {
|
|
2247
2249
|
n && (n.current = t);
|
|
2248
2250
|
});
|
|
2249
2251
|
}, e);
|
|
2250
2252
|
}
|
|
2251
|
-
const
|
|
2252
|
-
let
|
|
2253
|
+
const li = 20;
|
|
2254
|
+
let Le = [];
|
|
2253
2255
|
function ln() {
|
|
2254
|
-
|
|
2256
|
+
Le = Le.filter((e) => e.isConnected);
|
|
2255
2257
|
}
|
|
2256
|
-
function
|
|
2257
|
-
ln(), e &&
|
|
2258
|
+
function ai(e) {
|
|
2259
|
+
ln(), e && We(e) !== "body" && (Le.push(e), Le.length > li && (Le = Le.slice(-20)));
|
|
2258
2260
|
}
|
|
2259
|
-
function
|
|
2260
|
-
return ln(),
|
|
2261
|
+
function _n() {
|
|
2262
|
+
return ln(), Le[Le.length - 1];
|
|
2261
2263
|
}
|
|
2262
|
-
function
|
|
2264
|
+
function fi(e) {
|
|
2263
2265
|
const t = lt();
|
|
2264
|
-
return
|
|
2266
|
+
return jn(e, t) ? e : At(e, t)[0] || e;
|
|
2265
2267
|
}
|
|
2266
|
-
function
|
|
2268
|
+
function Wn(e, t) {
|
|
2267
2269
|
var n;
|
|
2268
2270
|
if (!t.current.includes("floating") && !((n = e.getAttribute("role")) != null && n.includes("dialog")))
|
|
2269
2271
|
return;
|
|
2270
|
-
const r = lt(), s =
|
|
2272
|
+
const r = lt(), s = Pr(e, r).filter((c) => {
|
|
2271
2273
|
const a = c.getAttribute("data-tabindex") || "";
|
|
2272
|
-
return
|
|
2274
|
+
return jn(c, r) || c.hasAttribute("data-tabindex") && !a.startsWith("-");
|
|
2273
2275
|
}), i = e.getAttribute("tabindex");
|
|
2274
2276
|
t.current.includes("floating") || s.length === 0 ? i !== "0" && e.setAttribute("tabindex", "0") : (i !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
|
|
2275
2277
|
}
|
|
2276
|
-
const
|
|
2278
|
+
const di = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2277
2279
|
return /* @__PURE__ */ me("button", {
|
|
2278
2280
|
...t,
|
|
2279
2281
|
type: "button",
|
|
2280
2282
|
ref: n,
|
|
2281
2283
|
tabIndex: -1,
|
|
2282
|
-
style:
|
|
2284
|
+
style: Nt
|
|
2283
2285
|
});
|
|
2284
2286
|
});
|
|
2285
|
-
function
|
|
2287
|
+
function _i(e) {
|
|
2286
2288
|
const {
|
|
2287
2289
|
context: t,
|
|
2288
2290
|
children: n,
|
|
@@ -2292,31 +2294,31 @@ function Ni(e) {
|
|
|
2292
2294
|
initialFocus: i = 0,
|
|
2293
2295
|
returnFocus: c = !0,
|
|
2294
2296
|
restoreFocus: a = !1,
|
|
2295
|
-
modal:
|
|
2296
|
-
visuallyHiddenDismiss:
|
|
2297
|
+
modal: l = !0,
|
|
2298
|
+
visuallyHiddenDismiss: u = !1,
|
|
2297
2299
|
closeOnFocusOut: m = !0,
|
|
2298
|
-
outsideElementsInert:
|
|
2299
|
-
getInsideElements:
|
|
2300
|
+
outsideElementsInert: p = !1,
|
|
2301
|
+
getInsideElements: f = () => []
|
|
2300
2302
|
} = e, {
|
|
2301
2303
|
open: v,
|
|
2302
|
-
onOpenChange:
|
|
2304
|
+
onOpenChange: g,
|
|
2303
2305
|
events: y,
|
|
2304
2306
|
dataRef: x,
|
|
2305
2307
|
elements: {
|
|
2306
2308
|
domReference: b,
|
|
2307
2309
|
floating: w
|
|
2308
2310
|
}
|
|
2309
|
-
} = t,
|
|
2311
|
+
} = t, C = ie(() => {
|
|
2310
2312
|
var K;
|
|
2311
2313
|
return (K = x.current.floatingContext) == null ? void 0 : K.nodeId;
|
|
2312
|
-
}),
|
|
2314
|
+
}), M = ie(f), k = typeof i == "number" && i < 0, N = en(b) && k, P = ii(), V = P ? s : !0, L = !V || P && p, _ = ye(o), G = ye(i), W = ye(c), R = et(), E = Sr(), $ = d.useRef(null), T = d.useRef(null), h = d.useRef(!1), I = d.useRef(!1), D = d.useRef(-1), ee = d.useRef(-1), F = E != null, O = It(w), J = ie(function(K) {
|
|
2313
2315
|
return K === void 0 && (K = O), K ? At(K, lt()) : [];
|
|
2314
2316
|
}), j = ie((K) => {
|
|
2315
2317
|
const z = J(K);
|
|
2316
2318
|
return _.current.map((B) => b && B === "reference" ? b : O && B === "floating" ? O : z).filter(Boolean).flat();
|
|
2317
2319
|
});
|
|
2318
|
-
|
|
2319
|
-
if (r || !
|
|
2320
|
+
d.useEffect(() => {
|
|
2321
|
+
if (r || !l) return;
|
|
2320
2322
|
function K(B) {
|
|
2321
2323
|
if (B.key === "Tab") {
|
|
2322
2324
|
ce(O, Re(le(O))) && J().length === 0 && !N && de(B);
|
|
@@ -2328,7 +2330,7 @@ function Ni(e) {
|
|
|
2328
2330
|
return z.addEventListener("keydown", K), () => {
|
|
2329
2331
|
z.removeEventListener("keydown", K);
|
|
2330
2332
|
};
|
|
2331
|
-
}, [r, b, O,
|
|
2333
|
+
}, [r, b, O, l, _, N, J, j]), d.useEffect(() => {
|
|
2332
2334
|
if (r || !w) return;
|
|
2333
2335
|
function K(z) {
|
|
2334
2336
|
const B = Ae(z), te = J().indexOf(B);
|
|
@@ -2337,34 +2339,34 @@ function Ni(e) {
|
|
|
2337
2339
|
return w.addEventListener("focusin", K), () => {
|
|
2338
2340
|
w.removeEventListener("focusin", K);
|
|
2339
2341
|
};
|
|
2340
|
-
}, [r, w, J]),
|
|
2342
|
+
}, [r, w, J]), d.useEffect(() => {
|
|
2341
2343
|
if (r || !m) return;
|
|
2342
2344
|
function K() {
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
+
I.current = !0, setTimeout(() => {
|
|
2346
|
+
I.current = !1;
|
|
2345
2347
|
});
|
|
2346
2348
|
}
|
|
2347
2349
|
function z(te) {
|
|
2348
2350
|
const U = te.relatedTarget, fe = te.currentTarget, se = Ae(te);
|
|
2349
2351
|
queueMicrotask(() => {
|
|
2350
|
-
const ae =
|
|
2352
|
+
const ae = C(), xe = !(ce(b, U) || ce(w, U) || ce(U, w) || ce(E?.portalNode, U) || U != null && U.hasAttribute(ze("focus-guard")) || R && ($e(R.nodesRef.current, ae).find((S) => {
|
|
2351
2353
|
var H, A;
|
|
2352
|
-
return ce((H =
|
|
2353
|
-
}) || wn(R.nodesRef.current, ae).find((
|
|
2354
|
+
return ce((H = S.context) == null ? void 0 : H.elements.floating, U) || ce((A = S.context) == null ? void 0 : A.elements.domReference, U);
|
|
2355
|
+
}) || wn(R.nodesRef.current, ae).find((S) => {
|
|
2354
2356
|
var H, A, q;
|
|
2355
|
-
return [(H =
|
|
2357
|
+
return [(H = S.context) == null ? void 0 : H.elements.floating, It((A = S.context) == null ? void 0 : A.elements.floating)].includes(U) || ((q = S.context) == null ? void 0 : q.elements.domReference) === U;
|
|
2356
2358
|
})));
|
|
2357
|
-
if (fe === b && O &&
|
|
2359
|
+
if (fe === b && O && Wn(O, _), a && fe !== b && !(se != null && se.isConnected) && Re(le(O)) === le(O).body) {
|
|
2358
2360
|
ne(O) && O.focus();
|
|
2359
|
-
const
|
|
2361
|
+
const S = D.current, H = J(), A = H[S] || H[H.length - 1] || O;
|
|
2360
2362
|
ne(A) && A.focus();
|
|
2361
2363
|
}
|
|
2362
2364
|
if (x.current.insideReactTree) {
|
|
2363
2365
|
x.current.insideReactTree = !1;
|
|
2364
2366
|
return;
|
|
2365
2367
|
}
|
|
2366
|
-
(N || !
|
|
2367
|
-
U !==
|
|
2368
|
+
(N || !l) && U && xe && !I.current && // Fix React 18 Strict Mode returnFocus due to double rendering.
|
|
2369
|
+
U !== _n() && (h.current = !0, g(!1, te, "focus-out"));
|
|
2368
2370
|
});
|
|
2369
2371
|
}
|
|
2370
2372
|
const B = !!(!R && E);
|
|
@@ -2377,31 +2379,31 @@ function Ni(e) {
|
|
|
2377
2379
|
return b.addEventListener("focusout", z), b.addEventListener("pointerdown", K), w.addEventListener("focusout", z), B && w.addEventListener("focusout", Q, !0), () => {
|
|
2378
2380
|
b.removeEventListener("focusout", z), b.removeEventListener("pointerdown", K), w.removeEventListener("focusout", z), B && w.removeEventListener("focusout", Q, !0);
|
|
2379
2381
|
};
|
|
2380
|
-
}, [r, b, w, O,
|
|
2381
|
-
const oe =
|
|
2382
|
-
|
|
2382
|
+
}, [r, b, w, O, l, R, E, g, m, a, J, N, C, _, x]);
|
|
2383
|
+
const oe = d.useRef(null), ve = d.useRef(null), tt = Nn([oe, E?.beforeInsideRef]), Ue = Nn([ve, E?.afterInsideRef]);
|
|
2384
|
+
d.useEffect(() => {
|
|
2383
2385
|
var K, z;
|
|
2384
2386
|
if (r || !w) return;
|
|
2385
|
-
const B = Array.from((E == null || (K = E.portalNode) == null ? void 0 : K.querySelectorAll("[" + ze("portal") + "]")) || []), te = (z = (R ? wn(R.nodesRef.current,
|
|
2387
|
+
const B = Array.from((E == null || (K = E.portalNode) == null ? void 0 : K.querySelectorAll("[" + ze("portal") + "]")) || []), te = (z = (R ? wn(R.nodesRef.current, C()) : []).find((se) => {
|
|
2386
2388
|
var ae;
|
|
2387
|
-
return
|
|
2388
|
-
})) == null || (z = z.context) == null ? void 0 : z.elements.domReference, U = [w, te, ...B, ...
|
|
2389
|
+
return en(((ae = se.context) == null ? void 0 : ae.elements.domReference) || null);
|
|
2390
|
+
})) == null || (z = z.context) == null ? void 0 : z.elements.domReference, U = [w, te, ...B, ...M(), $.current, T.current, oe.current, ve.current, E?.beforeOutsideRef.current, E?.afterOutsideRef.current, _.current.includes("reference") || N ? b : null].filter((se) => se != null), fe = l || N ? kn(U, !L, L) : kn(U);
|
|
2389
2391
|
return () => {
|
|
2390
2392
|
fe();
|
|
2391
2393
|
};
|
|
2392
|
-
}, [r, b, w,
|
|
2394
|
+
}, [r, b, w, l, _, E, N, V, L, R, C, M]), X(() => {
|
|
2393
2395
|
if (r || !ne(O)) return;
|
|
2394
2396
|
const K = le(O), z = Re(K);
|
|
2395
2397
|
queueMicrotask(() => {
|
|
2396
2398
|
const B = j(O), Q = G.current, te = (typeof Q == "number" ? B[Q] : Q.current) || O, U = ce(O, z);
|
|
2397
|
-
!
|
|
2399
|
+
!k && !U && v && Ke(te, {
|
|
2398
2400
|
preventScroll: te === O
|
|
2399
2401
|
});
|
|
2400
2402
|
});
|
|
2401
|
-
}, [r, v, O,
|
|
2403
|
+
}, [r, v, O, k, j, G]), X(() => {
|
|
2402
2404
|
if (r || !O) return;
|
|
2403
2405
|
const K = le(O), z = Re(K);
|
|
2404
|
-
|
|
2406
|
+
ai(z);
|
|
2405
2407
|
function B(U) {
|
|
2406
2408
|
let {
|
|
2407
2409
|
reason: fe,
|
|
@@ -2411,7 +2413,7 @@ function Ni(e) {
|
|
|
2411
2413
|
if (["hover", "safe-polygon"].includes(fe) && se.type === "mouseleave" && (h.current = !0), fe === "outside-press")
|
|
2412
2414
|
if (ae)
|
|
2413
2415
|
h.current = !1;
|
|
2414
|
-
else if (
|
|
2416
|
+
else if (rr(se) || or(se))
|
|
2415
2417
|
h.current = !1;
|
|
2416
2418
|
else {
|
|
2417
2419
|
let xe = !1;
|
|
@@ -2424,24 +2426,24 @@ function Ni(e) {
|
|
|
2424
2426
|
}
|
|
2425
2427
|
y.on("openchange", B);
|
|
2426
2428
|
const Q = K.createElement("span");
|
|
2427
|
-
Q.setAttribute("tabindex", "-1"), Q.setAttribute("aria-hidden", "true"), Object.assign(Q.style,
|
|
2429
|
+
Q.setAttribute("tabindex", "-1"), Q.setAttribute("aria-hidden", "true"), Object.assign(Q.style, Nt), F && b && b.insertAdjacentElement("afterend", Q);
|
|
2428
2430
|
function te() {
|
|
2429
|
-
if (typeof
|
|
2430
|
-
const U = b ||
|
|
2431
|
+
if (typeof W.current == "boolean") {
|
|
2432
|
+
const U = b || _n();
|
|
2431
2433
|
return U && U.isConnected ? U : Q;
|
|
2432
2434
|
}
|
|
2433
|
-
return
|
|
2435
|
+
return W.current.current || Q;
|
|
2434
2436
|
}
|
|
2435
2437
|
return () => {
|
|
2436
2438
|
y.off("openchange", B);
|
|
2437
|
-
const U = Re(K), fe = ce(w, U) || R && $e(R.nodesRef.current,
|
|
2439
|
+
const U = Re(K), fe = ce(w, U) || R && $e(R.nodesRef.current, C(), !1).some((ae) => {
|
|
2438
2440
|
var xe;
|
|
2439
2441
|
return ce((xe = ae.context) == null ? void 0 : xe.elements.floating, U);
|
|
2440
2442
|
}), se = te();
|
|
2441
2443
|
queueMicrotask(() => {
|
|
2442
|
-
const ae =
|
|
2444
|
+
const ae = fi(se);
|
|
2443
2445
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2444
|
-
|
|
2446
|
+
W.current && !h.current && ne(ae) && // If the focus moved somewhere else after mount, avoid returning focus
|
|
2445
2447
|
// since it likely entered a different element which should be
|
|
2446
2448
|
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
2447
2449
|
(!(ae !== U && U !== K.body) || fe) && ae.focus({
|
|
@@ -2449,44 +2451,44 @@ function Ni(e) {
|
|
|
2449
2451
|
}), Q.remove();
|
|
2450
2452
|
});
|
|
2451
2453
|
};
|
|
2452
|
-
}, [r, w, O,
|
|
2454
|
+
}, [r, w, O, W, x, y, R, F, b, C]), d.useEffect(() => (queueMicrotask(() => {
|
|
2453
2455
|
h.current = !1;
|
|
2454
2456
|
}), () => {
|
|
2455
2457
|
queueMicrotask(ln);
|
|
2456
|
-
}), [r]),
|
|
2458
|
+
}), [r]), X(() => {
|
|
2457
2459
|
if (!r && E)
|
|
2458
2460
|
return E.setFocusManagerState({
|
|
2459
|
-
modal:
|
|
2461
|
+
modal: l,
|
|
2460
2462
|
closeOnFocusOut: m,
|
|
2461
2463
|
open: v,
|
|
2462
|
-
onOpenChange:
|
|
2464
|
+
onOpenChange: g,
|
|
2463
2465
|
domReference: b
|
|
2464
2466
|
}), () => {
|
|
2465
2467
|
E.setFocusManagerState(null);
|
|
2466
2468
|
};
|
|
2467
|
-
}, [r, E,
|
|
2468
|
-
r || O &&
|
|
2469
|
+
}, [r, E, l, v, g, m, b]), X(() => {
|
|
2470
|
+
r || O && Wn(O, _);
|
|
2469
2471
|
}, [r, O, _]);
|
|
2470
2472
|
function Oe(K) {
|
|
2471
|
-
return r || !
|
|
2473
|
+
return r || !u || !l ? null : /* @__PURE__ */ me(di, {
|
|
2472
2474
|
ref: K === "start" ? $ : T,
|
|
2473
|
-
onClick: (z) =>
|
|
2474
|
-
children: typeof
|
|
2475
|
+
onClick: (z) => g(!1, z.nativeEvent),
|
|
2476
|
+
children: typeof u == "string" ? u : "Dismiss"
|
|
2475
2477
|
});
|
|
2476
2478
|
}
|
|
2477
|
-
const Ge = !r &&
|
|
2478
|
-
return /* @__PURE__ */
|
|
2479
|
+
const Ge = !r && V && (l ? !N : !0) && (F || l);
|
|
2480
|
+
return /* @__PURE__ */ qn(Dr, {
|
|
2479
2481
|
children: [Ge && /* @__PURE__ */ me(Ot, {
|
|
2480
2482
|
"data-type": "inside",
|
|
2481
2483
|
ref: tt,
|
|
2482
2484
|
onFocus: (K) => {
|
|
2483
|
-
if (
|
|
2485
|
+
if (l) {
|
|
2484
2486
|
const B = j();
|
|
2485
2487
|
Ke(o[0] === "reference" ? B[0] : B[B.length - 1]);
|
|
2486
2488
|
} else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
2487
2489
|
if (h.current = !1, ot(K, E.portalNode)) {
|
|
2488
|
-
const B =
|
|
2489
|
-
B
|
|
2490
|
+
const B = ar(b);
|
|
2491
|
+
B?.focus();
|
|
2490
2492
|
} else {
|
|
2491
2493
|
var z;
|
|
2492
2494
|
(z = E.beforeOutsideRef.current) == null || z.focus();
|
|
@@ -2496,12 +2498,12 @@ function Ni(e) {
|
|
|
2496
2498
|
"data-type": "inside",
|
|
2497
2499
|
ref: Ue,
|
|
2498
2500
|
onFocus: (K) => {
|
|
2499
|
-
if (
|
|
2501
|
+
if (l)
|
|
2500
2502
|
Ke(j()[0]);
|
|
2501
2503
|
else if (E != null && E.preserveTabOrder && E.portalNode)
|
|
2502
2504
|
if (m && (h.current = !0), ot(K, E.portalNode)) {
|
|
2503
|
-
const B =
|
|
2504
|
-
B
|
|
2505
|
+
const B = fr(b);
|
|
2506
|
+
B?.focus();
|
|
2505
2507
|
} else {
|
|
2506
2508
|
var z;
|
|
2507
2509
|
(z = E.afterOutsideRef.current) == null || z.focus();
|
|
@@ -2512,16 +2514,16 @@ function Ni(e) {
|
|
|
2512
2514
|
}
|
|
2513
2515
|
let vt = 0;
|
|
2514
2516
|
const Vn = "--floating-ui-scrollbar-width";
|
|
2515
|
-
function
|
|
2516
|
-
const e =
|
|
2517
|
+
function mi() {
|
|
2518
|
+
const e = sn(), t = /iP(hone|ad|od)|iOS/.test(e) || // iPads can claim to be MacIntel
|
|
2517
2519
|
e === "MacIntel" && navigator.maxTouchPoints > 1, n = document.body.style, o = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft ? "paddingLeft" : "paddingRight", s = window.innerWidth - document.documentElement.clientWidth, i = n.left ? parseFloat(n.left) : window.scrollX, c = n.top ? parseFloat(n.top) : window.scrollY;
|
|
2518
2520
|
if (n.overflow = "hidden", n.setProperty(Vn, s + "px"), s && (n[o] = s + "px"), t) {
|
|
2519
|
-
var a,
|
|
2520
|
-
const
|
|
2521
|
+
var a, l;
|
|
2522
|
+
const u = ((a = window.visualViewport) == null ? void 0 : a.offsetLeft) || 0, m = ((l = window.visualViewport) == null ? void 0 : l.offsetTop) || 0;
|
|
2521
2523
|
Object.assign(n, {
|
|
2522
2524
|
position: "fixed",
|
|
2523
2525
|
top: -(c - Math.floor(m)) + "px",
|
|
2524
|
-
left: -(i - Math.floor(
|
|
2526
|
+
left: -(i - Math.floor(u)) + "px",
|
|
2525
2527
|
right: "0"
|
|
2526
2528
|
});
|
|
2527
2529
|
}
|
|
@@ -2537,17 +2539,17 @@ function di() {
|
|
|
2537
2539
|
}), window.scrollTo(i, c));
|
|
2538
2540
|
};
|
|
2539
2541
|
}
|
|
2540
|
-
let
|
|
2542
|
+
let Kn = () => {
|
|
2541
2543
|
};
|
|
2542
|
-
const
|
|
2544
|
+
const Wi = /* @__PURE__ */ d.forwardRef(function(t, n) {
|
|
2543
2545
|
const {
|
|
2544
2546
|
lockScroll: r = !1,
|
|
2545
2547
|
...o
|
|
2546
2548
|
} = t;
|
|
2547
|
-
return
|
|
2549
|
+
return X(() => {
|
|
2548
2550
|
if (r)
|
|
2549
|
-
return vt++, vt === 1 && (
|
|
2550
|
-
vt--, vt === 0 &&
|
|
2551
|
+
return vt++, vt === 1 && (Kn = mi()), () => {
|
|
2552
|
+
vt--, vt === 0 && Kn();
|
|
2551
2553
|
};
|
|
2552
2554
|
}, [r]), /* @__PURE__ */ me("div", {
|
|
2553
2555
|
ref: n,
|
|
@@ -2563,14 +2565,14 @@ const _i = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
|
2563
2565
|
}
|
|
2564
2566
|
});
|
|
2565
2567
|
});
|
|
2566
|
-
function
|
|
2568
|
+
function $n(e) {
|
|
2567
2569
|
return ne(e.target) && e.target.tagName === "BUTTON";
|
|
2568
2570
|
}
|
|
2569
|
-
function
|
|
2571
|
+
function pi(e) {
|
|
2570
2572
|
return ne(e.target) && e.target.tagName === "A";
|
|
2571
2573
|
}
|
|
2572
|
-
function
|
|
2573
|
-
return
|
|
2574
|
+
function Bn(e) {
|
|
2575
|
+
return cn(e);
|
|
2574
2576
|
}
|
|
2575
2577
|
function Vi(e, t) {
|
|
2576
2578
|
t === void 0 && (t = {});
|
|
@@ -2585,52 +2587,52 @@ function Vi(e, t) {
|
|
|
2585
2587
|
enabled: i = !0,
|
|
2586
2588
|
event: c = "click",
|
|
2587
2589
|
toggle: a = !0,
|
|
2588
|
-
ignoreMouse:
|
|
2589
|
-
keyboardHandlers:
|
|
2590
|
+
ignoreMouse: l = !1,
|
|
2591
|
+
keyboardHandlers: u = !0,
|
|
2590
2592
|
stickIfOpen: m = !0
|
|
2591
|
-
} = t,
|
|
2592
|
-
onPointerDown(
|
|
2593
|
-
|
|
2593
|
+
} = t, p = d.useRef(), f = d.useRef(!1), v = d.useMemo(() => ({
|
|
2594
|
+
onPointerDown(g) {
|
|
2595
|
+
p.current = g.pointerType;
|
|
2594
2596
|
},
|
|
2595
|
-
onMouseDown(
|
|
2596
|
-
const y =
|
|
2597
|
-
|
|
2597
|
+
onMouseDown(g) {
|
|
2598
|
+
const y = p.current;
|
|
2599
|
+
g.button === 0 && c !== "click" && (it(y, !0) && l || (n && a && (!(o.current.openEvent && m) || o.current.openEvent.type === "mousedown") ? r(!1, g.nativeEvent, "click") : (g.preventDefault(), r(!0, g.nativeEvent, "click"))));
|
|
2598
2600
|
},
|
|
2599
|
-
onClick(
|
|
2600
|
-
const y =
|
|
2601
|
-
if (c === "mousedown" &&
|
|
2602
|
-
|
|
2601
|
+
onClick(g) {
|
|
2602
|
+
const y = p.current;
|
|
2603
|
+
if (c === "mousedown" && p.current) {
|
|
2604
|
+
p.current = void 0;
|
|
2603
2605
|
return;
|
|
2604
2606
|
}
|
|
2605
|
-
it(y, !0) &&
|
|
2607
|
+
it(y, !0) && l || (n && a && (!(o.current.openEvent && m) || o.current.openEvent.type === "click") ? r(!1, g.nativeEvent, "click") : r(!0, g.nativeEvent, "click"));
|
|
2606
2608
|
},
|
|
2607
|
-
onKeyDown(
|
|
2608
|
-
|
|
2609
|
+
onKeyDown(g) {
|
|
2610
|
+
p.current = void 0, !(g.defaultPrevented || !u || $n(g)) && (g.key === " " && !Bn(s) && (g.preventDefault(), f.current = !0), !pi(g) && g.key === "Enter" && r(!(n && a), g.nativeEvent, "click"));
|
|
2609
2611
|
},
|
|
2610
|
-
onKeyUp(
|
|
2611
|
-
|
|
2612
|
+
onKeyUp(g) {
|
|
2613
|
+
g.defaultPrevented || !u || $n(g) || Bn(s) || g.key === " " && f.current && (f.current = !1, r(!(n && a), g.nativeEvent, "click"));
|
|
2612
2614
|
}
|
|
2613
|
-
}), [o, s, c,
|
|
2614
|
-
return
|
|
2615
|
+
}), [o, s, c, l, u, r, n, m, a]);
|
|
2616
|
+
return d.useMemo(() => i ? {
|
|
2615
2617
|
reference: v
|
|
2616
2618
|
} : {}, [i, v]);
|
|
2617
2619
|
}
|
|
2618
|
-
const
|
|
2620
|
+
const gi = {
|
|
2619
2621
|
pointerdown: "onPointerDown",
|
|
2620
2622
|
mousedown: "onMouseDown",
|
|
2621
2623
|
click: "onClick"
|
|
2622
|
-
},
|
|
2624
|
+
}, hi = {
|
|
2623
2625
|
pointerdown: "onPointerDownCapture",
|
|
2624
2626
|
mousedown: "onMouseDownCapture",
|
|
2625
2627
|
click: "onClickCapture"
|
|
2626
|
-
},
|
|
2628
|
+
}, Hn = (e) => {
|
|
2627
2629
|
var t, n;
|
|
2628
2630
|
return {
|
|
2629
|
-
escapeKey: typeof e == "boolean" ? e : (t = e
|
|
2630
|
-
outsidePress: typeof e == "boolean" ? e : (n = e
|
|
2631
|
+
escapeKey: typeof e == "boolean" ? e : (t = e?.escapeKey) != null ? t : !1,
|
|
2632
|
+
outsidePress: typeof e == "boolean" ? e : (n = e?.outsidePress) != null ? n : !0
|
|
2631
2633
|
};
|
|
2632
2634
|
};
|
|
2633
|
-
function
|
|
2635
|
+
function Ki(e, t) {
|
|
2634
2636
|
t === void 0 && (t = {});
|
|
2635
2637
|
const {
|
|
2636
2638
|
open: n,
|
|
@@ -2641,74 +2643,74 @@ function Wi(e, t) {
|
|
|
2641
2643
|
enabled: i = !0,
|
|
2642
2644
|
escapeKey: c = !0,
|
|
2643
2645
|
outsidePress: a = !0,
|
|
2644
|
-
outsidePressEvent:
|
|
2645
|
-
referencePress:
|
|
2646
|
+
outsidePressEvent: l = "pointerdown",
|
|
2647
|
+
referencePress: u = !1,
|
|
2646
2648
|
referencePressEvent: m = "pointerdown",
|
|
2647
|
-
ancestorScroll:
|
|
2648
|
-
bubbles:
|
|
2649
|
+
ancestorScroll: p = !1,
|
|
2650
|
+
bubbles: f,
|
|
2649
2651
|
capture: v
|
|
2650
|
-
} = t,
|
|
2652
|
+
} = t, g = et(), y = ie(typeof a == "function" ? a : () => !1), x = typeof a == "function" ? y : a, b = d.useRef(!1), {
|
|
2651
2653
|
escapeKey: w,
|
|
2652
|
-
outsidePress:
|
|
2653
|
-
} =
|
|
2654
|
-
escapeKey:
|
|
2655
|
-
outsidePress:
|
|
2656
|
-
} =
|
|
2654
|
+
outsidePress: C
|
|
2655
|
+
} = Hn(f), {
|
|
2656
|
+
escapeKey: M,
|
|
2657
|
+
outsidePress: k
|
|
2658
|
+
} = Hn(v), N = d.useRef(!1), P = ie((R) => {
|
|
2657
2659
|
var E;
|
|
2658
2660
|
if (!n || !i || !c || R.key !== "Escape" || N.current)
|
|
2659
2661
|
return;
|
|
2660
|
-
const $ = (E = s.current.floatingContext) == null ? void 0 : E.nodeId, T =
|
|
2662
|
+
const $ = (E = s.current.floatingContext) == null ? void 0 : E.nodeId, T = g ? $e(g.nodesRef.current, $) : [];
|
|
2661
2663
|
if (!w && (R.stopPropagation(), T.length > 0)) {
|
|
2662
2664
|
let h = !0;
|
|
2663
|
-
if (T.forEach((
|
|
2665
|
+
if (T.forEach((I) => {
|
|
2664
2666
|
var D;
|
|
2665
|
-
if ((D =
|
|
2667
|
+
if ((D = I.context) != null && D.open && !I.context.dataRef.current.__escapeKeyBubbles) {
|
|
2666
2668
|
h = !1;
|
|
2667
2669
|
return;
|
|
2668
2670
|
}
|
|
2669
2671
|
}), !h)
|
|
2670
2672
|
return;
|
|
2671
2673
|
}
|
|
2672
|
-
r(!1,
|
|
2673
|
-
}),
|
|
2674
|
+
r(!1, so(R) ? R.nativeEvent : R, "escape-key");
|
|
2675
|
+
}), V = ie((R) => {
|
|
2674
2676
|
var E;
|
|
2675
2677
|
const $ = () => {
|
|
2676
2678
|
var T;
|
|
2677
2679
|
P(R), (T = Ae(R)) == null || T.removeEventListener("keydown", $);
|
|
2678
2680
|
};
|
|
2679
2681
|
(E = Ae(R)) == null || E.addEventListener("keydown", $);
|
|
2680
|
-
}),
|
|
2682
|
+
}), L = ie((R) => {
|
|
2681
2683
|
var E;
|
|
2682
2684
|
const $ = s.current.insideReactTree;
|
|
2683
2685
|
s.current.insideReactTree = !1;
|
|
2684
2686
|
const T = b.current;
|
|
2685
|
-
if (b.current = !1,
|
|
2687
|
+
if (b.current = !1, l === "click" && T || $ || typeof x == "function" && !x(R))
|
|
2686
2688
|
return;
|
|
2687
|
-
const h = Ae(R),
|
|
2688
|
-
let ee =
|
|
2689
|
-
for (; ee && !
|
|
2689
|
+
const h = Ae(R), I = "[" + ze("inert") + "]", D = le(o.floating).querySelectorAll(I);
|
|
2690
|
+
let ee = Y(h) ? h : null;
|
|
2691
|
+
for (; ee && !Me(ee); ) {
|
|
2690
2692
|
const j = Pe(ee);
|
|
2691
|
-
if (
|
|
2693
|
+
if (Me(j) || !Y(j))
|
|
2692
2694
|
break;
|
|
2693
2695
|
ee = j;
|
|
2694
2696
|
}
|
|
2695
|
-
if (D.length &&
|
|
2697
|
+
if (D.length && Y(h) && !ro(h) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
|
|
2696
2698
|
!ce(h, o.floating) && // If the target root element contains none of the markers, then the
|
|
2697
2699
|
// element was injected after the floating element rendered.
|
|
2698
2700
|
Array.from(D).every((j) => !ce(ee, j)))
|
|
2699
2701
|
return;
|
|
2700
|
-
if (ne(h) &&
|
|
2701
|
-
const j =
|
|
2702
|
+
if (ne(h) && W) {
|
|
2703
|
+
const j = Me(h), oe = we(h), ve = /auto|scroll/, tt = j || ve.test(oe.overflowX), Ue = j || ve.test(oe.overflowY), Oe = tt && h.clientWidth > 0 && h.scrollWidth > h.clientWidth, Ge = Ue && h.clientHeight > 0 && h.scrollHeight > h.clientHeight, K = oe.direction === "rtl", z = Ge && (K ? R.offsetX <= h.offsetWidth - h.clientWidth : R.offsetX > h.clientWidth), B = Oe && R.offsetY > h.clientHeight;
|
|
2702
2704
|
if (z || B)
|
|
2703
2705
|
return;
|
|
2704
2706
|
}
|
|
2705
|
-
const F = (E = s.current.floatingContext) == null ? void 0 : E.nodeId, O =
|
|
2707
|
+
const F = (E = s.current.floatingContext) == null ? void 0 : E.nodeId, O = g && $e(g.nodesRef.current, F).some((j) => {
|
|
2706
2708
|
var oe;
|
|
2707
|
-
return
|
|
2709
|
+
return Kt(R, (oe = j.context) == null ? void 0 : oe.elements.floating);
|
|
2708
2710
|
});
|
|
2709
|
-
if (
|
|
2711
|
+
if (Kt(R, o.floating) || Kt(R, o.domReference) || O)
|
|
2710
2712
|
return;
|
|
2711
|
-
const J =
|
|
2713
|
+
const J = g ? $e(g.nodesRef.current, F) : [];
|
|
2712
2714
|
if (J.length > 0) {
|
|
2713
2715
|
let j = !0;
|
|
2714
2716
|
if (J.forEach((oe) => {
|
|
@@ -2725,14 +2727,14 @@ function Wi(e, t) {
|
|
|
2725
2727
|
var E;
|
|
2726
2728
|
const $ = () => {
|
|
2727
2729
|
var T;
|
|
2728
|
-
|
|
2730
|
+
L(R), (T = Ae(R)) == null || T.removeEventListener(l, $);
|
|
2729
2731
|
};
|
|
2730
|
-
(E = Ae(R)) == null || E.addEventListener(
|
|
2732
|
+
(E = Ae(R)) == null || E.addEventListener(l, $);
|
|
2731
2733
|
});
|
|
2732
|
-
|
|
2734
|
+
d.useEffect(() => {
|
|
2733
2735
|
if (!n || !i)
|
|
2734
2736
|
return;
|
|
2735
|
-
s.current.__escapeKeyBubbles = w, s.current.__outsidePressBubbles =
|
|
2737
|
+
s.current.__escapeKeyBubbles = w, s.current.__outsidePressBubbles = C;
|
|
2736
2738
|
let R = -1;
|
|
2737
2739
|
function E(D) {
|
|
2738
2740
|
r(!1, D, "ancestor-scroll");
|
|
@@ -2751,27 +2753,27 @@ function Wi(e, t) {
|
|
|
2751
2753
|
);
|
|
2752
2754
|
}
|
|
2753
2755
|
const h = le(o.floating);
|
|
2754
|
-
c && (h.addEventListener("keydown",
|
|
2755
|
-
let
|
|
2756
|
-
return
|
|
2756
|
+
c && (h.addEventListener("keydown", M ? V : P, M), h.addEventListener("compositionstart", $), h.addEventListener("compositionend", T)), x && h.addEventListener(l, k ? _ : L, k);
|
|
2757
|
+
let I = [];
|
|
2758
|
+
return p && (Y(o.domReference) && (I = ke(o.domReference)), Y(o.floating) && (I = I.concat(ke(o.floating))), !Y(o.reference) && o.reference && o.reference.contextElement && (I = I.concat(ke(o.reference.contextElement)))), I = I.filter((D) => {
|
|
2757
2759
|
var ee;
|
|
2758
2760
|
return D !== ((ee = h.defaultView) == null ? void 0 : ee.visualViewport);
|
|
2759
|
-
}),
|
|
2761
|
+
}), I.forEach((D) => {
|
|
2760
2762
|
D.addEventListener("scroll", E, {
|
|
2761
2763
|
passive: !0
|
|
2762
2764
|
});
|
|
2763
2765
|
}), () => {
|
|
2764
|
-
c && (h.removeEventListener("keydown",
|
|
2766
|
+
c && (h.removeEventListener("keydown", M ? V : P, M), h.removeEventListener("compositionstart", $), h.removeEventListener("compositionend", T)), x && h.removeEventListener(l, k ? _ : L, k), I.forEach((D) => {
|
|
2765
2767
|
D.removeEventListener("scroll", E);
|
|
2766
2768
|
}), window.clearTimeout(R);
|
|
2767
2769
|
};
|
|
2768
|
-
}, [s, o, c, x,
|
|
2770
|
+
}, [s, o, c, x, l, n, r, p, i, w, C, P, M, V, L, k, _]), d.useEffect(() => {
|
|
2769
2771
|
s.current.insideReactTree = !1;
|
|
2770
|
-
}, [s, x,
|
|
2771
|
-
const G =
|
|
2772
|
+
}, [s, x, l]);
|
|
2773
|
+
const G = d.useMemo(() => ({
|
|
2772
2774
|
onKeyDown: P,
|
|
2773
|
-
...
|
|
2774
|
-
[
|
|
2775
|
+
...u && {
|
|
2776
|
+
[gi[m]]: (R) => {
|
|
2775
2777
|
r(!1, R.nativeEvent, "reference-press");
|
|
2776
2778
|
},
|
|
2777
2779
|
...m !== "click" && {
|
|
@@ -2780,7 +2782,7 @@ function Wi(e, t) {
|
|
|
2780
2782
|
}
|
|
2781
2783
|
}
|
|
2782
2784
|
}
|
|
2783
|
-
}), [P, r,
|
|
2785
|
+
}), [P, r, u, m]), W = d.useMemo(() => ({
|
|
2784
2786
|
onKeyDown: P,
|
|
2785
2787
|
onMouseDown() {
|
|
2786
2788
|
b.current = !0;
|
|
@@ -2788,65 +2790,65 @@ function Wi(e, t) {
|
|
|
2788
2790
|
onMouseUp() {
|
|
2789
2791
|
b.current = !0;
|
|
2790
2792
|
},
|
|
2791
|
-
[
|
|
2793
|
+
[hi[l]]: () => {
|
|
2792
2794
|
s.current.insideReactTree = !0;
|
|
2793
2795
|
}
|
|
2794
|
-
}), [P,
|
|
2795
|
-
return
|
|
2796
|
+
}), [P, l, s]);
|
|
2797
|
+
return d.useMemo(() => i ? {
|
|
2796
2798
|
reference: G,
|
|
2797
|
-
floating:
|
|
2798
|
-
} : {}, [i, G,
|
|
2799
|
+
floating: W
|
|
2800
|
+
} : {}, [i, G, W]);
|
|
2799
2801
|
}
|
|
2800
|
-
function
|
|
2802
|
+
function vi(e) {
|
|
2801
2803
|
const {
|
|
2802
2804
|
open: t = !1,
|
|
2803
2805
|
onOpenChange: n,
|
|
2804
2806
|
elements: r
|
|
2805
|
-
} = e, o =
|
|
2807
|
+
} = e, o = Ft(), s = d.useRef({}), [i] = d.useState(() => Cr()), c = Ze() != null;
|
|
2806
2808
|
if (process.env.NODE_ENV !== "production") {
|
|
2807
|
-
const
|
|
2808
|
-
|
|
2809
|
+
const f = r.reference;
|
|
2810
|
+
f && !Y(f) && ri("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `refs.setPositionReference()`", "instead.");
|
|
2809
2811
|
}
|
|
2810
|
-
const [a,
|
|
2811
|
-
s.current.openEvent =
|
|
2812
|
-
open:
|
|
2812
|
+
const [a, l] = d.useState(r.reference), u = ie((f, v, g) => {
|
|
2813
|
+
s.current.openEvent = f ? v : void 0, i.emit("openchange", {
|
|
2814
|
+
open: f,
|
|
2813
2815
|
event: v,
|
|
2814
|
-
reason:
|
|
2816
|
+
reason: g,
|
|
2815
2817
|
nested: c
|
|
2816
|
-
}), n
|
|
2817
|
-
}), m =
|
|
2818
|
-
setPositionReference:
|
|
2819
|
-
}), []),
|
|
2818
|
+
}), n?.(f, v, g);
|
|
2819
|
+
}), m = d.useMemo(() => ({
|
|
2820
|
+
setPositionReference: l
|
|
2821
|
+
}), []), p = d.useMemo(() => ({
|
|
2820
2822
|
reference: a || r.reference || null,
|
|
2821
2823
|
floating: r.floating || null,
|
|
2822
2824
|
domReference: r.reference
|
|
2823
2825
|
}), [a, r.reference, r.floating]);
|
|
2824
|
-
return
|
|
2826
|
+
return d.useMemo(() => ({
|
|
2825
2827
|
dataRef: s,
|
|
2826
2828
|
open: t,
|
|
2827
|
-
onOpenChange:
|
|
2828
|
-
elements:
|
|
2829
|
+
onOpenChange: u,
|
|
2830
|
+
elements: p,
|
|
2829
2831
|
events: i,
|
|
2830
2832
|
floatingId: o,
|
|
2831
2833
|
refs: m
|
|
2832
|
-
}), [t,
|
|
2834
|
+
}), [t, u, p, i, o, m]);
|
|
2833
2835
|
}
|
|
2834
|
-
function
|
|
2836
|
+
function $i(e) {
|
|
2835
2837
|
e === void 0 && (e = {});
|
|
2836
2838
|
const {
|
|
2837
2839
|
nodeId: t
|
|
2838
|
-
} = e, n =
|
|
2840
|
+
} = e, n = vi({
|
|
2839
2841
|
...e,
|
|
2840
2842
|
elements: {
|
|
2841
2843
|
reference: null,
|
|
2842
2844
|
floating: null,
|
|
2843
2845
|
...e.elements
|
|
2844
2846
|
}
|
|
2845
|
-
}), r = e.rootContext || n, o = r.elements, [s, i] =
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
}, [
|
|
2849
|
-
const
|
|
2847
|
+
}), r = e.rootContext || n, o = r.elements, [s, i] = d.useState(null), [c, a] = d.useState(null), u = o?.domReference || s, m = d.useRef(null), p = et();
|
|
2848
|
+
X(() => {
|
|
2849
|
+
u && (m.current = u);
|
|
2850
|
+
}, [u]);
|
|
2851
|
+
const f = jo({
|
|
2850
2852
|
...e,
|
|
2851
2853
|
elements: {
|
|
2852
2854
|
...o,
|
|
@@ -2854,48 +2856,48 @@ function Ki(e) {
|
|
|
2854
2856
|
reference: c
|
|
2855
2857
|
}
|
|
2856
2858
|
}
|
|
2857
|
-
}), v =
|
|
2858
|
-
const
|
|
2859
|
+
}), v = d.useCallback((w) => {
|
|
2860
|
+
const C = Y(w) ? {
|
|
2859
2861
|
getBoundingClientRect: () => w.getBoundingClientRect(),
|
|
2860
2862
|
getClientRects: () => w.getClientRects(),
|
|
2861
2863
|
contextElement: w
|
|
2862
2864
|
} : w;
|
|
2863
|
-
a(
|
|
2864
|
-
}, [
|
|
2865
|
-
(
|
|
2865
|
+
a(C), f.refs.setReference(C);
|
|
2866
|
+
}, [f.refs]), g = d.useCallback((w) => {
|
|
2867
|
+
(Y(w) || w === null) && (m.current = w, i(w)), (Y(f.refs.reference.current) || f.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to
|
|
2866
2868
|
// `null` to support `positionReference` + an unstable `reference`
|
|
2867
2869
|
// callback ref.
|
|
2868
|
-
w !== null && !
|
|
2869
|
-
}, [
|
|
2870
|
-
...
|
|
2871
|
-
setReference:
|
|
2870
|
+
w !== null && !Y(w)) && f.refs.setReference(w);
|
|
2871
|
+
}, [f.refs]), y = d.useMemo(() => ({
|
|
2872
|
+
...f.refs,
|
|
2873
|
+
setReference: g,
|
|
2872
2874
|
setPositionReference: v,
|
|
2873
2875
|
domReference: m
|
|
2874
|
-
}), [
|
|
2875
|
-
...
|
|
2876
|
-
domReference:
|
|
2877
|
-
}), [
|
|
2878
|
-
...
|
|
2876
|
+
}), [f.refs, g, v]), x = d.useMemo(() => ({
|
|
2877
|
+
...f.elements,
|
|
2878
|
+
domReference: u
|
|
2879
|
+
}), [f.elements, u]), b = d.useMemo(() => ({
|
|
2880
|
+
...f,
|
|
2879
2881
|
...r,
|
|
2880
2882
|
refs: y,
|
|
2881
2883
|
elements: x,
|
|
2882
2884
|
nodeId: t
|
|
2883
|
-
}), [
|
|
2884
|
-
return
|
|
2885
|
+
}), [f, y, x, t, r]);
|
|
2886
|
+
return X(() => {
|
|
2885
2887
|
r.dataRef.current.floatingContext = b;
|
|
2886
|
-
const w =
|
|
2888
|
+
const w = p?.nodesRef.current.find((C) => C.id === t);
|
|
2887
2889
|
w && (w.context = b);
|
|
2888
|
-
}),
|
|
2889
|
-
...
|
|
2890
|
+
}), d.useMemo(() => ({
|
|
2891
|
+
...f,
|
|
2890
2892
|
context: b,
|
|
2891
2893
|
refs: y,
|
|
2892
2894
|
elements: x
|
|
2893
|
-
}), [
|
|
2895
|
+
}), [f, y, x, b]);
|
|
2894
2896
|
}
|
|
2895
|
-
function
|
|
2896
|
-
return
|
|
2897
|
+
function qt() {
|
|
2898
|
+
return Zr() && tr();
|
|
2897
2899
|
}
|
|
2898
|
-
function
|
|
2900
|
+
function Bi(e, t) {
|
|
2899
2901
|
t === void 0 && (t = {});
|
|
2900
2902
|
const {
|
|
2901
2903
|
open: n,
|
|
@@ -2906,73 +2908,73 @@ function $i(e, t) {
|
|
|
2906
2908
|
} = e, {
|
|
2907
2909
|
enabled: c = !0,
|
|
2908
2910
|
visibleOnly: a = !0
|
|
2909
|
-
} = t,
|
|
2910
|
-
|
|
2911
|
+
} = t, l = d.useRef(!1), u = d.useRef(-1), m = d.useRef(!0);
|
|
2912
|
+
d.useEffect(() => {
|
|
2911
2913
|
if (!c) return;
|
|
2912
|
-
const
|
|
2914
|
+
const f = pe(i.domReference);
|
|
2913
2915
|
function v() {
|
|
2914
|
-
!n && ne(i.domReference) && i.domReference === Re(le(i.domReference)) && (
|
|
2916
|
+
!n && ne(i.domReference) && i.domReference === Re(le(i.domReference)) && (l.current = !0);
|
|
2915
2917
|
}
|
|
2916
|
-
function
|
|
2918
|
+
function g() {
|
|
2917
2919
|
m.current = !0;
|
|
2918
2920
|
}
|
|
2919
2921
|
function y() {
|
|
2920
2922
|
m.current = !1;
|
|
2921
2923
|
}
|
|
2922
|
-
return
|
|
2923
|
-
|
|
2924
|
+
return f.addEventListener("blur", v), qt() && (f.addEventListener("keydown", g, !0), f.addEventListener("pointerdown", y, !0)), () => {
|
|
2925
|
+
f.removeEventListener("blur", v), qt() && (f.removeEventListener("keydown", g, !0), f.removeEventListener("pointerdown", y, !0));
|
|
2924
2926
|
};
|
|
2925
|
-
}, [i.domReference, n, c]),
|
|
2927
|
+
}, [i.domReference, n, c]), d.useEffect(() => {
|
|
2926
2928
|
if (!c) return;
|
|
2927
|
-
function
|
|
2929
|
+
function f(v) {
|
|
2928
2930
|
let {
|
|
2929
|
-
reason:
|
|
2931
|
+
reason: g
|
|
2930
2932
|
} = v;
|
|
2931
|
-
(
|
|
2933
|
+
(g === "reference-press" || g === "escape-key") && (l.current = !0);
|
|
2932
2934
|
}
|
|
2933
|
-
return o.on("openchange",
|
|
2934
|
-
o.off("openchange",
|
|
2935
|
+
return o.on("openchange", f), () => {
|
|
2936
|
+
o.off("openchange", f);
|
|
2935
2937
|
};
|
|
2936
|
-
}, [o, c]),
|
|
2937
|
-
ge(
|
|
2938
|
+
}, [o, c]), d.useEffect(() => () => {
|
|
2939
|
+
ge(u);
|
|
2938
2940
|
}, []);
|
|
2939
|
-
const
|
|
2941
|
+
const p = d.useMemo(() => ({
|
|
2940
2942
|
onMouseLeave() {
|
|
2941
|
-
|
|
2943
|
+
l.current = !1;
|
|
2942
2944
|
},
|
|
2943
|
-
onFocus(
|
|
2944
|
-
if (
|
|
2945
|
-
const v = Ae(
|
|
2946
|
-
if (a &&
|
|
2947
|
-
if (
|
|
2948
|
-
if (!m.current && !
|
|
2945
|
+
onFocus(f) {
|
|
2946
|
+
if (l.current) return;
|
|
2947
|
+
const v = Ae(f.nativeEvent);
|
|
2948
|
+
if (a && Y(v)) {
|
|
2949
|
+
if (qt() && !f.relatedTarget) {
|
|
2950
|
+
if (!m.current && !cn(v))
|
|
2949
2951
|
return;
|
|
2950
|
-
} else if (!
|
|
2952
|
+
} else if (!oo(v))
|
|
2951
2953
|
return;
|
|
2952
2954
|
}
|
|
2953
|
-
r(!0,
|
|
2955
|
+
r(!0, f.nativeEvent, "focus");
|
|
2954
2956
|
},
|
|
2955
|
-
onBlur(
|
|
2956
|
-
|
|
2957
|
-
const v =
|
|
2958
|
-
|
|
2957
|
+
onBlur(f) {
|
|
2958
|
+
l.current = !1;
|
|
2959
|
+
const v = f.relatedTarget, g = f.nativeEvent, y = Y(v) && v.hasAttribute(ze("focus-guard")) && v.getAttribute("data-type") === "outside";
|
|
2960
|
+
u.current = window.setTimeout(() => {
|
|
2959
2961
|
var x;
|
|
2960
2962
|
const b = Re(i.domReference ? i.domReference.ownerDocument : document);
|
|
2961
|
-
!v && b === i.domReference || ce((x = s.current.floatingContext) == null ? void 0 : x.refs.floating.current, b) || ce(i.domReference, b) || y || r(!1,
|
|
2963
|
+
!v && b === i.domReference || ce((x = s.current.floatingContext) == null ? void 0 : x.refs.floating.current, b) || ce(i.domReference, b) || y || r(!1, g, "focus");
|
|
2962
2964
|
});
|
|
2963
2965
|
}
|
|
2964
2966
|
}), [s, i.domReference, r, a]);
|
|
2965
|
-
return
|
|
2966
|
-
reference:
|
|
2967
|
-
} : {}, [c,
|
|
2967
|
+
return d.useMemo(() => c ? {
|
|
2968
|
+
reference: p
|
|
2969
|
+
} : {}, [c, p]);
|
|
2968
2970
|
}
|
|
2969
|
-
function
|
|
2971
|
+
function Xt(e, t, n) {
|
|
2970
2972
|
const r = /* @__PURE__ */ new Map(), o = n === "item";
|
|
2971
2973
|
let s = e;
|
|
2972
2974
|
if (o && e) {
|
|
2973
2975
|
const {
|
|
2974
|
-
[
|
|
2975
|
-
[
|
|
2976
|
+
[On]: i,
|
|
2977
|
+
[An]: c,
|
|
2976
2978
|
...a
|
|
2977
2979
|
} = e;
|
|
2978
2980
|
s = a;
|
|
@@ -2980,52 +2982,52 @@ function qt(e, t, n) {
|
|
|
2980
2982
|
return {
|
|
2981
2983
|
...n === "floating" && {
|
|
2982
2984
|
tabIndex: -1,
|
|
2983
|
-
[
|
|
2985
|
+
[Qo]: ""
|
|
2984
2986
|
},
|
|
2985
2987
|
...s,
|
|
2986
2988
|
...t.map((i) => {
|
|
2987
2989
|
const c = i ? i[n] : null;
|
|
2988
2990
|
return typeof c == "function" ? e ? c(e) : null : c;
|
|
2989
2991
|
}).concat(e).reduce((i, c) => (c && Object.entries(c).forEach((a) => {
|
|
2990
|
-
let [
|
|
2991
|
-
if (!(o && [
|
|
2992
|
-
if (
|
|
2993
|
-
if (r.has(
|
|
2992
|
+
let [l, u] = a;
|
|
2993
|
+
if (!(o && [On, An].includes(l)))
|
|
2994
|
+
if (l.indexOf("on") === 0) {
|
|
2995
|
+
if (r.has(l) || r.set(l, []), typeof u == "function") {
|
|
2994
2996
|
var m;
|
|
2995
|
-
(m = r.get(
|
|
2996
|
-
for (var
|
|
2997
|
-
v[
|
|
2998
|
-
return (
|
|
2997
|
+
(m = r.get(l)) == null || m.push(u), i[l] = function() {
|
|
2998
|
+
for (var p, f = arguments.length, v = new Array(f), g = 0; g < f; g++)
|
|
2999
|
+
v[g] = arguments[g];
|
|
3000
|
+
return (p = r.get(l)) == null ? void 0 : p.map((y) => y(...v)).find((y) => y !== void 0);
|
|
2999
3001
|
};
|
|
3000
3002
|
}
|
|
3001
3003
|
} else
|
|
3002
|
-
i[
|
|
3004
|
+
i[l] = u;
|
|
3003
3005
|
}), i), {})
|
|
3004
3006
|
};
|
|
3005
3007
|
}
|
|
3006
|
-
function
|
|
3008
|
+
function Hi(e) {
|
|
3007
3009
|
e === void 0 && (e = []);
|
|
3008
|
-
const t = e.map((c) => c
|
|
3009
|
-
(c) =>
|
|
3010
|
+
const t = e.map((c) => c?.reference), n = e.map((c) => c?.floating), r = e.map((c) => c?.item), o = d.useCallback(
|
|
3011
|
+
(c) => Xt(c, e, "reference"),
|
|
3010
3012
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3011
3013
|
t
|
|
3012
|
-
), s =
|
|
3013
|
-
(c) =>
|
|
3014
|
+
), s = d.useCallback(
|
|
3015
|
+
(c) => Xt(c, e, "floating"),
|
|
3014
3016
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3015
3017
|
n
|
|
3016
|
-
), i =
|
|
3017
|
-
(c) =>
|
|
3018
|
+
), i = d.useCallback(
|
|
3019
|
+
(c) => Xt(c, e, "item"),
|
|
3018
3020
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3019
3021
|
r
|
|
3020
3022
|
);
|
|
3021
|
-
return
|
|
3023
|
+
return d.useMemo(() => ({
|
|
3022
3024
|
getReferenceProps: o,
|
|
3023
3025
|
getFloatingProps: s,
|
|
3024
3026
|
getItemProps: i
|
|
3025
3027
|
}), [o, s, i]);
|
|
3026
3028
|
}
|
|
3027
|
-
const
|
|
3028
|
-
function
|
|
3029
|
+
const bi = "Escape";
|
|
3030
|
+
function _t(e, t, n) {
|
|
3029
3031
|
switch (e) {
|
|
3030
3032
|
case "vertical":
|
|
3031
3033
|
return t;
|
|
@@ -3036,19 +3038,19 @@ function Nt(e, t, n) {
|
|
|
3036
3038
|
}
|
|
3037
3039
|
}
|
|
3038
3040
|
function bt(e, t) {
|
|
3039
|
-
return
|
|
3041
|
+
return _t(t, e === st || e === Fe, e === Ne || e === _e);
|
|
3040
3042
|
}
|
|
3041
3043
|
function Yt(e, t, n) {
|
|
3042
|
-
return
|
|
3044
|
+
return _t(t, e === Fe, n ? e === Ne : e === _e) || e === "Enter" || e === " " || e === "";
|
|
3043
3045
|
}
|
|
3044
|
-
function
|
|
3045
|
-
return
|
|
3046
|
+
function zn(e, t, n) {
|
|
3047
|
+
return _t(t, n ? e === Ne : e === _e, e === Fe);
|
|
3046
3048
|
}
|
|
3047
|
-
function
|
|
3049
|
+
function Un(e, t, n, r) {
|
|
3048
3050
|
const o = n ? e === _e : e === Ne, s = e === st;
|
|
3049
|
-
return t === "both" || t === "horizontal" && r && r > 1 ? e ===
|
|
3051
|
+
return t === "both" || t === "horizontal" && r && r > 1 ? e === bi : _t(t, o, s);
|
|
3050
3052
|
}
|
|
3051
|
-
function
|
|
3053
|
+
function zi(e, t) {
|
|
3052
3054
|
const {
|
|
3053
3055
|
open: n,
|
|
3054
3056
|
onOpenChange: r,
|
|
@@ -3059,37 +3061,37 @@ function Hi(e, t) {
|
|
|
3059
3061
|
activeIndex: c,
|
|
3060
3062
|
onNavigate: a = () => {
|
|
3061
3063
|
},
|
|
3062
|
-
enabled:
|
|
3063
|
-
selectedIndex:
|
|
3064
|
+
enabled: l = !0,
|
|
3065
|
+
selectedIndex: u = null,
|
|
3064
3066
|
allowEscape: m = !1,
|
|
3065
|
-
loop:
|
|
3066
|
-
nested:
|
|
3067
|
+
loop: p = !1,
|
|
3068
|
+
nested: f = !1,
|
|
3067
3069
|
rtl: v = !1,
|
|
3068
|
-
virtual:
|
|
3070
|
+
virtual: g = !1,
|
|
3069
3071
|
focusItemOnOpen: y = "auto",
|
|
3070
3072
|
focusItemOnHover: x = !0,
|
|
3071
3073
|
openOnArrowKeyDown: b = !0,
|
|
3072
3074
|
disabledIndices: w = void 0,
|
|
3073
|
-
orientation:
|
|
3074
|
-
parentOrientation:
|
|
3075
|
-
cols:
|
|
3075
|
+
orientation: C = "vertical",
|
|
3076
|
+
parentOrientation: M,
|
|
3077
|
+
cols: k = 1,
|
|
3076
3078
|
scrollItemIntoView: N = !0,
|
|
3077
3079
|
virtualItemRef: P,
|
|
3078
|
-
itemSizes:
|
|
3079
|
-
dense:
|
|
3080
|
+
itemSizes: V,
|
|
3081
|
+
dense: L = !1
|
|
3080
3082
|
} = t;
|
|
3081
|
-
process.env.NODE_ENV !== "production" && (m && (
|
|
3082
|
-
const _ =
|
|
3083
|
-
|
|
3084
|
-
e.dataRef.current.orientation =
|
|
3085
|
-
}, [e,
|
|
3083
|
+
process.env.NODE_ENV !== "production" && (m && (p || zt("`useListNavigation` looping must be enabled to allow escaping."), g || zt("`useListNavigation` must be virtual to allow escaping.")), C === "vertical" && k > 1 && zt("In grid list navigation mode (`cols` > 1), the `orientation` should", 'be either "horizontal" or "both".'));
|
|
3084
|
+
const _ = It(o.floating), G = ye(_), W = Ze(), R = et();
|
|
3085
|
+
X(() => {
|
|
3086
|
+
e.dataRef.current.orientation = C;
|
|
3087
|
+
}, [e, C]);
|
|
3086
3088
|
const E = ie(() => {
|
|
3087
3089
|
a(h.current === -1 ? null : h.current);
|
|
3088
|
-
}), $ =
|
|
3089
|
-
function
|
|
3090
|
-
if (
|
|
3090
|
+
}), $ = en(o.domReference), T = d.useRef(y), h = d.useRef(u ?? -1), I = d.useRef(null), D = d.useRef(!0), ee = d.useRef(E), F = d.useRef(!!o.floating), O = d.useRef(n), J = d.useRef(!1), j = d.useRef(!1), oe = ye(w), ve = ye(n), tt = ye(N), Ue = ye(u), [Oe, Ge] = d.useState(), [K, z] = d.useState(), B = ie(() => {
|
|
3091
|
+
function S(Z) {
|
|
3092
|
+
if (g) {
|
|
3091
3093
|
var re;
|
|
3092
|
-
(re = Z.id) != null && re.endsWith("-fui-option") && (Z.id = s + "-" + Math.random().toString(16).slice(2, 10)), Ge(Z.id), R
|
|
3094
|
+
(re = Z.id) != null && re.endsWith("-fui-option") && (Z.id = s + "-" + Math.random().toString(16).slice(2, 10)), Ge(Z.id), R?.events.emit("virtualfocus", Z), P && (P.current = Z);
|
|
3093
3095
|
} else
|
|
3094
3096
|
Ke(Z, {
|
|
3095
3097
|
sync: J.current,
|
|
@@ -3097,10 +3099,10 @@ function Hi(e, t) {
|
|
|
3097
3099
|
});
|
|
3098
3100
|
}
|
|
3099
3101
|
const H = i.current[h.current], A = j.current;
|
|
3100
|
-
H &&
|
|
3102
|
+
H && S(H), (J.current ? (Z) => Z() : requestAnimationFrame)(() => {
|
|
3101
3103
|
const Z = i.current[h.current] || H;
|
|
3102
3104
|
if (!Z) return;
|
|
3103
|
-
H ||
|
|
3105
|
+
H || S(Z);
|
|
3104
3106
|
const re = tt.current;
|
|
3105
3107
|
re && te && (A || !D.current) && (Z.scrollIntoView == null || Z.scrollIntoView(typeof re == "boolean" ? {
|
|
3106
3108
|
block: "nearest",
|
|
@@ -3108,44 +3110,44 @@ function Hi(e, t) {
|
|
|
3108
3110
|
} : re));
|
|
3109
3111
|
});
|
|
3110
3112
|
});
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
}, [
|
|
3114
|
-
if (
|
|
3113
|
+
X(() => {
|
|
3114
|
+
l && (n && o.floating ? T.current && u != null && (j.current = !0, h.current = u, E()) : F.current && (h.current = -1, ee.current()));
|
|
3115
|
+
}, [l, n, o.floating, u, E]), X(() => {
|
|
3116
|
+
if (l && n && o.floating)
|
|
3115
3117
|
if (c == null) {
|
|
3116
3118
|
if (J.current = !1, Ue.current != null)
|
|
3117
3119
|
return;
|
|
3118
|
-
if (F.current && (h.current = -1, B()), (!O.current || !F.current) && T.current && (
|
|
3119
|
-
let
|
|
3120
|
+
if (F.current && (h.current = -1, B()), (!O.current || !F.current) && T.current && (I.current != null || T.current === !0 && I.current == null)) {
|
|
3121
|
+
let S = 0;
|
|
3120
3122
|
const H = () => {
|
|
3121
|
-
i.current[0] == null ? (
|
|
3123
|
+
i.current[0] == null ? (S < 2 && (S ? requestAnimationFrame : queueMicrotask)(H), S++) : (h.current = I.current == null || Yt(I.current, C, v) || f ? yt(i, oe.current) : tn(i, oe.current), I.current = null, E());
|
|
3122
3124
|
};
|
|
3123
3125
|
H();
|
|
3124
3126
|
}
|
|
3125
3127
|
} else qe(i, c) || (h.current = c, B(), j.current = !1);
|
|
3126
|
-
}, [
|
|
3127
|
-
var
|
|
3128
|
-
if (!
|
|
3128
|
+
}, [l, n, o.floating, c, Ue, f, i, C, v, E, B, oe]), X(() => {
|
|
3129
|
+
var S;
|
|
3130
|
+
if (!l || o.floating || !R || g || !F.current)
|
|
3129
3131
|
return;
|
|
3130
|
-
const H = R.nodesRef.current, A = (
|
|
3132
|
+
const H = R.nodesRef.current, A = (S = H.find((re) => re.id === W)) == null || (S = S.context) == null ? void 0 : S.elements.floating, q = Re(le(o.floating)), Z = H.some((re) => re.context && ce(re.context.elements.floating, q));
|
|
3131
3133
|
A && !Z && D.current && A.focus({
|
|
3132
3134
|
preventScroll: !0
|
|
3133
3135
|
});
|
|
3134
|
-
}, [
|
|
3135
|
-
if (!
|
|
3136
|
-
function
|
|
3136
|
+
}, [l, o.floating, R, W, g]), X(() => {
|
|
3137
|
+
if (!l || !R || !g || W) return;
|
|
3138
|
+
function S(H) {
|
|
3137
3139
|
z(H.id), P && (P.current = H);
|
|
3138
3140
|
}
|
|
3139
|
-
return R.events.on("virtualfocus",
|
|
3140
|
-
R.events.off("virtualfocus",
|
|
3141
|
+
return R.events.on("virtualfocus", S), () => {
|
|
3142
|
+
R.events.off("virtualfocus", S);
|
|
3141
3143
|
};
|
|
3142
|
-
}, [
|
|
3144
|
+
}, [l, R, g, W, P]), X(() => {
|
|
3143
3145
|
ee.current = E, O.current = n, F.current = !!o.floating;
|
|
3144
|
-
}),
|
|
3145
|
-
n || (
|
|
3146
|
+
}), X(() => {
|
|
3147
|
+
n || (I.current = null, T.current = y);
|
|
3146
3148
|
}, [n, y]);
|
|
3147
|
-
const Q = c != null, te =
|
|
3148
|
-
function
|
|
3149
|
+
const Q = c != null, te = d.useMemo(() => {
|
|
3150
|
+
function S(A) {
|
|
3149
3151
|
if (!ve.current) return;
|
|
3150
3152
|
const q = i.current.indexOf(A);
|
|
3151
3153
|
q !== -1 && h.current !== q && (h.current = q, E());
|
|
@@ -3155,7 +3157,7 @@ function Hi(e, t) {
|
|
|
3155
3157
|
let {
|
|
3156
3158
|
currentTarget: q
|
|
3157
3159
|
} = A;
|
|
3158
|
-
J.current = !0,
|
|
3160
|
+
J.current = !0, S(q);
|
|
3159
3161
|
},
|
|
3160
3162
|
onClick: (A) => {
|
|
3161
3163
|
let {
|
|
@@ -3170,13 +3172,13 @@ function Hi(e, t) {
|
|
|
3170
3172
|
let {
|
|
3171
3173
|
currentTarget: q
|
|
3172
3174
|
} = A;
|
|
3173
|
-
J.current = !0, j.current = !1, x &&
|
|
3175
|
+
J.current = !0, j.current = !1, x && S(q);
|
|
3174
3176
|
},
|
|
3175
3177
|
onPointerLeave(A) {
|
|
3176
3178
|
let {
|
|
3177
3179
|
pointerType: q
|
|
3178
3180
|
} = A;
|
|
3179
|
-
if (!(!D.current || q === "touch") && (J.current = !0, !!x && (h.current = -1, E(), !
|
|
3181
|
+
if (!(!D.current || q === "touch") && (J.current = !0, !!x && (h.current = -1, E(), !g))) {
|
|
3180
3182
|
var Z;
|
|
3181
3183
|
(Z = G.current) == null || Z.focus({
|
|
3182
3184
|
preventScroll: !0
|
|
@@ -3184,63 +3186,63 @@ function Hi(e, t) {
|
|
|
3184
3186
|
}
|
|
3185
3187
|
}
|
|
3186
3188
|
};
|
|
3187
|
-
}, [ve, G, x, i, E,
|
|
3188
|
-
var
|
|
3189
|
-
return
|
|
3190
|
-
}, [
|
|
3191
|
-
if (D.current = !1, J.current = !0,
|
|
3189
|
+
}, [ve, G, x, i, E, g]), U = d.useCallback(() => {
|
|
3190
|
+
var S;
|
|
3191
|
+
return M ?? (R == null || (S = R.nodesRef.current.find((H) => H.id === W)) == null || (S = S.context) == null || (S = S.dataRef) == null ? void 0 : S.current.orientation);
|
|
3192
|
+
}, [W, R, M]), fe = ie((S) => {
|
|
3193
|
+
if (D.current = !1, J.current = !0, S.which === 229 || !ve.current && S.currentTarget === G.current)
|
|
3192
3194
|
return;
|
|
3193
|
-
if (
|
|
3194
|
-
bt(
|
|
3195
|
+
if (f && Un(S.key, C, v, k)) {
|
|
3196
|
+
bt(S.key, U()) || de(S), r(!1, S.nativeEvent, "list-navigation"), ne(o.domReference) && (g ? R?.events.emit("virtualfocus", o.domReference) : o.domReference.focus());
|
|
3195
3197
|
return;
|
|
3196
3198
|
}
|
|
3197
|
-
const H = h.current, A = yt(i, w), q =
|
|
3198
|
-
if ($ || (
|
|
3199
|
-
const Z =
|
|
3199
|
+
const H = h.current, A = yt(i, w), q = tn(i, w);
|
|
3200
|
+
if ($ || (S.key === "Home" && (de(S), h.current = A, E()), S.key === "End" && (de(S), h.current = q, E())), k > 1) {
|
|
3201
|
+
const Z = V || Array.from({
|
|
3200
3202
|
length: i.current.length
|
|
3201
3203
|
}, () => ({
|
|
3202
3204
|
width: 1,
|
|
3203
3205
|
height: 1
|
|
3204
|
-
})), re =
|
|
3206
|
+
})), re = sr(Z, k, L), nt = re.findIndex((be) => be != null && !Be(i, be, w)), at = re.reduce((be, Ve, ft) => Ve != null && !Be(i, Ve, w) ? ft : be, -1), rt = re[ir({
|
|
3205
3207
|
current: re.map((be) => be != null ? i.current[be] : null)
|
|
3206
3208
|
}, {
|
|
3207
|
-
event:
|
|
3208
|
-
orientation:
|
|
3209
|
-
loop:
|
|
3209
|
+
event: S,
|
|
3210
|
+
orientation: C,
|
|
3211
|
+
loop: p,
|
|
3210
3212
|
rtl: v,
|
|
3211
|
-
cols:
|
|
3213
|
+
cols: k,
|
|
3212
3214
|
// treat undefined (empty grid spaces) as disabled indices so we
|
|
3213
3215
|
// don't end up in them
|
|
3214
|
-
disabledIndices:
|
|
3216
|
+
disabledIndices: ur([...(typeof w != "function" ? w : null) || i.current.map((be, Ve) => Be(i, Ve, w) ? Ve : void 0), void 0], re),
|
|
3215
3217
|
minIndex: nt,
|
|
3216
3218
|
maxIndex: at,
|
|
3217
|
-
prevIndex:
|
|
3219
|
+
prevIndex: cr(
|
|
3218
3220
|
h.current > q ? A : h.current,
|
|
3219
3221
|
Z,
|
|
3220
3222
|
re,
|
|
3221
|
-
|
|
3223
|
+
k,
|
|
3222
3224
|
// use a corner matching the edge closest to the direction
|
|
3223
3225
|
// we're moving in so we don't end up in the same item. Prefer
|
|
3224
3226
|
// top/left over bottom/right.
|
|
3225
|
-
|
|
3227
|
+
S.key === Fe ? "bl" : S.key === (v ? Ne : _e) ? "tr" : "tl"
|
|
3226
3228
|
),
|
|
3227
3229
|
stopEvent: !0
|
|
3228
3230
|
})];
|
|
3229
|
-
if (rt != null && (h.current = rt, E()),
|
|
3231
|
+
if (rt != null && (h.current = rt, E()), C === "both")
|
|
3230
3232
|
return;
|
|
3231
3233
|
}
|
|
3232
|
-
if (bt(
|
|
3233
|
-
if (de(
|
|
3234
|
-
h.current = Yt(
|
|
3234
|
+
if (bt(S.key, C)) {
|
|
3235
|
+
if (de(S), n && !g && Re(S.currentTarget.ownerDocument) === S.currentTarget) {
|
|
3236
|
+
h.current = Yt(S.key, C, v) ? A : q, E();
|
|
3235
3237
|
return;
|
|
3236
3238
|
}
|
|
3237
|
-
Yt(
|
|
3239
|
+
Yt(S.key, C, v) ? p ? h.current = H >= q ? m && H !== i.current.length ? -1 : A : ue(i, {
|
|
3238
3240
|
startingIndex: H,
|
|
3239
3241
|
disabledIndices: w
|
|
3240
3242
|
}) : h.current = Math.min(q, ue(i, {
|
|
3241
3243
|
startingIndex: H,
|
|
3242
3244
|
disabledIndices: w
|
|
3243
|
-
})) :
|
|
3245
|
+
})) : p ? h.current = H <= A ? m && H !== -1 ? i.current.length : q : ue(i, {
|
|
3244
3246
|
startingIndex: H,
|
|
3245
3247
|
decrement: !0,
|
|
3246
3248
|
disabledIndices: w
|
|
@@ -3250,29 +3252,29 @@ function Hi(e, t) {
|
|
|
3250
3252
|
disabledIndices: w
|
|
3251
3253
|
})), qe(i, h.current) && (h.current = -1), E();
|
|
3252
3254
|
}
|
|
3253
|
-
}), se =
|
|
3255
|
+
}), se = d.useMemo(() => g && n && Q && {
|
|
3254
3256
|
"aria-activedescendant": K || Oe
|
|
3255
|
-
}, [
|
|
3256
|
-
"aria-orientation":
|
|
3257
|
+
}, [g, n, Q, K, Oe]), ae = d.useMemo(() => ({
|
|
3258
|
+
"aria-orientation": C === "both" ? void 0 : C,
|
|
3257
3259
|
...$ ? {} : se,
|
|
3258
3260
|
onKeyDown: fe,
|
|
3259
3261
|
onPointerMove() {
|
|
3260
3262
|
D.current = !0;
|
|
3261
3263
|
}
|
|
3262
|
-
}), [se, fe,
|
|
3263
|
-
function
|
|
3264
|
-
y === "auto" &&
|
|
3264
|
+
}), [se, fe, C, $]), xe = d.useMemo(() => {
|
|
3265
|
+
function S(A) {
|
|
3266
|
+
y === "auto" && rr(A.nativeEvent) && (T.current = !0);
|
|
3265
3267
|
}
|
|
3266
3268
|
function H(A) {
|
|
3267
|
-
T.current = y, y === "auto" &&
|
|
3269
|
+
T.current = y, y === "auto" && or(A.nativeEvent) && (T.current = !0);
|
|
3268
3270
|
}
|
|
3269
3271
|
return {
|
|
3270
3272
|
...se,
|
|
3271
3273
|
onKeyDown(A) {
|
|
3272
3274
|
D.current = !1;
|
|
3273
|
-
const q = A.key.startsWith("Arrow"), Z = ["Home", "End"].includes(A.key), re = q || Z, nt =
|
|
3274
|
-
if (
|
|
3275
|
-
const dt = R
|
|
3275
|
+
const q = A.key.startsWith("Arrow"), Z = ["Home", "End"].includes(A.key), re = q || Z, nt = zn(A.key, C, v), at = Un(A.key, C, v, k), rt = zn(A.key, U(), v), be = bt(A.key, C), Ve = (f ? rt : be) || A.key === "Enter" || A.key.trim() === "";
|
|
3276
|
+
if (g && n) {
|
|
3277
|
+
const dt = R?.nodesRef.current.find((mt) => mt.parentId == null), De = R && dt ? io(R.nodesRef.current, dt.id) : null;
|
|
3276
3278
|
if (re && De && P) {
|
|
3277
3279
|
const mt = new KeyboardEvent("keydown", {
|
|
3278
3280
|
key: A.key,
|
|
@@ -3280,7 +3282,7 @@ function Hi(e, t) {
|
|
|
3280
3282
|
});
|
|
3281
3283
|
if (nt || at) {
|
|
3282
3284
|
var ft, an;
|
|
3283
|
-
const Mr = ((ft = De.context) == null ? void 0 : ft.elements.domReference) === A.currentTarget, dn = at && !Mr ? (an = De.context) == null ? void 0 : an.elements.domReference : nt ? i.current.find((mn) =>
|
|
3285
|
+
const Mr = ((ft = De.context) == null ? void 0 : ft.elements.domReference) === A.currentTarget, dn = at && !Mr ? (an = De.context) == null ? void 0 : an.elements.domReference : nt ? i.current.find((mn) => mn?.id === Oe) : null;
|
|
3284
3286
|
dn && (de(A), dn.dispatchEvent(mt), z(void 0));
|
|
3285
3287
|
}
|
|
3286
3288
|
if ((be || Z) && De.context && De.context.open && De.parentId && A.currentTarget !== De.context.elements.domReference) {
|
|
@@ -3292,34 +3294,34 @@ function Hi(e, t) {
|
|
|
3292
3294
|
return fe(A);
|
|
3293
3295
|
}
|
|
3294
3296
|
if (!(!n && !b && q)) {
|
|
3295
|
-
if (
|
|
3297
|
+
if (Ve) {
|
|
3296
3298
|
const dt = bt(A.key, U());
|
|
3297
|
-
|
|
3299
|
+
I.current = f && dt ? null : A.key;
|
|
3298
3300
|
}
|
|
3299
|
-
if (
|
|
3301
|
+
if (f) {
|
|
3300
3302
|
rt && (de(A), n ? (h.current = yt(i, oe.current), E()) : r(!0, A.nativeEvent, "list-navigation"));
|
|
3301
3303
|
return;
|
|
3302
3304
|
}
|
|
3303
|
-
be && (
|
|
3305
|
+
be && (u != null && (h.current = u), de(A), !n && b ? r(!0, A.nativeEvent, "list-navigation") : fe(A), n && E());
|
|
3304
3306
|
}
|
|
3305
3307
|
},
|
|
3306
3308
|
onFocus() {
|
|
3307
|
-
n && !
|
|
3309
|
+
n && !g && (h.current = -1, E());
|
|
3308
3310
|
},
|
|
3309
3311
|
onPointerDown: H,
|
|
3310
3312
|
onPointerEnter: H,
|
|
3311
|
-
onMouseDown:
|
|
3312
|
-
onClick:
|
|
3313
|
+
onMouseDown: S,
|
|
3314
|
+
onClick: S
|
|
3313
3315
|
};
|
|
3314
|
-
}, [Oe, se,
|
|
3315
|
-
return
|
|
3316
|
+
}, [Oe, se, k, fe, oe, y, i, f, E, r, n, b, C, U, v, u, R, g, P]);
|
|
3317
|
+
return d.useMemo(() => l ? {
|
|
3316
3318
|
reference: xe,
|
|
3317
3319
|
floating: ae,
|
|
3318
3320
|
item: te
|
|
3319
|
-
} : {}, [
|
|
3321
|
+
} : {}, [l, xe, ae, te]);
|
|
3320
3322
|
}
|
|
3321
|
-
const
|
|
3322
|
-
function
|
|
3323
|
+
const yi = /* @__PURE__ */ new Map([["select", "listbox"], ["combobox", "listbox"], ["label", !1]]);
|
|
3324
|
+
function Ui(e, t) {
|
|
3323
3325
|
var n, r;
|
|
3324
3326
|
t === void 0 && (t = {});
|
|
3325
3327
|
const {
|
|
@@ -3329,22 +3331,22 @@ function zi(e, t) {
|
|
|
3329
3331
|
} = e, {
|
|
3330
3332
|
enabled: c = !0,
|
|
3331
3333
|
role: a = "dialog"
|
|
3332
|
-
} = t,
|
|
3334
|
+
} = t, l = Ft(), u = ((n = s.domReference) == null ? void 0 : n.id) || l, m = d.useMemo(() => {
|
|
3333
3335
|
var b;
|
|
3334
|
-
return ((b =
|
|
3335
|
-
}, [s.floating, i]),
|
|
3336
|
+
return ((b = It(s.floating)) == null ? void 0 : b.id) || i;
|
|
3337
|
+
}, [s.floating, i]), p = (r = yi.get(a)) != null ? r : a, v = Ze() != null, g = d.useMemo(() => p === "tooltip" || a === "label" ? {
|
|
3336
3338
|
["aria-" + (a === "label" ? "labelledby" : "describedby")]: o ? m : void 0
|
|
3337
3339
|
} : {
|
|
3338
3340
|
"aria-expanded": o ? "true" : "false",
|
|
3339
|
-
"aria-haspopup":
|
|
3341
|
+
"aria-haspopup": p === "alertdialog" ? "dialog" : p,
|
|
3340
3342
|
"aria-controls": o ? m : void 0,
|
|
3341
|
-
...
|
|
3343
|
+
...p === "listbox" && {
|
|
3342
3344
|
role: "combobox"
|
|
3343
3345
|
},
|
|
3344
|
-
...
|
|
3345
|
-
id:
|
|
3346
|
+
...p === "menu" && {
|
|
3347
|
+
id: u
|
|
3346
3348
|
},
|
|
3347
|
-
...
|
|
3349
|
+
...p === "menu" && v && {
|
|
3348
3350
|
role: "menuitem"
|
|
3349
3351
|
},
|
|
3350
3352
|
...a === "select" && {
|
|
@@ -3353,25 +3355,25 @@ function zi(e, t) {
|
|
|
3353
3355
|
...a === "combobox" && {
|
|
3354
3356
|
"aria-autocomplete": "list"
|
|
3355
3357
|
}
|
|
3356
|
-
}, [
|
|
3358
|
+
}, [p, m, v, o, u, a]), y = d.useMemo(() => {
|
|
3357
3359
|
const b = {
|
|
3358
3360
|
id: m,
|
|
3359
|
-
...
|
|
3360
|
-
role:
|
|
3361
|
+
...p && {
|
|
3362
|
+
role: p
|
|
3361
3363
|
}
|
|
3362
3364
|
};
|
|
3363
|
-
return
|
|
3365
|
+
return p === "tooltip" || a === "label" ? b : {
|
|
3364
3366
|
...b,
|
|
3365
|
-
...
|
|
3366
|
-
"aria-labelledby":
|
|
3367
|
+
...p === "menu" && {
|
|
3368
|
+
"aria-labelledby": u
|
|
3367
3369
|
}
|
|
3368
3370
|
};
|
|
3369
|
-
}, [
|
|
3371
|
+
}, [p, m, u, a]), x = d.useCallback((b) => {
|
|
3370
3372
|
let {
|
|
3371
3373
|
active: w,
|
|
3372
|
-
selected:
|
|
3374
|
+
selected: C
|
|
3373
3375
|
} = b;
|
|
3374
|
-
const
|
|
3376
|
+
const M = {
|
|
3375
3377
|
role: "option",
|
|
3376
3378
|
...w && {
|
|
3377
3379
|
id: m + "-fui-option"
|
|
@@ -3381,28 +3383,28 @@ function zi(e, t) {
|
|
|
3381
3383
|
case "select":
|
|
3382
3384
|
case "combobox":
|
|
3383
3385
|
return {
|
|
3384
|
-
...
|
|
3385
|
-
"aria-selected":
|
|
3386
|
+
...M,
|
|
3387
|
+
"aria-selected": C
|
|
3386
3388
|
};
|
|
3387
3389
|
}
|
|
3388
3390
|
return {};
|
|
3389
3391
|
}, [m, a]);
|
|
3390
|
-
return
|
|
3391
|
-
reference:
|
|
3392
|
+
return d.useMemo(() => c ? {
|
|
3393
|
+
reference: g,
|
|
3392
3394
|
floating: y,
|
|
3393
3395
|
item: x
|
|
3394
|
-
} : {}, [c,
|
|
3396
|
+
} : {}, [c, g, y, x]);
|
|
3395
3397
|
}
|
|
3396
|
-
function
|
|
3397
|
-
const [n, r] =
|
|
3398
|
-
return e && !n && r(!0),
|
|
3398
|
+
function wi(e, t) {
|
|
3399
|
+
const [n, r] = d.useState(e);
|
|
3400
|
+
return e && !n && r(!0), d.useEffect(() => {
|
|
3399
3401
|
if (!e && n) {
|
|
3400
3402
|
const o = setTimeout(() => r(!1), t);
|
|
3401
3403
|
return () => clearTimeout(o);
|
|
3402
3404
|
}
|
|
3403
3405
|
}, [e, n, t]), n;
|
|
3404
3406
|
}
|
|
3405
|
-
function
|
|
3407
|
+
function Gi(e, t) {
|
|
3406
3408
|
t === void 0 && (t = {});
|
|
3407
3409
|
const {
|
|
3408
3410
|
open: n,
|
|
@@ -3411,52 +3413,52 @@ function Ui(e, t) {
|
|
|
3411
3413
|
}
|
|
3412
3414
|
} = e, {
|
|
3413
3415
|
duration: o = 250
|
|
3414
|
-
} = t, i = (typeof o == "number" ? o : o.close) || 0, [c, a] =
|
|
3415
|
-
return !
|
|
3416
|
+
} = t, i = (typeof o == "number" ? o : o.close) || 0, [c, a] = d.useState("unmounted"), l = wi(n, i);
|
|
3417
|
+
return !l && c === "close" && a("unmounted"), X(() => {
|
|
3416
3418
|
if (r) {
|
|
3417
3419
|
if (n) {
|
|
3418
3420
|
a("initial");
|
|
3419
|
-
const
|
|
3420
|
-
|
|
3421
|
+
const u = requestAnimationFrame(() => {
|
|
3422
|
+
nn.flushSync(() => {
|
|
3421
3423
|
a("open");
|
|
3422
3424
|
});
|
|
3423
3425
|
});
|
|
3424
3426
|
return () => {
|
|
3425
|
-
cancelAnimationFrame(
|
|
3427
|
+
cancelAnimationFrame(u);
|
|
3426
3428
|
};
|
|
3427
3429
|
}
|
|
3428
3430
|
a("close");
|
|
3429
3431
|
}
|
|
3430
3432
|
}, [n, r]), {
|
|
3431
|
-
isMounted:
|
|
3433
|
+
isMounted: l,
|
|
3432
3434
|
status: c
|
|
3433
3435
|
};
|
|
3434
3436
|
}
|
|
3435
3437
|
export {
|
|
3436
3438
|
Mi as C,
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3439
|
+
Wi as F,
|
|
3440
|
+
Pi as a,
|
|
3441
|
+
Ki as b,
|
|
3442
|
+
Ui as c,
|
|
3443
|
+
Hi as d,
|
|
3444
|
+
Gi as e,
|
|
3445
|
+
_i as f,
|
|
3446
|
+
Ni as g,
|
|
3447
|
+
Jo as h,
|
|
3448
|
+
Si as i,
|
|
3449
|
+
Oi as j,
|
|
3450
|
+
Fi as k,
|
|
3451
|
+
Bi as l,
|
|
3452
|
+
Ai as m,
|
|
3451
3453
|
Vi as n,
|
|
3452
3454
|
Ii as o,
|
|
3453
|
-
|
|
3455
|
+
Ci as p,
|
|
3454
3456
|
Ze as q,
|
|
3455
3457
|
ki as r,
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3458
|
+
Ti as s,
|
|
3459
|
+
Di as t,
|
|
3460
|
+
$i as u,
|
|
3461
|
+
Li as v,
|
|
3460
3462
|
Yo as w,
|
|
3461
|
-
|
|
3463
|
+
zi as x
|
|
3462
3464
|
};
|