{"version":3,"file":"select.B2M0LrW8.js","sources":["../../../node_modules/lucide-react/dist/esm/icons/chevron-up.js","../../../node_modules/@radix-ui/number/dist/index.mjs","../../../node_modules/@radix-ui/react-select/dist/index.mjs","../../../src/components/ui/select.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.453.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronUp = createLucideIcon(\"ChevronUp\", [[\"path\", { d: \"m18 15-6-6-6 6\", key: \"153udz\" }]]);\n\nexport { ChevronUp as default };\n//# sourceMappingURL=chevron-up.js.map\n","// packages/core/number/src/number.ts\nfunction clamp(value, [min, max]) {\n return Math.min(max, Math.max(min, value));\n}\nexport {\n clamp\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/select/src/Select.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { clamp } from \"@radix-ui/number\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { usePrevious } from \"@radix-ui/react-use-previous\";\nimport { VisuallyHidden } from \"@radix-ui/react-visually-hidden\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar OPEN_KEYS = [\" \", \"Enter\", \"ArrowUp\", \"ArrowDown\"];\nvar SELECTION_KEYS = [\" \", \"Enter\"];\nvar SELECT_NAME = \"Select\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);\nvar [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [\n createCollectionScope,\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);\nvar [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);\nvar Select = (props) => {\n const {\n __scopeSelect,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n value: valueProp,\n defaultValue,\n onValueChange,\n dir,\n name,\n autoComplete,\n disabled,\n required,\n form\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const [trigger, setTrigger] = React.useState(null);\n const [valueNode, setValueNode] = React.useState(null);\n const [valueNodeHasChildren, setValueNodeHasChildren] = React.useState(false);\n const direction = useDirection(dir);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue,\n onChange: onValueChange\n });\n const triggerPointerDownPosRef = React.useRef(null);\n const isFormControl = trigger ? form || !!trigger.closest(\"form\") : true;\n const [nativeOptionsSet, setNativeOptionsSet] = React.useState(/* @__PURE__ */ new Set());\n const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(\";\");\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsxs(\n SelectProvider,\n {\n required,\n scope: __scopeSelect,\n trigger,\n onTriggerChange: setTrigger,\n valueNode,\n onValueNodeChange: setValueNode,\n valueNodeHasChildren,\n onValueNodeHasChildrenChange: setValueNodeHasChildren,\n contentId: useId(),\n value,\n onValueChange: setValue,\n open,\n onOpenChange: setOpen,\n dir: direction,\n triggerPointerDownPosRef,\n disabled,\n children: [\n /* @__PURE__ */ jsx(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n SelectNativeOptionsProvider,\n {\n scope: props.__scopeSelect,\n onNativeOptionAdd: React.useCallback((option) => {\n setNativeOptionsSet((prev) => new Set(prev).add(option));\n }, []),\n onNativeOptionRemove: React.useCallback((option) => {\n setNativeOptionsSet((prev) => {\n const optionsSet = new Set(prev);\n optionsSet.delete(option);\n return optionsSet;\n });\n }, []),\n children\n }\n ) }),\n isFormControl ? /* @__PURE__ */ jsxs(\n BubbleSelect,\n {\n \"aria-hidden\": true,\n required,\n tabIndex: -1,\n name,\n autoComplete,\n value,\n onChange: (event) => setValue(event.target.value),\n disabled,\n form,\n children: [\n value === void 0 ? /* @__PURE__ */ jsx(\"option\", { value: \"\" }) : null,\n Array.from(nativeOptionsSet)\n ]\n },\n nativeSelectKey\n ) : null\n ]\n }\n ) });\n};\nSelect.displayName = SELECT_NAME;\nvar TRIGGER_NAME = \"SelectTrigger\";\nvar SelectTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, disabled = false, ...triggerProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(TRIGGER_NAME, __scopeSelect);\n const isDisabled = context.disabled || disabled;\n const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);\n const getItems = useCollection(__scopeSelect);\n const pointerTypeRef = React.useRef(\"touch\");\n const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.value === context.value);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem !== void 0) {\n context.onValueChange(nextItem.value);\n }\n });\n const handleOpen = (pointerEvent) => {\n if (!isDisabled) {\n context.onOpenChange(true);\n resetTypeahead();\n }\n if (pointerEvent) {\n context.triggerPointerDownPosRef.current = {\n x: Math.round(pointerEvent.pageX),\n y: Math.round(pointerEvent.pageY)\n };\n }\n };\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n role: \"combobox\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open,\n \"aria-required\": context.required,\n \"aria-autocomplete\": \"none\",\n dir: context.dir,\n \"data-state\": context.open ? \"open\" : \"closed\",\n disabled: isDisabled,\n \"data-disabled\": isDisabled ? \"\" : void 0,\n \"data-placeholder\": shouldShowPlaceholder(context.value) ? \"\" : void 0,\n ...triggerProps,\n ref: composedRefs,\n onClick: composeEventHandlers(triggerProps.onClick, (event) => {\n event.currentTarget.focus();\n if (pointerTypeRef.current !== \"mouse\") {\n handleOpen(event);\n }\n }),\n onPointerDown: composeEventHandlers(triggerProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n const target = event.target;\n if (target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n if (event.button === 0 && event.ctrlKey === false && event.pointerType === \"mouse\") {\n handleOpen(event);\n event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {\n const isTypingAhead = searchRef.current !== \"\";\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if (isTypingAhead && event.key === \" \") return;\n if (OPEN_KEYS.includes(event.key)) {\n handleOpen();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nSelectTrigger.displayName = TRIGGER_NAME;\nvar VALUE_NAME = \"SelectValue\";\nvar SelectValue = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, children, placeholder = \"\", ...valueProps } = props;\n const context = useSelectContext(VALUE_NAME, __scopeSelect);\n const { onValueNodeHasChildrenChange } = context;\n const hasChildren = children !== void 0;\n const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);\n useLayoutEffect(() => {\n onValueNodeHasChildrenChange(hasChildren);\n }, [onValueNodeHasChildrenChange, hasChildren]);\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...valueProps,\n ref: composedRefs,\n style: { pointerEvents: \"none\" },\n children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ jsx(Fragment, { children: placeholder }) : children\n }\n );\n }\n);\nSelectValue.displayName = VALUE_NAME;\nvar ICON_NAME = \"SelectIcon\";\nvar SelectIcon = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, children, ...iconProps } = props;\n return /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...iconProps, ref: forwardedRef, children: children || \"\\u25BC\" });\n }\n);\nSelectIcon.displayName = ICON_NAME;\nvar PORTAL_NAME = \"SelectPortal\";\nvar SelectPortal = (props) => {\n return /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, ...props });\n};\nSelectPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"SelectContent\";\nvar SelectContent = React.forwardRef(\n (props, forwardedRef) => {\n const context = useSelectContext(CONTENT_NAME, props.__scopeSelect);\n const [fragment, setFragment] = React.useState();\n useLayoutEffect(() => {\n setFragment(new DocumentFragment());\n }, []);\n if (!context.open) {\n const frag = fragment;\n return frag ? ReactDOM.createPortal(\n /* @__PURE__ */ jsx(SelectContentProvider, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSelect, children: /* @__PURE__ */ jsx(\"div\", { children: props.children }) }) }),\n frag\n ) : null;\n }\n return /* @__PURE__ */ jsx(SelectContentImpl, { ...props, ref: forwardedRef });\n }\n);\nSelectContent.displayName = CONTENT_NAME;\nvar CONTENT_MARGIN = 10;\nvar [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME);\nvar CONTENT_IMPL_NAME = \"SelectContentImpl\";\nvar SelectContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n position = \"item-aligned\",\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n //\n // PopperContent props\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions,\n //\n ...contentProps\n } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const [content, setContent] = React.useState(null);\n const [viewport, setViewport] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [selectedItem, setSelectedItem] = React.useState(null);\n const [selectedItemText, setSelectedItemText] = React.useState(\n null\n );\n const getItems = useCollection(__scopeSelect);\n const [isPositioned, setIsPositioned] = React.useState(false);\n const firstValidItemFoundRef = React.useRef(false);\n React.useEffect(() => {\n if (content) return hideOthers(content);\n }, [content]);\n useFocusGuards();\n const focusFirst = React.useCallback(\n (candidates) => {\n const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);\n const [lastItem] = restItems.slice(-1);\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate?.scrollIntoView({ block: \"nearest\" });\n if (candidate === firstItem && viewport) viewport.scrollTop = 0;\n if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;\n candidate?.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n },\n [getItems, viewport]\n );\n const focusSelectedItem = React.useCallback(\n () => focusFirst([selectedItem, content]),\n [focusFirst, selectedItem, content]\n );\n React.useEffect(() => {\n if (isPositioned) {\n focusSelectedItem();\n }\n }, [isPositioned, focusSelectedItem]);\n const { onOpenChange, triggerPointerDownPosRef } = context;\n React.useEffect(() => {\n if (content) {\n let pointerMoveDelta = { x: 0, y: 0 };\n const handlePointerMove = (event) => {\n pointerMoveDelta = {\n x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),\n y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))\n };\n };\n const handlePointerUp = (event) => {\n if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) {\n event.preventDefault();\n } else {\n if (!content.contains(event.target)) {\n onOpenChange(false);\n }\n }\n document.removeEventListener(\"pointermove\", handlePointerMove);\n triggerPointerDownPosRef.current = null;\n };\n if (triggerPointerDownPosRef.current !== null) {\n document.addEventListener(\"pointermove\", handlePointerMove);\n document.addEventListener(\"pointerup\", handlePointerUp, { capture: true, once: true });\n }\n return () => {\n document.removeEventListener(\"pointermove\", handlePointerMove);\n document.removeEventListener(\"pointerup\", handlePointerUp, { capture: true });\n };\n }\n }, [content, onOpenChange, triggerPointerDownPosRef]);\n React.useEffect(() => {\n const close = () => onOpenChange(false);\n window.addEventListener(\"blur\", close);\n window.addEventListener(\"resize\", close);\n return () => {\n window.removeEventListener(\"blur\", close);\n window.removeEventListener(\"resize\", close);\n };\n }, [onOpenChange]);\n const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {\n const enabledItems = getItems().filter((item) => !item.disabled);\n const currentItem = enabledItems.find((item) => item.ref.current === document.activeElement);\n const nextItem = findNextItem(enabledItems, search, currentItem);\n if (nextItem) {\n setTimeout(() => nextItem.ref.current.focus());\n }\n });\n const itemRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItem(node);\n if (isFirstValidItem) firstValidItemFoundRef.current = true;\n }\n },\n [context.value]\n );\n const handleItemLeave = React.useCallback(() => content?.focus(), [content]);\n const itemTextRefCallback = React.useCallback(\n (node, value, disabled) => {\n const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;\n const isSelectedItem = context.value !== void 0 && context.value === value;\n if (isSelectedItem || isFirstValidItem) {\n setSelectedItemText(node);\n }\n },\n [context.value]\n );\n const SelectPosition = position === \"popper\" ? SelectPopperPosition : SelectItemAlignedPosition;\n const popperContentProps = SelectPosition === SelectPopperPosition ? {\n side,\n sideOffset,\n align,\n alignOffset,\n arrowPadding,\n collisionBoundary,\n collisionPadding,\n sticky,\n hideWhenDetached,\n avoidCollisions\n } : {};\n return /* @__PURE__ */ jsx(\n SelectContentProvider,\n {\n scope: __scopeSelect,\n content,\n viewport,\n onViewportChange: setViewport,\n itemRefCallback,\n selectedItem,\n onItemLeave: handleItemLeave,\n itemTextRefCallback,\n focusSelectedItem,\n selectedItemText,\n position,\n isPositioned,\n searchRef,\n children: /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: context.open,\n onMountAutoFocus: (event) => {\n event.preventDefault();\n },\n onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {\n context.trigger?.focus({ preventScroll: true });\n event.preventDefault();\n }),\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: true,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: () => context.onOpenChange(false),\n children: /* @__PURE__ */ jsx(\n SelectPosition,\n {\n role: \"listbox\",\n id: context.contentId,\n \"data-state\": context.open ? \"open\" : \"closed\",\n dir: context.dir,\n onContextMenu: (event) => event.preventDefault(),\n ...contentProps,\n ...popperContentProps,\n onPlaced: () => setIsPositioned(true),\n ref: composedRefs,\n style: {\n // flex layout so we can place the scroll buttons properly\n display: \"flex\",\n flexDirection: \"column\",\n // reset the outline by default as the content MAY get focused\n outline: \"none\",\n ...contentProps.style\n },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);\n if ([\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\"].includes(event.key)) {\n const items = getItems().filter((item) => !item.disabled);\n let candidateNodes = items.map((item) => item.ref.current);\n if ([\"ArrowUp\", \"End\"].includes(event.key)) {\n candidateNodes = candidateNodes.slice().reverse();\n }\n if ([\"ArrowUp\", \"ArrowDown\"].includes(event.key)) {\n const currentElement = event.target;\n const currentIndex = candidateNodes.indexOf(currentElement);\n candidateNodes = candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n event.preventDefault();\n }\n })\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nSelectContentImpl.displayName = CONTENT_IMPL_NAME;\nvar ITEM_ALIGNED_POSITION_NAME = \"SelectItemAlignedPosition\";\nvar SelectItemAlignedPosition = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onPlaced, ...popperProps } = props;\n const context = useSelectContext(CONTENT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(CONTENT_NAME, __scopeSelect);\n const [contentWrapper, setContentWrapper] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const getItems = useCollection(__scopeSelect);\n const shouldExpandOnScrollRef = React.useRef(false);\n const shouldRepositionRef = React.useRef(true);\n const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;\n const position = React.useCallback(() => {\n if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {\n const triggerRect = context.trigger.getBoundingClientRect();\n const contentRect = content.getBoundingClientRect();\n const valueNodeRect = context.valueNode.getBoundingClientRect();\n const itemTextRect = selectedItemText.getBoundingClientRect();\n if (context.dir !== \"rtl\") {\n const itemTextOffset = itemTextRect.left - contentRect.left;\n const left = valueNodeRect.left - itemTextOffset;\n const leftDelta = triggerRect.left - left;\n const minContentWidth = triggerRect.width + leftDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const rightEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedLeft = clamp(left, [\n CONTENT_MARGIN,\n // Prevents the content from going off the starting edge of the\n // viewport. It may still go off the ending edge, but this can be\n // controlled by the user since they may want to manage overflow in a\n // specific way.\n // https://github.com/radix-ui/primitives/issues/2049\n Math.max(CONTENT_MARGIN, rightEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.left = clampedLeft + \"px\";\n } else {\n const itemTextOffset = contentRect.right - itemTextRect.right;\n const right = window.innerWidth - valueNodeRect.right - itemTextOffset;\n const rightDelta = window.innerWidth - triggerRect.right - right;\n const minContentWidth = triggerRect.width + rightDelta;\n const contentWidth = Math.max(minContentWidth, contentRect.width);\n const leftEdge = window.innerWidth - CONTENT_MARGIN;\n const clampedRight = clamp(right, [\n CONTENT_MARGIN,\n Math.max(CONTENT_MARGIN, leftEdge - contentWidth)\n ]);\n contentWrapper.style.minWidth = minContentWidth + \"px\";\n contentWrapper.style.right = clampedRight + \"px\";\n }\n const items = getItems();\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const itemsHeight = viewport.scrollHeight;\n const contentStyles = window.getComputedStyle(content);\n const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);\n const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);\n const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;\n const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);\n const viewportStyles = window.getComputedStyle(viewport);\n const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);\n const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);\n const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;\n const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;\n const selectedItemHalfHeight = selectedItem.offsetHeight / 2;\n const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;\n const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;\n const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;\n const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;\n if (willAlignWithoutTopOverflow) {\n const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current;\n contentWrapper.style.bottom = \"0px\";\n const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;\n const clampedTriggerMiddleToBottomEdge = Math.max(\n triggerMiddleToBottomEdge,\n selectedItemHalfHeight + // viewport might have padding bottom, include it to avoid a scrollable viewport\n (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth\n );\n const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;\n contentWrapper.style.height = height + \"px\";\n } else {\n const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current;\n contentWrapper.style.top = \"0px\";\n const clampedTopEdgeToTriggerMiddle = Math.max(\n topEdgeToTriggerMiddle,\n contentBorderTopWidth + viewport.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport\n (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight\n );\n const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;\n contentWrapper.style.height = height + \"px\";\n viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;\n }\n contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;\n contentWrapper.style.minHeight = minContentHeight + \"px\";\n contentWrapper.style.maxHeight = availableHeight + \"px\";\n onPlaced?.();\n requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);\n }\n }, [\n getItems,\n context.trigger,\n context.valueNode,\n contentWrapper,\n content,\n viewport,\n selectedItem,\n selectedItemText,\n context.dir,\n onPlaced\n ]);\n useLayoutEffect(() => position(), [position]);\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n const handleScrollButtonChange = React.useCallback(\n (node) => {\n if (node && shouldRepositionRef.current === true) {\n position();\n focusSelectedItem?.();\n shouldRepositionRef.current = false;\n }\n },\n [position, focusSelectedItem]\n );\n return /* @__PURE__ */ jsx(\n SelectViewportProvider,\n {\n scope: __scopeSelect,\n contentWrapper,\n shouldExpandOnScrollRef,\n onScrollButtonChange: handleScrollButtonChange,\n children: /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: setContentWrapper,\n style: {\n display: \"flex\",\n flexDirection: \"column\",\n position: \"fixed\",\n zIndex: contentZIndex\n },\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...popperProps,\n ref: composedRefs,\n style: {\n // When we get the height of the content, it includes borders. If we were to set\n // the height without having `boxSizing: 'border-box'` it would be too big.\n boxSizing: \"border-box\",\n // We need to ensure the content doesn't get taller than the wrapper\n maxHeight: \"100%\",\n ...popperProps.style\n }\n }\n )\n }\n )\n }\n );\n});\nSelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;\nvar POPPER_POSITION_NAME = \"SelectPopperPosition\";\nvar SelectPopperPosition = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeSelect,\n align = \"start\",\n collisionPadding = CONTENT_MARGIN,\n ...popperProps\n } = props;\n const popperScope = usePopperScope(__scopeSelect);\n return /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n ...popperScope,\n ...popperProps,\n ref: forwardedRef,\n align,\n collisionPadding,\n style: {\n // Ensure border-box for floating-ui calculations\n boxSizing: \"border-box\",\n ...popperProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-select-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-select-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-select-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-select-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-select-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nSelectPopperPosition.displayName = POPPER_POSITION_NAME;\nvar [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME, {});\nvar VIEWPORT_NAME = \"SelectViewport\";\nvar SelectViewport = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, nonce, ...viewportProps } = props;\n const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);\n const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);\n const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);\n const prevScrollTopRef = React.useRef(0);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n \"style\",\n {\n dangerouslySetInnerHTML: {\n __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`\n },\n nonce\n }\n ),\n /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeSelect, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-radix-select-viewport\": \"\",\n role: \"presentation\",\n ...viewportProps,\n ref: composedRefs,\n style: {\n // we use position: 'relative' here on the `viewport` so that when we call\n // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport\n // (independent of the scrollUpButton).\n position: \"relative\",\n flex: 1,\n // Viewport should only be scrollable in the vertical direction.\n // This won't work in vertical writing modes, so we'll need to\n // revisit this if/when that is supported\n // https://developer.chrome.com/blog/vertical-form-controls\n overflow: \"hidden auto\",\n ...viewportProps.style\n },\n onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {\n const viewport = event.currentTarget;\n const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;\n if (shouldExpandOnScrollRef?.current && contentWrapper) {\n const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);\n if (scrolledBy > 0) {\n const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;\n const cssMinHeight = parseFloat(contentWrapper.style.minHeight);\n const cssHeight = parseFloat(contentWrapper.style.height);\n const prevHeight = Math.max(cssMinHeight, cssHeight);\n if (prevHeight < availableHeight) {\n const nextHeight = prevHeight + scrolledBy;\n const clampedNextHeight = Math.min(availableHeight, nextHeight);\n const heightDiff = nextHeight - clampedNextHeight;\n contentWrapper.style.height = clampedNextHeight + \"px\";\n if (contentWrapper.style.bottom === \"0px\") {\n viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;\n contentWrapper.style.justifyContent = \"flex-end\";\n }\n }\n }\n }\n prevScrollTopRef.current = viewport.scrollTop;\n })\n }\n ) })\n ] });\n }\n);\nSelectViewport.displayName = VIEWPORT_NAME;\nvar GROUP_NAME = \"SelectGroup\";\nvar [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);\nvar SelectGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...groupProps } = props;\n const groupId = useId();\n return /* @__PURE__ */ jsx(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", \"aria-labelledby\": groupId, ...groupProps, ref: forwardedRef }) });\n }\n);\nSelectGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"SelectLabel\";\nvar SelectLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...labelProps } = props;\n const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);\n return /* @__PURE__ */ jsx(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });\n }\n);\nSelectLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"SelectItem\";\nvar [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);\nvar SelectItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeSelect,\n value,\n disabled = false,\n textValue: textValueProp,\n ...itemProps\n } = props;\n const context = useSelectContext(ITEM_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);\n const isSelected = context.value === value;\n const [textValue, setTextValue] = React.useState(textValueProp ?? \"\");\n const [isFocused, setIsFocused] = React.useState(false);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => contentContext.itemRefCallback?.(node, value, disabled)\n );\n const textId = useId();\n const pointerTypeRef = React.useRef(\"touch\");\n const handleSelect = () => {\n if (!disabled) {\n context.onValueChange(value);\n context.onOpenChange(false);\n }\n };\n if (value === \"\") {\n throw new Error(\n \"A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.\"\n );\n }\n return /* @__PURE__ */ jsx(\n SelectItemContextProvider,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textId,\n isSelected,\n onItemTextChange: React.useCallback((node) => {\n setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? \"\").trim());\n }, []),\n children: /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeSelect,\n value,\n disabled,\n textValue,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"option\",\n \"aria-labelledby\": textId,\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-selected\": isSelected && isFocused,\n \"data-state\": isSelected ? \"checked\" : \"unchecked\",\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n tabIndex: disabled ? void 0 : -1,\n ...itemProps,\n ref: composedRefs,\n onFocus: composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),\n onClick: composeEventHandlers(itemProps.onClick, () => {\n if (pointerTypeRef.current !== \"mouse\") handleSelect();\n }),\n onPointerUp: composeEventHandlers(itemProps.onPointerUp, () => {\n if (pointerTypeRef.current === \"mouse\") handleSelect();\n }),\n onPointerDown: composeEventHandlers(itemProps.onPointerDown, (event) => {\n pointerTypeRef.current = event.pointerType;\n }),\n onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {\n pointerTypeRef.current = event.pointerType;\n if (disabled) {\n contentContext.onItemLeave?.();\n } else if (pointerTypeRef.current === \"mouse\") {\n event.currentTarget.focus({ preventScroll: true });\n }\n }),\n onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {\n if (event.currentTarget === document.activeElement) {\n contentContext.onItemLeave?.();\n }\n }),\n onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef?.current !== \"\";\n if (isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) handleSelect();\n if (event.key === \" \") event.preventDefault();\n })\n }\n )\n }\n )\n }\n );\n }\n);\nSelectItem.displayName = ITEM_NAME;\nvar ITEM_TEXT_NAME = \"SelectItemText\";\nvar SelectItemText = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, className, style, ...itemTextProps } = props;\n const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);\n const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);\n const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);\n const [itemTextNode, setItemTextNode] = React.useState(null);\n const composedRefs = useComposedRefs(\n forwardedRef,\n (node) => setItemTextNode(node),\n itemContext.onItemTextChange,\n (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)\n );\n const textContent = itemTextNode?.textContent;\n const nativeOption = React.useMemo(\n () => /* @__PURE__ */ jsx(\"option\", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),\n [itemContext.disabled, itemContext.value, textContent]\n );\n const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;\n useLayoutEffect(() => {\n onNativeOptionAdd(nativeOption);\n return () => onNativeOptionRemove(nativeOption);\n }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),\n itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM.createPortal(itemTextProps.children, context.valueNode) : null\n ] });\n }\n);\nSelectItemText.displayName = ITEM_TEXT_NAME;\nvar ITEM_INDICATOR_NAME = \"SelectItemIndicator\";\nvar SelectItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...itemIndicatorProps } = props;\n const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);\n return itemContext.isSelected ? /* @__PURE__ */ jsx(Primitive.span, { \"aria-hidden\": true, ...itemIndicatorProps, ref: forwardedRef }) : null;\n }\n);\nSelectItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SCROLL_UP_BUTTON_NAME = \"SelectScrollUpButton\";\nvar SelectScrollUpButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);\n const [canScrollUp, setCanScrollUp] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const canScrollUp2 = viewport.scrollTop > 0;\n setCanScrollUp(canScrollUp2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollUp ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;\nvar SCROLL_DOWN_BUTTON_NAME = \"SelectScrollDownButton\";\nvar SelectScrollDownButton = React.forwardRef((props, forwardedRef) => {\n const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);\n const [canScrollDown, setCanScrollDown] = React.useState(false);\n const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);\n useLayoutEffect(() => {\n if (contentContext.viewport && contentContext.isPositioned) {\n let handleScroll2 = function() {\n const maxScroll = viewport.scrollHeight - viewport.clientHeight;\n const canScrollDown2 = Math.ceil(viewport.scrollTop) < maxScroll;\n setCanScrollDown(canScrollDown2);\n };\n var handleScroll = handleScroll2;\n const viewport = contentContext.viewport;\n handleScroll2();\n viewport.addEventListener(\"scroll\", handleScroll2);\n return () => viewport.removeEventListener(\"scroll\", handleScroll2);\n }\n }, [contentContext.viewport, contentContext.isPositioned]);\n return canScrollDown ? /* @__PURE__ */ jsx(\n SelectScrollButtonImpl,\n {\n ...props,\n ref: composedRefs,\n onAutoScroll: () => {\n const { viewport, selectedItem } = contentContext;\n if (viewport && selectedItem) {\n viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;\n }\n }\n }\n ) : null;\n});\nSelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;\nvar SelectScrollButtonImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;\n const contentContext = useSelectContentContext(\"SelectScrollButton\", __scopeSelect);\n const autoScrollTimerRef = React.useRef(null);\n const getItems = useCollection(__scopeSelect);\n const clearAutoScrollTimer = React.useCallback(() => {\n if (autoScrollTimerRef.current !== null) {\n window.clearInterval(autoScrollTimerRef.current);\n autoScrollTimerRef.current = null;\n }\n }, []);\n React.useEffect(() => {\n return () => clearAutoScrollTimer();\n }, [clearAutoScrollTimer]);\n useLayoutEffect(() => {\n const activeItem = getItems().find((item) => item.ref.current === document.activeElement);\n activeItem?.ref.current?.scrollIntoView({ block: \"nearest\" });\n }, [getItems]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-hidden\": true,\n ...scrollIndicatorProps,\n ref: forwardedRef,\n style: { flexShrink: 0, ...scrollIndicatorProps.style },\n onPointerDown: composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {\n contentContext.onItemLeave?.();\n if (autoScrollTimerRef.current === null) {\n autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);\n }\n }),\n onPointerLeave: composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {\n clearAutoScrollTimer();\n })\n }\n );\n});\nvar SEPARATOR_NAME = \"SelectSeparator\";\nvar SelectSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { \"aria-hidden\": true, ...separatorProps, ref: forwardedRef });\n }\n);\nSelectSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"SelectArrow\";\nvar SelectArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeSelect, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeSelect);\n const context = useSelectContext(ARROW_NAME, __scopeSelect);\n const contentContext = useSelectContentContext(ARROW_NAME, __scopeSelect);\n return context.open && contentContext.position === \"popper\" ? /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef }) : null;\n }\n);\nSelectArrow.displayName = ARROW_NAME;\nfunction shouldShowPlaceholder(value) {\n return value === \"\" || value === void 0;\n}\nvar BubbleSelect = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...selectProps } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const prevValue = usePrevious(value);\n React.useEffect(() => {\n const select = ref.current;\n const selectProto = window.HTMLSelectElement.prototype;\n const descriptor = Object.getOwnPropertyDescriptor(\n selectProto,\n \"value\"\n );\n const setValue = descriptor.set;\n if (prevValue !== value && setValue) {\n const event = new Event(\"change\", { bubbles: true });\n setValue.call(select, value);\n select.dispatchEvent(event);\n }\n }, [prevValue, value]);\n return /* @__PURE__ */ jsx(VisuallyHidden, { asChild: true, children: /* @__PURE__ */ jsx(\"select\", { ...selectProps, ref: composedRefs, defaultValue: value }) });\n }\n);\nBubbleSelect.displayName = \"BubbleSelect\";\nfunction useTypeaheadSearch(onSearchChange) {\n const handleSearchChange = useCallbackRef(onSearchChange);\n const searchRef = React.useRef(\"\");\n const timerRef = React.useRef(0);\n const handleTypeaheadSearch = React.useCallback(\n (key) => {\n const search = searchRef.current + key;\n handleSearchChange(search);\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n },\n [handleSearchChange]\n );\n const resetTypeahead = React.useCallback(() => {\n searchRef.current = \"\";\n window.clearTimeout(timerRef.current);\n }, []);\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n return [searchRef, handleTypeaheadSearch, resetTypeahead];\n}\nfunction findNextItem(items, search, currentItem) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;\n let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));\n const excludeCurrentItem = normalizedSearch.length === 1;\n if (excludeCurrentItem) wrappedItems = wrappedItems.filter((v) => v !== currentItem);\n const nextItem = wrappedItems.find(\n (item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextItem !== currentItem ? nextItem : void 0;\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root2 = Select;\nvar Trigger = SelectTrigger;\nvar Value = SelectValue;\nvar Icon = SelectIcon;\nvar Portal = SelectPortal;\nvar Content2 = SelectContent;\nvar Viewport = SelectViewport;\nvar Group = SelectGroup;\nvar Label = SelectLabel;\nvar Item = SelectItem;\nvar ItemText = SelectItemText;\nvar ItemIndicator = SelectItemIndicator;\nvar ScrollUpButton = SelectScrollUpButton;\nvar ScrollDownButton = SelectScrollDownButton;\nvar Separator = SelectSeparator;\nvar Arrow2 = SelectArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Group,\n Icon,\n Item,\n ItemIndicator,\n ItemText,\n Label,\n Portal,\n Root2 as Root,\n ScrollDownButton,\n ScrollUpButton,\n Select,\n SelectArrow,\n SelectContent,\n SelectGroup,\n SelectIcon,\n SelectItem,\n SelectItemIndicator,\n SelectItemText,\n SelectLabel,\n SelectPortal,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n SelectViewport,\n Separator,\n Trigger,\n Value,\n Viewport,\n createSelectScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from 'react'\nimport * as SelectPrimitive from '@radix-ui/react-select'\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react'\n\nimport { cn } from '@lib/utils'\n\nconst Select = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef & { compact?: boolean }\n>(({ className, children, compact = false, ...props }, ref) => (\n \n {children}\n \n \n \n \n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n \n \n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, position = 'popper', ...props }, ref) => (\n \n \n \n \n {children}\n \n \n \n \n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, children, ...props }, ref) => (\n \n \n \n \n \n \n\n {children}\n \n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ElementRef,\n React.ComponentPropsWithoutRef\n>(({ className, ...props }, ref) => (\n \n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton\n}\n"],"names":["ChevronUp","createLucideIcon","clamp","value","min","max","OPEN_KEYS","SELECTION_KEYS","SELECT_NAME","Collection","useCollection","createCollectionScope","createCollection","createSelectContext","createSelectScope","createContextScope","createPopperScope","usePopperScope","SelectProvider","useSelectContext","SelectNativeOptionsProvider","useSelectNativeOptionsContext","Select","props","__scopeSelect","children","openProp","defaultOpen","onOpenChange","valueProp","defaultValue","onValueChange","dir","name","autoComplete","disabled","required","form","popperScope","trigger","setTrigger","React.useState","valueNode","setValueNode","valueNodeHasChildren","setValueNodeHasChildren","direction","useDirection","open","setOpen","useControllableState","setValue","triggerPointerDownPosRef","React.useRef","isFormControl","nativeOptionsSet","setNativeOptionsSet","nativeSelectKey","option","jsx","PopperPrimitive.Root","jsxs","useId","React.useCallback","prev","optionsSet","BubbleSelect","event","TRIGGER_NAME","SelectTrigger","React.forwardRef","forwardedRef","triggerProps","context","isDisabled","composedRefs","useComposedRefs","getItems","pointerTypeRef","searchRef","handleTypeaheadSearch","resetTypeahead","useTypeaheadSearch","search","enabledItems","item","currentItem","nextItem","findNextItem","handleOpen","pointerEvent","PopperPrimitive.Anchor","Primitive","shouldShowPlaceholder","composeEventHandlers","target","isTypingAhead","VALUE_NAME","SelectValue","className","style","placeholder","valueProps","onValueNodeHasChildrenChange","hasChildren","useLayoutEffect","Fragment","ICON_NAME","SelectIcon","iconProps","PORTAL_NAME","SelectPortal","PortalPrimitive","CONTENT_NAME","SelectContent","fragment","setFragment","frag","ReactDOM.createPortal","SelectContentProvider","SelectContentImpl","CONTENT_MARGIN","useSelectContentContext","CONTENT_IMPL_NAME","position","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","contentProps","content","setContent","viewport","setViewport","node","selectedItem","setSelectedItem","selectedItemText","setSelectedItemText","isPositioned","setIsPositioned","firstValidItemFoundRef","React.useEffect","hideOthers","useFocusGuards","focusFirst","candidates","firstItem","restItems","lastItem","PREVIOUSLY_FOCUSED_ELEMENT","candidate","focusSelectedItem","pointerMoveDelta","handlePointerMove","handlePointerUp","close","itemRefCallback","isFirstValidItem","handleItemLeave","itemTextRefCallback","SelectPosition","SelectPopperPosition","SelectItemAlignedPosition","popperContentProps","RemoveScroll","Slot","FocusScope","DismissableLayer","isModifierKey","candidateNodes","currentElement","currentIndex","ITEM_ALIGNED_POSITION_NAME","onPlaced","popperProps","contentContext","contentWrapper","setContentWrapper","shouldExpandOnScrollRef","shouldRepositionRef","triggerRect","contentRect","valueNodeRect","itemTextRect","itemTextOffset","left","leftDelta","minContentWidth","contentWidth","rightEdge","clampedLeft","right","rightDelta","leftEdge","clampedRight","items","availableHeight","itemsHeight","contentStyles","contentBorderTopWidth","contentPaddingTop","contentBorderBottomWidth","contentPaddingBottom","fullContentHeight","minContentHeight","viewportStyles","viewportPaddingTop","viewportPaddingBottom","topEdgeToTriggerMiddle","triggerMiddleToBottomEdge","selectedItemHalfHeight","itemOffsetMiddle","contentTopToItemMiddle","itemMiddleToContentBottom","isLastItem","viewportOffsetBottom","clampedTriggerMiddleToBottomEdge","height","isFirstItem","contentZIndex","setContentZIndex","handleScrollButtonChange","SelectViewportProvider","POPPER_POSITION_NAME","PopperPrimitive.Content","useSelectViewportContext","VIEWPORT_NAME","SelectViewport","nonce","viewportProps","viewportContext","prevScrollTopRef","scrolledBy","cssMinHeight","cssHeight","prevHeight","nextHeight","clampedNextHeight","heightDiff","GROUP_NAME","SelectGroupContextProvider","useSelectGroupContext","SelectGroup","groupProps","groupId","LABEL_NAME","SelectLabel","labelProps","groupContext","ITEM_NAME","SelectItemContextProvider","useSelectItemContext","SelectItem","textValueProp","itemProps","isSelected","textValue","setTextValue","isFocused","setIsFocused","textId","handleSelect","prevTextValue","ITEM_TEXT_NAME","SelectItemText","itemTextProps","itemContext","nativeOptionsContext","itemTextNode","setItemTextNode","textContent","nativeOption","React.useMemo","onNativeOptionAdd","onNativeOptionRemove","ITEM_INDICATOR_NAME","SelectItemIndicator","itemIndicatorProps","SCROLL_UP_BUTTON_NAME","SelectScrollUpButton","canScrollUp","setCanScrollUp","handleScroll2","canScrollUp2","SelectScrollButtonImpl","SCROLL_DOWN_BUTTON_NAME","SelectScrollDownButton","canScrollDown","setCanScrollDown","maxScroll","canScrollDown2","onAutoScroll","scrollIndicatorProps","autoScrollTimerRef","clearAutoScrollTimer","SEPARATOR_NAME","SelectSeparator","separatorProps","ARROW_NAME","SelectArrow","arrowProps","PopperPrimitive.Arrow","selectProps","ref","prevValue","usePrevious","select","selectProto","VisuallyHidden","onSearchChange","handleSearchChange","useCallbackRef","timerRef","key","updateSearch","normalizedSearch","char","currentItemIndex","wrappedItems","wrapArray","v","array","startIndex","_","index","Root2","Trigger","Value","Icon","Portal","Content2","Viewport","Label","Item","ItemText","ItemIndicator","ScrollUpButton","ScrollDownButton","Separator","SelectPrimitive.Root","SelectPrimitive.Value","compact","SelectPrimitive.Trigger","cn","SelectPrimitive.Icon","ChevronDown","SelectPrimitive.ScrollUpButton","SelectPrimitive.ScrollDownButton","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Viewport","SelectPrimitive.Label","SelectPrimitive.Item","SelectPrimitive.ItemIndicator","Check","SelectPrimitive.ItemText","SelectPrimitive.Separator"],"mappings":"8pCAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,GAAYC,GAAiB,YAAa,CAAC,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAQ,CAAE,CAAC,CAAC,ECRlG,SAASC,GAAMC,EAAO,CAACC,EAAKC,CAAG,EAAG,CAChC,OAAO,KAAK,IAAIA,EAAK,KAAK,IAAID,EAAKD,CAAK,CAAC,CAC3C,CCyBA,IAAIG,GAAY,CAAC,IAAK,QAAS,UAAW,WAAW,EACjDC,GAAiB,CAAC,IAAK,OAAO,EAC9BC,GAAc,SACd,CAACC,GAAYC,GAAeC,EAAqB,EAAIC,GAAiBJ,EAAW,EACjF,CAACK,GAAqBC,EAAiB,EAAIC,GAAmBP,GAAa,CAC7EG,GACAK,EACF,CAAC,EACGC,GAAiBD,GAAiB,EAClC,CAACE,GAAgBC,CAAgB,EAAIN,GAAoBL,EAAW,EACpE,CAACY,GAA6BC,EAA6B,EAAIR,GAAoBL,EAAW,EAC9Fc,GAAUC,GAAU,CACtB,KAAM,CACJ,cAAAC,EACA,SAAAC,EACA,KAAMC,EACN,YAAAC,EACA,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