{"version":3,"names":["createEffect","createMemo","createSignal","onCleanup","untrack","useBaseUiId","createChangeEventDetails","REASONS","createControlledState","FloatingTree","useFloatingParentNodeId","useClick","useDismiss","useFloatingRootContext","useInteractions","useListNavigation","useTypeahead","readOption","useOpenChangeComplete","useOpenInteractionType","useTransitionStatus","VISUALLY_HIDDEN_STYLE","createSelect","SelectRootContext","useSelectRootContext","defaultItemEquality","findItemIndex","stringifyAsLabel","stringifyAsValue","SelectRootComponent","props","multiple","modal","disabled","readOnly","required","highlightItemOnHover","itemToStringLabel","itemToStringValue","isItemEqualToValue","items","name","generatedId","id","resolvedValue","setUncontrolledValue","controlled","value","default","defaultValue","fallback","state","resolvedOpen","setUncontrolledOpen","open","undefined","Boolean","defaultOpen","_primitive","activeIndex","setActiveIndex","ownedWrite","selectedIndex","setSelectedIndex","labelId","setLabelId","triggerElement","setTriggerElement","listElement","setListElement","popupRef","current","valueRef","selectedItemTextRef","listRef","labelsRef","valuesRef","typingRef","initialValueRef","mounted","transitionStatus","setMounted","scrollUpArrowVisible","setScrollUpArrowVisible","scrollDownArrowVisible","setScrollDownArrowVisible","scrollArrowsMountedCountRef","scrollHandlerRef","handleScrollArrowVisibilityRef","handleScrollArrowVisibility","keyboardActiveRef","selectionRef","allowSelectedMouseUp","allowUnselectedMouseUp","openMethod","ref","onComplete","onOpenChangeComplete","isMounted","isOpen","currentValue","equals","registry","cv","Array","isArray","length","last","idx","setOpen","next","details","onOpenChange","isCanceled","setValue","onValueChange","floatingRootContext","nextOpen","openValue","trigger","status","update","referenceElement","domReferenceElement","click","enabled","event","dismiss","bubbles","listNavigation","focusItemOnHover","onNavigate","nextActiveIndex","typeahead","onMatch","index","nextValue","none","onTypingChange","typing","interactions","handleUnmount","actions","unmount","actionsRef","serializedValue","v","multipleSerialized","map","x","hasMultipleSelection","hiddenInputName","handleAutofill","target","currentTarget","matching","find","candidate","candidateValue","toLowerCase","candidateLabel","setInputRef","el","r","inputRef","contextValue","children","form","autoComplete","focus","MultipleHiddenInputs","values","SelectRoot"],"sources":["select-root.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n/**\n * `<Select.Root>` — Solid 2 port of Base UI React's `SelectRoot`\n * (`packages/react/src/select/root/SelectRoot.tsx`).\n *\n * Owns the select's open/value state (controlled + uncontrolled), wires\n * `useInteractions` with click + dismiss + list-navigation + typeahead,\n * manages highlighting (`activeIndex`) + selection (`selectedIndex`)\n * independently, and writes a hidden `<input>` (or multiple hidden inputs\n * when `multiple`) for native form participation.\n *\n * ### React → Solid deviations\n *\n * - The React source's store + selectors pair is replaced by plain\n *   signals — Solid's fine-grained reactivity + context gives the same\n *   subscribe-where-you-care ergonomics. The signals live under the root\n *   context.\n * - `useOpenInteractionType` is not yet wired; `openMethod` is omitted\n *   from the port (no touch/keyboard differentiation inside the popup).\n *   Deferred along with the align-item-with-trigger math.\n * - `alignItemWithTrigger` popup trigger-aligned placement is deferred —\n *   the complex scroll-arrow + max-height geometry isn't exercisable in\n *   happy-dom.\n * - `useOnFirstRender` stamping of `popupProps` / `triggerProps` maps to\n *   the root context exposing interaction getters directly — parts read\n *   them inside their own reactive scopes.\n */\n\nimport {\n\ttype Accessor,\n\tcreateEffect,\n\tcreateMemo,\n\tcreateSignal,\n\tonCleanup,\n\tuntrack,\n} from \"solid-js\";\nimport { useBaseUiId } from \"../../internals/base-ui-id\";\nimport {\n\tcreateChangeEventDetails,\n\tREASONS,\n} from \"../../internals/change-event-details\";\nimport { createControlledState } from \"../../internals/create-controlled-state\";\nimport {\n\tFloatingTree,\n\tuseFloatingParentNodeId,\n} from \"../../internals/floating-ui/components/floating-tree\";\nimport { useClick } from \"../../internals/floating-ui/hooks/use-click\";\nimport { useDismiss } from \"../../internals/floating-ui/hooks/use-dismiss\";\nimport { useFloatingRootContext } from \"../../internals/floating-ui/hooks/use-floating-root-context\";\nimport { useInteractions } from \"../../internals/floating-ui/hooks/use-interactions\";\nimport { useListNavigation } from \"../../internals/floating-ui/hooks/use-list-navigation\";\nimport { useTypeahead } from \"../../internals/floating-ui/hooks/use-typeahead\";\nimport type { MutableRef } from \"../../internals/floating-ui/types\";\nimport { type MaybeAccessor, readOption } from \"../../internals/maybe-accessor\";\nimport { useOpenChangeComplete } from \"../../internals/popups/use-open-change-complete\";\nimport { useOpenInteractionType } from \"../../internals/popups/use-open-interaction-type\";\nimport { useTransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport { VISUALLY_HIDDEN_STYLE } from \"../../internals/visually-hidden-style\";\nimport { createSelect } from \"../create-select\";\nimport {\n\ttype SelectRootChangeEventDetails,\n\ttype SelectRootChangeEventReason,\n\tSelectRootContext,\n\ttype SelectRootContextValue,\n\ttype SelectSelectionGuard,\n\ttype SelectValue,\n\tuseSelectRootContext,\n} from \"../select-root-context\";\nimport { defaultItemEquality, findItemIndex } from \"../utils/item-equality\";\nimport {\n\ttype ItemsInput,\n\tstringifyAsLabel,\n\tstringifyAsValue,\n} from \"../utils/resolve-value-label\";\n\nexport type { SelectRootChangeEventDetails, SelectRootChangeEventReason };\n\n/**\n * Imperative actions written into `actionsRef` on `<Select.Root>`. Mirrors\n * React's `SelectRoot.Actions` — only `unmount()` is exposed (close is\n * reserved via `onOpenChange`).\n */\nexport interface SelectRootActions {\n\tunmount: () => void;\n}\n\nexport interface SelectRootProps<\n\tValue = SelectValue,\n\tMultiple extends boolean | undefined = false,\n> {\n\t/** The id of the Select. */\n\tid?: string | undefined;\n\t/** Field name for form submission. */\n\tname?: string | undefined;\n\t/** Form id for the hidden input. */\n\tform?: string | undefined;\n\t/** Autocomplete hint. */\n\tautoComplete?: string | undefined;\n\t/** Whether the user must choose a value before submitting. */\n\trequired?: MaybeAccessor<boolean | undefined>;\n\t/** Whether the user can change the selection. */\n\treadOnly?: MaybeAccessor<boolean | undefined>;\n\t/** Whether the component ignores interaction. */\n\tdisabled?: MaybeAccessor<boolean | undefined>;\n\t/** Whether multiple items may be selected. */\n\tmultiple?: Multiple | undefined;\n\t/** Whether hovering an item highlights it. */\n\thighlightItemOnHover?: boolean | undefined;\n\t/**\n\t * Controlled open state. When provided (resolved value not\n\t * `undefined`), the consumer owns the state — pair with\n\t * {@link onOpenChange}. When omitted, the select manages its own open\n\t * state (seeded from {@link defaultOpen}).\n\t */\n\topen?: MaybeAccessor<boolean | undefined>;\n\t/**\n\t * Initial open state when uncontrolled. Read once at mount.\n\t * @default false\n\t */\n\tdefaultOpen?: MaybeAccessor<boolean | undefined>;\n\t/**\n\t * Fires on every open/close request. Calling `eventDetails.cancel()`\n\t * keeps the select's own (uncontrolled) state unchanged, mirroring\n\t * React Base UI; controlled consumers simply don't update their signal.\n\t */\n\tonOpenChange?:\n\t\t| ((open: boolean, eventDetails: SelectRootChangeEventDetails) => void)\n\t\t| undefined;\n\t/** Called after open/close transitions settle. */\n\tonOpenChangeComplete?: ((open: boolean) => void) | undefined;\n\t/** Modal mode — locks outside interaction while open. @default true */\n\tmodal?: boolean | undefined;\n\t/**\n\t * Controlled value (scalar for single; array for multiple). When\n\t * provided (resolved value not `undefined` — `null` counts as\n\t * controlled), the consumer owns the state — pair with\n\t * {@link onValueChange}. When omitted, the select manages its own\n\t * value (seeded from {@link defaultValue}).\n\t */\n\tvalue?: MaybeAccessor<SelectValueType<Value, Multiple> | null | undefined>;\n\t/**\n\t * Initial value when uncontrolled. Read once at mount.\n\t * @default null (normalized to `[]` when `multiple`)\n\t */\n\tdefaultValue?: MaybeAccessor<\n\t\tSelectValueType<Value, Multiple> | null | undefined\n\t>;\n\t/**\n\t * Fires on every selection request. Calling `eventDetails.cancel()`\n\t * keeps the select's own (uncontrolled) value unchanged, mirroring\n\t * React Base UI; controlled consumers simply don't update their signal.\n\t */\n\tonValueChange?:\n\t\t| ((\n\t\t\t\tvalue:\n\t\t\t\t\t| SelectValueType<Value, Multiple>\n\t\t\t\t\t| (Multiple extends true ? never : null),\n\t\t\t\teventDetails: SelectRootChangeEventDetails,\n\t\t  ) => void)\n\t\t| undefined;\n\t/**\n\t * Imperative actions — callback-ref shape (React uses RefObject).\n\t */\n\tactionsRef?:\n\t\t| ((actions: SelectRootActions | null) => void)\n\t\t| { current: SelectRootActions | null }\n\t\t| undefined;\n\t/** Ref to the hidden input. */\n\tinputRef?:\n\t\t| ((el: HTMLInputElement | null) => void)\n\t\t| { current: HTMLInputElement | null }\n\t\t| undefined;\n\t/** Items registry — drives trigger label resolution for object values. */\n\titems?: MaybeAccessor<ItemsInput<Value>>;\n\t/** Formatter for object values (trigger display). */\n\titemToStringLabel?: ((value: Value) => string) | undefined;\n\t/** Formatter for object values (form submission). */\n\titemToStringValue?: ((value: Value) => string) | undefined;\n\t/** Custom equality comparer. */\n\tisItemEqualToValue?:\n\t\t| ((itemValue: Value, value: Value) => boolean)\n\t\t| undefined;\n\t/** Children. */\n\tchildren?: JSX.Element;\n}\n\ntype SelectValueType<\n\tValue,\n\tMultiple extends boolean | undefined,\n> = Multiple extends true ? Value[] : Value;\n\nfunction SelectRootComponent<\n\tValue = SelectValue,\n\tMultiple extends boolean | undefined = false,\n>(props: SelectRootProps<Value, Multiple>): JSX.Element {\n\tconst multiple = (): boolean => props.multiple ?? false;\n\tconst modal = (): boolean => props.modal ?? true;\n\tconst disabled = (): boolean => readOption(props.disabled) ?? false;\n\tconst readOnly = (): boolean => readOption(props.readOnly) ?? false;\n\tconst required = (): boolean => readOption(props.required) ?? false;\n\tconst highlightItemOnHover = (): boolean =>\n\t\tprops.highlightItemOnHover ?? true;\n\tconst itemToStringLabel = (): ((value: Value) => string) | undefined =>\n\t\tprops.itemToStringLabel;\n\tconst itemToStringValue = (): ((value: Value) => string) | undefined =>\n\t\tprops.itemToStringValue;\n\tconst isItemEqualToValue = (): ((a: unknown, b: unknown) => boolean) =>\n\t\t(props.isItemEqualToValue ?? defaultItemEquality) as (\n\t\t\ta: unknown,\n\t\t\tb: unknown,\n\t\t) => boolean;\n\tconst items = (): ItemsInput<SelectValue> =>\n\t\treadOption(props.items) as ItemsInput<SelectValue>;\n\tconst name = (): string | undefined => props.name;\n\n\tconst generatedId = useBaseUiId(props.id);\n\n\t// Controlled / uncontrolled state (Base UI `useControlled` contract,\n\t// applied to BOTH axes like React's `SelectRoot`):\n\t// - `value` is controlled while its resolved value is not `undefined` —\n\t//   `value={null}` IS controlled (Base UI semantics). The uncontrolled\n\t//   fallback is `null`; the createSelect primitive normalizes `null` to\n\t//   `[]` in multiple mode (matching React's\n\t//   `multiple ? defaultValue ?? EMPTY_ARRAY : defaultValue`).\n\t// - `open` is controlled while its resolved value is not `undefined`,\n\t//   otherwise backed by an internal signal seeded from `defaultOpen`.\n\tconst [resolvedValue, setUncontrolledValue] = createControlledState<unknown>({\n\t\tcontrolled: () => readOption(props.value) as unknown,\n\t\tdefault: () => readOption(props.defaultValue) as unknown,\n\t\tfallback: null,\n\t\tname: \"<Select.Root>\",\n\t\tstate: \"value\",\n\t});\n\n\tconst [resolvedOpen, setUncontrolledOpen] = createControlledState<boolean>({\n\t\tcontrolled: () => {\n\t\t\tconst controlled = readOption(props.open);\n\t\t\treturn controlled === undefined ? undefined : Boolean(controlled);\n\t\t},\n\t\tdefault: () => readOption(props.defaultOpen),\n\t\tfallback: false,\n\t\tname: \"<Select.Root>\",\n\t\tstate: \"open\",\n\t});\n\n\t// Logical state delegated to the createSelect primitive.\n\t// The primitive owns: value/open normalisation + isItemSelected + valueLabel.\n\t// The wrapper adds: floating-ui, keyboard nav, hidden form inputs, scroll arrows.\n\tconst _primitive = createSelect({\n\t\tvalue: resolvedValue,\n\t\topen: resolvedOpen,\n\t\tmultiple: props.multiple as boolean | undefined,\n\t\tdisabled: () => Boolean(readOption(props.disabled)),\n\t\treadOnly: () => Boolean(readOption(props.readOnly)),\n\t\trequired: () => Boolean(readOption(props.required)),\n\t\titems: () => readOption(props.items) as ItemsInput<unknown> | undefined,\n\t\titemToStringLabel: () =>\n\t\t\tprops.itemToStringLabel as ((v: unknown) => string) | undefined,\n\t\titemToStringValue: () =>\n\t\t\tprops.itemToStringValue as ((v: unknown) => string) | undefined,\n\t\tisItemEqualToValue: () =>\n\t\t\tprops.isItemEqualToValue as\n\t\t\t\t| ((a: unknown, b: unknown) => boolean)\n\t\t\t\t| undefined,\n\t});\n\n\t// Value — reads from the primitive (handles multi-select empty-array default).\n\tconst value = _primitive.value as Accessor<SelectValue>;\n\n\t// Open — reads from the primitive.\n\tconst open = _primitive.open;\n\n\t// Highlighted + selected index. They're independent — the highlight\n\t// drives keyboard navigation whereas the selection reflects the stored\n\t// value.\n\tconst [activeIndex, setActiveIndex] = createSignal<number | null>(null, {\n\t\townedWrite: true,\n\t});\n\tconst [selectedIndex, setSelectedIndex] = createSignal<number | null>(null, {\n\t\townedWrite: true,\n\t});\n\n\t// Label id — wired up via useRegisteredLabelId when Select.Label lands.\n\tconst [labelId, setLabelId] = createSignal<string | undefined>(undefined, {\n\t\townedWrite: true,\n\t});\n\n\t// Element slots.\n\tconst [triggerElement, setTriggerElement] = createSignal<HTMLElement | null>(\n\t\tnull,\n\t\t{ ownedWrite: true },\n\t);\n\tconst [listElement, setListElement] = createSignal<HTMLElement | null>(null, {\n\t\townedWrite: true,\n\t});\n\tconst popupRef: MutableRef<HTMLElement | null> = { current: null };\n\tconst valueRef: MutableRef<HTMLElement | null> = { current: null };\n\tconst selectedItemTextRef: MutableRef<HTMLElement | null> = {\n\t\tcurrent: null,\n\t};\n\tconst listRef: MutableRef<Array<HTMLElement | null>> = { current: [] };\n\tconst labelsRef: MutableRef<Array<string | null>> = { current: [] };\n\t// biome-ignore lint/suspicious/noExplicitAny: values registry indexes by position; typed as `any` to match React's surface.\n\tconst valuesRef: MutableRef<any[]> = { current: [] };\n\tconst typingRef: MutableRef<boolean> = { current: false };\n\t// biome-ignore lint/suspicious/noExplicitAny: initial value holder mirrors React's ref.\n\tconst initialValueRef: MutableRef<any> = { current: untrack(value) };\n\n\t// Mount / transition machinery.\n\tconst { mounted, transitionStatus, setMounted } = useTransitionStatus(\n\t\topen,\n\t\t() => true,\n\t\t() => false,\n\t);\n\n\t// Scroll-arrow visibility signals — written by the popup's trigger-aligned\n\t// geometry effect.\n\tconst [scrollUpArrowVisible, setScrollUpArrowVisible] = createSignal(false, {\n\t\townedWrite: true,\n\t});\n\tconst [scrollDownArrowVisible, setScrollDownArrowVisible] = createSignal(\n\t\tfalse,\n\t\t{ ownedWrite: true },\n\t);\n\tconst scrollArrowsMountedCountRef: MutableRef<number> = { current: 0 };\n\n\t// Filled by the popup's geometry effect on initial placement; called from\n\t// items / positioner to re-probe scroll edges after list mutations. React\n\t// stores this on `handleScrollArrowVisibility` via `useStableCallback`; we\n\t// use a plain ref so updates don't require re-running consumers.\n\tconst scrollHandlerRef: MutableRef<(scroller: HTMLElement) => void> = {\n\t\tcurrent: () => {},\n\t};\n\tconst handleScrollArrowVisibilityRef: MutableRef<() => void> = {\n\t\tcurrent: () => {},\n\t};\n\tconst handleScrollArrowVisibility = (): void => {\n\t\thandleScrollArrowVisibilityRef.current();\n\t};\n\n\t// Most-recent-interaction flags (keyboard vs. mouse). Written from the\n\t// popup's onKeyDown / onMouseMove + trigger's onKeyDown / onPointerMove.\n\tconst keyboardActiveRef: MutableRef<boolean> = { current: false };\n\n\t// Selection-window guard. Flips to `true` on a delay after open — mirrors\n\t// React's `SelectTrigger` behavior.\n\tconst selectionRef: MutableRef<SelectSelectionGuard> = {\n\t\tcurrent: { allowSelectedMouseUp: false, allowUnselectedMouseUp: false },\n\t};\n\n\t// Capture the interaction type that opened the popup. `openMethod` is\n\t// `null` while closed, `'mouse' | 'keyboard' | 'touch' | 'pen' | ''` after\n\t// the opening interaction.\n\tconst { openMethod } = useOpenInteractionType(open);\n\n\t// Deferred unmount — waits for any CSS exit animation on the popup.\n\tuseOpenChangeComplete({\n\t\topen,\n\t\tref: popupRef,\n\t\tonComplete: () => {\n\t\t\tif (!open()) {\n\t\t\t\tsetMounted(false);\n\t\t\t\tsetActiveIndex(null);\n\t\t\t\tprops.onOpenChangeComplete?.(false);\n\t\t\t} else {\n\t\t\t\tprops.onOpenChangeComplete?.(true);\n\t\t\t}\n\t\t},\n\t});\n\n\t// Reset trigger-aligned state when the popup unmounts. Mirrors React's\n\t// `<Select.Positioner>` layout-effect which clears scroll-arrow flags\n\t// when `mounted` flips to false, and the trigger-side reset for\n\t// selectionRef when `open` flips to false.\n\tcreateEffect(\n\t\t() => mounted(),\n\t\t(isMounted) => {\n\t\t\tif (!isMounted) {\n\t\t\t\tsetScrollUpArrowVisible(false);\n\t\t\t\tsetScrollDownArrowVisible(false);\n\t\t\t}\n\t\t},\n\t);\n\tcreateEffect(\n\t\t() => open(),\n\t\t(isOpen) => {\n\t\t\tif (!isOpen) {\n\t\t\t\tselectionRef.current = {\n\t\t\t\t\tallowSelectedMouseUp: false,\n\t\t\t\t\tallowUnselectedMouseUp: false,\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t);\n\n\t// Sync selectedIndex when open=false or the value changes — mirrors\n\t// React's `syncSelectedIndex` layout effect.\n\tcreateEffect(\n\t\t() => ({\n\t\t\tisOpen: open(),\n\t\t\tcurrentValue: value(),\n\t\t\tequals: isItemEqualToValue(),\n\t\t}),\n\t\t({ isOpen, currentValue, equals }) => {\n\t\t\tif (isOpen) return;\n\t\t\tconst registry = valuesRef.current;\n\t\t\tif (multiple()) {\n\t\t\t\tconst cv = Array.isArray(currentValue) ? currentValue : [];\n\t\t\t\tif (cv.length === 0) {\n\t\t\t\t\tsetSelectedIndex(null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst last = cv[cv.length - 1];\n\t\t\t\tconst idx = findItemIndex(registry, last, equals);\n\t\t\t\tsetSelectedIndex(idx === -1 ? null : idx);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst idx = findItemIndex(registry, currentValue, equals);\n\t\t\tsetSelectedIndex(idx === -1 ? null : idx);\n\t\t},\n\t);\n\n\t// Setters — mirror Base UI's `SelectRoot` `setOpen` / `setValue`: fire\n\t// the `onXChange` callback, honor `details.cancel()`, then write the\n\t// uncontrolled state (a no-op for reads while the matching prop is\n\t// controlled — the consumer's signal write is the source of truth).\n\tconst setOpen = (\n\t\tnext: boolean,\n\t\tdetails: SelectRootChangeEventDetails,\n\t): void => {\n\t\tprops.onOpenChange?.(next, details);\n\t\tif (details.isCanceled) return;\n\t\tsetUncontrolledOpen(next);\n\t};\n\n\tconst setValue = (\n\t\tnext: SelectValue,\n\t\tdetails: SelectRootChangeEventDetails,\n\t): void => {\n\t\tprops.onValueChange?.(\n\t\t\tnext as SelectValueType<Value, Multiple>,\n\t\t\tdetails as SelectRootChangeEventDetails,\n\t\t);\n\t\tif (details.isCanceled) return;\n\t\tsetUncontrolledValue(next);\n\t};\n\n\t// Floating-UI integration.\n\tconst floatingRootContext = useFloatingRootContext({\n\t\topen: untrack(open),\n\t\tonOpenChange: (nextOpen, details) => {\n\t\t\tsetOpen(nextOpen, details as SelectRootChangeEventDetails);\n\t\t},\n\t});\n\n\tcreateEffect(\n\t\t() => ({\n\t\t\topenValue: open(),\n\t\t\ttrigger: triggerElement(),\n\t\t\tstatus: transitionStatus(),\n\t\t}),\n\t\t({ openValue, trigger, status }) => {\n\t\t\tfloatingRootContext.update({\n\t\t\t\topen: openValue,\n\t\t\t\treferenceElement: trigger,\n\t\t\t\tdomReferenceElement: trigger,\n\t\t\t\ttransitionStatus: status,\n\t\t\t});\n\t\t},\n\t);\n\n\t// Interaction hooks. Each hook reads its accessor inputs once at body\n\t// time to seed local refs / signals — wrap in `untrack` so those\n\t// snapshot reads don't trip Solid 2's `[STRICT_READ_UNTRACKED]` shell\n\t// labelled with this component's name. Reactivity for subsequent\n\t// updates flows through the accessor closures the hooks retain.\n\tconst click = untrack(() =>\n\t\tuseClick(floatingRootContext, {\n\t\t\tenabled: () => !readOnly() && !disabled(),\n\t\t\tevent: \"mousedown\",\n\t\t}),\n\t);\n\n\tconst dismiss = untrack(() =>\n\t\tuseDismiss(floatingRootContext, {\n\t\t\tenabled: () => !readOnly() && !disabled(),\n\t\t\tbubbles: false,\n\t\t}),\n\t);\n\n\tconst listNavigation = untrack(() =>\n\t\tuseListNavigation(floatingRootContext, {\n\t\t\tenabled: () => !readOnly() && !disabled(),\n\t\t\tlistRef,\n\t\t\tactiveIndex,\n\t\t\tselectedIndex,\n\t\t\tfocusItemOnHover: highlightItemOnHover,\n\t\t\tonNavigate(nextActiveIndex) {\n\t\t\t\t// Retain the highlight while transitioning out — React's note.\n\t\t\t\tif (nextActiveIndex === null && !untrack(open)) return;\n\t\t\t\tsetActiveIndex(nextActiveIndex);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst typeahead = untrack(() =>\n\t\tuseTypeahead(floatingRootContext, {\n\t\t\tenabled: () => !readOnly() && !disabled() && (open() || !multiple()),\n\t\t\tlistRef: labelsRef,\n\t\t\tactiveIndex,\n\t\t\tselectedIndex,\n\t\t\tonMatch(index) {\n\t\t\t\tif (untrack(open)) {\n\t\t\t\t\tsetActiveIndex(index);\n\t\t\t\t} else {\n\t\t\t\t\tconst nextValue = valuesRef.current[index];\n\t\t\t\t\tsetValue(\n\t\t\t\t\t\tnextValue,\n\t\t\t\t\t\tcreateChangeEventDetails(\n\t\t\t\t\t\t\tREASONS.none,\n\t\t\t\t\t\t) as SelectRootChangeEventDetails,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonTypingChange(typing) {\n\t\t\t\ttypingRef.current = typing;\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst interactions = untrack(() =>\n\t\tuseInteractions([click, dismiss, listNavigation, typeahead]),\n\t);\n\n\t// actionsRef wiring.\n\tconst handleUnmount = (): void => {\n\t\tsetMounted(false);\n\t\tsetActiveIndex(null);\n\t};\n\tconst actions: SelectRootActions = { unmount: handleUnmount };\n\tconst ref = props.actionsRef;\n\tif (typeof ref === \"function\") {\n\t\tref(actions);\n\t\tonCleanup(() => ref(null));\n\t} else if (ref && typeof ref === \"object\") {\n\t\tref.current = actions;\n\t\tonCleanup(() => {\n\t\t\tref.current = null;\n\t\t});\n\t}\n\n\t// Hidden form input — single-select path.\n\tconst serializedValue = createMemo<string>(() => {\n\t\tconst v = value();\n\t\tif (multiple() && Array.isArray(v) && v.length === 0) return \"\";\n\t\treturn stringifyAsValue(\n\t\t\tv,\n\t\t\titemToStringValue() as ((v: unknown) => string) | undefined,\n\t\t);\n\t});\n\n\t// For multi-select we render one hidden `<input>` per value (matching\n\t// React). This accessor returns the list of serialized strings.\n\tconst multipleSerialized = createMemo<string[]>(() => {\n\t\tconst v = value();\n\t\tif (!multiple() || !Array.isArray(v)) return [];\n\t\treturn v.map((x) =>\n\t\t\tstringifyAsValue(\n\t\t\t\tx,\n\t\t\t\titemToStringValue() as ((v: unknown) => string) | undefined,\n\t\t\t),\n\t\t);\n\t});\n\n\tconst hasMultipleSelection = createMemo<boolean>(() => {\n\t\tconst v = value();\n\t\treturn multiple() && Array.isArray(v) && v.length > 0;\n\t});\n\tconst hiddenInputName = (): string | undefined =>\n\t\tmultiple() ? undefined : name();\n\n\t// Browser autofill handling — mirrors React. When autocomplete writes a\n\t// string into the hidden input, try to map it back into a registered\n\t// item value (by stringified value OR by label).\n\tconst handleAutofill = (event: Event): void => {\n\t\tconst target = event.currentTarget as HTMLInputElement | null;\n\t\tif (!target) return;\n\t\tconst nextValue = target.value;\n\t\tif (multiple()) return; // Browser autofill only writes a single scalar.\n\t\tconst registry = valuesRef.current;\n\t\tconst matching = registry.find((candidate) => {\n\t\t\tconst candidateValue = stringifyAsValue(\n\t\t\t\tcandidate,\n\t\t\t\titemToStringValue() as ((v: unknown) => string) | undefined,\n\t\t\t);\n\t\t\tif (candidateValue.toLowerCase() === nextValue.toLowerCase()) return true;\n\t\t\tconst candidateLabel = stringifyAsLabel(\n\t\t\t\tcandidate,\n\t\t\t\titemToStringLabel() as ((v: unknown) => string) | undefined,\n\t\t\t);\n\t\t\tif (candidateLabel.toLowerCase() === nextValue.toLowerCase()) return true;\n\t\t\treturn false;\n\t\t});\n\t\tif (matching != null) {\n\t\t\tsetValue(\n\t\t\t\tmatching,\n\t\t\t\tcreateChangeEventDetails(\n\t\t\t\t\tREASONS.none,\n\t\t\t\t\tevent,\n\t\t\t\t) as SelectRootChangeEventDetails,\n\t\t\t);\n\t\t}\n\t};\n\n\tconst setInputRef = (el: HTMLInputElement | null): void => {\n\t\tconst r = props.inputRef;\n\t\tif (typeof r === \"function\") r(el);\n\t\telse if (r && typeof r === \"object\") r.current = el;\n\t};\n\n\tconst contextValue: SelectRootContextValue = {\n\t\topen,\n\t\tmounted,\n\t\ttransitionStatus,\n\t\tmodal,\n\t\tmultiple,\n\t\tdisabled,\n\t\treadOnly,\n\t\trequired,\n\t\tname,\n\t\tid: () => generatedId,\n\t\tlabelId,\n\t\tsetLabelId,\n\t\tvalue,\n\t\tactiveIndex,\n\t\tsetActiveIndex,\n\t\tselectedIndex,\n\t\tsetSelectedIndex,\n\t\thighlightItemOnHover,\n\t\tisItemEqualToValue: isItemEqualToValue as () => (\n\t\t\ta: SelectValue,\n\t\t\tb: SelectValue,\n\t\t) => boolean,\n\t\titemToStringLabel: itemToStringLabel as () =>\n\t\t\t| ((value: SelectValue) => string)\n\t\t\t| undefined,\n\t\titemToStringValue: itemToStringValue as () =>\n\t\t\t| ((value: SelectValue) => string)\n\t\t\t| undefined,\n\t\titems,\n\t\tsetOpen,\n\t\tsetValue,\n\t\tfloatingRootContext,\n\t\tinteractions,\n\t\ttriggerElement,\n\t\tsetTriggerElement,\n\t\tpopupRef,\n\t\tlistElement,\n\t\tsetListElement,\n\t\tvalueRef,\n\t\tselectedItemTextRef,\n\t\tlistRef,\n\t\tlabelsRef,\n\t\tvaluesRef,\n\t\ttypingRef,\n\t\tonOpenChangeComplete: props.onOpenChangeComplete,\n\t\tinitialValueRef,\n\t\topenMethod,\n\t\tscrollUpArrowVisible,\n\t\tsetScrollUpArrowVisible,\n\t\tscrollDownArrowVisible,\n\t\tsetScrollDownArrowVisible,\n\t\tscrollArrowsMountedCountRef,\n\t\thandleScrollArrowVisibility,\n\t\tscrollHandlerRef,\n\t\tkeyboardActiveRef,\n\t\tselectionRef,\n\t\thandleScrollArrowVisibilityRef,\n\t};\n\n\treturn (\n\t\t<SelectRootContext value={contextValue}>\n\t\t\t{props.children}\n\t\t\t<input\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tref={setInputRef}\n\t\t\t\tid={\n\t\t\t\t\tgeneratedId && hiddenInputName() == null\n\t\t\t\t\t\t? `${generatedId}-hidden-input`\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tform={props.form}\n\t\t\t\tname={hiddenInputName()}\n\t\t\t\tautocomplete={props.autoComplete}\n\t\t\t\tvalue={multiple() ? \"\" : serializedValue()}\n\t\t\t\tdisabled={disabled()}\n\t\t\t\trequired={required() && !hasMultipleSelection()}\n\t\t\t\treadonly={readOnly()}\n\t\t\t\tstyle={{ ...VISUALLY_HIDDEN_STYLE } as JSX.CSSProperties}\n\t\t\t\ttabindex={-1}\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tonFocus={() => {\n\t\t\t\t\t// Move focus to the trigger when the hidden input is focused.\n\t\t\t\t\tconst trigger = triggerElement();\n\t\t\t\t\ttrigger?.focus();\n\t\t\t\t}}\n\t\t\t\tonChange={handleAutofill}\n\t\t\t/>\n\t\t\t{multiple() && name() ? (\n\t\t\t\t<MultipleHiddenInputs\n\t\t\t\t\tname={name() as string}\n\t\t\t\t\tform={props.form}\n\t\t\t\t\tvalues={multipleSerialized}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</SelectRootContext>\n\t);\n}\n\nfunction MultipleHiddenInputs(props: {\n\tname: string;\n\tform: string | undefined;\n\tvalues: Accessor<string[]>;\n}): JSX.Element {\n\treturn (\n\t\t<>\n\t\t\t{props.values().map((v) => (\n\t\t\t\t<input type=\"hidden\" form={props.form} name={props.name} value={v} />\n\t\t\t))}\n\t\t</>\n\t);\n}\n\n/**\n * Groups all parts of the select. Doesn't render its own HTML element —\n * the root is a pure context provider.\n */\nexport function SelectRoot<\n\tValue = SelectValue,\n\tMultiple extends boolean | undefined = false,\n>(props: SelectRootProps<Value, Multiple>): JSX.Element {\n\tif (useSelectRootContext(true) != null || useFloatingParentNodeId() != null) {\n\t\treturn <SelectRootComponent<Value, Multiple> {...props} />;\n\t}\n\treturn (\n\t\t<FloatingTree>\n\t\t\t<SelectRootComponent<Value, Multiple> {...props} />\n\t\t</FloatingTree>\n\t);\n}\n"],"mappings":"AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAECA,YAAY,EACZC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,OAAO,QACD,UAAU;AACjB,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SACCC,wBAAwB,EACxBC,OAAO,QACD,sCAAsC;AAC7C,SAASC,qBAAqB,QAAQ,yCAAyC;AAC/E,SACCC,YAAY,EACZC,uBAAuB,QACjB,sDAAsD;AAC7D,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,UAAU,QAAQ,+CAA+C;AAC1E,SAASC,sBAAsB,QAAQ,6DAA6D;AACpG,SAASC,eAAe,QAAQ,oDAAoD;AACpF,SAASC,iBAAiB,QAAQ,uDAAuD;AACzF,SAASC,YAAY,QAAQ,iDAAiD;AAE9E,SAA6BC,UAAU,QAAQ,gCAAgC;AAC/E,SAASC,qBAAqB,QAAQ,iDAAiD;AACvF,SAASC,sBAAsB,QAAQ,kDAAkD;AACzF,SAASC,mBAAmB,QAAQ,6DAA6D;AACjG,SAASC,qBAAqB,QAAQ,uCAAuC;AAC7E,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAGCC,iBAAiB,EAIjBC,oBAAoB,QACd,wBAAwB;AAC/B,SAASC,mBAAmB,EAAEC,aAAa,QAAQ,wBAAwB;AAC3E,SAECC,gBAAgB,EAChBC,gBAAgB,QACV,8BAA8B;;AAIrC;AACA;AACA;AACA;AACA;;AA8GA,SAASC,mBAAmBA,CAG1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