@rcarls/rc-select 0.0.0-next-20260921045401

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.
@@ -0,0 +1,1079 @@
1
+ import { css as g, LitElement as f, html as d, nothing as p } from "lit";
2
+ import { property as c, query as u, state as h } from "lit/decorators.js";
3
+ import { NativeChildController as b, ActiveDescendantController as m, AnchorController as y } from "@rcarls/rc-common";
4
+ import "@rcarls/rc-dialog/define";
5
+ const x = g`
6
+ :host {
7
+ display: inline-block;
8
+ }
9
+
10
+ #anchor {
11
+ display: flex;
12
+ align-items: center;
13
+ flex-wrap: wrap;
14
+ gap: var(--rc-select-gap, var(--rc-control-gap, 0.25em));
15
+ }
16
+
17
+ #trigger {
18
+ display: flex;
19
+ align-items: center;
20
+ flex-wrap: wrap;
21
+ gap: var(--rc-select-gap, var(--rc-control-gap, 0.25em));
22
+ min-block-size: var(--rc-select-control-block-size, var(--rc-control-block-size, auto));
23
+ padding: var(--rc-select-padding-block, var(--rc-control-padding-block, 1px))
24
+ var(--rc-select-padding-inline, var(--rc-control-padding-inline, 4px));
25
+ min-width: 8em;
26
+ cursor: default;
27
+ user-select: none;
28
+ border: var(
29
+ --rc-select-border,
30
+ var(--rc-border, 1px solid var(--rc-border-color, ButtonBorder))
31
+ );
32
+ border-radius: var(--rc-select-radius, var(--rc-control-radius, var(--rc-radius-sm, 0.125em)));
33
+ background: var(--rc-field, Field);
34
+ color: var(--rc-field-text, FieldText);
35
+ font-family: var(--rc-font-family, inherit);
36
+ font-size: var(--rc-font-size, inherit);
37
+ line-height: var(--rc-line-height, normal);
38
+ transition:
39
+ background-color var(--rc-motion-duration, 120ms),
40
+ border-color var(--rc-motion-duration, 120ms),
41
+ box-shadow var(--rc-motion-duration, 120ms);
42
+
43
+ /* Keyboard focus indicator */
44
+ outline: none;
45
+ &:focus-visible {
46
+ outline: var(--rc-focus-ring, auto);
47
+ outline-offset: var(--rc-focus-ring-offset, 0);
48
+ }
49
+ }
50
+
51
+ [part='value-display'] {
52
+ flex: 1;
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+ white-space: nowrap;
56
+ }
57
+
58
+ [part='toggle-indicator'] {
59
+ flex-shrink: 0;
60
+ display: inline-flex;
61
+ align-items: center;
62
+ justify-content: center;
63
+ inline-size: var(--rc-select-toggle-indicator-size, 1.1em);
64
+ }
65
+
66
+ [part='chips'] {
67
+ flex: 0 1 auto;
68
+ max-inline-size: 100%;
69
+ min-inline-size: 0;
70
+ --rc-chip-group-column-gap: var(--rc-select-gap, var(--rc-control-gap, 0.25em));
71
+ --rc-chip-group-row-gap: 0;
72
+ }
73
+
74
+ /* Input-chip chrome; rc-chip keeps the native button as the removal action. */
75
+ [part='chip'] {
76
+ display: inline-flex;
77
+ align-items: center;
78
+ gap: var(--rc-select-chip-gap, calc(var(--rc-control-gap, 0.25em) * 0.8));
79
+ padding-block: var(--rc-select-chip-padding-block, 0.1em);
80
+ padding-inline-start: var(--rc-select-chip-padding-inline-start, 0.3em);
81
+ padding-inline-end: var(
82
+ --rc-select-chip-padding-inline-end,
83
+ calc(
84
+ var(--rc-chip-remove-target-size, 1.5rem) + var(--rc-chip-remove-offset-inline, 0.125rem)
85
+ )
86
+ );
87
+ border: var(
88
+ --rc-select-chip-border,
89
+ var(--rc-border, 1px solid var(--rc-border-color, ButtonBorder))
90
+ );
91
+ border-radius: var(--rc-select-chip-radius, var(--rc-radius-md, 0.25em));
92
+ background: var(--rc-button-bg, ButtonFace);
93
+ color: var(--rc-button-text, ButtonText);
94
+ font: inherit;
95
+ font-size: 0.875em;
96
+ cursor: pointer;
97
+
98
+ &:hover {
99
+ background: var(--rc-highlight, Highlight);
100
+ color: var(--rc-highlight-text, HighlightText);
101
+ }
102
+
103
+ &:focus-visible {
104
+ outline: var(--rc-focus-ring, auto);
105
+ outline-offset: var(--rc-focus-ring-offset, 0);
106
+ }
107
+ }
108
+
109
+ /* Decorative × icon inside the chip — no interaction, aria-hidden. */
110
+ [part='chip-remove'] {
111
+ display: inline-flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ width: 1em;
115
+ font-size: 0.85em;
116
+ pointer-events: none;
117
+ }
118
+
119
+ /* Hide the default slot — visually suppresses the slotted native <select> */
120
+ slot:not([name]) {
121
+ display: none;
122
+ }
123
+
124
+ /* Listbox popup — positioned by AnchorController via adoptedStyleSheets */
125
+ rc-listbox {
126
+ max-height: var(--rc-select-max-height, 20em);
127
+ overflow-y: auto;
128
+ background: var(--rc-surface, Canvas);
129
+ border: var(
130
+ --rc-select-listbox-border,
131
+ var(--rc-border, 1px solid var(--rc-border-color, ButtonBorder))
132
+ );
133
+ border-radius: var(--rc-select-listbox-radius, var(--rc-control-radius, 0));
134
+ box-shadow: var(
135
+ --rc-select-shadow,
136
+ var(--rc-shadow, 0 2px 8px color-mix(in srgb, CanvasText 15%, transparent))
137
+ );
138
+ color: var(--rc-field-text, FieldText);
139
+ padding-block: var(--rc-select-listbox-padding-block, var(--rc-control-padding-block, 0.25em));
140
+ --rc-listbox-option-gap: var(--rc-item-gap, 0.4em);
141
+ --rc-listbox-option-padding-block: var(--rc-item-padding-block, 0.3em);
142
+ --rc-listbox-option-padding-inline: var(--rc-item-padding-inline, 0.75em);
143
+ --rc-listbox-hover-bg: var(--rc-highlight, Highlight);
144
+ --rc-listbox-hover-color: var(--rc-highlight-text, HighlightText);
145
+ --rc-listbox-active-bg: var(--rc-highlight, Highlight);
146
+ --rc-listbox-active-color: var(--rc-highlight-text, HighlightText);
147
+ --rc-listbox-selected-bg: var(--rc-highlight, Highlight);
148
+ --rc-listbox-selected-color: var(--rc-highlight-text, HighlightText);
149
+ --rc-listbox-disabled-opacity: var(--rc-disabled-opacity, 0.5);
150
+ }
151
+
152
+ /*
153
+ * @media (prefers-reduced-motion: reduce) below restates this plainly for
154
+ * a reduced-motion user: without any transition on display, it still
155
+ * changes instantly, exactly like this unconditional rule would.
156
+ */
157
+ @media (prefers-reduced-motion: no-preference) {
158
+ /*
159
+ * Opacity only, deliberately not a scale/slide transform: AnchorController
160
+ * (see rc-common) positions this listbox and applies its own
161
+ * viewport-clamping translate to it, tracked against
162
+ * getBoundingClientRect() to compute the next correction. A second,
163
+ * CSS-driven transform on the same element and property would fight
164
+ * that math on every open.
165
+ *
166
+ * display and overlay join the transition list, allow-discrete: without
167
+ * them, this listbox's own separate display: none on
168
+ * :not(:popover-open) (still needed, see below) would apply instantly,
169
+ * and a transition on a property of an element with no box doesn't
170
+ * render at all — confirmed directly, an earlier opacity-only version
171
+ * of this rule measured display: none and opacity: 0 only 300ms into
172
+ * what should have been a 2-second exit fade.
173
+ */
174
+ [part='listbox']:popover-open {
175
+ opacity: 1;
176
+ transition:
177
+ opacity var(--rc-select-listbox-duration, 150ms) var(--rc-motion-effects-easing-enter, ease-out),
178
+ overlay var(--rc-select-listbox-duration, 150ms) allow-discrete,
179
+ display var(--rc-select-listbox-duration, 150ms) allow-discrete;
180
+ }
181
+
182
+ [part='listbox']:not(:popover-open) {
183
+ opacity: 0;
184
+ transition:
185
+ opacity var(--rc-select-listbox-duration, 150ms) var(--rc-motion-effects-easing-exit, ease-in),
186
+ overlay var(--rc-select-listbox-duration, 150ms) allow-discrete,
187
+ display var(--rc-select-listbox-duration, 150ms) allow-discrete;
188
+ }
189
+
190
+ @starting-style {
191
+ [part='listbox']:popover-open {
192
+ opacity: 0;
193
+ }
194
+ }
195
+ }
196
+
197
+ [part='listbox']:not(:popover-open) {
198
+ display: none;
199
+ }
200
+
201
+ rc-dialog[variant='fullscreen'] {
202
+ display: contents;
203
+ }
204
+
205
+ [part~='dialog'] {
206
+ box-sizing: border-box;
207
+ background: var(--rc-surface, Canvas);
208
+ color: var(--rc-field-text, CanvasText);
209
+ font-family: var(--rc-font-family, inherit);
210
+
211
+ &[open] {
212
+ display: flex;
213
+ flex-direction: column;
214
+ gap: var(--rc-select-dialog-gap, 1rem);
215
+ }
216
+ }
217
+
218
+ [part~='dialog-header'] {
219
+ display: grid;
220
+ grid-template-columns: auto minmax(0, 1fr) auto;
221
+ align-items: center;
222
+ gap: var(--rc-select-dialog-header-gap, 0.5rem);
223
+ }
224
+
225
+ [part~='dialog-header'] > [part~='dialog-title']:first-child {
226
+ grid-column: 1 / 3;
227
+ }
228
+
229
+ [part~='dialog-title'] {
230
+ min-inline-size: 0;
231
+ margin: 0;
232
+ overflow: hidden;
233
+ text-overflow: ellipsis;
234
+ white-space: nowrap;
235
+ font: inherit;
236
+ }
237
+
238
+ [part~='dialog-cancel'],
239
+ [part~='dialog-confirm'] {
240
+ min-inline-size: 2.75rem;
241
+ min-block-size: 2.75rem;
242
+ }
243
+
244
+ [part~='dialog-cancel'] {
245
+ display: inline-flex;
246
+ align-items: center;
247
+ justify-content: center;
248
+ padding: 0;
249
+ }
250
+
251
+ [part~='dialog-cancel-icon'] {
252
+ fill: currentColor;
253
+ }
254
+
255
+ [part~='dialog-selected'] {
256
+ max-block-size: 30%;
257
+ overflow: auto;
258
+ }
259
+
260
+ [part~='dialog-listbox'] {
261
+ flex: 1;
262
+ min-block-size: 0;
263
+ max-block-size: none;
264
+ box-shadow: none;
265
+ }
266
+
267
+ rc-listbox [part~='option'][hidden] {
268
+ display: none;
269
+ }
270
+
271
+ rc-listbox [part~='option'][data-active]:not([aria-disabled='true']) {
272
+ outline: var(--rc-focus-ring, 2px solid var(--rc-accent, Highlight));
273
+ outline-offset: -2px;
274
+ }
275
+
276
+ rc-listbox [part~='option'][aria-disabled='true'] {
277
+ cursor: not-allowed;
278
+ }
279
+
280
+ /* Selection checkmark — reserves space whether visible or not */
281
+ rc-listbox [part~='option-checkmark'] {
282
+ flex-shrink: 0;
283
+ width: 1em;
284
+ text-align: center;
285
+ font-size: 0.85em;
286
+ visibility: hidden;
287
+ }
288
+
289
+ rc-listbox [part~='option'][aria-selected='true'] [part~='option-checkmark'] {
290
+ visibility: visible;
291
+ }
292
+
293
+ rc-listbox [part~='create-option'] {
294
+ font-style: italic;
295
+ border-top: 1px solid var(--rc-border-color, ButtonBorder);
296
+ margin-top: 0.25em;
297
+ padding-top: 0.3em;
298
+ }
299
+ `;
300
+ var k = Object.defineProperty, a = (_, e, t, i) => {
301
+ for (var s = void 0, r = _.length - 1, l; r >= 0; r--)
302
+ (l = _[r]) && (s = l(e, t, s) || s);
303
+ return s && k(e, t, s), s;
304
+ };
305
+ const v = class v extends f {
306
+ constructor() {
307
+ super(...arguments), this.open = !1, this.multiple = !1, this.disabled = !1, this.required = !1, this.placeholder = "", this.display = "auto", this.popupMode = "popover", this.dialogConfirmLabel = "Done", this.dialogCancelLabel = "Cancel", this.dialogCancelButton = "visible", this._selectedValues = /* @__PURE__ */ new Set(), this._pendingSelectedValues = null, this._accessibleName = "", this._activePopupMode = "popover", this._chipNavIndex = -1, this._options = [], this._$selectRef = null, this._selectController = new b(this, {
308
+ selector: ":scope > select",
309
+ observe: !0,
310
+ onChange: (e) => this._setupSelect(e),
311
+ onMissing: () => {
312
+ }
313
+ }), this._mutationObserver = null, this._selectionInitialized = !1, this._pickerGuardActive = !1, this._pickerGuardConsumerDisabled = !1, this._pickerGuardForm = null, this._typeAheadBuffer = "", this._typeAheadTimer = 0, this._activeDescendantCtrl = new m(this, {
314
+ host: () => this._$activeDescendantHost,
315
+ items: () => this._$listbox?.navigableItems ?? []
316
+ }), this._anchorCtrl = new y(this, {
317
+ anchor: () => this._$anchor ?? null,
318
+ floating: () => this._$listbox ?? null,
319
+ shadowHost: () => this,
320
+ placement: "bottom-start",
321
+ offset: 2
322
+ }), this._onDocClick = (e) => {
323
+ this.open && (e.composedPath().includes(this) || this.closePopup(!1));
324
+ }, this._onDocKeyDown = (e) => {
325
+ this.open && e.key === "Escape" && (e.preventDefault(), this.closePopup());
326
+ }, this._onNativeSelectClick = (e) => {
327
+ e.preventDefault();
328
+ }, this._handleFormData = (e) => {
329
+ const t = this._$selectRef?.deref();
330
+ if (!(!this._pickerGuardActive || !t?.name))
331
+ for (const i of this.selectedValues)
332
+ e.formData.append(t.name, i);
333
+ }, this._handleFormSubmit = (e) => {
334
+ const t = this._$selectRef?.deref();
335
+ if (!this._pickerGuardActive || !t)
336
+ return;
337
+ const i = e.currentTarget, s = e.submitter;
338
+ if (i.noValidate || s?.formNoValidate || t.validity.valid)
339
+ return;
340
+ e.preventDefault(), t.dispatchEvent(new Event("invalid", { cancelable: !0 })) && this._$trigger?.focus();
341
+ };
342
+ }
343
+ /** Element that owns `aria-activedescendant` for the currently rendered popup. */
344
+ get _$activeDescendantHost() {
345
+ return this._$trigger ?? null;
346
+ }
347
+ connectedCallback() {
348
+ super.connectedCallback(), document.addEventListener("click", this._onDocClick, { capture: !0 }), document.addEventListener("keydown", this._onDocKeyDown, { capture: !0 });
349
+ const e = this._$selectRef?.deref();
350
+ e && this._pickerGuardActive && this._syncFormListeners(e.form);
351
+ }
352
+ disconnectedCallback() {
353
+ super.disconnectedCallback(), document.removeEventListener("click", this._onDocClick, { capture: !0 }), document.removeEventListener("keydown", this._onDocKeyDown, {
354
+ capture: !0
355
+ }), this._mutationObserver?.disconnect(), this._syncFormListeners(null);
356
+ }
357
+ updated(e) {
358
+ super.updated(e), this.toggleAttribute("has-value", this._selectedValues.size > 0);
359
+ }
360
+ /**
361
+ * Forwards focus to the trigger. The host itself is never in the tab order, so without this
362
+ * override, calling `.focus()` on `<rc-select>` (as `rc-field` does when treating it as a
363
+ * control provider) would be a no-op.
364
+ */
365
+ focus(e) {
366
+ this._$trigger?.focus(e);
367
+ }
368
+ /** Forwards blur to the trigger; see `focus()`. */
369
+ blur() {
370
+ this._$trigger?.blur();
371
+ }
372
+ /** Opens the popup listbox if not already open or disabled. */
373
+ openPopup() {
374
+ if (!(this.open || this.disabled)) {
375
+ if (this._activePopupMode = this.popupMode, this._activePopupMode === "dialog") {
376
+ this._pendingSelectedValues = new Set(this._selectedValues), this.open = !0, this.requestUpdate(), this.updateComplete.then(async () => {
377
+ const e = this._$dialogHost;
378
+ !this.open || this._activePopupMode !== "dialog" || !e || (await e.updateComplete, !(!this.open || this._activePopupMode !== "dialog") && (this._$listbox?.setSelectedValues(this._dialogSelectedValues), e.showModal(), this._focusDialogContent(), this.dispatchEvent(new CustomEvent("rc-select-open", { bubbles: !0, composed: !0 }))));
379
+ });
380
+ return;
381
+ }
382
+ this.open = !0, this._$listbox.showPopover(), this._anchorCtrl.update(), this.dispatchEvent(new CustomEvent("rc-select-open", { bubbles: !0, composed: !0 })), this.requestUpdate();
383
+ }
384
+ }
385
+ /**
386
+ * Closes the popup listbox.
387
+ *
388
+ * @param returnFocus - When `true` (default), returns focus to the trigger.
389
+ */
390
+ closePopup(e = !0) {
391
+ if (this.open) {
392
+ if (this._activePopupMode === "dialog") {
393
+ this._discardDialogSelection(), this._$dialogHost?.close("cancel"), this._finishDialogClose(e);
394
+ return;
395
+ }
396
+ this.open = !1, this._$listbox.hidePopover(), this._activeDescendantCtrl.clear(), e && this._$trigger?.focus(), this.dispatchEvent(new CustomEvent("rc-select-close", { bubbles: !0, composed: !0 }));
397
+ }
398
+ }
399
+ /**
400
+ * Current selection. Host writes update selection silently; user interaction
401
+ * emits `rc-select-change`.
402
+ */
403
+ get value() {
404
+ return this.multiple ? this.selectedValues : this.selectedValues[0] ?? "";
405
+ }
406
+ set value(e) {
407
+ const t = this._value;
408
+ if (this._value = e, e === void 0) {
409
+ this.requestUpdate("value", t);
410
+ return;
411
+ }
412
+ this._selectionInitialized = !0, this._applySelection(this._normalizeValue(e)), this.requestUpdate("value", t);
413
+ }
414
+ /** Initial uncontrolled selection, applied before user or native state owns the value. */
415
+ get defaultValue() {
416
+ return this._defaultValue;
417
+ }
418
+ set defaultValue(e) {
419
+ const t = this._defaultValue;
420
+ this._defaultValue = e, !this._selectionInitialized && this._value === void 0 && e !== void 0 && this._applySelection(this._normalizeValue(e)), this.requestUpdate("defaultValue", t);
421
+ }
422
+ /** Programmatic option source. Omit to derive options from the slotted `<select>`. */
423
+ get options() {
424
+ return this._propertyOptions ? [...this._propertyOptions] : void 0;
425
+ }
426
+ set options(e) {
427
+ const t = this._propertyOptions;
428
+ this._propertyOptions = e ? [...e] : void 0, this._syncOptions(this._currentOptions()), this._mirrorOptionsToNativeSelect(), this.requestUpdate("options", t);
429
+ }
430
+ /** Selected values as a consistently-array-shaped convenience getter. */
431
+ get selectedValues() {
432
+ return [...this._selectedValues];
433
+ }
434
+ /** `ListboxOption` objects for the current selection; falls back to label-only stubs for unknown values. */
435
+ get selectedOptions() {
436
+ return this._selectedOptionsFor(this.selectedValues);
437
+ }
438
+ /**
439
+ * Applies an already-normalized array of values as the current selection.
440
+ *
441
+ * In single-select mode only the first value is kept. Syncs `_$listbox` and the
442
+ * native `<select>` but does NOT dispatch `rc-select-change`.
443
+ *
444
+ * @param fromUser - Pass `true` only for a selection driven by real user interaction, so
445
+ * `_syncNativeSelect` dispatches native `input`/`change` on the underlying `<select>` (a
446
+ * programmatic `value`/`defaultValue` write is not a native interaction and relies on an
447
+ * external `sync()` call instead, the same as `rc-textarea`'s controlled-value contract).
448
+ */
449
+ _applySelection(e, t = !1) {
450
+ const i = this.multiple ? e : e.slice(0, 1);
451
+ this._selectedValues = new Set(i), this._$listbox?.setSelectedValues(i), this._syncNativeSelect(t), this.open && this._activePopupMode === "dialog" && this._pendingSelectedValues && (this._pendingSelectedValues = new Set(i)), this.requestUpdate();
452
+ }
453
+ /**
454
+ * Countermeasure for select["multiple"] bug in Firefox for Android / GeckoView.
455
+ *
456
+ * Works around a GeckoView bug where tapping anywhere inside an
457
+ * ancestor `<label>`'s bounds opens the native picker dialog of a wrapped
458
+ * `<select multiple>`, even though the select is hidden and the tap landed on this
459
+ * component's own UI.
460
+ *
461
+ * Label activation on a disabled control is a spec-defined no-op, so the slotted select
462
+ * is force-disabled after upgrade while it is `multiple`. A disabled select submits
463
+ * nothing, so form submission is restored by appending the current selection in a
464
+ * `formdata` listener on the owning form (`_handleFormData`). A disabled select is also
465
+ * barred from native constraint validation, so `_handleFormSubmit` enforces its
466
+ * `ValidityState` at submit time instead.
467
+ *
468
+ * Scoped to multiple selects: the single-select picker path is already suppressed by
469
+ * `_onNativeSelectClick`. Pre-upgrade behavior is unaffected — the guard
470
+ * only applies once the component initializes.
471
+ *
472
+ * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1475723
473
+ */
474
+ _applyPickerGuard(e) {
475
+ e.multiple && !this._pickerGuardActive ? (this._pickerGuardActive = !0, this._pickerGuardConsumerDisabled = e.disabled, e.disabled = !0) : !e.multiple && this._pickerGuardActive ? (this._pickerGuardActive = !1, e.disabled = this._pickerGuardConsumerDisabled) : e.multiple && !e.disabled && (this._pickerGuardConsumerDisabled = !1, this.disabled = !1, e.disabled = !0), this._syncFormListeners(this._pickerGuardActive ? e.form : null);
476
+ }
477
+ /** Moves the picker guard's `formdata` and `submit` listeners to `$form`; pass `null` to detach. */
478
+ _syncFormListeners(e) {
479
+ e !== this._pickerGuardForm && (this._pickerGuardForm?.removeEventListener("formdata", this._handleFormData), this._pickerGuardForm?.removeEventListener("submit", this._handleFormSubmit, {
480
+ capture: !0
481
+ }), this._pickerGuardForm = e, e?.addEventListener("formdata", this._handleFormData), e?.addEventListener("submit", this._handleFormSubmit, { capture: !0 }));
482
+ }
483
+ /**
484
+ * Resolves the slotted `<select>` on every `slotchange`, wires `_mutationObserver`,
485
+ * and seeds initial state via `queueMicrotask` to stay safe inside framework reactive passes.
486
+ */
487
+ _handleSelectSlotChange() {
488
+ this._selectController.sync();
489
+ }
490
+ _setupSelect(e) {
491
+ this._mutationObserver?.disconnect(), this._mutationObserver = null;
492
+ const t = this._$selectRef?.deref();
493
+ t && (t.removeEventListener("click", this._onNativeSelectClick), this._pickerGuardActive && (t.disabled = this._pickerGuardConsumerDisabled)), this._pickerGuardActive = !1, this._syncFormListeners(null), this._$selectRef = e ? new WeakRef(e) : null, e && (e.addEventListener("click", this._onNativeSelectClick), queueMicrotask(() => {
494
+ e.isConnected && (this.multiple = e.multiple, this.disabled = e.disabled, this.required = e.required, this._syncOptionsFromSelect(e), this._applyPickerGuard(e), this._mutationObserver = new MutationObserver(() => {
495
+ const i = this._$selectRef?.deref();
496
+ if (i) {
497
+ if (this.multiple = i.multiple, this.required = i.required, this._pickerGuardActive || (this.disabled = i.disabled), this._applyPickerGuard(i), this._propertyOptions !== void 0) {
498
+ this._applySelectionFromCurrentSource();
499
+ return;
500
+ }
501
+ this._syncOptionsFromSelect(i);
502
+ }
503
+ }), this._mutationObserver.observe(e, {
504
+ childList: !0,
505
+ subtree: !0,
506
+ attributes: !0
507
+ }), this._syncAccessibleName(e));
508
+ }));
509
+ }
510
+ /**
511
+ * Derives options from `$select` (or defers to `_propertyOptions` when set)
512
+ * and re-applies selection from the current authoritative source.
513
+ */
514
+ _syncOptionsFromSelect(e) {
515
+ if (this._propertyOptions !== void 0) {
516
+ this._syncOptions(this._propertyOptions), this._mirrorOptionsToNativeSelect(), this._applySelectionFromCurrentSource();
517
+ return;
518
+ }
519
+ const t = this._optionsFromSelect(e);
520
+ this._syncOptions(t), this._applySelectionFromCurrentSource(), this._syncAccessibleName(e);
521
+ }
522
+ /**
523
+ * Picks the correct selection source in priority order:
524
+ * controlled `_value` → `_defaultValue` → native `<select>` default/current state.
525
+ */
526
+ _applySelectionFromCurrentSource() {
527
+ if (this._value !== void 0) {
528
+ this._applySelection(this._normalizeValue(this._value));
529
+ return;
530
+ }
531
+ if (!this._selectionInitialized && this._defaultValue !== void 0) {
532
+ this._selectionInitialized = !0, this._applySelection(this._normalizeValue(this._defaultValue));
533
+ return;
534
+ }
535
+ const e = this._selectionInitialized ? this._selectedValuesFromNativeSelect() : this._defaultSelectedValuesFromNativeSelect();
536
+ this._selectionInitialized = !0, this._applySelection(e);
537
+ }
538
+ /** Writes `_options` and pushes the list to `_$listbox` when it is mounted. */
539
+ _syncOptions(e) {
540
+ this._options = [...e], this._$listbox && (this._$listbox.options = this._options);
541
+ }
542
+ /** Returns `_propertyOptions` when set; otherwise reads live from the slotted `<select>`. */
543
+ _currentOptions() {
544
+ if (this._propertyOptions !== void 0)
545
+ return this._propertyOptions;
546
+ const e = this._$selectRef?.deref();
547
+ return e ? this._optionsFromSelect(e) : [];
548
+ }
549
+ /**
550
+ * Maps non-empty native `<option>` nodes to `ListboxOption` objects.
551
+ *
552
+ * Options with empty `value` are skipped (placeholder guard).
553
+ */
554
+ _optionsFromSelect(e) {
555
+ const t = [];
556
+ for (const i of e.options)
557
+ i.value && t.push({
558
+ value: i.value,
559
+ label: i.text,
560
+ disabled: i.disabled
561
+ });
562
+ return t;
563
+ }
564
+ /** Returns values of currently selected `<option>` nodes; falls back to `selectedValues` when no native select is present. */
565
+ _selectedValuesFromNativeSelect() {
566
+ const e = this._$selectRef?.deref();
567
+ return e ? Array.from(e.selectedOptions).map((t) => t.value).filter(Boolean) : this.selectedValues;
568
+ }
569
+ /** Returns values of `defaultSelected` `<option>` nodes (author `selected` attribute); falls back to `selectedValues`. */
570
+ _defaultSelectedValuesFromNativeSelect() {
571
+ const e = this._$selectRef?.deref();
572
+ return e ? Array.from(e.options).filter((t) => t.defaultSelected).map((t) => t.value).filter(Boolean) : this.selectedValues;
573
+ }
574
+ /**
575
+ * Rebuilds native `<select>` options from `_propertyOptions`.
576
+ *
577
+ * Only runs when `_propertyOptions` is set; pauses then resumes `_mutationObserver`
578
+ * while writing to avoid re-entrant sync.
579
+ */
580
+ _mirrorOptionsToNativeSelect() {
581
+ const e = this._$selectRef?.deref();
582
+ if (!(!e || this._propertyOptions === void 0)) {
583
+ this._mutationObserver?.disconnect(), e.replaceChildren();
584
+ for (const t of this._propertyOptions) {
585
+ const i = document.createElement("option");
586
+ i.value = t.value, i.text = t.label, i.disabled = t.disabled ?? !1, i.selected = this._selectedValues.has(t.value), e.add(i);
587
+ }
588
+ this._mutationObserver?.observe(e, {
589
+ childList: !0,
590
+ subtree: !0,
591
+ attributes: !0
592
+ });
593
+ }
594
+ }
595
+ /**
596
+ * Upserts a single option into `_options` (and `_propertyOptions` when set)
597
+ * and adds the corresponding `<option>` to the native `<select>` if absent.
598
+ */
599
+ _addOption(e) {
600
+ const t = this._options.some((r) => r.value === e.value) ? this._options.map((r) => r.value === e.value ? e : r) : [...this._options, e];
601
+ this._propertyOptions !== void 0 && (this._propertyOptions = t), this._syncOptions(t);
602
+ const i = this._$selectRef?.deref();
603
+ if (!i || Array.from(i.options).some((r) => r.value === e.value))
604
+ return;
605
+ const s = document.createElement("option");
606
+ s.value = e.value, s.text = e.label, s.disabled = e.disabled ?? !1, s.selected = this._selectedValues.has(e.value), i.add(s);
607
+ }
608
+ /** Coerces `RCSelectValue` (string or string[]) to `string[]`; returns `[]` for empty-string singles. */
609
+ _normalizeValue(e) {
610
+ return Array.isArray(e) ? e : e ? [e] : [];
611
+ }
612
+ /**
613
+ * Copies `aria-label` or first-label text from the native `<select>` to `_$trigger`.
614
+ *
615
+ * No-op when the trigger already has an explicit `aria-label`.
616
+ */
617
+ _syncAccessibleName(e) {
618
+ if (!this._$trigger || this._$trigger.hasAttribute("aria-label"))
619
+ return;
620
+ const t = e.getAttribute("aria-label") ?? e.labels?.[0]?.textContent?.trim() ?? null;
621
+ this._accessibleName = t ?? "", t ? this._$trigger.setAttribute("aria-label", t) : this._$trigger.removeAttribute("aria-label");
622
+ }
623
+ /**
624
+ * Handles `rc-listbox-change` from the popup.
625
+ *
626
+ * Stops propagation, mutates `_selectedValues`, syncs state, and fires
627
+ * `rc-select-change`.
628
+ */
629
+ _handleListboxChange(e) {
630
+ const t = e.detail;
631
+ if (t.reason === "action") {
632
+ e.stopPropagation();
633
+ return;
634
+ }
635
+ const { optionValue: i, value: s, selected: r } = t, l = i ?? (Array.isArray(s) ? s.at(-1) : s);
636
+ if (l) {
637
+ if (e.stopPropagation(), this.open && this._activePopupMode === "dialog") {
638
+ const n = new Set(this._pendingSelectedValues ?? this._selectedValues);
639
+ this.multiple ? r ? n.add(l) : n.delete(l) : (n.clear(), r && n.add(l)), this._pendingSelectedValues = n, this._$listbox.setSelectedValues([...n]), this.requestUpdate();
640
+ return;
641
+ }
642
+ if (this.multiple) {
643
+ const n = new Set(this._selectedValues);
644
+ r ? n.add(l) : n.delete(l), this._selectedValues = n;
645
+ } else
646
+ this._selectedValues = r ? /* @__PURE__ */ new Set([l]) : /* @__PURE__ */ new Set(), r && this.closePopup();
647
+ this._selectionInitialized = !0, this._syncNativeSelect(!0), this._$listbox.setSelectedValues(this.selectedValues), this._dispatchChange();
648
+ }
649
+ }
650
+ /** Removes a single value from `_selectedValues`, syncs the listbox and native select, and dispatches `rc-select-change`. */
651
+ _removeValue(e) {
652
+ const t = new Set(this._selectedValues);
653
+ t.delete(e), this._selectedValues = t, this._$listbox.setSelectedValues([...t]), this._selectionInitialized = !0, this._syncNativeSelect(!0), this._dispatchChange();
654
+ }
655
+ /**
656
+ * Flips `selected` on each `<option>` in the native `<select>` to match `_selectedValues`;
657
+ * no-op when no native select is present.
658
+ *
659
+ * @param fromUser - When `true`, also dispatches native `input` and `change` on `$select`
660
+ * (in that order, matching a real `<select>`) so outside listeners, including an
661
+ * `rc-field` ancestor treating this component as its control provider, observe the change.
662
+ */
663
+ _syncNativeSelect(e = !1) {
664
+ const t = this._$selectRef?.deref();
665
+ if (t) {
666
+ for (const i of t.options)
667
+ i.selected = this._selectedValues.has(i.value);
668
+ e && (t.dispatchEvent(new Event("input", { bubbles: !0 })), t.dispatchEvent(new Event("change", { bubbles: !0 })));
669
+ }
670
+ }
671
+ /** Constructs and dispatches `rc-select-change` with current `value`, `selectedValues`, and `selectedOptions`. */
672
+ _dispatchChange() {
673
+ this.dispatchEvent(
674
+ new CustomEvent("rc-select-change", {
675
+ bubbles: !0,
676
+ composed: !0,
677
+ detail: {
678
+ value: this.value,
679
+ selectedValues: this.selectedValues,
680
+ selectedOptions: this.selectedOptions
681
+ }
682
+ })
683
+ );
684
+ }
685
+ /** Maps value strings to `ListboxOption` objects from `_options`; creates label-only fallback stubs for unknown values. */
686
+ _selectedOptionsFor(e) {
687
+ return e.map((t) => this._options.find(
688
+ (i) => i.kind !== "action" && i.value === t
689
+ ) ?? {
690
+ value: t,
691
+ label: t
692
+ });
693
+ }
694
+ /** Resolved display mode after `auto` pointer-detection: `'chips'` on fine-pointer devices, `'compact'` on coarse. */
695
+ get _effectiveDisplay() {
696
+ return this.display === "chips" ? "chips" : this.display === "compact" || window.matchMedia("(pointer: coarse)").matches ? "compact" : "chips";
697
+ }
698
+ /** Looks up the display label for `value` from native `<select>` option text; returns `value` itself as a fallback. */
699
+ _labelFor(e) {
700
+ const t = this._$selectRef?.deref();
701
+ if (t) {
702
+ for (const i of t.options)
703
+ if (i.value === e)
704
+ return i.text;
705
+ }
706
+ return e;
707
+ }
708
+ /** Text shown in the trigger's value-display area; returns placeholder when chips are active or nothing is selected. */
709
+ get _displayLabel() {
710
+ if (this._selectedValues.size === 0)
711
+ return this.placeholder;
712
+ if (this._effectiveDisplay === "chips" && this.multiple)
713
+ return this.placeholder;
714
+ if (this._selectedValues.size === 1)
715
+ return this._labelFor([...this._selectedValues][0]);
716
+ const e = [...this._selectedValues];
717
+ return `${this._labelFor(e[0])}, +${e.length - 1} more`;
718
+ }
719
+ /**
720
+ * APG Combobox keyboard handler on the trigger.
721
+ *
722
+ * Arrow keys navigate/open, Space/Enter activate, Tab closes without focus return,
723
+ * ArrowLeft enters chip navigation, and printable chars forward to type-ahead.
724
+ */
725
+ _handleTriggerKeyDown(e) {
726
+ switch (e.key) {
727
+ case "ArrowDown":
728
+ e.preventDefault(), this.open ? this._activeDescendantCtrl.navigate(1) : (this.openPopup(), this._activeDescendantCtrl.navigateToFirst());
729
+ break;
730
+ case "ArrowUp":
731
+ e.preventDefault(), this.open ? this._activeDescendantCtrl.navigate(-1) : (this.openPopup(), this._activeDescendantCtrl.navigateToLast());
732
+ break;
733
+ case "Home":
734
+ this.open && (e.preventDefault(), this._activeDescendantCtrl.navigateToFirst());
735
+ break;
736
+ case "End":
737
+ this.open && (e.preventDefault(), this._activeDescendantCtrl.navigateToLast());
738
+ break;
739
+ case " ":
740
+ case "Enter":
741
+ e.preventDefault(), this.open ? this._activateActive() : (this.openPopup(), this._activeDescendantCtrl.navigateToFirst());
742
+ break;
743
+ case "Tab":
744
+ this.open && this.closePopup(!1);
745
+ break;
746
+ case "ArrowLeft":
747
+ !this.open && this.multiple && this._selectedValues.size > 0 && (e.preventDefault(), this._enterChipNav());
748
+ break;
749
+ default:
750
+ e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && this._handleTypeAhead(e.key);
751
+ }
752
+ }
753
+ /**
754
+ * Dispatches a synthetic `pointerdown` on the active listbox item to activate it.
755
+ *
756
+ * Prefers `pointerdown` over a direct call so listbox item click logic
757
+ * (which is bound to `pointerdown`) fires through its normal path.
758
+ */
759
+ _activateActive() {
760
+ const e = this._activeDescendantCtrl.activeItem;
761
+ e && e.dispatchEvent(new PointerEvent("pointerdown", { bubbles: !0, cancelable: !0 }));
762
+ }
763
+ /**
764
+ * Accumulates characters in `_typeAheadBuffer` and either immediately selects
765
+ * the first match (closed single-select) or moves the virtual cursor (open popup).
766
+ */
767
+ _handleTypeAhead(e) {
768
+ clearTimeout(this._typeAheadTimer), this._typeAheadBuffer += e.toLowerCase(), this._typeAheadTimer = window.setTimeout(() => {
769
+ this._typeAheadBuffer = "";
770
+ }, 500);
771
+ const i = (this._$listbox?.allOptions ?? []).find(
772
+ (s) => !s.disabled && s.label.toLowerCase().startsWith(this._typeAheadBuffer)
773
+ );
774
+ if (i)
775
+ if (!this.open)
776
+ this.multiple || (this._selectionInitialized = !0, this._applySelection([i.value], !0), this._dispatchChange());
777
+ else {
778
+ const r = this._$listbox.navigableItems.find((l) => l.getAttribute("data-value") === i.value);
779
+ r && this._activeDescendantCtrl.navigateToItem(r);
780
+ }
781
+ }
782
+ /** Focuses the last chip button and sets `_chipNavIndex` to begin roving-tabindex navigation within the chip group. */
783
+ _enterChipNav() {
784
+ const e = this._$chipButtons();
785
+ e.length !== 0 && (this._chipNavIndex = e.length - 1, e[this._chipNavIndex].focus());
786
+ }
787
+ /** Queries all native remove buttons inside input chips; order matches DOM order. */
788
+ _$chipButtons() {
789
+ return Array.from(
790
+ this.renderRoot.querySelectorAll('rc-chip > button[part~="chip"]')
791
+ );
792
+ }
793
+ /**
794
+ * Keyboard handler for chip buttons.
795
+ *
796
+ * ArrowLeft/Right rove chip focus, Escape returns to trigger,
797
+ * Delete/Backspace/Enter/Space remove the chip's value
798
+ * and return focus to the trigger.
799
+ */
800
+ _handleChipKeyDown(e, t) {
801
+ const i = this._$chipButtons();
802
+ switch (e.key) {
803
+ case "ArrowLeft":
804
+ e.preventDefault(), this._chipNavIndex > 0 && (this._chipNavIndex--, i[this._chipNavIndex]?.focus());
805
+ break;
806
+ case "ArrowRight":
807
+ e.preventDefault(), this._chipNavIndex < i.length - 1 ? (this._chipNavIndex++, i[this._chipNavIndex]?.focus()) : (this._chipNavIndex = -1, this._$trigger?.focus());
808
+ break;
809
+ case "Escape":
810
+ e.preventDefault(), this._chipNavIndex = -1, this._$trigger?.focus();
811
+ break;
812
+ case "Delete":
813
+ case "Backspace":
814
+ case "Enter":
815
+ case " ":
816
+ e.preventDefault(), this._removeValue(t), this._chipNavIndex = -1, this._$trigger?.focus();
817
+ break;
818
+ }
819
+ }
820
+ /** Toggles the popup open or closed on trigger click. */
821
+ _handleTriggerClick() {
822
+ this.open ? this.closePopup() : this.openPopup();
823
+ }
824
+ get _dialogSelectedValues() {
825
+ return [...this._pendingSelectedValues ?? this._selectedValues];
826
+ }
827
+ _focusDialogContent() {
828
+ this._$listbox?.focus();
829
+ }
830
+ /** Hook for subclasses to finalize provisional options before dialog selection commits. */
831
+ _prepareDialogCommit() {
832
+ }
833
+ _commitDialogSelection() {
834
+ if (!this.open || this._activePopupMode !== "dialog")
835
+ return;
836
+ this._prepareDialogCommit();
837
+ const e = this._dialogSelectedValues, t = this.selectedValues, i = e.length !== t.length || e.some((s) => !t.includes(s));
838
+ this._pendingSelectedValues = null, i && (this._selectionInitialized = !0, this._applySelection(e, !0), this._dispatchChange()), this._$dialogHost?.close("done"), this._finishDialogClose(!0);
839
+ }
840
+ _discardDialogSelection() {
841
+ this._pendingSelectedValues = null, this._$listbox?.setSelectedValues(this.selectedValues);
842
+ }
843
+ _finishDialogClose(e) {
844
+ this.open && (this.open = !1, this._activeDescendantCtrl.clear(), e && this._$trigger?.focus(), this.dispatchEvent(new CustomEvent("rc-select-close", { bubbles: !0, composed: !0 })), this.requestUpdate());
845
+ }
846
+ _handleDialogClose(e) {
847
+ e.stopPropagation(), this.open && (this._discardDialogSelection(), this._finishDialogClose(!0));
848
+ }
849
+ _stopDialogEvent(e) {
850
+ e.stopPropagation();
851
+ }
852
+ _removePendingValue(e) {
853
+ const t = new Set(this._pendingSelectedValues ?? this._selectedValues);
854
+ t.delete(e), this._pendingSelectedValues = t, this._$listbox?.setSelectedValues([...t]), this.requestUpdate();
855
+ }
856
+ _renderDialogBody() {
857
+ return d`
858
+ <rc-listbox
859
+ id="dialog-listbox"
860
+ part="listbox dialog-listbox"
861
+ tabindex="0"
862
+ aria-label=${this._accessibleName || "Options"}
863
+ ?multiple=${this.multiple}
864
+ checkmark
865
+ .options=${this._options}
866
+ @rc-listbox-change=${this._handleListboxChange}
867
+ ></rc-listbox>
868
+ `;
869
+ }
870
+ _renderDialogPopup() {
871
+ const e = this._accessibleName || "Options", t = this.multiple && this._dialogSelectedValues.length > 0;
872
+ return d`
873
+ <rc-dialog
874
+ id="dialog-host"
875
+ variant="fullscreen"
876
+ closed-by="closerequest"
877
+ @rc-dialog-open=${this._stopDialogEvent}
878
+ @rc-dialog-toggle=${this._stopDialogEvent}
879
+ @rc-dialog-request-close=${this._stopDialogEvent}
880
+ @rc-dialog-cancel=${this._stopDialogEvent}
881
+ @rc-dialog-close=${this._handleDialogClose}
882
+ >
883
+ <dialog id="dialog" part="dialog" aria-labelledby="dialog-title">
884
+ <header part="dialog-header">
885
+ ${this.dialogCancelButton === "visible" ? d`
886
+ <button
887
+ part="dialog-cancel"
888
+ type="button"
889
+ aria-label=${this.dialogCancelLabel}
890
+ @click=${() => this.closePopup()}
891
+ >
892
+ <svg
893
+ part="dialog-cancel-icon"
894
+ aria-hidden="true"
895
+ viewBox="0 0 24 24"
896
+ width="24"
897
+ height="24"
898
+ >
899
+ <path
900
+ d="M6.4 5 5 6.4l5.6 5.6L5 17.6 6.4 19l5.6-5.6 5.6 5.6 1.4-1.4-5.6-5.6L19 6.4 17.6 5 12 10.6Z"
901
+ />
902
+ </svg>
903
+ </button>
904
+ ` : p}
905
+
906
+ <h2 id="dialog-title" part="dialog-title">${e}</h2>
907
+
908
+ <div part="dialog-actions">
909
+ <button part="dialog-confirm" type="button" @click=${this._commitDialogSelection}>
910
+ ${this.dialogConfirmLabel}
911
+ </button>
912
+ </div>
913
+ </header>
914
+
915
+ ${t ? d`<div part="dialog-selected">
916
+ ${this._renderChips(this._dialogSelectedValues, !0)}
917
+ </div>` : p}
918
+ ${this._renderDialogBody()}
919
+ </dialog>
920
+ </rc-dialog>
921
+ `;
922
+ }
923
+ render() {
924
+ return (this.open ? this._activePopupMode : this.popupMode) === "dialog" ? d`
925
+ ${this._renderAnchor()} ${this.open ? this._renderDialogPopup() : p}
926
+ <slot @slotchange=${this._handleSelectSlotChange}></slot>
927
+ ` : d`
928
+ ${this._renderAnchor()}
929
+
930
+ <rc-listbox
931
+ id="listbox"
932
+ part="listbox"
933
+ popover="manual"
934
+ ?multiple=${this.multiple}
935
+ checkmark
936
+ @rc-listbox-change=${this._handleListboxChange}
937
+ ></rc-listbox>
938
+
939
+ <slot @slotchange=${this._handleSelectSlotChange}></slot>
940
+ `;
941
+ }
942
+ _renderAnchor() {
943
+ const e = this.multiple && this._effectiveDisplay === "chips" && this._selectedValues.size > 0, t = (this.open ? this._activePopupMode : this.popupMode) === "dialog";
944
+ return d`
945
+ <div id="anchor" part="anchor">
946
+ <div
947
+ id="trigger"
948
+ part="trigger"
949
+ role="combobox"
950
+ tabindex=${this.disabled ? "-1" : "0"}
951
+ aria-haspopup=${t ? "dialog" : "listbox"}
952
+ aria-expanded=${this.open ? "true" : "false"}
953
+ aria-controls=${t ? "dialog" : "listbox"}
954
+ aria-disabled=${this.disabled ? "true" : "false"}
955
+ aria-required=${this.required ? "true" : "false"}
956
+ aria-label=${this.placeholder || p}
957
+ @click=${this._handleTriggerClick}
958
+ @keydown=${this._handleTriggerKeyDown}
959
+ >
960
+ ${e ? this._renderChips() : p}
961
+
962
+ <span part="value-display">${this._displayLabel}</span>
963
+
964
+ <span part="toggle-indicator" aria-hidden="true">
965
+ <slot name="toggle-indicator">
966
+ <svg
967
+ width="10"
968
+ height="6"
969
+ viewBox="0 0 10 6"
970
+ fill="none"
971
+ stroke="currentColor"
972
+ stroke-width="1.5"
973
+ stroke-linecap="round"
974
+ stroke-linejoin="round"
975
+ >
976
+ <polyline points="1,1 5,5 9,1" />
977
+ </svg>
978
+ </slot>
979
+ </span>
980
+ </div>
981
+ </div>
982
+ `;
983
+ }
984
+ /** Renders selected values as removable input chips inside the shared chip-group layout. */
985
+ _renderChips(e = this._selectedValues, t = !1) {
986
+ return d`
987
+ <rc-chip-group part="chips" kind="generic" layout="wrap" aria-label="Selected items">
988
+ ${[...e].map((i) => {
989
+ const s = this._labelFor(i);
990
+ return d`
991
+ <rc-chip
992
+ variant="input"
993
+ removable
994
+ data-value=${i}
995
+ @rc-chip-remove=${(r) => {
996
+ r.stopPropagation(), t ? this._removePendingValue(i) : this._removeValue(i);
997
+ }}
998
+ >
999
+ <button
1000
+ type="button"
1001
+ part="chip"
1002
+ tabindex="-1"
1003
+ aria-label=${`Remove ${s}`}
1004
+ @click=${(r) => r.stopPropagation()}
1005
+ @keydown=${(r) => this._handleChipKeyDown(r, i)}
1006
+ >
1007
+ <span part="chip-label">${s}</span>
1008
+ </button>
1009
+ <span slot="remove-icon" part="chip-remove" aria-hidden="true">&#215;</span>
1010
+ </rc-chip>
1011
+ `;
1012
+ })}
1013
+ </rc-chip-group>
1014
+ `;
1015
+ }
1016
+ };
1017
+ v.styles = x;
1018
+ let o = v;
1019
+ a([
1020
+ c({ type: Boolean, reflect: !0 })
1021
+ ], o.prototype, "open");
1022
+ a([
1023
+ c({ type: Boolean, reflect: !0 })
1024
+ ], o.prototype, "multiple");
1025
+ a([
1026
+ c({ type: Boolean, reflect: !0 })
1027
+ ], o.prototype, "disabled");
1028
+ a([
1029
+ c({ type: Boolean, reflect: !0 })
1030
+ ], o.prototype, "required");
1031
+ a([
1032
+ c()
1033
+ ], o.prototype, "placeholder");
1034
+ a([
1035
+ c()
1036
+ ], o.prototype, "display");
1037
+ a([
1038
+ c({ attribute: "popup-mode", reflect: !0 })
1039
+ ], o.prototype, "popupMode");
1040
+ a([
1041
+ c({ attribute: "dialog-confirm-label" })
1042
+ ], o.prototype, "dialogConfirmLabel");
1043
+ a([
1044
+ c({ attribute: "dialog-cancel-label" })
1045
+ ], o.prototype, "dialogCancelLabel");
1046
+ a([
1047
+ c({ attribute: "dialog-cancel-button", reflect: !0 })
1048
+ ], o.prototype, "dialogCancelButton");
1049
+ a([
1050
+ u("#anchor")
1051
+ ], o.prototype, "_$anchor");
1052
+ a([
1053
+ u("#trigger")
1054
+ ], o.prototype, "_$trigger");
1055
+ a([
1056
+ u("rc-listbox")
1057
+ ], o.prototype, "_$listbox");
1058
+ a([
1059
+ u("#dialog-host")
1060
+ ], o.prototype, "_$dialogHost");
1061
+ a([
1062
+ h()
1063
+ ], o.prototype, "_selectedValues");
1064
+ a([
1065
+ h()
1066
+ ], o.prototype, "_pendingSelectedValues");
1067
+ a([
1068
+ h()
1069
+ ], o.prototype, "_accessibleName");
1070
+ a([
1071
+ h()
1072
+ ], o.prototype, "_chipNavIndex");
1073
+ a([
1074
+ h()
1075
+ ], o.prototype, "_options");
1076
+ export {
1077
+ o as R
1078
+ };
1079
+ //# sourceMappingURL=rc-select-MQcvA385.js.map