@dep-dio/dio-designsystem 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +33 -46
  2. package/dist/components/Alert/Alert.d.ts +8 -0
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
  4. package/dist/components/Button/Button.d.ts +12 -0
  5. package/dist/components/Button/ButtonClose.d.ts +8 -0
  6. package/dist/components/Button/ButtonLink.d.ts +10 -0
  7. package/dist/components/Card/Card.d.ts +20 -0
  8. package/dist/components/Checkbox/Checkbox.d.ts +17 -0
  9. package/dist/components/Checkbox/CheckboxFieldset.d.ts +10 -0
  10. package/dist/components/ControlGroup/ControlGroup.d.ts +7 -0
  11. package/dist/components/Details/Details.d.ts +18 -0
  12. package/dist/components/Dialog/Dialog.d.ts +30 -0
  13. package/dist/components/Dropdown/Dropdown.d.ts +19 -0
  14. package/dist/components/ErrorSummary/ErrorSummary.d.ts +27 -0
  15. package/dist/components/FeedbackBanner/FeedbackBanner.d.ts +9 -0
  16. package/dist/components/Form/Form.d.ts +6 -0
  17. package/dist/components/Label/Label.d.ts +9 -0
  18. package/dist/components/LinkList/LinkList.d.ts +11 -0
  19. package/dist/components/NavigationalLink/NavigationalLink.d.ts +8 -0
  20. package/dist/components/Pagination/Pagination.d.ts +15 -0
  21. package/dist/components/Radio/Radio.d.ts +9 -0
  22. package/dist/components/Radio/RadioFieldset.d.ts +10 -0
  23. package/dist/components/Select/Select.d.ts +25 -0
  24. package/dist/components/Spinner/Spinner.d.ts +8 -0
  25. package/dist/components/SvgIcon/SvgIcon.d.ts +10 -0
  26. package/dist/components/Switch/Switch.d.ts +9 -0
  27. package/dist/components/Tabs/Tabs.d.ts +13 -0
  28. package/dist/components/Tag/Tag.d.ts +7 -0
  29. package/dist/components/Textarea/Textarea.d.ts +16 -0
  30. package/dist/components/Textfield/Textfield.d.ts +15 -0
  31. package/dist/components/ValidationMessage/ValidationMessage.d.ts +3 -0
  32. package/dist/react.d.ts +31 -0
  33. package/dist/react.js +9842 -0
  34. package/dist/react.js.map +7 -0
  35. package/dist/styles/main.css +21 -2
  36. package/dist/theme-colors.d.ts +6 -0
  37. package/dist/types.d.ts +1 -1
  38. package/dist/web.d.ts +6 -6
  39. package/dist/web.js +6 -6
  40. package/dist/web.js.map +2 -2
  41. package/package.json +27 -9
  42. /package/dist/{carousel/Carousel.d.ts → web-components/Carousel/DioCarousel.d.ts} +0 -0
  43. /package/dist/{feedback-banner/FeedbackBanner.d.ts → web-components/FeedbackBanner/DioFeedbackBanner.d.ts} +0 -0
  44. /package/dist/{news-alert-subscribe/NewsAlertSubscribe.d.ts → web-components/NewsAlertSubscribe/DioNewsAlertSubscribe.d.ts} +0 -0
  45. /package/dist/{search-autocomplete/SearchAutocomplete.d.ts → web-components/SearchAutocomplete/DioSearchAutocomplete.d.ts} +0 -0
  46. /package/dist/{timeline/Timeline.d.ts → web-components/Timeline/DioTimeline.d.ts} +0 -0
  47. /package/dist/{to-top-of-page/ToTopOfPage.d.ts → web-components/ToTopOfPage/DioToTopOfPage.d.ts} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../node_modules/clsx/dist/lite.mjs", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/alert/alert.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/avatar/avatar.js", "../../../node_modules/@radix-ui/react-slot/src/slot.tsx", "../../../node_modules/@radix-ui/react-compose-refs/src/compose-refs.tsx", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/avatar-stack/avatar-stack.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/badge/badge-position.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/badge/badge.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/badge/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/breadcrumbs/breadcrumbs-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/link/link.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/breadcrumbs/breadcrumbs-link.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/breadcrumbs/breadcrumbs-list.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/breadcrumbs/breadcrumbs.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/breadcrumbs/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/deprecated/use-media-query/use-media-query.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/use-checkbox-group/use-checkbox-group.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/use-pagination/use-pagination.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/use-radio-group/use-radio-group.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/use-synchronized-animation/use-synchronized-animation.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/hooks/use-merge-refs/use-merge-refs.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/roving-focus/use-roving-focus.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/roving-focus/roving-focus-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/utilities/roving-focus/roving-focus-root.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/spinner/spinner.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/button/button.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/label/label.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/omit/omit.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/validation-message/validation-message.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/paragraph/paragraph.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/input/input.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/chip/chips.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/chip/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/ComboboxContext.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Option/Description.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Option/SelectedIcon.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/ComboboxIdContext.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Custom.js", "../../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs", "../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../../../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs", "../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs", "../../../node_modules/tabbable/src/index.js", "../../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs", "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs", "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/utilities.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Option/useComboboxOption.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Option/Option.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Empty.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/internal/ComboboxError.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/internal/ComboboxChips.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/internal/ComboboxClearButton.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/internal/ComboboxInput.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/internal/ComboboxLabel.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/internal/ComboboxNative.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/useCombobox.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/useComboboxKeyboard.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/useFloatingCombobox.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/useFormField/FieldsetContext.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/useFormField/useFormField.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/Combobox.js", "../../../node_modules/@tanstack/virtual-core/src/lazy-measurements.ts", "../../../node_modules/@tanstack/virtual-core/src/utils.ts", "../../../node_modules/@tanstack/virtual-core/src/index.ts", "../../../node_modules/@tanstack/react-virtual/src/index.tsx", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/Combobox/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/card/card-block.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/card/card.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/card/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/field/field-affix.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/field/field-counter.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/field/field-description.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/field/field.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/field/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/checkbox/checkbox.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/details/details-content.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/details/details-summary.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/details/details.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/details/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dialog/dialog-trigger-context.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dialog/dialog-block.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dialog/dialog-trigger.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dialog/dialog.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dialog/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/divider/divider.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/popover/popover-trigger-context.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown-button.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/heading/heading.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown-heading.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown-list.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/popover/popover-trigger.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown-trigger.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown-trigger-context.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/popover/popover.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/dropdown.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/dropdown/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/error-summary/error-summary-heading.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/list/list-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/list/lists.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/list/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/error-summary/error-summary-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/error-summary/error-summary-link.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/error-summary/error-summary-list.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/error-summary/error-summary.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/error-summary/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/fieldset/fieldset-description.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/fieldset/fieldset-legend.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/fieldset/fieldset.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/fieldset/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/file-upload/file-upload.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/pagination/pagination-button.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/pagination/pagination-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/pagination/pagination-list.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/pagination/pagination.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/pagination/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/popover/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/radio/radio.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/search/search-button.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/search/search-clear.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/search/search-input.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/search/search.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/search/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/select/select-optgroup.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/select/select-option.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/select/select.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/select/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/skeleton/skeleton.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/skip-link/skip-link.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion-clear.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion-empty.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion-input.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion-list.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion-option.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/suggestion-toggle.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/suggestion/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/switch/switch.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table-body.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table-cell.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table-foot.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table-head.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table-header-cell.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table-row.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/table.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/table/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tabs/tabs-list.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tabs/tabs.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tabs/tabs-panel.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tabs/tabs-tab.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tabs/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tag/tag.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/textarea/textarea.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/textfield/textfield.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/toggle-group/toggle-group.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/toggle-group/toggle-group-item.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/toggle-group/index.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/tooltip/tooltip.js", "../../../node_modules/@digdir/designsystemet-react/dist/esm/components/index.js", "../src/components/Alert/Alert.tsx", "../src/components/Breadcrumbs/Breadcrumbs.tsx", "../src/components/SvgIcon/SvgIcon.tsx", "../src/components/Button/Button.tsx", "../src/components/Button/ButtonClose.tsx", "../src/components/Button/ButtonLink.tsx", "../src/components/Card/Card.tsx", "../src/components/Checkbox/Checkbox.tsx", "../src/components/Label/Label.tsx", "../src/components/Tag/Tag.tsx", "../src/components/ValidationMessage/ValidationMessage.tsx", "../src/components/ControlGroup/ControlGroup.tsx", "../src/components/Checkbox/CheckboxFieldset.tsx", "../src/components/Details/Details.tsx", "../src/components/Dialog/Dialog.tsx", "../src/components/Dropdown/Dropdown.tsx", "../src/components/ErrorSummary/ErrorSummary.tsx", "../src/components/FeedbackBanner/FeedbackBanner.tsx", "../src/components/Form/Form.tsx", "../src/components/LinkList/LinkList.tsx", "../src/components/NavigationalLink/NavigationalLink.tsx", "../src/components/Pagination/Pagination.tsx", "../src/components/Radio/Radio.tsx", "../src/components/Radio/RadioFieldset.tsx", "../src/components/Select/Select.tsx", "../src/components/Spinner/Spinner.tsx", "../src/components/Switch/Switch.tsx", "../src/components/Tabs/Tabs.tsx", "../src/components/Textarea/Textarea.tsx", "../src/components/Textfield/Textfield.tsx", "../src/theme-colors.ts"],
4
+ "sourcesContent": ["export function clsx(){for(var t,r=0,e=\"\",n=arguments.length;r<n;r++)(t=arguments[r])&&\"string\"==typeof t&&(e+=(e&&\" \")+t);return e}export default clsx;", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/alert/alert.tsx\n/**\n* Alerts are used to inform users about important information, warnings, errors, or success.\n*\n* @example\n* <Alert data-color='info'>Dette er en informasjonsmelding</Alert>\n*/\nconst Alert = forwardRef(function Alert({ \"data-color\": color = \"info\", className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: cl(\"ds-alert\", className),\n\t\t\"data-color\": color,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Alert };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { Fragment, forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/avatar/avatar.tsx\n/**\n* Avatars are used to represent people or entities.\n*\n* @example\n* <Avatar aria-label=\"John Doe\" initials=\"JD\" />\n*\n* @example\n* <Avatar aria-label=\"John Doe\">\n* <img src='\u2026' alt='John Doe' />\n* </Avatar>\n*\n* @example\n* <Avatar aria-label=\"John Doe\">\n* <Icon />\n* </Avatar>\n*/\nconst Avatar = forwardRef(function Avatar({ \"aria-label\": ariaLabel, \"data-tooltip\": dataTooltip, variant, className, children, initials, asChild, ...rest }, ref) {\n\tconst OuterComponent = asChild ? Slot : \"span\";\n\tconst useSlot = children && typeof children !== \"string\";\n\tconst textChild = children && typeof children === \"string\";\n\tconst Component = useSlot ? Slot : Fragment;\n\treturn /* @__PURE__ */ jsx(OuterComponent, {\n\t\tref,\n\t\tclassName: cl(\"ds-avatar\", className),\n\t\t\"data-variant\": variant,\n\t\t\"data-initials\": initials,\n\t\trole: asChild ? void 0 : \"img\",\n\t\t\"aria-label\": ariaLabel || dataTooltip,\n\t\t\"data-tooltip\": dataTooltip,\n\t\ttabIndex: dataTooltip ? 0 : void 0,\n\t\t...rest,\n\t\tchildren: /* @__PURE__ */ jsx(Component, {\n\t\t\t...useSlot && !asChild ? { \"aria-hidden\": true } : {},\n\t\t\tchildren: textChild ? /* @__PURE__ */ jsx(\"span\", { children }) : children\n\t\t})\n\t});\n});\n//#endregion\nexport { Avatar };\n", "import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\n\ndeclare module 'react' {\n interface ReactElement {\n $$typeof?: symbol | string;\n }\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\n\ntype SlotProps<Elem extends Element = HTMLElement, Props = React.HTMLAttributes<Elem>> = Props & {\n children?: React.ReactNode;\n};\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot<\n Elem extends Element = HTMLElement,\n Props = React.HTMLAttributes<Elem>,\n>(ownerName: string) {\n const Slot = React.forwardRef<Elem, SlotProps<Elem, Props>>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n let slottableElement: React.ReactElement | null = null;\n let hasSlottable = false;\n const newChildren: React.ReactNode[] = [];\n\n if (isLazyComponent(children) && typeof use === 'function') {\n children = use(children._payload);\n }\n\n React.Children.forEach(children, (maybeSlottable) => {\n if (isSlottable(maybeSlottable)) {\n hasSlottable = true;\n const slottable = maybeSlottable;\n let child = 'child' in slottable.props ? slottable.props.child : slottable.props.children;\n\n if (isLazyComponent(child) && typeof use === 'function') {\n child = use(child._payload);\n }\n\n slottableElement = getSlottableElementFromSlottable(slottable, child);\n newChildren.push((slottableElement?.props as any)?.children);\n } else {\n newChildren.push(maybeSlottable);\n }\n });\n\n if (slottableElement) {\n slottableElement = React.cloneElement(slottableElement, undefined, newChildren);\n } else if (\n // A `Slottable` was found but it didn't resolve to a single element (e.g.\n // it wrapped multiple elements, text, or a render-prop `child` that\n // wasn't an element). Don't fall back to treating the `Slottable` wrapper\n // itself as the slot target \u2014 throw a descriptive error below instead.\n !hasSlottable &&\n React.Children.count(children) === 1 &&\n React.isValidElement(children)\n ) {\n slottableElement = children;\n }\n\n const slottableElementRef = slottableElement ? getElementRef(slottableElement) : undefined;\n const composedRef = useComposedRefs(forwardedRef, slottableElementRef);\n\n if (!slottableElement) {\n // Empty/falsy children (`null`, `undefined`, `false`, no children, etc.) are valid and\n // render nothing. Anything else is content we couldn't slot onto a single element, which\n // is a usage error, so we fail loudly with a clear message.\n if (children || children === 0) {\n throw new Error(\n hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName),\n );\n }\n return children;\n }\n\n const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});\n\n // do not pass ref to React.Fragment for React 19 compatibility\n if (slottableElement.type !== React.Fragment) {\n mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;\n }\n\n return React.cloneElement(slottableElement, mergedProps);\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol.for('radix.slottable');\n\ntype SlottableChildrenProps = { children: React.ReactNode };\ntype SlottableRenderFnProps = {\n child: React.ReactNode;\n children: (slottable: React.ReactNode) => React.ReactNode;\n};\n\ntype SlottableProps = SlottableRenderFnProps | SlottableChildrenProps;\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = (props) =>\n 'child' in props ? props.children(props.child) : props.children;\n\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* -------------------------------------------------------------------------------------------------\n * getSlottableElementFromSlottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst getSlottableElementFromSlottable = (slottable: SlottableElement, child: React.ReactNode) => {\n if ('child' in slottable.props) {\n const child = slottable.props.child;\n if (!React.isValidElement<React.PropsWithChildren>(child)) return null;\n return React.cloneElement(child, undefined, slottable.props.children(child.props.children));\n }\n\n return React.isValidElement(child) ? child : null;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * mergeProps\n * -----------------------------------------------------------------------------------------------*/\n\ntype AnyProps = Record<string, any>;\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n/* -------------------------------------------------------------------------------------------------\n * getElementRef\n * -----------------------------------------------------------------------------------------------*/\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype SlottableElement = React.ReactElement<SlottableProps, SlottableComponent>;\n\nfunction isSlottable(\n child: React.ReactNode,\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<any>>>;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === 'object' &&\n '$$typeof' in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n '_payload' in element &&\n isPromiseLike(element._payload)\n );\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === 'object' && value !== null && 'then' in value;\n}\n\nconst createSlotError = (ownerName: string) => {\n return `${ownerName} failed to slot onto its children. Expected a single React element child or \\`Slottable\\`.`;\n};\n\nconst createSlottableError = (ownerName: string) => {\n return `${ownerName} failed to slot onto its \\`Slottable\\`. Expected \\`Slottable\\` to receive a single React element child.`;\n};\n\nconst use: typeof React.use | undefined = (React as any)[' use '.trim().toString()];\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n", "import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == 'function') {\n hasCleanup = true;\n }\n return cleanup;\n });\n\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == 'function') {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/avatar-stack/avatar-stack.tsx\n/**\n* Use `AvatarStack` to constrain Avatars into a stack.\n*\n* @example\n* <EXPERIMENTAL_AvatarStack>\n* <Avatar aria-label='name'>\n* <img src={cat1} alt='' />\n* </Avatar>\n* <Avatar aria-label='name'>\n* <BriefcaseIcon />\n* </Avatar>\n* <Avatar aria-label='name' initials='sm' />\n* </EXPERIMENTAL_AvatarStack>\n*/\nconst EXPERIMENTAL_AvatarStack = forwardRef(function AvatarStack({ className, gap, suffix, children, avatarSize, overlap, style, expandable, ...rest }, ref) {\n\tif (typeof overlap === \"number\") overlap = `calc(var(--dsc-avatar-stack-size) / 100 * ${overlap})`;\n\treturn /* @__PURE__ */ jsxs(\"ul\", {\n\t\tclassName: cl(`ds-avatar-stack`, className),\n\t\t\"data-expandable\": expandable || void 0,\n\t\ttabIndex: rest.tabIndex ?? (expandable ? 0 : void 0),\n\t\tref,\n\t\tstyle: {\n\t\t\t\"--dsc-avatar-stack-gap\": gap,\n\t\t\t\"--dsc-avatar-stack-size\": avatarSize,\n\t\t\t\"--dsc-avatar-stack-overlap\": overlap,\n\t\t\t...style\n\t\t},\n\t\t...rest,\n\t\tchildren: [children, suffix && /* @__PURE__ */ jsx(\"li\", { children: suffix })]\n\t});\n});\n//#endregion\nexport { EXPERIMENTAL_AvatarStack };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/badge/badge-position.tsx\n/**\n* `BadgePosition` is a component that positions the badge.\n*\n* @example\n* <BadgePosition placement='top-right' overlap='circle'>\n* <Badge count={5} maxCount={10} />\n* <Element />\n* </BadgePosition>\n*/\nconst BadgePosition = forwardRef(function BadgePlacement({ className, overlap = \"rectangle\", placement = \"top-right\", ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"span\", {\n\t\tclassName: cl(\"ds-badge--position\", className),\n\t\t\"data-overlap\": overlap,\n\t\t\"data-placement\": placement,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { BadgePosition };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/badge/badge.tsx\n/**\n* `Badge` is a non-interactive component for displaying status with or without numbers.\n*\n* @example without children\n* <Badge count={5} maxCount={10} />\n*\n* @example with children\n* <Badge count={5} maxCount={10}>\n* <Icon />\n* </Badge>\n*/\nconst Badge = forwardRef(function Badge({ className, count, maxCount, variant, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"span\", {\n\t\tclassName: cl(\"ds-badge\", className),\n\t\t\"data-count\": count && maxCount && count > maxCount ? `${maxCount}+` : count,\n\t\t\"data-variant\": variant,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Badge };\n", "'use client';\nimport { Badge as Badge$1 } from \"./badge.js\";\nimport { BadgePosition } from \"./badge-position.js\";\n//#region src/components/badge/index.ts\n/**\n* `Badge` is a non-interactive component for displaying status with or without numbers.\n*\n* @example without children\n* <Badge count={5} maxCount={10} />\n*/\nconst Badge = Object.assign(Badge$1, { Position: BadgePosition });\nBadge.Position.displayName = \"Badge.Position\";\n//#endregion\nexport { Badge, BadgePosition };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/breadcrumbs/breadcrumbs-item.tsx\nconst BreadcrumbsItem = forwardRef(function BreadcrumbsItem({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"li\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { BreadcrumbsItem };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/link/link.tsx\n/**\n* Link component, renders a native `a` element.\n*\n* @example\n* <Link href='#'>Link</Link>\n*/\nconst Link = forwardRef(({ asChild, className, ...rest }, ref) => {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"a\", {\n\t\tclassName: cl(\"ds-link\", className),\n\t\tref,\n\t\t...rest\n\t});\n});\nLink.displayName = \"Link\";\n//#endregion\nexport { Link };\n", "'use client';\nimport { Link } from \"../link/link.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/breadcrumbs/breadcrumbs-link.tsx\nconst BreadcrumbsLink = forwardRef(function BreadcrumbsLink(rest, ref) {\n\treturn /* @__PURE__ */ jsx(Link, {\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { BreadcrumbsLink };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/breadcrumbs/breadcrumbs-list.tsx\nconst BreadcrumbsList = forwardRef(function BreadcrumbsList(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"ol\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { BreadcrumbsList };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/breadcrumbs/breadcrumbs.tsx\n/**\n* `Breadcrumbs` is a component that displays a list of breadcrumbs.\n*\n* @example\n* <Breadcrumbs aria-label='Du er her:' {...args}>\n* <Breadcrumbs.Link href='#' aria-label='Tilbake til Niv\u00E5 1'>\n* Niv\u00E5 1\n* </Breadcrumbs.Link>\n* <Breadcrumbs.List>\n* <Breadcrumbs.Item>\n* <Breadcrumbs.Link href='#'>Niv\u00E5 1</Breadcrumbs.Link>\n* </Breadcrumbs.Item>\n* <Breadcrumbs.Item>\n* <Breadcrumbs.Link href='#'>Niv\u00E5 2</Breadcrumbs.Link>\n* </Breadcrumbs.Item>\n* </Breadcrumbs.List>\n* </Breadcrumbs>\n*/\nconst Breadcrumbs = forwardRef(({ className, ...rest }, ref) => /* @__PURE__ */ jsx(\"ds-breadcrumbs\", {\n\tsuppressHydrationWarning: true,\n\tclass: cl(\"ds-breadcrumbs\", className),\n\tref,\n\t...rest\n}));\n//#endregion\nexport { Breadcrumbs };\n", "'use client';\nimport { Breadcrumbs } from \"./breadcrumbs.js\";\nimport { BreadcrumbsItem } from \"./breadcrumbs-item.js\";\nimport { BreadcrumbsLink } from \"./breadcrumbs-link.js\";\nimport { BreadcrumbsList } from \"./breadcrumbs-list.js\";\n//#region src/components/breadcrumbs/index.ts\n/**\n* `Breadcrumbs` is a component that displays a list of breadcrumbs.\n*\n* @example\n* <Breadcrumbs aria-label='Du er her:'>\n* <Breadcrumbs.Link href='#' aria-label='Tilbake til Niv\u00E5 1'>\n* Niv\u00E5 1\n* </Breadcrumbs.Link>\n* <Breadcrumbs.List>\n* <Breadcrumbs.Item>\n* <Breadcrumbs.Link href='#'>Niv\u00E5 1</Breadcrumbs.Link>\n* </Breadcrumbs.Item>\n* <Breadcrumbs.Item>\n* <Breadcrumbs.Link href='#'>Niv\u00E5 2</Breadcrumbs.Link>\n* </Breadcrumbs.Item>\n* </Breadcrumbs.List>\n* </Breadcrumbs>\n*/\nconst BreadcrumbsComponent = Object.assign(Breadcrumbs, {\n\tList: BreadcrumbsList,\n\tItem: BreadcrumbsItem,\n\tLink: BreadcrumbsLink\n});\nBreadcrumbsComponent.List.displayName = \"Breadcrumbs.List\";\nBreadcrumbsComponent.Item.displayName = \"Breadcrumbs.Item\";\nBreadcrumbsComponent.Link.displayName = \"Breadcrumbs.Link\";\n//#endregion\nexport { BreadcrumbsComponent as Breadcrumbs, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsList };\n", "'use client';\nimport { useEffect, useRef } from \"react\";\n//#region src/utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.ts\nfunction useDebounceCallback(callback, delay = 50) {\n\tconst timeoutRef = useRef(null);\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (timeoutRef.current) clearTimeout(timeoutRef.current);\n\t\t};\n\t}, []);\n\tconst debouncedCallback = (...args) => {\n\t\tif (timeoutRef.current) clearTimeout(timeoutRef.current);\n\t\ttimeoutRef.current = window.setTimeout(() => {\n\t\t\tcallback(...args);\n\t\t}, delay);\n\t};\n\treturn debouncedCallback;\n}\n//#endregion\nexport { useDebounceCallback };\n", "'use client';\nimport { useEffect, useLayoutEffect } from \"react\";\n//#region src/utilities/hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.ts\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n//#endregion\nexport { useIsomorphicLayoutEffect };\n", "'use client';\nimport { useIsomorphicLayoutEffect } from \"../use-isomorphic-layout-effect/use-isomorphic-layout-effect.js\";\nimport { useState } from \"react\";\n//#region src/utilities/hooks/deprecated/use-media-query/use-media-query.ts\nconst IS_SERVER = typeof window === \"undefined\";\nfunction useMediaQuery(query, { defaultValue = false, initializeWithValue = true } = {}) {\n\tconst getMatches = (query) => {\n\t\tif (IS_SERVER) return defaultValue;\n\t\treturn window.matchMedia(query).matches;\n\t};\n\tconst [matches, setMatches] = useState(() => {\n\t\tif (initializeWithValue) return getMatches(query);\n\t\treturn defaultValue;\n\t});\n\tfunction handleChange() {\n\t\tsetMatches(getMatches(query));\n\t}\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconst matchMedia = window.matchMedia(query);\n\t\thandleChange();\n\t\tif (matchMedia.addListener) matchMedia.addListener(handleChange);\n\t\telse matchMedia.addEventListener(\"change\", handleChange);\n\t\treturn () => {\n\t\t\tif (matchMedia.removeListener) matchMedia.removeListener(handleChange);\n\t\t\telse matchMedia.removeEventListener(\"change\", handleChange);\n\t\t};\n\t}, [query]);\n\treturn matches;\n}\n//#endregion\nexport { useMediaQuery };\n", "'use client';\nimport { useEffect, useId, useRef, useState } from \"react\";\n//#region src/utilities/hooks/use-checkbox-group/use-checkbox-group.ts\nconst toggleIndeterminate = (getIndeterminateInputs, getInputs) => {\n\tconst inputs = getIndeterminateInputs();\n\tconst checked = !!getInputs(true).length;\n\tconst unchecked = !!getInputs(false).length;\n\tfor (const input of inputs) {\n\t\tinput.indeterminate = unchecked && checked;\n\t\tinput.checked = !unchecked && checked;\n\t}\n};\nfunction useCheckboxGroup(props) {\n\tconst { error, name: groupName, onChange, value = [], disabled, readOnly, required } = props || {};\n\tconst [groupValue, setGroupValue] = useState(value);\n\tconst namedId = useId();\n\tconst errorId = useId();\n\tconst checkboxRefs = useRef(/* @__PURE__ */ new Set());\n\tconst indeterminateRefs = useRef(/* @__PURE__ */ new Set());\n\tconst inputRefs = useRef(/* @__PURE__ */ new Map());\n\tconst getInputs = (checked) => Array.from(checkboxRefs.current.values()).filter((input) => input.checked === checked);\n\tconst getIndeterminateInputs = () => Array.from(indeterminateRefs.current.values());\n\tuseEffect(() => {\n\t\ttoggleIndeterminate(getIndeterminateInputs, getInputs);\n\t}, [groupValue]);\n\treturn {\n\t\t/**\n\t\t* Current value of the group.\n\t\t*/\n\t\tvalue: groupValue,\n\t\t/**\n\t\t* Set the value of the group.\n\t\t*\n\t\t* @param value string[]\n\t\t* @returns void\n\t\t*/\n\t\tsetValue: setGroupValue,\n\t\t/**\n\t\t* Props to send to the `Checkbox` component.\n\t\t* Accepts value or object\n\t\t* @example\n\t\t* <Checkbox {...getCheckboxProps('value')} />\n\t\t*\n\t\t* @example allow indeterminate\n\t\t* <Checkbox {...getCheckboxProps({ value: 'all', allowIndeterminate: true })} />\n\t\t*/\n\t\tgetCheckboxProps: (propsOrValue) => {\n\t\t\tlet groupProps;\n\t\t\tif (props) {\n\t\t\t\tconst { onChange, error, ...rest } = props;\n\t\t\t\tgroupProps = rest;\n\t\t\t}\n\t\t\tconst { allowIndeterminate = false, ref: forwardedRef = void 0, value = \"\", ...rest } = typeof propsOrValue === \"string\" ? { value: propsOrValue } : propsOrValue || {};\n\t\t\tconst handleRef = (element) => {\n\t\t\t\tif (element) {\n\t\t\t\t\t(allowIndeterminate ? indeterminateRefs : checkboxRefs).current.add(element);\n\t\t\t\t\tinputRefs.current.set(value, element);\n\t\t\t\t\tif (getIndeterminateInputs().length) toggleIndeterminate(getIndeterminateInputs, getInputs);\n\t\t\t\t} else {\n\t\t\t\t\tconst oldElement = inputRefs.current.get(value);\n\t\t\t\t\tif (oldElement) {\n\t\t\t\t\t\tcheckboxRefs.current.delete(oldElement);\n\t\t\t\t\t\tindeterminateRefs.current.delete(oldElement);\n\t\t\t\t\t\tinputRefs.current.delete(value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (forwardedRef) if (typeof forwardedRef === \"function\") forwardedRef(element);\n\t\t\t\telse forwardedRef.current = element;\n\t\t\t};\n\t\t\tconst handleChange = () => {\n\t\t\t\tconst nextGroupValue = Array.from(getInputs(true), ({ value }) => value);\n\t\t\t\tsetGroupValue(nextGroupValue);\n\t\t\t\tonChange?.(nextGroupValue, groupValue);\n\t\t\t};\n\t\t\tconst indeterminateChange = () => {\n\t\t\t\tconst element = inputRefs.current.get(value);\n\t\t\t\tif (!element) return;\n\t\t\t\tconst checked = !!element.checked;\n\t\t\t\tfor (const input of getInputs(!checked)) input.click();\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...groupProps,\n\t\t\t\t...rest,\n\t\t\t\t\"aria-describedby\": `${error ? errorId : \"\"} ${rest[\"aria-describedby\"] || \"\"}`.trim() || void 0,\n\t\t\t\t\"aria-invalid\": !!error || rest[\"aria-invalid\"],\n\t\t\t\tchecked: allowIndeterminate ? void 0 : groupValue.includes(value),\n\t\t\t\tname: rest.name || groupName || namedId,\n\t\t\t\tonChange: (e) => {\n\t\t\t\t\trest.onChange?.(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tallowIndeterminate && indeterminateChange();\n\t\t\t\t\thandleChange();\n\t\t\t\t},\n\t\t\t\tref: handleRef,\n\t\t\t\tvalue,\n\t\t\t\tdisabled: disabled || rest.disabled,\n\t\t\t\treadOnly: readOnly || rest.readOnly,\n\t\t\t\trequired: required || rest.required\n\t\t\t};\n\t\t},\n\t\t/**\n\t\t* Props to send to the `ValidationMessage` component.\n\t\t*\n\t\t* @example\n\t\t* <ValidationMessage {...validationMessageProps} />\n\t\t*/\n\t\tvalidationMessageProps: {\n\t\t\tchildren: error,\n\t\t\thidden: !error,\n\t\t\tid: errorId\n\t\t}\n\t};\n}\n//#endregion\nexport { useCheckboxGroup };\n", "'use client';\nimport { pagination } from \"@digdir/designsystemet-web\";\nimport { useMemo } from \"react\";\n//#region src/utilities/hooks/use-pagination/use-pagination.ts\n/**\n* Hook to help manage pagination state\n*\n* @example\n* const { pages, nextButtonProps, prevButtonProps } = usePagination({\n* currentPage: page,\n* totalPages: 10,\n* showPages: 7,\n* setCurrentPage,\n* })\n*\n* <Pagination>\n* <Pagination.Item>\n* <Pagination.Button {...prevButtonProps}>Forrige</Pagination.Button>\n* </Pagination.Item>\n* {pages.map(({ page, itemKey, buttonProps }) => (\n* <Pagination.Item key={itemKey}>\n* {typeof page === 'number' && (\n* <Pagination.Button {...buttonProps} aria-label={`Side ${page}`}>\n* {page}\n* </Pagination.Button>\n* )}\n* </Pagination.Item>\n* ))}\n* <Pagination.Item>\n* <Pagination.Button {...nextButtonProps}>Neste</Pagination.Button>\n* </Pagination.Item>\n* </Pagination>\n**/\nconst usePagination = ({ currentPage: current = 1, setCurrentPage, onChange, totalPages: total = 1, showPages: show = 7 }) => useMemo(() => {\n\tconst { next, prev, pages } = pagination({\n\t\tcurrent,\n\t\ttotal,\n\t\tshow\n\t});\n\tconst handleClick = (page) => (event) => {\n\t\tif (page < 1 || page > total) return event.preventDefault();\n\t\tonChange?.(event, page);\n\t\tif (!event.defaultPrevented) setCurrentPage?.(page);\n\t};\n\treturn {\n\t\t/** Number of steps */\n\t\tpages: pages.map(({ page, current }, index) => ({\n\t\t\t/**\n\t\t\t* Page number or \"ellipsis\" for the ellipsis item\n\t\t\t*/\n\t\t\tpage: page || \"ellipsis\",\n\t\t\t/**\n\t\t\t* Unique key for the item\n\t\t\t*/\n\t\t\titemKey: page ? `page-${page}` : `ellipsis-${index}`,\n\t\t\t/**\n\t\t\t* Properties to spread on Pagination.Button\n\t\t\t*/\n\t\t\tbuttonProps: page ? {\n\t\t\t\t\"aria-current\": current ? \"true\" : void 0,\n\t\t\t\tonClick: handleClick(page)\n\t\t\t} : null\n\t\t})),\n\t\t/** Properties to spread on Pagination.Button used for previous navigation */\n\t\tprevButtonProps: {\n\t\t\t\"aria-hidden\": !prev,\n\t\t\tonClick: handleClick(prev)\n\t\t},\n\t\t/** Properties to spread on Pagination.Button used for next navigation */\n\t\tnextButtonProps: {\n\t\t\t\"aria-hidden\": !next,\n\t\t\tonClick: handleClick(next)\n\t\t},\n\t\t/** Indication if previous page action should be shown or not */\n\t\thasPrev: !!prev,\n\t\t/** Indication if next page action should be shown or not */\n\t\thasNext: !!next\n\t};\n}, [\n\tcurrent,\n\ttotal,\n\tshow\n]);\n//#endregion\nexport { usePagination };\n", "'use client';\nimport { useId, useState } from \"react\";\n//#region src/utilities/hooks/use-radio-group/use-radio-group.ts\n/**\n* useRadioGroup is used to group multiple <Radio> components\n* @example\n* const { getRadioProps, validationMessageProps, value, setValue } = useRadioGroup({\n* disabled: false,\n* error: 'Validation message text',\n* name: 'group-name',\n* onChange: (nextValue, prevValue) => {},\n* readOnly: false,\n* required: true,\n* value: '',\n* });\n*/\nfunction useRadioGroup(props) {\n\tconst { error, readOnly, required, disabled, name, onChange, value: initialValue = \"\" } = props || {};\n\tconst [groupValue, setGroupValue] = useState(initialValue);\n\tconst errorId = useId();\n\tconst namedId = useId();\n\tconst radioGroupName = name || namedId;\n\treturn {\n\t\t/**\n\t\t* Current value of the group.\n\t\t*/\n\t\tvalue: groupValue,\n\t\t/**\n\t\t* Set the value of the group.\n\t\t*\n\t\t* @param value string[]\n\t\t* @returns void\n\t\t*/\n\t\tsetValue: setGroupValue,\n\t\t/**\n\t\t* Props to send to the `Radio` component.\n\t\t* @example\n\t\t* <Radio label=\"Option 1\" {...getRadioProps('option-1')} />\n\t\t*/\n\t\tgetRadioProps: (propsOrValue) => {\n\t\t\tlet groupProps;\n\t\t\tif (props) {\n\t\t\t\tconst { onChange, error, ...rest } = props;\n\t\t\t\tgroupProps = rest;\n\t\t\t}\n\t\t\tconst { ref: forwardedRef = void 0, value = \"\", ...rest } = typeof propsOrValue === \"string\" ? { value: propsOrValue } : propsOrValue;\n\t\t\tconst handleRef = (element) => {\n\t\t\t\tif (element) element.checked = value === groupValue;\n\t\t\t\tif (forwardedRef) if (typeof forwardedRef === \"function\") forwardedRef(element);\n\t\t\t\telse forwardedRef.current = element;\n\t\t\t};\n\t\t\tconst handleChange = (e) => {\n\t\t\t\tif (e.target.name === radioGroupName) setGroupValue((prevValue) => {\n\t\t\t\t\tonChange?.(e.target.value, prevValue);\n\t\t\t\t\treturn e.target.value;\n\t\t\t\t});\n\t\t\t};\n\t\t\treturn {\n\t\t\t\t...groupProps,\n\t\t\t\t...rest,\n\t\t\t\tname: radioGroupName,\n\t\t\t\t\"aria-describedby\": `${error ? errorId : \"\"} ${rest[\"aria-describedby\"] || \"\"}`.trim() || void 0,\n\t\t\t\t\"aria-invalid\": !!error || rest[\"aria-invalid\"],\n\t\t\t\tvalue,\n\t\t\t\tref: handleRef,\n\t\t\t\trequired: required || rest.required,\n\t\t\t\treadOnly: readOnly || rest.readOnly,\n\t\t\t\tdisabled: disabled || rest.disabled,\n\t\t\t\tonChange: (e) => {\n\t\t\t\t\trest.onChange?.(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\thandleChange(e);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t\t/**\n\t\t* Props to send to the `ValidationMessage` component.\n\t\t*\n\t\t* @example\n\t\t* <ValidationMessage {...validationMessageProps} />\n\t\t*/\n\t\tvalidationMessageProps: {\n\t\t\tchildren: error,\n\t\t\thidden: !error,\n\t\t\tid: errorId\n\t\t}\n\t};\n}\n//#endregion\nexport { useRadioGroup };\n", "'use client';\nimport { useEffect, useLayoutEffect, useRef } from \"react\";\n//#region src/utilities/hooks/use-synchronized-animation/use-synchronized-animation.ts\nconst useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n/**\n* Synchronizes the css animation of multiple elements with the same `animationName`.\n*\n* @example\n* ```tsx\n* const ref = useSynchronizedAnimation<HTMLDivElement>('spin');\n*\n* <div\n* ref={ref}\n* />\n* ```\n*/\nfunction useSynchronizedAnimation(animationName) {\n\tconst ref = useRef(null);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tconst animations = document.getAnimations().filter((animation) => \"animationName\" in animation && animation.animationName === animationName);\n\t\tconst firstOfType = animations.find((animation) => \"animationName\" in animation && animation.animationName === animationName);\n\t\tconst myAnimation = animations.find((animation) => animation.effect?.target === ref.current);\n\t\tif (myAnimation && myAnimation === firstOfType) myAnimation.currentTime = 0;\n\t\tif (myAnimation && firstOfType?.currentTime && myAnimation !== firstOfType) myAnimation.currentTime = firstOfType.currentTime;\n\t\treturn () => {\n\t\t\tif (myAnimation && firstOfType?.currentTime) myAnimation.currentTime = firstOfType.currentTime;\n\t\t};\n\t}, [animationName]);\n\treturn ref;\n}\n//#endregion\nexport { useIsomorphicLayoutEffect, useSynchronizedAnimation };\n", "'use client';\nimport { useCallback, useMemo, useRef } from \"react\";\n//#region src/utilities/hooks/use-merge-refs/use-merge-refs.ts\n/**\n* Merges an array of refs into a single memoized callback ref or `null`.\n*/\nfunction useMergeRefs(refs) {\n\tconst cleanupRef = useRef(void 0);\n\tconst refEffect = useCallback((instance) => {\n\t\tconst cleanups = refs.map((ref) => {\n\t\t\tif (ref == null) return null;\n\t\t\tif (typeof ref === \"function\") {\n\t\t\t\tconst refCallback = ref;\n\t\t\t\tconst refCleanup = refCallback(instance);\n\t\t\t\treturn typeof refCleanup === \"function\" ? refCleanup : () => {\n\t\t\t\t\trefCallback(null);\n\t\t\t\t};\n\t\t\t}\n\t\t\tref.current = instance;\n\t\t\treturn () => {\n\t\t\t\tref.current = null;\n\t\t\t};\n\t\t});\n\t\treturn () => {\n\t\t\tfor (const refCleanup of cleanups) refCleanup?.();\n\t\t};\n\t}, refs);\n\treturn useMemo(() => {\n\t\tif (refs.every((ref) => ref == null)) return null;\n\t\treturn (value) => {\n\t\t\tif (cleanupRef.current) {\n\t\t\t\tcleanupRef.current();\n\t\t\t\tcleanupRef.current = void 0;\n\t\t\t}\n\t\t\tif (value != null) cleanupRef.current = refEffect(value);\n\t\t};\n\t}, refs);\n}\n//#endregion\nexport { useMergeRefs };\n", "'use client';\nimport { RovingFocusContext } from \"./roving-focus-root.js\";\nimport { useContext } from \"react\";\n//#region src/utilities/roving-focus/use-roving-focus.ts\n/**\n@deprecated useRovingFocus is deprecated.\nHandles props for `RovingFocus` in context with `RovingFocusRoot` */\nconst useRovingFocus = (value) => {\n\tconst { elements, getOrderedItems, setFocusableValue, focusableValue, onShiftTab, orientation } = useContext(RovingFocusContext);\n\treturn {\n\t\tgetOrderedItems,\n\t\tisFocusable: focusableValue === value,\n\t\torientation,\n\t\tgetRovingProps: (props) => ({\n\t\t\t...props,\n\t\t\tref: (element) => {\n\t\t\t\tif (element) elements.current.set(value, element);\n\t\t\t\telse elements.current.delete(value);\n\t\t\t},\n\t\t\tonKeyDown: (e) => {\n\t\t\t\tprops?.onKeyDown?.(e);\n\t\t\t\tif (e.shiftKey && e.key === \"Tab\") {\n\t\t\t\t\tonShiftTab();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonFocus: (e) => {\n\t\t\t\tprops?.onFocus?.(e);\n\t\t\t\tsetFocusableValue(value);\n\t\t\t},\n\t\t\t\"data-roving-tabindex-item\": true,\n\t\t\ttabIndex: focusableValue === value ? 0 : -1\n\t\t})\n\t};\n};\n//#endregion\nexport { useRovingFocus };\n", "'use client';\nimport { useMergeRefs } from \"../hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../hooks/index.js\";\nimport { useRovingFocus } from \"./use-roving-focus.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/utilities/roving-focus/roving-focus-item.tsx\n/** Get the next focusable RovingFocusItem */\nfunction getNextFocusableValue(items, value) {\n\tconst currIndex = items.findIndex((item) => item.value === value);\n\treturn items.at(currIndex === items.length - 1 ? 0 : currIndex + 1);\n}\n/** Get the previous focusable RovingFocusItem */\nfunction getPrevFocusableValue(items, value) {\n\tconst currIndex = items.findIndex((item) => item.value === value);\n\treturn items.at(currIndex === 0 ? -1 : currIndex - 1);\n}\n/** @deprecated RovingFocusItem is deprecated.*/\nconst RovingFocusItem = forwardRef(({ value, asChild, ...rest }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\tconst focusValue = value ?? (typeof rest.children === \"string\" ? rest.children : \"\");\n\tconst { getOrderedItems, getRovingProps, orientation } = useRovingFocus(focusValue);\n\tconst rovingProps = getRovingProps({ onKeyDown: (e) => {\n\t\trest?.onKeyDown?.(e);\n\t\tconst items = getOrderedItems();\n\t\tlet nextItem;\n\t\tswitch (orientation) {\n\t\t\tcase \"horizontal\":\n\t\t\t\tif (e.key === \"ArrowRight\") nextItem = getNextFocusableValue(items, focusValue);\n\t\t\t\tif (e.key === \"ArrowLeft\") nextItem = getPrevFocusableValue(items, focusValue);\n\t\t\t\tbreak;\n\t\t\tcase \"vertical\":\n\t\t\t\tif (e.key === \"ArrowDown\") nextItem = getNextFocusableValue(items, focusValue);\n\t\t\t\tif (e.key === \"ArrowUp\") nextItem = getPrevFocusableValue(items, focusValue);\n\t\t\t\tbreak;\n\t\t\tcase \"ambiguous\":\n\t\t\t\tif ([\"ArrowRight\", \"ArrowDown\"].includes(e.key)) nextItem = getNextFocusableValue(items, focusValue);\n\t\t\t\tif ([\"ArrowLeft\", \"ArrowUp\"].includes(e.key)) nextItem = getPrevFocusableValue(items, focusValue);\n\t\t}\n\t\tif (e.key === \"Home\") nextItem = items[0];\n\t\tif (e.key === \"End\") nextItem = items[items.length - 1];\n\t\tif (nextItem) {\n\t\t\te.preventDefault();\n\t\t\tnextItem.element.focus();\n\t\t}\n\t} });\n\tconst mergedRefs = useMergeRefs([ref, rovingProps.ref]);\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\t...rest,\n\t\t...rovingProps,\n\t\tref: mergedRefs,\n\t\tchildren: rest.children\n\t});\n});\n//#endregion\nexport { RovingFocusItem, getNextFocusableValue, getPrevFocusableValue };\n", "'use client';\nimport { useDebounceCallback } from \"./hooks/deprecated/use-debounce-callback/use-debounce-callback.js\";\nimport { useIsomorphicLayoutEffect } from \"./hooks/deprecated/use-isomorphic-layout-effect/use-isomorphic-layout-effect.js\";\nimport { useMediaQuery } from \"./hooks/deprecated/use-media-query/use-media-query.js\";\nimport { useCheckboxGroup } from \"./hooks/use-checkbox-group/use-checkbox-group.js\";\nimport { usePagination } from \"./hooks/use-pagination/use-pagination.js\";\nimport { useRadioGroup } from \"./hooks/use-radio-group/use-radio-group.js\";\nimport { useSynchronizedAnimation } from \"./hooks/use-synchronized-animation/use-synchronized-animation.js\";\nimport \"./hooks/index.js\";\nimport { RovingFocusRoot } from \"./roving-focus/roving-focus-root.js\";\nimport \"./roving-focus/use-roving-focus.js\";\nimport { RovingFocusItem } from \"./roving-focus/roving-focus-item.js\";\n//#region src/utilities/index.ts\nconst warn = (message, ...args) => typeof window === \"undefined\" || window.dsWarnings === false || console.warn(`Designsystemet: ${message}`, ...args);\n//#endregion\nexport { RovingFocusItem, RovingFocusRoot, useCheckboxGroup, useDebounceCallback, useIsomorphicLayoutEffect, useMediaQuery, usePagination, useRadioGroup, useSynchronizedAnimation, warn };\n", "'use client';\nimport { useMergeRefs } from \"../hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../hooks/index.js\";\nimport { warn } from \"../index.js\";\nimport { createContext, forwardRef, useEffect, useRef, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/utilities/roving-focus/roving-focus-root.tsx\nconst RovingFocusContext = createContext({\n\telements: { current: /* @__PURE__ */ new Map() },\n\tgetOrderedItems: () => [],\n\tsetFocusableValue: () => {},\n\tonShiftTab: () => {},\n\tfocusableValue: null,\n\torientation: \"horizontal\"\n});\n/** @deprecated RovingFocusRoot is deprecated. */\nconst RovingFocusRoot = forwardRef(({ activeValue, asChild, orientation = \"horizontal\", onBlur, onFocus, ...rest }, ref) => {\n\tconst Component = asChild ? Slot : \"div\";\n\tconst activeValueOrNull = activeValue ?? null;\n\tconst [focusableValue, setFocusableValue] = useState(activeValueOrNull);\n\tconst [isShiftTabbing, setIsShiftTabbing] = useState(false);\n\tconst elements = useRef(/* @__PURE__ */ new Map());\n\tconst myRef = useRef(null);\n\tconst refs = useMergeRefs([ref, myRef]);\n\tconst getOrderedItems = () => {\n\t\tif (!myRef.current) return [];\n\t\tconst elementsFromDOM = Array.from(myRef.current.querySelectorAll(\"[data-roving-tabindex-item]\"));\n\t\treturn Array.from(elements.current).sort((a, b) => elementsFromDOM.indexOf(a[1]) - elementsFromDOM.indexOf(b[1])).map(([value, element]) => ({\n\t\t\tvalue,\n\t\t\telement\n\t\t}));\n\t};\n\tuseEffect(() => {\n\t\tsetFocusableValue(activeValueOrNull);\n\t}, [activeValueOrNull]);\n\twarn(\"RovingFocusRoot is deprecated.\");\n\treturn /* @__PURE__ */ jsx(RovingFocusContext.Provider, {\n\t\tvalue: {\n\t\t\telements,\n\t\t\tgetOrderedItems,\n\t\t\tfocusableValue,\n\t\t\tsetFocusableValue,\n\t\t\tonShiftTab: () => {\n\t\t\t\tsetIsShiftTabbing(true);\n\t\t\t},\n\t\t\torientation\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsx(Component, {\n\t\t\t...rest,\n\t\t\ttabIndex: isShiftTabbing ? -1 : 0,\n\t\t\tonBlur: (e) => {\n\t\t\t\tonBlur?.(e);\n\t\t\t\tsetIsShiftTabbing(false);\n\t\t\t\tsetFocusableValue(activeValue ?? null);\n\t\t\t},\n\t\t\tonFocus: (e) => {\n\t\t\t\tonFocus?.(e);\n\t\t\t\tif (e.target !== e.currentTarget) return;\n\t\t\t\tconst orderedItems = getOrderedItems();\n\t\t\t\tif (orderedItems.length === 0) return;\n\t\t\t\tif (focusableValue != null) elements.current.get(focusableValue)?.focus();\n\t\t\t\telse if (activeValue != null) elements.current.get(activeValue)?.focus();\n\t\t\t\telse orderedItems.at(0)?.element.focus();\n\t\t\t},\n\t\t\tref: refs\n\t\t})\n\t});\n});\n//#endregion\nexport { RovingFocusContext, RovingFocusRoot };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport { useSynchronizedAnimation } from \"../../utilities/hooks/use-synchronized-animation/use-synchronized-animation.js\";\nimport \"../../utilities/hooks/index.js\";\nimport \"../../utilities/index.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/spinner/spinner.tsx\n/**\n* Spinner component used for indicating busy or indeterminate loading.\n*\n* @example\n* <Spinner aria-label='Loading users...' />\n*/\nconst Spinner = forwardRef(function Spinner({ \"aria-label\": ariaLabel, className, ...rest }, ref) {\n\tconst svgRef = useSynchronizedAnimation(\"ds-spinner-rotate-animation\");\n\tconst strokeRef = useSynchronizedAnimation(\"ds-spinner-stroke-animation\");\n\tconst mergedRefs = useMergeRefs([svgRef, ref]);\n\treturn /* @__PURE__ */ jsxs(\"svg\", {\n\t\t\"aria-label\": ariaLabel,\n\t\tclassName: cl(\"ds-spinner\", className),\n\t\tref: mergedRefs,\n\t\trole: \"img\",\n\t\tviewBox: \"0 0 50 50\",\n\t\t...rest,\n\t\tchildren: [/* @__PURE__ */ jsx(\"circle\", {\n\t\t\tclassName: cl(\"ds-spinner__background\"),\n\t\t\tcx: \"25\",\n\t\t\tcy: \"25\",\n\t\t\tr: \"20\",\n\t\t\tfill: \"none\",\n\t\t\tstrokeWidth: \"5\"\n\t\t}), /* @__PURE__ */ jsx(\"circle\", {\n\t\t\tclassName: cl(`ds-spinner__circle`),\n\t\t\tcx: \"25\",\n\t\t\tcy: \"25\",\n\t\t\tr: \"20\",\n\t\t\tfill: \"none\",\n\t\t\tstrokeWidth: \"5\",\n\t\t\tref: strokeRef\n\t\t})]\n\t});\n});\n//#endregion\nexport { Spinner };\n", "'use client';\nimport { Spinner } from \"../spinner/spinner.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, version } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n//#region src/components/button/button.tsx\n/**\n* Button used for interaction\n*\n* @example\n* <Button>Click me</Button>\n*/\nconst Button = forwardRef(function Button({ asChild, className, children, icon = false, loading = false, variant, popoverTarget, popovertarget, commandfor, commandFor, ...rest }, ref) {\n\tconst Component = asChild ? Slot : \"button\";\n\tconst popoverVal = popoverTarget ?? popovertarget;\n\tconst popoverKey = version.startsWith(\"19\") ? \"popoverTarget\" : \"popovertarget\";\n\tconst commandForVal = commandFor ?? commandfor;\n\treturn /* @__PURE__ */ jsxs(Component, {\n\t\tsuppressHydrationWarning: true,\n\t\t\"aria-busy\": Boolean(loading) || void 0,\n\t\tclassName: cl(\"ds-button\", className),\n\t\t\"data-icon\": icon || void 0,\n\t\tcommandfor: commandForVal,\n\t\t\"data-variant\": variant,\n\t\tref,\n\t\ttype: asChild ? void 0 : \"button\",\n\t\t[popoverKey]: popoverVal,\n\t\t...rest,\n\t\tchildren: [loading === true ? /* @__PURE__ */ jsx(Spinner, { \"aria-hidden\": \"true\" }) : loading, /* @__PURE__ */ jsx(Slottable, { children: icon && loading ? null : children })]\n\t});\n});\n//#endregion\nexport { Button };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/label/label.tsx\n/**\n* Use `Label` for labels. Renders a native `label` element.\n*\n* @example\n* <Label data-size='lg' weight='medium'>Label</Label>\n*/\nconst Label = forwardRef(function Label({ className, weight, asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"label\", {\n\t\tref,\n\t\tclassName: cl(\"ds-label\", className),\n\t\tsuppressHydrationWarning: true,\n\t\t\"data-weight\": weight,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Label };\n", "'use client';\n//#region src/components/Combobox/omit/omit.ts\n/**\n* @deprecated This function is deprecated. Use suggest using `omit` from dedicated utiility libraries or create your own utility function.\n*\n* Returns a partial copy of an object omitting the keys specified.\n* @param {Array} names an array of String property names to omit from the new object\n* @param {Object} obj The object to copy from\n* @return {Object} A new object with properties from `names` not on it.\n* @example omit(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, c: 3}\n*/\nconst omit = (names, obj) => {\n\tconst result = {};\n\tconst index = {};\n\tlet idx = 0;\n\tconst len = names.length;\n\twhile (idx < len) {\n\t\tindex[names[idx]] = 1;\n\t\tidx += 1;\n\t}\n\tfor (const prop in obj) if (!Object.hasOwn(index, prop)) result[prop] = obj[prop];\n\treturn result;\n};\n//#endregion\nexport { omit };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/validation-message/validation-message.tsx\n/**\n* Use `ValidationMessage` to display validation text\n*\n* @example\n* <ValidationMessage>This is a danger validation message</ValidationMessage>\n*/\nconst ValidationMessage = forwardRef(function ValidationMessage({ className, asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"p\", {\n\t\tclassName: cl(\"ds-validation-message\", className),\n\t\t\"data-field\": \"validation\",\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { ValidationMessage };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/paragraph/paragraph.tsx\n/**\n* Use `Paragraph` to display text with paragraph text styles.\n* Renders a native `p` element.\n*\n* @example\n* <Paragraph data-size='lg'>Paragraph</Paragraph>\n*/\nconst Paragraph = forwardRef(function Paragraph({ className, asChild, variant, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"p\", {\n\t\tref,\n\t\tclassName: cl(`ds-paragraph`, className),\n\t\t\"data-variant\": variant,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Paragraph };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/input/input.tsx\n/**\n* Input renders a native `input` element.\n*\n* @example\n* <Input />\n*/\nconst Input = forwardRef(function Input({ type = \"text\", className, onChange, onClick, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"input\", {\n\t\tclassName: cl(`ds-input`, className),\n\t\tref,\n\t\ttype,\n\t\tsuppressHydrationWarning: true,\n\t\tonChange: (event) => rest.readOnly || onChange?.(event),\n\t\tonClick: (event) => {\n\t\t\tif (rest.readOnly) event.preventDefault();\n\t\t\tonClick?.(event);\n\t\t},\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Input };\n", "'use client';\nimport { Input } from \"../input/input.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { Slot, Slottable } from \"@radix-ui/react-slot\";\n//#region src/components/chip/chips.tsx\n/**\n* Chip.Button used for interaction\n*\n* @example\n* <Chip.Button>Click me</Chip.Button>\n*/\nconst ChipButton = forwardRef(function ChipButton({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"button\", {\n\t\tclassName: cl(\"ds-chip\", className),\n\t\ttype: asChild ? void 0 : \"button\",\n\t\tref,\n\t\t...rest\n\t});\n});\n/**\n* Chip.Removable used for interaction\n* @example\n* <Chip.Removable>Click to remove me</Chip.Removable>\n*/\nconst ChipRemovable = forwardRef(function ChipRemovable(props, ref) {\n\treturn /* @__PURE__ */ jsx(ChipButton, {\n\t\t\"data-removable\": true,\n\t\tref,\n\t\t...props\n\t});\n});\n/**\n* Chip.Checkbox used for multiselection\n* @example\n* <Chip.Checkbox name=\"language\" value=\"nynorsk\">Nynorsk</Chip.Checkbox>\n* <Chip.Checkbox name=\"language\" value=\"bokm\u00E5l\">Bokm\u00E5l</Chip.Checkbox>\n*/\nconst ChipCheckbox = forwardRef(function ChipCheckbox({ asChild, children, className, \"data-color\": color, \"data-size\": size, \"data-wrap\": wrap, ...rest }, ref) {\n\tconst inputType = rest.type ?? \"checkbox\";\n\treturn /* @__PURE__ */ jsxs(asChild ? Slot : \"label\", {\n\t\tclassName: cl(\"ds-chip\", className),\n\t\t\"data-color\": color,\n\t\t\"data-size\": size,\n\t\t\"data-wrap\": wrap,\n\t\tref,\n\t\tchildren: [/* @__PURE__ */ jsx(Input, {\n\t\t\t...rest,\n\t\t\ttype: inputType\n\t\t}), /* @__PURE__ */ jsx(Slottable, { children })]\n\t});\n});\n/**\n* Chip.Radio used for single selection\n* @example\n* <Chip.Radio name=\"language\" value=\"nynorsk\">Nynorsk</Chip.Radio>\n* <Chip.Radio name=\"language\" value=\"bokm\u00E5l\">Bokm\u00E5l</Chip.Radio>\n*/\nconst ChipRadio = forwardRef(function ChipRadio(props, ref) {\n\treturn /* @__PURE__ */ jsx(ChipCheckbox, {\n\t\tref,\n\t\ttype: \"radio\",\n\t\t...props\n\t});\n});\n//#endregion\nexport { ChipButton, ChipCheckbox, ChipRadio, ChipRemovable };\n", "'use client';\nimport { ChipButton, ChipCheckbox, ChipRadio, ChipRemovable } from \"./chips.js\";\n//#region src/components/chip/index.ts\nconst ChipComponent = {\n\tButton: ChipButton,\n\tCheckbox: ChipCheckbox,\n\tRadio: ChipRadio,\n\tRemovable: ChipRemovable\n};\nChipComponent.Button.displayName = \"Chip.Button\";\nChipComponent.Checkbox.displayName = \"Chip.Checkbox\";\nChipComponent.Radio.displayName = \"Chip.Radio\";\nChipComponent.Removable.displayName = \"Chip.Removable\";\n//#endregion\nexport { ChipComponent as Chip, ChipButton, ChipCheckbox, ChipRadio, ChipRemovable };\n", "'use client';\nimport { createContext } from \"react\";\n//#region src/components/Combobox/ComboboxContext.tsx\nconst ComboboxContext = createContext(void 0);\n//#endregion\nexport { ComboboxContext };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/Combobox/Option/Description.tsx\nconst ComboboxOptionDescription = forwardRef(({ children, className, ...rest }, ref) => {\n\treturn /* @__PURE__ */ jsx(\"span\", {\n\t\tclassName: cl(\"ds-combobox__option__description\", className),\n\t\tref,\n\t\t...rest,\n\t\tchildren\n\t});\n});\nComboboxOptionDescription.displayName = \"ComboboxOptionDescription\";\n//#endregion\nexport { ComboboxOptionDescription as default };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { CheckmarkIcon } from \"@navikt/aksel-icons\";\n//#region src/components/Combobox/Option/SelectedIcon.tsx\nconst SelectedIcon = ({ multiple, selected }) => {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: cl(multiple && \"ds-combobox__option__icon-wrapper\", selected && \"ds-combobox__option__icon-wrapper--selected\"),\n\t\tchildren: selected && /* @__PURE__ */ jsx(CheckmarkIcon, {\n\t\t\tclassName: \"ds-combobox__option__icon-wrapper__icon\",\n\t\t\t\"aria-hidden\": true\n\t\t})\n\t});\n};\nSelectedIcon.displayName = \"SelectedIcon\";\n//#endregion\nexport { SelectedIcon };\n", "'use client';\nimport { createContext, useContext, useReducer } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/Combobox/ComboboxIdContext.tsx\nconst ComboboxIdContext = createContext({ activeIndex: 0 });\nconst ComboboxIdReducer = (state, action) => {\n\tswitch (action.type) {\n\t\tcase \"SET_ACTIVE_INDEX\": return {\n\t\t\t...state,\n\t\t\tactiveIndex: action.payload\n\t\t};\n\t\tdefault: return state;\n\t}\n};\nconst ComboboxIdDispatch = createContext(() => {\n\tthrow new Error(\"ComboboxIdDispatch must be used within a provider\");\n});\nconst ComboboxIdProvider = ({ children }) => {\n\tconst [state, dispatch] = useReducer(ComboboxIdReducer, { activeIndex: 0 });\n\treturn /* @__PURE__ */ jsx(ComboboxIdContext.Provider, {\n\t\tvalue: state,\n\t\tchildren: /* @__PURE__ */ jsx(ComboboxIdDispatch.Provider, {\n\t\t\tvalue: dispatch,\n\t\t\tchildren\n\t\t})\n\t});\n};\nfunction useComboboxIdDispatch() {\n\treturn useContext(ComboboxIdDispatch);\n}\nfunction useComboboxId() {\n\treturn useContext(ComboboxIdContext);\n}\n//#endregion\nexport { ComboboxIdContext, ComboboxIdDispatch, ComboboxIdProvider, ComboboxIdReducer, useComboboxId, useComboboxIdDispatch };\n", "'use client';\nimport { ComboboxContext } from \"./ComboboxContext.js\";\nimport { useComboboxId } from \"./ComboboxIdContext.js\";\nimport { Label } from \"../label/label.js\";\nimport { omit } from \"./omit/omit.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useContext, useId, useMemo } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useMergeRefs } from \"@floating-ui/react\";\n//#region src/components/Combobox/Custom.tsx\nconst ComboboxCustom = forwardRef(({ asChild, interactive, id, className, ...rest }, ref) => {\n\tif (interactive && !id) throw new Error(\"If ComboboxCustom is interactive, it must have an id\");\n\tconst Component = asChild ? Slot : \"div\";\n\tconst randomId = useId();\n\tconst { activeIndex } = useComboboxId();\n\tconst context = useContext(ComboboxContext);\n\tif (!context) throw new Error(\"ComboboxCustom must be used within a Combobox\");\n\tconst { customIds, setListRef, getItemProps, size } = context;\n\tconst index = useMemo(() => id && customIds.indexOf(id) || 0, [id, customIds]);\n\treturn /* @__PURE__ */ jsx(Label, {\n\t\t\"data-size\": size,\n\t\tasChild: true,\n\t\tchildren: /* @__PURE__ */ jsx(Component, {\n\t\t\tref: useMergeRefs([(node) => {\n\t\t\t\tsetListRef(index, node);\n\t\t\t}, ref]),\n\t\t\ttabIndex: -1,\n\t\t\tclassName: cl(\"ds-combobox__custom\", className),\n\t\t\tid: id || randomId,\n\t\t\trole: \"option\",\n\t\t\t\"aria-selected\": activeIndex === index,\n\t\t\t\"data-active\": activeIndex === index,\n\t\t\t...omit([\"interactive\"], rest),\n\t\t\t...omit([\"onClick\", \"onPointerLeave\"], getItemProps())\n\t\t})\n\t});\n});\n//#endregion\nexport { ComboboxCustom };\n", "import * as React from 'react';\nimport { useLayoutEffect, useEffect, useRef } from 'react';\nimport { stopEvent, getDocument, isMouseLikePointerType, contains, activeElement, isSafari, isTypeableCombobox, isVirtualClick, isVirtualPointerEvent, getTarget, getPlatform, isTypeableElement, isReactEvent, isRootElement, isEventTargetWithin, isMac, getUserAgent } from '@floating-ui/react/utils';\nimport { floor, evaluate } from '@floating-ui/utils';\nimport { getComputedStyle, isElement, getNodeName, isHTMLElement, getWindow, isLastTraversableNode, getParentNode } from '@floating-ui/utils/dom';\nimport { tabbable, isTabbable } from 'tabbable';\nimport * as ReactDOM from 'react-dom';\nimport { getOverflowAncestors, useFloating as useFloating$1, offset, detectOverflow } from '@floating-ui/react-dom';\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/react-dom';\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/react-utils#usemergerefs\n */\nfunction useMergeRefs(refs) {\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return value => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}\n\n// https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\nconst SafeReact = {\n ...React\n};\n\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect = useInsertionEffect || (fn => fn());\nfunction useEffectEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n useSafeInsertionEffect(() => {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\nfunction isDifferentRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nfunction isIndexOutOfBounds(listRef, index) {\n return index < 0 || index >= listRef.current.length;\n}\nfunction getMinIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n disabledIndices\n });\n}\nfunction getMaxIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\nfunction findNonDisabledIndex(listRef, _temp) {\n let {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n } = _temp === void 0 ? {} : _temp;\n const list = listRef.current;\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isDisabled(list, index, disabledIndices));\n return index;\n}\nfunction getGridNavigatedIndex(elementsRef, _ref) {\n let {\n event,\n orientation,\n loop,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n } = _ref;\n let nextIndex = prevIndex;\n if (event.key === ARROW_UP) {\n stop && stopEvent(event);\n if (prevIndex === -1) {\n nextIndex = maxIndex;\n } else {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: nextIndex,\n amount: cols,\n decrement: true,\n disabledIndices\n });\n if (loop && (prevIndex - cols < minIndex || nextIndex < 0)) {\n const col = prevIndex % cols;\n const maxCol = maxIndex % cols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - cols;\n }\n }\n }\n if (isIndexOutOfBounds(elementsRef, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === ARROW_DOWN) {\n stop && stopEvent(event);\n if (prevIndex === -1) {\n nextIndex = minIndex;\n } else {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex,\n amount: cols,\n disabledIndices\n });\n if (loop && prevIndex + cols > maxIndex) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex % cols - cols,\n amount: cols,\n disabledIndices\n });\n }\n }\n if (isIndexOutOfBounds(elementsRef, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === ARROW_RIGHT) {\n stop && stopEvent(event);\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loop && isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n } else if (loop) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n if (isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === ARROW_LEFT) {\n stop && stopEvent(event);\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loop && isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n } else if (loop) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n if (isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfBounds(elementsRef, nextIndex)) {\n if (loop && lastRow) {\n nextIndex = event.key === ARROW_LEFT ? maxIndex : findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nfunction buildCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach((_ref2, index) => {\n let {\n width,\n height\n } = _ref2;\n if (width > cols) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\"[Floating UI]: Invalid grid - item width at index \" + index + \" is greater than grid columns\");\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex++;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nfunction getCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) return -1;\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nfunction getCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nfunction isDisabled(list, index, disabledIndices) {\n if (disabledIndices) {\n return disabledIndices.includes(index);\n }\n const element = list[index];\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}\n\nlet rafId = 0;\nfunction enqueueFocus(el, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n preventScroll = false,\n cancelPrevious = true,\n sync = false\n } = options;\n cancelPrevious && cancelAnimationFrame(rafId);\n const exec = () => el == null ? void 0 : el.focus({\n preventScroll\n });\n if (sync) {\n exec();\n } else {\n rafId = requestAnimationFrame(exec);\n }\n}\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nfunction sortByDocumentPosition(a, b) {\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1;\n }\n return 0;\n}\nfunction areMapsEqual(map1, map2) {\n if (map1.size !== map2.size) {\n return false;\n }\n for (const [key, value] of map1.entries()) {\n if (value !== map2.get(key)) {\n return false;\n }\n }\n return true;\n}\nconst FloatingListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n map: /*#__PURE__*/new Map(),\n elementsRef: {\n current: []\n }\n});\n/**\n * Provides context for a list of items within the floating element.\n * @see https://floating-ui.com/docs/FloatingList\n */\nfunction FloatingList(props) {\n const {\n children,\n elementsRef,\n labelsRef\n } = props;\n const [map, setMap] = React.useState(() => new Map());\n const register = React.useCallback(node => {\n setMap(prevMap => new Map(prevMap).set(node, null));\n }, []);\n const unregister = React.useCallback(node => {\n setMap(prevMap => {\n const map = new Map(prevMap);\n map.delete(node);\n return map;\n });\n }, []);\n index(() => {\n const newMap = new Map(map);\n const nodes = Array.from(newMap.keys()).sort(sortByDocumentPosition);\n nodes.forEach((node, index) => {\n newMap.set(node, index);\n });\n if (!areMapsEqual(map, newMap)) {\n setMap(newMap);\n }\n }, [map]);\n return /*#__PURE__*/React.createElement(FloatingListContext.Provider, {\n value: React.useMemo(() => ({\n register,\n unregister,\n map,\n elementsRef,\n labelsRef\n }), [register, unregister, map, elementsRef, labelsRef])\n }, children);\n}\n/**\n * Used to register a list item and its index (DOM position) in the\n * `FloatingList`.\n * @see https://floating-ui.com/docs/FloatingList#uselistitem\n */\nfunction useListItem(props) {\n if (props === void 0) {\n props = {};\n }\n const {\n label\n } = props;\n const {\n register,\n unregister,\n map,\n elementsRef,\n labelsRef\n } = React.useContext(FloatingListContext);\n const [index$1, setIndex] = React.useState(null);\n const componentRef = React.useRef(null);\n const ref = React.useCallback(node => {\n componentRef.current = node;\n if (index$1 !== null) {\n elementsRef.current[index$1] = node;\n if (labelsRef) {\n var _node$textContent;\n const isLabelDefined = label !== undefined;\n labelsRef.current[index$1] = isLabelDefined ? label : (_node$textContent = node == null ? void 0 : node.textContent) != null ? _node$textContent : null;\n }\n }\n }, [index$1, elementsRef, labelsRef, label]);\n index(() => {\n const node = componentRef.current;\n if (node) {\n register(node);\n return () => {\n unregister(node);\n };\n }\n }, [register, unregister]);\n index(() => {\n const index = componentRef.current ? map.get(componentRef.current) : null;\n if (index != null) {\n setIndex(index);\n }\n }, [map]);\n return React.useMemo(() => ({\n ref,\n index: index$1 == null ? -1 : index$1\n }), [index$1, ref]);\n}\n\nfunction renderJsx(render, computedProps) {\n if (typeof render === 'function') {\n return render(computedProps);\n }\n if (render) {\n return /*#__PURE__*/React.cloneElement(render, computedProps);\n }\n return /*#__PURE__*/React.createElement(\"div\", computedProps);\n}\nconst CompositeContext = /*#__PURE__*/React.createContext({\n activeIndex: 0,\n onNavigate: () => {}\n});\nconst horizontalKeys = [ARROW_LEFT, ARROW_RIGHT];\nconst verticalKeys = [ARROW_UP, ARROW_DOWN];\nconst allKeys = [...horizontalKeys, ...verticalKeys];\n\n/**\n * Creates a single tab stop whose items are navigated by arrow keys, which\n * provides list navigation outside of floating element contexts.\n *\n * This is useful to enable navigation of a list of items that aren\u2019t part of a\n * floating element. A menubar is an example of a composite, with each reference\n * element being an item.\n * @see https://floating-ui.com/docs/Composite\n */\nconst Composite = /*#__PURE__*/React.forwardRef(function Composite(props, forwardedRef) {\n const {\n render,\n orientation = 'both',\n loop = true,\n cols = 1,\n disabledIndices,\n activeIndex: externalActiveIndex,\n onNavigate: externalSetActiveIndex,\n itemSizes,\n dense = false,\n ...domProps\n } = props;\n const [internalActiveIndex, internalSetActiveIndex] = React.useState(0);\n const activeIndex = externalActiveIndex != null ? externalActiveIndex : internalActiveIndex;\n const onNavigate = useEffectEvent(externalSetActiveIndex != null ? externalSetActiveIndex : internalSetActiveIndex);\n const elementsRef = React.useRef([]);\n const renderElementProps = render && typeof render !== 'function' ? render.props : {};\n const contextValue = React.useMemo(() => ({\n activeIndex,\n onNavigate\n }), [activeIndex, onNavigate]);\n const isGrid = cols > 1;\n function handleKeyDown(event) {\n if (!allKeys.includes(event.key)) return;\n let nextIndex = activeIndex;\n const minIndex = getMinIndex(elementsRef, disabledIndices);\n const maxIndex = getMaxIndex(elementsRef, disabledIndices);\n if (isGrid) {\n const sizes = itemSizes || Array.from({\n length: elementsRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = buildCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isDisabled(elementsRef.current, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const maybeNextIndex = cellMap[getGridNavigatedIndex({\n current: cellMap.map(itemIndex => itemIndex ? elementsRef.current[itemIndex] : null)\n }, {\n event,\n orientation,\n loop,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getCellIndices([...(disabledIndices || elementsRef.current.map((_, index) => isDisabled(elementsRef.current, index) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getCellIndexOfCorner(activeIndex > maxIndex ? minIndex : activeIndex, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction we're\n // moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n event.key === ARROW_DOWN ? 'bl' : event.key === ARROW_RIGHT ? 'tr' : 'tl')\n })];\n if (maybeNextIndex != null) {\n nextIndex = maybeNextIndex;\n }\n }\n const toEndKeys = {\n horizontal: [ARROW_RIGHT],\n vertical: [ARROW_DOWN],\n both: [ARROW_RIGHT, ARROW_DOWN]\n }[orientation];\n const toStartKeys = {\n horizontal: [ARROW_LEFT],\n vertical: [ARROW_UP],\n both: [ARROW_LEFT, ARROW_UP]\n }[orientation];\n const preventedKeys = isGrid ? allKeys : {\n horizontal: horizontalKeys,\n vertical: verticalKeys,\n both: allKeys\n }[orientation];\n if (nextIndex === activeIndex && [...toEndKeys, ...toStartKeys].includes(event.key)) {\n if (loop && nextIndex === maxIndex && toEndKeys.includes(event.key)) {\n nextIndex = minIndex;\n } else if (loop && nextIndex === minIndex && toStartKeys.includes(event.key)) {\n nextIndex = maxIndex;\n } else {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: nextIndex,\n decrement: toStartKeys.includes(event.key),\n disabledIndices\n });\n }\n }\n if (nextIndex !== activeIndex && !isIndexOutOfBounds(elementsRef, nextIndex)) {\n event.stopPropagation();\n if (preventedKeys.includes(event.key)) {\n event.preventDefault();\n }\n onNavigate(nextIndex);\n\n // Wait for FocusManager `returnFocus` to execute.\n queueMicrotask(() => {\n enqueueFocus(elementsRef.current[nextIndex]);\n });\n }\n }\n const computedProps = {\n ...domProps,\n ...renderElementProps,\n ref: forwardedRef,\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n onKeyDown(e) {\n domProps.onKeyDown == null || domProps.onKeyDown(e);\n renderElementProps.onKeyDown == null || renderElementProps.onKeyDown(e);\n handleKeyDown(e);\n }\n };\n return /*#__PURE__*/React.createElement(CompositeContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(FloatingList, {\n elementsRef: elementsRef\n }, renderJsx(render, computedProps)));\n});\n/**\n * @see https://floating-ui.com/docs/Composite\n */\nconst CompositeItem = /*#__PURE__*/React.forwardRef(function CompositeItem(props, forwardedRef) {\n const {\n render,\n ...domProps\n } = props;\n const renderElementProps = render && typeof render !== 'function' ? render.props : {};\n const {\n activeIndex,\n onNavigate\n } = React.useContext(CompositeContext);\n const {\n ref,\n index\n } = useListItem();\n const mergedRef = useMergeRefs([ref, forwardedRef, renderElementProps.ref]);\n const isActive = activeIndex === index;\n const computedProps = {\n ...domProps,\n ...renderElementProps,\n ref: mergedRef,\n tabIndex: isActive ? 0 : -1,\n 'data-active': isActive ? '' : undefined,\n onFocus(e) {\n domProps.onFocus == null || domProps.onFocus(e);\n renderElementProps.onFocus == null || renderElementProps.onFocus(e);\n onNavigate(index);\n }\n };\n return renderJsx(render, computedProps);\n});\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nlet serverHandoffComplete = false;\nlet count = 0;\nconst genId = () => // Ensure the id is unique with multiple independent versions of Floating UI\n// on <React 18\n\"floating-ui-\" + Math.random().toString(36).slice(2, 6) + count++;\nfunction useFloatingId() {\n const [id, setId] = React.useState(() => serverHandoffComplete ? genId() : undefined);\n index(() => {\n if (id == null) {\n setId(genId());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n React.useEffect(() => {\n serverHandoffComplete = true;\n }, []);\n return id;\n}\nconst useReactId = SafeReact.useId;\n\n/**\n * Uses React 18's built-in `useId()` when available, or falls back to a\n * slightly less performant (requiring a double render) implementation for\n * earlier React versions.\n * @see https://floating-ui.com/docs/react-utils#useid\n */\nconst useId = useReactId || useFloatingId;\n\nlet devMessageSet;\nif (process.env.NODE_ENV !== \"production\") {\n devMessageSet = /*#__PURE__*/new Set();\n}\nfunction warn() {\n var _devMessageSet;\n for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n const message = \"Floating UI: \" + messages.join(' ');\n if (!((_devMessageSet = devMessageSet) != null && _devMessageSet.has(message))) {\n var _devMessageSet2;\n (_devMessageSet2 = devMessageSet) == null || _devMessageSet2.add(message);\n console.warn(message);\n }\n}\nfunction error() {\n var _devMessageSet3;\n for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n messages[_key2] = arguments[_key2];\n }\n const message = \"Floating UI: \" + messages.join(' ');\n if (!((_devMessageSet3 = devMessageSet) != null && _devMessageSet3.has(message))) {\n var _devMessageSet4;\n (_devMessageSet4 = devMessageSet) == null || _devMessageSet4.add(message);\n console.error(message);\n }\n}\n\n/**\n * Renders a pointing arrow triangle.\n * @see https://floating-ui.com/docs/FloatingArrow\n */\nconst FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props, ref) {\n const {\n context: {\n placement,\n elements: {\n floating\n },\n middlewareData: {\n arrow,\n shift\n }\n },\n width = 14,\n height = 7,\n tipRadius = 0,\n strokeWidth = 0,\n staticOffset,\n stroke,\n d,\n style: {\n transform,\n ...restStyle\n } = {},\n ...rest\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (!ref) {\n warn('The `ref` prop is required for `FloatingArrow`.');\n }\n }\n const clipPathId = useId();\n const [isRTL, setIsRTL] = React.useState(false);\n\n // https://github.com/floating-ui/floating-ui/issues/2932\n index(() => {\n if (!floating) return;\n const isRTL = getComputedStyle(floating).direction === 'rtl';\n if (isRTL) {\n setIsRTL(true);\n }\n }, [floating]);\n if (!floating) {\n return null;\n }\n const [side, alignment] = placement.split('-');\n const isVerticalSide = side === 'top' || side === 'bottom';\n let computedStaticOffset = staticOffset;\n if (isVerticalSide && shift != null && shift.x || !isVerticalSide && shift != null && shift.y) {\n computedStaticOffset = null;\n }\n\n // Strokes must be double the border width, this ensures the stroke's width\n // works as you'd expect.\n const computedStrokeWidth = strokeWidth * 2;\n const halfStrokeWidth = computedStrokeWidth / 2;\n const svgX = width / 2 * (tipRadius / -8 + 1);\n const svgY = height / 2 * tipRadius / 4;\n const isCustomShape = !!d;\n const yOffsetProp = computedStaticOffset && alignment === 'end' ? 'bottom' : 'top';\n let xOffsetProp = computedStaticOffset && alignment === 'end' ? 'right' : 'left';\n if (computedStaticOffset && isRTL) {\n xOffsetProp = alignment === 'end' ? 'left' : 'right';\n }\n const arrowX = (arrow == null ? void 0 : arrow.x) != null ? computedStaticOffset || arrow.x : '';\n const arrowY = (arrow == null ? void 0 : arrow.y) != null ? computedStaticOffset || arrow.y : '';\n const dValue = d || 'M0,0' + (\" H\" + width) + (\" L\" + (width - svgX) + \",\" + (height - svgY)) + (\" Q\" + width / 2 + \",\" + height + \" \" + svgX + \",\" + (height - svgY)) + ' Z';\n const rotation = {\n top: isCustomShape ? 'rotate(180deg)' : '',\n left: isCustomShape ? 'rotate(90deg)' : 'rotate(-90deg)',\n bottom: isCustomShape ? '' : 'rotate(180deg)',\n right: isCustomShape ? 'rotate(-90deg)' : 'rotate(90deg)'\n }[side];\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, rest, {\n \"aria-hidden\": true,\n ref: ref,\n width: isCustomShape ? width : width + computedStrokeWidth,\n height: width,\n viewBox: \"0 0 \" + width + \" \" + (height > width ? height : width),\n style: {\n position: 'absolute',\n pointerEvents: 'none',\n [xOffsetProp]: arrowX,\n [yOffsetProp]: arrowY,\n [side]: isVerticalSide || isCustomShape ? '100%' : \"calc(100% - \" + computedStrokeWidth / 2 + \"px)\",\n transform: \"\" + rotation + (transform != null ? transform : ''),\n ...restStyle\n }\n }), computedStrokeWidth > 0 && /*#__PURE__*/React.createElement(\"path\", {\n clipPath: \"url(#\" + clipPathId + \")\",\n fill: \"none\",\n stroke: stroke\n // Account for the stroke on the fill path rendered below.\n ,\n strokeWidth: computedStrokeWidth + (d ? 0 : 1),\n d: dValue\n }), /*#__PURE__*/React.createElement(\"path\", {\n stroke: computedStrokeWidth && !d ? rest.fill : 'none',\n d: dValue\n }), /*#__PURE__*/React.createElement(\"clipPath\", {\n id: clipPathId\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: -halfStrokeWidth,\n y: halfStrokeWidth * (isCustomShape ? -1 : 1),\n width: width + computedStrokeWidth,\n height: width\n })));\n});\n\nfunction createPubSub() {\n const map = new Map();\n return {\n emit(event, data) {\n var _map$get;\n (_map$get = map.get(event)) == null || _map$get.forEach(handler => handler(data));\n },\n on(event, listener) {\n map.set(event, [...(map.get(event) || []), listener]);\n },\n off(event, listener) {\n var _map$get2;\n map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter(l => l !== listener)) || []);\n }\n };\n}\n\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nconst useFloatingParentNodeId = () => {\n var _React$useContext;\n return ((_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;\n};\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nconst useFloatingTree = () => React.useContext(FloatingTreeContext);\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction useFloatingNodeId(customParentId) {\n const id = useId();\n const tree = useFloatingTree();\n const reactParentId = useFloatingParentNodeId();\n const parentId = customParentId || reactParentId;\n index(() => {\n const node = {\n id,\n parentId\n };\n tree == null || tree.addNode(node);\n return () => {\n tree == null || tree.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/React.createElement(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId])\n }, children);\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction FloatingTree(props) {\n const {\n children\n } = props;\n const nodesRef = React.useRef([]);\n const addNode = React.useCallback(node => {\n nodesRef.current = [...nodesRef.current, node];\n }, []);\n const removeNode = React.useCallback(node => {\n nodesRef.current = nodesRef.current.filter(n => n !== node);\n }, []);\n const events = React.useState(() => createPubSub())[0];\n return /*#__PURE__*/React.createElement(FloatingTreeContext.Provider, {\n value: React.useMemo(() => ({\n nodesRef,\n addNode,\n removeNode,\n events\n }), [addNode, removeNode, events])\n }, children);\n}\n\nfunction createAttribute(name) {\n return \"data-floating-ui-\" + name;\n}\n\nfunction useLatestRef(value) {\n const ref = useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\nconst safePolygonIdentifier = /*#__PURE__*/createAttribute('safe-polygon');\nfunction getDelay(value, prop, pointerType) {\n if (pointerType && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'number') {\n return value;\n }\n return value == null ? void 0 : value[prop];\n}\n/**\n * Opens the floating element while hovering over the reference element, like\n * CSS `:hover`.\n * @see https://floating-ui.com/docs/useHover\n */\nfunction useHover(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n elements\n } = context;\n const {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true\n } = props;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const handleCloseRef = useLatestRef(handleClose);\n const delayRef = useLatestRef(delay);\n const openRef = useLatestRef(open);\n const pointerTypeRef = React.useRef();\n const timeoutRef = React.useRef(-1);\n const handlerRef = React.useRef();\n const restTimeoutRef = React.useRef(-1);\n const blockMouseMoveRef = React.useRef(true);\n const performedPointerEventsMutationRef = React.useRef(false);\n const unbindMouseMoveRef = React.useRef(() => {});\n const isHoverOpen = React.useCallback(() => {\n var _dataRef$current$open;\n const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;\n return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';\n }, [dataRef]);\n\n // When closing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) return;\n function onOpenChange(_ref) {\n let {\n open\n } = _ref;\n if (!open) {\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n blockMouseMoveRef.current = true;\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n };\n }, [enabled, events]);\n React.useEffect(() => {\n if (!enabled) return;\n if (!handleCloseRef.current) return;\n if (!open) return;\n function onLeave(event) {\n if (isHoverOpen()) {\n onOpenChange(false, event, 'hover');\n }\n }\n const html = getDocument(elements.floating).documentElement;\n html.addEventListener('mouseleave', onLeave);\n return () => {\n html.removeEventListener('mouseleave', onLeave);\n };\n }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);\n const closeWithDelay = React.useCallback(function (event, runElseBranch, reason) {\n if (runElseBranch === void 0) {\n runElseBranch = true;\n }\n if (reason === void 0) {\n reason = 'hover';\n }\n const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);\n if (closeDelay && !handlerRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay);\n } else if (runElseBranch) {\n clearTimeout(timeoutRef.current);\n onOpenChange(false, event, reason);\n }\n }, [delayRef, onOpenChange]);\n const cleanupMouseMoveHandler = useEffectEvent(() => {\n unbindMouseMoveRef.current();\n handlerRef.current = undefined;\n });\n const clearPointerEvents = useEffectEvent(() => {\n if (performedPointerEventsMutationRef.current) {\n const body = getDocument(elements.floating).body;\n body.style.pointerEvents = '';\n body.removeAttribute(safePolygonIdentifier);\n performedPointerEventsMutationRef.current = false;\n }\n });\n\n // Registering the mouse events on the reference directly to bypass React's\n // delegation system. If the cursor was on a disabled element and then entered\n // the reference (no gap), `mouseenter` doesn't fire in the delegation system.\n React.useEffect(() => {\n if (!enabled) return;\n function isClickLikeOpenEvent() {\n return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;\n }\n function onMouseEnter(event) {\n clearTimeout(timeoutRef.current);\n blockMouseMoveRef.current = false;\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || restMs > 0 && !getDelay(delayRef.current, 'open')) {\n return;\n }\n const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);\n if (openDelay) {\n timeoutRef.current = window.setTimeout(() => {\n if (!openRef.current) {\n onOpenChange(true, event, 'hover');\n }\n }, openDelay);\n } else {\n onOpenChange(true, event, 'hover');\n }\n }\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) return;\n unbindMouseMoveRef.current();\n const doc = getDocument(elements.floating);\n clearTimeout(restTimeoutRef.current);\n if (handleCloseRef.current && dataRef.current.floatingContext) {\n // Prevent clearing `onScrollMouseLeave` timeout.\n if (!open) {\n clearTimeout(timeoutRef.current);\n }\n handlerRef.current = handleCloseRef.current({\n ...dataRef.current.floatingContext,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n closeWithDelay(event, true, 'safe-polygon');\n }\n });\n const handler = handlerRef.current;\n doc.addEventListener('mousemove', handler);\n unbindMouseMoveRef.current = () => {\n doc.removeEventListener('mousemove', handler);\n };\n return;\n }\n\n // Allow interactivity without `safePolygon` on touch devices. With a\n // pointer, a short close delay is an alternative, so it should work\n // consistently.\n const shouldClose = pointerTypeRef.current === 'touch' ? !contains(elements.floating, event.relatedTarget) : true;\n if (shouldClose) {\n closeWithDelay(event);\n }\n }\n\n // Ensure the floating element closes after scrolling even if the pointer\n // did not move.\n // https://github.com/floating-ui/floating-ui/discussions/1692\n function onScrollMouseLeave(event) {\n if (isClickLikeOpenEvent()) return;\n if (!dataRef.current.floatingContext) return;\n handleCloseRef.current == null || handleCloseRef.current({\n ...dataRef.current.floatingContext,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n closeWithDelay(event);\n }\n })(event);\n }\n if (isElement(elements.domReference)) {\n var _elements$floating;\n const ref = elements.domReference;\n open && ref.addEventListener('mouseleave', onScrollMouseLeave);\n (_elements$floating = elements.floating) == null || _elements$floating.addEventListener('mouseleave', onScrollMouseLeave);\n move && ref.addEventListener('mousemove', onMouseEnter, {\n once: true\n });\n ref.addEventListener('mouseenter', onMouseEnter);\n ref.addEventListener('mouseleave', onMouseLeave);\n return () => {\n var _elements$floating2;\n open && ref.removeEventListener('mouseleave', onScrollMouseLeave);\n (_elements$floating2 = elements.floating) == null || _elements$floating2.removeEventListener('mouseleave', onScrollMouseLeave);\n move && ref.removeEventListener('mousemove', onMouseEnter);\n ref.removeEventListener('mouseenter', onMouseEnter);\n ref.removeEventListener('mouseleave', onMouseLeave);\n };\n }\n }, [elements, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef]);\n\n // Block pointer-events of every element other than the reference and floating\n // while the floating element is open and has a `handleClose` handler. Also\n // handles nested floating elements.\n // https://github.com/floating-ui/floating-ui/issues/1722\n index(() => {\n var _handleCloseRef$curre;\n if (!enabled) return;\n if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {\n performedPointerEventsMutationRef.current = true;\n const floatingEl = elements.floating;\n if (isElement(elements.domReference) && floatingEl) {\n var _tree$nodesRef$curren;\n const body = getDocument(elements.floating).body;\n body.setAttribute(safePolygonIdentifier, '');\n const ref = elements.domReference;\n const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n body.style.pointerEvents = 'none';\n ref.style.pointerEvents = 'auto';\n floatingEl.style.pointerEvents = 'auto';\n return () => {\n body.style.pointerEvents = '';\n ref.style.pointerEvents = '';\n floatingEl.style.pointerEvents = '';\n };\n }\n }\n }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);\n index(() => {\n if (!open) {\n pointerTypeRef.current = undefined;\n cleanupMouseMoveHandler();\n clearPointerEvents();\n }\n }, [open, cleanupMouseMoveHandler, clearPointerEvents]);\n React.useEffect(() => {\n return () => {\n cleanupMouseMoveHandler();\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n clearPointerEvents();\n };\n }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);\n const reference = React.useMemo(() => {\n function setPointerRef(event) {\n pointerTypeRef.current = event.pointerType;\n }\n return {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove(event) {\n const {\n nativeEvent\n } = event;\n function handleMouseMove() {\n if (!blockMouseMoveRef.current && !openRef.current) {\n onOpenChange(true, nativeEvent, 'hover');\n }\n }\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {\n return;\n }\n if (open || restMs === 0) {\n return;\n }\n clearTimeout(restTimeoutRef.current);\n if (pointerTypeRef.current === 'touch') {\n handleMouseMove();\n } else {\n restTimeoutRef.current = window.setTimeout(handleMouseMove, restMs);\n }\n }\n };\n }, [mouseOnly, onOpenChange, open, openRef, restMs]);\n const floating = React.useMemo(() => ({\n onMouseEnter() {\n clearTimeout(timeoutRef.current);\n },\n onMouseLeave(event) {\n closeWithDelay(event.nativeEvent, false);\n }\n }), [closeWithDelay]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nconst NOOP = () => {};\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n delay: 0,\n initialDelay: 0,\n timeoutMs: 0,\n currentId: null,\n setCurrentId: NOOP,\n setState: NOOP,\n isInstantPhase: false\n});\n\n/**\n * @deprecated\n * Use the return value of `useDelayGroup()` instead.\n */\nconst useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);\n/**\n * Provides context for a group of floating elements that should share a\n * `delay`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction FloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const [state, setState] = React.useReducer((prev, next) => ({\n ...prev,\n ...next\n }), {\n delay,\n timeoutMs,\n initialDelay: delay,\n currentId: null,\n isInstantPhase: false\n });\n const initialCurrentIdRef = React.useRef(null);\n const setCurrentId = React.useCallback(currentId => {\n setState({\n currentId\n });\n }, []);\n index(() => {\n if (state.currentId) {\n if (initialCurrentIdRef.current === null) {\n initialCurrentIdRef.current = state.currentId;\n } else if (!state.isInstantPhase) {\n setState({\n isInstantPhase: true\n });\n }\n } else {\n if (state.isInstantPhase) {\n setState({\n isInstantPhase: false\n });\n }\n initialCurrentIdRef.current = null;\n }\n }, [state.currentId, state.isInstantPhase]);\n return /*#__PURE__*/React.createElement(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n ...state,\n setState,\n setCurrentId\n }), [state, setCurrentId])\n }, children);\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `FloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction useDelayGroup(context, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n open,\n onOpenChange,\n floatingId\n } = context;\n const {\n id: optionId\n } = options;\n const id = optionId != null ? optionId : floatingId;\n const groupContext = useDelayGroupContext();\n const {\n currentId,\n setCurrentId,\n initialDelay,\n setState,\n timeoutMs\n } = groupContext;\n index(() => {\n if (!currentId) return;\n setState({\n delay: {\n open: 1,\n close: getDelay(initialDelay, 'close')\n }\n });\n if (currentId !== id) {\n onOpenChange(false);\n }\n }, [id, onOpenChange, setState, currentId, initialDelay]);\n index(() => {\n function unset() {\n onOpenChange(false);\n setState({\n delay: initialDelay,\n currentId: null\n });\n }\n if (!currentId) return;\n if (!open && currentId === id) {\n if (timeoutMs) {\n const timeout = window.setTimeout(unset, timeoutMs);\n return () => {\n clearTimeout(timeout);\n };\n }\n unset();\n }\n }, [open, setState, currentId, id, onOpenChange, initialDelay, timeoutMs]);\n index(() => {\n if (setCurrentId === NOOP || !open) return;\n setCurrentId(id);\n }, [open, setCurrentId, id]);\n return groupContext;\n}\n\nfunction getAncestors(nodes, id) {\n var _nodes$find;\n let allAncestors = [];\n let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode == null ? void 0 : currentNode.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}\n\nfunction getChildren(nodes, id) {\n let allChildren = nodes.filter(node => {\n var _node$context;\n return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);\n });\n let currentChildren = allChildren;\n while (currentChildren.length) {\n currentChildren = nodes.filter(node => {\n var _currentChildren;\n return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {\n var _node$context2;\n return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);\n });\n });\n allChildren = allChildren.concat(currentChildren);\n }\n return allChildren;\n}\nfunction getDeepestNode(nodes, id) {\n let deepestNodeId;\n let maxDepth = -1;\n function findDeepest(nodeId, depth) {\n if (depth > maxDepth) {\n deepestNodeId = nodeId;\n maxDepth = depth;\n }\n const children = getChildren(nodes, nodeId);\n children.forEach(child => {\n findDeepest(child.id, depth + 1);\n });\n }\n findDeepest(id, 0);\n return nodes.find(node => node.id === deepestNodeId);\n}\n\n// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nlet counterMap = /*#__PURE__*/new WeakMap();\nlet uncontrolledElementsSet = /*#__PURE__*/new WeakSet();\nlet markerMap = {};\nlet lockCount = 0;\nconst supportsInert = () => typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;\nconst unwrapHost = node => node && (node.host || unwrapHost(node.parentNode));\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert) {\n const markerName = 'data-floating-ui-inert';\n const controlAttribute = inert ? 'inert' : ariaHidden ? 'aria-hidden' : null;\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const elementsToKeep = new Set();\n const elementsToStop = new Set(avoidElements);\n const hiddenElements = [];\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n const markerCounter = markerMap[markerName];\n avoidElements.forEach(keep);\n deep(body);\n elementsToKeep.clear();\n function keep(el) {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n elementsToKeep.add(el);\n el.parentNode && keep(el.parentNode);\n }\n function deep(parent) {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n [].forEach.call(parent.children, node => {\n if (getNodeName(node) === 'script') return;\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n const attr = controlAttribute ? node.getAttribute(controlAttribute) : null;\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledElementsSet.add(node);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n if (!alreadyHidden && controlAttribute) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n });\n }\n lockCount++;\n return () => {\n hiddenElements.forEach(element => {\n const counterValue = (counterMap.get(element) || 0) - 1;\n const markerValue = (markerCounter.get(element) || 0) - 1;\n counterMap.set(element, counterValue);\n markerCounter.set(element, markerValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet.has(element) && controlAttribute) {\n element.removeAttribute(controlAttribute);\n }\n uncontrolledElementsSet.delete(element);\n }\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n lockCount--;\n if (!lockCount) {\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledElementsSet = new WeakSet();\n markerMap = {};\n }\n };\n}\nfunction markOthers(avoidElements, ariaHidden, inert) {\n if (ariaHidden === void 0) {\n ariaHidden = false;\n }\n if (inert === void 0) {\n inert = false;\n }\n const body = getDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements.concat(Array.from(body.querySelectorAll('[aria-live]'))), body, ariaHidden, inert);\n}\n\nconst getTabbableOptions = () => ({\n getShadowRoot: true,\n displayCheck:\n // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === 'function' && ResizeObserver.toString().includes('[native code]') ? 'full' : 'none'\n});\nfunction getTabbableIn(container, direction) {\n const allTabbable = tabbable(container, getTabbableOptions());\n if (direction === 'prev') {\n allTabbable.reverse();\n }\n const activeIndex = allTabbable.indexOf(activeElement(getDocument(container)));\n const nextTabbableElements = allTabbable.slice(activeIndex + 1);\n return nextTabbableElements[0];\n}\nfunction getNextTabbable() {\n return getTabbableIn(document.body, 'next');\n}\nfunction getPreviousTabbable() {\n return getTabbableIn(document.body, 'prev');\n}\nfunction isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nfunction disableFocusInside(container) {\n const tabbableElements = tabbable(container, getTabbableOptions());\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nfunction enableFocusInside(container) {\n const elements = container.querySelectorAll('[data-tabindex]');\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}\nfunction getClosestTabbableElement(tabbableElements, element, floating) {\n const elementIndex = tabbableElements.indexOf(element);\n function traverseTabbableElements(next) {\n const attr = createAttribute('focus-guard');\n let index = elementIndex + (next ? 1 : 0);\n let currentElement = tabbableElements[index];\n while (currentElement && (!currentElement.isConnected || currentElement.hasAttribute(attr) || contains(floating, currentElement))) {\n if (next) {\n index++;\n } else {\n index--;\n }\n currentElement = tabbableElements[index];\n }\n return currentElement;\n }\n\n // First, try to find the next tabbable element\n const next = traverseTabbableElements(true);\n if (next) {\n return next;\n }\n\n // If we can't find a next tabbable element, try to find the previous one\n return traverseTabbableElements(false);\n}\n\n// See Diego Haz's Sandbox for making this logic work well on Safari/iOS:\n// https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/FocusTrap.tsx\n\nconst HIDDEN_STYLES = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'fixed',\n whiteSpace: 'nowrap',\n width: '1px',\n top: 0,\n left: 0\n};\nlet timeoutId;\nfunction setActiveElementOnTab(event) {\n if (event.key === 'Tab') {\n event.target;\n clearTimeout(timeoutId);\n }\n}\nconst FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n index(() => {\n if (isSafari()) {\n // Unlike other screen readers such as NVDA and JAWS, the virtual cursor\n // on VoiceOver does trigger the onFocus event, so we can use the focus\n // trap element. On Safari, only buttons trigger the onFocus event.\n // NB: \"group\" role in the Sandbox no longer appears to work, must be a\n // button role.\n setRole('button');\n }\n document.addEventListener('keydown', setActiveElementOnTab);\n return () => {\n document.removeEventListener('keydown', setActiveElementOnTab);\n };\n }, []);\n const restProps = {\n ref,\n tabIndex: 0,\n // Role is only for VoiceOver\n role,\n 'aria-hidden': role ? undefined : true,\n [createAttribute('focus-guard')]: '',\n style: HIDDEN_STYLES\n };\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, props, restProps));\n});\n\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nconst attr = /*#__PURE__*/createAttribute('portal');\n/**\n * @see https://floating-ui.com/docs/FloatingPortal#usefloatingportalnode\n */\nfunction useFloatingPortalNode(props) {\n if (props === void 0) {\n props = {};\n }\n const {\n id,\n root\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const [portalNode, setPortalNode] = React.useState(null);\n const portalNodeRef = React.useRef(null);\n index(() => {\n return () => {\n portalNode == null || portalNode.remove();\n // Allow the subsequent layout effects to create a new node on updates.\n // The portal node will still be cleaned up on unmount.\n // https://github.com/floating-ui/floating-ui/issues/2454\n queueMicrotask(() => {\n portalNodeRef.current = null;\n });\n };\n }, [portalNode]);\n index(() => {\n // Wait for the uniqueId to be generated before creating the portal node in\n // React <18 (using `useFloatingId` instead of the native `useId`).\n // https://github.com/floating-ui/floating-ui/issues/2778\n if (!uniqueId) return;\n if (portalNodeRef.current) return;\n const existingIdRoot = id ? document.getElementById(id) : null;\n if (!existingIdRoot) return;\n const subRoot = document.createElement('div');\n subRoot.id = uniqueId;\n subRoot.setAttribute(attr, '');\n existingIdRoot.appendChild(subRoot);\n portalNodeRef.current = subRoot;\n setPortalNode(subRoot);\n }, [id, uniqueId]);\n index(() => {\n if (!uniqueId) return;\n if (portalNodeRef.current) return;\n let container = root || (portalContext == null ? void 0 : portalContext.portalNode);\n if (container && !isElement(container)) container = container.current;\n container = container || document.body;\n let idWrapper = null;\n if (id) {\n idWrapper = document.createElement('div');\n idWrapper.id = id;\n container.appendChild(idWrapper);\n }\n const subRoot = document.createElement('div');\n subRoot.id = uniqueId;\n subRoot.setAttribute(attr, '');\n container = idWrapper || container;\n container.appendChild(subRoot);\n portalNodeRef.current = subRoot;\n setPortalNode(subRoot);\n }, [id, root, uniqueId, portalContext]);\n return portalNode;\n}\n/**\n * Portals the floating element into a given container element \u2014 by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n */\nfunction FloatingPortal(props) {\n const {\n children,\n id,\n root = null,\n preserveTabOrder = true\n } = props;\n const portalNode = useFloatingPortalNode({\n id,\n root\n });\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const modal = focusManagerState == null ? void 0 : focusManagerState.modal;\n const open = focusManagerState == null ? void 0 : focusManagerState.open;\n const shouldRenderGuards =\n // The FocusManager and therefore floating element are currently open/\n // rendered.\n !!focusManagerState &&\n // Guards are only for non-modal focus management.\n !focusManagerState.modal &&\n // Don't render if unmount is transitioning.\n focusManagerState.open && preserveTabOrder && !!(root || portalNode);\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || !preserveTabOrder || modal) {\n return;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && isOutsideEvent(event)) {\n const focusing = event.type === 'focusin';\n const manageFocus = focusing ? enableFocusInside : disableFocusInside;\n manageFocus(portalNode);\n }\n }\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n portalNode.addEventListener('focusin', onFocus, true);\n portalNode.addEventListener('focusout', onFocus, true);\n return () => {\n portalNode.removeEventListener('focusin', onFocus, true);\n portalNode.removeEventListener('focusout', onFocus, true);\n };\n }, [portalNode, preserveTabOrder, modal]);\n React.useEffect(() => {\n if (!portalNode) return;\n if (open) return;\n enableFocusInside(portalNode);\n }, [open, portalNode]);\n return /*#__PURE__*/React.createElement(PortalContext.Provider, {\n value: React.useMemo(() => ({\n preserveTabOrder,\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [preserveTabOrder, portalNode])\n }, shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _beforeInsideRef$curr;\n (_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus();\n } else {\n const prevTabbable = getPreviousTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n prevTabbable == null || prevTabbable.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(\"span\", {\n \"aria-owns\": portalNode.id,\n style: HIDDEN_STYLES\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _afterInsideRef$curre;\n (_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus();\n } else {\n const nextTabbable = getNextTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n nextTabbable == null || nextTabbable.focus();\n (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, 'focus-out'));\n }\n }\n }));\n}\nconst usePortalContext = () => React.useContext(PortalContext);\n\nconst FOCUSABLE_ATTRIBUTE = 'data-floating-ui-focusable';\nfunction getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(\"[\" + FOCUSABLE_ATTRIBUTE + \"]\") || floatingElement;\n}\n\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction addPreviouslyFocusedElement(element) {\n previouslyFocusedElements = previouslyFocusedElements.filter(el => el.isConnected);\n let tabbableEl = element;\n if (!tabbableEl || getNodeName(tabbableEl) === 'body') return;\n if (!isTabbable(tabbableEl, getTabbableOptions())) {\n const tabbableChild = tabbable(tabbableEl, getTabbableOptions())[0];\n if (tabbableChild) {\n tabbableEl = tabbableChild;\n }\n }\n previouslyFocusedElements.push(tabbableEl);\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n}\nfunction getPreviouslyFocusedElement() {\n return previouslyFocusedElements.slice().reverse().find(el => el.isConnected);\n}\nconst VisuallyHiddenDismiss = /*#__PURE__*/React.forwardRef(function VisuallyHiddenDismiss(props, ref) {\n return /*#__PURE__*/React.createElement(\"button\", _extends({}, props, {\n type: \"button\",\n ref: ref,\n tabIndex: -1,\n style: HIDDEN_STYLES\n }));\n});\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n */\nfunction FloatingFocusManager(props) {\n const {\n context,\n children,\n disabled = false,\n order = ['content'],\n guards: _guards = true,\n initialFocus = 0,\n returnFocus = true,\n restoreFocus = false,\n modal = true,\n visuallyHiddenDismiss = false,\n closeOnFocusOut = true\n } = props;\n const {\n open,\n refs,\n nodeId,\n onOpenChange,\n events,\n dataRef,\n floatingId,\n elements: {\n domReference,\n floating\n }\n } = context;\n const ignoreInitialFocus = typeof initialFocus === 'number' && initialFocus < 0;\n // If the reference is a combobox and is typeable (e.g. input/textarea),\n // there are different focus semantics. The guards should not be rendered, but\n // aria-hidden should be applied to all nodes still. Further, the visually\n // hidden dismiss button should only appear at the end of the list, not the\n // start.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n\n // Force the guards to be rendered if the `inert` attribute is not supported.\n const guards = supportsInert() ? _guards : true;\n const orderRef = useLatestRef(order);\n const initialFocusRef = useLatestRef(initialFocus);\n const returnFocusRef = useLatestRef(returnFocus);\n const tree = useFloatingTree();\n const portalContext = usePortalContext();\n const startDismissButtonRef = React.useRef(null);\n const endDismissButtonRef = React.useRef(null);\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const tabbableIndexRef = React.useRef(-1);\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useEffectEvent(function (container) {\n if (container === void 0) {\n container = floatingFocusElement;\n }\n return container ? tabbable(container, getTabbableOptions()) : [];\n });\n const getTabbableElements = useEffectEvent(container => {\n const content = getTabbableContent(container);\n return orderRef.current.map(type => {\n if (domReference && type === 'reference') {\n return domReference;\n }\n if (floatingFocusElement && type === 'floating') {\n return floatingFocusElement;\n }\n return content;\n }).filter(Boolean).flat();\n });\n React.useEffect(() => {\n preventReturnFocusRef.current = false;\n }, [disabled]);\n React.useEffect(() => {\n if (disabled) return;\n if (!modal) return;\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(getDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n const els = getTabbableElements();\n const target = getTarget(event);\n if (orderRef.current[0] === 'reference' && target === domReference) {\n stopEvent(event);\n if (event.shiftKey) {\n enqueueFocus(els[els.length - 1]);\n } else {\n enqueueFocus(els[1]);\n }\n }\n if (orderRef.current[1] === 'floating' && target === floatingFocusElement && event.shiftKey) {\n stopEvent(event);\n enqueueFocus(els[0]);\n }\n }\n }\n const doc = getDocument(floatingFocusElement);\n doc.addEventListener('keydown', onKeyDown);\n return () => {\n doc.removeEventListener('keydown', onKeyDown);\n };\n }, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]);\n React.useEffect(() => {\n if (disabled) return;\n if (!floating) return;\n function handleFocusIn(event) {\n const target = getTarget(event);\n const tabbableContent = getTabbableContent();\n const tabbableIndex = tabbableContent.indexOf(target);\n if (tabbableIndex !== -1) {\n tabbableIndexRef.current = tabbableIndex;\n }\n }\n floating.addEventListener('focusin', handleFocusIn);\n return () => {\n floating.removeEventListener('focusin', handleFocusIn);\n };\n }, [disabled, floating, getTabbableContent]);\n React.useEffect(() => {\n if (disabled) return;\n if (!closeOnFocusOut) return;\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n setTimeout(() => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n queueMicrotask(() => {\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute('focus-guard')) || tree && (getChildren(tree.nodesRef.current, nodeId).find(node => {\n var _node$context, _node$context2;\n return contains((_node$context = node.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains((_node$context2 = node.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget);\n }) || getAncestors(tree.nodesRef.current, nodeId).find(node => {\n var _node$context3, _node$context4;\n return ((_node$context3 = node.context) == null ? void 0 : _node$context3.elements.floating) === relatedTarget || ((_node$context4 = node.context) == null ? void 0 : _node$context4.elements.domReference) === relatedTarget;\n })));\n\n // Restore focus to the previous tabbable element index to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && movedToUnrelatedNode && activeElement(getDocument(floatingFocusElement)) === getDocument(floatingFocusElement).body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n }\n const prevTabbableIndex = tabbableIndexRef.current;\n const tabbableContent = getTabbableContent();\n const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current &&\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n relatedTarget !== getPreviouslyFocusedElement()) {\n preventReturnFocusRef.current = true;\n onOpenChange(false, event, 'focus-out');\n }\n });\n }\n if (floating && isHTMLElement(domReference)) {\n domReference.addEventListener('focusout', handleFocusOutside);\n domReference.addEventListener('pointerdown', handlePointerDown);\n floating.addEventListener('focusout', handleFocusOutside);\n return () => {\n domReference.removeEventListener('focusout', handleFocusOutside);\n domReference.removeEventListener('pointerdown', handlePointerDown);\n floating.removeEventListener('focusout', handleFocusOutside);\n };\n }\n }, [disabled, domReference, floating, floatingFocusElement, modal, nodeId, tree, portalContext, onOpenChange, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox]);\n React.useEffect(() => {\n var _portalContext$portal;\n if (disabled) return;\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll(\"[\" + createAttribute('portal') + \"]\")) || []);\n if (floating) {\n const insideElements = [floating, ...portalNodes, startDismissButtonRef.current, endDismissButtonRef.current, orderRef.current.includes('reference') || isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const cleanup = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, guards, !guards) : markOthers(insideElements);\n return () => {\n cleanup();\n };\n }\n }, [disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, guards]);\n index(() => {\n if (disabled || !isHTMLElement(floatingFocusElement)) return;\n const doc = getDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const focusableElements = getTabbableElements(floatingFocusElement);\n const initialFocusValue = initialFocusRef.current;\n const elToFocus = (typeof initialFocusValue === 'number' ? focusableElements[initialFocusValue] : initialFocusValue.current) || floatingFocusElement;\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (!ignoreInitialFocus && !focusAlreadyInsideFloatingEl && open) {\n enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floatingFocusElement\n });\n }\n });\n }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef]);\n index(() => {\n if (disabled || !floatingFocusElement) return;\n let preventReturnFocusScroll = false;\n const doc = getDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n const contextData = dataRef.current;\n let openEvent = contextData.openEvent;\n const domReference = refs.domReference.current;\n addPreviouslyFocusedElement(previouslyFocusedElement);\n\n // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n function onOpenChange(_ref) {\n let {\n open,\n reason,\n event,\n nested\n } = _ref;\n if (open) {\n openEvent = event;\n }\n if (reason === 'escape-key' && refs.domReference.current) {\n addPreviouslyFocusedElement(refs.domReference.current);\n }\n if (reason === 'hover' && event.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (reason !== 'outside-press') return;\n if (nested) {\n preventReturnFocusRef.current = false;\n preventReturnFocusScroll = true;\n } else {\n preventReturnFocusRef.current = !(isVirtualClick(event) || isVirtualPointerEvent(event));\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n const activeEl = activeElement(doc);\n const isFocusInsideFloatingTree = contains(floating, activeEl) || tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context5;\n return contains((_node$context5 = node.context) == null ? void 0 : _node$context5.elements.floating, activeEl);\n });\n const shouldFocusReference = isFocusInsideFloatingTree || openEvent && ['click', 'mousedown'].includes(openEvent.type);\n if (shouldFocusReference && refs.domReference.current) {\n addPreviouslyFocusedElement(refs.domReference.current);\n }\n const returnContextElement = domReference || previouslyFocusedElement;\n const tabbableElements = tabbable(getDocument(returnContextElement).body, getTabbableOptions());\n\n // Wait for the return element to get potentially disconnected before\n // checking.\n queueMicrotask(() => {\n let returnElement = getPreviouslyFocusedElement();\n if (!returnElement && isHTMLElement(returnContextElement) && floating) {\n returnElement = getClosestTabbableElement(tabbableElements, returnContextElement, floating);\n }\n if (\n // eslint-disable-next-line react-hooks/exhaustive-deps\n returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(returnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n returnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n returnElement.focus({\n preventScroll: preventReturnFocusScroll\n });\n }\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, refs, events, tree, nodeId]);\n\n // Synchronize the `context` & `modal` value to the FloatingPortal context.\n // It will decide whether or not it needs to render its own guards.\n index(() => {\n if (disabled) return;\n if (!portalContext) return;\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange,\n refs\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, onOpenChange, refs, closeOnFocusOut]);\n index(() => {\n if (disabled) return;\n if (!floatingFocusElement) return;\n if (typeof MutationObserver !== 'function') return;\n if (ignoreInitialFocus) return;\n const handleMutation = () => {\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n const tabbableContent = getTabbableContent();\n const activeEl = activeElement(getDocument(floating));\n const tabbableIndex = tabbableContent.indexOf(activeEl);\n if (tabbableIndex !== -1) {\n tabbableIndexRef.current = tabbableIndex;\n }\n if (orderRef.current.includes('floating') || activeEl !== refs.domReference.current && tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n }\n } else if (tabIndex !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n }\n };\n handleMutation();\n const observer = new MutationObserver(handleMutation);\n observer.observe(floatingFocusElement, {\n childList: true,\n subtree: true,\n attributes: true\n });\n return () => {\n observer.disconnect();\n };\n }, [disabled, floating, floatingFocusElement, refs, orderRef, getTabbableContent, ignoreInitialFocus]);\n function renderDismissButton(location) {\n if (disabled || !visuallyHiddenDismiss || !modal) {\n return null;\n }\n return /*#__PURE__*/React.createElement(VisuallyHiddenDismiss, {\n ref: location === 'start' ? startDismissButtonRef : endDismissButtonRef,\n onClick: event => onOpenChange(false, event.nativeEvent)\n }, typeof visuallyHiddenDismiss === 'string' ? visuallyHiddenDismiss : 'Dismiss');\n }\n const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/React.createElement(React.Fragment, null, shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"inside\",\n ref: portalContext == null ? void 0 : portalContext.beforeInsideRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableElements();\n enqueueFocus(order[0] === 'reference' ? els[0] : els[els.length - 1]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable() || domReference;\n nextTabbable == null || nextTabbable.focus();\n } else {\n var _portalContext$before;\n (_portalContext$before = portalContext.beforeOutsideRef.current) == null || _portalContext$before.focus();\n }\n }\n }\n }), !isUntrappedTypeableCombobox && renderDismissButton('start'), children, renderDismissButton('end'), shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"inside\",\n ref: portalContext == null ? void 0 : portalContext.afterInsideRef,\n onFocus: event => {\n if (modal) {\n enqueueFocus(getTabbableElements()[0]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable() || domReference;\n prevTabbable == null || prevTabbable.focus();\n } else {\n var _portalContext$afterO;\n (_portalContext$afterO = portalContext.afterOutsideRef.current) == null || _portalContext$afterO.focus();\n }\n }\n }\n }));\n}\n\nconst activeLocks = /*#__PURE__*/new Set();\n/**\n * Provides base styling for a fixed overlay element to dim content or block\n * pointer events behind a floating element.\n * It's a regular `<div>`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(props, ref) {\n const {\n lockScroll = false,\n ...rest\n } = props;\n const lockId = useId();\n index(() => {\n if (!lockScroll) return;\n activeLocks.add(lockId);\n const isIOS = /iP(hone|ad|od)|iOS/.test(getPlatform());\n const bodyStyle = document.body.style;\n // RTL <body> scrollbar\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX;\n const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY;\n bodyStyle.overflow = 'hidden';\n if (scrollbarWidth) {\n bodyStyle[paddingProp] = scrollbarWidth + \"px\";\n }\n\n // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n if (isIOS) {\n var _window$visualViewpor, _window$visualViewpor2;\n // iOS 12 does not support `visualViewport`.\n const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0;\n const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0;\n Object.assign(bodyStyle, {\n position: 'fixed',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0'\n });\n }\n return () => {\n activeLocks.delete(lockId);\n if (activeLocks.size === 0) {\n Object.assign(bodyStyle, {\n overflow: '',\n [paddingProp]: ''\n });\n if (isIOS) {\n Object.assign(bodyStyle, {\n position: '',\n top: '',\n left: '',\n right: ''\n });\n window.scrollTo(scrollX, scrollY);\n }\n }\n };\n }, [lockId, lockScroll]);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, rest, {\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n }));\n});\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nfunction useClick(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n elements: {\n domReference\n }\n } = context;\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true\n } = props;\n const pointerTypeRef = React.useRef();\n const didKeyDownRef = React.useRef(false);\n const reference = React.useMemo(() => ({\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) return;\n if (eventOption === 'click') return;\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;\n if (open && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n // Prevent stealing focus from the floating element\n event.preventDefault();\n onOpenChange(true, event.nativeEvent, 'click');\n }\n },\n onClick(event) {\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;\n if (open && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n },\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event)) {\n return;\n }\n if (event.key === ' ' && !isSpaceIgnored(domReference)) {\n // Prevent scrolling\n event.preventDefault();\n didKeyDownRef.current = true;\n }\n if (event.key === 'Enter') {\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n }\n },\n onKeyUp(event) {\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {\n return;\n }\n if (event.key === ' ' && didKeyDownRef.current) {\n didKeyDownRef.current = false;\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n }\n }\n }), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open, toggle]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nfunction createVirtualElement(domElement, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domElement || undefined,\n getBoundingClientRect() {\n var _data$dataRef$current;\n const domRect = (domElement == null ? void 0 : domElement.getBoundingClientRect()) || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(((_data$dataRef$current = data.dataRef.current.openEvent) == null ? void 0 : _data$dataRef$current.type) || '') && data.pointerType !== 'touch';\n let width = domRect.width;\n let height = domRect.height;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n width = 0;\n height = 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n width = data.axis === 'y' ? domRect.width : 0;\n height = data.axis === 'x' ? domRect.height : 0;\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n height = data.axis === 'x' ? domRect.height : height;\n width = data.axis === 'y' ? domRect.width : width;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nfunction useClientPoint(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n dataRef,\n elements: {\n floating,\n domReference\n },\n refs\n } = context;\n const {\n enabled = true,\n axis = 'both',\n x = null,\n y = null\n } = props;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const setReference = useEffectEvent((x, y) => {\n if (initialRef.current) return;\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n refs.setPositionReference(createVirtualElement(domReference, {\n x,\n y,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useEffectEvent(event => {\n if (x != null || y != null) return;\n if (!open) {\n setReference(event.clientX, event.clientY);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n const addListener = React.useCallback(() => {\n // Explicitly specified `x`/`y` coordinates shouldn't add a listener.\n if (!openCheck || !enabled || x != null || y != null) return;\n const win = getWindow(floating);\n function handleMouseMove(event) {\n const target = getTarget(event);\n if (!contains(floating, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n win.addEventListener('mousemove', handleMouseMove);\n const cleanup = () => {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n };\n cleanupListenerRef.current = cleanup;\n return cleanup;\n }\n refs.setPositionReference(domReference);\n }, [openCheck, enabled, x, y, floating, dataRef, refs, domReference, setReference]);\n React.useEffect(() => {\n return addListener();\n }, [addListener, reactive]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n index(() => {\n if (enabled && (x != null || y != null)) {\n initialRef.current = false;\n setReference(x, y);\n }\n }, [enabled, x, y, setReference]);\n const reference = React.useMemo(() => {\n function setPointerTypeRef(_ref) {\n let {\n pointerType\n } = _ref;\n setPointerType(pointerType);\n }\n return {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n };\n }, [handleReferenceEnterOrMove]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\nconst normalizeProp = normalizable => {\n var _normalizable$escapeK, _normalizable$outside;\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true\n };\n};\n/**\n * Closes the floating element when a dismissal is requested \u2014 by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nfunction useDismiss(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n elements,\n dataRef\n } = context;\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: unstable_outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles,\n capture\n } = props;\n const tree = useFloatingTree();\n const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === 'function' ? unstable_outsidePress : () => false);\n const outsidePress = typeof unstable_outsidePress === 'function' ? outsidePressFn : unstable_outsidePress;\n const insideReactTreeRef = React.useRef(false);\n const endedOrStartedInsideRef = React.useRef(false);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const {\n escapeKey: escapeKeyCapture,\n outsidePress: outsidePressCapture\n } = normalizeProp(capture);\n const closeOnEscapeKeyDown = useEffectEvent(event => {\n var _dataRef$current$floa;\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (!escapeKeyBubbles) {\n event.stopPropagation();\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context;\n if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n }\n onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event, 'escape-key');\n });\n const closeOnEscapeKeyDownCapture = useEffectEvent(event => {\n var _getTarget2;\n const callback = () => {\n var _getTarget;\n closeOnEscapeKeyDown(event);\n (_getTarget = getTarget(event)) == null || _getTarget.removeEventListener('keydown', callback);\n };\n (_getTarget2 = getTarget(event)) == null || _getTarget2.addEventListener('keydown', callback);\n });\n const closeOnPressOutside = useEffectEvent(event => {\n var _dataRef$current$floa2;\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = insideReactTreeRef.current;\n insideReactTreeRef.current = false;\n\n // When click outside is lazy (`click` event), handle dragging.\n // Don't close if:\n // - The click started inside the floating element.\n // - The click ended inside the floating element.\n const endedOrStartedInside = endedOrStartedInsideRef.current;\n endedOrStartedInsideRef.current = false;\n if (outsidePressEvent === 'click' && endedOrStartedInside) {\n return;\n }\n if (insideReactTree) {\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n const target = getTarget(event);\n const inertSelector = \"[\" + createAttribute('inert') + \"]\";\n const markers = getDocument(elements.floating).querySelectorAll(inertSelector);\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, elements.floating) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n Array.from(markers).every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n if (isHTMLElement(target) && floating) {\n // In Firefox, `target.scrollWidth > target.clientWidth` for inline\n // elements.\n const canScrollX = target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n let xCond = canScrollY && event.offsetX > target.clientWidth;\n\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n if (canScrollY) {\n const isRTL = getComputedStyle(target).direction === 'rtl';\n if (isRTL) {\n xCond = event.offsetX <= target.offsetWidth - target.clientWidth;\n }\n }\n if (xCond || canScrollX && event.offsetY > target.clientHeight) {\n return;\n }\n }\n const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;\n const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);\n });\n if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {\n return;\n }\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context2;\n if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n onOpenChange(false, event, 'outside-press');\n });\n const closeOnPressOutsideCapture = useEffectEvent(event => {\n var _getTarget4;\n const callback = () => {\n var _getTarget3;\n closeOnPressOutside(event);\n (_getTarget3 = getTarget(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback);\n };\n (_getTarget4 = getTarget(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback);\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n function onScroll(event) {\n onOpenChange(false, event, 'ancestor-scroll');\n }\n const doc = getDocument(elements.floating);\n escapeKey && doc.addEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);\n outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);\n let ancestors = [];\n if (ancestorScroll) {\n if (isElement(elements.domReference)) {\n ancestors = getOverflowAncestors(elements.domReference);\n }\n if (isElement(elements.floating)) {\n ancestors = ancestors.concat(getOverflowAncestors(elements.floating));\n }\n if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {\n ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));\n }\n }\n\n // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n escapeKey && doc.removeEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);\n outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n };\n }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);\n React.useEffect(() => {\n insideReactTreeRef.current = false;\n }, [outsidePress, outsidePressEvent]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n [bubbleHandlerKeys[referencePressEvent]]: event => {\n if (referencePress) {\n onOpenChange(false, event.nativeEvent, 'reference-press');\n }\n }\n }), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onMouseDown() {\n endedOrStartedInsideRef.current = true;\n },\n onMouseUp() {\n endedOrStartedInsideRef.current = true;\n },\n [captureHandlerKeys[outsidePressEvent]]: () => {\n insideReactTreeRef.current = true;\n }\n }), [closeOnEscapeKeyDown, outsidePressEvent]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nfunction useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange: onOpenChangeProp,\n elements: elementsProp\n } = options;\n const floatingId = useId();\n const dataRef = React.useRef({});\n const [events] = React.useState(() => createPubSub());\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== \"production\") {\n const optionDomReference = elementsProp.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `refs.setPositionReference()`', 'instead.');\n }\n }\n const [positionReference, setPositionReference] = React.useState(elementsProp.reference);\n const onOpenChange = useEffectEvent((open, event, reason) => {\n dataRef.current.openEvent = open ? event : undefined;\n events.emit('openchange', {\n open,\n event,\n reason,\n nested\n });\n onOpenChangeProp == null || onOpenChangeProp(open, event, reason);\n });\n const refs = React.useMemo(() => ({\n setPositionReference\n }), []);\n const elements = React.useMemo(() => ({\n reference: positionReference || elementsProp.reference || null,\n floating: elementsProp.floating || null,\n domReference: elementsProp.reference\n }), [positionReference, elementsProp.reference, elementsProp.floating]);\n return React.useMemo(() => ({\n dataRef,\n open,\n onOpenChange,\n elements,\n events,\n floatingId,\n refs\n }), [open, onOpenChange, elements, events, floatingId, refs]);\n}\n\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n nodeId\n } = options;\n const internalRootContext = useFloatingRootContext({\n ...options,\n elements: {\n reference: null,\n floating: null,\n ...options.elements\n }\n });\n const rootContext = options.rootContext || internalRootContext;\n const computedElements = rootContext.elements;\n const [_domReference, setDomReference] = React.useState(null);\n const [positionReference, _setPositionReference] = React.useState(null);\n const optionDomReference = computedElements == null ? void 0 : computedElements.reference;\n const domReference = optionDomReference || _domReference;\n const domReferenceRef = React.useRef(null);\n const tree = useFloatingTree();\n index(() => {\n if (domReference) {\n domReferenceRef.current = domReference;\n }\n }, [domReference]);\n const position = useFloating$1({\n ...options,\n elements: {\n ...computedElements,\n ...(positionReference && {\n reference: positionReference\n })\n }\n });\n const setPositionReference = React.useCallback(node => {\n const computedPositionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n contextElement: node\n } : node;\n // Store the positionReference in state if the DOM reference is specified externally via the\n // `elements.reference` option. This ensures that it won't be overridden on future renders.\n _setPositionReference(computedPositionReference);\n position.refs.setReference(computedPositionReference);\n }, [position.refs]);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReference\n }), [position.elements, domReference]);\n const context = React.useMemo(() => ({\n ...position,\n ...rootContext,\n refs,\n elements,\n nodeId\n }), [position, refs, elements, nodeId, rootContext]);\n index(() => {\n rootContext.dataRef.current.floatingContext = context;\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements\n }), [position, refs, elements, context]);\n}\n\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nfunction useFocus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n events,\n dataRef,\n elements\n } = context;\n const {\n enabled = true,\n visibleOnly = true\n } = props;\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef();\n const keyboardModalityRef = React.useRef(true);\n React.useEffect(() => {\n if (!enabled) return;\n const win = getWindow(elements.domReference);\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference))) {\n blockFocusRef.current = true;\n }\n }\n function onKeyDown() {\n keyboardModalityRef.current = true;\n }\n win.addEventListener('blur', onBlur);\n win.addEventListener('keydown', onKeyDown, true);\n return () => {\n win.removeEventListener('blur', onBlur);\n win.removeEventListener('keydown', onKeyDown, true);\n };\n }, [elements.domReference, open, enabled]);\n React.useEffect(() => {\n if (!enabled) return;\n function onOpenChange(_ref) {\n let {\n reason\n } = _ref;\n if (reason === 'reference-press' || reason === 'escape-key') {\n blockFocusRef.current = true;\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, []);\n const reference = React.useMemo(() => ({\n onPointerDown(event) {\n if (isVirtualPointerEvent(event.nativeEvent)) return;\n keyboardModalityRef.current = false;\n },\n onMouseLeave() {\n blockFocusRef.current = false;\n },\n onFocus(event) {\n if (blockFocusRef.current) return;\n const target = getTarget(event.nativeEvent);\n if (visibleOnly && isElement(target)) {\n try {\n // Mac Safari unreliably matches `:focus-visible` on the reference\n // if focus was outside the page initially - use the fallback\n // instead.\n if (isSafari() && isMac()) throw Error();\n if (!target.matches(':focus-visible')) return;\n } catch (e) {\n // Old browsers will throw an error when using `:focus-visible`.\n if (!keyboardModalityRef.current && !isTypeableElement(target)) {\n return;\n }\n }\n }\n onOpenChange(true, event.nativeEvent, 'focus');\n },\n onBlur(event) {\n blockFocusRef.current = false;\n const relatedTarget = event.relatedTarget;\n const nativeEvent = event.nativeEvent;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeoutRef.current = window.setTimeout(() => {\n var _dataRef$current$floa;\n const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);\n\n // Focus left the page, keep it open.\n if (!relatedTarget && activeEl === elements.domReference) return;\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n // We can not rely on relatedTarget to point to the correct element\n // as it will only point to the shadow host of the newly focused element\n // and not the element that actually has received focus if it is located\n // inside a shadow root.\n if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) {\n return;\n }\n onOpenChange(false, nativeEvent, 'focus');\n });\n }\n }), [dataRef, elements.domReference, onOpenChange, visibleOnly]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nconst ACTIVE_KEY = 'active';\nconst SELECTED_KEY = 'selected';\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n const isItem = elementKey === 'item';\n let domUserProps = userProps;\n if (isItem && userProps) {\n const {\n [ACTIVE_KEY]: _,\n [SELECTED_KEY]: __,\n ...validProps\n } = userProps;\n domUserProps = validProps;\n }\n return {\n ...(elementKey === 'floating' && {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n }),\n ...domUserProps,\n ...propsList.map(value => {\n const propsOrGetProps = value ? value[elementKey] : null;\n if (typeof propsOrGetProps === 'function') {\n return userProps ? propsOrGetProps(userProps) : null;\n }\n return propsOrGetProps;\n }).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) {\n return;\n }\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n if (typeof value === 'function') {\n var _map$get;\n (_map$get = map.get(key)) == null || _map$get.push(value);\n acc[key] = function () {\n var _map$get2;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map(fn => fn(...args)).find(val => val !== undefined);\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\n/**\n * Merges an array of interaction hooks' props into prop getters, allowing\n * event handler functions to be composed together without overwriting one\n * another.\n * @see https://floating-ui.com/docs/useInteractions\n */\nfunction useInteractions(propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n const referenceDeps = propsList.map(key => key == null ? void 0 : key.reference);\n const floatingDeps = propsList.map(key => key == null ? void 0 : key.floating);\n const itemDeps = propsList.map(key => key == null ? void 0 : key.item);\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n referenceDeps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n floatingDeps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n itemDeps);\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n}\n\nlet isPreventScrollSupported = false;\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nfunction useListNavigation(context, props) {\n const {\n open,\n onOpenChange,\n elements\n } = context;\n const {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n cols = 1,\n scrollItemIntoView = true,\n virtualItemRef,\n itemSizes,\n dense = false\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && cols > 1) {\n warn('In grid list navigation mode (`cols` > 1), the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const floatingFocusElement = getFloatingFocusElement(elements.floating);\n const floatingFocusElementRef = useLatestRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const onNavigate = useEffectEvent(unstable_onNavigate);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousMountedRef = React.useRef(!!elements.floating);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocus = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const latestOpenRef = useLatestRef(open);\n const scrollItemIntoViewRef = useLatestRef(scrollItemIntoView);\n const selectedIndexRef = useLatestRef(selectedIndex);\n const [activeId, setActiveId] = React.useState();\n const [virtualId, setVirtualId] = React.useState();\n const focusItem = useEffectEvent(function (listRef, indexRef, forceScrollIntoView) {\n if (forceScrollIntoView === void 0) {\n forceScrollIntoView = false;\n }\n function runFocus(item) {\n if (virtual) {\n setActiveId(item.id);\n tree == null || tree.events.emit('virtualfocus', item);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n } else {\n enqueueFocus(item, {\n preventScroll: true,\n // Mac Safari does not move the virtual cursor unless the focus call\n // is sync. However, for the very first focus call, we need to wait\n // for the position to be ready in order to prevent unwanted\n // scrolling. This means the virtual cursor will not move to the first\n // item when first opening the floating element, but will on\n // subsequent calls. `preventScroll` is supported in modern Safari,\n // so we can use that instead.\n // iOS Safari must be async or the first item will not be focused.\n sync: isMac() && isSafari() ? isPreventScrollSupported || forceSyncFocus.current : false\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n if (initialItem) {\n runFocus(initialItem);\n }\n requestAnimationFrame(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) return;\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const scrollIntoViewOptions = scrollItemIntoViewRef.current;\n const shouldScrollIntoView = scrollIntoViewOptions && item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView == null || waitedItem.scrollIntoView(typeof scrollIntoViewOptions === 'boolean' ? {\n block: 'nearest',\n inline: 'nearest'\n } : scrollIntoViewOptions);\n }\n });\n });\n index(() => {\n document.createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n }, []);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n index(() => {\n if (!enabled) return;\n if (open && elements.floating) {\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n indexRef.current = selectedIndex;\n onNavigate(selectedIndex);\n }\n } else if (previousMountedRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function.\n indexRef.current = -1;\n previousOnNavigateRef.current(null);\n }\n }, [enabled, open, elements.floating, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n index(() => {\n if (!enabled) return;\n if (open && elements.floating) {\n if (activeIndex == null) {\n forceSyncFocus.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? requestAnimationFrame : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs++;\n } else {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);\n keyRef.current = null;\n onNavigate(indexRef.current);\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem(listRef, indexRef, forceScrollIntoViewRef.current);\n forceScrollIntoViewRef.current = false;\n }\n }\n }, [enabled, open, elements.floating, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n index(() => {\n var _nodes$find;\n if (!enabled || elements.floating || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = (_nodes$find = nodes.find(node => node.id === parentId)) == null || (_nodes$find = _nodes$find.context) == null ? void 0 : _nodes$find.elements.floating;\n const activeEl = activeElement(getDocument(elements.floating));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, elements.floating, tree, parentId, virtual]);\n index(() => {\n if (!enabled) return;\n if (!tree) return;\n if (!virtual) return;\n if (parentId) return;\n function handleVirtualFocus(item) {\n setVirtualId(item.id);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n }\n tree.events.on('virtualfocus', handleVirtualFocus);\n return () => {\n tree.events.off('virtualfocus', handleVirtualFocus);\n };\n }, [enabled, tree, virtual, parentId, virtualItemRef]);\n index(() => {\n previousOnNavigateRef.current = onNavigate;\n previousMountedRef.current = !!elements.floating;\n });\n index(() => {\n if (!open) {\n keyRef.current = null;\n }\n }, [open]);\n index(() => {\n previousOpenRef.current = open;\n }, [open]);\n const hasActiveIndex = activeIndex != null;\n const item = React.useMemo(() => {\n function syncCurrentTarget(currentTarget) {\n if (!open) return;\n const index = listRef.current.indexOf(currentTarget);\n if (index !== -1) {\n onNavigate(index);\n }\n }\n const props = {\n onFocus(_ref) {\n let {\n currentTarget\n } = _ref;\n syncCurrentTarget(currentTarget);\n },\n onClick: _ref2 => {\n let {\n currentTarget\n } = _ref2;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n ...(focusItemOnHover && {\n onMouseMove(_ref3) {\n let {\n currentTarget\n } = _ref3;\n syncCurrentTarget(currentTarget);\n },\n onPointerLeave(_ref4) {\n let {\n pointerType\n } = _ref4;\n if (!isPointerModalityRef.current || pointerType === 'touch') {\n return;\n }\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n onNavigate(null);\n if (!virtual) {\n enqueueFocus(floatingFocusElementRef.current, {\n preventScroll: true\n });\n }\n }\n })\n };\n return props;\n }, [open, floatingFocusElementRef, focusItem, focusItemOnHover, listRef, onNavigate, virtual]);\n const commonOnKeyDown = useEffectEvent(event => {\n isPointerModalityRef.current = false;\n forceSyncFocus.current = true;\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {\n stopEvent(event);\n onOpenChange(false, event.nativeEvent, 'list-navigation');\n if (isHTMLElement(elements.domReference) && !virtual) {\n elements.domReference.focus();\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinIndex(listRef, disabledIndices);\n const maxIndex = getMaxIndex(listRef, disabledIndices);\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(indexRef.current);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(indexRef.current);\n }\n\n // Grid navigation.\n if (cols > 1) {\n const sizes = itemSizes || Array.from({\n length: listRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = buildCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isDisabled(listRef.current, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isDisabled(listRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const index = cellMap[getGridNavigatedIndex({\n current: cellMap.map(itemIndex => itemIndex != null ? listRef.current[itemIndex] : null)\n }, {\n event,\n orientation,\n loop,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getCellIndices([...(disabledIndices || listRef.current.map((_, index) => isDisabled(listRef.current, index) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getCellIndexOfCorner(indexRef.current > maxIndex ? minIndex : indexRef.current, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction\n // we're moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n event.key === ARROW_DOWN ? 'bl' : event.key === ARROW_RIGHT ? 'tr' : 'tl'),\n stopEvent: true\n })];\n if (index != null) {\n indexRef.current = index;\n onNavigate(indexRef.current);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(indexRef.current);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n onNavigate(null);\n } else {\n onNavigate(indexRef.current);\n }\n }\n });\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': virtualId || activeId\n };\n }, [virtual, open, hasActiveIndex, virtualId, activeId]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!isTypeableCombobox(elements.domReference) && ariaActiveDescendantProp),\n onKeyDown: commonOnKeyDown,\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, elements.domReference, orientation]);\n const reference = React.useMemo(() => {\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n ...ariaActiveDescendantProp,\n onKeyDown(event) {\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.indexOf('Arrow') === 0;\n const isCrossOpenKey = isCrossOrientationOpenKey(event.key, orientation, rtl);\n const isCrossCloseKey = isCrossOrientationCloseKey(event.key, orientation, rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && open) {\n const rootNode = tree == null ? void 0 : tree.nodesRef.current.find(node => node.parentId == null);\n const deepestNode = tree && rootNode ? getDeepestNode(tree.nodesRef.current, rootNode.id) : null;\n if (isArrowKey && deepestNode && virtualItemRef) {\n const eventObject = new KeyboardEvent('keydown', {\n key: event.key,\n bubbles: true\n });\n if (isCrossOpenKey || isCrossCloseKey) {\n var _deepestNode$context, _deepestNode$context2;\n const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ? void 0 : _deepestNode$context.elements.domReference) === event.currentTarget;\n const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ? void 0 : _deepestNode$context2.elements.domReference : isCrossOpenKey ? listRef.current.find(item => (item == null ? void 0 : item.id) === activeId) : null;\n if (dispatchItem) {\n stopEvent(event);\n dispatchItem.dispatchEvent(eventObject);\n setVirtualId(undefined);\n }\n }\n if (isMainKey && deepestNode.context) {\n if (deepestNode.context.open && deepestNode.parentId && event.currentTarget !== deepestNode.context.elements.domReference) {\n var _deepestNode$context$;\n stopEvent(event);\n (_deepestNode$context$ = deepestNode.context.elements.domReference) == null || _deepestNode$context$.dispatchEvent(eventObject);\n return;\n }\n }\n }\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!open && !openOnArrowKeyDown && isArrowKey) {\n return;\n }\n if (isNavigationKey) {\n keyRef.current = nested && isMainKey ? null : event.key;\n }\n if (nested) {\n if (isCrossOpenKey) {\n stopEvent(event);\n if (open) {\n indexRef.current = getMinIndex(listRef, disabledIndicesRef.current);\n onNavigate(indexRef.current);\n } else {\n onOpenChange(true, event.nativeEvent, 'list-navigation');\n }\n }\n return;\n }\n if (isMainKey) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n stopEvent(event);\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true, event.nativeEvent, 'list-navigation');\n } else {\n commonOnKeyDown(event);\n }\n if (open) {\n onNavigate(indexRef.current);\n }\n }\n },\n onFocus() {\n if (open && !virtual) {\n onNavigate(null);\n }\n },\n onPointerDown: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [activeId, ariaActiveDescendantProp, commonOnKeyDown, disabledIndicesRef, focusItemOnOpen, listRef, nested, onNavigate, onOpenChange, open, openOnArrowKeyDown, orientation, rtl, selectedIndex, tree, virtual, virtualItemRef]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item\n } : {}, [enabled, reference, floating, item]);\n}\n\nconst componentRoleToAriaRoleMap = /*#__PURE__*/new Map([['select', 'listbox'], ['combobox', 'listbox'], ['label', false]]);\n\n/**\n * Adds base screen reader props to the reference and floating elements for a\n * given floating element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nfunction useRole(context, props) {\n var _componentRoleToAriaR;\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n floatingId\n } = context;\n const {\n enabled = true,\n role = 'dialog'\n } = props;\n const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap.get(role)) != null ? _componentRoleToAriaR : role;\n const referenceId = useId();\n const parentId = useFloatingParentNodeId();\n const isNested = parentId != null;\n const reference = React.useMemo(() => {\n if (ariaRole === 'tooltip' || role === 'label') {\n return {\n [\"aria-\" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined\n };\n }\n return {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,\n 'aria-controls': open ? floatingId : undefined,\n ...(ariaRole === 'listbox' && {\n role: 'combobox'\n }),\n ...(ariaRole === 'menu' && {\n id: referenceId\n }),\n ...(ariaRole === 'menu' && isNested && {\n role: 'menuitem'\n }),\n ...(role === 'select' && {\n 'aria-autocomplete': 'none'\n }),\n ...(role === 'combobox' && {\n 'aria-autocomplete': 'list'\n })\n };\n }, [ariaRole, floatingId, isNested, open, referenceId, role]);\n const floating = React.useMemo(() => {\n const floatingProps = {\n id: floatingId,\n ...(ariaRole && {\n role: ariaRole\n })\n };\n if (ariaRole === 'tooltip' || role === 'label') {\n return floatingProps;\n }\n return {\n ...floatingProps,\n ...(ariaRole === 'menu' && {\n 'aria-labelledby': referenceId\n })\n };\n }, [ariaRole, floatingId, referenceId, role]);\n const item = React.useCallback(_ref => {\n let {\n active,\n selected\n } = _ref;\n const commonProps = {\n role: 'option',\n ...(active && {\n id: floatingId + \"-option\"\n })\n };\n\n // For `menu`, we are unable to tell if the item is a `menuitemradio`\n // or `menuitemcheckbox`. For backwards-compatibility reasons, also\n // avoid defaulting to `menuitem` as it may overwrite custom role props.\n switch (role) {\n case 'select':\n return {\n ...commonProps,\n 'aria-selected': active && selected\n };\n case 'combobox':\n {\n return {\n ...commonProps,\n ...(active && {\n 'aria-selected': true\n })\n };\n }\n }\n return {};\n }, [floatingId, role]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item\n } : {}, [enabled, reference, floating, item]);\n}\n\n// Converts a JS style key like `backgroundColor` to a CSS transition-property\n// like `background-color`.\nconst camelCaseToKebabCase = str => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());\nfunction execWithArgsOrReturn(valueOrFn, args) {\n return typeof valueOrFn === 'function' ? valueOrFn(args) : valueOrFn;\n}\nfunction useDelayUnmount(open, durationMs) {\n const [isMounted, setIsMounted] = React.useState(open);\n if (open && !isMounted) {\n setIsMounted(true);\n }\n React.useEffect(() => {\n if (!open && isMounted) {\n const timeout = setTimeout(() => setIsMounted(false), durationMs);\n return () => clearTimeout(timeout);\n }\n }, [open, isMounted, durationMs]);\n return isMounted;\n}\n/**\n * Provides a status string to apply CSS transitions to a floating element,\n * correctly handling placement-aware transitions.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstatus\n */\nfunction useTransitionStatus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n elements: {\n floating\n }\n } = context;\n const {\n duration = 250\n } = props;\n const isNumberDuration = typeof duration === 'number';\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [status, setStatus] = React.useState('unmounted');\n const isMounted = useDelayUnmount(open, closeDuration);\n if (!isMounted && status === 'close') {\n setStatus('unmounted');\n }\n index(() => {\n if (!floating) return;\n if (open) {\n setStatus('initial');\n const frame = requestAnimationFrame(() => {\n setStatus('open');\n });\n return () => {\n cancelAnimationFrame(frame);\n };\n }\n setStatus('close');\n }, [open, floating]);\n return {\n isMounted,\n status\n };\n}\n/**\n * Provides styles to apply CSS transitions to a floating element, correctly\n * handling placement-aware transitions. Wrapper around `useTransitionStatus`.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstyles\n */\nfunction useTransitionStyles(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n initial: unstable_initial = {\n opacity: 0\n },\n open: unstable_open,\n close: unstable_close,\n common: unstable_common,\n duration = 250\n } = props;\n const placement = context.placement;\n const side = placement.split('-')[0];\n const fnArgs = React.useMemo(() => ({\n side,\n placement\n }), [side, placement]);\n const isNumberDuration = typeof duration === 'number';\n const openDuration = (isNumberDuration ? duration : duration.open) || 0;\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [styles, setStyles] = React.useState(() => ({\n ...execWithArgsOrReturn(unstable_common, fnArgs),\n ...execWithArgsOrReturn(unstable_initial, fnArgs)\n }));\n const {\n isMounted,\n status\n } = useTransitionStatus(context, {\n duration\n });\n const initialRef = useLatestRef(unstable_initial);\n const openRef = useLatestRef(unstable_open);\n const closeRef = useLatestRef(unstable_close);\n const commonRef = useLatestRef(unstable_common);\n index(() => {\n const initialStyles = execWithArgsOrReturn(initialRef.current, fnArgs);\n const closeStyles = execWithArgsOrReturn(closeRef.current, fnArgs);\n const commonStyles = execWithArgsOrReturn(commonRef.current, fnArgs);\n const openStyles = execWithArgsOrReturn(openRef.current, fnArgs) || Object.keys(initialStyles).reduce((acc, key) => {\n acc[key] = '';\n return acc;\n }, {});\n if (status === 'initial') {\n setStyles(styles => ({\n transitionProperty: styles.transitionProperty,\n ...commonStyles,\n ...initialStyles\n }));\n }\n if (status === 'open') {\n setStyles({\n transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(','),\n transitionDuration: openDuration + \"ms\",\n ...commonStyles,\n ...openStyles\n });\n }\n if (status === 'close') {\n const styles = closeStyles || initialStyles;\n setStyles({\n transitionProperty: Object.keys(styles).map(camelCaseToKebabCase).join(','),\n transitionDuration: closeDuration + \"ms\",\n ...commonStyles,\n ...styles\n });\n }\n }, [closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status, fnArgs]);\n return {\n isMounted,\n styles\n };\n}\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nfunction useTypeahead(context, props) {\n var _ref;\n const {\n open,\n dataRef\n } = context;\n const {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch,\n onTypingChange: unstable_onTypingChange,\n enabled = true,\n findMatch = null,\n resetMs = 750,\n ignoreKeys = [],\n selectedIndex = null\n } = props;\n const timeoutIdRef = React.useRef();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEffectEvent(unstable_onMatch);\n const onTypingChange = useEffectEvent(unstable_onTypingChange);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n index(() => {\n if (open) {\n clearTimeout(timeoutIdRef.current);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n index(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n var _ref2;\n prevIndexRef.current = (_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n const setTypingChange = useEffectEvent(value => {\n if (value) {\n if (!dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n } else {\n if (dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n }\n });\n const onKeyDown = useEffectEvent(event => {\n function getMatchingIndex(list, orderedList, string) {\n const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(string.toLocaleLowerCase())) === 0);\n return str ? list.indexOf(str) : -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, listContent, stringRef.current) === -1) {\n setTypingChange(false);\n } else if (event.key === ' ') {\n stopEvent(event);\n }\n }\n if (listContent == null || ignoreKeysRef.current.includes(event.key) ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n setTypingChange(true);\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n });\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n setTypingChange(false);\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const index = getMatchingIndex(listContent, [...listContent.slice((prevIndex || 0) + 1), ...listContent.slice(0, (prevIndex || 0) + 1)], stringRef.current);\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n setTypingChange(false);\n }\n });\n const reference = React.useMemo(() => ({\n onKeyDown\n }), [onKeyDown]);\n const floating = React.useMemo(() => {\n return {\n onKeyDown,\n onKeyUp(event) {\n if (event.key === ' ') {\n setTypingChange(false);\n }\n }\n };\n }, [onKeyDown, setTypingChange]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nfunction getArgsWithCustomFloatingHeight(state, height) {\n return {\n ...state,\n rects: {\n ...state.rects,\n floating: {\n ...state.rects.floating,\n height\n }\n }\n };\n}\n/**\n * Positions the floating element such that an inner element inside of it is\n * anchored to the reference element.\n * @see https://floating-ui.com/docs/inner\n */\nconst inner = props => ({\n name: 'inner',\n options: props,\n async fn(state) {\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = evaluate(props, state);\n const {\n rects,\n elements: {\n floating\n }\n } = state;\n const item = listRef.current[index];\n const scrollEl = (scrollRef == null ? void 0 : scrollRef.current) || floating;\n\n // Valid combinations:\n // 1. Floating element is the scrollRef and has a border (default)\n // 2. Floating element is not the scrollRef, floating element has a border\n // 3. Floating element is not the scrollRef, scrollRef has a border\n // Floating > {...getFloatingProps()} wrapper > scrollRef > items is not\n // allowed as VoiceOver doesn't work.\n const clientTop = floating.clientTop || scrollEl.clientTop;\n const floatingIsBordered = floating.clientTop !== 0;\n const scrollElIsBordered = scrollEl.clientTop !== 0;\n const floatingIsScrollEl = floating === scrollEl;\n if (process.env.NODE_ENV !== \"production\") {\n if (!state.placement.startsWith('bottom')) {\n warn('`placement` side must be \"bottom\" when using the `inner`', 'middleware.');\n }\n }\n if (!item) {\n return {};\n }\n const nextArgs = {\n ...state,\n ...(await offset(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state))\n };\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, scrollEl.scrollHeight + clientTop + floating.clientTop), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = Math.max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const maxHeight = Math.max(0, scrollEl.scrollHeight + (floatingIsBordered && floatingIsScrollEl || scrollElIsBordered ? clientTop * 2 : 0) - diffY - Math.max(0, overflow.bottom));\n scrollEl.style.maxHeight = maxHeight + \"px\";\n scrollEl.scrollTop = diffY;\n\n // There is not enough space, fallback to standard anchored positioning\n if (onFallbackChange) {\n if (scrollEl.offsetHeight < item.offsetHeight * Math.min(minItemsVisible, listRef.current.length - 1) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold) {\n ReactDOM.flushSync(() => onFallbackChange(true));\n } else {\n ReactDOM.flushSync(() => onFallbackChange(false));\n }\n }\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({\n ...nextArgs,\n y: nextY\n }, scrollEl.offsetHeight + clientTop + floating.clientTop), detectOverflowOptions);\n }\n return {\n y: nextY\n };\n }\n});\n/**\n * Changes the `inner` middleware's `offset` upon a `wheel` event to\n * expand the floating element's height, revealing more list items.\n * @see https://floating-ui.com/docs/inner\n */\nfunction useInnerOffset(context, props) {\n const {\n open,\n elements\n } = context;\n const {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = props;\n const onChange = useEffectEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n if (!enabled) return;\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n ReactDOM.flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (open && el) {\n el.addEventListener('wheel', onWheel);\n\n // Wait for the position to be ready.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n if (overflowRef.current != null) {\n initialOverflowRef.current = {\n ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);\n const floating = React.useMemo(() => ({\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n onWheel() {\n controlledScrollingRef.current = false;\n },\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n onScroll() {\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n ReactDOM.flushSync(() => onChange(d => d + scrollDiff));\n }\n }\n\n // [Firefox] Wait for the height change to have been applied.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n }), [elements.floating, onChange, overflowRef, scrollRef]);\n return React.useMemo(() => enabled ? {\n floating\n } : {}, [enabled, floating]);\n}\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInside(point, rect) {\n return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safepolygon\n */\nfunction safePolygon(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n buffer = 0.5,\n blockPointerEvents = false,\n requireIntent = true\n } = options;\n let timeoutId;\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = performance.now();\n function getCursorSpeed(x, y) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return null;\n }\n const deltaX = x - lastX;\n const deltaY = y - lastY;\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const speed = distance / elapsedTime; // px / ms\n\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return speed;\n }\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n } = _ref;\n return function onMouseMove(event) {\n function close() {\n clearTimeout(timeoutId);\n onClose();\n }\n clearTimeout(timeoutId);\n if (!elements.domReference || !elements.floating || placement == null || x == null || y == null) {\n return;\n }\n const {\n clientX,\n clientY\n } = event;\n const clientPoint = [clientX, clientY];\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(elements.floating, target);\n const isOverReferenceEl = contains(elements.domReference, target);\n const refRect = elements.domReference.getBoundingClientRect();\n const rect = elements.floating.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isOverReferenceRect = isInside(clientPoint, refRect);\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n }\n if (isOverReferenceEl && !isLeave) {\n hasLanded = true;\n return;\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {\n return;\n }\n\n // If any nested child is open, abort.\n if (tree && getChildren(tree.nodesRef.current, nodeId).some(_ref2 => {\n let {\n context\n } = _ref2;\n return context == null ? void 0 : context.open;\n })) {\n return;\n }\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let rectPoly = [];\n switch (side) {\n case 'top':\n rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];\n break;\n case 'bottom':\n rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];\n break;\n case 'left':\n rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];\n break;\n case 'right':\n rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];\n break;\n }\n function getPolygon(_ref3) {\n let [x, y] = _ref3;\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n if (isPointInPolygon([clientX, clientY], rectPoly)) {\n return;\n }\n if (hasLanded && !isOverReferenceRect) {\n return close();\n }\n if (!isLeave && requireIntent) {\n const cursorSpeed = getCursorSpeed(event.clientX, event.clientY);\n const cursorSpeedThreshold = 0.1;\n if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {\n return close();\n }\n }\n if (!isPointInPolygon([clientX, clientY], getPolygon([x, y]))) {\n close();\n } else if (!hasLanded && requireIntent) {\n timeoutId = window.setTimeout(close, 40);\n }\n };\n };\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nexport { Composite, CompositeItem, FloatingArrow, FloatingDelayGroup, FloatingFocusManager, FloatingList, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, inner, safePolygon, useClick, useClientPoint, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingRootContext, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListItem, useListNavigation, useMergeRefs, useRole, useTransitionStatus, useTransitionStyles, useTypeahead };\n", "function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n", "import { isShadowRoot, isHTMLElement } from '@floating-ui/utils/dom';\n\nfunction activeElement(doc) {\n let activeElement = doc.activeElement;\n while (((_activeElement = activeElement) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {\n var _activeElement;\n activeElement = activeElement.shadowRoot.activeElement;\n }\n return activeElement;\n}\nfunction contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n\n // then fallback to custom implementation with Shadow DOM support\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n // @ts-ignore\n next = next.parentNode || next.host;\n }\n }\n\n // Give up, the result is false\n return false;\n}\n// Avoid Chrome DevTools blue warning.\nfunction getPlatform() {\n const uaData = navigator.userAgentData;\n if (uaData != null && uaData.platform) {\n return uaData.platform;\n }\n return navigator.platform;\n}\nfunction getUserAgent() {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(_ref => {\n let {\n brand,\n version\n } = _ref;\n return brand + \"/\" + version;\n }).join(' ');\n }\n return navigator.userAgent;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/utils/src/isVirtualEvent.ts\nfunction isVirtualClick(event) {\n // FIXME: Firefox is now emitting a deprecation warning for `mozInputSource`.\n // Try to find a workaround for this. `react-aria` source still has the check.\n if (event.mozInputSource === 0 && event.isTrusted) {\n return true;\n }\n if (isAndroid() && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nfunction isVirtualPointerEvent(event) {\n if (isJSDOM()) return false;\n return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333\u2022 for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nfunction isSafari() {\n // Chrome DevTools does not complain about navigator.vendor\n return /apple/i.test(navigator.vendor);\n}\nfunction isAndroid() {\n const re = /android/i;\n return re.test(getPlatform()) || re.test(getUserAgent());\n}\nfunction isMac() {\n return getPlatform().toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\n}\nfunction isJSDOM() {\n return getUserAgent().includes('jsdom/');\n}\nfunction isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nfunction isReactEvent(event) {\n return 'nativeEvent' in event;\n}\nfunction isRootElement(element) {\n return element.matches('html,body');\n}\nfunction getDocument(node) {\n return (node == null ? void 0 : node.ownerDocument) || document;\n}\nfunction isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const e = event;\n return e.target != null && node.contains(e.target);\n}\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n return event.target;\n}\nconst TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nfunction isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nfunction stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nfunction isTypeableCombobox(element) {\n if (!element) return false;\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\n\nexport { TYPEABLE_SELECTOR, activeElement, contains, getDocument, getPlatform, getTarget, getUserAgent, isAndroid, isEventTargetWithin, isJSDOM, isMac, isMouseLikePointerType, isReactEvent, isRootElement, isSafari, isTypeableCombobox, isTypeableElement, isVirtualClick, isVirtualPointerEvent, stopEvent };\n", "/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n var _padding$top, _padding$right, _padding$bottom, _padding$left;\n return {\n top: (_padding$top = padding.top) != null ? _padding$top : 0,\n right: (_padding$right = padding.right) != null ? _padding$right : 0,\n bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n left: (_padding$left = padding.left) != null ? _padding$left : 0\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n", "// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\nconst candidateSelectors = [\n 'input:not([inert]):not([inert] *)',\n 'select:not([inert]):not([inert] *)',\n 'textarea:not([inert]):not([inert] *)',\n 'a[href]:not([inert]):not([inert] *)',\n 'area[href]:not([inert]):not([inert] *)',\n 'button:not([inert]):not([inert] *)',\n '[tabindex]:not(slot):not([inert]):not([inert] *)',\n 'audio[controls]:not([inert]):not([inert] *)',\n 'video[controls]:not([inert]):not([inert] *)',\n '[contenteditable]:not([contenteditable=\"false\"]):not([inert]):not([inert] *)',\n 'details>summary:first-of-type:not([inert]):not([inert] *)',\n 'details:not([inert]):not([inert] *)',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst NoElement = typeof Element === 'undefined';\n\nconst matches = NoElement\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getRootNode =\n !NoElement && Element.prototype.getRootNode\n ? (element) => element?.getRootNode?.()\n : (element) => element?.ownerDocument;\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Node} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nconst isInert = function (node, lookUp = true) {\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n const inertAtt = node?.getAttribute?.('inert');\n const inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n const result =\n inert ||\n (lookUp &&\n node &&\n // closest does not exist on shadow roots, so we fall back to a manual\n // lookup upward, in case it is not defined.\n (typeof node.closest === 'function'\n ? node.closest('[inert]')\n : isInert(node.parentNode)));\n\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nconst isContentEditable = function (node) {\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n const attValue = node?.getAttribute?.('contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nconst getCandidates = function (el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert (either by itself or via its parent), then all its children are inert\n if (isInert(el)) {\n return [];\n }\n\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidateScope>}\n */\nconst getCandidatesIteratively = function (\n elements,\n includeContainer,\n options\n) {\n const candidates = [];\n const elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n const element = elementsToCheck.shift();\n if (isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n const assigned = element.assignedElements();\n const content = assigned.length ? assigned : element.children;\n const nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // check candidate element\n const validCandidate = matches.call(element, candidateSelector);\n if (\n validCandidate &&\n options.filter(element) &&\n (includeContainer || !elements.includes(element))\n ) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n const shadowRoot =\n element.shadowRoot ||\n // check for an undisclosed shadow\n (typeof options.getShadowRoot === 'function' &&\n options.getShadowRoot(element));\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n const validShadowRoot =\n !isInert(shadowRoot, false) &&\n (!options.shadowRootFilter || options.shadowRootFilter(element));\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n const nestedCandidates = getCandidatesIteratively(\n shadowRoot === true ? element.children : shadowRoot.children,\n true,\n options\n );\n\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift(...element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nconst hasTabIndex = function (node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nconst getTabIndex = function (node) {\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n if (\n (/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) ||\n isContentEditable(node)) &&\n !hasTabIndex(node)\n ) {\n return 0;\n }\n }\n\n return node.tabIndex;\n};\n\n/**\n * Determine the tab index of a given node __for sort order purposes__.\n * @param {HTMLElement} node\n * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,\n * has tabIndex -1, but needs to be sorted by document order in order for its content to be\n * inserted into the correct sort position.\n * @returns {number} Tab order (negative, 0, or positive number).\n */\nconst getSortOrderTabIndex = function (node, isScope) {\n const tabIndex = getTabIndex(node);\n\n if (tabIndex < 0 && isScope && !hasTabIndex(node)) {\n return 0;\n }\n\n return tabIndex;\n};\n\nconst sortOrderedTabbables = function (a, b) {\n return a.tabIndex === b.tabIndex\n ? a.documentOrder - b.documentOrder\n : a.tabIndex - b.tabIndex;\n};\n\nconst isInput = function (node) {\n return node.tagName === 'INPUT';\n};\n\nconst isHiddenInput = function (node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nconst isDetailsWithSummary = function (node) {\n const r =\n node.tagName === 'DETAILS' &&\n Array.prototype.slice\n .apply(node.children)\n .some((child) => child.tagName === 'SUMMARY');\n return r;\n};\n\nconst getCheckedRadio = function (nodes, form) {\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nconst isTabbableRadio = function (node) {\n if (!node.name) {\n return true;\n }\n const radioScope = node.form || getRootNode(node);\n const queryRadios = function (name) {\n return radioScope.querySelectorAll(\n 'input[type=\"radio\"][name=\"' + name + '\"]'\n );\n };\n\n let radioSet;\n if (\n typeof window !== 'undefined' &&\n typeof window.CSS !== 'undefined' &&\n typeof window.CSS.escape === 'function'\n ) {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(\n 'Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s',\n err.message\n );\n return false;\n }\n }\n\n const checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nconst isRadio = function (node) {\n return isInput(node) && node.type === 'radio';\n};\n\nconst isNonTabbableRadio = function (node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\n// determines if a node is ultimately attached to the window's document\nconst isNodeAttached = function (node) {\n // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // To further complicate things, we have to look all the way up until we find a shadow HOST\n // that is attached (or find none) because the node might be in nested shadows...\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible\n // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed\n // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then\n // `ownerDocument` will be `null`, hence the optional chaining on it.\n let nodeRoot = node && getRootNode(node);\n let nodeRootHost = nodeRoot?.host;\n\n // in some cases, a detached node will return itself as the root instead of a document or\n // shadow root object, in which case, we shouldn't try to look further up the host chain\n let attached = false;\n if (nodeRoot && nodeRoot !== node) {\n attached = !!(\n nodeRootHost?.ownerDocument?.contains(nodeRootHost) ||\n node?.ownerDocument?.contains(node)\n );\n\n while (!attached && nodeRootHost) {\n // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,\n // which means we need to get the host's host and check if that parent host is contained\n // in (i.e. attached to) the document\n nodeRoot = getRootNode(nodeRootHost);\n nodeRootHost = nodeRoot?.host;\n attached = !!nodeRootHost?.ownerDocument?.contains(nodeRootHost);\n }\n }\n\n return attached;\n};\n\nconst isZeroArea = function (node) {\n const { width, height } = node.getBoundingClientRect();\n return width === 0 && height === 0;\n};\nconst isHidden = function (node, { displayCheck, getShadowRoot }) {\n if (displayCheck === 'full-native') {\n if ('checkVisibility' in node) {\n // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility\n const visible = node.checkVisibility({\n // Checking opacity might be desirable for some use cases, but natively,\n // opacity zero elements _are_ focusable and tabbable.\n checkOpacity: false,\n opacityProperty: false,\n\n contentVisibilityAuto: true,\n visibilityProperty: true,\n // This is an alias for `visibilityProperty`. Contemporary browsers\n // support both. However, this alias has wider browser support (Chrome\n // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so\n // we include it anyway.\n checkVisibilityCSS: true,\n });\n return !visible;\n }\n // Fall through to manual visibility checks\n }\n\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n const { visibility } = getComputedStyle(node);\n if (visibility === 'hidden' || visibility === 'collapse') {\n return true;\n }\n\n const isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n const nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n\n if (\n !displayCheck ||\n displayCheck === 'full' ||\n // full-native can run this branch when it falls through in case\n // Element#checkVisibility is unsupported\n displayCheck === 'full-native' ||\n displayCheck === 'legacy-full'\n ) {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n const originalNode = node;\n while (node) {\n const parentElement = node.parentElement;\n const rootNode = getRootNode(node);\n if (\n parentElement &&\n !parentElement.shadowRoot &&\n getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n\n node = originalNode;\n }\n // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n if (isNodeAttached(node)) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n }\n\n // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n //\n // v6.0.0: As of this major release, the default 'full' option __no longer treats detached\n // nodes as visible with the 'none' fallback.__\n if (displayCheck !== 'legacy-full') {\n return true; // hidden\n }\n // else, fallback to 'none' mode and consider the node visible\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n }\n\n // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume\n // it's visible\n return false;\n};\n\n// form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\nconst isDisabledFromFieldset = function (node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n let parentNode = node.parentElement;\n // check if `node` is contained in a disabled <fieldset>\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (let i = 0; i < parentNode.children.length; i++) {\n const child = parentNode.children.item(i);\n // when the first <legend> (in document order) is found\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *')\n ? true\n : !child.contains(node);\n }\n }\n // the disabled <fieldset> containing `node` has no <legend>\n return true;\n }\n parentNode = parentNode.parentElement;\n }\n }\n\n // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n return false;\n};\n\nconst isNodeMatchingSelectorFocusable = function (options, node) {\n if (\n node.disabled ||\n isHiddenInput(node) ||\n isHidden(node, options) ||\n // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) ||\n isDisabledFromFieldset(node)\n ) {\n return false;\n }\n return true;\n};\n\nconst isNodeMatchingSelectorTabbable = function (options, node) {\n if (\n isNonTabbableRadio(node) ||\n getTabIndex(node) < 0 ||\n !isNodeMatchingSelectorFocusable(options, node)\n ) {\n return false;\n }\n return true;\n};\n\nconst isShadowRootTabbable = function (shadowHostNode) {\n const tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n }\n // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n return false;\n};\n\n/**\n * @param {Array.<Element|CandidateScope>} candidates\n * @returns Element[]\n */\nconst sortByOrder = function (candidates) {\n const regularTabbables = [];\n const orderedTabbables = [];\n candidates.forEach(function (item, i) {\n const isScope = !!item.scopeParent;\n const element = isScope ? item.scopeParent : item;\n const candidateTabindex = getSortOrderTabIndex(element, isScope);\n const elements = isScope ? sortByOrder(item.candidates) : element;\n if (candidateTabindex === 0) {\n isScope\n ? regularTabbables.push(...elements)\n : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements,\n });\n }\n });\n\n return orderedTabbables\n .sort(sortOrderedTabbables)\n .reduce((acc, sortable) => {\n sortable.isScope\n ? acc.push(...sortable.content)\n : acc.push(sortable.content);\n return acc;\n }, [])\n .concat(regularTabbables);\n};\n\nconst tabbable = function (container, options) {\n options = options || {};\n\n let candidates;\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively(\n [container],\n options.includeContainer,\n {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isShadowRootTabbable,\n }\n );\n } else {\n candidates = getCandidates(\n container,\n options.includeContainer,\n isNodeMatchingSelectorTabbable.bind(null, options)\n );\n }\n return sortByOrder(candidates);\n};\n\nconst focusable = function (container, options) {\n options = options || {};\n\n let candidates;\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively(\n [container],\n options.includeContainer,\n {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot,\n }\n );\n } else {\n candidates = getCandidates(\n container,\n options.includeContainer,\n isNodeMatchingSelectorFocusable.bind(null, options)\n );\n }\n\n return candidates;\n};\n\nconst isTabbable = function (node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(options, node);\n};\n\nconst focusableCandidateSelector = /* #__PURE__ */ candidateSelectors\n .concat('iframe:not([inert]):not([inert] *)')\n .join(',');\n\nconst isFocusable = function (node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { tabbable, focusable, isTabbable, isFocusable, getTabIndex };\n", "import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n const alignment = getAlignment(placement);\n if (alignment) {\n coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(minPadding, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n\n // No rects (e.g. a hidden or detached reference, or a collapsed range) \u2014\n // keep the existing reference rect rather than resetting to an invalid\n // one with non-finite values.\n if (!nativeClientRects.length) {\n return {};\n }\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n return rectToClientRect({\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n });\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n return rectToClientRect({\n x: minLeft,\n y: top,\n width: maxRight - minLeft,\n height: bottom - top\n });\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n if (checkMainAxis) {\n mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n }\n if (checkCrossAxis) {\n crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n var _rawOffset$mainAxis, _rawOffset$crossAxis;\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const shiftData = state.middlewareData.shift;\n const noShift = !shiftData;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (shiftData != null && shiftData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if (shiftData != null && shiftData.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n if (isYAxis) {\n availableWidth = width - 2 * max(overflow.left, overflow.right);\n } else {\n availableHeight = height - 2 * max(overflow.top, overflow.bottom);\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n", "import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement && offsetParent) {\n const win = getWindow(domElement);\n const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n const scroll = getNodeScroll(html);\n const body = html.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n if (rootBoundary === void 0) {\n rootBoundary = 'viewport';\n }\n const isLayoutViewport = rootBoundary === 'layoutViewport';\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n // Client coordinates are relative to the layout viewport, except in\n // WebKit with an `absolute` strategy, where they are relative to the\n // visual viewport.\n const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n if (isLayoutViewport) {\n if (!layoutRelativeClientCoords) {\n x = -visualViewport.offsetLeft;\n y = -visualViewport.offsetTop;\n }\n } else {\n width = visualViewport.width;\n height = visualViewport.height;\n if (layoutRelativeClientCoords) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n // reserves an empty inline-start gutter that clips nothing, so exclude just\n // the one scrollbar-side gutter \u2014 halve the measured (two-gutter) total. A\n // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n // `getHTMLOffset`/`visualViewport.width`; skip it here.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n if (gutter <= SCROLLBAR_MAX) {\n width -= gutter;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = getScale(element);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n rect = getViewportRect(element, strategy, clippingAncestor);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let lastKeptComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n // Position of the containing block chain below the current node. A fixed\n // element whose containing block hasn't been found yet is a fixed chain.\n const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n // A non-containing ancestor does not clip the element when the chain\n // below it escapes it: a fixed chain escapes all ancestors up to the\n // next containing block, an absolute chain escapes static ancestors.\n const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // The kept node carries the chain position for the next iteration.\n lastKeptComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n if (!isOffsetParentAnElement && documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n\n // The entry is a snapshot, so the reference may have moved since the\n // intersection was computed (under performance constraints, or between\n // consecutive frames of a multi-frame layout shift). The reported ratio\n // and the observed area are stale in that case and cannot be trusted to\n // detect subsequent movement, so refresh regardless of the ratio.\n if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n return refresh();\n }\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped in place, the ratio is 0. Throttle\n // the refresh to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n const win = getWindow(element);\n // The window is a resize ancestor, so when `ancestorResize` is enabled its\n // listener already runs the update on resize. Here we only need to rebuild\n // the `IntersectionObserver` for the new root size, skipping a redundant\n // update. When `ancestorResize` is disabled, this becomes the sole update.\n const handleResize = () => refresh(ancestorResize);\n win.addEventListener('resize', handleResize);\n refresh(true);\n return () => {\n win.removeEventListener('resize', handleResize);\n cleanup();\n };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update);\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = options != null ? options : {};\n const platformWithCache = {\n ...platform,\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n", "import { computePosition, arrow as arrow$2, autoPlacement as autoPlacement$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1 } from '@floating-ui/dom';\nexport { autoUpdate, computePosition, detectOverflow, getOverflowAncestors, platform } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\nvar isClient = typeof document !== 'undefined';\n\nvar noop = function noop() {};\nvar index = isClient ? useLayoutEffect : noop;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length;\n let i;\n let keys;\n if (a && b && typeof a === 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length !== b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!{}.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction getDPR(element) {\n if (typeof window === 'undefined') {\n return 1;\n }\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\n\nfunction roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n elements: {\n reference: externalReference,\n floating: externalFloating\n } = {},\n transform = true,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: 0,\n y: 0,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const [_reference, _setReference] = React.useState(null);\n const [_floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (node !== referenceRef.current) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (node !== floatingRef.current) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const referenceEl = externalReference || _reference;\n const floatingEl = externalFloating || _floating;\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const hasWhileElementsMounted = whileElementsMounted != null;\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const openRef = useLatestRef(open);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n // The floating element's position may be recomputed while it's closed\n // but still mounted (such as when transitioning out). To ensure\n // `isPositioned` will be `false` initially on the next open, avoid\n // setting it to `true` when `open === false` (must be specified).\n isPositioned: openRef.current !== false\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef, openRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (referenceEl) referenceRef.current = referenceEl;\n if (floatingEl) floatingRef.current = floatingEl;\n if (referenceEl && floatingEl) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(referenceEl, floatingEl, update);\n }\n update();\n }\n }, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference: referenceEl,\n floating: floatingEl\n }), [referenceEl, floatingEl]);\n const floatingStyles = React.useMemo(() => {\n const initialStyles = {\n position: strategy,\n left: 0,\n top: 0\n };\n if (!elements.floating) {\n return initialStyles;\n }\n const x = roundByDPR(elements.floating, data.x);\n const y = roundByDPR(elements.floating, data.y);\n if (transform) {\n return {\n ...initialStyles,\n transform: \"translate(\" + x + \"px, \" + y + \"px)\",\n ...(getDPR(elements.floating) >= 1.5 && {\n willChange: 'transform'\n })\n };\n }\n return {\n position: strategy,\n left: x,\n top: y\n };\n }, [strategy, transform, elements.floating, data.x, data.y]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n floatingStyles\n }), [data, update, refs, elements, floatingStyles]);\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow$1 = options => {\n function isRef(value) {\n return {}.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(state) {\n const {\n element,\n padding\n } = typeof options === 'function' ? options(state) : options;\n if (element && isRef(element)) {\n if (element.current != null) {\n return arrow$2({\n element: element.current,\n padding\n }).fn(state);\n }\n return {};\n }\n if (element) {\n return arrow$2({\n element,\n padding\n }).fn(state);\n }\n return {};\n }\n };\n};\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = (options, deps) => {\n const result = offset$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = (options, deps) => {\n const result = shift$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = (options, deps) => {\n const result = limitShift$1(options);\n return {\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = (options, deps) => {\n const result = flip$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = (options, deps) => {\n const result = size$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = (options, deps) => {\n const result = autoPlacement$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = (options, deps) => {\n const result = hide$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = (options, deps) => {\n const result = inline$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = (options, deps) => {\n const result = arrow$1(options);\n return {\n name: result.name,\n fn: result.fn,\n options: [options, deps]\n };\n};\n\nexport { arrow, autoPlacement, flip, hide, inline, limitShift, offset, shift, size, useFloating };\n", "'use client';\nimport { ComboboxCustom } from \"./Custom.js\";\nimport { isValidElement } from \"react\";\n//#region src/components/Combobox/utilities.ts\nfunction isComboboxCustom(child) {\n\treturn isValidElement(child) && child.type === ComboboxCustom;\n}\nfunction isInteractiveComboboxCustom(child) {\n\treturn isComboboxCustom(child) && child.props.interactive === true;\n}\nconst INTERNAL_OPTION_PREFIX = \"internal-option-\";\n/**\n* We use this function to prefix the value of the options so we can make sure numbers as strings are not parsed as numbers in objects\n* @param value\n* @returns\n*/\nconst prefix = (value) => {\n\treturn INTERNAL_OPTION_PREFIX + value;\n};\nconst removePrefix = (value) => {\n\treturn value.slice(16);\n};\nconst setReactInputValue = (input, value) => {\n\tconst previousValue = input.value;\n\tinput.value = value;\n\tconst tracker = input._valueTracker;\n\tif (typeof tracker !== \"undefined\") tracker.setValue(previousValue);\n\tinput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n};\n//#endregion\nexport { isComboboxCustom, isInteractiveComboboxCustom, prefix, removePrefix, setReactInputValue };\n", "'use client';\nimport { useDebounceCallback } from \"../../../utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.js\";\nimport \"../../../utilities/index.js\";\nimport { ComboboxContext } from \"../ComboboxContext.js\";\nimport { useComboboxId, useComboboxIdDispatch } from \"../ComboboxIdContext.js\";\nimport { prefix } from \"../utilities.js\";\nimport { useContext, useEffect, useId, useMemo } from \"react\";\nimport { useMergeRefs } from \"@floating-ui/react\";\n//#region src/components/Combobox/Option/useComboboxOption.tsx\nconst useComboboxOption = ({ id, ref, value }) => {\n\tconst generatedId = useId();\n\tconst newId = id || generatedId;\n\tconst context = useContext(ComboboxContext);\n\tconst { activeIndex } = useComboboxId();\n\tconst dispatch = useComboboxIdDispatch();\n\tif (!context) throw new Error(\"ComboboxOption must be used within a Combobox\");\n\tconst { selectedOptions, onOptionClick, setListRef, customIds, filteredOptions } = context;\n\tconst index = useMemo(() => filteredOptions.indexOf(prefix(String(value))) + customIds.length, [\n\t\tcustomIds.length,\n\t\tfilteredOptions,\n\t\tvalue\n\t]);\n\tconst combinedRef = useMergeRefs([(node) => {\n\t\tsetListRef(index, node);\n\t}, ref]);\n\tif (index === -1) throw new Error(\"Internal error: ComboboxOption did not find index\");\n\tconst selected = selectedOptions[prefix(value)];\n\tconst active = activeIndex === index;\n\tuseEffect(() => {\n\t\tif (active) dispatch?.({\n\t\t\ttype: \"SET_ACTIVE_INDEX\",\n\t\t\tpayload: index\n\t\t});\n\t}, [\n\t\tgeneratedId,\n\t\tid,\n\t\tdispatch,\n\t\tactive,\n\t\tindex\n\t]);\n\treturn {\n\t\tid: newId,\n\t\tref: combinedRef,\n\t\tselected,\n\t\tactive,\n\t\tonOptionClick: useDebounceCallback(() => onOptionClick(value), 50)\n\t};\n};\n//#endregion\nexport { useComboboxOption };\n", "'use client';\nimport { ComboboxContext } from \"../ComboboxContext.js\";\nimport { Label } from \"../../label/label.js\";\nimport { omit } from \"../omit/omit.js\";\nimport ComboboxOptionDescription from \"./Description.js\";\nimport { SelectedIcon } from \"./SelectedIcon.js\";\nimport { useComboboxOption } from \"./useComboboxOption.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, isValidElement, memo, useContext, useId } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/Combobox/Option/Option.tsx\nconst ComboboxOption = memo(forwardRef(({ value, description, children, className, ...rest }, forwardedRef) => {\n\tconst labelId = useId();\n\tconst { id, ref, selected, active, onOptionClick } = useComboboxOption({\n\t\tid: rest.id,\n\t\tref: forwardedRef,\n\t\tvalue\n\t});\n\tconst context = useContext(ComboboxContext);\n\tif (!context) throw new Error(\"ComboboxOption must be used within a Combobox\");\n\tconst { size, multiple, getItemProps } = context;\n\tconst props = getItemProps();\n\treturn /* @__PURE__ */ jsx(Label, {\n\t\t\"data-size\": \"md\",\n\t\tasChild: true,\n\t\tchildren: /* @__PURE__ */ jsxs(\"button\", {\n\t\t\tref,\n\t\t\tid,\n\t\t\trole: \"option\",\n\t\t\ttype: \"button\",\n\t\t\t\"aria-selected\": !!selected,\n\t\t\t\"aria-labelledby\": labelId,\n\t\t\ttabIndex: -1,\n\t\t\tonClick: (e) => {\n\t\t\t\tonOptionClick();\n\t\t\t\trest.onClick?.(e);\n\t\t\t},\n\t\t\tclassName: cl(\"ds-combobox__option\", active && \"ds-combobox__option--active\", multiple && \"ds-combobox__option--multiple\", className),\n\t\t\t...omit([\"displayValue\"], rest),\n\t\t\t...omit([\"onClick\", \"onPointerLeave\"], props),\n\t\t\tchildren: [/* @__PURE__ */ jsx(Label, {\n\t\t\t\tasChild: true,\n\t\t\t\t\"data-size\": size,\n\t\t\t\tchildren: /* @__PURE__ */ jsx(\"span\", { children: /* @__PURE__ */ jsx(SelectedIcon, {\n\t\t\t\t\tmultiple,\n\t\t\t\t\tselected: !!selected\n\t\t\t\t}) })\n\t\t\t}), /* @__PURE__ */ jsxs(Label, {\n\t\t\t\tclassName: \"ds-combobox__option__label\",\n\t\t\t\t\"data-size\": size,\n\t\t\t\tid: labelId,\n\t\t\t\tchildren: [children, description && /* @__PURE__ */ jsx(ComboboxOptionDescription, { children: description })]\n\t\t\t})]\n\t\t})\n\t});\n}));\nComboboxOption.displayName = \"ComboboxOption\";\nfunction isComboboxOption(child) {\n\treturn isValidElement(child) && child.type === ComboboxOption;\n}\n//#endregion\nexport { ComboboxOption, isComboboxOption };\n", "'use client';\nimport { ComboboxContext } from \"./ComboboxContext.js\";\nimport { Label } from \"../label/label.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useContext } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/Combobox/Empty.tsx\nconst ComboboxEmpty = forwardRef(({ children, className, ...rest }, ref) => {\n\tconst context = useContext(ComboboxContext);\n\tif (!context) throw new Error(\"ComboboxEmpty must be used within a Combobox\");\n\tconst { filteredOptions, size } = context;\n\treturn filteredOptions.length === 0 && /* @__PURE__ */ jsx(Label, {\n\t\t\"data-size\": size,\n\t\tasChild: true,\n\t\tchildren: /* @__PURE__ */ jsx(\"div\", {\n\t\t\tref,\n\t\t\tclassName: cl(\"ds-combobox__empty\", className),\n\t\t\t...rest,\n\t\t\tchildren\n\t\t})\n\t});\n});\nComboboxEmpty.displayName = \"ComboboxEmpty\";\n//#endregion\nexport { ComboboxEmpty };\n", "'use client';\nimport { ValidationMessage } from \"../../validation-message/validation-message.js\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/Combobox/internal/ComboboxError.tsx\nconst ComboboxError = ({ size, error, formFieldProps }) => {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: \"ds-combobox__error-message\",\n\t\tid: formFieldProps.errorId,\n\t\t\"aria-live\": \"polite\",\n\t\t\"aria-relevant\": \"additions removals\",\n\t\tchildren: error && /* @__PURE__ */ jsx(ValidationMessage, {\n\t\t\t\"data-size\": size,\n\t\t\tchildren: error\n\t\t})\n\t});\n};\nComboboxError.displayName = \"ComboboxError\";\n//#endregion\nexport { ComboboxError as default };\n", "'use client';\nimport { ComboboxContext } from \"../ComboboxContext.js\";\nimport { ChipRemovable } from \"../../chip/chips.js\";\nimport \"../../chip/index.js\";\nimport { useContext } from \"react\";\nimport { Fragment as Fragment$1, jsx } from \"react/jsx-runtime\";\n//#region src/components/Combobox/internal/ComboboxChips.tsx\nconst ComboboxChips = () => {\n\tconst context = useContext(ComboboxContext);\n\tif (!context) throw new Error(\"ComboboxContext is missing\");\n\tconst { size, readOnly, disabled, selectedOptions, chipSrLabel, handleSelectOption, inputRef } = context;\n\treturn /* @__PURE__ */ jsx(Fragment$1, { children: Object.keys(selectedOptions).map((value) => {\n\t\treturn /* @__PURE__ */ jsx(ChipRemovable, {\n\t\t\t\"data-size\": size,\n\t\t\tdisabled,\n\t\t\tonKeyDown: (e) => {\n\t\t\t\tif (readOnly) return;\n\t\t\t\tif (disabled) return;\n\t\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleSelectOption({\n\t\t\t\t\t\toption: selectedOptions[value],\n\t\t\t\t\t\tremove: true\n\t\t\t\t\t});\n\t\t\t\t\tinputRef?.current?.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tonClick: () => {\n\t\t\t\tif (readOnly) return;\n\t\t\t\tif (disabled) return;\n\t\t\t\thandleSelectOption({\n\t\t\t\t\toption: selectedOptions[value],\n\t\t\t\t\tremove: true\n\t\t\t\t});\n\t\t\t},\n\t\t\t\"aria-label\": chipSrLabel(selectedOptions[value]),\n\t\t\tchildren: selectedOptions[value].label\n\t\t}, value);\n\t}) });\n};\nComboboxChips.displayName = \"ComboboxChips\";\n//#endregion\nexport { ComboboxChips as default };\n", "'use client';\nimport { ComboboxContext } from \"../ComboboxContext.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useContext } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { XMarkIcon } from \"@navikt/aksel-icons\";\n//#region src/components/Combobox/internal/ComboboxClearButton.tsx\nconst ComboboxClearButton = forwardRef((props, ref) => {\n\tconst context = useContext(ComboboxContext);\n\tif (!context) throw new Error(\"ComboboxContext is missing\");\n\tconst { readOnly, disabled, clearButtonLabel, handleSelectOption } = context;\n\treturn /* @__PURE__ */ jsx(\"button\", {\n\t\t...props,\n\t\tref,\n\t\tdisabled,\n\t\tclassName: cl(\"ds-combobox__clear-button\", `ds-focus`),\n\t\tonClick: () => {\n\t\t\tif (readOnly) return;\n\t\t\tif (disabled) return;\n\t\t\thandleSelectOption({\n\t\t\t\toption: null,\n\t\t\t\tclear: true\n\t\t\t});\n\t\t},\n\t\tonKeyDown: (e) => {\n\t\t\tif (readOnly) return;\n\t\t\tif (disabled) return;\n\t\t\tif (e.key === \"Enter\") {\n\t\t\t\te.stopPropagation();\n\t\t\t\thandleSelectOption({\n\t\t\t\t\toption: null,\n\t\t\t\t\tclear: true\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\ttype: \"button\",\n\t\t\"aria-label\": clearButtonLabel,\n\t\tchildren: /* @__PURE__ */ jsx(XMarkIcon, {\n\t\t\theight: \"1.5em\",\n\t\t\twidth: \"1.5em\",\n\t\t\ttitle: \"Clear selection\"\n\t\t})\n\t});\n});\nComboboxClearButton.displayName = \"ComboboxClearButton\";\n//#endregion\nexport { ComboboxClearButton as default };\n", "'use client';\nimport { ComboboxContext } from \"../ComboboxContext.js\";\nimport { useComboboxIdDispatch } from \"../ComboboxIdContext.js\";\nimport { omit } from \"../omit/omit.js\";\nimport { Paragraph } from \"../../paragraph/paragraph.js\";\nimport { prefix } from \"../utilities.js\";\nimport ComboboxChips from \"./ComboboxChips.js\";\nimport ComboboxClearButton from \"./ComboboxClearButton.js\";\nimport cl from \"clsx/lite\";\nimport { useContext, useRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { useMergeRefs } from \"@floating-ui/react\";\nimport { ChevronDownIcon, ChevronUpIcon } from \"@navikt/aksel-icons\";\n//#region src/components/Combobox/internal/ComboboxInput.tsx\nconst ComboboxInput = ({ hideClearButton, listId, error, hideChips, handleKeyDown, ...rest }) => {\n\tconst context = useContext(ComboboxContext);\n\tconst idDispatch = useComboboxIdDispatch();\n\tconst clearButtonRef = useRef(null);\n\tif (!context) throw new Error(\"ComboboxContext is missing\");\n\tconst setActiveIndex = (id) => {\n\t\tidDispatch?.({\n\t\t\ttype: \"SET_ACTIVE_INDEX\",\n\t\t\tpayload: id\n\t\t});\n\t};\n\tconst { forwareddRef, readOnly, disabled, open, inputRef, refs, inputValue, multiple, selectedOptions, formFieldProps, htmlSize, options, setOpen, getReferenceProps, setInputValue, handleSelectOption, size } = context;\n\tconst mergedRefs = useMergeRefs([forwareddRef, inputRef]);\n\tconst onChange = (event) => {\n\t\tconst value = event.target.value;\n\t\tsetInputValue(value);\n\t\tsetActiveIndex(0);\n\t\tfor (const option of Object.values(options)) if (option.label.toLowerCase() === value.toLowerCase()) {\n\t\t\tif (selectedOptions[prefix(option.value)]) continue;\n\t\t\thandleSelectOption({ option });\n\t\t}\n\t};\n\tconst showClearButton = !hideClearButton && Object.keys(selectedOptions).length > 0;\n\tconst props = getReferenceProps({\n\t\tref: refs?.setReference,\n\t\trole: null,\n\t\t\"aria-controls\": null,\n\t\t\"aria-expanded\": null,\n\t\t\"aria-haspopup\": null,\n\t\tonClick(event) {\n\t\t\tif (disabled) return;\n\t\t\tif (readOnly) return;\n\t\t\tif (clearButtonRef.current?.contains(event.target)) return;\n\t\t\tsetOpen(!open);\n\t\t\tsetActiveIndex(0);\n\t\t\tinputRef.current?.focus();\n\t\t},\n\t\tonKeyDown: handleKeyDown,\n\t\tonKeyPress(event) {\n\t\t\tif (event.key === \"Enter\") event.preventDefault();\n\t\t}\n\t});\n\treturn /* @__PURE__ */ jsx(Paragraph, {\n\t\t\"data-size\": size,\n\t\tasChild: true,\n\t\tchildren: /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t...props,\n\t\t\t\"aria-disabled\": disabled ? \"true\" : void 0,\n\t\t\tclassName: cl(\"ds-textfield__input\", \"ds-combobox__input__wrapper\", readOnly && \"ds-combobox--readonly\", error && \"ds-combobox--error\"),\n\t\t\tchildren: [\n\t\t\t\t/* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\tclassName: \"ds-combobox__chip-and-input\",\n\t\t\t\t\tchildren: [multiple && !hideChips && /* @__PURE__ */ jsx(ComboboxChips, {}), /* @__PURE__ */ jsx(Paragraph, {\n\t\t\t\t\t\t\"data-size\": size,\n\t\t\t\t\t\tasChild: true,\n\t\t\t\t\t\tchildren: /* @__PURE__ */ jsx(\"input\", {\n\t\t\t\t\t\t\tref: mergedRefs,\n\t\t\t\t\t\t\t\"aria-activedescendant\": props[\"aria-activedescendant\"],\n\t\t\t\t\t\t\treadOnly,\n\t\t\t\t\t\t\t\"aria-autocomplete\": \"list\",\n\t\t\t\t\t\t\trole: \"combobox\",\n\t\t\t\t\t\t\t\"aria-expanded\": open,\n\t\t\t\t\t\t\t\"aria-controls\": open ? listId : void 0,\n\t\t\t\t\t\t\tautoComplete: \"off\",\n\t\t\t\t\t\t\tsize: htmlSize,\n\t\t\t\t\t\t\tvalue: inputValue,\n\t\t\t\t\t\t\t...omit([\"style\", \"className\"], rest),\n\t\t\t\t\t\t\t...formFieldProps.inputProps,\n\t\t\t\t\t\t\tclassName: \"ds-combobox__input\",\n\t\t\t\t\t\t\tonChange: (e) => {\n\t\t\t\t\t\t\t\tonChange(e);\n\t\t\t\t\t\t\t\t!open && setOpen(true);\n\t\t\t\t\t\t\t\trest.onChange?.(e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t})]\n\t\t\t\t}),\n\t\t\t\tshowClearButton && /* @__PURE__ */ jsx(ComboboxClearButton, { ref: clearButtonRef }),\n\t\t\t\t/* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\tclassName: \"ds-combobox__arrow\",\n\t\t\t\t\tchildren: open ? /* @__PURE__ */ jsx(ChevronUpIcon, {\n\t\t\t\t\t\ttitle: \"arrow up\",\n\t\t\t\t\t\theight: \"1.5em\",\n\t\t\t\t\t\twidth: \"1.5em\"\n\t\t\t\t\t}) : /* @__PURE__ */ jsx(ChevronDownIcon, {\n\t\t\t\t\t\ttitle: \"arrow down\",\n\t\t\t\t\t\theight: \"1.5em\",\n\t\t\t\t\t\twidth: \"1.5em\"\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t});\n};\nComboboxInput.displayName = \"ComboboxInput\";\n//#endregion\nexport { ComboboxInput as default };\n", "'use client';\nimport { Label } from \"../../label/label.js\";\nimport { Paragraph } from \"../../paragraph/paragraph.js\";\nimport cl from \"clsx/lite\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nimport { PadlockLockedFillIcon } from \"@navikt/aksel-icons\";\n//#region src/components/Combobox/internal/ComboboxLabel.tsx\nconst ComboboxLabel = ({ label, description, hideLabel, size, readOnly, formFieldProps }) => {\n\treturn /* @__PURE__ */ jsxs(Fragment, { children: [label && /* @__PURE__ */ jsxs(Label, {\n\t\t\"data-size\": size,\n\t\thtmlFor: formFieldProps.inputProps.id,\n\t\tclassName: cl(\"ds-combobox__label\", hideLabel && `ds-sr-only`),\n\t\tchildren: [readOnly && /* @__PURE__ */ jsx(PadlockLockedFillIcon, {\n\t\t\t\"aria-hidden\": true,\n\t\t\tclassName: \"ds-combobox__readonly__icon\"\n\t\t}), label]\n\t}), description && /* @__PURE__ */ jsx(Paragraph, {\n\t\tasChild: true,\n\t\t\"data-size\": size,\n\t\tchildren: /* @__PURE__ */ jsx(\"div\", {\n\t\t\tid: formFieldProps.descriptionId,\n\t\t\tclassName: cl(\"ds-combobox__description\", hideLabel && `ds-sr-only`),\n\t\t\tchildren: description\n\t\t})\n\t})] });\n};\nComboboxLabel.displayName = \"ComboboxLabel\";\n//#endregion\nexport { ComboboxLabel as default };\n", "'use client';\nimport { removePrefix } from \"../utilities.js\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/Combobox/internal/ComboboxNative.tsx\nconst ComboboxNative = ({ selectedOptions, multiple, name }) => {\n\tconst VALUE = Object.keys(selectedOptions).map((key) => removePrefix(key));\n\treturn /* @__PURE__ */ jsx(\"select\", {\n\t\tname,\n\t\tmultiple,\n\t\tstyle: { display: \"none\" },\n\t\tvalue: multiple ? VALUE : VALUE[0],\n\t\tonChange: () => {},\n\t\tchildren: VALUE.map((value) => /* @__PURE__ */ jsx(\"option\", { value }, value))\n\t});\n};\nComboboxNative.displayName = \"ComboboxNative\";\n//#endregion\nexport { ComboboxNative as default };\n", "'use client';\nimport { isInteractiveComboboxCustom, prefix } from \"./utilities.js\";\nimport { isComboboxOption } from \"./Option/Option.js\";\nimport { Children, useCallback, useMemo, useState } from \"react\";\n//#region src/components/Combobox/useCombobox.tsx\nconst isOption = (option) => !!option;\nfunction useCombobox({ children, inputValue, multiple, filter = (inputValue, option) => {\n\treturn option.label.toLowerCase().startsWith(inputValue.toLowerCase());\n}, initialValue }) {\n\tconst filterCallback = useCallback(filter, [filter]);\n\tconst { optionsChildren, customIds, restChildren, interactiveChildren } = useMemo(() => {\n\t\treturn Children.toArray(children).reduce((acc, child) => {\n\t\t\tif (isComboboxOption(child)) acc.optionsChildren.push(child);\n\t\t\telse {\n\t\t\t\tacc.restChildren.push(child);\n\t\t\t\tif (isInteractiveComboboxCustom(child)) {\n\t\t\t\t\tconst childElement = child;\n\t\t\t\t\tacc.interactiveChildren.push(childElement);\n\t\t\t\t\tif (!childElement.props.id) throw new Error(\"If ComboboxCustom is interactive, it must have an id\");\n\t\t\t\t\tacc.customIds.push(childElement.props.id);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, {\n\t\t\toptionsChildren: [],\n\t\t\tcustomIds: [],\n\t\t\trestChildren: [],\n\t\t\tinteractiveChildren: []\n\t\t});\n\t}, [children]);\n\tconst options = useMemo(() => {\n\t\tconst values = [];\n\t\tconst allOptions = {};\n\t\toptionsChildren.map((child) => {\n\t\t\tconst props = child.props;\n\t\t\tlet label = props.displayValue || \"\";\n\t\t\tif (!props.displayValue) {\n\t\t\t\tlet childrenLabel = \"\";\n\t\t\t\tChildren.forEach(props.children, (child) => {\n\t\t\t\t\tif (typeof child === \"string\") childrenLabel += child;\n\t\t\t\t\telse throw new Error(\"If ComboboxOption is not a string, it must have a displayValue prop\");\n\t\t\t\t});\n\t\t\t\tlabel = childrenLabel;\n\t\t\t}\n\t\t\tif (values.includes(props.value)) console.warn(`Combobox has multiple options with the same value: ${props.value}`);\n\t\t\tvalues.push(props.value);\n\t\t\tallOptions[prefix(String(props.value))] = {\n\t\t\t\tvalue: String(props.value),\n\t\t\t\tlabel,\n\t\t\t\tdisplayValue: props.displayValue,\n\t\t\t\tdescription: props.description\n\t\t\t};\n\t\t\treturn null;\n\t\t});\n\t\treturn allOptions;\n\t}, [optionsChildren]);\n\tconst [selectedOptions, setSelectedOptions] = useState(useMemo(() => (initialValue?.map((key) => {\n\t\treturn prefix(key);\n\t}) || []).reduce((acc, value) => {\n\t\tconst option = options[value];\n\t\tif (isOption(option)) acc[value] = option;\n\t\treturn acc;\n\t}, {}), [initialValue, options]));\n\tconst { filteredOptions, filteredOptionsChildren } = useMemo(() => {\n\t\tconst filteredOptions = [];\n\t\treturn {\n\t\t\tfilteredOptions,\n\t\t\tfilteredOptionsChildren: Object.keys(options).map((option, index) => {\n\t\t\t\tif (!multiple && Object.keys(selectedOptions).length === 1) {\n\t\t\t\t\tfilteredOptions.push(option);\n\t\t\t\t\treturn optionsChildren[index];\n\t\t\t\t}\n\t\t\t\tif (multiple && selectedOptions[option]) {\n\t\t\t\t\tfilteredOptions.push(option);\n\t\t\t\t\treturn optionsChildren[index];\n\t\t\t\t}\n\t\t\t\tif (filterCallback(inputValue, options[option])) {\n\t\t\t\t\tfilteredOptions.push(option);\n\t\t\t\t\treturn optionsChildren[index];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}).filter((child) => child)\n\t\t};\n\t}, [\n\t\tfilterCallback,\n\t\tinputValue,\n\t\tmultiple,\n\t\toptions,\n\t\toptionsChildren,\n\t\tselectedOptions\n\t]);\n\treturn {\n\t\tfilteredOptionsChildren,\n\t\tfilteredOptions,\n\t\trestChildren,\n\t\toptions,\n\t\tcustomIds,\n\t\tselectedOptions,\n\t\tinteractiveChildren,\n\t\tsetSelectedOptions\n\t};\n}\n//#endregion\nexport { useCombobox };\n", "'use client';\nimport { useDebounceCallback } from \"../../utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.js\";\nimport \"../../utilities/index.js\";\nimport { useComboboxId } from \"./ComboboxIdContext.js\";\n//#region src/components/Combobox/useComboboxKeyboard.tsx\nconst useComboboxKeyboard = ({ readOnly, disabled, interactiveChildren, filteredOptions, inputValue, selectedOptions, multiple, open, options, setOpen, handleSelectOption }) => {\n\tconst { activeIndex } = useComboboxId();\n\tconst handleKeyDownFunc = (event) => {\n\t\tif (readOnly || disabled) return;\n\t\tif (!event) return;\n\t\tswitch (event.key) {\n\t\t\tcase \"ArrowDown\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (open) break;\n\t\t\t\tsetOpen(true);\n\t\t\t\tbreak;\n\t\t\tcase \"ArrowUp\":\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (activeIndex !== 0) break;\n\t\t\t\tsetOpen(false);\n\t\t\t\tbreak;\n\t\t\tcase \"Enter\": {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (!open) break;\n\t\t\t\tif (activeIndex <= interactiveChildren.length - 1) {\n\t\t\t\t\tconst selectedComponent = interactiveChildren[activeIndex];\n\t\t\t\t\tif (selectedComponent.props.onSelect) {\n\t\t\t\t\t\tselectedComponent?.props.onSelect();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst option = filteredOptions[activeIndex - interactiveChildren.length];\n\t\t\t\thandleSelectOption({ option: options[option] });\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"Backspace\":\n\t\t\t\tif (!multiple) {\n\t\t\t\t\tconst lastOption = Object.keys(selectedOptions).pop();\n\t\t\t\t\tlastOption && handleSelectOption({\n\t\t\t\t\t\toption: selectedOptions[lastOption],\n\t\t\t\t\t\tremove: true\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (inputValue === \"\" && multiple) {\n\t\t\t\t\tconst lastOption = Object.keys(selectedOptions).pop();\n\t\t\t\t\tlastOption && handleSelectOption({\n\t\t\t\t\t\toption: selectedOptions[lastOption],\n\t\t\t\t\t\tremove: true\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault: break;\n\t\t}\n\t};\n\treturn useDebounceCallback(handleKeyDownFunc, 20);\n};\n//#endregion\nexport { useComboboxKeyboard };\n", "'use client';\nimport { useComboboxId, useComboboxIdDispatch } from \"./ComboboxIdContext.js\";\nimport { useState } from \"react\";\nimport { autoUpdate, flip, offset, size, useDismiss, useFloating, useInteractions, useListNavigation, useRole } from \"@floating-ui/react\";\nimport { flushSync } from \"react-dom\";\n//#region src/components/Combobox/useFloatingCombobox.tsx\nconst useFloatingCombobox = ({ listRef }) => {\n\tconst [open, setOpen] = useState(false);\n\tconst { activeIndex } = useComboboxId();\n\tconst dispatch = useComboboxIdDispatch();\n\tconst { refs, floatingStyles, context } = useFloating({\n\t\topen,\n\t\tonOpenChange: (newOpen) => {\n\t\t\tif (!newOpen) dispatch?.({\n\t\t\t\ttype: \"SET_ACTIVE_INDEX\",\n\t\t\t\tpayload: 0\n\t\t\t});\n\t\t\tflushSync(() => {\n\t\t\t\tif (refs.floating.current && !newOpen) refs.floating.current.scrollTop = 0;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tsetOpen(newOpen);\n\t\t\t\t}, 1);\n\t\t\t});\n\t\t},\n\t\twhileElementsMounted: (reference, floating, update) => {\n\t\t\tautoUpdate(reference, floating, update);\n\t\t\treturn () => {\n\t\t\t\tfloating.scrollTop = 0;\n\t\t\t};\n\t\t},\n\t\tmiddleware: [\n\t\t\tflip({ padding: 10 }),\n\t\t\tsize({ apply({ rects, elements }) {\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tObject.assign(elements.floating.style, {\n\t\t\t\t\t\twidth: `${rects.reference.width}px`,\n\t\t\t\t\t\tmaxHeight: `200px`\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} }),\n\t\t\toffset(10)\n\t\t]\n\t});\n\tconst { getReferenceProps, getFloatingProps, getItemProps } = useInteractions([\n\t\tuseRole(context, { role: \"listbox\" }),\n\t\tuseDismiss(context),\n\t\tuseListNavigation(context, {\n\t\t\tlistRef,\n\t\t\tactiveIndex,\n\t\t\tvirtual: true,\n\t\t\tscrollItemIntoView: true,\n\t\t\tenabled: open,\n\t\t\tfocusItemOnHover: true,\n\t\t\tonNavigate: (index) => {\n\t\t\t\tdispatch?.({\n\t\t\t\t\ttype: \"SET_ACTIVE_INDEX\",\n\t\t\t\t\tpayload: index || 0\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t]);\n\treturn {\n\t\topen,\n\t\tsetOpen,\n\t\tactiveIndex,\n\t\trefs,\n\t\tfloatingStyles,\n\t\tcontext,\n\t\tgetReferenceProps,\n\t\tgetFloatingProps,\n\t\tgetItemProps\n\t};\n};\n//#endregion\nexport { useFloatingCombobox };\n", "'use client';\nimport { createContext } from \"react\";\n//#region src/components/Combobox/useFormField/FieldsetContext.ts\nconst FieldsetContext = createContext(null);\n//#endregion\nexport { FieldsetContext };\n", "'use client';\nimport { FieldsetContext } from \"./FieldsetContext.js\";\nimport cl from \"clsx/lite\";\nimport { useContext, useId } from \"react\";\n//#region src/components/Combobox/useFormField/useFormField.ts\n/**\n* Handles props and their state for various form-fields in context with Fieldset\n*/\nconst useFormField = (props, prefix) => {\n\tconst fieldset = useContext(FieldsetContext);\n\tconst randomId = useId();\n\tconst id = props.id ?? `${prefix}-${randomId}`;\n\tconst errorId = props.errorId ?? `${prefix}-error-${randomId}`;\n\tconst descriptionId = `${prefix}-description-${randomId}`;\n\tconst size = props.size ?? fieldset?.size ?? \"md\";\n\tconst disabled = fieldset?.disabled || props?.disabled;\n\tconst hasError = !disabled && !!(props.error || fieldset?.error);\n\treturn {\n\t\thasError,\n\t\terrorId,\n\t\tdescriptionId,\n\t\tsize,\n\t\tinputProps: {\n\t\t\tid,\n\t\t\tdisabled,\n\t\t\t\"aria-invalid\": hasError ? true : void 0,\n\t\t\t\"aria-describedby\": cl(props[\"aria-describedby\"], !!props?.description && typeof props?.description === \"string\" && descriptionId, hasError && !fieldset?.error && errorId, hasError && !!fieldset?.error && fieldset?.errorId) || void 0\n\t\t}\n\t};\n};\n//#endregion\nexport { useFormField };\n", "'use client';\nimport { useDebounceCallback } from \"../../utilities/hooks/deprecated/use-debounce-callback/use-debounce-callback.js\";\nimport \"../../utilities/index.js\";\nimport { Spinner } from \"../spinner/spinner.js\";\nimport { ComboboxContext } from \"./ComboboxContext.js\";\nimport { ComboboxIdProvider } from \"./ComboboxIdContext.js\";\nimport { omit } from \"./omit/omit.js\";\nimport { ComboboxCustom } from \"./Custom.js\";\nimport ComboboxError from \"./internal/ComboboxError.js\";\nimport { prefix, removePrefix, setReactInputValue } from \"./utilities.js\";\nimport ComboboxInput from \"./internal/ComboboxInput.js\";\nimport ComboboxLabel from \"./internal/ComboboxLabel.js\";\nimport ComboboxNative from \"./internal/ComboboxNative.js\";\nimport { useCombobox } from \"./useCombobox.js\";\nimport { useComboboxKeyboard } from \"./useComboboxKeyboard.js\";\nimport { useFloatingCombobox } from \"./useFloatingCombobox.js\";\nimport { useFormField } from \"./useFormField/useFormField.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useEffect, useRef, useState } from \"react\";\nimport { Fragment as Fragment$1, jsx, jsxs } from \"react/jsx-runtime\";\nimport { FloatingFocusManager, FloatingPortal } from \"@floating-ui/react\";\nimport { useVirtualizer } from \"@tanstack/react-virtual\";\n//#region src/components/Combobox/Combobox.tsx\n/**\n* @deprecated Use `Suggestion` instead\n*/\nconst ComboboxComponent = forwardRef(({ value, initialValue = [], onValueChange, label, hideLabel = false, description, multiple = false, disabled = false, readOnly = false, hideChips = false, clearButtonLabel = \"Fjern alt\", hideClearButton = false, error, errorId, id, name, portal = true, htmlSize = 0, virtual = false, children, style, size = \"md\", loading, loadingLabel = \"Laster...\", filter, chipSrLabel = (option) => \"Slett \" + option.label, className, ...rest }, forwareddRef) => {\n\tconst inputRef = useRef(null);\n\tconst portalRef = useRef(null);\n\tconst listRef = useRef([]);\n\tconst [inputValue, setInputValue] = useState(rest.inputValue || \"\");\n\tuseEffect(() => {\n\t\tif (typeof rest.inputValue === \"string\") setInputValue(rest.inputValue);\n\t}, [rest.inputValue]);\n\tconst { selectedOptions, options, restChildren, interactiveChildren, customIds, filteredOptionsChildren, filteredOptions, setSelectedOptions } = useCombobox({\n\t\tchildren,\n\t\tinputValue,\n\t\tfilter,\n\t\tmultiple,\n\t\tinitialValue\n\t});\n\tconst { open, setOpen, refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingCombobox({ listRef });\n\tconst formFieldProps = useFormField({\n\t\tdisabled,\n\t\treadOnly,\n\t\terror,\n\t\terrorId,\n\t\tsize,\n\t\tdescription,\n\t\tid\n\t}, \"combobox\");\n\tuseEffect(() => {\n\t\tif (value && value.length > 0 && !multiple) {\n\t\t\tconst option = options[prefix(value[0])];\n\t\t\tinputRef.current && setReactInputValue(inputRef.current, option?.label || \"\");\n\t\t}\n\t}, [\n\t\tmultiple,\n\t\tvalue,\n\t\toptions\n\t]);\n\tuseEffect(() => {\n\t\tif (value && Object.keys(options).length >= 0) {\n\t\t\tconst updatedSelectedOptions = value.map((option) => {\n\t\t\t\treturn options[prefix(option)];\n\t\t\t});\n\t\t\tsetSelectedOptions(updatedSelectedOptions.reduce((acc, value) => {\n\t\t\t\tacc[prefix(value.value)] = value;\n\t\t\t\treturn acc;\n\t\t\t}, {}));\n\t\t}\n\t}, [\n\t\tmultiple,\n\t\tvalue,\n\t\toptions,\n\t\tsetSelectedOptions\n\t]);\n\tconst handleSelectOption = (args) => {\n\t\tconst { option, clear, remove } = args;\n\t\tif (clear) {\n\t\t\tsetSelectedOptions({});\n\t\t\tinputRef.current && setReactInputValue(inputRef.current, \"\");\n\t\t\tonValueChange?.([]);\n\t\t\treturn;\n\t\t}\n\t\tif (!option) return;\n\t\tif (remove) {\n\t\t\tconst newSelectedOptions = { ...selectedOptions };\n\t\t\tdelete newSelectedOptions[prefix(option.value)];\n\t\t\tsetSelectedOptions(newSelectedOptions);\n\t\t\tonValueChange?.(Object.keys(newSelectedOptions).map((key) => removePrefix(key)));\n\t\t\treturn;\n\t\t}\n\t\tconst newSelectedOptions = { ...selectedOptions };\n\t\tif (multiple) {\n\t\t\tif (newSelectedOptions[prefix(option.value)]) delete newSelectedOptions[prefix(option.value)];\n\t\t\telse newSelectedOptions[prefix(option.value)] = option;\n\t\t\tinputRef.current && setReactInputValue(inputRef.current, \"\");\n\t\t\tinputRef.current?.focus();\n\t\t} else {\n\t\t\tfor (const key of Object.keys(newSelectedOptions)) delete newSelectedOptions[key];\n\t\t\tnewSelectedOptions[prefix(option.value)] = option;\n\t\t\tinputRef.current && setReactInputValue(inputRef.current, option?.label || \"\");\n\t\t\tsetTimeout(() => {\n\t\t\t\tinputRef.current?.setSelectionRange(option?.label?.length || 0, option?.label?.length || 0);\n\t\t\t}, 0);\n\t\t}\n\t\tsetSelectedOptions(newSelectedOptions);\n\t\tonValueChange?.(Object.keys(newSelectedOptions).map((key) => removePrefix(key)));\n\t\t!multiple && setOpen(false);\n\t\trefs.domReference.current?.focus();\n\t};\n\tconst debouncedHandleSelectOption = useDebounceCallback(handleSelectOption, 50);\n\tconst handleKeyDown = useComboboxKeyboard({\n\t\tfilteredOptions,\n\t\tselectedOptions,\n\t\treadOnly: formFieldProps.readOnly || false,\n\t\tdisabled,\n\t\tmultiple,\n\t\tinputValue,\n\t\toptions,\n\t\topen,\n\t\tinteractiveChildren,\n\t\tsetOpen,\n\t\tsetInputValue,\n\t\thandleSelectOption: debouncedHandleSelectOption\n\t});\n\tconst rowVirtualizer = useVirtualizer({\n\t\tcount: Object.keys(filteredOptionsChildren).length,\n\t\tgetScrollElement: () => virtual ? refs.floating.current : null,\n\t\testimateSize: () => 70,\n\t\tmeasureElement: (elem) => {\n\t\t\treturn elem.getBoundingClientRect().height;\n\t\t},\n\t\toverscan: 7\n\t});\n\treturn /* @__PURE__ */ jsxs(ComboboxContext.Provider, {\n\t\tvalue: {\n\t\t\tsize,\n\t\t\toptions,\n\t\t\tselectedOptions,\n\t\t\tmultiple,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\topen,\n\t\t\tinputRef,\n\t\t\trefs,\n\t\t\tinputValue,\n\t\t\tformFieldProps,\n\t\t\thtmlSize,\n\t\t\tclearButtonLabel,\n\t\t\tcustomIds,\n\t\t\tfilteredOptions,\n\t\t\tsetInputValue,\n\t\t\tsetOpen,\n\t\t\tgetReferenceProps,\n\t\t\tgetItemProps,\n\t\t\tonOptionClick: (value) => {\n\t\t\t\tif (readOnly) return;\n\t\t\t\tif (disabled) return;\n\t\t\t\tconst option = options[prefix(value)];\n\t\t\t\tdebouncedHandleSelectOption({ option });\n\t\t\t},\n\t\t\thandleSelectOption: debouncedHandleSelectOption,\n\t\t\tchipSrLabel,\n\t\t\tlistRef,\n\t\t\tforwareddRef,\n\t\t\tsetListRef: (index, node) => {\n\t\t\t\tlistRef.current[index] = node;\n\t\t\t}\n\t\t},\n\t\tchildren: [/* @__PURE__ */ jsxs(\"div\", {\n\t\t\tclassName: cl(\"ds-combobox\", `ds-combobox--${size}`, disabled && \"ds-combobox__disabled\", className),\n\t\t\tstyle,\n\t\t\tref: portalRef,\n\t\t\tchildren: [\n\t\t\t\tname && /* @__PURE__ */ jsx(ComboboxNative, {\n\t\t\t\t\tname,\n\t\t\t\t\tselectedOptions,\n\t\t\t\t\tmultiple\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsx(ComboboxLabel, {\n\t\t\t\t\tlabel,\n\t\t\t\t\tdescription,\n\t\t\t\t\tsize,\n\t\t\t\t\treadOnly,\n\t\t\t\t\thideLabel,\n\t\t\t\t\tformFieldProps\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsx(ComboboxInput, {\n\t\t\t\t\t...omit([\"inputValue\"], rest),\n\t\t\t\t\thideClearButton,\n\t\t\t\t\tlistId: context.floatingId || \"\",\n\t\t\t\t\terror,\n\t\t\t\t\thideChips,\n\t\t\t\t\thandleKeyDown,\n\t\t\t\t\t\"aria-busy\": loading\n\t\t\t\t}),\n\t\t\t\t/* @__PURE__ */ jsx(ComboboxError, {\n\t\t\t\t\tsize,\n\t\t\t\t\terror,\n\t\t\t\t\tformFieldProps\n\t\t\t\t})\n\t\t\t]\n\t\t}), open && /* @__PURE__ */ jsx(FloatingPortal, {\n\t\t\troot: portal ? null : portalRef,\n\t\t\tchildren: /* @__PURE__ */ jsx(FloatingFocusManager, {\n\t\t\t\tcontext,\n\t\t\t\tinitialFocus: -1,\n\t\t\t\tvisuallyHiddenDismiss: true,\n\t\t\t\tchildren: /* @__PURE__ */ jsxs(\"div\", {\n\t\t\t\t\t\"aria-labelledby\": formFieldProps.inputProps.id,\n\t\t\t\t\t\"aria-autocomplete\": \"list\",\n\t\t\t\t\ttabIndex: -1,\n\t\t\t\t\t...getFloatingProps({\n\t\t\t\t\t\tref: refs.setFloating,\n\t\t\t\t\t\tstyle: { ...floatingStyles }\n\t\t\t\t\t}),\n\t\t\t\t\tclassName: cl(\"ds-combobox__options-wrapper\", `ds-combobox--${size}`),\n\t\t\t\t\tchildren: [virtual && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\theight: `${rowVirtualizer.getTotalSize()}px`,\n\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\tposition: \"relative\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\tchildren: rowVirtualizer.getVirtualItems().map((virtualRow) => /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\t\t\tref: rowVirtualizer.measureElement,\n\t\t\t\t\t\t\t\"data-index\": virtualRow.index,\n\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\ttransform: `translateY(${virtualRow.start}px)`\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tchildren: filteredOptionsChildren[virtualRow.index]\n\t\t\t\t\t\t}, virtualRow.index))\n\t\t\t\t\t}), loading ? /* @__PURE__ */ jsxs(ComboboxCustom, {\n\t\t\t\t\t\tclassName: \"ds-combobox__loading\",\n\t\t\t\t\t\tchildren: [/* @__PURE__ */ jsx(Spinner, {\n\t\t\t\t\t\t\t\"aria-label\": \"Laster\",\n\t\t\t\t\t\t\t\"data-size\": \"sm\"\n\t\t\t\t\t\t}), loadingLabel]\n\t\t\t\t\t}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [restChildren, !virtual && filteredOptionsChildren] })]\n\t\t\t\t})\n\t\t\t})\n\t\t})]\n\t});\n});\nconst Combobox = forwardRef((props, ref) => /* @__PURE__ */ jsx(ComboboxIdProvider, { children: /* @__PURE__ */ jsx(ComboboxComponent, {\n\t...props,\n\tref\n}) }));\nCombobox.displayName = \"Combobox\";\n//#endregion\nexport { Combobox, ComboboxComponent };\n", "// Lazy materialization for the lanes===1 fast path. Backed by a\n// Float64Array (stride 2: start, size, …); VirtualItems are constructed on\n// first indexed read, replacing the stored key. Saves the per-item object\n// allocation at large list counts where most items are never visible.\n\nimport type { VirtualItem } from './index'\n\nexport function getMeasurementKey(\n item: VirtualItem | VirtualItem['key'],\n): VirtualItem['key'] {\n return typeof item === 'object' ? item.key : item\n}\n\nexport function createLazyMeasurementsView(\n cache: Array<VirtualItem | VirtualItem['key']>,\n flat: Float64Array,\n): Array<VirtualItem> {\n const count = cache.length\n return new Proxy(cache, {\n get(target, prop, receiver) {\n if (typeof prop === 'string') {\n // Cheap digit-prefix sniff before number coerce.\n const c = prop.charCodeAt(0)\n if (c >= 48 && c <= 57) {\n const i = +prop\n if (Number.isInteger(i) && i >= 0 && i < count) {\n let v = target[i]!\n if (typeof v !== 'object') {\n const s = flat[i * 2]!\n v = target[i] = {\n index: i,\n key: v,\n start: s,\n size: flat[i * 2 + 1]!,\n end: s + flat[i * 2 + 1]!,\n lane: 0,\n }\n }\n return v\n }\n }\n if (prop === 'length') return count\n }\n return Reflect.get(target, prop, receiver)\n },\n }) as Array<VirtualItem>\n}\n", "export type NoInfer<A extends any> = [A][A extends any ? 0 : never]\n\nexport type PartialKeys<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>\n\nexport function memo<TDeps extends ReadonlyArray<any>, TResult>(\n getDeps: () => [...TDeps],\n fn: (...args: NoInfer<[...TDeps]>) => TResult,\n opts: {\n key: false | string\n debug?: () => boolean\n onChange?: (result: TResult) => void\n initialDeps?: TDeps\n skipInitialOnChange?: boolean\n },\n) {\n let deps = opts.initialDeps ?? []\n let result: TResult | undefined\n let isInitial = true\n\n function memoizedFunction(): TResult {\n // Debug-only timing. In production builds, `process.env.NODE_ENV !==\n // 'production'` is constant-folded to `false` by downstream minifiers\n // (Terser/esbuild/swc with `define`), which DCEs the entire block.\n const debugEnabled =\n process.env.NODE_ENV !== 'production' && !!opts.key && !!opts.debug?.()\n let depTime = 0\n if (debugEnabled) depTime = Date.now()\n\n const newDeps = getDeps()\n\n const depsChanged =\n newDeps.length !== deps.length ||\n newDeps.some((dep: any, index: number) => deps[index] !== dep)\n\n if (!depsChanged) {\n return result!\n }\n\n deps = newDeps\n\n let resultTime = 0\n if (debugEnabled) resultTime = Date.now()\n\n result = fn(...newDeps)\n\n if (debugEnabled) {\n const depEndTime = Math.round((Date.now() - depTime) * 100) / 100\n const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100\n const resultFpsPercentage = resultEndTime / 16\n\n const pad = (str: number | string, num: number) => {\n str = String(str)\n while (str.length < num) {\n str = ' ' + str\n }\n return str\n }\n\n console.info(\n `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,\n `\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(\n 0,\n Math.min(120 - 120 * resultFpsPercentage, 120),\n )}deg 100% 31%);`,\n opts?.key,\n )\n }\n\n if (opts?.onChange && !(isInitial && opts.skipInitialOnChange)) {\n opts.onChange(result)\n }\n\n isInitial = false\n\n return result\n }\n\n // Attach updateDeps to the function itself\n memoizedFunction.updateDeps = (newDeps: [...TDeps]) => {\n deps = newDeps\n }\n\n return memoizedFunction\n}\n\nexport function notUndefined<T>(value: T | undefined, msg?: string): T {\n if (value === undefined) {\n throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ''}`)\n } else {\n return value\n }\n}\n\nexport const approxEqual = (a: number, b: number) => Math.abs(a - b) < 1.01\n\nexport const debounce = (\n targetWindow: Window & typeof globalThis,\n fn: Function,\n ms: number,\n) => {\n let timeoutId: number\n return Object.assign(\n function (this: any, ...args: Array<any>) {\n targetWindow.clearTimeout(timeoutId)\n timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms)\n },\n {\n // The handle is closure-local, so a caller that has already\n // unsubscribed has no way to stop a queued call. Teardown paths use\n // this to drop the pending invocation instead of letting it land.\n cancel: () => {\n targetWindow.clearTimeout(timeoutId)\n },\n },\n )\n}\n", "import {\n createLazyMeasurementsView,\n getMeasurementKey,\n} from './lazy-measurements'\nimport { approxEqual, debounce, memo, notUndefined } from './utils'\n\n// Browser-aware iOS detection. Programmatic `scrollTo`/`scrollTop` writes\n// during a momentum-scroll cancel the momentum on iOS WebKit, so we defer\n// scroll-position adjustments triggered by mid-scroll resizes until the\n// scroll settles. SSR-safe (returns false when navigator is unavailable).\nlet _isIOSResult: boolean | undefined\nconst isIOSWebKit = (): boolean => {\n if (_isIOSResult !== undefined) return _isIOSResult\n if (typeof navigator === 'undefined') return (_isIOSResult = false)\n if (/iP(hone|od|ad)/.test(navigator.userAgent)) return (_isIOSResult = true)\n // iPadOS 13+ reports as MacIntel; touch-points distinguishes it from desktop.\n const mtp = (navigator as Navigator & { maxTouchPoints?: number })\n .maxTouchPoints\n return (_isIOSResult =\n navigator.platform === 'MacIntel' && mtp !== undefined && mtp > 0)\n}\n\n// Test hook: reset the iOS detection cache. Not exported.\nexport const _resetIOSDetectionForTests = () => {\n _isIOSResult = undefined\n}\n\nexport { approxEqual, debounce, memo, notUndefined } from './utils'\nexport type { NoInfer, PartialKeys } from './utils'\n\n//\n\ntype ScrollDirection = 'forward' | 'backward'\n\ntype ScrollAlignment = 'start' | 'center' | 'end' | 'auto'\n\ntype ScrollBehavior = 'auto' | 'smooth' | 'instant'\n\ntype ScrollAnchor = 'start' | 'end'\n\ntype FollowOnAppend = boolean | ScrollBehavior\n\nexport interface ScrollToOptions {\n align?: ScrollAlignment\n behavior?: ScrollBehavior\n}\n\ntype ScrollToOffsetOptions = ScrollToOptions\n\ntype ScrollToIndexOptions = ScrollToOptions\n\ntype ScrollToEndOptions = Pick<ScrollToOptions, 'behavior'>\n\nexport interface Range {\n startIndex: number\n endIndex: number\n overscan: number\n count: number\n}\n\ntype Key = number | string | bigint\n\nexport interface VirtualItem {\n key: Key\n index: number\n start: number\n end: number\n size: number\n lane: number\n}\n\nexport interface Rect {\n width: number\n height: number\n}\n\n//\n\nconst getRect = (element: HTMLElement): Rect => {\n const { offsetWidth, offsetHeight } = element\n return { width: offsetWidth, height: offsetHeight }\n}\n\nexport const defaultKeyExtractor = (index: number) => index\n\nexport const defaultRangeExtractor = (range: Range) => {\n const start = Math.max(range.startIndex - range.overscan, 0)\n const end = Math.min(range.endIndex + range.overscan, range.count - 1)\n const len = end - start + 1\n\n const arr = new Array<number>(len)\n for (let i = 0; i < len; i++) {\n arr[i] = start + i\n }\n return arr\n}\n\nexport const observeElementRect = <T extends Element>(\n instance: Virtualizer<T, any>,\n cb: (rect: Rect) => void,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n const targetWindow = instance.targetWindow\n if (!targetWindow) {\n return\n }\n\n const handler = (rect: Rect) => {\n const { width, height } = rect\n cb({ width: Math.round(width), height: Math.round(height) })\n }\n\n handler(getRect(element as unknown as HTMLElement))\n\n if (!targetWindow.ResizeObserver) {\n return () => {}\n }\n\n const observer = new targetWindow.ResizeObserver((entries) => {\n const run = () => {\n const entry = entries[0]\n if (entry?.borderBoxSize) {\n const box = entry.borderBoxSize[0]\n if (box) {\n handler({ width: box.inlineSize, height: box.blockSize })\n return\n }\n }\n handler(getRect(element as unknown as HTMLElement))\n }\n\n instance.options.useAnimationFrameWithResizeObserver\n ? requestAnimationFrame(run)\n : run()\n })\n\n observer.observe(element, { box: 'border-box' })\n\n return () => {\n observer.unobserve(element)\n }\n}\n\nconst addEventListenerOptions = {\n passive: true,\n}\n\nexport const observeWindowRect = (\n instance: Virtualizer<Window, any>,\n cb: (rect: Rect) => void,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n\n const handler = () => {\n cb({ width: element.innerWidth, height: element.innerHeight })\n }\n handler()\n\n element.addEventListener('resize', handler, addEventListenerOptions)\n\n return () => {\n element.removeEventListener('resize', handler)\n }\n}\n\nconst supportsScrollend =\n typeof window == 'undefined' ? true : 'onscrollend' in window\n\ntype ObserveOffsetCallBack = (offset: number, isScrolling: boolean) => void\n\n// Shared core: both element and window variants attach scroll/scrollend\n// listeners with the same lifecycle; they only differ in how to read the\n// current offset from the scroll target.\nconst observeOffset = <T extends Element | Window>(\n instance: Virtualizer<T, any>,\n cb: ObserveOffsetCallBack,\n readOffset: (target: T) => number,\n) => {\n const element = instance.scrollElement\n if (!element) {\n return\n }\n const targetWindow = instance.targetWindow\n if (!targetWindow) {\n return\n }\n\n const registerScrollendEvent =\n instance.options.useScrollendEvent && supportsScrollend\n\n let offset = 0\n const fallback = registerScrollendEvent\n ? null\n : debounce(\n targetWindow,\n () => cb(offset, false),\n instance.options.isScrollingResetDelay,\n )\n\n const createHandler = (isScrolling: boolean) => () => {\n offset = readOffset(element)\n fallback?.()\n cb(offset, isScrolling)\n }\n const handler = createHandler(true)\n const endHandler = createHandler(false)\n\n element.addEventListener('scroll', handler, addEventListenerOptions)\n if (registerScrollendEvent) {\n element.addEventListener('scrollend', endHandler, addEventListenerOptions)\n }\n return () => {\n element.removeEventListener('scroll', handler)\n if (registerScrollendEvent) {\n element.removeEventListener('scrollend', endHandler)\n }\n // Removing the listener doesn't retract a reset already queued by the\n // last scroll, and that call would land on a virtualizer that has been\n // torn down — in React, a dispatch into an unmounted tree.\n fallback?.cancel()\n }\n}\n\nexport const observeElementOffset = <T extends Element>(\n instance: Virtualizer<T, any>,\n cb: ObserveOffsetCallBack,\n) =>\n observeOffset(instance, cb, (el) => {\n const { horizontal, isRtl } = instance.options\n return horizontal ? el.scrollLeft * ((isRtl && -1) || 1) : el.scrollTop\n })\n\nexport const observeWindowOffset = (\n instance: Virtualizer<Window, any>,\n cb: ObserveOffsetCallBack,\n) =>\n observeOffset(instance, cb, (win) =>\n instance.options.horizontal ? win.scrollX : win.scrollY,\n )\n\nexport const measureElement = <TItemElement extends Element>(\n element: TItemElement,\n entry: ResizeObserverEntry | undefined,\n instance: Virtualizer<any, TItemElement>,\n) => {\n // When useCachedMeasurements is enabled, return the cached size\n // (or estimateSize as fallback) instead of measuring the DOM.\n if (instance.options.useCachedMeasurements) {\n const index = instance.indexFromElement(element)\n const key = instance.options.getItemKey(index)\n return (\n instance.itemSizeCache.get(key) ?? instance.options.estimateSize(index)\n )\n }\n\n if (entry?.borderBoxSize) {\n const box = entry.borderBoxSize[0]\n if (box) {\n const size = Math.round(\n box[instance.options.horizontal ? 'inlineSize' : 'blockSize'],\n )\n return size\n }\n }\n\n // When called without a ResizeObserverEntry (sync measurement path),\n // return the previously measured size if available. This avoids a\n // synchronous layout read (offsetWidth/offsetHeight) on re-renders.\n // The ResizeObserver is already observing the element and will deliver\n // the accurate size asynchronously if it changed.\n // Users who need synchronous DOM reads can provide a custom measureElement.\n if (!entry) {\n const index = instance.indexFromElement(element)\n const key = instance.options.getItemKey(index)\n const cachedSize = instance.itemSizeCache.get(key)\n if (cachedSize !== undefined) {\n return cachedSize\n }\n }\n\n return (element as unknown as HTMLElement)[\n instance.options.horizontal ? 'offsetWidth' : 'offsetHeight'\n ]\n}\n\nconst scrollWithAdjustments = (\n offset: number,\n {\n adjustments = 0,\n behavior,\n }: { adjustments?: number; behavior?: ScrollBehavior },\n instance: Virtualizer<any, any>,\n) => {\n instance.scrollElement?.scrollTo?.({\n [instance.options.horizontal ? 'left' : 'top']: offset + adjustments,\n behavior,\n })\n}\n\nexport const windowScroll: <T extends Window>(\n offset: number,\n options: { adjustments?: number; behavior?: ScrollBehavior },\n instance: Virtualizer<T, any>,\n) => void = scrollWithAdjustments\n\nexport const elementScroll: <T extends Element>(\n offset: number,\n options: { adjustments?: number; behavior?: ScrollBehavior },\n instance: Virtualizer<T, any>,\n) => void = scrollWithAdjustments\n\ntype LaneAssignmentMode = 'estimate' | 'measured'\n\nexport interface VirtualizerOptions<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> {\n // Required from the user\n count: number\n getScrollElement: () => TScrollElement | null\n estimateSize: (index: number) => number\n\n // Required from the framework adapter (but can be overridden)\n scrollToFn: (\n offset: number,\n options: { adjustments?: number; behavior?: ScrollBehavior },\n instance: Virtualizer<TScrollElement, TItemElement>,\n ) => void\n observeElementRect: (\n instance: Virtualizer<TScrollElement, TItemElement>,\n cb: (rect: Rect) => void,\n ) => void | (() => void)\n observeElementOffset: (\n instance: Virtualizer<TScrollElement, TItemElement>,\n cb: ObserveOffsetCallBack,\n ) => void | (() => void)\n // Optional\n debug?: boolean\n initialRect?: Rect\n onChange?: (\n instance: Virtualizer<TScrollElement, TItemElement>,\n sync: boolean,\n ) => void\n measureElement?: (\n element: TItemElement,\n entry: ResizeObserverEntry | undefined,\n instance: Virtualizer<TScrollElement, TItemElement>,\n ) => number\n overscan?: number\n horizontal?: boolean\n paddingStart?: number\n paddingEnd?: number\n scrollPaddingStart?: number\n scrollPaddingEnd?: number\n initialOffset?: number | (() => number)\n getItemKey?: (index: number) => Key\n rangeExtractor?: (range: Range) => Array<number>\n scrollMargin?: number\n gap?: number\n indexAttribute?: string\n initialMeasurementsCache?: Array<VirtualItem>\n lanes?: number\n anchorTo?: ScrollAnchor\n followOnAppend?: FollowOnAppend\n scrollEndThreshold?: number\n isScrollingResetDelay?: number\n useScrollendEvent?: boolean\n enabled?: boolean\n isRtl?: boolean\n useAnimationFrameWithResizeObserver?: boolean\n laneAssignmentMode?: LaneAssignmentMode\n useCachedMeasurements?: boolean\n}\n\ntype ScrollState = {\n // what we want\n index: number | null\n align: ScrollAlignment\n behavior: ScrollBehavior\n\n // lifecycle\n startedAt: number\n\n // target tracking\n lastTargetOffset: number\n\n // settling\n stableFrames: number\n}\n\ntype PendingScrollAnchor = [\n key: Key | null,\n offset: number,\n followOnAppend: ScrollBehavior | null,\n anchorDelta: number,\n]\n\nfunction isAppendWithTrim(\n prevCount: number,\n nextCount: number,\n getPreviousKey: (index: number) => Key,\n getNextKey: (index: number) => Key,\n): boolean {\n if (nextCount === 0) return false\n\n const firstKey = getNextKey(0)\n const removedKeys = new Set<Key>()\n let removedCount = 0\n while (removedCount < prevCount) {\n const key = getPreviousKey(removedCount)\n if (key === firstKey) break\n removedKeys.add(key)\n removedCount++\n }\n\n const retainedCount = prevCount - removedCount\n if (retainedCount === 0 || retainedCount >= nextCount) return false\n\n for (let i = 0; i < retainedCount; i++) {\n if (getNextKey(i) !== getPreviousKey(removedCount + i)) return false\n }\n for (let i = retainedCount; i < nextCount; i++) {\n if (removedKeys.has(getNextKey(i))) return false\n }\n return true\n}\n\nexport class Virtualizer<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> {\n private unsubs: Array<void | (() => void)> = []\n options!: Required<VirtualizerOptions<TScrollElement, TItemElement>>\n scrollElement: TScrollElement | null = null\n targetWindow: (Window & typeof globalThis) | null = null\n isScrolling = false\n private scrollState: ScrollState | null = null\n measurementsCache: Array<VirtualItem> = []\n // Keys belong to the layout build, even when VirtualItems are read later.\n // The flat [start, size, ...] buffer is reused across builds.\n private _singleLaneMeasurements: {\n flat: Float64Array\n items: Array<Key | VirtualItem>\n } | null = null\n itemSizeCache = new Map<Key, number>()\n private itemSizeCacheVersion = 0\n private laneAssignments = new Map<number, number>() // index → lane cache\n // Earliest index dirtied since last getMeasurements() rebuild, or null.\n private pendingMin: number | null = null\n private prevLanes: number | undefined = undefined\n private lanesChangedFlag = false\n private lanesSettling = false\n private pendingScrollAnchor: PendingScrollAnchor | null = null\n scrollRect: Rect | null = null\n scrollOffset: number | null = null\n scrollDirection: ScrollDirection | null = null\n scrollAdjustments = 0\n // Sum of size-change deltas above-viewport that were skipped during\n // iOS momentum scroll (writing scrollTop mid-momentum cancels it).\n // Flushed in a single scrollTo when iOS is fully settled.\n private _iosDeferredAdjustment = 0\n // Touch state. iOS WebKit cancels momentum when scrollTop is written, so\n // we defer adjustments not only during `isScrolling` but also through the\n // touchstart→touchend window (active drag) and a short tail after\n // touchend (early-momentum window — iOS only fires touch events once at\n // the start of momentum, so we use a timer rather than another event).\n private _iosTouching = false\n private _iosJustTouchEnded = false\n private _iosTouchEndTimerId: number | null = null\n // Subpixel reconciliation. Safari (and Chrome/Firefox under certain DPRs)\n // round scrollTop/scrollLeft writes to integer pixels. If we wrote 12345.5\n // but the browser reports back 12346, the next reconcileScroll sees a\n // \"target changed\" and re-fires scrollTo — a feedback loop that the\n // approxEqual(<1.01) tolerance otherwise absorbs as a workaround.\n // By remembering the intended value of our most-recent self-driven\n // scrollTo, we can match the browser's rounded read back to the intended\n // value when the diff is < 1.5 px, distinguishing it from a real user\n // scroll. The +0.5 over Math.abs lets us also absorb the +1 / -1 cases.\n private _intendedScrollOffset: number | null = null\n // A compensation write from `applyScrollAdjustment` whose target exceeded\n // the element's scroll max at the moment of the write. The browser clamps\n // such a write because the consumer's sizer has not grown yet: an\n // end-anchored item growing at the bottom only extends `scrollHeight` to\n // its own end, so with `paddingEnd > 0` the clamp lands exactly\n // `paddingEnd` short of the target (#1258). `_willUpdate` re-issues the\n // write once the sizer has caught up; the clamped read-back keeps it\n // pending, any other scroll event (a real gesture) cancels it.\n private _clampedAdjustment: { target: number; maxAtWrite: number } | null =\n null\n shouldAdjustScrollPositionOnItemSizeChange:\n | undefined\n | ((\n item: VirtualItem,\n delta: number,\n instance: Virtualizer<TScrollElement, TItemElement>,\n ) => boolean)\n elementsCache = new Map<Key, TItemElement>()\n private now = () => this.targetWindow?.performance?.now?.() ?? Date.now()\n private observer = (() => {\n let _ro: ResizeObserver | null = null\n\n const get = () => {\n if (_ro) {\n return _ro\n }\n\n if (!this.targetWindow || !this.targetWindow.ResizeObserver) {\n return null\n }\n\n return (_ro = new this.targetWindow.ResizeObserver((entries) => {\n entries.forEach((entry) => {\n const run = () => {\n const node = entry.target as TItemElement\n const index = this.indexFromElement(node)\n\n if (!node.isConnected) {\n this.observer.unobserve(node)\n // Find the cache entry pointing to this exact node and remove\n // it. We can't call getItemKey(index) here because items may\n // have been removed since this node was rendered — the index\n // could be stale and out-of-bounds in the user's data array\n // (regression test in e2e/.../stale-index.spec.ts, fix #1148).\n // The === comparison naturally handles the React-replaced-\n // a-node-for-the-same-key case: that entry now points to a\n // different node, so this loop won't match.\n for (const [cacheKey, cachedNode] of this.elementsCache) {\n if (cachedNode === node) {\n this.elementsCache.delete(cacheKey)\n break\n }\n }\n return\n }\n\n if (!this.isIndexInRange(index)) return\n\n if (this.shouldMeasureDuringScroll(index)) {\n this.resizeItem(\n index,\n this.options.measureElement(node, entry, this),\n )\n }\n }\n this.options.useAnimationFrameWithResizeObserver\n ? requestAnimationFrame(run)\n : run()\n })\n }))\n }\n\n return {\n disconnect: () => {\n get()?.disconnect()\n _ro = null\n },\n observe: (target: Element) =>\n get()?.observe(target, { box: 'border-box' }),\n unobserve: (target: Element) => get()?.unobserve(target),\n }\n })()\n range: { startIndex: number; endIndex: number } | null = null\n\n constructor(opts: VirtualizerOptions<TScrollElement, TItemElement>) {\n this.setOptions(opts)\n }\n\n setOptions = (opts: VirtualizerOptions<TScrollElement, TItemElement>) => {\n // Skip `{...defaults, ...opts}` because explicit `undefined` values in\n // opts would override defaults with `undefined`.\n const merged = {\n debug: false,\n initialOffset: 0,\n overscan: 1,\n paddingStart: 0,\n paddingEnd: 0,\n scrollPaddingStart: 0,\n scrollPaddingEnd: 0,\n horizontal: false,\n getItemKey: defaultKeyExtractor,\n rangeExtractor: defaultRangeExtractor,\n onChange: () => {},\n measureElement,\n initialRect: { width: 0, height: 0 },\n scrollMargin: 0,\n gap: 0,\n indexAttribute: 'data-index',\n initialMeasurementsCache: [],\n lanes: 1,\n anchorTo: 'start',\n followOnAppend: false,\n scrollEndThreshold: 1,\n isScrollingResetDelay: 150,\n enabled: true,\n isRtl: false,\n useScrollendEvent: false,\n useAnimationFrameWithResizeObserver: false,\n laneAssignmentMode: 'estimate',\n useCachedMeasurements: false,\n } as unknown as Required<VirtualizerOptions<TScrollElement, TItemElement>>\n\n for (const key in opts) {\n const v = (opts as any)[key]\n if (v !== undefined) (merged as any)[key] = v\n }\n\n const prevOptions = this.options as\n | Required<VirtualizerOptions<TScrollElement, TItemElement>>\n | undefined\n let anchor: [Key, number] | null = null\n let followOnAppend: ScrollBehavior | null = null\n let edgeKeysChanged = false\n\n if (\n prevOptions !== undefined &&\n prevOptions.enabled &&\n merged.enabled &&\n merged.anchorTo === 'end' &&\n this.scrollElement !== null\n ) {\n const prevCount = prevOptions.count\n const nextCount = merged.count\n const measurements = this.getMeasurements()\n const previousItems = this._singleLaneMeasurements?.items ?? measurements\n const getPreviousKey = (index: number) =>\n getMeasurementKey(previousItems[index]!)\n const prevFirstKey = prevCount > 0 ? getPreviousKey(0) : null\n const prevLastKey = prevCount > 0 ? getPreviousKey(prevCount - 1) : null\n const didCountChange = nextCount !== prevCount\n const didEdgeKeysChange =\n didCountChange ||\n (prevCount > 0 &&\n nextCount > 0 &&\n (merged.getItemKey(0) !== prevFirstKey ||\n merged.getItemKey(nextCount - 1) !== prevLastKey))\n\n if (didEdgeKeysChange) {\n edgeKeysChanged = true\n const item =\n prevCount > 0\n ? (this.getVirtualItemForOffset(this.getScrollOffset()) ??\n measurements[0])\n : null\n\n if (item) {\n anchor = [item.key, this.getScrollOffset() - item.start]\n }\n\n const behavior =\n merged.followOnAppend === true\n ? 'auto'\n : merged.followOnAppend || null\n\n if (\n behavior &&\n nextCount > 0 &&\n this.isAtEnd(prevOptions.scrollEndThreshold) &&\n (prevCount === 0 || merged.getItemKey(nextCount - 1) !== prevLastKey)\n ) {\n if (\n nextCount > prevCount ||\n isAppendWithTrim(\n prevCount,\n nextCount,\n getPreviousKey,\n merged.getItemKey,\n )\n ) {\n followOnAppend = behavior\n }\n }\n }\n }\n\n this.options = merged\n\n // When edge keys changed (prepend, trim, reorder, etc.) the key→index\n // mapping has shifted. Force a full measurement rebuild so the anchor\n // resolution below reads positions from the new layout, not the stale\n // memoised cache. Without this, a stable `getItemKey` reference +\n // unchanged `count` would let getMeasurements() return the old layout.\n if (edgeKeysChanged) {\n this.pendingMin = 0\n this.itemSizeCacheVersion++\n }\n\n // Eagerly adjust scrollOffset so the virtualizer computes the correct\n // visible range during the current render pass — before _willUpdate\n // syncs the DOM scroll position in a layout effect. Without this,\n // the virtualizer would render the wrong items for one frame (the\n // estimate-based positions are stale) and then correct in the next\n // frame, producing a visible \"jump\" on prepend with dynamic sizes.\n let anchorResolved = false\n let anchorDelta = 0\n if (anchor && this.scrollOffset !== null) {\n const [anchorKey, anchorOffset] = anchor\n const newMeasurements = this.getMeasurements()\n const { count, getItemKey } = this.options\n let idx = 0\n while (idx < count && getItemKey(idx) !== anchorKey) {\n idx++\n }\n if (idx < count) {\n const anchorItem = newMeasurements[idx]\n if (anchorItem) {\n // Clamp to the reachable range's lower bound — anchorOffset may\n // have been derived from a transiently negative scrollOffset\n // (rubber-band), and a negative tracked offset never self-heals\n // when the element cannot scroll (#1229).\n const newOffset = Math.max(0, anchorItem.start + anchorOffset)\n // A no-op end scroll emits no event to correct a reading-anchor offset.\n if (!followOnAppend && newOffset !== this.scrollOffset) {\n anchorDelta = newOffset - this.scrollOffset\n this.scrollOffset = newOffset\n anchorResolved = true\n }\n }\n }\n }\n\n if (anchorResolved || followOnAppend) {\n this.pendingScrollAnchor = [\n anchorResolved ? anchor![0] : null,\n anchorResolved ? anchor![1] : 0,\n followOnAppend,\n anchorDelta,\n ]\n }\n }\n\n private notify = (sync: boolean) => {\n this.options.onChange?.(this, sync)\n }\n\n // Returns `true` when it performed a synchronous `scrollTop` write this\n // tick, `false` when the delta was zero or the write was deferred (iOS).\n // `resizeItem` uses that to decide whether the follow-up `notify` must be\n // synchronous so the grown transforms commit in the same paint (#1227).\n private applyScrollAdjustment(\n delta: number,\n behavior?: ScrollBehavior,\n ): boolean {\n if (delta === 0) return false\n\n if (process.env.NODE_ENV !== 'production' && this.options.debug) {\n console.info('correction', delta)\n }\n\n if (\n isIOSWebKit() &&\n (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)\n ) {\n this._iosDeferredAdjustment += delta\n return false\n } else {\n const target = this.getScrollOffset() + this.scrollAdjustments + delta\n // Guarded so a bare test double without `scrollHeight` / `document`\n // does not crash in `getMaxScrollOffset`.\n const el = this.scrollElement\n const maxAtWrite =\n el !== null && ('scrollHeight' in el || 'document' in el)\n ? this.getMaxScrollOffset()\n : null\n this._clampedAdjustment =\n maxAtWrite !== null && target > maxAtWrite + 0.5\n ? { target, maxAtWrite }\n : null\n this._scrollToOffset(this.getScrollOffset(), {\n adjustments: (this.scrollAdjustments += delta),\n behavior,\n })\n // Eagerly carry the intended target in `scrollOffset` so callers that\n // read it before the next scroll event — notably the next `resizeItem`\n // tick's `getVirtualDistanceFromEnd()` / `wasAtEnd` check — see the\n // post-adjustment position even when the DOM `scrollTop` write was\n // clamped because the consumer hasn't grown the sizer yet (`notify()`\n // runs after this in `resizeItem`). Same idea as the eager\n // `scrollOffset` adjustment for prepend in `setOptions` (#1176). The\n // adjustment is now baked into `scrollOffset`, so zero\n // `scrollAdjustments` to keep their sum invariant.\n if (this.scrollOffset !== null) {\n this.scrollOffset += this.scrollAdjustments\n // Clamp only the lower bound: a negative offset is unreachable, and\n // on an unscrollable element (content fits the viewport) no scroll\n // event ever fires to correct it, permanently skewing\n // getDistanceFromEnd() and wedging _flushIosDeferredIfReady (#1229).\n // Upper-bound overflow stays untouched — it is transiently\n // legitimate mid-prepend while the consumer's sizer catches up.\n if (this.scrollOffset < 0) this.scrollOffset = 0\n this.scrollAdjustments = 0\n }\n return true\n }\n }\n\n private maybeNotify = memo(\n () => {\n this.calculateRange()\n\n return [\n this.isScrolling,\n this.range ? this.range.startIndex : null,\n this.range ? this.range.endIndex : null,\n ]\n },\n (isScrolling) => {\n this.notify(isScrolling)\n },\n {\n key: process.env.NODE_ENV !== 'production' && 'maybeNotify',\n debug: () => this.options.debug,\n initialDeps: [\n this.isScrolling,\n this.range ? this.range.startIndex : null,\n this.range ? this.range.endIndex : null,\n ] as [boolean, number | null, number | null],\n },\n )\n\n private cleanup = () => {\n this.unsubs.filter(Boolean).forEach((d) => d!())\n this.unsubs = []\n this.observer.disconnect()\n if (this.rafId != null && this.targetWindow) {\n this.targetWindow.cancelAnimationFrame(this.rafId)\n this.rafId = null\n }\n this.scrollState = null\n // The debounce cancelled above is the only thing that writes `isScrolling`\n // back to false, so a cleanup inside the reset window would strand it, and\n // the direction derived from it, as true. That matters because `cleanup`\n // also runs when the scroll element changes or `enabled` goes false, where\n // the instance lives on.\n this.isScrolling = false\n this.scrollDirection = null\n // The iOS gesture/deferral state is scoped to the current scroll\n // element: the touch listeners that maintain it were just removed, and\n // an in-flight touch keeps targeting the old element (implicit touch\n // capture), so the new element never reports it. Carrying the state\n // over would replay a stale deferred delta on the new element's first\n // flush, and a cleanup that lands mid-touch or inside the post-touchend\n // grace window would strand _iosTouching / _iosJustTouchEnded as true\n // (the listener unsub clears the grace timer, and with it the only\n // pending reset of the flag), deferring every adjustment on the new\n // element until its next touch cycle.\n this._iosDeferredAdjustment = 0\n this._iosTouching = false\n this._iosJustTouchEnded = false\n this._clampedAdjustment = null\n this.scrollElement = null\n this.targetWindow = null\n }\n\n _didMount = () => {\n return () => {\n this.cleanup()\n }\n }\n\n _willUpdate = () => {\n const scrollElement = this.options.enabled\n ? this.options.getScrollElement()\n : null\n\n if (this.scrollElement !== scrollElement) {\n this.cleanup()\n\n if (!scrollElement) {\n this.maybeNotify()\n return\n }\n\n this.scrollElement = scrollElement\n\n if (this.scrollElement && 'ownerDocument' in this.scrollElement) {\n this.targetWindow = this.scrollElement.ownerDocument.defaultView\n } else {\n this.targetWindow = this.scrollElement?.window ?? null\n }\n\n this.elementsCache.forEach((cached) => {\n this.observer.observe(cached)\n })\n\n this.unsubs.push(\n this.options.observeElementRect(this, (rect) => {\n this.scrollRect = rect\n this.maybeNotify()\n }),\n )\n\n this.unsubs.push(\n this.options.observeElementOffset(this, (offset, isScrolling) => {\n // A scroll event that reports movement but lands on the offset we\n // already hold — and isn't a self-write read-back — is a spurious\n // no-op re-emit that Safari/Firefox fire after a re-render's layout\n // (Chrome doesn't). Treating it as scrolling re-arms `isScrolling`,\n // which forces a render that triggers another such event: an\n // infinite re-render loop. Ignore it. (Self-writes are handled by\n // the `_intendedScrollOffset` reconciliation just below.)\n if (\n isScrolling &&\n this._intendedScrollOffset === null &&\n offset === this.scrollOffset\n ) {\n return\n }\n\n // If this scroll event looks like the browser's read-back of a\n // value we just wrote, prefer our intended (sub-pixel-accurate)\n // value over the browser's rounded one. The 1.5 px tolerance is\n // tight enough to avoid mistaking a real user scroll for a\n // self-write — by the time the user has moved 1.5 px, the\n // intended value will already have been consumed by a prior\n // scroll event and cleared.\n if (\n this._intendedScrollOffset !== null &&\n Math.abs(offset - this._intendedScrollOffset) < 1.5\n ) {\n offset = this._intendedScrollOffset\n }\n this._intendedScrollOffset = null\n\n // A pending clamped compensation write (#1258) survives only its\n // own read-back, which the browser reports at the scroll max we\n // saw at write time. Anything else is a real gesture (or the write\n // landing after all), so drop it rather than yank the user later.\n if (\n this._clampedAdjustment !== null &&\n Math.abs(offset - this._clampedAdjustment.maxAtWrite) >= 1.5\n ) {\n this._clampedAdjustment = null\n }\n\n this.scrollAdjustments = 0\n // If the offset hasn't moved, this is the echo of our own\n // adjustment write — `applyScrollAdjustment` already folded it\n // into `scrollOffset`. There's no direction to infer, so leave\n // it alone; a real gesture always moves the offset.\n const prevOffset = this.getScrollOffset()\n this.scrollDirection = isScrolling\n ? prevOffset === offset\n ? this.scrollDirection\n : prevOffset < offset\n ? 'forward'\n : 'backward'\n : null\n this.scrollOffset = offset\n this.isScrolling = isScrolling\n\n // Flush deferred iOS adjustments if we're now fully settled.\n // \"Fully settled\" means: not actively scrolling, no finger on\n // screen, and the post-touchend grace window has expired.\n this._flushIosDeferredIfReady()\n\n if (this.scrollState) {\n this.scheduleScrollReconcile()\n }\n this.maybeNotify()\n }),\n )\n\n // Touch event listeners (iOS-aware deferral). We attach unconditionally\n // — the listeners are passive and cheap; on non-touch devices they\n // simply never fire. The gating by isIOSWebKit() lives in resizeItem\n // and _flushIosDeferredIfReady so we only burn the path on iOS.\n if ('addEventListener' in this.scrollElement) {\n const scrollEl = this.scrollElement as unknown as EventTarget\n const onTouchStart = () => {\n this._iosTouching = true\n this._iosJustTouchEnded = false\n if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {\n this.targetWindow.clearTimeout(this._iosTouchEndTimerId)\n this._iosTouchEndTimerId = null\n }\n }\n const onTouchEnd = () => {\n this._iosTouching = false\n if (!isIOSWebKit() || this.targetWindow == null) {\n // Non-iOS: nothing more to track. Just clear the touching flag.\n return\n }\n this._iosJustTouchEnded = true\n // After ~150 ms with no scroll/touch events, momentum is done.\n this._iosTouchEndTimerId = this.targetWindow.setTimeout(() => {\n this._iosJustTouchEnded = false\n this._iosTouchEndTimerId = null\n // After the grace window, attempt to flush. The scroll event\n // for momentum decay may have already fired before our timer.\n this._flushIosDeferredIfReady()\n }, 150)\n }\n scrollEl.addEventListener(\n 'touchstart',\n onTouchStart,\n addEventListenerOptions,\n )\n scrollEl.addEventListener(\n 'touchend',\n onTouchEnd,\n addEventListenerOptions,\n )\n this.unsubs.push(() => {\n scrollEl.removeEventListener('touchstart', onTouchStart)\n scrollEl.removeEventListener('touchend', onTouchEnd)\n if (this._iosTouchEndTimerId !== null && this.targetWindow != null) {\n this.targetWindow.clearTimeout(this._iosTouchEndTimerId)\n this._iosTouchEndTimerId = null\n }\n })\n }\n\n this._scrollToOffset(this.getScrollOffset(), {\n adjustments: undefined,\n behavior: undefined,\n })\n }\n\n const anchor = this.pendingScrollAnchor\n this.pendingScrollAnchor = null\n\n if (anchor && this.scrollElement && this.options.enabled) {\n const [key, _offset, followOnAppend, anchorDelta] = anchor\n\n if (key !== null && !followOnAppend) {\n // scrollOffset was eagerly adjusted in setOptions so the\n // virtualizer already computed the correct range during render.\n // Now sync the browser's actual scroll position to match.\n // Skip when followOnAppend is set — scrollToEnd will handle it.\n //\n // On iOS WebKit, writing scrollTop during touch/momentum cancels\n // the in-flight scroll. Defer the DOM sync the same way\n // applyScrollAdjustment does — accumulate the delta and let\n // _flushIosDeferredIfReady handle it once the scroll settles.\n if (\n isIOSWebKit() &&\n (this.isScrolling || this._iosTouching || this._iosJustTouchEnded)\n ) {\n if (anchorDelta !== 0) {\n this._iosDeferredAdjustment += anchorDelta\n }\n } else {\n this._scrollToOffset(this.getScrollOffset(), {\n adjustments: undefined,\n behavior: undefined,\n })\n }\n }\n\n if (followOnAppend) {\n this.scrollToEnd({ behavior: followOnAppend })\n }\n }\n\n // The consumer has committed the new total size by now, so a clamped\n // compensation write may have room (#1258).\n this._retryClampedAdjustment()\n }\n\n // Re-issue a compensation write the browser clamped because the sizer had\n // not grown yet (#1258, #1266). Called after `notify` in `resizeItem`,\n // which covers consumers that size the container synchronously inside\n // `onChange` (direct DOM updates, flushSync renders — where no re-render\n // may follow at all), and from `_willUpdate` for consumers that size it\n // during an asynchronous render. Both the clamped read-back and the\n // absence of one leave `_clampedAdjustment` set, so timing does not matter.\n private _retryClampedAdjustment = () => {\n if (\n this._clampedAdjustment === null ||\n !this.scrollElement ||\n !this.options.enabled\n ) {\n return\n }\n const { target, maxAtWrite } = this._clampedAdjustment\n const max = this.getMaxScrollOffset()\n if (max > maxAtWrite + 0.5) {\n // Still short (the sizer grew only partially): stay pending against\n // the new max so the next opportunity retries.\n this._clampedAdjustment =\n target > max + 0.5 ? { target, maxAtWrite: max } : null\n this._scrollToOffset(target, {\n adjustments: undefined,\n behavior: undefined,\n })\n }\n }\n\n // Apply any accumulated iOS-deferred scroll adjustment, but only when we're\n // truly settled — not actively scrolling, not under an active touch, and\n // past the post-touchend grace window. Called from the scroll callback\n // and the touchend grace-timer.\n private _flushIosDeferredIfReady = () => {\n if (this._iosDeferredAdjustment === 0) return\n if (this.isScrolling) return\n if (this._iosTouching) return\n if (this._iosJustTouchEnded) return\n // Phase 2b: Safari elastic-overscroll (rubber-band) lets scrollTop go\n // negative or beyond scrollHeight - clientHeight. Writing scrollTop\n // while in that zone snaps the page back to the clamped value at the\n // end of the bounce, often discarding the user's intent. Skip the\n // flush; the next in-bounds scroll event will retry.\n const cur = this.getScrollOffset()\n const max = this.getMaxScrollOffset()\n if (cur < 0 || cur > max) return\n // At the end clamp the browser already absorbed a shrink above the\n // viewport (it clamped scrollTop onto the new bottom), so replaying our\n // deferred negative delta would lift the view off the bottom — drop it.\n // Positive deltas still replay: growth above doesn't clamp. (#1233)\n if (this._iosDeferredAdjustment < 0 && cur >= max - 1) {\n this._iosDeferredAdjustment = 0\n return\n }\n const delta = this._iosDeferredAdjustment\n this._iosDeferredAdjustment = 0\n // Roll the deferred delta into the running accumulator so any resize\n // landing between now and the resulting scroll event computes from the\n // post-flush offset rather than the stale one.\n this._scrollToOffset(cur, {\n adjustments: (this.scrollAdjustments += delta),\n behavior: undefined,\n })\n }\n\n private rafId: number | null = null\n private scheduleScrollReconcile() {\n if (!this.targetWindow) {\n this.scrollState = null\n return\n }\n if (this.rafId != null) return\n this.rafId = this.targetWindow.requestAnimationFrame(() => {\n this.rafId = null\n this.reconcileScroll()\n })\n }\n private reconcileScroll() {\n if (!this.scrollState) return\n\n const el = this.scrollElement\n if (!el) return\n\n // Safety valve: bail out if reconciliation has been running too long\n const MAX_RECONCILE_MS = 5000\n if (this.now() - this.scrollState.startedAt > MAX_RECONCILE_MS) {\n this.scrollState = null\n return\n }\n\n const offsetInfo =\n this.scrollState.index != null\n ? this.getOffsetForIndex(this.scrollState.index, this.scrollState.align)\n : undefined\n const targetOffset = offsetInfo\n ? offsetInfo[0]\n : this.scrollState.lastTargetOffset\n\n // Require one stable frame where target matches scroll offset.\n // approxEqual() already tolerates minor fluctuations, so one frame is sufficient\n // to confirm scroll has reached its target without premature cleanup.\n const STABLE_FRAMES = 1\n\n const targetChanged = targetOffset !== this.scrollState.lastTargetOffset\n\n if (!targetChanged && approxEqual(targetOffset, this.getScrollOffset())) {\n this.scrollState.stableFrames++\n if (this.scrollState.stableFrames >= STABLE_FRAMES) {\n // Final-pass exact landing. The reconcile-stable check uses a 1.01px\n // tolerance (approxEqual) so we don't fight subpixel browser rounding\n // during the converging phase. Once we're definitively settled,\n // commit the exact target so consumers calling scrollToIndex(N)\n // end up at the EXACT computed position of item N — matching\n // virtuoso's 0px landing accuracy rather than our prior 0.5-1px.\n if (this.getScrollOffset() !== targetOffset) {\n this._scrollToOffset(targetOffset, {\n adjustments: undefined,\n behavior: 'auto',\n })\n }\n this.scrollState = null\n return\n }\n } else {\n this.scrollState.stableFrames = 0\n\n if (targetChanged) {\n // When the target moves during smooth scroll (because items came into\n // view and got measured, shifting positions), the original logic was\n // to immediately snap to 'auto' — visibly jarring on long\n // scroll-to-index calls. Now: keep smooth while we're still far\n // (more than a viewport) from the new target. Only fall back to\n // 'auto' for the final approach, so the user sees one continuous\n // motion that smoothly adjusts its endpoint as measurements arrive.\n const viewport = this.getSize() || 600\n const distance = Math.abs(targetOffset - this.getScrollOffset())\n const keepSmooth =\n this.scrollState.behavior === 'smooth' && distance > viewport\n\n this.scrollState.lastTargetOffset = targetOffset\n if (!keepSmooth) {\n this.scrollState.behavior = 'auto'\n }\n\n this._scrollToOffset(targetOffset, {\n adjustments: undefined,\n behavior: keepSmooth ? 'smooth' : 'auto',\n })\n }\n }\n\n // Always reschedule while scrollState is active to guarantee\n // the safety valve timeout runs even if no scroll events fire\n // (e.g. no-op scrollToFn, detached element)\n this.scheduleScrollReconcile()\n }\n\n private getSize = () => {\n if (!this.options.enabled) {\n this.scrollRect = null\n return 0\n }\n\n this.scrollRect = this.scrollRect ?? this.options.initialRect\n\n return this.scrollRect[this.options.horizontal ? 'width' : 'height']\n }\n\n private getScrollOffset = () => {\n if (!this.options.enabled) {\n this.scrollOffset = null\n return 0\n }\n\n this.scrollOffset =\n this.scrollOffset ??\n (typeof this.options.initialOffset === 'function'\n ? this.options.initialOffset()\n : this.options.initialOffset)\n\n return this.scrollOffset\n }\n\n private getMeasurementOptions = memo(\n () => [\n this.options.count,\n this.options.paddingStart,\n this.options.scrollMargin,\n this.options.getItemKey,\n this.options.enabled,\n this.options.lanes,\n this.options.laneAssignmentMode,\n this.options.gap,\n ],\n (\n count,\n paddingStart,\n scrollMargin,\n getItemKey,\n enabled,\n lanes,\n laneAssignmentMode,\n gap,\n ) => {\n const lanesChanged =\n this.prevLanes !== undefined && this.prevLanes !== lanes\n\n if (lanesChanged) {\n // Set flag for getMeasurements to handle\n this.lanesChangedFlag = true\n }\n\n this.prevLanes = lanes\n this.pendingMin = null\n\n return {\n count,\n paddingStart,\n scrollMargin,\n getItemKey,\n enabled,\n lanes,\n laneAssignmentMode,\n gap,\n }\n },\n {\n key: false,\n },\n )\n\n private isIndexInRange = (index: number): boolean =>\n index >= 0 && index < this.options.count\n\n private getMeasurements = memo(\n () => [this.getMeasurementOptions(), this.itemSizeCacheVersion],\n (\n {\n count,\n paddingStart,\n scrollMargin,\n getItemKey,\n enabled,\n lanes,\n laneAssignmentMode,\n gap,\n },\n _itemSizeCacheVersion,\n ) => {\n const itemSizeCache = this.itemSizeCache\n if (!enabled) {\n this.measurementsCache = []\n this._singleLaneMeasurements = null\n this.itemSizeCache.clear()\n this.laneAssignments.clear()\n return []\n }\n\n // Clean up stale lane cache entries when count decreases\n if (this.laneAssignments.size > count) {\n for (const index of this.laneAssignments.keys()) {\n if (index >= count) {\n this.laneAssignments.delete(index)\n }\n }\n }\n\n // ✅ Force complete recalculation when lanes change\n if (this.lanesChangedFlag) {\n this.lanesChangedFlag = false // Reset immediately\n this.lanesSettling = true // Start settling period\n this.measurementsCache = []\n this._singleLaneMeasurements = null\n this.itemSizeCache.clear()\n this.laneAssignments.clear() // Clear lane cache for new lane count\n // Force min = 0 on the rebuild\n this.pendingMin = null\n }\n\n // Don't restore from initialMeasurementsCache during lane changes\n // as it contains stale lane assignments from the previous lane count\n if (this.measurementsCache.length === 0 && !this.lanesSettling) {\n this.measurementsCache = this.options.initialMeasurementsCache\n this.measurementsCache.forEach((item) => {\n this.itemSizeCache.set(item.key, item.size)\n })\n }\n\n // During lanes settling, ignore pendingMin to prevent repositioning\n const min = this.lanesSettling ? 0 : (this.pendingMin ?? 0)\n this.pendingMin = null\n\n // ✅ End settling period when cache is fully built\n if (this.lanesSettling && this.measurementsCache.length === count) {\n this.lanesSettling = false\n }\n\n // ─── Fast path: single-lane lazy materialization ────────────────────\n // For lanes === 1 (the default and most common case), skip the\n // per-item VirtualItem object allocation. We write start/size pairs\n // into a Float64Array and return a Proxy that builds VirtualItem\n // objects on demand (only the indices a consumer actually reads).\n if (lanes === 1) {\n // Reuse flat backing if large enough; else grow (preserving data\n // before `min` to mirror the slice-and-rebuild contract).\n const need = count * 2\n let flat = this._singleLaneMeasurements?.flat\n if (!flat || flat.length < need) {\n const next = new Float64Array(need)\n if (flat && min > 0) next.set(flat.subarray(0, min * 2))\n flat = next\n }\n\n const items: Array<Key | VirtualItem> =\n min === 0\n ? new Array(count)\n : this._singleLaneMeasurements!.items.slice()\n\n let runningStart: number\n if (min === 0) {\n runningStart = paddingStart + scrollMargin\n } else {\n // Continue from where we left off\n const prevIdx = min - 1\n runningStart = flat[prevIdx * 2]! + flat[prevIdx * 2 + 1]! + gap\n }\n\n for (let i = min; i < count; i++) {\n const key = getItemKey(i)\n items[i] = key\n const measuredSize = itemSizeCache.get(key)\n const size =\n typeof measuredSize === 'number'\n ? measuredSize\n : this.options.estimateSize(i)\n flat[i * 2] = runningStart\n flat[i * 2 + 1] = size\n runningStart += size + gap\n }\n\n this._singleLaneMeasurements = { flat, items }\n const view = createLazyMeasurementsView(items, flat)\n this.measurementsCache = view\n return view\n }\n\n const measurements = this.measurementsCache.slice(0, min)\n\n // ✅ Performance: Track last item index per lane for O(1) lookup\n const laneLastIndex: Array<number | undefined> = new Array(lanes).fill(\n undefined,\n )\n // Running end position of each lane's last item, so the shortest lane\n // can be found with an O(lanes) argmin instead of the old backward walk\n // through `measurements` (getFurthestMeasurement). `filledLanes` tracks\n // how many lanes have at least one item, mirroring the previous\n // \"all lanes seen → shortest lane, else i % lanes\" branch.\n const laneEnds = new Float64Array(lanes)\n let filledLanes = 0\n\n // Initialize from existing measurements (before min)\n for (let m = 0; m < min; m++) {\n const item = measurements[m]\n if (item) {\n if (laneLastIndex[item.lane] === undefined) filledLanes++\n laneLastIndex[item.lane] = m\n laneEnds[item.lane] = item.end\n }\n }\n\n for (let i = min; i < count; i++) {\n const key = getItemKey(i)\n\n // Check for cached lane assignment\n const cachedLane = this.laneAssignments.get(i)\n let lane: number\n let start: number\n\n const shouldCacheLane =\n laneAssignmentMode === 'estimate' || itemSizeCache.has(key)\n\n if (cachedLane !== undefined && this.options.lanes > 1) {\n // Use cached lane - O(1) lookup for previous item in same lane\n lane = cachedLane\n const prevIndex = laneLastIndex[lane]\n const prevInLane =\n prevIndex !== undefined ? measurements[prevIndex] : undefined\n start = prevInLane\n ? prevInLane.end + gap\n : paddingStart + scrollMargin\n } else if (filledLanes === lanes) {\n // No cache, every lane seeded: place in the shortest lane.\n // Read the running per-lane ends (O(lanes) argmin) instead of the\n // old backward scan. Tie-break on the lane's last-item index to\n // preserve the previous sort-by-(end, index) placement exactly.\n let bestLane = 0\n let bestEnd = laneEnds[0]!\n let bestIdx = laneLastIndex[0]!\n for (let l = 1; l < lanes; l++) {\n const e = laneEnds[l]!\n if (e < bestEnd || (e === bestEnd && laneLastIndex[l]! < bestIdx)) {\n bestLane = l\n bestEnd = e\n bestIdx = laneLastIndex[l]!\n }\n }\n lane = bestLane\n start = bestEnd + gap\n\n if (shouldCacheLane) {\n this.laneAssignments.set(i, lane)\n }\n } else {\n // No cache and not every lane seeded yet — seed lanes in order,\n // matching the previous `i % lanes` fallback for the first row.\n lane = i % this.options.lanes\n start = paddingStart + scrollMargin\n\n if (shouldCacheLane) {\n this.laneAssignments.set(i, lane)\n }\n }\n\n const measuredSize = itemSizeCache.get(key)\n const size =\n typeof measuredSize === 'number'\n ? measuredSize\n : this.options.estimateSize(i)\n\n const end = start + size\n\n measurements[i] = {\n index: i,\n start,\n size,\n end,\n key,\n lane,\n }\n\n // ✅ Performance: Update lane's last item index + running end\n if (laneLastIndex[lane] === undefined) filledLanes++\n laneLastIndex[lane] = i\n laneEnds[lane] = end\n }\n\n this.measurementsCache = measurements\n\n return measurements\n },\n {\n key: process.env.NODE_ENV !== 'production' && 'getMeasurements',\n debug: () => this.options.debug,\n },\n )\n\n calculateRange = memo(\n () => [\n this.getMeasurements(),\n this.getSize(),\n this.getScrollOffset(),\n this.options.lanes,\n ],\n (measurements, outerSize, scrollOffset, lanes) => {\n if (measurements.length === 0 || outerSize === 0) {\n this.range = null\n return null\n }\n this.range = calculateRangeImpl(\n measurements,\n outerSize,\n scrollOffset,\n lanes,\n // Pass the typed array so binary search + forward-walk can read\n // start/end directly from Float64Array, skipping the Proxy traps.\n lanes === 1 && this._singleLaneMeasurements !== null\n ? this._singleLaneMeasurements.flat\n : null,\n )\n return this.range\n },\n {\n key: process.env.NODE_ENV !== 'production' && 'calculateRange',\n debug: () => this.options.debug,\n },\n )\n\n getVirtualIndexes = memo(\n () => {\n let startIndex: number | null = null\n let endIndex: number | null = null\n const range = this.calculateRange()\n if (range) {\n startIndex = range.startIndex\n endIndex = range.endIndex\n }\n this.maybeNotify.updateDeps([this.isScrolling, startIndex, endIndex])\n return [\n this.options.rangeExtractor,\n this.options.overscan,\n this.options.count,\n startIndex,\n endIndex,\n ]\n },\n (rangeExtractor, overscan, count, startIndex, endIndex) => {\n return startIndex === null || endIndex === null\n ? []\n : rangeExtractor({\n startIndex,\n endIndex,\n overscan,\n count,\n })\n },\n {\n key: process.env.NODE_ENV !== 'production' && 'getVirtualIndexes',\n debug: () => this.options.debug,\n },\n )\n\n indexFromElement = (node: TItemElement) => {\n const attributeName = this.options.indexAttribute\n const indexStr = node.getAttribute(attributeName)\n\n if (!indexStr) {\n console.warn(\n `Missing attribute name '${attributeName}={index}' on measured element.`,\n )\n return -1\n }\n\n return parseInt(indexStr, 10)\n }\n\n /**\n * Determines if an item at the given index should be measured during smooth scroll.\n * During smooth scroll, only items within a buffer range around the target are measured\n * to prevent items far from the target from pushing it away.\n */\n private shouldMeasureDuringScroll = (index: number): boolean => {\n // No scroll state or not smooth scroll - always allow measurements\n if (!this.scrollState || this.scrollState.behavior !== 'smooth') {\n return true\n }\n\n const scrollIndex =\n this.scrollState.index ??\n this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index\n\n if (scrollIndex !== undefined && this.range) {\n // Allow measurements within a buffer range around the scroll target\n const bufferSize = Math.max(\n this.options.overscan,\n Math.ceil((this.range.endIndex - this.range.startIndex) / 2),\n )\n const minIndex = Math.max(0, scrollIndex - bufferSize)\n const maxIndex = Math.min(\n this.options.count - 1,\n scrollIndex + bufferSize,\n )\n return index >= minIndex && index <= maxIndex\n }\n\n return true\n }\n\n measureElement = (node: TItemElement | null) => {\n if (!node) {\n this.elementsCache.forEach((cached, key) => {\n if (!cached.isConnected) {\n this.observer.unobserve(cached)\n this.elementsCache.delete(key)\n }\n })\n return\n }\n\n const index = this.indexFromElement(node)\n if (!this.isIndexInRange(index)) return\n\n const key = this.options.getItemKey(index)\n const prevNode = this.elementsCache.get(key)\n\n if (prevNode !== node) {\n if (prevNode) {\n this.observer.unobserve(prevNode)\n }\n this.observer.observe(node)\n this.elementsCache.set(key, node)\n }\n\n // Sync-measure when idle (initial render) or during programmatic scrolling\n // (scrollToIndex/scrollToOffset) where reconcileScroll needs sizes in the same frame.\n // During normal user scrolling, skip sync measurement — the RO callback handles it async.\n if (\n (!this.isScrolling || this.scrollState) &&\n this.shouldMeasureDuringScroll(index)\n ) {\n this.resizeItem(index, this.options.measureElement(node, undefined, this))\n }\n }\n\n resizeItem = (index: number, size: number) => {\n if (!this.isIndexInRange(index)) return\n\n // Fast field reads. For lanes===1 we read raw start/size from the flat\n // typed array, avoiding a Proxy.get + VirtualItem allocation per call.\n // For lanes>1 we fall back to the cached VirtualItem array.\n let cachedSize: number\n let itemStart: number\n let key: Key\n const flat = this._singleLaneMeasurements?.flat\n if (this.options.lanes === 1 && flat != null) {\n key = this.options.getItemKey(index)\n itemStart = flat[index * 2]!\n cachedSize = flat[index * 2 + 1]!\n } else {\n const item = this.measurementsCache[index]\n if (!item) return\n key = item.key\n itemStart = item.start\n cachedSize = item.size\n }\n\n const itemSize = this.itemSizeCache.get(key) ?? cachedSize\n const delta = size - itemSize\n\n if (delta !== 0) {\n const wasAtEnd =\n this.options.anchorTo === 'end' &&\n this.scrollState?.behavior !== 'smooth' &&\n this.getVirtualDistanceFromEnd() <= this.options.scrollEndThreshold\n const prevTotalSize = wasAtEnd ? this.getTotalSize() : 0\n // Default anchoring predicate (used unless the consumer supplies a\n // custom shouldAdjustScrollPositionOnItemSizeChange).\n const scrollOffsetWithAdj =\n this.getScrollOffset() + this.scrollAdjustments\n const isFirstMeasure = !this.itemSizeCache.has(key)\n const defaultShouldAdjust = isFirstMeasure\n ? // First measurement: compensate any item whose top sits above the\n // fold — the estimate→actual delta must be corrected regardless of\n // scroll direction, since the whole estimated block was above it.\n itemStart < scrollOffsetWithAdj\n : // Re-measurement: only compensate an item that is ENTIRELY above the\n // fold. An item that merely *spans* the fold (top above, bottom\n // below — e.g. a streaming chat message growing at its bottom)\n // changes size *below* the anchor point, so shifting scrollTop by the\n // delta would drag the viewport downward on every growth (#1218).\n // Also skip during backward scroll to avoid the \"items jump while\n // scrolling up\" cascade.\n itemStart + itemSize <= scrollOffsetWithAdj &&\n this.scrollDirection !== 'backward'\n const shouldAdjustScroll =\n this.scrollState?.behavior !== 'smooth' &&\n (this.shouldAdjustScrollPositionOnItemSizeChange !== undefined\n ? this.shouldAdjustScrollPositionOnItemSizeChange(\n // The callback expects a VirtualItem; build one lazily only\n // when the consumer actually supplied a custom predicate.\n this.measurementsCache[index] ?? {\n index,\n key,\n start: itemStart,\n size: cachedSize,\n end: itemStart + cachedSize,\n lane: 0,\n },\n delta,\n this,\n )\n : defaultShouldAdjust)\n\n if (this.pendingMin === null || index < this.pendingMin) {\n this.pendingMin = index\n }\n this.itemSizeCache.set(key, size)\n this.itemSizeCacheVersion++\n\n let adjustedSync = false\n if (wasAtEnd) {\n adjustedSync = this.applyScrollAdjustment(\n this.getTotalSize() - prevTotalSize,\n )\n } else if (shouldAdjustScroll) {\n adjustedSync = this.applyScrollAdjustment(delta)\n }\n\n // When we just moved `scrollTop` to compensate for an above-viewport\n // resize, the grown item transforms must commit in the SAME frame as\n // that write. `applyScrollAdjustment` writes `scrollTop` synchronously\n // inside this ResizeObserver callback, but an async `notify` schedules\n // the transform render for a later commit — so the browser can paint\n // one frame with the new `scrollTop` and the old positions, and the\n // viewport visibly jumps by `delta` before snapping back (#1227). A\n // synchronous notify flushes the render in this same callback, so both\n // land in one paint. When nothing moved (or the write was deferred on\n // iOS), keep the cheaper async notify.\n this.notify(adjustedSync)\n // A consumer that grows the sizer synchronously inside `onChange`\n // (direct DOM updates) may never re-render when the range is\n // unchanged, so retry a clamped write here rather than only in\n // `_willUpdate` (#1266).\n this._retryClampedAdjustment()\n }\n }\n\n getVirtualItems = memo(\n () => [this.getVirtualIndexes(), this.getMeasurements()],\n (indexes, measurements) => {\n const virtualItems: Array<VirtualItem> = []\n\n for (let k = 0, len = indexes.length; k < len; k++) {\n const i = indexes[k]!\n const measurement = measurements[i]!\n\n virtualItems.push(measurement)\n }\n\n return virtualItems\n },\n {\n key: process.env.NODE_ENV !== 'production' && 'getVirtualItems',\n debug: () => this.options.debug,\n },\n )\n\n getVirtualItemForOffset = (offset: number) => {\n const measurements = this.getMeasurements()\n if (measurements.length === 0) {\n return undefined\n }\n // Same fast-path as calculateRange: read start values directly from the\n // typed array during binary search to skip the Proxy.get materialization\n // per probe.\n const flat = this._singleLaneMeasurements?.flat\n const useFlat = this.options.lanes === 1 && flat != null\n const idx = findNearestBinarySearch(\n 0,\n measurements.length - 1,\n useFlat\n ? (i: number) => flat[i * 2]!\n : (i: number) => notUndefined(measurements[i]).start,\n offset,\n )\n return notUndefined(measurements[idx])\n }\n\n private getMaxScrollOffset = () => {\n if (!this.scrollElement) return 0\n\n if ('scrollHeight' in this.scrollElement) {\n // Element\n return this.options.horizontal\n ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth\n : this.scrollElement.scrollHeight - this.scrollElement.clientHeight\n } else {\n // Window\n const doc = this.scrollElement.document.documentElement\n return this.options.horizontal\n ? doc.scrollWidth - this.scrollElement.innerWidth\n : doc.scrollHeight - this.scrollElement.innerHeight\n }\n }\n\n private getVirtualDistanceFromEnd = () => {\n return Math.max(\n this.getTotalSize() - this.getSize() - this.getScrollOffset(),\n 0,\n )\n }\n\n getDistanceFromEnd = () => {\n return Math.max(this.getMaxScrollOffset() - this.getScrollOffset(), 0)\n }\n\n isAtEnd = (threshold = this.options.scrollEndThreshold) => {\n return this.getDistanceFromEnd() <= threshold\n }\n\n getOffsetForAlignment = (\n toOffset: number,\n align: ScrollAlignment,\n itemSize = 0,\n ) => {\n if (!this.scrollElement) return 0\n\n const size = this.getSize()\n const scrollOffset = this.getScrollOffset()\n\n if (align === 'auto') {\n align = toOffset >= scrollOffset + size ? 'end' : 'start'\n }\n\n if (align === 'center') {\n // When aligning to a particular item (e.g. with scrollToIndex),\n // adjust offset by the size of the item to center on the item\n toOffset += (itemSize - size) / 2\n } else if (align === 'end') {\n toOffset -= size\n }\n\n const maxOffset = this.getMaxScrollOffset()\n\n return Math.max(Math.min(maxOffset, toOffset), 0)\n }\n\n getOffsetForIndex = (index: number, align: ScrollAlignment = 'auto') => {\n index = Math.max(0, Math.min(index, this.options.count - 1))\n\n const size = this.getSize()\n const scrollOffset = this.getScrollOffset()\n\n const item = this.measurementsCache[index]\n if (!item) return\n\n if (align === 'auto') {\n if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {\n align = 'end'\n } else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {\n align = 'start'\n } else {\n return [scrollOffset, align] as const\n }\n }\n\n // For the last item with 'end' alignment, use browser's actual max scroll\n // to account for borders/padding that aren't in our measurements\n if (align === 'end' && index === this.options.count - 1) {\n return [this.getMaxScrollOffset(), align] as const\n }\n\n const toOffset =\n align === 'end'\n ? item.end + this.options.scrollPaddingEnd\n : item.start - this.options.scrollPaddingStart\n\n return [\n this.getOffsetForAlignment(toOffset, align, item.size),\n align,\n ] as const\n }\n\n scrollToOffset = (\n toOffset: number,\n { align = 'start', behavior = 'auto' }: ScrollToOffsetOptions = {},\n ) => {\n // An absolute scroll command derives its target from current\n // measurements, so any iOS-deferred compensation still pending is stale by\n // definition — the command already accounts for the measurements the delta\n // was compensating for. Drop it so _flushIosDeferredIfReady doesn't replay\n // it onto the just-established position (relative commands like scrollBy\n // intentionally keep the deferral, since they build on the current offset).\n this._iosDeferredAdjustment = 0\n\n const offset = this.getOffsetForAlignment(toOffset, align)\n\n const now = this.now()\n this.scrollState = {\n index: null,\n align,\n behavior,\n startedAt: now,\n lastTargetOffset: offset,\n stableFrames: 0,\n }\n\n this._scrollToOffset(offset, { adjustments: undefined, behavior })\n\n this.scheduleScrollReconcile()\n }\n\n scrollToIndex = (\n index: number,\n {\n align: initialAlign = 'auto',\n behavior = 'auto',\n }: ScrollToIndexOptions = {},\n ) => {\n // See scrollToOffset: an absolute target invalidates any pending\n // iOS-deferred compensation.\n this._iosDeferredAdjustment = 0\n\n index = Math.max(0, Math.min(index, this.options.count - 1))\n\n const offsetInfo = this.getOffsetForIndex(index, initialAlign)\n if (!offsetInfo) {\n return\n }\n const [offset, align] = offsetInfo\n\n const now = this.now()\n this.scrollState = {\n index,\n align,\n behavior,\n startedAt: now,\n lastTargetOffset: offset,\n stableFrames: 0,\n }\n\n this._scrollToOffset(offset, { adjustments: undefined, behavior })\n\n this.scheduleScrollReconcile()\n }\n\n scrollBy = (\n delta: number,\n { behavior = 'auto' }: ScrollToOffsetOptions = {},\n ) => {\n const offset = this.getScrollOffset() + delta\n const now = this.now()\n\n this.scrollState = {\n index: null,\n align: 'start',\n behavior,\n startedAt: now,\n lastTargetOffset: offset,\n stableFrames: 0,\n }\n\n this._scrollToOffset(offset, { adjustments: undefined, behavior })\n\n this.scheduleScrollReconcile()\n }\n\n scrollToEnd = ({ behavior = 'auto' }: ScrollToEndOptions = {}) => {\n if (this.options.count > 0) {\n this.scrollToIndex(this.options.count - 1, {\n align: 'end',\n behavior,\n })\n return\n }\n\n this.scrollToOffset(Math.max(this.getTotalSize() - this.getSize(), 0), {\n behavior,\n })\n }\n\n getTotalSize = () => {\n const measurements = this.getMeasurements()\n\n let end: number\n // If there are no measurements, set the end to paddingStart\n // If there is only one lane, use the last measurement's end\n // Otherwise find the maximum end value among all measurements\n if (measurements.length === 0) {\n end = this.options.paddingStart\n } else if (this.options.lanes === 1) {\n // Fast path: read last item's end directly from the flat typed array\n // when available; avoids a Proxy.get + VirtualItem materialization\n // just to call getTotalSize (which React renders trigger every commit).\n const lastIdx = measurements.length - 1\n const flat = this._singleLaneMeasurements?.flat\n if (flat != null) {\n end = flat[lastIdx * 2]! + flat[lastIdx * 2 + 1]!\n } else {\n end = measurements[lastIdx]?.end ?? 0\n }\n } else {\n const endByLane = Array<number | null>(this.options.lanes).fill(null)\n let endIndex = measurements.length - 1\n while (endIndex >= 0 && endByLane.some((val) => val === null)) {\n const item = measurements[endIndex]!\n if (endByLane[item.lane] === null) {\n endByLane[item.lane] = item.end\n }\n\n endIndex--\n }\n\n end = Math.max(...endByLane.filter((val): val is number => val !== null))\n }\n\n return Math.max(\n end - this.options.scrollMargin + this.options.paddingEnd,\n 0,\n )\n }\n\n /**\n * Returns a snapshot of currently-measured items suitable for round-\n * tripping through state storage (sessionStorage, history, etc.) and\n * passing back as `initialMeasurementsCache` on remount. Pair with the\n * current `scrollOffset` to restore exact scroll position after navigation.\n *\n * Only items the consumer has actually rendered (and thus measured) appear\n * in the snapshot; unmeasured items will fall back to `estimateSize` on\n * restore. Returns an empty array if no items have been measured.\n */\n takeSnapshot = (): Array<VirtualItem> => {\n const snapshot: Array<VirtualItem> = []\n if (this.itemSizeCache.size === 0) return snapshot\n // Iterate measurementsCache only for indices whose key is in itemSizeCache\n // (i.e., have been measured). We build VirtualItem objects with the\n // current start/size/end so they can be persisted as plain data.\n const m = this.getMeasurements()\n for (const item of m) {\n if (item && this.itemSizeCache.has(item.key)) {\n // Force materialization (lazy path) and copy plain fields.\n snapshot.push({\n index: item.index,\n key: item.key,\n start: item.start,\n size: item.size,\n end: item.end,\n lane: item.lane,\n })\n }\n }\n return snapshot\n }\n\n private _scrollToOffset = (\n offset: number,\n {\n adjustments,\n behavior,\n }: {\n adjustments: number | undefined\n behavior: ScrollBehavior | undefined\n },\n ) => {\n // Record the intended logical scroll target so the next scroll event\n // can reconcile against subpixel rounding by the browser.\n this._intendedScrollOffset = offset + (adjustments ?? 0)\n this.options.scrollToFn(offset, { behavior, adjustments }, this)\n }\n\n measure = () => {\n // Reset pendingMin so the next getMeasurements rebuilds from index 0.\n // Without this, a prior resizeItem() that left pendingMin > 0 would\n // cause the rebuild to preserve stale items before that index.\n this.pendingMin = null\n this.itemSizeCache.clear()\n this.laneAssignments.clear() // Clear lane cache for full re-layout\n this.itemSizeCacheVersion++\n this.notify(false)\n }\n}\n\nconst findNearestBinarySearch = (\n low: number,\n high: number,\n getCurrentValue: (i: number) => number,\n value: number,\n) => {\n while (low <= high) {\n const middle = ((low + high) / 2) | 0\n const currentValue = getCurrentValue(middle)\n\n if (currentValue < value) {\n low = middle + 1\n } else if (currentValue > value) {\n high = middle - 1\n } else {\n return middle\n }\n }\n\n if (low > 0) {\n return low - 1\n } else {\n return 0\n }\n}\n\n// Monomorphic Float64Array variant — reads start values directly at stride\n// 2 instead of through a getter closure. JITs the inner load to a typed-\n// array bounds-check + load with no indirect call.\nfunction findNearestBinarySearchFlat(\n flat: Float64Array,\n high: number,\n value: number,\n) {\n let low = 0\n while (low <= high) {\n const middle = ((low + high) / 2) | 0\n const currentValue = flat[middle * 2]!\n\n if (currentValue < value) {\n low = middle + 1\n } else if (currentValue > value) {\n high = middle - 1\n } else {\n return middle\n }\n }\n return low > 0 ? low - 1 : 0\n}\n\nfunction calculateRangeImpl(\n measurements: Array<VirtualItem>,\n outerSize: number,\n scrollOffset: number,\n lanes: number,\n flat: Float64Array | null,\n) {\n const lastIndex = measurements.length - 1\n\n // handle case when item count is less than or equal to lanes\n if (measurements.length <= lanes) {\n return { startIndex: 0, endIndex: lastIndex }\n }\n\n if (lanes === 1 && flat !== null) {\n // Hot single-lane path: typed-array reads, no closures, no Proxy traps.\n const startIndex = findNearestBinarySearchFlat(\n flat,\n lastIndex,\n scrollOffset,\n )\n let endIndex = startIndex\n const limit = scrollOffset + outerSize\n while (\n endIndex < lastIndex &&\n flat[endIndex * 2]! + flat[endIndex * 2 + 1]! < limit\n ) {\n endIndex++\n }\n return { startIndex, endIndex }\n }\n\n // Fallback (lanes > 1 or no flat array): closure-based reads.\n const getStart = (index: number) => measurements[index]!.start\n let startIndex = findNearestBinarySearch(0, lastIndex, getStart, scrollOffset)\n let endIndex = startIndex\n\n if (lanes === 1) {\n while (\n endIndex < lastIndex &&\n measurements[endIndex]!.end < scrollOffset + outerSize\n ) {\n endIndex++\n }\n } else if (lanes > 1) {\n // Expand forward until we include the visible items from all lanes\n // which are closer to the end of the virtualizer window\n const endPerLane = Array(lanes).fill(0)\n while (\n endIndex < lastIndex &&\n endPerLane.some((pos) => pos < scrollOffset + outerSize)\n ) {\n const item = measurements[endIndex]!\n endPerLane[item.lane] = item.end\n endIndex++\n }\n\n // Expand backward until we include all lanes' visible items\n // closer to the top\n const startPerLane = Array(lanes).fill(scrollOffset + outerSize)\n while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {\n const item = measurements[startIndex]!\n startPerLane[item.lane] = item.start\n startIndex--\n }\n\n // Align startIndex to the beginning of its lane\n startIndex = Math.max(0, startIndex - (startIndex % lanes))\n // Align endIndex to the end of its lane\n endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - (endIndex % lanes)))\n }\n\n return { startIndex, endIndex }\n}\n", "import * as React from 'react'\nimport { flushSync } from 'react-dom'\nimport {\n Virtualizer,\n elementScroll,\n observeElementOffset,\n observeElementRect,\n observeWindowOffset,\n observeWindowRect,\n windowScroll,\n} from '@tanstack/virtual-core'\nimport type { PartialKeys, VirtualizerOptions } from '@tanstack/virtual-core'\n\nexport * from '@tanstack/virtual-core'\n\nconst useIsomorphicLayoutEffect =\n typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nexport type ReactVirtualizer<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> = Virtualizer<TScrollElement, TItemElement> & {\n /**\n * Ref callback for the inner size container element. Only meaningful when\n * `directDomUpdates: true` — the virtualizer writes the container's\n * main-axis size (`height` or `width`) directly to skip React re-renders.\n */\n containerRef: (node: HTMLElement | null) => void\n}\n\nexport type ReactVirtualizerOptions<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n> = VirtualizerOptions<TScrollElement, TItemElement> & {\n useFlushSync?: boolean\n /**\n * Skip React re-renders for scroll-only updates. The virtualizer writes\n * item positions (`top`/`left`) and the container size (`height`/`width`)\n * directly to the DOM, and only re-renders when the visible index range\n * or `isScrolling` changes.\n *\n * Requirements when enabled:\n * - Item elements must be `position: absolute`; in `'transform'` mode they\n * must also be anchored with `top: 0` / `left: 0`.\n * - Item elements must NOT set the main-axis position in their style — the\n * virtualizer owns `top` / `left` in `'position'` mode and `transform` in\n * `'transform'` mode.\n * - The inner size container must receive `virtualizer.containerRef` and\n * must NOT set `height` / `width` in its style.\n * - For multi-lane layouts (grids / masonry), the cross-axis position\n * (e.g. `left: ${(item.lane * 100) / lanes}%`) is stable per item and\n * must still be set in your JSX — only the main axis is automated.\n *\n * This flag is intended to be set once at mount. Toggling it (or\n * `directDomUpdatesMode`) at runtime can leave stale inline styles on\n * items and the container.\n */\n directDomUpdates?: boolean\n /**\n * How `directDomUpdates` positions item elements.\n * - `'transform'` (default): writes `transform: translate3d(...)`.\n * Promotes items to their own compositor layer — usually smoother on long\n * lists, but creates a stacking context and can interfere with\n * `position: fixed` descendants. Item elements must still be anchored with\n * `position: absolute`, `top: 0`, and `left: 0`.\n * - `'position'`: writes `top` / `left`. Item elements must be\n * `position: absolute`.\n */\n directDomUpdatesMode?: 'position' | 'transform'\n}\n\nfunction useVirtualizerBase<\n TScrollElement extends Element | Window,\n TItemElement extends Element,\n>({\n useFlushSync = true,\n directDomUpdates = false,\n directDomUpdatesMode = 'transform',\n ...options\n}: ReactVirtualizerOptions<TScrollElement, TItemElement>): ReactVirtualizer<\n TScrollElement,\n TItemElement\n> {\n const rerender = React.useReducer((x: number) => x + 1, 0)[1]\n\n // Mutable across renders so the onChange closure captured by setOptions\n // always reads the latest values without us having to re-create it.\n const directRef = React.useRef({\n enabled: directDomUpdates,\n mode: directDomUpdatesMode,\n container: null as HTMLElement | null,\n lastSize: null as number | null,\n // Keyed by the element itself so a remounted node (same key, new DOM\n // node — e.g. when `enabled` is toggled off then on) is treated as fresh\n // and gets its style written.\n lastPositions: new WeakMap<HTMLElement, number>(),\n prevRange: null as {\n startIndex: number\n endIndex: number\n isScrolling: boolean\n } | null,\n })\n directRef.current.enabled = directDomUpdates\n directRef.current.mode = directDomUpdatesMode\n\n // Writes the size container's total extent to the DOM. Idempotent — guarded\n // by lastSize. Split out from applyDirectStyles so it can run *before* the\n // scroll-position sync in the _willUpdate effect: an end-anchored prepend\n // grows the total and bumps scrollOffset in the same pass, and if scrollTop\n // is written before the container has grown the browser clamps it to the\n // stale (shorter) scrollHeight, leaving a gap at the top until the next\n // scroll (visible only in directDomUpdates mode — React-rendered sizers get\n // their height during render).\n const applyContainerSize = (\n instance: Virtualizer<TScrollElement, TItemElement>,\n ) => {\n const state = directRef.current\n if (!state.enabled || !state.container) return\n\n const totalSize = instance.getTotalSize()\n if (totalSize !== state.lastSize) {\n state.lastSize = totalSize\n const sizeAxis = instance.options.horizontal ? 'width' : 'height'\n state.container.style[sizeAxis] = `${totalSize}px`\n }\n }\n\n // Writes container size + item positions to the DOM. Idempotent — guarded\n // by lastSize / lastPositions. Called from onChange (covers scroll-driven\n // updates) and from a layout effect (covers post-render commits when refs\n // have just registered new items in elementsCache).\n const applyDirectStyles = (\n instance: Virtualizer<TScrollElement, TItemElement>,\n ) => {\n const state = directRef.current\n if (!state.enabled || !state.container) return\n\n applyContainerSize(instance)\n\n const horizontal = !!instance.options.horizontal\n const useTransform = state.mode === 'transform'\n const posAxis = horizontal ? 'left' : 'top'\n const scrollMargin = instance.options.scrollMargin\n const items = instance.getVirtualItems()\n for (const item of items) {\n const next = item.start - scrollMargin\n const el = instance.elementsCache.get(item.key) as HTMLElement | undefined\n if (!el) continue\n if (state.lastPositions.get(el) === next) continue\n state.lastPositions.set(el, next)\n if (useTransform) {\n el.style.transform = horizontal\n ? `translate3d(${next}px, 0, 0)`\n : `translate3d(0, ${next}px, 0)`\n } else {\n el.style[posAxis] = `${next}px`\n }\n }\n }\n\n const resolvedOptions: VirtualizerOptions<TScrollElement, TItemElement> = {\n ...options,\n onChange: (instance, sync) => {\n const state = directRef.current\n let shouldRerender = true\n\n if (state.enabled) {\n applyDirectStyles(instance)\n\n // Only re-render on range / isScrolling changes\n const range = instance.range\n const prev = state.prevRange\n shouldRerender =\n !prev ||\n prev.isScrolling !== instance.isScrolling ||\n prev.startIndex !== range?.startIndex ||\n prev.endIndex !== range?.endIndex\n if (shouldRerender) {\n state.prevRange = range\n ? {\n startIndex: range.startIndex,\n endIndex: range.endIndex,\n isScrolling: instance.isScrolling,\n }\n : null\n }\n }\n\n if (shouldRerender) {\n if (useFlushSync && sync) {\n flushSync(rerender)\n } else {\n rerender()\n }\n }\n\n options.onChange?.(instance, sync)\n },\n }\n\n const [instance] = React.useState(() => {\n const v = new Virtualizer<TScrollElement, TItemElement>(resolvedOptions)\n return Object.assign(v, {\n containerRef: (node: HTMLElement | null) => {\n const state = directRef.current\n state.container = node\n state.lastSize = null\n if (node && state.enabled) {\n const total = v.getTotalSize()\n state.lastSize = total\n const axis = v.options.horizontal ? 'width' : 'height'\n node.style[axis] = `${total}px`\n }\n },\n })\n })\n\n instance.setOptions(resolvedOptions)\n\n useIsomorphicLayoutEffect(() => {\n return instance._didMount()\n }, [])\n\n useIsomorphicLayoutEffect(() => {\n // Grow the size container to the new total BEFORE _willUpdate syncs the\n // scroll position. On an end-anchored prepend the scroll target lands at\n // the new bottom; if the container is still at its old (shorter) height the\n // browser clamps the scrollTop write and the list is left with a gap at the\n // top until the next scroll. Positions are written afterwards by the\n // applyDirectStyles effect below.\n applyContainerSize(instance)\n return instance._willUpdate()\n })\n\n // After every render commit, newly mounted item refs have registered in\n // elementsCache; write their positions to the DOM so the user doesn't see\n // them at (0, 0) until the next onChange.\n useIsomorphicLayoutEffect(() => {\n applyDirectStyles(instance)\n })\n\n return instance\n}\n\nexport function useVirtualizer<\n TScrollElement extends Element,\n TItemElement extends Element,\n>(\n options: PartialKeys<\n ReactVirtualizerOptions<TScrollElement, TItemElement>,\n 'observeElementRect' | 'observeElementOffset' | 'scrollToFn'\n >,\n): ReactVirtualizer<TScrollElement, TItemElement> {\n return useVirtualizerBase<TScrollElement, TItemElement>({\n observeElementRect: observeElementRect,\n observeElementOffset: observeElementOffset,\n scrollToFn: elementScroll,\n ...options,\n })\n}\n\nexport function useWindowVirtualizer<TItemElement extends Element>(\n options: PartialKeys<\n ReactVirtualizerOptions<Window, TItemElement>,\n | 'getScrollElement'\n | 'observeElementRect'\n | 'observeElementOffset'\n | 'scrollToFn'\n >,\n): ReactVirtualizer<Window, TItemElement> {\n return useVirtualizerBase<Window, TItemElement>({\n getScrollElement: () => (typeof document !== 'undefined' ? window : null),\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () => (typeof document !== 'undefined' ? window.scrollY : 0),\n ...options,\n })\n}\n", "'use client';\nimport { ComboboxOption } from \"./Option/Option.js\";\nimport { Combobox as Combobox$1 } from \"./Combobox.js\";\nimport { ComboboxEmpty } from \"./Empty.js\";\n//#region src/components/Combobox/index.ts\n/**\n* @deprecated Use `Suggestion` instead\n*/\nconst Combobox = Combobox$1;\nCombobox.Option = ComboboxOption;\nCombobox.Empty = ComboboxEmpty;\nCombobox.Option.displayName = \"Combobox.Option\";\nCombobox.Empty.displayName = \"Combobox.Empty\";\n//#endregion\nexport { Combobox, ComboboxEmpty, ComboboxOption };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/card/card-block.tsx\nconst CardBlock = forwardRef(function CardBlock({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"div\", {\n\t\tclassName: cl(`ds-card__block`, className),\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { CardBlock };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useEffect, useId, useRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/card/card.tsx\nconst ATTR_CLICKDELEGATE = \"data-clickdelegatefor\";\nconst SELECTOR_LINK = `:is(h1,h2,h3,h4,h5,h6) a`;\nconst SELECTOR_SKIP = \"a,button,label,details,dialog,[role=\\\"button\\\"],[popover],[contenteditable]\";\n/**\n* Card component to present content in a structured way.\n*\n* @example\n* <Card>\n* <Card.Block>Header</Card.Block>\n* <Card.Block>Content</Card.Block>\n* <Card.Block>Footer</Card.Block>\n* </Card>\n*/\nconst Card = forwardRef(function Card({ asChild = false, variant, className, ...rest }, ref) {\n\tconst Component = asChild ? Slot : \"div\";\n\tconst cardRef = useRef(null);\n\tconst linkGeneratedId = useId();\n\tconst mergedRefs = useMergeRefs([cardRef, ref]);\n\tuseEffect(() => {\n\t\tconst card = cardRef.current;\n\t\tconst link = card?.querySelector(SELECTOR_LINK);\n\t\tconst skip = !link || link.parentElement?.closest(SELECTOR_SKIP);\n\t\tconst id = link?.id;\n\t\tif (card?.hasAttribute(ATTR_CLICKDELEGATE) || skip) return;\n\t\tlink.id = id || linkGeneratedId;\n\t\tcard?.setAttribute(ATTR_CLICKDELEGATE, link.id);\n\t\treturn () => {\n\t\t\tif (id && link) link.id = id;\n\t\t\telse link?.removeAttribute(\"id\");\n\t\t\tcard?.removeAttribute(ATTR_CLICKDELEGATE);\n\t\t};\n\t}, []);\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\tclassName: cl(`ds-card`, className),\n\t\t\"data-variant\": variant,\n\t\tref: mergedRefs,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Card };\n", "'use client';\nimport { Card } from \"./card.js\";\nimport { CardBlock } from \"./card-block.js\";\n//#region src/components/card/index.ts\n/**\n* Card component to present content in a structured way.\n*\n* @example\n* <Card>\n* <Card.Block>Header</Card.Block>\n* <Card.Block>Content</Card.Block>\n* <Card.Block>Footer</Card.Block>\n* </Card>\n*/\nconst CardComponent = Object.assign(Card, { Block: CardBlock });\nCardComponent.Block.displayName = \"Card.Block\";\n//#endregion\nexport { CardComponent as Card, CardBlock };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/field/field-affix.tsx\n/**\n* FieldAffixes component, used to wrap a form field.\n*\n* @example\n* <Field.Affixes>\n* <Field.Affix>NOK</Field.Affix>\n* <Input />\n* <Field.Affix>pr. mnd.</Field.Affix>\n* </Field.Affixes>\n*/\nconst FieldAffixes = forwardRef(function FieldAffixes({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tclassName: cl(\"ds-field-affixes\", className),\n\t\tref,\n\t\t...rest\n\t});\n});\n/**\n* FieldAffix component, used to wrap a form field.\n* Use together with Field.Affixes.\n*\n* @example\n* <Field.Affixes>\n* <Field.Affix>NOK</Field.Affix>\n* <Input />\n* <Field.Affix>pr. mnd.</Field.Affix>\n* </Field.Affixes>\n*/\nconst FieldAffix = forwardRef(function FieldAffix({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"span\", {\n\t\tclassName: cl(\"ds-field-affix\", className),\n\t\t\"aria-hidden\": \"true\",\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { FieldAffix, FieldAffixes };\n", "'use client';\nimport { warn } from \"../../utilities/index.js\";\nimport { ValidationMessage } from \"../validation-message/validation-message.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/field/field-counter.tsx\n/**\n* FieldCounter component, used to display a counter for a form field.\n*\n* @example\n* <Field>\n* <Input />\n* <Field.Counter limit={100} under='%d tegn igjen' over='%d tegn for mye' />\n* </Field>\n*/\nconst FieldCounter = forwardRef(function FieldCounter({ limit, under, over, hint, ...rest }, _ref) {\n\tif (hint) warn(\"hint attribute is deprecated on Field.Counter\");\n\treturn /* @__PURE__ */ jsx(ValidationMessage, {\n\t\tsuppressHydrationWarning: true,\n\t\t\"data-field\": \"counter\",\n\t\t\"data-limit\": limit,\n\t\t\"data-under\": under,\n\t\t\"data-over\": over,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { FieldCounter };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/field/field-description.tsx\n/**\n* Field description component, used to provide additional information below the input.\n*\n* @example\n* <FieldDescription>Additional information</FieldDescription>\n*/\nconst FieldDescription = forwardRef(function FieldDescription(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tsuppressHydrationWarning: true,\n\t\t\"data-field\": \"description\",\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { FieldDescription };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/field/field.tsx\n/**\n* Field component, used to wrap a form field.\n*\n* @example\n* <Field>\n* <Label>Kort beskrivelse</Label>\n* <Field.Description>Beskrivelse</Field.Description>\n* <Input />\n* <ValidationMessage>Feilmelding</ValidationMessage>\n* </Field>\n*/\nconst Field = forwardRef(function Field({ className, position, asChild, ...rest }, ref) {\n\tconst Component = asChild ? Slot : \"ds-field\";\n\tconst mergedRefs = useMergeRefs([useRef(null), ref]);\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\t...asChild ? { className: cl(\"ds-field\", className) } : { class: cl(\"ds-field\", className) },\n\t\tsuppressHydrationWarning: true,\n\t\t\"data-position\": position,\n\t\tref: mergedRefs,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Field };\n", "'use client';\nimport { Field } from \"./field.js\";\nimport { FieldAffix, FieldAffixes } from \"./field-affix.js\";\nimport { FieldCounter } from \"./field-counter.js\";\nimport { FieldDescription } from \"./field-description.js\";\n//#region src/components/field/index.ts\n/**\n* Field component, used to wrap a form field.\n*\n* @example\n* <Field>\n* <Label>Kort beskrivelse</Label>\n* <Field.Description>Beskrivelse</Field.Description>\n* <Input />\n* <ValidationMessage>Feilmelding</ValidationMessage>\n* </Field>\n*/\nconst FieldComponent = Object.assign(Field, {\n\tDescription: FieldDescription,\n\tAffixes: FieldAffixes,\n\tAffix: FieldAffix,\n\tCounter: FieldCounter\n});\nFieldComponent.Description.displayName = \"Field.Description\";\nFieldComponent.Affixes.displayName = \"Field.Affixes\";\nFieldComponent.Affix.displayName = \"Field.Affix\";\nFieldComponent.Counter.displayName = \"Field.Counter\";\n//#endregion\nexport { FieldComponent as Field, FieldAffix, FieldAffixes, FieldCounter, FieldDescription };\n", "'use client';\nimport { Label } from \"../label/label.js\";\nimport { ValidationMessage } from \"../validation-message/validation-message.js\";\nimport { Input } from \"../input/input.js\";\nimport { Field as FieldComponent } from \"../field/index.js\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/checkbox/checkbox.tsx\n/**\n* Checkbox used to select multiple options.\n*\n* @example\n* <Checkbox label=\"I agree\" value=\"agree\" />\n*/\nconst Checkbox = forwardRef(function Checkbox({ \"data-size\": size, children, className, description, error, label, position, style, variant, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsxs(FieldComponent, {\n\t\t\"data-size\": size,\n\t\t\"data-variant\": variant,\n\t\t\"data-position\": position,\n\t\tclassName,\n\t\tstyle,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(Input, {\n\t\t\t\ttype: \"checkbox\",\n\t\t\t\tref,\n\t\t\t\t...rest\n\t\t\t}),\n\t\t\t!!label && /* @__PURE__ */ jsx(Label, {\n\t\t\t\tweight: \"regular\",\n\t\t\t\tchildren: label\n\t\t\t}),\n\t\t\t!!description && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\"data-field\": \"description\",\n\t\t\t\tchildren: description\n\t\t\t}),\n\t\t\t!!error && /* @__PURE__ */ jsx(ValidationMessage, { children: error })\n\t\t]\n\t});\n});\n//#endregion\nexport { Checkbox };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/details/details-content.tsx\n/**\n* Details content component, contains the content of the details item.\n*\n* @example\n* <DetailsContent>Content</DetailsContent>\n*/\nconst DetailsContent = forwardRef(function DetailsContent(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DetailsContent };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/details/details-summary.tsx\n/**\n* Details summary component, contains a the heading to toggle the content.\n*\n* @example\n* <Details.Summary>Heading</Details.Summary>\n*/\nconst DetailsSummary = forwardRef(function DetailsSummary(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"summary\", {\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DetailsSummary };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useEffect, useRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/details/details.tsx\n/**\n* Details component, contains `Details.Summary` and `Details.Content` components.\n*\n* @example\n* <Details>\n* <Details.Summary>Header</Details.Summary>\n* <Details.Content>Content</Details.Content>\n* </Details>\n*/\nconst Details = forwardRef(function Details({ className, open, defaultOpen = false, variant, onToggle, ...rest }, ref) {\n\tconst detailsRef = useRef(null);\n\tconst initialOpen = useRef(defaultOpen);\n\tconst mergedRefs = useMergeRefs([detailsRef, ref]);\n\tconst onToggleRef = useRef(onToggle);\n\tconst openRef = useRef(open);\n\tonToggleRef.current = onToggle;\n\topenRef.current = open;\n\tuseEffect(() => {\n\t\tconst details = detailsRef.current;\n\t\tconst handleToggle = (event) => {\n\t\t\tif (!details || details?.open === openRef.current) return;\n\t\t\tonToggleRef.current?.(event);\n\t\t\tif (openRef.current !== void 0) details.open = openRef.current;\n\t\t};\n\t\tdetails?.addEventListener(\"toggle\", handleToggle, true);\n\t\treturn () => details?.removeEventListener(\"toggle\", handleToggle, true);\n\t}, []);\n\treturn /* @__PURE__ */ jsx(\"details\", {\n\t\tclassName: cl(\"ds-details\", className),\n\t\topen: (open ?? initialOpen.current) || void 0,\n\t\t\"data-variant\": variant,\n\t\tref: mergedRefs,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Details };\n", "'use client';\nimport { Details } from \"./details.js\";\nimport { DetailsContent } from \"./details-content.js\";\nimport { DetailsSummary } from \"./details-summary.js\";\n//#region src/components/details/index.ts\n/**\n* Details component, contains `Details.Summary` and `Details.Content` components.\n*\n* @example\n* <Details>\n* <Details.Summary>Header</Details.Summary>\n* <Details.Content>Content</Details.Content>\n* </Details>\n*/\nconst DetailsComponent = Object.assign(Details, {\n\tSummary: DetailsSummary,\n\tContent: DetailsContent\n});\nDetailsComponent.Summary.displayName = \"Details.Summary\";\nDetailsComponent.Content.displayName = \"Details.Content\";\n//#endregion\nexport { DetailsComponent as Details, DetailsContent, DetailsSummary };\n", "'use client';\nimport { createContext, useRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dialog/dialog-trigger-context.tsx\nconst Context = createContext({ current: null });\n/**\n* DialogTriggerContext component, used to provide a context for a dialog trigger.\n*\n* @example\n* <Dialog.TriggerContext>\n* <Dialog.Trigger>Open Dialog</Dialog.Trigger>\n* <Dialog>\n* Content\n* </Dialog>\n* </Dialog.TriggerContext>\n*/\nconst DialogTriggerContext = (rest) => {\n\tconst contextRef = useRef(null);\n\treturn /* @__PURE__ */ jsx(Context.Provider, {\n\t\tvalue: contextRef,\n\t\t...rest\n\t});\n};\nDialogTriggerContext.displayName = \"DialogTriggerContext\";\n//#endregion\nexport { Context, DialogTriggerContext };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/dialog/dialog-block.tsx\n/**\n* DialogBlock component, used to separate content in a Dialog.\n*\n* @example\n* <Dialog>\n* <Dialog.Block>\n* Header\n* </Dialog.Block>\n* <Dialog.Block>\n* Content\n* </Dialog.Block>\n* <Dialog.Block>\n* Footer\n* </Dialog.Block>\n* </Dialog>\n*/\nconst DialogBlock = forwardRef(function DialogBlock({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"div\", {\n\t\tclassName: cl(\"ds-dialog__block\", className),\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DialogBlock };\n", "'use client';\nimport { Button } from \"../button/button.js\";\nimport { Context } from \"./dialog-trigger-context.js\";\nimport { forwardRef, useContext } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/dialog/dialog-trigger.tsx\n/**\n* DialogTrigger component, used within a Dialog.TriggerContext to open a dialog.\n*\n* @example\n* <Dialog.TriggerContext>\n* <Dialog.Trigger>Open Dialog</Dialog.Trigger>\n* <Dialog>\n* Content\n* </Dialog>\n* </Dialog.TriggerContext>\n*/\nconst DialogTrigger = forwardRef(function DialogTrigger({ asChild, ...rest }, ref) {\n\tconst contextRef = useContext(Context);\n\tconst Component = asChild ? Slot : Button;\n\tconst openDialog = () => {\n\t\tcontextRef.current?.getAttribute(\"data-modal\") === \"true\" ? contextRef.current?.showModal() : contextRef.current?.show();\n\t};\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\t\"aria-haspopup\": \"dialog\",\n\t\tonClick: openDialog,\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DialogTrigger };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport { Button } from \"../button/button.js\";\nimport { Context } from \"./dialog-trigger-context.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useContext, useEffect, useId, useRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/dialog/dialog.tsx\n/**\n* Dialog component, used to display a dialog dialog.\n*\n* @example with TriggerContext\n* <Dialog.TriggerContext>\n* <Dialog.Trigger>Open Dialog</Dialog.Trigger>\n* <Dialog>\n* <Dialog.Block>\n* Content\n* </Dialog.Block>\n* </Dialog>\n* </Dialog.TriggerContext>\n*\n* @example without TriggerContext\n* const dialogRef = useRef<HTMLDialogElement>(null);\n*\n* ...\n*\n* <Button command=\"show-modal\" commandfor=\"my-dialog\">Open Dialog</Button>\n* <Dialog id=\"my-dialog\">\n* Content\n* </Dialog>\n*/\nconst Dialog = forwardRef(function Dialog({ asChild, children, className, closeButton = \"Lukk dialogvindu\", id, modal = true, onAnimationEnd, onClick, onClose, open, placement = \"center\", ...rest }, ref) {\n\tconst contextRef = useContext(Context);\n\tconst dialogRef = useRef(null);\n\tconst skipCloseRef = useRef(false);\n\tconst Component = asChild ? Slot : \"dialog\";\n\tconst mergedRefs = useMergeRefs([\n\t\tcontextRef,\n\t\tref,\n\t\tdialogRef\n\t]);\n\tconst autoId = useId();\n\tconst usedId = id ?? autoId;\n\tuseEffect(() => {\n\t\tconst dialog = dialogRef.current;\n\t\tif (!dialog || open === void 0 || open === dialog.open) return;\n\t\tif (open) return dialog[modal ? \"showModal\" : \"show\"]();\n\t\tskipCloseRef.current = true;\n\t\tdialog.close();\n\t}, [open, modal]);\n\treturn /* @__PURE__ */ jsxs(Component, {\n\t\tclassName: cl(\"ds-dialog\", className),\n\t\t\"data-placement\": placement,\n\t\t\"data-modal\": modal,\n\t\tid: usedId,\n\t\tonClose: (event) => {\n\t\t\tif (event.target !== event.currentTarget) return;\n\t\t\tif (!skipCloseRef.current) onClose?.(event.nativeEvent);\n\t\t\tskipCloseRef.current = false;\n\t\t},\n\t\tonClick: (event) => {\n\t\t\tonClick?.(event);\n\t\t\tconst { currentTarget: dialog, target: el, defaultPrevented } = event;\n\t\t\tconst isClose = el?.closest?.(\"[data-command=\\\"close\\\"]\");\n\t\t\tif (!defaultPrevented && isClose) {\n\t\t\t\tdialog.close();\n\t\t\t\tif (window.dsWarnings !== false) console.log(\"Designsystemet: data-command=\\\"close\\\" is deprecated. Use command=\\\"close\\\" and commandfor=\\\"DIALOG-ID\\\" instead.\");\n\t\t\t}\n\t\t},\n\t\tonAnimationEnd: (event) => {\n\t\t\tonAnimationEnd?.(event);\n\t\t\tif (event.currentTarget !== event.target) return;\n\t\t\tconst autofocus = event.currentTarget.querySelector(\"[autofocus]\");\n\t\t\tif (document.activeElement !== autofocus) autofocus?.focus();\n\t\t},\n\t\tref: mergedRefs,\n\t\t...rest,\n\t\tchildren: [closeButton !== false && /* @__PURE__ */ jsx(Button, {\n\t\t\t\"aria-label\": closeButton,\n\t\t\t\"data-color\": \"neutral\",\n\t\t\ticon: true,\n\t\t\tvariant: \"tertiary\",\n\t\t\tcommand: \"close\",\n\t\t\tcommandfor: usedId\n\t\t}), children]\n\t});\n});\n//#endregion\nexport { Dialog };\n", "'use client';\nimport { DialogTriggerContext } from \"./dialog-trigger-context.js\";\nimport { Dialog } from \"./dialog.js\";\nimport { DialogBlock } from \"./dialog-block.js\";\nimport { DialogTrigger } from \"./dialog-trigger.js\";\n//#region src/components/dialog/index.ts\n/**\n* Dialog component, used to display a Dialog dialog.\n*\n* @example\n* <Dialog.TriggerContext>\n* <Dialog.Trigger>Open Dialog</Dialog.Trigger>\n* <Dialog>\n* <Dialog.Block>\n* Content\n* </Dialog.Block>\n* </Dialog>\n* </Dialog.TriggerContext>\n*/\nconst DialogComponent = Object.assign(Dialog, {\n\tBlock: DialogBlock,\n\tTriggerContext: DialogTriggerContext,\n\tTrigger: DialogTrigger\n});\nDialogComponent.Block.displayName = \"Dialog.Block\";\nDialogComponent.TriggerContext.displayName = \"Dialog.TriggerContext\";\nDialogComponent.Trigger.displayName = \"Dialog.Trigger\";\n//#endregion\nexport { DialogComponent as Dialog, DialogBlock, DialogTrigger, DialogTriggerContext };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/divider/divider.tsx\n/**\n* Divider component, used to separate content. Uses `hr` element.\n*\n* @example\n* <Divider />\n*/\nconst Divider = forwardRef(function Divider({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"hr\", {\n\t\t\"aria-hidden\": \"true\",\n\t\tclassName: cl(\"ds-divider\", className),\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Divider };\n", "'use client';\nimport { createContext, useId, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/popover/popover-trigger-context.tsx\n/**\n* PopoverTriggerContext component, use to wrap a Popover.Trigger and Popover.\n*\n* @example\n* <PopoverTriggerContext>\n* <PopoverTrigger>Open Popover</PopoverTrigger>\n* <Popover>\n* Content\n* </Popover>\n* </PopoverTriggerContext>\n*/\nconst PopoverTriggerContext = ({ children }) => {\n\tconst [popoverId, setPopoverId] = useState(useId());\n\treturn /* @__PURE__ */ jsx(Context.Provider, {\n\t\tvalue: {\n\t\t\tpopoverId,\n\t\t\tsetPopoverId\n\t\t},\n\t\tchildren\n\t});\n};\nPopoverTriggerContext.displayName = \"PopoverTriggerContext\";\nconst Context = createContext({});\n//#endregion\nexport { Context, PopoverTriggerContext };\n", "'use client';\nimport { Button } from \"../button/button.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown-button.tsx\n/**\n* DropdownButton component, used to display a button in the DropdownItem.\n*\n* @example\n* <Dropdown>\n* <DropdownList>\n* <DropdownItem>\n* <DropdownButton>Button</DropdownButton>\n* </DropdownItem>\n* </DropdownList>\n* </Dropdown>\n*/\nconst DropdownButton = forwardRef(function DropdownButton({ ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(Button, {\n\t\tref,\n\t\tvariant: \"tertiary\",\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DropdownButton };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/heading/heading.tsx\n/**\n* Use `Heading` to render h1-6 elements with heading text styles.\n*\n* @example\n* <Heading data-size='lg' level={2}>Heading</Heading>\n*/\nconst Heading = forwardRef(function Heading({ level = 2, className, asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : `h${level}`, {\n\t\tclassName: cl(`ds-heading`, className),\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Heading };\n", "'use client';\nimport { Heading } from \"../heading/heading.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown-heading.tsx\n/**\n* DropdownHeading component, used to display a heading in the Dropdown.\n*\n* @example\n* <Dropdown>\n* <DropdownHeading>Heading</DropdownHeading>\n* </Dropdown>\n*/\nconst DropdownHeading = forwardRef(function DropdownHeading(rest, ref) {\n\treturn /* @__PURE__ */ jsx(Heading, {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DropdownHeading };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown-item.tsx\n/**\n* DropdownItem component, used to display an item in the Dropdown. Used within a DropdownList.\n*\n* @example\n* <Dropdown>\n* <DropdownList>\n* <DropdownItem>\n* <DropdownButton>Button</DropdownButton>\n* </DropdownItem>\n* </DropdownList>\n* </Dropdown>\n*/\nconst DropdownItem = forwardRef(function DropdownItem(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"li\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DropdownItem };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown-list.tsx\n/**\n* DropdownList component, used to display a list of items in the Dropdown.\n*\n* @example\n* <Dropdown>\n* <DropdownList>\n* <DropdownItem>\n* <DropdownButton>Button</DropdownButton>\n* </DropdownItem>\n* </DropdownList>\n* </Dropdown>\n*/\nconst DropdownList = forwardRef(function DropdownList(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"ul\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DropdownList };\n", "'use client';\nimport { Button } from \"../button/button.js\";\nimport { Context } from \"./popover-trigger-context.js\";\nimport { forwardRef, useContext, version } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/popover/popover-trigger.tsx\n/**\n* PopoverTrigger component, used to trigger a popover.\n*\n* @example\n* <PopoverTriggerContext>\n* <PopoverTrigger>Open Popover</PopoverTrigger>\n* <Popover>\n* Content\n* </Popover>\n* </PopoverTriggerContext>\n*\n* @example inline\n* <PopoverTriggerContext>\n* <Paragraph>\n* We can use it <PopoverTrigger inline={true}>inline</PopoverTrigger>.\n* </Paragraph>\n* <Popover>\n* Content\n* </Popover>\n* </PopoverTriggerContext>\n*/\nconst PopoverTrigger = forwardRef(function PopoverTrigger({ id, inline, asChild, popovertarget, popoverTarget, ...rest }, ref) {\n\tconst { popoverId } = useContext(Context);\n\tconst Component = asChild ? Slot : inline ? \"button\" : Button;\n\tconst popoverVal = popoverTarget ?? popovertarget ?? popoverId;\n\tconst popoverKey = version.startsWith(\"19\") ? \"popoverTarget\" : \"popovertarget\";\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\tref,\n\t\t\"data-popover\": inline ? \"inline\" : void 0,\n\t\t[popoverKey]: popoverVal,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { PopoverTrigger };\n", "'use client';\nimport { PopoverTrigger } from \"../popover/popover-trigger.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown-trigger.tsx\n/**\n* DropdownTrigger component, used within a Dropdown.TriggerContext to open a Dropdown.\n*\n* @example\n* <Dropdown.TriggerContext>\n* <Dropdown.Trigger>Dropdown</Dropdown.Trigger>\n* <Dropdown>\n* <Dropdown.Heading>Heading</Dropdown.Heading>\n* <Dropdown.List>\n* <Dropdown.Item>\n* <Dropdown.Button>Button</Dropdown.Button>\n* </Dropdown.Item>\n* </Dropdown.List>\n* </Dropdown>\n* </Dropdown.TriggerContext>\n*/\nconst DropdownTrigger = forwardRef(function DropdownTrigger({ asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(PopoverTrigger, {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { DropdownTrigger };\n", "'use client';\nimport { PopoverTriggerContext } from \"../popover/popover-trigger-context.js\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown-trigger-context.tsx\n/**\n* DropdownTriggerContext enables use of the `.Trigger` for the Dropdown component.\n*\n* @example\n* <DropdownTriggerContext>\n* <DropdownTrigger>Dropdown</DropdownTrigger>\n* <Dropdown>\n* <DropdownHeading>Heading</DropdownHeading>\n* <DropdownList>\n* <DropdownItem>\n* <DropdownButton>Button</DropdownButton>\n* </DropdownItem>\n* </DropdownList>\n* </Dropdown>\n* </DropdownTriggerContext>\n*/\nconst DropdownTriggerContext = ({ children }) => {\n\treturn /* @__PURE__ */ jsx(PopoverTriggerContext, { children });\n};\nDropdownTriggerContext.displayName = \"DropdownTriggerContext\";\n//#endregion\nexport { DropdownTriggerContext };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport { Context } from \"./popover-trigger-context.js\";\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useContext, useEffect, useRef, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/popover/popover.tsx\nconst IS_DROPDOWN = /(?:^|\\s)ds-dropdown(?:\\s|$)/;\n/**\n* Popover component, used to display content in a popover over an element.\n*\n* @example with TriggerContext\n* <Popover.TriggerContext>\n* <Popover.Trigger>Open Popover</Popover.Trigger>\n* <Popover>\n* Content\n* </Popover>\n* </Popover.TriggerContext>\n*\n* @example without TriggerContext\n* <Button popovertarget=\"my-popover\">Open Popover</Button>\n* <Popover id=\"my-popover\">\n* Content\n* </Popover>\n*/\nconst Popover = forwardRef(function Popover({ id, className = \"\", onClose, onOpen, open, variant, placement = \"top\", autoPlacement = true, asChild = false, ...rest }, ref) {\n\tconst Component = asChild ? Slot : \"div\";\n\tconst popoverRef = useRef(null);\n\tconst mergedRefs = useMergeRefs([popoverRef, ref]);\n\tconst { popoverId, setPopoverId } = useContext(Context);\n\tconst [internalOpen, setInternalOpen] = useState(false);\n\tconst controlledOpen = open ?? internalOpen;\n\tuseEffect(() => {\n\t\tconst popover = popoverRef.current;\n\t\tconst trigger = `[popovertarget=\"${popover?.id}\"],[commandfor=\"${popover?.id}\"]`;\n\t\tconst handleClick = (event) => {\n\t\t\tconst el = event.target;\n\t\t\tconst isTrigger = el?.closest?.(trigger);\n\t\t\tconst isOutside = !isTrigger && !popover?.contains(el);\n\t\t\tif (isTrigger) event.preventDefault();\n\t\t\tif (controlledOpen && (isTrigger || isOutside)) {\n\t\t\t\tsetInternalOpen(false);\n\t\t\t\tonClose?.();\n\t\t\t} else if (!controlledOpen && isTrigger) {\n\t\t\t\tsetInternalOpen(true);\n\t\t\t\tonOpen?.();\n\t\t\t}\n\t\t};\n\t\tconst handleKeydown = (event) => {\n\t\t\tif (event.key === \"Escape\" && controlledOpen && isTopLayer(popover)) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tdocument.querySelector(trigger)?.focus?.();\n\t\t\t\tsetInternalOpen(false);\n\t\t\t\tonClose?.();\n\t\t\t}\n\t\t};\n\t\tpopover?.togglePopover?.(controlledOpen);\n\t\tif (controlledOpen) popover?.dispatchEvent(new CustomEvent(\"ds-toggle-source\", {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t\tdetail: document.querySelector(trigger)\n\t\t}));\n\t\tdocument.addEventListener(\"click\", handleClick, true);\n\t\tdocument.addEventListener(\"keydown\", handleKeydown);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"click\", handleClick, true);\n\t\t\tdocument.removeEventListener(\"keydown\", handleKeydown);\n\t\t};\n\t}, [controlledOpen]);\n\tuseEffect(() => {\n\t\tif (id) setPopoverId?.(id);\n\t}, [id]);\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\tclassName: cl(IS_DROPDOWN.test(className) ? void 0 : \"ds-popover\", className),\n\t\tid: id || popoverId,\n\t\tpopover: \"manual\",\n\t\t\"data-placement\": placement,\n\t\t\"data-variant\": variant,\n\t\tref: mergedRefs,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\nconst isTopLayer = (checkElement) => {\n\tif (!checkElement) return false;\n\tconst { x, y, width, height } = checkElement.getBoundingClientRect();\n\tconst topElement = document.elementFromPoint(x + width / 2, y + height / 2);\n\tfor (let el = topElement; el; el = el.parentElement) {\n\t\tif (checkElement === el) return true;\n\t\tif (el instanceof HTMLDialogElement && el.open) return false;\n\t\tif (el.classList.contains(\":popover-open\")) return false;\n\t\tif (el.matches(\":popover-open\")) return false;\n\t}\n\treturn false;\n};\n//#endregion\nexport { Popover };\n", "'use client';\nimport { Popover } from \"../popover/popover.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/dropdown/dropdown.tsx\n/**\n* Dropdown component, used to display a list of options.\n*\n* @example with TriggerContext\n* <Dropdown.TriggerContext>\n* <Dropdown.Trigger>Dropdown trigger</Dropdown.Trigger>\n* <Dropdown placement='bottom-end'>\n* <Dropdown.Heading>Dropdown</Dropdown.Heading>\n* <Dropdown.List>\n* <Dropdown.Item>\n* <Dropdown.Button>Option</Dropdown.Button>\n* </Dropdown.Item>\n* </Dropdown.List>\n* </Dropdown>\n* </Dropdown.TriggerContext>\n*\n* @example without TriggerContext\n* <Button popovertarget=\"my-dropdown\">Trigger</Button>\n* <Dropdown id=\"my-dropdown\">\n* <Dropdown.Heading>Heading</Dropdown.Heading>\n* <Dropdown.List>\n* <Dropdown.Item>\n* <Dropdown.Button>Item</Dropdown.Button>\n* </Dropdown.Item>\n* </Dropdown.List>\n* </Dropdown>\n*/\nconst Dropdown = forwardRef(function DropdownContent({ placement = \"bottom-end\", className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(Popover, {\n\t\tclassName: cl(\"ds-dropdown\", className),\n\t\tplacement,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Dropdown };\n", "'use client';\nimport { Dropdown } from \"./dropdown.js\";\nimport { DropdownButton } from \"./dropdown-button.js\";\nimport { DropdownHeading } from \"./dropdown-heading.js\";\nimport { DropdownItem } from \"./dropdown-item.js\";\nimport { DropdownList } from \"./dropdown-list.js\";\nimport { DropdownTrigger } from \"./dropdown-trigger.js\";\nimport { DropdownTriggerContext } from \"./dropdown-trigger-context.js\";\n//#region src/components/dropdown/index.ts\n/**\n* Dropdown component, used to display a list of options.\n*\n* @example with TriggerContext\n* <Dropdown.TriggerContext>\n* <Dropdown.Trigger>Dropdown trigger</Dropdown.Trigger>\n* <Dropdown placement='bottom-end'>\n* <Dropdown.Heading>Dropdown</Dropdown.Heading>\n* <Dropdown.List>\n* <Dropdown.Item>\n* <Dropdown.Button>Option</Dropdown.Button>\n* </Dropdown.Item>\n* </Dropdown.List>\n* </Dropdown>\n* </Dropdown.TriggerContext>\n*\n* @example without TriggerContext\n* <Button popovertarget=\"my-dropdown\">Trigger</Button>\n* <Dropdown id=\"my-dropdown\">\n* <Dropdown.Heading>Heading</Dropdown.Heading>\n* <Dropdown.List>\n* <Dropdown.Item>\n* <Dropdown.Button>Item</Dropdown.Button>\n* </Dropdown.Item>\n* </Dropdown.List>\n* </Dropdown>\n*/\nconst DropdownComponent = Object.assign(Dropdown, {\n\tTriggerContext: DropdownTriggerContext,\n\tHeading: DropdownHeading,\n\tList: DropdownList,\n\tItem: DropdownItem,\n\tButton: DropdownButton,\n\tTrigger: DropdownTrigger\n});\nDropdownComponent.TriggerContext.displayName = \"Dropdown.TriggerContext\";\nDropdownComponent.List.displayName = \"Dropdown.List\";\nDropdownComponent.Heading.displayName = \"Dropdown.Heading\";\nDropdownComponent.Item.displayName = \"Dropdown.Item\";\nDropdownComponent.Button.displayName = \"Dropdown.Button\";\nDropdownComponent.Trigger.displayName = \"Dropdown.Trigger\";\n//#endregion\nexport { DropdownComponent as Dropdown, DropdownButton, DropdownHeading, DropdownItem, DropdownList, DropdownTrigger, DropdownTriggerContext };\n", "'use client';\nimport { Heading } from \"../heading/heading.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/error-summary/error-summary-heading.tsx\n/**\n* ErrorSummary heading component, used to display a heading for the error summary.\n*\n* @example\n* <ErrorSummary>\n* <ErrorSummaryHeading>Heading</ErrorSummaryHeading>\n* </ErrorSummary>\n*/\nconst ErrorSummaryHeading = forwardRef(function ErrorSummaryHeading(rest, ref) {\n\treturn /* @__PURE__ */ jsx(Heading, {\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { ErrorSummaryHeading };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/list/list-item.tsx\n/**\n* Component that provides a list item.\n*\n* @example\n* <List.Item>Item</List.Item>\n*/\nconst ListItem = forwardRef(function ListItem({ asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"li\", {\n\t\t...rest,\n\t\tref\n\t});\n});\n//#endregion\nexport { ListItem };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/list/lists.tsx\n/**\n* ListUnordered component, used to display a list of items.\n* Renders a native `ul` element.\n*\n* @example\n* <ListUnordered>\n* <ListItem>Item 1</ListItem>\n* <ListItem>Item 2</ListItem>\n* </ListUnordered>\n*/\nconst ListUnordered = forwardRef(function ListUnordered({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"ul\", {\n\t\tclassName: cl(`ds-list`, className),\n\t\tref,\n\t\t...rest\n\t});\n});\n/**\n* ListOrdered component, used to display a list of items.\n* Renders a native `ol` element.\n*\n* @example\n* <ListOrdered>\n* <ListItem>Item 1</ListItem>\n* <ListItem>Item 2</ListItem>\n* </ListOrdered>\n*/\nconst ListOrdered = forwardRef(function ListOrdered({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"ol\", {\n\t\tclassName: cl(`ds-list`, className),\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { ListOrdered, ListUnordered };\n", "'use client';\nimport { ListItem } from \"./list-item.js\";\nimport { ListOrdered, ListUnordered } from \"./lists.js\";\n//#region src/components/list/index.ts\nconst ListComponent = {\n\tItem: ListItem,\n\tOrdered: ListOrdered,\n\tUnordered: ListUnordered\n};\nListComponent.Item.displayName = \"List.Item\";\nListComponent.Ordered.displayName = \"List.Ordered\";\nListComponent.Unordered.displayName = \"List.Unordered\";\n//#endregion\nexport { ListComponent as List, ListItem, ListOrdered, ListUnordered };\n", "'use client';\nimport { ListItem } from \"../list/list-item.js\";\nimport \"../list/index.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/error-summary/error-summary-item.tsx\n/**\n* ErrorSummaryItem component, used to display an error link in the ErrorSummary.\n*\n* @example\n* <ErrorSummaryItem>\n* <ErrorSummaryLink href=\"#\">\n* Link to error\n* </ErrorSummaryLink>\n* </ErrorSummaryItem>\n*/\nconst ErrorSummaryItem = forwardRef(function ErrorSummaryItem({ ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(ListItem, {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { ErrorSummaryItem };\n", "'use client';\nimport { Link } from \"../link/link.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/error-summary/error-summary-link.tsx\n/**\n* ErrorSummary link component, used to link to a specific error. Used within an ErrorSummary.Item.\n*\n* @example\n* <ErrorSummary>\n* <ErrorSummaryItem>\n* <ErrorSummaryLink href='#'>Error 1</ErrorSummaryLink>\n* </ErrorSummaryItem>\n* </ErrorSummary>\n*/\nconst ErrorSummaryLink = forwardRef(function ErrorSummaryLink({ ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(Link, {\n\t\tref,\n\t\t\"data-color\": \"neutral\",\n\t\t...rest\n\t});\n});\n//#endregion\nexport { ErrorSummaryLink };\n", "'use client';\nimport { List as ListComponent } from \"../list/index.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/error-summary/error-summary-list.tsx\n/**\n* ErrorSummary list component, used to display a list of errors.\n*\n* @example\n* <ErrorSummary>\n* <ErrorSummary.List>\n* <ErrorSummary.Item>\n* <ErrorSummary.Link href='#'>Error 1</ErrorSummary.Link>\n* </ErrorSummary.Item>\n* <ErrorSummary.Item>\n* <ErrorSummary.Link href='#'>Error 2</ErrorSummary.Link>\n* </ErrorSummary.Item>\n* </ErrorSummary.List>\n* </ErrorSummary>\n*/\nconst ErrorSummaryList = forwardRef(function ErrorSummaryList({ ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(ListComponent.Unordered, {\n\t\t...rest,\n\t\tref\n\t});\n});\n//#endregion\nexport { ErrorSummaryList };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/error-summary/error-summary.tsx\n/**\n* ErrorSummary component, used to display a list of errors.\n*\n* @example\n* <ErrorSummary>\n* <ErrorSummary.Heading>Heading</ErrorSummary.Heading>\n* <ErrorSummary.List>\n* <ErrorSummary.Item>\n* <ErrorSummary.Link href='#'>Error 1</ErrorSummary.Link>\n* </ErrorSummary.Item>\n* <ErrorSummary.Item>\n* <ErrorSummary.Link href='#'>Error 2</ErrorSummary.Link>\n* </ErrorSummary.Item>\n* </ErrorSummary.List>\n* </ErrorSummary>\n*/\nconst ErrorSummary = forwardRef(function ErrorSummary({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"ds-error-summary\", {\n\t\t...asChild ? { className: cl(\"ds-error-summary\", className) } : { class: cl(\"ds-error-summary\", className) },\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { ErrorSummary };\n", "'use client';\nimport { ErrorSummary } from \"./error-summary.js\";\nimport { ErrorSummaryHeading } from \"./error-summary-heading.js\";\nimport { ErrorSummaryItem } from \"./error-summary-item.js\";\nimport { ErrorSummaryLink } from \"./error-summary-link.js\";\nimport { ErrorSummaryList } from \"./error-summary-list.js\";\n//#region src/components/error-summary/index.ts\n/**\n* ErrorSummary component, used to display a list of errors.\n*\n* @example\n* <ErrorSummary>\n* <ErrorSummary.Heading>Heading</ErrorSummary.Heading>\n* <ErrorSummary.List>\n* <ErrorSummary.Item>\n* <ErrorSummary.Link href='#'>Error 1</ErrorSummary.Link>\n* </ErrorSummary.Item>\n* <ErrorSummary.Item>\n* <ErrorSummary.Link href='#'>Error 2</ErrorSummary.Link>\n* </ErrorSummary.Item>\n* </ErrorSummary.List>\n* </ErrorSummary>\n*/\nconst ErrorSummaryComponent = Object.assign(ErrorSummary, {\n\tHeading: ErrorSummaryHeading,\n\tItem: ErrorSummaryItem,\n\tList: ErrorSummaryList,\n\tLink: ErrorSummaryLink\n});\nErrorSummaryComponent.Item.displayName = \"ErrorSummary.Item\";\nErrorSummaryComponent.Heading.displayName = \"ErrorSummary.Heading\";\nErrorSummaryComponent.List.displayName = \"ErrorSummary.List\";\nErrorSummaryComponent.Link.displayName = \"ErrorSummary.Link\";\n//#endregion\nexport { ErrorSummaryComponent as ErrorSummary, ErrorSummaryHeading, ErrorSummaryItem, ErrorSummaryLink, ErrorSummaryList };\n", "'use client';\nimport { Paragraph } from \"../paragraph/paragraph.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/fieldset/fieldset-description.tsx\n/**\n* FieldsetDescription component, used to display a description for a fieldset.\n*\n* @example\n* <FieldsetDescription>\n* Gi en kort beskrivelse i begge feltene\n* </FieldsetDescription>\n*/\nconst FieldsetDescription = forwardRef(function FieldsetDescription(rest, ref) {\n\treturn /* @__PURE__ */ jsx(Paragraph, {\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { FieldsetDescription };\n", "'use client';\nimport { Label } from \"../label/label.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/fieldset/fieldset-legend.tsx\n/**\n* FieldsetLegend component, used to display a legend for a fieldset.\n*\n* @example\n* <FieldsetLegend>Skriv inn dine svar</FieldsetLegend>\n*/\nconst FieldsetLegend = forwardRef(function FieldsetLegend(rest, ref) {\n\treturn /* @__PURE__ */ jsx(Label, {\n\t\tasChild: true,\n\t\tchildren: /* @__PURE__ */ jsx(\"legend\", {\n\t\t\tsuppressHydrationWarning: true,\n\t\t\tref,\n\t\t\t...rest\n\t\t})\n\t});\n});\n//#endregion\nexport { FieldsetLegend };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/fieldset/fieldset.tsx\n/**\n* Fieldset component, used to wrap a form field. Uses native `fieldset` element.\n*\n* @example\n* <Fieldset>\n* <Fieldset.Legend>Skriv inn dine svar</Fieldset.Legend>\n* <Fieldset.Description>\n* Gi en kort beskrivelse i begge feltene\n* </Fieldset.Description>\n* <Field>\n* <Label>Kort beskrivelse</Label>\n* <Input />\n* </Field>\n* </Fieldset>\n*/\nconst Fieldset = forwardRef(function Fieldset({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"fieldset\", {\n\t\tclassName: cl(\"ds-fieldset\", className),\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Fieldset };\n", "'use client';\nimport { Fieldset } from \"./fieldset.js\";\nimport { FieldsetDescription } from \"./fieldset-description.js\";\nimport { FieldsetLegend } from \"./fieldset-legend.js\";\n//#region src/components/fieldset/index.ts\n/**\n* Fieldset component, used to wrap a form field.\n*\n* @example\n* <Fieldset>\n* <Fieldset.Legend>Skriv inn dine svar</Fieldset.Legend>\n* <Fieldset.Description>\n* Gi en kort beskrivelse i begge feltene\n* </Fieldset.Description>\n* <Field>\n* <Label>Kort beskrivelse</Label>\n* <Input />\n* </Field>\n* </Fieldset>\n*/\nconst FieldsetComponent = Object.assign(Fieldset, {\n\tLegend: FieldsetLegend,\n\tDescription: FieldsetDescription\n});\nFieldsetComponent.Legend.displayName = \"Fieldset.Legend\";\nFieldsetComponent.Description.displayName = \"Fieldset.Description\";\n//#endregion\nexport { FieldsetComponent as Fieldset, FieldsetDescription, FieldsetLegend };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/file-upload/file-upload.tsx\n/**\n* FileUpload component to present a file upload area.\n*\n* @example\n* <Field>\n* <Label>Upload file</Label>\n* <FileUpload>\n* <CloudUpIcon aria-hidden='true' />\n* <Field.Description>Drop file here</Field.Description>\n* <Field.Description>\n* File must be in csv format and less than 2MB\n* </Field.Description>\n* <Button asChild data-variant='secondary'>\n* <span>Upload file</span>\n* </Button>\n* <input type=\"file\" />\n* </FileUpload>\n* </Field>\n*/\nconst FileUpload = forwardRef(function FileUpload({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"div\", {\n\t\tref,\n\t\tclassName: cl(\"ds-file-upload\", className),\n\t\t...rest\n\t});\n});\n//#endregion\nexport { FileUpload };\n", "'use client';\nimport { Button } from \"../button/button.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/pagination/pagination-button.tsx\n/**\n* PaginationButton component, use within a Pagination.Item.\n*\n* @example\n* <PaginationItem>\n* <PaginationButton aria-label='Forrige side'>Forrige</PaginationButton>\n* </PaginationItem>\n*/\nconst PaginationButton = forwardRef(function PaginationButton(rest, ref) {\n\treturn /* @__PURE__ */ jsx(Button, {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { PaginationButton };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/pagination/pagination-item.tsx\n/**\n* PaginationItem component, use within a Pagination.List.\n*\n* @example\n* <PaginationList>\n* <PaginationItem>\n* <PaginationButton aria-label='Forrige side'>Forrige</PaginationButton>\n* </PaginationItem>\n* </PaginationList>\n*/\nconst PaginationItem = forwardRef(function PaginationItem({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"li\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { PaginationItem };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/pagination/pagination-list.tsx\n/**\n* PaginationList component, use within a Pagination.\n*\n* @example\n* <Pagination>\n* <PaginationList>\n* <PaginationItem>\n* <PaginationButton aria-label='Forrige side'>Forrige</PaginationButton>\n* </PaginationItem>\n* </PaginationList>\n* </Pagination>\n*/\nconst PaginationList = forwardRef(function PaginationList({ asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"ul\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { PaginationList };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/pagination/pagination.tsx\n/**\n* Pagination component, used to navigate through a list of items.\n*\n* @example\n* <Pagination>\n* <Pagination.List>\n* <Pagination.Item>\n* <Pagination.Button aria-label='Forrige side'>Forrige</Pagination.Button>\n* </Pagination.Item>\n* <Pagination.Item>\n* <Pagination.Button aria-label='Side 1'>1</Pagination.Button>\n* </Pagination.Item>\n* <Pagination.Item>\n* <Pagination.Button aria-label='Side 2'>2</Pagination.Button>\n* </Pagination.Item>\n* </Pagination.List>\n* </Pagination>\n*/\nconst Pagination = forwardRef(function Pagination({ asChild, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"ds-pagination\", {\n\t\t...asChild ? { className: cl(\"ds-pagination\", className) } : { class: cl(\"ds-pagination\", className) },\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Pagination };\n", "'use client';\nimport { Pagination } from \"./pagination.js\";\nimport { PaginationButton } from \"./pagination-button.js\";\nimport { PaginationItem } from \"./pagination-item.js\";\nimport { PaginationList } from \"./pagination-list.js\";\n//#region src/components/pagination/index.ts\n/**\n* Pagination component, used to navigate through a list of items.\n*\n* @example\n* <Pagination>\n* <Pagination.List>\n* <Pagination.Item>\n* <Pagination.Button aria-label='Forrige side'>Forrige</Pagination.Button>\n* </Pagination.Item>\n* <Pagination.Item>\n* <Pagination.Button aria-label='Side 1'>1</Pagination.Button>\n* </Pagination.Item>\n* <Pagination.Item>\n* <Pagination.Button aria-label='Side 2'>2</Pagination.Button>\n* </Pagination.Item>\n* </Pagination.List>\n* </Pagination>\n*/\nconst PaginationComponent = Object.assign(Pagination, {\n\tList: PaginationList,\n\tItem: PaginationItem,\n\tButton: PaginationButton\n});\nPaginationComponent.List.displayName = \"Pagination.List\";\nPaginationComponent.Item.displayName = \"Pagination.Item\";\nPaginationComponent.Button.displayName = \"Pagination.Button\";\n//#endregion\nexport { PaginationComponent as Pagination, PaginationButton, PaginationItem, PaginationList };\n", "'use client';\nimport { PopoverTriggerContext } from \"./popover-trigger-context.js\";\nimport { Popover } from \"./popover.js\";\nimport { PopoverTrigger } from \"./popover-trigger.js\";\n//#region src/components/popover/index.ts\n/**\n* Popover component, used to display content in a popover over an element.\n*\n* @example\n* <Popover.TriggerContext>\n* <Popover.Trigger>Open Popover</Popover.Trigger>\n* <Popover>\n* Content\n* </Popover>\n* </Popover.TriggerContext>\n*/\nconst PopoverComponent = Object.assign(Popover, {\n\tTriggerContext: PopoverTriggerContext,\n\tTrigger: PopoverTrigger\n});\nPopoverComponent.TriggerContext.displayName = \"Popover.TriggerContext\";\nPopoverComponent.Trigger.displayName = \"Popover.Trigger\";\n//#endregion\nexport { PopoverComponent as Popover, PopoverTrigger, PopoverTriggerContext };\n", "'use client';\nimport { Label } from \"../label/label.js\";\nimport { ValidationMessage } from \"../validation-message/validation-message.js\";\nimport { Input } from \"../input/input.js\";\nimport { Field as FieldComponent } from \"../field/index.js\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/radio/radio.tsx\n/**\n* Radio used to select multiple options.\n*\n* @example\n* <Radio label=\"I agree\" value=\"agree\" />\n*/\nconst Radio = forwardRef(function Radio({ \"data-size\": size, children, className, description, error, label, position, style, variant, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsxs(FieldComponent, {\n\t\t\"data-size\": size,\n\t\t\"data-variant\": variant,\n\t\t\"data-position\": position,\n\t\tclassName,\n\t\tstyle,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(Input, {\n\t\t\t\ttype: \"radio\",\n\t\t\t\tref,\n\t\t\t\t...rest\n\t\t\t}),\n\t\t\t!!label && /* @__PURE__ */ jsx(Label, {\n\t\t\t\tweight: \"regular\",\n\t\t\t\tchildren: label\n\t\t\t}),\n\t\t\t!!description && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\"data-field\": \"description\",\n\t\t\t\tchildren: description\n\t\t\t}),\n\t\t\t!!error && /* @__PURE__ */ jsx(ValidationMessage, { children: error })\n\t\t]\n\t});\n});\n//#endregion\nexport { Radio };\n", "'use client';\nimport { Button } from \"../button/button.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/search/search-button.tsx\n/**\n* SearchButton component, used to display a search button within a Search component.\n*\n* @example\n* <Search>\n* <SearchInput aria-label='S\u00F8k' />\n* <SearchButton>S\u00F8k</SearchButton>\n* </Search>\n*/\nconst SearchButton = forwardRef(function SearchButton({ children = \"S\u00F8k\", ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(Button, {\n\t\tref,\n\t\ttype: \"submit\",\n\t\t...rest,\n\t\tchildren\n\t});\n});\n//#endregion\nexport { SearchButton };\n", "'use client';\nimport { Button } from \"../button/button.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/search/search-clear.tsx\n/**\n* SearchClear component, used to display a clear button when the search input is not empty.\n*\n* @example\n* <Search>\n* <SearchInput aria-label='S\u00F8k' />\n* <SearchClear />\n* </Search>\n*/\nconst SearchClear = forwardRef(function SearchClear({ \"aria-label\": label = \"T\u00F8m\", ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(Button, {\n\t\t\"aria-label\": label,\n\t\tref,\n\t\ttype: \"reset\",\n\t\tvariant: \"tertiary\",\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SearchClear };\n", "'use client';\nimport { Input } from \"../input/input.js\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/search/search-input.tsx\n/**\n* SearchInput component, used to display a search input within the Search component.\n*\n* @example\n* <Search>\n* <SearchInput aria-label='S\u00F8k' />\n* </Search>\n*/\nconst SearchInput = forwardRef(function SearchInput({ type = \"search\", ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(Input, {\n\t\tref,\n\t\ttype,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SearchInput };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/search/search.tsx\n/**\n* Search component, use to display different variations of a search input\n*\n* @example with button\n* <Search>\n* <Search.Input aria-label='S\u00F8k' />\n* <Search.Clear />\n* <Search.Button />\n* </Search>\n*\n* @example with icon\n* <Search>\n* <Search.Input aria-label='S\u00F8k' />\n* <Search.Clear />\n* </Search>\n*/\nconst Search = forwardRef(function Search({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"ds-suggestion\", {\n\t\tref,\n\t\tclass: cl(\"ds-search\", className),\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Search };\n", "'use client';\nimport { Search } from \"./search.js\";\nimport { SearchButton } from \"./search-button.js\";\nimport { SearchClear } from \"./search-clear.js\";\nimport { SearchInput } from \"./search-input.js\";\n//#region src/components/search/index.ts\n/**\n* Search component, use to display different variations of a search input\n*\n* @example with button\n* <Search>\n* <Search.Input aria-label='S\u00F8k' />\n* <Search.Clear />\n* <Search.Button />\n* </Search>\n*\n* @example with icon\n* <Search>\n* <Search.Input aria-label='S\u00F8k' />\n* <Search.Clear />\n* </Search>\n*/\nconst SearchComponent = Object.assign(Search, {\n\tClear: SearchClear,\n\tButton: SearchButton,\n\tInput: SearchInput\n});\nSearchComponent.Clear.displayName = \"Search.Clear\";\nSearchComponent.Button.displayName = \"Search.Button\";\nSearchComponent.Input.displayName = \"Search.Input\";\n//#endregion\nexport { SearchComponent as Search, SearchButton, SearchClear, SearchInput };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/select/select-optgroup.tsx\n/**\n* SelectOptgroup component, used to display a native optgroup within a select.\n*\n* @example\n* <Select>\n* <SelectOptgroup label='Group 1'>\n* <SelectOption value='1'>Option 1</SelectOption>\n* <SelectOption value='2'>Option 2</SelectOption>\n* </SelectOptgroup>\n* </Select>\n*/\nconst SelectOptgroup = forwardRef(function SelectOptgroup({ asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"optgroup\", {\n\t\t...rest,\n\t\tref\n\t});\n});\n//#endregion\nexport { SelectOptgroup };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/select/select-option.tsx\n/**\n* SelectOption component, used to display a native option within a select.\n*\n* @example\n* <Select>\n* <SelectOption value='1'>Option 1</SelectOption>\n* <SelectOption value='2'>Option 2</SelectOption>\n* </Select>\n*/\nconst SelectOption = forwardRef(function SelectOption({ asChild, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(asChild ? Slot : \"option\", {\n\t\t...rest,\n\t\tref\n\t});\n});\n//#endregion\nexport { SelectOption };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/select/select.tsx\n/**\n* Select component, used to display a native select.\n*\n* @example\n* <Select>\n* <Select.Option value='1'>Option 1</Select.Option>\n* <Select.Option value='2'>Option 2</Select.Option>\n* </Select>\n*/\nconst Select = forwardRef(function Select({ className, onKeyDown, onMouseDown, width, readOnly, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"select\", {\n\t\tclassName: cl(\"ds-input\", className),\n\t\t\"aria-readonly\": rest[\"aria-readonly\"] ?? readOnly,\n\t\tsuppressHydrationWarning: true,\n\t\t\"data-width\": width,\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Select };\n", "'use client';\nimport { Select } from \"./select.js\";\nimport { SelectOptgroup } from \"./select-optgroup.js\";\nimport { SelectOption } from \"./select-option.js\";\n//#region src/components/select/index.ts\n/**\n* Select component, used to display a native select.\n*\n* @example\n* <Select>\n* <Select.Option value='1'>Option 1</Select.Option>\n* <Select.Option value='2'>Option 2</Select.Option>\n* </Select>\n*/\nconst SelectComponent = Object.assign(Select, {\n\tOption: SelectOption,\n\tOptgroup: SelectOptgroup\n});\nSelectComponent.Option.displayName = \"Select.Option\";\nSelectComponent.Optgroup.displayName = \"Select.Optgroup\";\n//#endregion\nexport { SelectComponent as Select, SelectOptgroup, SelectOption };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport { useSynchronizedAnimation } from \"../../utilities/hooks/use-synchronized-animation/use-synchronized-animation.js\";\nimport \"../../utilities/hooks/index.js\";\nimport \"../../utilities/index.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/skeleton/skeleton.tsx\n/**\n* Skeleton is used to represent a draft of page while the content loads.\n*\n* @example\n* <Skeleton variant=\"circle\" />\n* <Skeleton variant=\"text\" />\n* <Skeleton variant=\"rectangle\" />\n*/\nconst Skeleton = forwardRef(function Skeleton({ asChild, className, height, style, variant, width, ...rest }, ref) {\n\tconst Component = asChild ? Slot : \"span\";\n\tconst isText = variant === \"text\";\n\tconst mergedRefs = useMergeRefs([useSynchronizedAnimation(\"ds-skeleton-opacity-fade\"), ref]);\n\treturn /* @__PURE__ */ jsx(Component, {\n\t\t\"aria-hidden\": \"true\",\n\t\tclassName: cl(\"ds-skeleton\", className),\n\t\t\"data-text\": isText ? \"-\".repeat(Number(width) || 1) : void 0,\n\t\t\"data-variant\": variant,\n\t\tref: mergedRefs,\n\t\tstyle: isText ? style : {\n\t\t\twidth,\n\t\t\theight,\n\t\t\t...style\n\t\t},\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Skeleton };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/skip-link/skip-link.tsx\n/**\n* SkipLink component, used to display a skip link within the page.\n* Place it at the top of the page to allow users to skip to the main content.\n*\n* @example\n* <SkipLink href='#main-content'>Skip to main content</SkipLink>\n*/\nconst SkipLink = forwardRef(function SkipLink({ children, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"a\", {\n\t\tclassName: cl(\"ds-skip-link\", className),\n\t\t...rest,\n\t\tref,\n\t\tchildren\n\t});\n});\n//#endregion\nexport { SkipLink };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion-clear.tsx\n/**\n* Component that provides a clear button for the Suggestion input.\n*\n* Place as a descendant of `Suggestion`\n*\n* @example\n* <Suggestion>\n* <Suggestion.Input />\n* <Suggestion.Toggle />\n* <Suggestion.Clear />\n* <Suggestion.List />\n* </Suggestion>\n*/\nconst SuggestionClear = forwardRef(function SuggestionClear({ \"aria-label\": label = \"T\u00F8m\", ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"button\", {\n\t\t\"aria-label\": label,\n\t\thidden: true,\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\ttype: \"reset\",\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SuggestionClear };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion-empty.tsx\n/**\n* Component that provides an empty Suggestion list.\n*\n* Place as a descendant of `Suggestion.List`\n*\n* @example\n* <Suggestion.List>\n* <Suggestion.Empty>Tomt</Suggestion.Empty>\n* </Suggestion.List>\n*/\nconst SuggestionEmpty = forwardRef(function SuggestionEmpty(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"u-option\", {\n\t\t\"data-empty\": true,\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SuggestionEmpty };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport cl from \"clsx/lite\";\nimport { createContext, forwardRef, useCallback, useEffect, useId, useRef, useState } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion.tsx\nconst text = (el) => el.textContent?.trim() || \"\";\nconst sanitizeItems = (values = []) => typeof values === \"string\" ? [{\n\tlabel: values,\n\tvalue: values\n}] : !Array.isArray(values) ? [values] : values.map((value) => typeof value === \"string\" ? {\n\tlabel: value,\n\tvalue\n} : value);\nconst nextItems = (data, prev, multiple) => {\n\tconst item = {\n\t\tlabel: text(data),\n\t\tvalue: data.value\n\t};\n\tif (!multiple) return data.isConnected ? void 0 : item;\n\treturn data.isConnected ? sanitizeItems(prev).filter(({ value }) => value !== item.value) : [...sanitizeItems(prev), item];\n};\nconst defaultFilter = ({ label, input }) => label.toLowerCase().includes(input.value.trim().toLowerCase());\nconst Suggestion = forwardRef(function Suggestion({ children, className, creatable = false, defaultSelected, filter = true, multiple = false, name, onBeforeMatch, onSelectedChange, renderSelected = ({ label }) => label, selected, ...rest }, ref) {\n\tconst dsSuggestionRef = useRef(null);\n\tconst genId = useId();\n\tconst selectId = rest.id ? `${rest.id}-select` : genId;\n\tconst isControlled = selected !== void 0;\n\tconst mergedRefs = useMergeRefs([ref, dsSuggestionRef]);\n\tconst [defaultItems, setDefaultItems] = useState(sanitizeItems(defaultSelected));\n\tconst selectedItems = selected ? sanitizeItems(selected) : defaultItems;\n\tconst onSelectedChangeRef = useRef(onSelectedChange);\n\tconst selectedItemsRef = useRef(selectedItems);\n\tuseEffect(() => {\n\t\tonSelectedChangeRef.current = onSelectedChange;\n\t}, [onSelectedChange]);\n\tuseEffect(() => {\n\t\tselectedItemsRef.current = selectedItems;\n\t}, [selectedItems]);\n\t/**\n\t* Listerners and handling of adding/removing\n\t*/\n\tuseEffect(() => {\n\t\tconst combobox = dsSuggestionRef.current;\n\t\tconst beforeChange = (event) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst multiple = combobox?.multiple;\n\t\t\tconst data = event.detail;\n\t\t\tconst nextItem = nextItems(data, selectedItemsRef.current, multiple);\n\t\t\tonSelectedChangeRef.current?.(nextItem || null);\n\t\t\tif (!isControlled) setDefaultItems(sanitizeItems(nextItem));\n\t\t};\n\t\tcombobox?.addEventListener(\"comboboxbeforeselect\", beforeChange);\n\t\treturn () => combobox?.removeEventListener(\"comboboxbeforeselect\", beforeChange);\n\t}, [isControlled]);\n\tuseEffect(() => {\n\t\tconst combobox = dsSuggestionRef.current;\n\t\tconst beforeMatch = (e) => onBeforeMatch?.(e);\n\t\tcombobox?.addEventListener(\"comboboxbeforematch\", beforeMatch);\n\t\treturn () => combobox?.removeEventListener(\"comboboxbeforematch\", beforeMatch);\n\t}, [onBeforeMatch]);\n\tconst handleFilter = useCallback(() => {\n\t\tconst { control: input, options = [] } = dsSuggestionRef?.current || {};\n\t\tconst filterFn = filter === true ? defaultFilter : filter;\n\t\tlet disabled = 0;\n\t\tlet index = 0;\n\t\tfor (const option of Array.from(options)) if (!option.hasAttribute(\"data-empty\")) {\n\t\t\tif (filterFn && input) option.disabled = !filterFn({\n\t\t\t\tindex,\n\t\t\t\tinput,\n\t\t\t\tlabel: option.label,\n\t\t\t\toptionElement: option,\n\t\t\t\ttext: option.text,\n\t\t\t\tvalue: option.value\n\t\t\t}) && Boolean(++disabled);\n\t\t\tindex++;\n\t\t}\n\t}, [filter]);\n\treturn /* @__PURE__ */ jsx(SuggestionContext.Provider, {\n\t\tvalue: {\n\t\t\thandleFilter,\n\t\t\tdsSuggestionRef\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsxs(\"ds-suggestion\", {\n\t\t\t\"data-multiple\": multiple || void 0,\n\t\t\t\"data-creatable\": creatable || void 0,\n\t\t\tclass: cl(\"ds-suggestion\", className),\n\t\t\tref: mergedRefs,\n\t\t\tsuppressHydrationWarning: true,\n\t\t\t...rest,\n\t\t\tchildren: [\n\t\t\t\tselectedItems.map((item) => /* @__PURE__ */ jsx(\"data\", {\n\t\t\t\t\tvalue: item.value,\n\t\t\t\t\tsuppressHydrationWarning: true,\n\t\t\t\t\tchildren: renderSelected(item)\n\t\t\t\t}, item.value)),\n\t\t\t\tchildren,\n\t\t\t\t!!name && /* @__PURE__ */ jsx(\"select\", {\n\t\t\t\t\tname,\n\t\t\t\t\tmultiple: true,\n\t\t\t\t\thidden: true,\n\t\t\t\t\tid: selectId\n\t\t\t\t})\n\t\t\t]\n\t\t})\n\t});\n});\nconst SuggestionContext = createContext({ handleFilter: () => void 0 });\n//#endregion\nexport { Suggestion, SuggestionContext };\n", "'use client';\nimport { Input } from \"../input/input.js\";\nimport { SuggestionContext } from \"./suggestion.js\";\nimport { forwardRef, useContext, useEffect } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion-input.tsx\n/**\n* Component that provides an input field for the Suggestion list.\n*\n* Place as a descendant of `Suggestion`\n*\n* @example\n* <Suggestion>\n* <Suggestion.Input />\n* <Suggestion.List />\n* </Suggestion>\n*/\nconst SuggestionInput = forwardRef(function SuggestionList({ value, onInput, onChange, ...rest }, ref) {\n\tconst { handleFilter } = useContext(SuggestionContext);\n\tuseEffect(handleFilter, [value]);\n\tif (onChange) console.warn(\"SuggestionInput: Avoid using onChange, as Suggestion controls the Input. Use onSelectedChange on Suggestion instead, or onInput if fetching API results\");\n\tif (value) console.warn(\"SuggestionInput: Avoid using value, as Suggestion controls the Input. Use selected on Suggestion instead.\");\n\treturn /* @__PURE__ */ jsx(Input, {\n\t\tplaceholder: \"\",\n\t\tref,\n\t\tonInput: (event) => {\n\t\t\tonInput?.(event);\n\t\t\thandleFilter?.();\n\t\t},\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SuggestionInput };\n", "'use client';\nimport { SuggestionContext } from \"./suggestion.js\";\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef, useContext, useEffect } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion-list.tsx\n/**\n* Component that provides a Suggestion list.\n*\n* Place as a descendant of `Suggestion`\n*\n* @example\n* <Suggestion>\n* <Suggestion.Input />\n* <Suggestion.List />\n* </Suggestion>\n*/\nconst SuggestionList = forwardRef(function SuggestionList({ singular = \"%d forslag\", plural = \"%d forslag\", className, id, autoPlacement = true, ...rest }, ref) {\n\tconst { handleFilter } = useContext(SuggestionContext);\n\tuseEffect(handleFilter);\n\treturn /* @__PURE__ */ jsx(\"u-datalist\", {\n\t\tclass: className,\n\t\t\"data-nofilter\": true,\n\t\t\"data-sr-plural\": plural,\n\t\t\"data-sr-singular\": singular,\n\t\tpopover: \"manual\",\n\t\tref,\n\t\trole: \"listbox\",\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SuggestionList };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion-option.tsx\n/**\n* A component for rendering individual options in the Suggestion list.\n*\n* @example\n* <Suggestion>\n* <Suggestion.Input />\n* <Suggestion.List>\n* <Suggestion.Option value='Option 1'>Option 1</Suggestion.Option>\n* <Suggestion.Option value='Option 2'>Option 2</Suggestion.Option>\n* </Suggestion.List>\n* </Suggestion>\n*/\nconst SuggestionOption = forwardRef(function SuggestionOption({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"u-option\", {\n\t\tclass: className,\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SuggestionOption };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/suggestion/suggestion-toggle.tsx\n/**\n* Component that provides a toggle button for the Suggestion list.\n*\n* Place as a descendant of `Suggestion`\n*\n* @example\n* <Suggestion>\n* <Suggestion.Input />\n* <Suggestion.Toggle />\n* <Suggestion.Clear />\n* <Suggestion.List />\n* </Suggestion>\n*/\nconst SuggestionToggle = forwardRef(function SuggestionToggle({ \"aria-label\": label = \"Valg\", ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"button\", {\n\t\t\"aria-expanded\": \"false\",\n\t\t\"aria-label\": label,\n\t\tref,\n\t\tsuppressHydrationWarning: true,\n\t\ttype: \"button\",\n\t\t...rest\n\t});\n});\n//#endregion\nexport { SuggestionToggle };\n", "'use client';\nimport { Suggestion } from \"./suggestion.js\";\nimport { SuggestionClear } from \"./suggestion-clear.js\";\nimport { SuggestionEmpty } from \"./suggestion-empty.js\";\nimport { SuggestionInput } from \"./suggestion-input.js\";\nimport { SuggestionList } from \"./suggestion-list.js\";\nimport { SuggestionOption } from \"./suggestion-option.js\";\nimport { SuggestionToggle } from \"./suggestion-toggle.js\";\n//#region src/components/suggestion/index.ts\n/**\n* A component that provides a suggestion list for an input field.\n*\n* @example\n* <Suggestion>\n* <Suggestion.Input />\n* <Suggestion.Toggle />\n* <Suggestion.Clear />\n* <Suggestion.List>\n* <Suggestion.Empty>Tomt</Suggestion.Empty>\n* <Suggestion.Option value='Option 1'>Option 1</Suggestion.Option>\n* <Suggestion.Option value='Option 2'>Option 2</Suggestion.Option>\n* </Suggestion.List>\n* </Suggestion>\n*/\nconst EXPERIMENTAL_Suggestion = Object.assign(Suggestion, {\n\tList: SuggestionList,\n\tInput: SuggestionInput,\n\tEmpty: SuggestionEmpty,\n\tOption: SuggestionOption,\n\tToggle: SuggestionToggle,\n\tClear: SuggestionClear\n});\nEXPERIMENTAL_Suggestion.displayName = \"EXPERIMENTAL_Suggestion\";\nEXPERIMENTAL_Suggestion.List.displayName = \"EXPERIMENTAL_Suggestion.List\";\nEXPERIMENTAL_Suggestion.Input.displayName = \"EXPERIMENTAL_Suggestion.Input\";\nEXPERIMENTAL_Suggestion.Empty.displayName = \"EXPERIMENTAL_Suggestion.Empty\";\nEXPERIMENTAL_Suggestion.Option.displayName = \"EXPERIMENTAL_Suggestion.Option\";\nEXPERIMENTAL_Suggestion.Toggle.displayName = \"EXPERIMENTAL_Suggestion.Toggle\";\nEXPERIMENTAL_Suggestion.Clear.displayName = \"EXPERIMENTAL_Suggestion.Clear\";\n//#endregion\nexport { EXPERIMENTAL_Suggestion, SuggestionClear as EXPERIMENTAL_SuggestionClear, SuggestionEmpty as EXPERIMENTAL_SuggestionEmpty, SuggestionInput as EXPERIMENTAL_SuggestionInput, SuggestionList as EXPERIMENTAL_SuggestionList, SuggestionOption as EXPERIMENTAL_SuggestionOption, SuggestionToggle as EXPERIMENTAL_SuggestionToggle };\n", "'use client';\nimport { Label } from \"../label/label.js\";\nimport { Input } from \"../input/input.js\";\nimport { Field as FieldComponent } from \"../field/index.js\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/switch/switch.tsx\n/**\n* Switch used to toggle options.\n*\n* @example\n* <Switch label=\"I agree\" value=\"agree\" />\n*/\nconst Switch = forwardRef(function Switch({ \"data-size\": size, children, className, description, label, position, style, variant, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsxs(FieldComponent, {\n\t\tclassName,\n\t\t\"data-position\": position,\n\t\t\"data-size\": size,\n\t\t\"data-variant\": variant,\n\t\tstyle,\n\t\tchildren: [\n\t\t\t/* @__PURE__ */ jsx(Input, {\n\t\t\t\ttype: \"checkbox\",\n\t\t\t\trole: \"switch\",\n\t\t\t\tref,\n\t\t\t\t...rest\n\t\t\t}),\n\t\t\t!!label && /* @__PURE__ */ jsx(Label, {\n\t\t\t\tweight: \"regular\",\n\t\t\t\tchildren: label\n\t\t\t}),\n\t\t\t!!description && /* @__PURE__ */ jsx(\"div\", {\n\t\t\t\t\"data-field\": \"description\",\n\t\t\t\tchildren: description\n\t\t\t})\n\t\t]\n\t});\n});\n//#endregion\nexport { Switch };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table-body.tsx\n/**\n* TableBody component, used to display the body of a table. Renders a native HTML tbody element.\n*\n* @example\n* <TableBody>\n* <TableRow>\n* <TableCell>John</TableCell>\n* <TableCell>25</TableCell>\n* </TableRow>\n* </TableBody>\n*/\nconst TableBody = forwardRef(function TableBody(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"tbody\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { TableBody };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table-cell.tsx\n/**\n* TableCell component, used to display the cells of a table. Renders a native HTML td element.\n*\n* @example\n* <TableCell>John</TableCell>\n*/\nconst TableCell = forwardRef(function TableCell(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"td\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { TableCell };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table-foot.tsx\n/**\n* TableFoot component, used to display the footer of a table. Renders a native HTML tfoot element.\n*\n* @example\n* <TableFoot>\n* <TableRow>\n* <TableCell>Total</TableCell>\n* <TableCell>2</TableCell>\n* </TableRow>\n* </TableFoot>\n*/\nconst TableFoot = forwardRef(function TableFoot(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"tfoot\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { TableFoot };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table-head.tsx\n/**\n* TableHead component, used to display the header of a table. Renders a native HTML thead element.\n*\n* @example\n* <TableHead>\n* <TableRow>\n* <TableHeaderCell>Name</TableHeaderCell>\n* <TableHeaderCell>Age</TableHeaderCell>\n* </TableRow>\n* </TableHead>\n*/\nconst TableHead = forwardRef(function TableHead(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"thead\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { TableHead };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table-header-cell.tsx\n/**\n* TableHeaderCell component, used to display the header cells of a table. Renders a native HTML th element.\n*\n* @example\n* <TableHeaderCell>Name</TableHeaderCell>\n*/\nconst TableHeaderCell = forwardRef(function TableHeaderCell({ sort, children, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"th\", {\n\t\t\"aria-sort\": sort,\n\t\tref,\n\t\t...rest,\n\t\tchildren: sort ? /* @__PURE__ */ jsx(\"button\", {\n\t\t\ttype: \"button\",\n\t\t\tchildren\n\t\t}) : children\n\t});\n});\n//#endregion\nexport { TableHeaderCell };\n", "'use client';\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table-row.tsx\n/**\n* TableRow component, used to display the rows of a table. Renders a native HTML tr element.\n*\n* @example\n* <TableRow>\n* <TableCell>John</TableCell>\n* <TableCell>25</TableCell>\n* </TableRow>\n*/\nconst TableRow = forwardRef(function TableRow(rest, ref) {\n\treturn /* @__PURE__ */ jsx(\"tr\", {\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { TableRow };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/table/table.tsx\n/**\n* Table component, used to display tabular data. Renders a native HTML table element.\n*\n* @example\n* <Table>\n* <Table.Head>\n* <Table.Row>\n* <Table.HeaderCell>Name</Table.HeaderCell>\n* <Table.HeaderCell>Age</Table.HeaderCell>\n* </Table.Row>\n* </Table.Head>\n* <Table.Body>\n* <Table.Row>\n* <Table.Cell>John</Table.Cell>\n* <Table.Cell>25</Table.Cell>\n* </Table.Row>\n* </Table.Body>\n* <Table.Foot>\n* <Table.Row>\n* <Table.Cell>Total</Table.Cell>\n* <Table.Cell>2</Table.Cell>\n* </Table.Row>\n* </Table.Foot>\n* </Table>\n*/\nconst Table = forwardRef(function Table({ zebra = false, stickyHeader = false, border = false, hover = false, className, children, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"table\", {\n\t\tclassName: cl(\"ds-table\", className),\n\t\t\"data-border\": border || void 0,\n\t\t\"data-hover\": hover || void 0,\n\t\t\"data-sticky-header\": stickyHeader || void 0,\n\t\t\"data-zebra\": zebra || void 0,\n\t\tref,\n\t\t...rest,\n\t\tchildren\n\t});\n});\n//#endregion\nexport { Table };\n", "'use client';\nimport { Table } from \"./table.js\";\nimport { TableBody } from \"./table-body.js\";\nimport { TableCell } from \"./table-cell.js\";\nimport { TableFoot } from \"./table-foot.js\";\nimport { TableHead } from \"./table-head.js\";\nimport { TableHeaderCell } from \"./table-header-cell.js\";\nimport { TableRow } from \"./table-row.js\";\n//#region src/components/table/index.ts\n/**\n* Table component, used to display tabular data. Renders a native HTML table element.\n*\n* @example\n* <Table>\n* <Table.Head>\n* <Table.Row>\n* <Table.HeaderCell>Name</Table.HeaderCell>\n* <Table.HeaderCell>Age</Table.HeaderCell>\n* </Table.Row>\n* </Table.Head>\n* <Table.Body>\n* <Table.Row>\n* <Table.Cell>John</Table.Cell>\n* <Table.Cell>25</Table.Cell>\n* </Table.Row>\n* </Table.Body>\n* <Table.Foot>\n* <Table.Row>\n* <Table.Cell>Total</Table.Cell>\n* <Table.Cell>2</Table.Cell>\n* </Table.Row>\n* </Table.Foot>\n* </Table>\n*/\nconst TableComponent = Object.assign(Table, {\n\tHead: TableHead,\n\tBody: TableBody,\n\tRow: TableRow,\n\tCell: TableCell,\n\tHeaderCell: TableHeaderCell,\n\tFoot: TableFoot\n});\nTableComponent.displayName = \"Table\";\nTableComponent.Head.displayName = \"Table.Head\";\nTableComponent.Body.displayName = \"Table.Body\";\nTableComponent.Row.displayName = \"Table.Row\";\nTableComponent.Cell.displayName = \"Table.Cell\";\nTableComponent.HeaderCell.displayName = \"Table.HeaderCell\";\nTableComponent.Foot.displayName = \"Table.Foot\";\n//#endregion\nexport { TableComponent as Table, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/tabs/tabs-list.tsx\n/**\n* The container for all `Tab` components.\n*\n* @example\n* <TabsList>\n* <TabsTab value='1'>Tab 1</TabsTab>\n* <TabsTab value='2'>Tab 2</TabsTab>\n* </TabsList>\n*/\nconst TabsList = forwardRef(function TabsList({ className, children, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"ds-tablist\", {\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\tclass: className,\n\t\t...rest,\n\t\tchildren\n\t});\n});\n//#endregion\nexport { TabsList };\n", "'use client';\nimport { useMergeRefs } from \"../../utilities/hooks/use-merge-refs/use-merge-refs.js\";\nimport \"../../utilities/hooks/index.js\";\nimport \"@digdir/designsystemet-web\";\nimport cl from \"clsx/lite\";\nimport { createContext, forwardRef, useId, useRef, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/tabs/tabs.tsx\nconst Context = createContext({});\n/**\n* Display a group of tabs that can be toggled between.\n*\n* @example\n* <Tabs onChange={(value) => console.log(value)}>\n* <Tabs.List>\n* <Tabs.Tab value='1'>Tab 1</Tabs.Tab>\n* <Tabs.Tab value='2'>Tab 2</Tabs.Tab>\n* <Tabs.Tab value='3'>Tab 3</Tabs.Tab>\n* </Tabs.List>\n* <Tabs.Panel value='1'>content 1</Tabs.Panel>\n* <Tabs.Panel value='2'>content 2</Tabs.Panel>\n* <Tabs.Panel value='3'>content 3</Tabs.Panel>\n* </Tabs>\n*/\nconst Tabs = forwardRef(function Tabs({ value, defaultValue, className, onChange, ...rest }, ref) {\n\tconst isControlled = value !== void 0;\n\tconst [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n\tconst tabsRef = useRef(null);\n\tconst valuePrefix = useId();\n\tconst mergedRefs = useMergeRefs([ref, tabsRef]);\n\tlet onValueChange = onChange;\n\tif (!isControlled) {\n\t\tonValueChange = (newValue) => {\n\t\t\tsetUncontrolledValue(newValue);\n\t\t\tonChange?.(newValue);\n\t\t};\n\t\tvalue = uncontrolledValue;\n\t}\n\treturn /* @__PURE__ */ jsx(Context.Provider, {\n\t\tvalue: {\n\t\t\tisControlled,\n\t\t\tcurrentValue: value,\n\t\t\tonChange: onValueChange,\n\t\t\tgetPrefixedValue: (value) => value && `${valuePrefix}-${value}`\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsx(\"ds-tabs\", {\n\t\t\tsuppressHydrationWarning: true,\n\t\t\tref: mergedRefs,\n\t\t\tclass: cl(\"ds-tabs\", className),\n\t\t\t...rest\n\t\t})\n\t});\n});\n//#endregion\nexport { Context, Tabs };\n", "'use client';\nimport { Context } from \"./tabs.js\";\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef, useContext } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/tabs/tabs-panel.tsx\n/**\n* A single content item in a Tabs component.\n*\n* @example\n* <TabsPanel value='1'>content 1</TabsPanel>\n*/\nconst TabsPanel = forwardRef(function TabsPanel({ children, value, id, className, ...rest }, ref) {\n\tconst { getPrefixedValue } = useContext(Context);\n\treturn /* @__PURE__ */ jsx(\"ds-tabpanel\", {\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\tid: id ?? getPrefixedValue?.(value),\n\t\tclass: className,\n\t\t...rest,\n\t\tchildren\n\t});\n});\n//#endregion\nexport { TabsPanel };\n", "'use client';\nimport { Context } from \"./tabs.js\";\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef, useContext } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/tabs/tabs-tab.tsx\n/**\n* A single item in a Tabs component.\n*\n* @example\n* <TabsTab value='1'>Tab 1</TabsTab>\n*/\nconst TabsTab = forwardRef(function TabsTab({ value, className, onClick, onClickCapture, ...rest }, ref) {\n\tconst { onChange, getPrefixedValue, isControlled, currentValue } = useContext(Context);\n\treturn /* @__PURE__ */ jsx(\"ds-tab\", {\n\t\t\"aria-controls\": rest[\"aria-controls\"] ?? getPrefixedValue?.(value),\n\t\t\"aria-selected\": `${currentValue === value}`,\n\t\t\"data-value\": value,\n\t\tref,\n\t\trole: \"tab\",\n\t\tsuppressHydrationWarning: true,\n\t\tonClickCapture: (e) => {\n\t\t\tonClickCapture?.(e);\n\t\t\tif (isControlled && currentValue !== value) e.preventDefault();\n\t\t},\n\t\tonClick: (e) => {\n\t\t\tif (currentValue !== value) onChange?.(value);\n\t\t\tonClick?.(e);\n\t\t},\n\t\tclass: className,\n\t\t...rest,\n\t\tchildren: rest.children\n\t});\n});\n//#endregion\nexport { TabsTab };\n", "'use client';\nimport { Tabs } from \"./tabs.js\";\nimport { TabsList } from \"./tabs-list.js\";\nimport { TabsPanel } from \"./tabs-panel.js\";\nimport { TabsTab } from \"./tabs-tab.js\";\n//#region src/components/tabs/index.ts\n/**\n* Display a group of tabs that can be toggled between.\n*\n* @example\n* <Tabs onChange={(value) => console.log(value)}>\n* <Tabs.List>\n* <Tabs.Tab value='1'>Tab 1</Tabs.Tab>\n* <Tabs.Tab value='2'>Tab 2</Tabs.Tab>\n* <Tabs.Tab value='3'>Tab 3</Tabs.Tab>\n* </Tabs.List>\n* <Tabs.Panel value='1'>content 1</Tabs.Panel>\n* <Tabs.Panel value='2'>content 2</Tabs.Panel>\n* <Tabs.Panel value='3'>content 3</Tabs.Panel>\n* </Tabs>\n*/\nconst TabsComponent = Object.assign(Tabs, {\n\tList: TabsList,\n\tTab: TabsTab,\n\tPanel: TabsPanel\n});\nTabsComponent.Tab.displayName = \"Tabs.Tab\";\nTabsComponent.List.displayName = \"Tabs.List\";\nTabsComponent.Panel.displayName = \"Tabs.Panel\";\n//#endregion\nexport { TabsComponent as Tabs, TabsList, TabsPanel, TabsTab };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/tag/tag.tsx\n/**\n* Use `Tag` to display categories or statuses.\n*\n* @example\n* <Tag>Melk</Tag>\n*/\nconst Tag = forwardRef(function Tag({ className, variant, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"span\", {\n\t\tclassName: cl(\"ds-tag\", className),\n\t\tref,\n\t\t\"data-variant\": variant,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Tag };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/textarea/textarea.tsx\n/**\n* Native HTML textarea element.\n*\n* @example\n* <Textarea />\n*/\nconst Textarea = forwardRef(function Textarea({ className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsx(\"textarea\", {\n\t\tclassName: cl(\"ds-input\", className),\n\t\tref,\n\t\t...rest\n\t});\n});\n//#endregion\nexport { Textarea };\n", "'use client';\nimport { Label } from \"../label/label.js\";\nimport { ValidationMessage } from \"../validation-message/validation-message.js\";\nimport { Input } from \"../input/input.js\";\nimport { FieldAffix, FieldAffixes } from \"../field/field-affix.js\";\nimport { FieldDescription } from \"../field/field-description.js\";\nimport { Field as FieldComponent } from \"../field/index.js\";\nimport { Textarea } from \"../textarea/textarea.js\";\nimport { forwardRef } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/textfield/textfield.tsx\n/**\n* Composed text input component using `Field`\n*\n* `classname` & `style` are passed to the wrapper elements.\n*\n* Rest props are passed to the `Input` or `Textarea` component.\n* @example\n* <Textfield label=\"Textfield label\">\n*/\nconst Textfield = forwardRef(function Textfield({ label, description, error, multiline, prefix, suffix, \"data-color\": color, \"data-size\": size, counter, style, className, ...rest }, ref) {\n\treturn /* @__PURE__ */ jsxs(FieldComponent, {\n\t\tclassName,\n\t\t\"data-color\": color,\n\t\t\"data-size\": size,\n\t\tstyle,\n\t\tchildren: [\n\t\t\t!!label && /* @__PURE__ */ jsx(Label, { children: label }),\n\t\t\t!!description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),\n\t\t\t/* @__PURE__ */ jsxs(FieldAffixes, { children: [\n\t\t\t\tprefix === void 0 || /* @__PURE__ */ jsx(FieldAffix, { children: prefix }),\n\t\t\t\tmultiline === true ? /* @__PURE__ */ jsx(Textarea, {\n\t\t\t\t\tref,\n\t\t\t\t\t\"aria-invalid\": Boolean(error) || void 0,\n\t\t\t\t\t...rest\n\t\t\t\t}) : /* @__PURE__ */ jsx(Input, {\n\t\t\t\t\tref,\n\t\t\t\t\t\"aria-invalid\": Boolean(error) || void 0,\n\t\t\t\t\t...rest\n\t\t\t\t}),\n\t\t\t\tsuffix === void 0 || /* @__PURE__ */ jsx(FieldAffix, { children: suffix })\n\t\t\t] }),\n\t\t\t!!counter && /* @__PURE__ */ jsx(FieldComponent.Counter, { ...typeof counter === \"number\" ? { limit: counter } : counter }),\n\t\t\t!!error && /* @__PURE__ */ jsx(ValidationMessage, { children: error })\n\t\t]\n\t});\n});\n//#endregion\nexport { Textfield };\n", "'use client';\nimport cl from \"clsx/lite\";\nimport { createContext, forwardRef, useId, useState } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n//#region src/components/toggle-group/toggle-group.tsx\nconst ToggleGroupContext = createContext({});\n/**\n* Display a group of buttons that can be toggled between.\n*\n* @example\n* <ToggleGroup aria-label=\"Label\" onChange={(value) => console.log(value)}>\n* <ToggleGroup.Item value='1'>Toggle 1</ToggleGroup.Item>\n* <ToggleGroup.Item value='2'>Toggle 2</ToggleGroup.Item>\n* <ToggleGroup.Item value='3'>Toggle 3</ToggleGroup.Item>\n* </ToggleGroup>\n*/\nconst ToggleGroup = forwardRef(function ToggleGroup({ \"data-toggle-group\": label, children, className, defaultValue, name, onChange, value, variant, ...rest }, ref) {\n\tconst nameId = useId();\n\tconst isControlled = value !== void 0;\n\tconst [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);\n\tlet onValueChange = onChange;\n\tif (!isControlled) {\n\t\tonValueChange = (newValue) => {\n\t\t\tsetUncontrolledValue(newValue);\n\t\t\tonChange?.(newValue);\n\t\t};\n\t\tvalue = uncontrolledValue;\n\t}\n\treturn /* @__PURE__ */ jsx(ToggleGroupContext.Provider, {\n\t\tvalue: {\n\t\t\tdefaultValue,\n\t\t\tname: name ?? `togglegroup-name-${nameId}`,\n\t\t\tonChange: onValueChange,\n\t\t\tvalue,\n\t\t\tvariant\n\t\t},\n\t\tchildren: /* @__PURE__ */ jsx(\"fieldset\", {\n\t\t\t\"aria-label\": label,\n\t\t\tclassName: cl(\"ds-toggle-group\", className),\n\t\t\t\"data-variant\": variant,\n\t\t\tfocusgroup: \"radiogroup\",\n\t\t\tref,\n\t\t\tsuppressHydrationWarning: true,\n\t\t\t...rest,\n\t\t\tchildren\n\t\t})\n\t});\n});\n//#endregion\nexport { ToggleGroup, ToggleGroupContext };\n", "'use client';\nimport { ToggleGroupContext } from \"./toggle-group.js\";\nimport cl from \"clsx/lite\";\nimport { forwardRef, useContext, useId } from \"react\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\n//#region src/components/toggle-group/toggle-group-item.tsx\n/**\n* A single item in a ToggleGroup.\n* @example\n* <ToggleGroupItem value='1'>Toggle 1</ToggleGroupItem>\n*/\nconst ToggleGroupItem = forwardRef(function ToggleGroupItem({ className, children, icon, value: rawValue, ...rest }, ref) {\n\tconst genValue = useId();\n\tconst toggleGroup = useContext(ToggleGroupContext);\n\tconst value = rawValue ?? genValue;\n\tconst active = toggleGroup.value === value;\n\tconst { \"aria-disabled\": ariaDisabled, disabled, readOnly, form, formAction, formEncType, formMethod, formNoValidate, formTarget, required, ...labelProps } = rest;\n\treturn /* @__PURE__ */ jsxs(\"label\", {\n\t\tref,\n\t\t...labelProps,\n\t\tclassName: cl(\"ds-button\", className),\n\t\t\"data-variant\": \"tertiary\",\n\t\t\"aria-disabled\": ariaDisabled ?? disabled,\n\t\tchildren: [/* @__PURE__ */ jsx(\"input\", {\n\t\t\t\"aria-disabled\": ariaDisabled,\n\t\t\tchecked: active,\n\t\t\tdisabled,\n\t\t\treadOnly,\n\t\t\tform,\n\t\t\tformAction,\n\t\t\tformEncType,\n\t\t\tformMethod,\n\t\t\tformNoValidate,\n\t\t\tformTarget,\n\t\t\tname: toggleGroup.name,\n\t\t\tonChange: () => toggleGroup.onChange?.(value),\n\t\t\trequired,\n\t\t\ttype: \"radio\",\n\t\t\tvalue\n\t\t}), children]\n\t});\n});\n//#endregion\nexport { ToggleGroupItem };\n", "'use client';\nimport { ToggleGroup } from \"./toggle-group.js\";\nimport { ToggleGroupItem } from \"./toggle-group-item.js\";\n//#region src/components/toggle-group/index.ts\n/**\n* Display a group of buttons that can be toggled between.\n*\n* @example\n* <ToggleGroup aria-label=\"Label\" onChange={(value) => console.log(value)}>\n* <ToggleGroup.Item value='1'>Toggle 1</ToggleGroup.Item>\n* <ToggleGroup.Item value='2'>Toggle 2</ToggleGroup.Item>\n* <ToggleGroup.Item value='3'>Toggle 3</ToggleGroup.Item>\n* </ToggleGroup>\n*/\nconst ToggleGroupComponent = Object.assign(ToggleGroup, { Item: ToggleGroupItem });\nToggleGroupComponent.Item.displayName = \"ToggleGroup.Item\";\n//#endregion\nexport { ToggleGroupComponent as ToggleGroup, ToggleGroupItem };\n", "'use client';\nimport \"@digdir/designsystemet-web\";\nimport { forwardRef } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nimport { Slot } from \"@radix-ui/react-slot\";\n//#region src/components/tooltip/tooltip.tsx\n/**\n* Tooltip component that displays a small piece of information when hovering or focusing on an element.\n*\n* @example\n* <Tooltip content='This is a tooltip'>\n* <button>Hover me</button>\n* </Tooltip>\n*\n* @example\n* <Tooltip content='This is a tooltip'>\n* Hover me\n* </Tooltip>\n*/\nconst Tooltip = forwardRef(function Tooltip({ content, placement = \"top\", autoPlacement = true, ...rest }, ref) {\n\tconst isString = typeof rest.children === \"string\";\n\treturn /* @__PURE__ */ jsx(Slot, {\n\t\t\"data-tooltip\": content,\n\t\t\"data-placement\": placement,\n\t\t\"data-autoplacement\": autoPlacement,\n\t\tsuppressHydrationWarning: true,\n\t\tref,\n\t\t...rest,\n\t\tchildren: isString ? /* @__PURE__ */ jsx(\"span\", {\n\t\t\ttabIndex: 0,\n\t\t\tchildren: rest.children\n\t\t}) : rest.children\n\t});\n});\n//#endregion\nexport { Tooltip };\n", "'use client';\nimport { Alert } from \"./alert/alert.js\";\nimport { Avatar } from \"./avatar/avatar.js\";\nimport { EXPERIMENTAL_AvatarStack } from \"./avatar-stack/avatar-stack.js\";\nimport { BadgePosition } from \"./badge/badge-position.js\";\nimport { Badge } from \"./badge/index.js\";\nimport { BreadcrumbsItem } from \"./breadcrumbs/breadcrumbs-item.js\";\nimport { Link } from \"./link/link.js\";\nimport { BreadcrumbsLink } from \"./breadcrumbs/breadcrumbs-link.js\";\nimport { BreadcrumbsList } from \"./breadcrumbs/breadcrumbs-list.js\";\nimport { Breadcrumbs as BreadcrumbsComponent } from \"./breadcrumbs/index.js\";\nimport { Spinner } from \"./spinner/spinner.js\";\nimport { Button } from \"./button/button.js\";\nimport { Label } from \"./label/label.js\";\nimport { ValidationMessage } from \"./validation-message/validation-message.js\";\nimport { Paragraph } from \"./paragraph/paragraph.js\";\nimport { Input } from \"./input/input.js\";\nimport { ChipButton, ChipCheckbox, ChipRadio, ChipRemovable } from \"./chip/chips.js\";\nimport { Chip as ChipComponent } from \"./chip/index.js\";\nimport { ComboboxOption } from \"./Combobox/Option/Option.js\";\nimport { ComboboxEmpty } from \"./Combobox/Empty.js\";\nimport { Combobox } from \"./Combobox/index.js\";\nimport { CardBlock } from \"./card/card-block.js\";\nimport { Card as CardComponent } from \"./card/index.js\";\nimport { FieldAffix, FieldAffixes } from \"./field/field-affix.js\";\nimport { FieldCounter } from \"./field/field-counter.js\";\nimport { FieldDescription } from \"./field/field-description.js\";\nimport { Field as FieldComponent } from \"./field/index.js\";\nimport { Checkbox } from \"./checkbox/checkbox.js\";\nimport { DetailsContent } from \"./details/details-content.js\";\nimport { DetailsSummary } from \"./details/details-summary.js\";\nimport { Details as DetailsComponent } from \"./details/index.js\";\nimport { DialogTriggerContext } from \"./dialog/dialog-trigger-context.js\";\nimport { DialogBlock } from \"./dialog/dialog-block.js\";\nimport { DialogTrigger } from \"./dialog/dialog-trigger.js\";\nimport { Dialog as DialogComponent } from \"./dialog/index.js\";\nimport { Divider } from \"./divider/divider.js\";\nimport { PopoverTriggerContext } from \"./popover/popover-trigger-context.js\";\nimport { DropdownButton } from \"./dropdown/dropdown-button.js\";\nimport { Heading } from \"./heading/heading.js\";\nimport { DropdownHeading } from \"./dropdown/dropdown-heading.js\";\nimport { DropdownItem } from \"./dropdown/dropdown-item.js\";\nimport { DropdownList } from \"./dropdown/dropdown-list.js\";\nimport { PopoverTrigger } from \"./popover/popover-trigger.js\";\nimport { DropdownTrigger } from \"./dropdown/dropdown-trigger.js\";\nimport { DropdownTriggerContext } from \"./dropdown/dropdown-trigger-context.js\";\nimport { Dropdown as DropdownComponent } from \"./dropdown/index.js\";\nimport { ErrorSummaryHeading } from \"./error-summary/error-summary-heading.js\";\nimport { ListItem } from \"./list/list-item.js\";\nimport { ListOrdered, ListUnordered } from \"./list/lists.js\";\nimport { List as ListComponent } from \"./list/index.js\";\nimport { ErrorSummaryItem } from \"./error-summary/error-summary-item.js\";\nimport { ErrorSummaryLink } from \"./error-summary/error-summary-link.js\";\nimport { ErrorSummaryList } from \"./error-summary/error-summary-list.js\";\nimport { ErrorSummary as ErrorSummaryComponent } from \"./error-summary/index.js\";\nimport { FieldsetDescription } from \"./fieldset/fieldset-description.js\";\nimport { FieldsetLegend } from \"./fieldset/fieldset-legend.js\";\nimport { Fieldset as FieldsetComponent } from \"./fieldset/index.js\";\nimport { EXPERIMENTAL_FileUpload } from \"./file-upload/index.js\";\nimport { PaginationButton } from \"./pagination/pagination-button.js\";\nimport { PaginationItem } from \"./pagination/pagination-item.js\";\nimport { PaginationList } from \"./pagination/pagination-list.js\";\nimport { Pagination as PaginationComponent } from \"./pagination/index.js\";\nimport { Popover as PopoverComponent } from \"./popover/index.js\";\nimport { Radio } from \"./radio/radio.js\";\nimport { SearchButton } from \"./search/search-button.js\";\nimport { SearchClear } from \"./search/search-clear.js\";\nimport { SearchInput } from \"./search/search-input.js\";\nimport { Search as SearchComponent } from \"./search/index.js\";\nimport { SelectOptgroup } from \"./select/select-optgroup.js\";\nimport { SelectOption } from \"./select/select-option.js\";\nimport { Select as SelectComponent } from \"./select/index.js\";\nimport { Skeleton } from \"./skeleton/skeleton.js\";\nimport { SkipLink } from \"./skip-link/skip-link.js\";\nimport { SuggestionClear } from \"./suggestion/suggestion-clear.js\";\nimport { SuggestionEmpty } from \"./suggestion/suggestion-empty.js\";\nimport { SuggestionInput } from \"./suggestion/suggestion-input.js\";\nimport { SuggestionList } from \"./suggestion/suggestion-list.js\";\nimport { SuggestionOption } from \"./suggestion/suggestion-option.js\";\nimport { SuggestionToggle } from \"./suggestion/suggestion-toggle.js\";\nimport { EXPERIMENTAL_Suggestion } from \"./suggestion/index.js\";\nimport { Switch } from \"./switch/switch.js\";\nimport { TableBody } from \"./table/table-body.js\";\nimport { TableCell } from \"./table/table-cell.js\";\nimport { TableFoot } from \"./table/table-foot.js\";\nimport { TableHead } from \"./table/table-head.js\";\nimport { TableHeaderCell } from \"./table/table-header-cell.js\";\nimport { TableRow } from \"./table/table-row.js\";\nimport { Table as TableComponent } from \"./table/index.js\";\nimport { TabsList } from \"./tabs/tabs-list.js\";\nimport { TabsPanel } from \"./tabs/tabs-panel.js\";\nimport { TabsTab } from \"./tabs/tabs-tab.js\";\nimport { Tabs as TabsComponent } from \"./tabs/index.js\";\nimport { Tag } from \"./tag/tag.js\";\nimport { Textarea } from \"./textarea/textarea.js\";\nimport { Textfield } from \"./textfield/textfield.js\";\nimport { ToggleGroupItem } from \"./toggle-group/toggle-group-item.js\";\nimport { ToggleGroup as ToggleGroupComponent } from \"./toggle-group/index.js\";\nimport { Tooltip } from \"./tooltip/tooltip.js\";\nimport \"@digdir/designsystemet-web\";\nexport { Alert, Avatar, Badge, BadgePosition, BreadcrumbsComponent as Breadcrumbs, BreadcrumbsItem, BreadcrumbsLink, BreadcrumbsList, Button, CardComponent as Card, CardBlock, Checkbox, ChipComponent as Chip, ChipButton, ChipCheckbox, ChipRadio, ChipRemovable, Combobox, ComboboxEmpty, ComboboxOption, DetailsComponent as Details, DetailsContent, DetailsSummary, DialogComponent as Dialog, DialogBlock, DialogTrigger, DialogTriggerContext, Divider, DropdownComponent as Dropdown, DropdownButton, DropdownHeading, DropdownItem, DropdownList, DropdownTrigger, DropdownTriggerContext, EXPERIMENTAL_AvatarStack, EXPERIMENTAL_FileUpload, EXPERIMENTAL_Suggestion, SuggestionClear as EXPERIMENTAL_SuggestionClear, SuggestionEmpty as EXPERIMENTAL_SuggestionEmpty, SuggestionInput as EXPERIMENTAL_SuggestionInput, SuggestionList as EXPERIMENTAL_SuggestionList, SuggestionOption as EXPERIMENTAL_SuggestionOption, SuggestionToggle as EXPERIMENTAL_SuggestionToggle, ErrorSummaryComponent as ErrorSummary, ErrorSummaryHeading, ErrorSummaryItem, ErrorSummaryLink, ErrorSummaryList, FieldComponent as Field, FieldAffix, FieldAffixes, FieldCounter, FieldDescription, FieldsetComponent as Fieldset, FieldsetDescription, FieldsetLegend, Heading, Input, Label, Link, ListComponent as List, ListItem, ListOrdered, ListUnordered, PaginationComponent as Pagination, PaginationButton, PaginationItem, PaginationList, Paragraph, PopoverComponent as Popover, PopoverTrigger, PopoverTriggerContext, Radio, SearchComponent as Search, SearchButton, SearchClear, SearchInput, SelectComponent as Select, SelectOptgroup, SelectOption, Skeleton, SkipLink, Spinner, Switch, TableComponent as Table, TableBody, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, TabsComponent as Tabs, TabsList, TabsPanel, TabsTab, Tag, Textarea, Textfield, ToggleGroupComponent as ToggleGroup, ToggleGroupItem, Tooltip, ValidationMessage };\n", "import { Alert as DsAlert, type AlertProps as DsAlertProps } from \"@digdir/designsystemet-react\"\n\nimport type { SeverityColors } from \"../../theme-colors\"\n\nexport interface AlertProps extends DsAlertProps {\n color?: SeverityColors\n title?: string\n description?: string\n}\n\nexport function Alert({ className, color, title, description, children, ...props }: AlertProps) {\n return (\n <DsAlert className={className} data-color={color} {...props}>\n {title !== undefined && (\n <h2 className=\"dio-text-heading-3\" style={{ marginBottom: \"var(--ds-size-2)\" }}>\n {title}\n </h2>\n )}\n {description && <p className=\"dio-text-body\">{description}</p>}\n {children}\n </DsAlert>\n )\n}\n", "import {\n Breadcrumbs as DsBreadcrumbs,\n type BreadcrumbsProps as DsBreadcrumbsProps,\n} from \"@digdir/designsystemet-react\"\n\nexport interface BreadcrumbItem {\n href?: string\n label: string\n isCurrent?: boolean\n}\n\nexport interface BreadcrumbsProps extends DsBreadcrumbsProps {\n items?: BreadcrumbItem[]\n}\n\nexport function Breadcrumbs({\n items,\n className,\n children,\n \"aria-label\": ariaLabel = \"Du er her\",\n ...props\n}: BreadcrumbsProps) {\n if (children) {\n return (\n <DsBreadcrumbs className={className} aria-label={ariaLabel} {...props}>\n {children}\n </DsBreadcrumbs>\n )\n }\n\n return (\n <DsBreadcrumbs className={className} aria-label={ariaLabel} {...props}>\n <DsBreadcrumbs.List>\n {items?.map((item) => (\n <DsBreadcrumbs.Item key={item.label}>\n {item.isCurrent || !item.href ? (\n <span {...(item.isCurrent ? { \"aria-current\": \"page\" as const } : {})}>\n {item.label}\n </span>\n ) : (\n <DsBreadcrumbs.Link href={item.href}>{item.label}</DsBreadcrumbs.Link>\n )}\n </DsBreadcrumbs.Item>\n ))}\n </DsBreadcrumbs.List>\n </DsBreadcrumbs>\n )\n}\n\nBreadcrumbs.Item = DsBreadcrumbs.Item\nBreadcrumbs.Link = DsBreadcrumbs.Link\nBreadcrumbs.List = DsBreadcrumbs.List\n", "import classNames from \"classnames\"\nimport type { CSSProperties } from \"react\"\n\nexport interface SvgIconProps {\n name: string\n width?: number\n height?: number\n className?: string\n label?: string\n style?: CSSProperties\n}\n\nexport function SvgIcon({ name, width = 24, height = 24, className, label, style }: SvgIconProps) {\n const href = name.startsWith(\"#\") ? name : `#${name}`\n\n return (\n <svg\n width={width}\n height={height}\n className={classNames(\"dio-svg-icon\", className)}\n style={style}\n {...(label ? { \"aria-label\": label, role: \"img\" } : { \"aria-hidden\": true })}\n >\n <use href={href} />\n </svg>\n )\n}\n", "import { Button as DsButton, type ButtonProps as DsButtonProps } from \"@digdir/designsystemet-react\"\n\nimport type { ThemeColor } from \"../../theme-colors\"\nimport { SvgIcon } from \"../SvgIcon/SvgIcon\"\n\nexport interface ButtonProps extends Omit<\n DsButtonProps,\n \"data-color\" | \"loading\" | \"disabled\" | \"aria-label\"\n> {\n color?: ThemeColor\n iconLeft?: string\n iconRight?: string\n ariaLabel?: string\n isLoading?: DsButtonProps[\"loading\"]\n isDisabled?: boolean\n size?: \"sm\" | \"md\" | \"lg\"\n}\n\nexport function Button({\n className,\n color,\n iconLeft,\n iconRight,\n children,\n ariaLabel,\n isLoading,\n isDisabled,\n size,\n ...props\n}: ButtonProps) {\n return (\n <DsButton\n className={className}\n data-color={color}\n loading={isLoading}\n disabled={isDisabled}\n aria-label={ariaLabel}\n data-size={size}\n {...props}\n >\n {iconLeft && !isLoading && <SvgIcon name={iconLeft} />}\n {children}\n {iconRight && !isLoading && <SvgIcon name={iconRight} />}\n </DsButton>\n )\n}\n", "import { Button as DsButton, type ButtonProps as DsButtonProps } from \"@digdir/designsystemet-react\"\nimport type { MouseEventHandler } from \"react\"\n\nimport { SvgIcon } from \"../SvgIcon/SvgIcon\"\n\nexport type ButtonCloseProps = Omit<DsButtonProps, \"icon\" | \"children\" | \"aria-label\"> & {\n onClick?: MouseEventHandler<HTMLButtonElement>\n ariaLabel?: string\n commandFor?: string\n}\n\nexport function ButtonClose({\n className,\n onClick,\n ariaLabel,\n title,\n id,\n commandFor,\n variant = \"tertiary\",\n ...props\n}: ButtonCloseProps) {\n return (\n <DsButton\n className={className}\n icon\n variant={variant}\n id={id}\n title={title}\n aria-label={ariaLabel}\n onClick={onClick}\n data-testid=\"button-close\"\n commandFor={commandFor}\n command=\"close\"\n {...props}\n >\n <SvgIcon name=\"dio-x-mark\" />\n </DsButton>\n )\n}\n", "import { Link as DsLink, type LinkProps as DsLinkProps } from \"@digdir/designsystemet-react\"\nimport type { ButtonHTMLAttributes, ReactNode } from \"react\"\n\nimport { SvgIcon } from \"../SvgIcon/SvgIcon\"\n\nexport type ButtonLinkProps = Omit<\n DsLinkProps,\n \"href\" | \"children\" | \"onClick\" | \"aria-label\" | \"asChild\"\n> & {\n children?: ReactNode\n iconLeft?: string\n iconRight?: string\n onClick?: ButtonHTMLAttributes<HTMLButtonElement>[\"onClick\"]\n isDisabled?: boolean\n}\n\nexport function ButtonLink({\n className,\n children,\n iconLeft,\n iconRight,\n onClick,\n isDisabled,\n ...props\n}: ButtonLinkProps) {\n return (\n <DsLink className={className} asChild {...props}>\n <button type=\"button\" onClick={onClick} disabled={isDisabled}>\n {iconLeft && <SvgIcon name={iconLeft} />}\n <span>{children}</span>\n {iconRight && <SvgIcon name={iconRight} />}\n </button>\n </DsLink>\n )\n}\n", "import { Card as DsCard, Link, type CardProps as DsCardProps } from \"@digdir/designsystemet-react\"\nimport type { ReactNode } from \"react\"\n\nimport type { Color } from \"../../theme-colors\"\n\nexport type CardVariant = \"default\" | \"tinted\"\n\nexport type CardProps = Omit<DsCardProps, \"children\"> & {\n title?: string\n href?: string\n description?: string\n children?: ReactNode\n color?: Color\n variant?: CardVariant\n headingLevel?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\"\n hasBlocks?: boolean\n}\n\nexport function Card({\n title,\n href,\n description,\n color,\n variant,\n children,\n className,\n headingLevel = \"h3\",\n hasBlocks = false,\n ...props\n}: CardProps) {\n const Heading = headingLevel\n\n const wrapBlock = (blockChildren: ReactNode) =>\n hasBlocks ? <DsCard.Block>{blockChildren}</DsCard.Block> : blockChildren\n\n return (\n <DsCard className={className} data-color={color} variant={variant} {...props}>\n {title !== undefined &&\n wrapBlock(\n <Heading\n className=\"dio-text-heading-2\"\n style={!hasBlocks ? { marginBottom: \"var(--ds-size-2)\" } : undefined}\n >\n {href !== undefined ? <Link href={href}>{title}</Link> : title}\n </Heading>,\n )}\n {description && wrapBlock(<p className=\"dio-text-body\">{description}</p>)}\n {children && wrapBlock(children)}\n </DsCard>\n )\n}\n\nCard.Block = DsCard.Block\n", "import {\n Label as DsLabel,\n type CheckboxProps as DsCheckboxProps,\n} from \"@digdir/designsystemet-react\"\nimport classNames from \"classnames\"\nimport { useId, type ChangeEventHandler, type ReactNode } from \"react\"\n\nimport { DEFAULT_REQUIRED_MESSAGE, Label } from \"../Label/Label\"\nimport { ValidationMessage } from \"../ValidationMessage/ValidationMessage\"\n\nexport type CheckboxProps = Omit<\n DsCheckboxProps,\n \"label\" | \"disabled\" | \"checked\" | \"required\" | \"defaultChecked\" | \"error\" | \"onChange\"\n> & {\n label?: ReactNode\n description?: ReactNode\n controlClassName?: string\n isValid?: boolean\n errorMessage?: string\n isValidationVisible?: boolean\n isDisabled?: boolean\n isChecked?: boolean\n isRequired?: boolean\n isDefaultChecked?: boolean\n requiredMessage?: string\n onChange?: ChangeEventHandler<HTMLInputElement>\n}\n\nexport function Checkbox({\n className,\n controlClassName,\n label,\n description,\n isValid,\n errorMessage,\n isValidationVisible,\n isDisabled,\n isChecked,\n isRequired,\n isDefaultChecked,\n requiredMessage = DEFAULT_REQUIRED_MESSAGE,\n onChange,\n ...props\n}: CheckboxProps) {\n const id = props.id ?? useId()\n const isInvalid = !!(!isValid && isValidationVisible && errorMessage)\n\n return (\n <div className={classNames(className, \"ds-field\")}>\n <input\n className={classNames(\"ds-input\", controlClassName)}\n type=\"checkbox\"\n checked={isChecked}\n disabled={isDisabled}\n required={isRequired}\n defaultChecked={isDefaultChecked}\n onChange={onChange}\n id={id}\n {...props}\n />\n <DsLabel htmlFor={id}>\n <Label\n isRequired={isRequired}\n isInvalid={isInvalid}\n requiredMessage={requiredMessage}\n >\n {label}\n </Label>\n </DsLabel>\n {description && <div data-field=\"description\">{description}</div>}\n {isInvalid && <ValidationMessage>{errorMessage}</ValidationMessage>}\n </div>\n )\n}\n", "import classNames from \"classnames\"\nimport type { HTMLAttributes, ReactNode } from \"react\"\n\nimport { Tag } from \"../Tag/Tag\"\n\nexport const DEFAULT_REQUIRED_MESSAGE = \"M\u00E5 fylles ut\"\n\nexport interface LabelProps extends HTMLAttributes<HTMLSpanElement> {\n isRequired?: boolean\n isInvalid?: boolean\n requiredMessage?: string\n children: ReactNode\n}\n\nexport function Label({\n className,\n children,\n isRequired,\n isInvalid,\n requiredMessage = DEFAULT_REQUIRED_MESSAGE,\n ...props\n}: LabelProps) {\n return (\n <span className={classNames(\"dio-label\", className)} {...props}>\n {children}\n {isRequired && (\n <Tag color={isInvalid ? \"danger\" : \"warning\"}>{requiredMessage}</Tag>\n )}\n </span>\n )\n}\n", "import { Tag as DsTag, type TagProps as DsTagProps } from \"@digdir/designsystemet-react\"\n\nimport type { Color } from \"../../theme-colors\"\n\ninterface TagProps extends DsTagProps {\n color?: Color\n}\n\nexport function Tag({ className, color, children, ...props }: TagProps) {\n return (\n <DsTag className={className} data-color={color} {...props}>\n {children}\n </DsTag>\n )\n}\n", "import {\n ValidationMessage as DsValidationMessage,\n type ValidationMessageProps as DsValidationMessageProps,\n} from \"@digdir/designsystemet-react\"\n\nexport type ValidationMessageProps = DsValidationMessageProps\n\nexport function ValidationMessage({ className, children, ...props }: ValidationMessageProps) {\n return (\n <DsValidationMessage className={className} {...props}>\n {children}\n </DsValidationMessage>\n )\n}\n", "import classNames from \"classnames\"\nimport type { ReactNode } from \"react\"\n\nexport interface ControlGroupProps {\n children: ReactNode\n className?: string\n orientation?: \"horizontal\" | \"vertical\"\n}\n\nexport function ControlGroup({\n children,\n className,\n orientation = \"horizontal\",\n}: ControlGroupProps) {\n return (\n <div\n className={classNames(\n \"dio-control-group\",\n orientation === \"vertical\" && \"dio-control-group--vertical\",\n className,\n )}\n >\n {children}\n </div>\n )\n}\n", "import {\n Fieldset as DsFieldset,\n type FieldsetProps as DsFieldsetProps,\n} from \"@digdir/designsystemet-react\"\nimport type { CSSProperties, ReactNode } from \"react\"\n\nimport { ControlGroup } from \"../ControlGroup/ControlGroup\"\n\nexport interface CheckboxFieldsetProps extends DsFieldsetProps {\n legend: string\n description?: ReactNode\n children: ReactNode\n direction?: \"horizontal\" | \"vertical\"\n style?: CSSProperties\n}\n\nexport function CheckboxFieldset({\n legend,\n description,\n children,\n direction = \"vertical\",\n style,\n className,\n ...props\n}: CheckboxFieldsetProps) {\n return (\n <DsFieldset className={className} style={style} {...props}>\n <DsFieldset.Legend>{legend}</DsFieldset.Legend>\n {description && <DsFieldset.Description>{description}</DsFieldset.Description>}\n {direction === \"horizontal\" ? <ControlGroup>{children}</ControlGroup> : children}\n </DsFieldset>\n )\n}\n", "import {\n Details as DsDetails,\n type DetailsProps as DsDetailsProps,\n} from \"@digdir/designsystemet-react\"\nimport type { ReactNode } from \"react\"\n\nexport type DetailsProps = Omit<\n DsDetailsProps,\n \"children\" | \"open\" | \"onToggle\" | \"defaultOpen\"\n> & {\n children: ReactNode\n trigger: string\n triggerExtraLabel?: ReactNode\n contentClassName?: string\n isOpen?: boolean\n onToggle?: (event: Event) => void\n isDefaultOpen?: boolean\n}\n\nexport function Details({\n children,\n trigger,\n triggerExtraLabel,\n contentClassName,\n className,\n isOpen,\n onToggle,\n isDefaultOpen,\n ...props\n}: DetailsProps) {\n const detailsProps =\n isOpen !== undefined\n ? { open: isOpen, onToggle: onToggle ?? (() => undefined) }\n : { onToggle, defaultOpen: isDefaultOpen }\n\n return (\n <DsDetails className={className} data-testid=\"details\" {...detailsProps} {...props}>\n <DsDetails.Summary>\n {trigger}\n {triggerExtraLabel}\n </DsDetails.Summary>\n <DsDetails.Content className={contentClassName}>{children}</DsDetails.Content>\n </DsDetails>\n )\n}\n\nDetails.Summary = DsDetails.Summary\nDetails.Content = DsDetails.Content\n", "import { Dialog as DsDialog, type DialogProps as DsDialogProps } from \"@digdir/designsystemet-react\"\nimport { useEffect, useRef, type ReactNode } from \"react\"\n\nexport interface DialogProps extends Omit<DsDialogProps, \"closeButton\" | \"open\" | \"modal\"> {\n children?: ReactNode\n title?: string\n id: string\n isInitialOpen?: boolean\n isModal?: boolean\n closeButtonText?: string\n}\n\nexport function Dialog({\n children,\n className,\n placement = \"center\",\n isModal = true,\n title,\n id,\n isInitialOpen = false,\n closeButtonText,\n onClose,\n ...props\n}: DialogProps) {\n const ref = useRef<HTMLDialogElement>(null)\n\n useEffect(() => {\n if (isInitialOpen) {\n ref.current?.showModal()\n }\n }, [isInitialOpen])\n\n return (\n <DsDialog\n ref={ref}\n className={className}\n id={id}\n placement={placement}\n modal={isModal}\n closeButton={closeButtonText}\n onClose={onClose}\n {...props}\n >\n {title && (\n <h2 className=\"dio-text-heading-2\" style={{ marginBottom: \"var(--ds-size-2)\" }}>\n {title}\n </h2>\n )}\n {children}\n </DsDialog>\n )\n}\n\nDialog.Block = DsDialog.Block\nDialog.Trigger = DsDialog.Trigger\nDialog.TriggerContext = DsDialog.TriggerContext\n", "import {\n Dropdown as DsDropdown,\n type DropdownProps as DsDropdownProps,\n} from \"@digdir/designsystemet-react\"\n\nexport type DropdownProps = DsDropdownProps\n\nfunction DropdownRoot({ className, children, ...props }: DropdownProps) {\n return (\n <DsDropdown className={className} {...props}>\n {children}\n </DsDropdown>\n )\n}\n\nexport const Dropdown = Object.assign(DropdownRoot, {\n TriggerContext: DsDropdown.TriggerContext,\n Trigger: DsDropdown.Trigger,\n Heading: DsDropdown.Heading,\n List: DsDropdown.List,\n Item: DsDropdown.Item,\n Button: DsDropdown.Button,\n})\n", "import {\n ErrorSummary as DsErrorSummary,\n type ErrorSummaryProps as DsErrorSummaryProps,\n} from \"@digdir/designsystemet-react\"\n\nexport interface ErrorSummaryItem {\n label: string\n href: string\n}\n\nexport interface ErrorSummaryProps extends DsErrorSummaryProps {\n title?: string\n errors?: ErrorSummaryItem[]\n}\n\nexport function ErrorSummary({ title, errors, className, children, ...props }: ErrorSummaryProps) {\n if (children) {\n return (\n <DsErrorSummary className={className} {...props}>\n {children}\n </DsErrorSummary>\n )\n }\n\n return (\n <DsErrorSummary className={className} {...props}>\n {title && <DsErrorSummary.Heading>{title}</DsErrorSummary.Heading>}\n {errors && errors.length > 0 && (\n <DsErrorSummary.List>\n {errors.map((error) => (\n <DsErrorSummary.Item key={error.label}>\n <DsErrorSummary.Link href={error.href}>\n {error.label}\n </DsErrorSummary.Link>\n </DsErrorSummary.Item>\n ))}\n </DsErrorSummary.List>\n )}\n </DsErrorSummary>\n )\n}\n\nErrorSummary.Heading = DsErrorSummary.Heading\nErrorSummary.List = DsErrorSummary.List\nErrorSummary.Item = DsErrorSummary.Item\nErrorSummary.Link = DsErrorSummary.Link\n", "import { Alert as DsAlert } from \"@digdir/designsystemet-react\"\nimport classNames from \"classnames\"\nimport type { ReactNode } from \"react\"\n\nimport type { SeverityColors } from \"../../theme-colors\"\nimport { ButtonClose } from \"../Button/ButtonClose\"\n\nexport interface FeedbackBannerProps {\n color?: SeverityColors\n className?: string\n children?: ReactNode\n closeLabel?: string\n}\n\nexport function FeedbackBanner({\n color,\n className,\n children,\n closeLabel = \"Lukk\",\n}: FeedbackBannerProps) {\n return (\n <dio-feedback-banner className={classNames(\"dio-feedback-banner\", className)}>\n <DsAlert data-color={color}>\n {children}\n <ButtonClose\n className=\"dio-feedback-banner__close-button\"\n ariaLabel={closeLabel}\n data-hide-banner\n />\n </DsAlert>\n </dio-feedback-banner>\n )\n}\n", "import classNames from \"classnames\"\nimport type { ReactNode } from \"react\"\n\nexport interface FormProps {\n className?: string\n children: ReactNode\n}\n\nexport function Form({ className, children }: FormProps) {\n return <div className={classNames(\"dio-form dio-prose\", className)}>{children}</div>\n}\n", "import { Link as DsLink } from \"@digdir/designsystemet-react\"\nimport classNames from \"classnames\"\n\nimport { SvgIcon } from \"../SvgIcon/SvgIcon\"\n\nexport interface LinkListItem {\n href: string\n label: string\n target?: string\n rel?: string\n}\n\nexport interface LinkListProps {\n links?: LinkListItem[]\n className?: string\n}\n\nexport function LinkList({ links = [], className }: LinkListProps) {\n return (\n <ul className={classNames(\"dio-link-list\", className)}>\n {links.map((link) => (\n <li key={link.href} className=\"dio-link-list__item\">\n <DsLink\n className=\"dio-link-list__link\"\n href={link.href}\n {...(link.target ? { target: link.target } : {})}\n {...(link.rel ? { rel: link.rel } : {})}\n >\n <SvgIcon name=\"dio-chevron-right\" />\n <span>{link.label}</span>\n </DsLink>\n </li>\n ))}\n </ul>\n )\n}\n", "import { Link as DsLink, type LinkProps as DsLinkProps } from \"@digdir/designsystemet-react\"\nimport classNames from \"classnames\"\nimport type { ReactNode } from \"react\"\n\nimport { SvgIcon } from \"../SvgIcon/SvgIcon\"\n\nexport type NavigationalLinkProps = Omit<DsLinkProps, \"children\"> & {\n children?: ReactNode\n iconLeft?: string\n iconRight?: string\n}\n\nexport function NavigationalLink({\n children,\n className,\n iconLeft,\n iconRight = \"dio-chevron-right\",\n ...props\n}: NavigationalLinkProps) {\n return (\n <DsLink\n className={classNames(\"dio-navigational-link\", className)}\n data-testid=\"navigational-link\"\n {...props}\n >\n {iconLeft && <SvgIcon name={iconLeft} />}\n <span>{children}</span>\n {iconRight && <SvgIcon name={iconRight} />}\n </DsLink>\n )\n}\n", "import {\n Pagination as DsPagination,\n type PaginationProps as DsPaginationProps,\n} from \"@digdir/designsystemet-react\"\n\nexport type PaginationProps = DsPaginationProps\n\nfunction PaginationRoot({ className, children, ...props }: PaginationProps) {\n return (\n <DsPagination className={className} {...props}>\n {children}\n </DsPagination>\n )\n}\n\nexport const Pagination = Object.assign(PaginationRoot, {\n List: DsPagination.List,\n Item: DsPagination.Item,\n Button: DsPagination.Button,\n})\n", "import { Radio as DsRadio, type RadioProps as DsRadioProps } from \"@digdir/designsystemet-react\"\nimport type { ChangeEventHandler } from \"react\"\n\nexport type RadioProps = Omit<\n DsRadioProps,\n \"disabled\" | \"checked\" | \"required\" | \"defaultChecked\" | \"error\" | \"onChange\"\n> & {\n isDisabled?: boolean\n isChecked?: boolean\n isDefaultChecked?: boolean\n onChange?: ChangeEventHandler<HTMLInputElement>\n}\n\nexport function Radio({\n className,\n isDisabled,\n isChecked,\n isDefaultChecked,\n onChange,\n ...props\n}: RadioProps) {\n return (\n <DsRadio\n {...({\n className,\n disabled: isDisabled,\n checked: isChecked,\n defaultChecked: isDefaultChecked,\n onChange,\n ...props,\n } as DsRadioProps)}\n />\n )\n}\n", "import {\n Fieldset as DsFieldset,\n type FieldsetProps as DsFieldsetProps,\n} from \"@digdir/designsystemet-react\"\nimport type { CSSProperties, ReactNode } from \"react\"\n\nimport { ControlGroup } from \"../ControlGroup/ControlGroup\"\n\nexport interface RadioFieldsetProps extends DsFieldsetProps {\n legend: string\n description?: ReactNode\n children: ReactNode\n direction?: \"horizontal\" | \"vertical\"\n style?: CSSProperties\n}\n\nexport function RadioFieldset({\n legend,\n description,\n children,\n direction = \"vertical\",\n style,\n className,\n ...props\n}: RadioFieldsetProps) {\n return (\n <DsFieldset className={className} style={style} {...props}>\n <DsFieldset.Legend>{legend}</DsFieldset.Legend>\n {description && <DsFieldset.Description>{description}</DsFieldset.Description>}\n {direction === \"horizontal\" ? <ControlGroup>{children}</ControlGroup> : children}\n </DsFieldset>\n )\n}\n", "import {\n Field as DsField,\n Label as DsLabel,\n Select as DsSelect,\n type SelectProps as DsSelectProps,\n} from \"@digdir/designsystemet-react\"\nimport type { ChangeEventHandler, ReactNode } from \"react\"\n\nimport { DEFAULT_REQUIRED_MESSAGE, Label } from \"../Label/Label\"\nimport { ValidationMessage } from \"../ValidationMessage/ValidationMessage\"\n\nexport interface SelectProps extends Omit<DsSelectProps, \"required\" | \"disabled\" | \"onChange\"> {\n controlClassName?: string\n label?: ReactNode\n description?: ReactNode\n selectedValue?: string\n isValid?: boolean\n errorMessage?: string\n isValidationVisible?: boolean\n isRequired?: boolean\n isDisabled?: boolean\n requiredMessage?: string\n onChange?: ChangeEventHandler<HTMLSelectElement>\n}\n\nfunction SelectRoot({\n className,\n controlClassName,\n label,\n description,\n id,\n isRequired,\n isDisabled,\n selectedValue,\n value,\n onChange,\n isValid,\n errorMessage,\n isValidationVisible,\n requiredMessage = DEFAULT_REQUIRED_MESSAGE,\n children,\n ...props\n}: SelectProps) {\n const isInvalid = !!(!isValid && isValidationVisible && errorMessage)\n\n return (\n <DsField className={className}>\n {label && (\n <DsLabel htmlFor={id}>\n <Label\n isRequired={isRequired}\n isInvalid={isInvalid}\n requiredMessage={requiredMessage}\n >\n {label}\n </Label>\n </DsLabel>\n )}\n {description && <DsField.Description>{description}</DsField.Description>}\n <DsSelect\n className={controlClassName}\n id={id}\n required={isRequired}\n disabled={isDisabled}\n value={value ?? selectedValue}\n onChange={onChange}\n aria-invalid={isInvalid ? true : undefined}\n {...props}\n >\n {children}\n </DsSelect>\n {isInvalid && <ValidationMessage>{errorMessage}</ValidationMessage>}\n </DsField>\n )\n}\n\nexport const Select = Object.assign(SelectRoot, {\n Option: DsSelect.Option,\n Optgroup: DsSelect.Optgroup,\n})\n", "import {\n Spinner as DsSpinner,\n type SpinnerProps as DsSpinnerProps,\n} from \"@digdir/designsystemet-react\"\nimport classNames from \"classnames\"\n\nexport interface SpinnerProps extends Omit<DsSpinnerProps, \"data-size\" | \"aria-label\"> {\n size?: \"2xs\" | \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\"\n textBefore?: string\n textAfter?: string\n ariaLabel?: string\n}\n\nexport function Spinner({\n size = \"md\",\n textBefore,\n textAfter,\n ariaLabel,\n className,\n ...props\n}: SpinnerProps) {\n const label = ariaLabel ?? textAfter ?? textBefore ?? \"Laster...\"\n const dataSize = size === \"2xl\" ? \"xl\" : size\n const hasText = !!(textBefore || textAfter)\n\n const icon = (\n <DsSpinner\n className={hasText ? \"spinner__icon\" : className}\n data-size={dataSize}\n aria-label={label}\n {...props}\n />\n )\n\n if (!hasText) {\n return icon\n }\n\n return (\n <div className={classNames(\"spinner\", className)} data-testid=\"spinner\">\n {textBefore && <p className=\"dio-text-large spinner__text\">{textBefore}</p>}\n {icon}\n {textAfter && <p className=\"dio-text-large spinner__text\">{textAfter}</p>}\n </div>\n )\n}\n", "import { Switch as DsSwitch, type SwitchProps as DsSwitchProps } from \"@digdir/designsystemet-react\"\nimport type { ChangeEventHandler } from \"react\"\n\nexport type SwitchProps = Omit<\n DsSwitchProps,\n \"disabled\" | \"checked\" | \"required\" | \"defaultChecked\" | \"onChange\"\n> & {\n isDisabled?: boolean\n isChecked?: boolean\n isDefaultChecked?: boolean\n onChange?: ChangeEventHandler<HTMLInputElement>\n}\n\nexport function Switch({\n className,\n isDisabled,\n isChecked,\n isDefaultChecked,\n onChange,\n ...props\n}: SwitchProps) {\n return (\n <DsSwitch\n {...({\n className,\n disabled: isDisabled,\n checked: isChecked,\n defaultChecked: isDefaultChecked,\n onChange,\n ...props,\n } as DsSwitchProps)}\n />\n )\n}\n", "import { Tabs as DsTabs, type TabsProps as DsTabsProps } from \"@digdir/designsystemet-react\"\n\nexport type TabsProps = DsTabsProps\n\nfunction TabsRoot({ className, children, ...props }: TabsProps) {\n return (\n <DsTabs className={className} {...props}>\n {children}\n </DsTabs>\n )\n}\n\nexport const Tabs = Object.assign(TabsRoot, {\n List: DsTabs.List,\n Tab: DsTabs.Tab,\n Panel: DsTabs.Panel,\n})\n", "import {\n Field as DsField,\n Label as DsLabel,\n Textarea as DsTextarea,\n type TextareaProps as DsTextareaProps,\n} from \"@digdir/designsystemet-react\"\nimport type { ChangeEventHandler, ReactNode } from \"react\"\n\nimport { DEFAULT_REQUIRED_MESSAGE, Label } from \"../Label/Label\"\nimport { ValidationMessage } from \"../ValidationMessage/ValidationMessage\"\n\nexport interface TextareaProps extends Omit<DsTextareaProps, \"required\" | \"disabled\" | \"onChange\"> {\n controlClassName?: string\n label?: ReactNode\n description?: ReactNode\n isValid?: boolean\n errorMessage?: string\n isValidationVisible?: boolean\n isRequired?: boolean\n isDisabled?: boolean\n requiredMessage?: string\n value?: string\n onChange?: ChangeEventHandler<HTMLTextAreaElement>\n}\n\nexport function Textarea({\n className,\n controlClassName,\n label,\n description,\n id,\n isValid,\n errorMessage,\n isValidationVisible,\n isRequired,\n isDisabled,\n requiredMessage = DEFAULT_REQUIRED_MESSAGE,\n value,\n onChange,\n ...props\n}: TextareaProps) {\n const isInvalid = !!(!isValid && isValidationVisible && errorMessage)\n\n return (\n <DsField className={className}>\n {label && (\n <DsLabel htmlFor={id}>\n <Label\n isRequired={isRequired}\n isInvalid={isInvalid}\n requiredMessage={requiredMessage}\n >\n {label}\n </Label>\n </DsLabel>\n )}\n {description && <DsField.Description>{description}</DsField.Description>}\n <DsTextarea\n id={id}\n className={controlClassName}\n required={isRequired}\n disabled={isDisabled}\n aria-invalid={isInvalid ? true : undefined}\n value={value}\n onChange={onChange}\n {...props}\n />\n {isInvalid && <ValidationMessage>{errorMessage}</ValidationMessage>}\n </DsField>\n )\n}\n", "import {\n Textfield as DsTextfield,\n type TextfieldProps as DsTextfieldProps,\n} from \"@digdir/designsystemet-react\"\nimport type { ChangeEventHandler, ReactNode } from \"react\"\n\nimport { DEFAULT_REQUIRED_MESSAGE, Label } from \"../Label/Label\"\n\nexport type TextfieldProps = Omit<\n DsTextfieldProps,\n \"label\" | \"error\" | \"required\" | \"disabled\" | \"onChange\"\n> & {\n isValid?: boolean\n isValidationVisible?: boolean\n label?: ReactNode\n errorMessage?: string\n isRequired?: boolean\n isDisabled?: boolean\n requiredMessage?: string\n value?: string\n onChange?: ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>\n accept?: string\n}\n\nexport function Textfield({\n className,\n isValid,\n isValidationVisible,\n errorMessage,\n isRequired,\n isDisabled,\n requiredMessage = DEFAULT_REQUIRED_MESSAGE,\n label,\n value,\n onChange,\n ...props\n}: TextfieldProps) {\n const isInvalid = !!(!isValid && isValidationVisible && errorMessage)\n\n return (\n <DsTextfield\n {...({\n className,\n label: label ? (\n <Label\n isRequired={isRequired}\n isInvalid={isInvalid}\n requiredMessage={requiredMessage}\n >\n {label}\n </Label>\n ) : undefined,\n required: isRequired,\n disabled: isDisabled,\n error: isInvalid ? errorMessage : undefined,\n value,\n onChange,\n ...props,\n } as DsTextfieldProps)}\n />\n )\n}\n", "import type { Color as ThemeColor, SeverityColors } from \"@digdir/designsystemet-types\"\n\nexport type { ThemeColor, SeverityColors }\n\nexport type Color = ThemeColor | Exclude<SeverityColors, ThemeColor>\n\nexport const themeColors = [\"primary\", \"accent1\", \"regjeringsbla\", \"neutral\"] as ThemeColor[]\n\nexport const severityColors = Object.keys({\n info: true,\n success: true,\n warning: true,\n danger: true,\n} satisfies Record<SeverityColors, true>) as SeverityColors[]\n\nexport const colors = [...themeColors, ...severityColors] as Color[]\n"],
5
+ "mappings": ";AAAO,SAAS,OAAM;AAAC,WAAQ,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,MAAI,YAAU,OAAO,MAAI,MAAI,KAAG,OAAK;AAAG,SAAO;AAAC;AAAC,IAAO,eAAQ;;;ACEnJ,SAAS,kBAAkB;AAC3B,SAAS,WAAW;AAQpB,IAAM,QAAQ,WAAW,SAASA,OAAM,EAAE,cAAc,QAAQ,QAAQ,WAAW,GAAG,KAAK,GAAG,KAAK;AAClG,SAAuB,oBAAI,OAAO;AAAA,IACjC,WAAW,aAAG,YAAY,SAAS;AAAA,IACnC,cAAc;AAAA,IACd;AAAA,IACA,GAAG;AAAA,EACJ,CAAC;AACF,CAAC;;;AChBD,SAAS,YAAAC,WAAU,cAAAC,mBAAkB;AACrC,SAAS,OAAAC,YAAW;;;ACHpB,YAAYC,YAAW;;;ACAvB,YAAY,WAAW;;;AAQvB,SAAS,OAA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;AACf,QAAM,YAAY,CAAC,EAAE,CAAC,WAAW,uBAAuB;AAExD,SACI,gBAAAF;AAAA,IAAC;AAAA;AAAA,MACI,GAAI;AAAA,QACD;AAAA,QACA,OAAO,QACH,gBAAAA;AAAA,UAACG;AAAA,UAAA;AAAA,YACG;AAAA,YACA;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACL,IACA;AAAA,QACJ,UAAU;AAAA,QACV,UAAUD;AAAA,QACV,OAAO,YAAY,eAAe;AAAA,QAClC;AAAA,QACA;AAAA,QACA,GAAG;AAAA,MACP;AAAA;AAAA,EACJ;AAER;;;ACvDO,IAAM,cAAc,CAAC,WAAW,WAAW,iBAAiB,SAAS;AAErE,IAAM,iBAAiB,OAAO,KAAK;AAAA,EACtC,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AACZ,CAAwC;AAEjC,IAAM,SAAS,CAAC,GAAG,aAAa,GAAG,cAAc;",
6
+ "names": ["Alert", "Fragment", "forwardRef", "jsx", "React", "Slot", "__name", "Slottable", "child", "React", "forwardRef", "Avatar", "Fragment", "jsx", "forwardRef", "jsx", "forwardRef", "jsx", "forwardRef", "jsx", "Badge", "count", "Badge", "forwardRef", "jsx", "BreadcrumbsItem", "forwardRef", "jsx", "forwardRef", "jsx", "forwardRef", "jsx", "BreadcrumbsLink", "forwardRef", "jsx", "BreadcrumbsList", "forwardRef", "jsx", "useEffect", "useEffect", "useRef", "useState", "useId", "useState", "useEffect", "useLayoutEffect", "useRef", "useIsomorphicLayoutEffect", "useCallback", "useMemo", "useRef", "forwardRef", "jsx", "forwardRef", "jsx", "forwardRef", "useEffect", "useRef", "useState", "jsx", "forwardRef", "useState", "useRef", "useEffect", "jsx", "forwardRef", "jsx", "jsxs", "Spinner", "forwardRef", "jsx", "jsxs", "forwardRef", "Button", "jsxs", "jsx", "forwardRef", "jsx", "forwardRef", "Label", "jsx", "index", "forwardRef", "jsx", "forwardRef", "ValidationMessage", "jsx", "forwardRef", "jsx", "forwardRef", "Paragraph", "jsx", "forwardRef", "jsx", "Input", "forwardRef", "jsx", "jsxs", "forwardRef", "ChipButton", "jsx", "ChipRemovable", "ChipCheckbox", "size", "jsxs", "ChipRadio", "createContext", "forwardRef", "jsx", "jsx", "createContext", "useContext", "jsx", "forwardRef", "useContext", "useId", "useMemo", "jsx", "React", "useLayoutEffect", "useEffect", "useRef", "getComputedStyle", "activeElement", "version", "candidateSelectors", "candidateSelector", "join", "NoElement", "Element", "matches", "prototype", "msMatchesSelector", "webkitMatchesSelector", "getRootNode", "element", "_element$getRootNode", "call", "ownerDocument", "isInert", "node", "lookUp", "_node$getAttribute", "inertAtt", "getAttribute", "inert", "result", "closest", "parentNode", "isContentEditable", "_node$getAttribute2", "attValue", "getCandidates", "el", "includeContainer", "filter", "candidates", "Array", "slice", "apply", "querySelectorAll", "unshift", "getCandidatesIteratively", "elements", "options", "elementsToCheck", "from", "length", "shift", "tagName", "assigned", "assignedElements", "content", "children", "nestedCandidates", "flatten", "push", "scopeParent", "validCandidate", "includes", "shadowRoot", "getShadowRoot", "validShadowRoot", "shadowRootFilter", "hasTabIndex", "isNaN", "parseInt", "getTabIndex", "Error", "tabIndex", "test", "getSortOrderTabIndex", "isScope", "sortOrderedTabbables", "a", "b", "documentOrder", "isInput", "isHiddenInput", "type", "isDetailsWithSummary", "r", "some", "child", "getCheckedRadio", "nodes", "form", "i", "checked", "isTabbableRadio", "name", "radioScope", "queryRadios", "radioSet", "window", "CSS", "escape", "err", "console", "error", "message", "isRadio", "isNonTabbableRadio", "isNodeAttached", "_nodeRoot", "nodeRoot", "nodeRootHost", "host", "attached", "_nodeRootHost", "_nodeRootHost$ownerDo", "_node$ownerDocument", "contains", "_nodeRoot2", "_nodeRootHost2", "_nodeRootHost2$ownerD", "isZeroArea", "_node$getBoundingClie", "getBoundingClientRect", "width", "height", "isHidden", "_ref", "displayCheck", "visible", "checkVisibility", "checkOpacity", "opacityProperty", "contentVisibilityAuto", "visibilityProperty", "checkVisibilityCSS", "_getComputedStyle", "getComputedStyle", "visibility", "isDirectSummary", "nodeUnderDetails", "parentElement", "originalNode", "rootNode", "assignedSlot", "getClientRects", "isDisabledFromFieldset", "disabled", "item", "isNodeMatchingSelectorFocusable", "isNodeMatchingSelectorTabbable", "isShadowRootTabbable", "shadowHostNode", "sortByOrder", "regularTabbables", "orderedTabbables", "forEach", "candidateTabindex", "sort", "reduce", "acc", "sortable", "concat", "tabbable", "container", "bind", "isTabbable", "node", "options", "Error", "matches", "call", "candidateSelector", "isNodeMatchingSelectorTabbable", "ReactDOM", "platform", "platform", "placements", "sides", "side", "placement", "overflow", "platform", "platform", "getComputedStyle", "timeoutId", "offset", "flip", "size", "computePosition", "React", "useLayoutEffect", "noop", "platform", "computePosition", "data", "offset", "flip", "size", "useMergeRefs", "React", "index", "offset", "useLayoutEffect", "useEffect", "index", "useId", "warn", "useLatestRef", "useRef", "index", "attr", "next", "index", "FocusGuard", "useId", "VisuallyHiddenDismiss", "useLatestRef", "domReference", "onOpenChange", "open", "isRTL", "getComputedStyle", "useId", "open", "useFloating", "index", "node", "mergeProps", "warn", "useLatestRef", "listRef", "indexRef", "item", "index", "props", "useId", "forwardRef", "useId", "useContext", "size", "index", "useMemo", "jsx", "useMergeRefs", "isValidElement", "useContext", "useEffect", "useId", "useMemo", "useId", "useContext", "index", "useMemo", "useMergeRefs", "useEffect", "forwardRef", "isValidElement", "useContext", "useId", "jsx", "jsxs", "size", "forwardRef", "useContext", "jsx", "size", "jsx", "size", "error", "useContext", "jsx", "size", "forwardRef", "useContext", "jsx", "useContext", "useRef", "jsx", "jsxs", "error", "useContext", "useRef", "size", "useMergeRefs", "jsx", "jsxs", "Fragment", "jsx", "jsxs", "size", "jsx", "Children", "useCallback", "useMemo", "useState", "inputValue", "child", "filteredOptions", "index", "useState", "flushSync", "useState", "useFloating", "flip", "size", "offset", "index", "createContext", "useContext", "useId", "prefix", "size", "forwardRef", "useEffect", "useRef", "useState", "Fragment$1", "jsx", "jsxs", "count", "memo", "index", "timeoutId", "index", "offset", "index", "size", "offset", "index", "opts", "count", "memo", "offset", "max", "min", "size", "key", "startIndex", "endIndex", "useIsomorphicLayoutEffect", "instance", "flushSync", "forwardRef", "error", "size", "useRef", "useState", "useEffect", "value", "newSelectedOptions", "jsxs", "index", "jsx", "Fragment$1", "Combobox", "forwardRef", "jsx", "forwardRef", "CardBlock", "jsx", "forwardRef", "useEffect", "useId", "useRef", "jsx", "forwardRef", "Card", "useRef", "useId", "useEffect", "jsx", "forwardRef", "jsx", "FieldAffixes", "FieldAffix", "forwardRef", "jsx", "FieldCounter", "forwardRef", "jsx", "FieldDescription", "forwardRef", "useRef", "jsx", "forwardRef", "Field", "useRef", "jsx", "forwardRef", "jsx", "jsxs", "Checkbox", "size", "error", "forwardRef", "jsx", "DetailsContent", "forwardRef", "jsx", "DetailsSummary", "forwardRef", "useEffect", "useRef", "jsx", "Details", "createContext", "useRef", "jsx", "forwardRef", "jsx", "forwardRef", "DialogBlock", "jsx", "forwardRef", "useContext", "jsx", "forwardRef", "DialogTrigger", "useContext", "jsx", "forwardRef", "useContext", "useEffect", "useId", "useRef", "jsx", "jsxs", "forwardRef", "Dialog", "useContext", "useRef", "useId", "useEffect", "jsxs", "jsx", "forwardRef", "jsx", "Divider", "createContext", "useId", "useState", "jsx", "Context", "forwardRef", "jsx", "DropdownButton", "forwardRef", "jsx", "forwardRef", "Heading", "jsx", "forwardRef", "jsx", "DropdownHeading", "forwardRef", "jsx", "DropdownItem", "forwardRef", "jsx", "DropdownList", "forwardRef", "useContext", "version", "jsx", "forwardRef", "PopoverTrigger", "inline", "useContext", "Context", "version", "jsx", "forwardRef", "jsx", "DropdownTrigger", "jsx", "forwardRef", "useContext", "useEffect", "useRef", "useState", "jsx", "forwardRef", "Popover", "autoPlacement", "useRef", "useContext", "Context", "useState", "useEffect", "isTopLayer", "jsx", "forwardRef", "jsx", "forwardRef", "jsx", "ErrorSummaryHeading", "forwardRef", "jsx", "forwardRef", "ListItem", "jsx", "forwardRef", "jsx", "forwardRef", "ListUnordered", "jsx", "ListOrdered", "forwardRef", "jsx", "ErrorSummaryItem", "forwardRef", "jsx", "ErrorSummaryLink", "forwardRef", "jsx", "ErrorSummaryList", "forwardRef", "jsx", "forwardRef", "ErrorSummary", "jsx", "forwardRef", "jsx", "FieldsetDescription", "forwardRef", "jsx", "FieldsetLegend", "forwardRef", "jsx", "Fieldset", "forwardRef", "jsx", "FileUpload", "forwardRef", "jsx", "PaginationButton", "forwardRef", "jsx", "forwardRef", "PaginationItem", "jsx", "forwardRef", "jsx", "forwardRef", "PaginationList", "jsx", "forwardRef", "jsx", "forwardRef", "Pagination", "jsx", "forwardRef", "jsx", "jsxs", "Radio", "size", "error", "forwardRef", "jsx", "SearchButton", "forwardRef", "jsx", "SearchClear", "forwardRef", "jsx", "SearchInput", "forwardRef", "jsx", "Search", "forwardRef", "jsx", "forwardRef", "SelectOptgroup", "jsx", "forwardRef", "jsx", "forwardRef", "SelectOption", "jsx", "forwardRef", "jsx", "Select", "forwardRef", "jsx", "forwardRef", "Skeleton", "jsx", "forwardRef", "jsx", "SkipLink", "forwardRef", "jsx", "SuggestionClear", "forwardRef", "jsx", "SuggestionEmpty", "createContext", "forwardRef", "useCallback", "useEffect", "useId", "useRef", "useState", "jsx", "jsxs", "Suggestion", "genId", "multiple", "index", "forwardRef", "useContext", "useEffect", "jsx", "forwardRef", "useContext", "useEffect", "jsx", "SuggestionList", "autoPlacement", "forwardRef", "jsx", "SuggestionOption", "forwardRef", "jsx", "SuggestionToggle", "SuggestionList", "forwardRef", "jsx", "jsxs", "Switch", "size", "forwardRef", "jsx", "TableBody", "forwardRef", "jsx", "TableCell", "forwardRef", "jsx", "TableFoot", "forwardRef", "jsx", "TableHead", "forwardRef", "jsx", "TableHeaderCell", "forwardRef", "jsx", "TableRow", "forwardRef", "jsx", "Table", "forwardRef", "jsx", "TabsList", "createContext", "forwardRef", "useId", "useRef", "useState", "jsx", "Context", "Tabs", "value", "forwardRef", "useContext", "jsx", "TabsPanel", "Context", "forwardRef", "useContext", "jsx", "TabsTab", "Context", "forwardRef", "jsx", "Tag", "forwardRef", "jsx", "Textarea", "forwardRef", "jsx", "jsxs", "Textfield", "error", "prefix", "size", "createContext", "forwardRef", "useId", "useState", "jsx", "ToggleGroup", "forwardRef", "useContext", "useId", "jsx", "jsxs", "ToggleGroupItem", "forwardRef", "jsx", "forwardRef", "Tooltip", "autoPlacement", "jsx", "jsx", "jsxs", "Alert", "jsx", "Breadcrumbs", "jsx", "jsx", "jsxs", "Button", "isDisabled", "size", "jsx", "jsx", "jsxs", "isDisabled", "jsx", "jsxs", "Card", "Heading", "classNames", "useId", "classNames", "jsx", "Tag", "jsx", "jsxs", "Label", "classNames", "Tag", "jsx", "ValidationMessage", "jsx", "jsxs", "Checkbox", "isDisabled", "useId", "classNames", "Label", "ValidationMessage", "classNames", "jsx", "jsx", "jsxs", "jsx", "jsxs", "Details", "useEffect", "useRef", "jsx", "jsxs", "Dialog", "jsx", "Dropdown", "jsx", "jsxs", "ErrorSummary", "error", "classNames", "jsx", "jsxs", "classNames", "classNames", "jsx", "classNames", "jsx", "jsxs", "classNames", "classNames", "jsx", "jsxs", "classNames", "jsx", "Pagination", "jsx", "Radio", "isDisabled", "jsx", "jsxs", "jsx", "jsxs", "isDisabled", "Label", "ValidationMessage", "Select", "classNames", "jsx", "jsxs", "Spinner", "size", "jsx", "Switch", "isDisabled", "jsx", "Tabs", "jsx", "jsxs", "Textarea", "isDisabled", "Label", "ValidationMessage", "jsx", "Textfield", "isDisabled", "Label"]
7
+ }