@wrdagency/blockout 0.0.19 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/2NBKRL7C-BAzCMGOw.js +85 -0
  2. package/dist/2RSXSRCN-qt84MtKs.js +61 -0
  3. package/dist/4CMBR7SL-BAGv8IL2.js +308 -0
  4. package/dist/5JTVDSTH-CG1NL6Fw.js +174 -0
  5. package/dist/5VQZOHHZ-CscZGerP.js +59 -0
  6. package/dist/6VRAQV3D-2rb_aClP.js +201 -0
  7. package/dist/7PRQYBBV-91wrWGjk.js +17 -0
  8. package/dist/ArrowRight.es-xyNbtVOa.js +60 -0
  9. package/dist/DG5U6ZEL-CVj-Czp2.js +17 -0
  10. package/dist/F5MUBM3I-87B2_4WK.js +54 -0
  11. package/dist/LMDWO4NN--KEvZePp.js +610 -0
  12. package/dist/MTZPJQMC-DyCWBG18.js +14 -0
  13. package/dist/P7GR5CS5-BoOYUfSQ.js +19 -0
  14. package/dist/PFRGBC2K-BEg8ahbY.js +303 -0
  15. package/dist/RS7LB2H4-D0fWv5qu.js +15 -0
  16. package/dist/RZ4GPYOB-13-5LlEb.js +37 -0
  17. package/dist/S43UC3DV-Dn8EFLaT.js +22 -0
  18. package/dist/Square.es-KJLdY11q.js +72 -0
  19. package/dist/T7VMP3TM-DeRMoW8g.js +77 -0
  20. package/dist/TP7N7UIH-BHb1rEeb.js +34 -0
  21. package/dist/UQQRIHDV-Bu8e1bYU.js +69 -0
  22. package/dist/UYGDZTLQ-DcCmv5SE.js +12 -0
  23. package/dist/VIIRIBF3-D5DmZNtI.js +26 -0
  24. package/dist/WMYDSCNQ-Dy1O-Kdl.js +2405 -0
  25. package/dist/WYCIER3C-DRn904Gy.js +175 -0
  26. package/dist/YV4JVR4I-kvospPUa.js +351 -0
  27. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  28. package/dist/assets/button.css +1 -1
  29. package/dist/assets/index.css +1 -1
  30. package/dist/assets/index10.css +1 -1
  31. package/dist/assets/index11.css +1 -1
  32. package/dist/assets/index12.css +1 -1
  33. package/dist/assets/index13.css +1 -1
  34. package/dist/assets/index14.css +1 -0
  35. package/dist/assets/index15.css +1 -0
  36. package/dist/assets/index16.css +1 -0
  37. package/dist/assets/index17.css +1 -0
  38. package/dist/assets/index18.css +1 -0
  39. package/dist/assets/index2.css +1 -1
  40. package/dist/assets/index3.css +1 -1
  41. package/dist/assets/index4.css +1 -1
  42. package/dist/assets/index5.css +1 -1
  43. package/dist/assets/index6.css +1 -1
  44. package/dist/assets/index7.css +1 -1
  45. package/dist/assets/index8.css +1 -1
  46. package/dist/assets/index9.css +1 -1
  47. package/dist/assets/style.css +1 -1
  48. package/dist/assets/style2.css +1 -0
  49. package/dist/assets/style3.css +1 -0
  50. package/dist/assets/style4.css +1 -0
  51. package/dist/assets/styles.css +1 -1
  52. package/dist/components/block-editor/editor.d.ts +5 -0
  53. package/dist/components/block-editor/editor.js +6 -0
  54. package/dist/components/block-editor/index.d.ts +1 -0
  55. package/dist/components/block-editor/index.js +4 -0
  56. package/dist/components/breadcrumbs/index.js +87 -31
  57. package/dist/components/button/button.d.ts +1 -1
  58. package/dist/components/button/button.js +5 -5
  59. package/dist/components/button/icon.d.ts +1 -2
  60. package/dist/components/button/icon.js +10 -3
  61. package/dist/components/button/index.d.ts +4 -0
  62. package/dist/components/controls/base-control/affix.js +7 -7
  63. package/dist/components/controls/base-control/index.js +11 -11
  64. package/dist/components/controls/base-popover-control/index.d.ts +9 -0
  65. package/dist/components/controls/base-popover-control/index.js +47 -0
  66. package/dist/components/controls/checkbox-control/index.d.ts +8 -0
  67. package/dist/components/controls/checkbox-control/index.js +57 -0
  68. package/dist/components/controls/choice-control/choice.js +13 -11
  69. package/dist/components/controls/choice-control/index.js +1 -1
  70. package/dist/components/controls/index.d.ts +4 -1
  71. package/dist/components/controls/index.js +25 -16
  72. package/dist/components/controls/number-control/index.js +29 -27
  73. package/dist/components/controls/password-control/index.js +1 -1
  74. package/dist/components/controls/recurrence-control/index.d.ts +8 -0
  75. package/dist/components/controls/recurrence-control/index.js +208 -0
  76. package/dist/components/controls/select-control/component.d.ts +12 -0
  77. package/dist/components/controls/select-control/component.js +1879 -0
  78. package/dist/components/controls/select-control/index.d.ts +2 -12
  79. package/dist/components/controls/select-control/index.js +5 -1860
  80. package/dist/components/controls/select-control/options.d.ts +7 -0
  81. package/dist/components/controls/select-control/options.js +9 -0
  82. package/dist/components/controls/textarea-control/index.js +1 -1
  83. package/dist/components/controls/toggle-control/index.js +11 -9
  84. package/dist/components/controls/toggle-group-control/index.d.ts +19 -0
  85. package/dist/components/controls/toggle-group-control/index.js +50 -0
  86. package/dist/components/data-table/column.js +1 -1
  87. package/dist/components/data-table/header.js +120 -171
  88. package/dist/components/data-table/index.js +1 -1
  89. package/dist/components/filesystem/file.d.ts +7 -0
  90. package/dist/components/filesystem/file.js +44 -0
  91. package/dist/components/filesystem/folder.d.ts +6 -0
  92. package/dist/components/filesystem/folder.js +160 -0
  93. package/dist/components/filesystem/icon.d.ts +7 -0
  94. package/dist/components/filesystem/icon.js +908 -0
  95. package/dist/components/filesystem/index.js +14 -0
  96. package/dist/components/filesystem/list.d.ts +4 -0
  97. package/dist/components/filesystem/list.js +18 -0
  98. package/dist/components/filesystem/root.d.ts +3 -0
  99. package/dist/components/filesystem/root.js +7 -0
  100. package/dist/components/form/components/index.js +12 -12
  101. package/dist/components/form/components/pagination.js +23 -16
  102. package/dist/components/form/components/progress.d.ts +3 -2
  103. package/dist/components/index.d.ts +4 -0
  104. package/dist/components/index.js +48 -31
  105. package/dist/components/menu/index.js +24 -23
  106. package/dist/components/menu/item.js +1 -1
  107. package/dist/components/menu/items/action.js +1 -1
  108. package/dist/components/menu/items/spacer.js +14 -42
  109. package/dist/components/menu/items/submenu.js +2 -2
  110. package/dist/components/menu/items/toggle.js +25 -91
  111. package/dist/components/progress/index.d.ts +5 -3
  112. package/dist/components/progress/index.js +44 -27
  113. package/dist/components/tabs/index.js +12 -0
  114. package/dist/components/tabs/list.d.ts +7 -0
  115. package/dist/components/tabs/list.js +42 -0
  116. package/dist/components/tabs/panel.d.ts +8 -0
  117. package/dist/components/tabs/panel.js +132 -0
  118. package/dist/components/tabs/root.d.ts +9 -0
  119. package/dist/components/tabs/root.js +173 -0
  120. package/dist/components/tabs/tab.d.ts +7 -0
  121. package/dist/components/tabs/tab.js +81 -0
  122. package/dist/components/toolbar/index.js +27 -0
  123. package/dist/components/toolbar/root.d.ts +6 -0
  124. package/dist/components/toolbar/root.js +6 -0
  125. package/dist/composite-provider-DNftbE5U.js +10 -0
  126. package/dist/hooks/state.d.ts +4 -0
  127. package/dist/hooks/state.js +7 -0
  128. package/dist/hooks/theme.js +7 -38
  129. package/dist/index-1AjPIqTN.js +73 -0
  130. package/dist/index-Cgx3BqdJ.js +388 -0
  131. package/dist/index.js +61 -40
  132. package/dist/{item-D9r2-3fk.js → item-B1ugJ7YQ.js} +240 -234
  133. package/dist/options-Cfoqhxw2.js +96 -0
  134. package/dist/primitives/index.d.ts +2 -0
  135. package/dist/primitives/index.js +4 -0
  136. package/dist/primitives/resizable/index.js +1 -1
  137. package/dist/primitives/scroll-area/index.d.ts +7 -0
  138. package/dist/primitives/scroll-area/index.js +777 -0
  139. package/dist/primitives/truncate/index.d.ts +7 -0
  140. package/dist/primitives/truncate/index.js +46 -0
  141. package/dist/primitives/visually-hidden/index.d.ts +2 -2
  142. package/dist/primitives/visually-hidden/index.js +13 -3
  143. package/dist/root-CaKPdqzv.js +73 -0
  144. package/dist/types/date.d.ts +39 -0
  145. package/dist/types/date.js +1778 -0
  146. package/dist/types/options.d.ts +8 -6
  147. package/dist/utils/components.d.ts +5 -0
  148. package/dist/utils/components.js +14 -0
  149. package/dist/utils/date.d.ts +1 -0
  150. package/dist/utils/date.js +15 -0
  151. package/dist/utils/string.d.ts +4 -0
  152. package/dist/utils/string.js +18 -0
  153. package/package.json +4 -2
  154. package/dist/2NBKRL7C-D-Q0qGRV.js +0 -81
  155. package/dist/P7GR5CS5-qyeuZVEs.js +0 -640
  156. package/dist/T7VMP3TM-BxgFbvdx.js +0 -2106
  157. package/dist/UQQRIHDV-BGs025hb.js +0 -1046
  158. package/dist/VIIRIBF3-D9clDhln.js +0 -21
  159. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  160. package/dist/components/markdown/formats.d.ts +0 -11
  161. package/dist/components/markdown/formats.js +0 -318
  162. package/dist/components/markdown/index.d.ts +0 -7
  163. package/dist/components/markdown/index.js +0 -25845
  164. package/dist/components/markdown/types/format.d.ts +0 -27
  165. package/dist/components/markdown/types/format.js +0 -4
  166. package/dist/floating-ui.dom-9sqP7IwC.js +0 -1512
@@ -1,1862 +1,7 @@
1
- import { jsx as I, jsxs as se, Fragment as Fe } from "react/jsx-runtime";
2
- import { normalizeOption as Zt } from "../../../types/options.js";
3
- import { noop as $t } from "../../../utils/noop.js";
4
- import { e as qt } from "../../../CaretDown.es-eySGHzTJ.js";
5
- import * as M from "react";
6
- import { createContext as ge, useMemo as Ee, useState as de, useRef as le, useEffect as ae, useCallback as Je, useContext as Ve, startTransition as zt } from "react";
7
- import { w as Yt } from "../../../SSRBase.es-BUXS72ra.js";
8
- import { g as Gt } from "../../../_commonjsHelpers-DaMA6jEr.js";
9
- import { BaseControl as Jt } from "../base-control/index.js";
10
- import { useBaseControlProps as Qt } from "../base-control/props.js";
11
- import { c as Qe, P as Xt, C as Xe, a as en, b as et, d as te, _ as ne, q as tn, i as me, j as R, k as x, t as tt, f as oe, e as re, K as nt, x as ue, y as D, z as Z, M as Me, u as L, g as G, G as he, s as Ae, O as ot, a2 as rt, m as lt, r as Ie, J as nn, h as on, l as st, n as at, ag as rn, ah as ut, a3 as ln, D as sn, a6 as an, ai as un, aj as cn, ak as dn, ac as Be, al as Pe, U as mn, af as fn, v as ke, H as vn, a4 as pn, am as bn, W as hn } from "../../../P7GR5CS5-qyeuZVEs.js";
12
- import { d as it, c as ct, t as dt, e as mt, k as ft, u as vt, f as pt, j as Sn, h as bt, i as ht, g as St, b as Cn, a as gn, l as En, C as On, m as Ct, n as gt, o as xn, p as yn, q as An, r as In } from "../../../T7VMP3TM-BxgFbvdx.js";
13
- import { m as Et, o as wn, t as Ot, c as xt, f as J, s as Q, i as yt, g as At, d as be, j as It, a as wt, b as Pt, u as Pn, p as Vn, k as _e } from "../../../UQQRIHDV-BGs025hb.js";
14
- import '../../../assets/index12.css';const kn = /* @__PURE__ */ new Map([
15
- [
16
- "bold",
17
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z" }))
18
- ],
19
- [
20
- "duotone",
21
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z", opacity: "0.2" }), /* @__PURE__ */ M.createElement("path", { d: "M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
22
- ],
23
- [
24
- "fill",
25
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z" }))
26
- ],
27
- [
28
- "light",
29
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z" }))
30
- ],
31
- [
32
- "regular",
33
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
34
- ],
35
- [
36
- "thin",
37
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z" }))
38
- ]
39
- ]), Vt = M.forwardRef((t, n) => /* @__PURE__ */ M.createElement(Yt, { ref: n, ...t, weights: kn }));
40
- Vt.displayName = "MagnifyingGlassIcon";
41
- var Oe = Qe(
42
- [en, et],
43
- [Xt, Xe]
44
- ), De = Oe.useContext, _n = Oe.useScopedContext, Ne = Oe.useProviderContext, Mn = Oe.ContextProvider, kt = Oe.ScopedContextProvider, Dn = ge(!1), je = ge(null), Nn = "span", Tn = {
45
- top: "4,10 8,6 12,10",
46
- right: "6,4 10,8 6,12",
47
- bottom: "4,6 8,10 12,6",
48
- left: "10,4 6,8 10,12"
49
- }, _t = te(function(n) {
50
- var o = n, { store: e, placement: r } = o, l = ne(o, ["store", "placement"]);
51
- const a = tn();
52
- e = e || a, me(
53
- e,
54
- process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
55
- );
56
- const f = e.useState((s) => r || s.placement).split("-")[0], c = Tn[f], u = Ee(
57
- () => /* @__PURE__ */ I(
58
- "svg",
59
- {
60
- display: "block",
61
- fill: "none",
62
- stroke: "currentColor",
63
- strokeLinecap: "round",
64
- strokeLinejoin: "round",
65
- strokeWidth: 1.5,
66
- viewBox: "0 0 16 16",
67
- height: "1em",
68
- width: "1em",
69
- children: /* @__PURE__ */ I("polyline", { points: c })
70
- }
71
- ),
72
- [c]
73
- );
74
- return l = R(x({
75
- children: u,
76
- "aria-hidden": !0
77
- }, l), {
78
- style: x({
79
- width: "1em",
80
- height: "1em",
81
- pointerEvents: "none"
82
- }, l.style)
83
- }), tt(l);
84
- });
85
- oe(
86
- function(n) {
87
- const o = _t(n);
88
- return re(Nn, o);
89
- }
90
- );
91
- function Ln(t = {}) {
92
- var n = t, {
93
- combobox: o
94
- } = n, e = nt(n, [
95
- "combobox"
96
- ]);
97
- const r = Et(
98
- e.store,
99
- wn(o, [
100
- "value",
101
- "items",
102
- "renderedItems",
103
- "baseElement",
104
- "arrowElement",
105
- "anchorElement",
106
- "contentElement",
107
- "popoverElement",
108
- "disclosureElement"
109
- ])
110
- );
111
- Ot(e, r);
112
- const l = r.getState(), a = it(ue(Z({}, e), {
113
- store: r,
114
- virtualFocus: D(
115
- e.virtualFocus,
116
- l.virtualFocus,
117
- !0
118
- ),
119
- includesBaseElement: D(
120
- e.includesBaseElement,
121
- l.includesBaseElement,
122
- !1
123
- ),
124
- activeId: D(
125
- e.activeId,
126
- l.activeId,
127
- e.defaultActiveId,
128
- null
129
- ),
130
- orientation: D(
131
- e.orientation,
132
- l.orientation,
133
- "vertical"
134
- )
135
- })), m = ct(ue(Z({}, e), {
136
- store: r,
137
- placement: D(
138
- e.placement,
139
- l.placement,
140
- "bottom-start"
141
- )
142
- })), f = new String(""), c = ue(Z(Z({}, a.getState()), m.getState()), {
143
- value: D(
144
- e.value,
145
- l.value,
146
- e.defaultValue,
147
- f
148
- ),
149
- setValueOnMove: D(
150
- e.setValueOnMove,
151
- l.setValueOnMove,
152
- !1
153
- ),
154
- labelElement: D(l.labelElement, null),
155
- selectElement: D(l.selectElement, null),
156
- listElement: D(l.listElement, null)
157
- }), u = xt(c, a, m, r);
158
- return J(
159
- u,
160
- () => Q(u, ["value", "items"], (s) => {
161
- if (s.value !== f || !s.items.length) return;
162
- const v = s.items.find(
163
- (C) => !C.disabled && C.value != null
164
- );
165
- (v == null ? void 0 : v.value) != null && u.setState("value", v.value);
166
- })
167
- ), J(
168
- u,
169
- () => Q(u, ["mounted"], (s) => {
170
- s.mounted || u.setState("activeId", c.activeId);
171
- })
172
- ), J(
173
- u,
174
- () => Q(u, ["mounted", "items", "value"], (s) => {
175
- if (o || s.mounted) return;
176
- const v = dt(s.value), C = v[v.length - 1];
177
- if (C == null) return;
178
- const d = s.items.find(
179
- (p) => !p.disabled && p.value === C
180
- );
181
- d && u.setState("activeId", d.id);
182
- })
183
- ), J(
184
- u,
185
- () => yt(u, ["setValueOnMove", "moves"], (s) => {
186
- const { mounted: v, value: C, activeId: d } = u.getState();
187
- if (!s.setValueOnMove && v || Array.isArray(C) || !s.moves || !d) return;
188
- const p = a.item(d);
189
- !p || p.disabled || p.value == null || u.setState("value", p.value);
190
- })
191
- ), ue(Z(Z(Z({}, a), m), u), {
192
- combobox: o,
193
- setValue: (s) => u.setState("value", s),
194
- setLabelElement: (s) => u.setState("labelElement", s),
195
- setSelectElement: (s) => u.setState("selectElement", s),
196
- setListElement: (s) => u.setState("listElement", s)
197
- });
198
- }
199
- function Rn(t) {
200
- const n = mt();
201
- return t = R(x({}, t), {
202
- combobox: t.combobox !== void 0 ? t.combobox : n
203
- }), ft(t);
204
- }
205
- function Kn(t, n, o) {
206
- return Me(n, [o.combobox]), be(t, o, "value", "setValue"), be(t, o, "setValueOnMove"), Object.assign(
207
- vt(
208
- pt(t, n, o),
209
- n,
210
- o
211
- ),
212
- { combobox: o.combobox }
213
- );
214
- }
215
- function Hn(t = {}) {
216
- t = Rn(t);
217
- const [n, o] = At(Ln, t);
218
- return Kn(n, o, t);
219
- }
220
- var Un = "span", Fn = te(
221
- function(n) {
222
- var o = n, { store: e } = o, r = ne(o, ["store"]);
223
- const l = De();
224
- return e = e || l, r = _t(x({ store: e }, r)), r;
225
- }
226
- ), Bn = oe(function(n) {
227
- const o = Fn(n);
228
- return re(Un, o);
229
- }), jn = "button";
230
- function Wn(t) {
231
- return Array.from(t.selectedOptions).map((n) => n.value);
232
- }
233
- function ye(t, n) {
234
- return () => {
235
- const o = n();
236
- if (!o) return;
237
- let e = 0, r = t.item(o);
238
- const l = r;
239
- for (; r && r.value == null; ) {
240
- const a = n(++e);
241
- if (!a) return;
242
- if (r = t.item(a), r === l) break;
243
- }
244
- return r == null ? void 0 : r.id;
245
- };
246
- }
247
- var Zn = te(function(n) {
248
- var o = n, {
249
- store: e,
250
- name: r,
251
- form: l,
252
- required: a,
253
- showOnKeyDown: m = !0,
254
- moveOnKeyDown: f = !0,
255
- toggleOnPress: c = !0,
256
- toggleOnClick: u = c
257
- } = o, s = ne(o, [
258
- "store",
259
- "name",
260
- "form",
261
- "required",
262
- "showOnKeyDown",
263
- "moveOnKeyDown",
264
- "toggleOnPress",
265
- "toggleOnClick"
266
- ]);
267
- const v = Ne();
268
- e = e || v, me(
269
- e,
270
- process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
271
- );
272
- const C = s.onKeyDown, d = L(m), p = L(f), y = e.useState("placement").split("-")[0], g = e.useState("value"), W = Array.isArray(g), K = G((S) => {
273
- var E;
274
- if (C == null || C(S), S.defaultPrevented || !e) return;
275
- const { orientation: q, items: z, activeId: X } = e.getState(), fe = q !== "horizontal", ie = q !== "vertical", _ = !!((E = z.find((xe) => !xe.disabled && xe.value != null)) != null && E.rowId), pe = {
276
- ArrowUp: (_ || fe) && ye(e, e.up),
277
- ArrowRight: (_ || ie) && ye(e, e.next),
278
- ArrowDown: (_ || fe) && ye(e, e.down),
279
- ArrowLeft: (_ || ie) && ye(e, e.previous)
280
- }[S.key];
281
- pe && p(S) && (S.preventDefault(), e.move(pe()));
282
- const Se = y === "top" || y === "bottom";
283
- ({
284
- ArrowDown: Se,
285
- ArrowUp: Se,
286
- ArrowLeft: y === "left",
287
- ArrowRight: y === "right"
288
- })[S.key] && d(S) && (S.preventDefault(), e.move(X), rt(S.currentTarget, "keyup", e.show));
289
- });
290
- s = he(
291
- s,
292
- (S) => /* @__PURE__ */ I(kt, { value: e, children: S }),
293
- [e]
294
- );
295
- const [$, k] = de(!1), w = le(!1);
296
- ae(() => {
297
- const S = w.current;
298
- w.current = !1, !S && k(!1);
299
- }, [g]);
300
- const U = e.useState((S) => {
301
- var E;
302
- return (E = S.labelElement) == null ? void 0 : E.id;
303
- }), b = s["aria-label"], O = s["aria-labelledby"] || U, F = e.useState((S) => {
304
- if (r)
305
- return S.items;
306
- }), B = Ee(() => [...new Set(F == null ? void 0 : F.map((S) => S.value).filter((S) => S != null))], [F]);
307
- s = he(
308
- s,
309
- (S) => r ? /* @__PURE__ */ se(Fe, { children: [
310
- /* @__PURE__ */ se(
311
- "select",
312
- {
313
- style: {
314
- border: 0,
315
- clip: "rect(0 0 0 0)",
316
- height: "1px",
317
- margin: "-1px",
318
- overflow: "hidden",
319
- padding: 0,
320
- position: "absolute",
321
- whiteSpace: "nowrap",
322
- width: "1px"
323
- },
324
- tabIndex: -1,
325
- "aria-hidden": !0,
326
- "aria-label": b,
327
- "aria-labelledby": O,
328
- name: r,
329
- form: l,
330
- required: a,
331
- disabled: s.disabled,
332
- value: g,
333
- multiple: W,
334
- onFocus: () => {
335
- var E;
336
- return (E = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : E.focus();
337
- },
338
- onChange: (E) => {
339
- w.current = !0, k(!0), e == null || e.setValue(
340
- W ? Wn(E.target) : E.target.value
341
- );
342
- },
343
- children: [
344
- dt(g).map((E) => E == null || B.includes(E) ? null : /* @__PURE__ */ I("option", { value: E, children: E }, E)),
345
- B.map((E) => /* @__PURE__ */ I("option", { value: E, children: E }, E))
346
- ]
347
- }
348
- ),
349
- S
350
- ] }) : S,
351
- [
352
- e,
353
- b,
354
- O,
355
- r,
356
- l,
357
- a,
358
- g,
359
- W,
360
- B,
361
- s.disabled
362
- ]
363
- );
364
- const h = /* @__PURE__ */ se(Fe, { children: [
365
- g,
366
- /* @__PURE__ */ I(Bn, {})
367
- ] }), P = e.useState("contentElement");
368
- return s = R(x({
369
- role: "combobox",
370
- "aria-autocomplete": "none",
371
- "aria-labelledby": U,
372
- "aria-haspopup": ot(P, "listbox"),
373
- "data-autofill": $ || void 0,
374
- "data-name": r,
375
- children: h
376
- }, s), {
377
- ref: Ae(e.setSelectElement, s.ref),
378
- onKeyDown: K
379
- }), s = Sn(x({ store: e, toggleOnClick: u }, s)), s = bt(x({ store: e }, s)), s;
380
- }), $n = oe(function(n) {
381
- const o = Zn(n);
382
- return re(jn, o);
383
- });
384
- function qn(t = {}) {
385
- const n = Hn(t);
386
- return /* @__PURE__ */ I(Mn, { value: n, children: t.children });
387
- }
388
- var zn = "div";
389
- function Yn(t, n) {
390
- if (n != null)
391
- return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
392
- }
393
- var Gn = te(
394
- function(n) {
395
- var o = n, {
396
- store: e,
397
- value: r,
398
- getItem: l,
399
- hideOnClick: a,
400
- setValueOnClick: m = r != null,
401
- preventScrollOnKeyDown: f = !0,
402
- focusOnHover: c = !0
403
- } = o, u = ne(o, [
404
- "store",
405
- "value",
406
- "getItem",
407
- "hideOnClick",
408
- "setValueOnClick",
409
- "preventScrollOnKeyDown",
410
- "focusOnHover"
411
- ]), s;
412
- const v = _n();
413
- e = e || v, me(
414
- e,
415
- process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
416
- );
417
- const C = Ie(u.id), d = nn(u), { listElement: p, multiSelectable: V, selected: y, autoFocus: g } = It(e, {
418
- listElement: "listElement",
419
- multiSelectable(b) {
420
- return Array.isArray(b.value);
421
- },
422
- selected(b) {
423
- return Yn(b.value, r);
424
- },
425
- autoFocus(b) {
426
- return r == null || b.value == null || b.activeId !== C && (e != null && e.item(b.activeId)) ? !1 : Array.isArray(b.value) ? b.value[b.value.length - 1] === r : b.value === r;
427
- }
428
- }), W = Je(
429
- (b) => {
430
- const O = R(x({}, b), {
431
- value: d ? void 0 : r,
432
- children: r
433
- });
434
- return l ? l(O) : O;
435
- },
436
- [d, r, l]
437
- );
438
- a = a ?? (r != null && !V);
439
- const K = u.onClick, $ = L(m), k = L(a), w = G((b) => {
440
- K == null || K(b), !b.defaultPrevented && (st(b) || at(b) || ($(b) && r != null && (e == null || e.setValue((O) => Array.isArray(O) ? O.includes(r) ? O.filter((F) => F !== r) : [...O, r] : r)), k(b) && (e == null || e.hide())));
441
- });
442
- u = he(
443
- u,
444
- (b) => /* @__PURE__ */ I(Dn.Provider, { value: y ?? !1, children: b }),
445
- [y]
446
- ), u = R(x({
447
- id: C,
448
- role: on(p),
449
- "aria-selected": y,
450
- children: r
451
- }, u), {
452
- autoFocus: (s = u.autoFocus) != null ? s : g,
453
- onClick: w
454
- }), u = wt(x({
455
- store: e,
456
- getItem: W,
457
- preventScrollOnKeyDown: f
458
- }, u));
459
- const U = L(c);
460
- return u = Pt(R(x({
461
- store: e
462
- }, u), {
463
- // We have to disable focusOnHover when the popup is closed, otherwise
464
- // the active item will change to null (the container) when the popup is
465
- // closed by clicking on an item.
466
- focusOnHover(b) {
467
- if (!U(b)) return !1;
468
- const O = e == null ? void 0 : e.getState();
469
- return !!(O != null && O.open);
470
- }
471
- })), u;
472
- }
473
- ), Jn = lt(
474
- oe(function(n) {
475
- const o = Gn(n);
476
- return re(zn, o);
477
- })
478
- ), Qn = "div", We = ge(null), Mt = te(
479
- function(n) {
480
- var o = n, {
481
- store: e,
482
- resetOnEscape: r = !0,
483
- hideOnEnter: l = !0,
484
- focusOnMove: a = !0,
485
- composite: m,
486
- alwaysVisible: f
487
- } = o, c = ne(o, [
488
- "store",
489
- "resetOnEscape",
490
- "hideOnEnter",
491
- "focusOnMove",
492
- "composite",
493
- "alwaysVisible"
494
- ]);
495
- const u = De();
496
- e = e || u, me(
497
- e,
498
- process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
499
- );
500
- const s = Ie(c.id), v = e.useState("value"), C = Array.isArray(v), [d, p] = de(v), V = e.useState("mounted");
501
- ae(() => {
502
- V || p(v);
503
- }, [V, v]), r = r && !C;
504
- const y = c.onKeyDown, g = L(r), W = L(l), K = G((_) => {
505
- y == null || y(_), !_.defaultPrevented && (_.key === "Escape" && g(_) && (e == null || e.setValue(d)), (_.key === " " || _.key === "Enter") && ln(_) && W(_) && (_.preventDefault(), e == null || e.hide()));
506
- }), $ = Ve(je), k = de(), [w, U] = $ || k, b = Ee(
507
- () => [w, U],
508
- [w]
509
- ), [O, F] = de(null), B = Ve(We);
510
- ae(() => {
511
- if (B)
512
- return B(e), () => B(null);
513
- }, [B, e]), c = he(
514
- c,
515
- (_) => /* @__PURE__ */ I(kt, { value: e, children: /* @__PURE__ */ I(We.Provider, { value: F, children: /* @__PURE__ */ I(je.Provider, { value: b, children: _ }) }) }),
516
- [e, b]
517
- );
518
- const h = !!e.combobox;
519
- m = m ?? (!h && O !== e);
520
- const [P, S] = rn(
521
- m ? e.setListElement : null
522
- ), E = ut(P, "role", c.role), z = (m || (E === "listbox" || E === "menu" || E === "tree" || E === "grid")) && C || void 0, X = ht(V, c.hidden, f), fe = X ? R(x({}, c.style), { display: "none" }) : c.style;
523
- m && (c = x({
524
- role: "listbox",
525
- "aria-multiselectable": z
526
- }, c));
527
- const ie = e.useState(
528
- (_) => {
529
- var ve;
530
- return w || ((ve = _.labelElement) == null ? void 0 : ve.id);
531
- }
532
- );
533
- return c = R(x({
534
- id: s,
535
- "aria-labelledby": ie,
536
- hidden: X
537
- }, c), {
538
- ref: Ae(S, c.ref),
539
- style: fe,
540
- onKeyDown: K
541
- }), c = St(R(x({ store: e }, c), { composite: m })), c = bt(x({ store: e, typeahead: !h }, c)), c;
542
- }
543
- ), Xn = oe(function(n) {
544
- const o = Mt(n);
545
- return re(Qn, o);
546
- }), eo = "div", to = te(
547
- function(n) {
548
- var o = n, { store: e, alwaysVisible: r } = o, l = ne(o, ["store", "alwaysVisible"]);
549
- const a = Ne();
550
- return e = e || a, l = Mt(x({ store: e, alwaysVisible: r }, l)), l = gn(x({ store: e, alwaysVisible: r }, l)), l;
551
- }
552
- ), no = Cn(
553
- oe(function(n) {
554
- const o = to(n);
555
- return re(eo, o);
556
- }),
557
- Ne
558
- );
559
- function oo({
560
- store: t,
561
- fallback: n,
562
- children: o
563
- } = {}) {
564
- const e = De();
565
- t = t || e;
566
- const r = Pn(t, (l) => l != null && l.value.length ? l.value : n);
567
- return o ? o(r || "") : r;
568
- }
569
- ge(null);
570
- ge(
571
- null
572
- );
573
- var ro = Qe(
574
- [et],
575
- [Xe]
576
- ), lo = ro.useContext, so = an() && un();
577
- function ao(t = {}) {
578
- var n = t, {
579
- tag: o
580
- } = n, e = nt(n, [
581
- "tag"
582
- ]);
583
- const r = Et(e.store, Vn(o, ["value", "rtl"]));
584
- Ot(e, r);
585
- const l = o == null ? void 0 : o.getState(), a = r == null ? void 0 : r.getState(), m = D(
586
- e.activeId,
587
- a == null ? void 0 : a.activeId,
588
- e.defaultActiveId,
589
- null
590
- ), f = it(ue(Z({}, e), {
591
- activeId: m,
592
- includesBaseElement: D(
593
- e.includesBaseElement,
594
- a == null ? void 0 : a.includesBaseElement,
595
- !0
596
- ),
597
- orientation: D(
598
- e.orientation,
599
- a == null ? void 0 : a.orientation,
600
- "vertical"
601
- ),
602
- focusLoop: D(e.focusLoop, a == null ? void 0 : a.focusLoop, !0),
603
- focusWrap: D(e.focusWrap, a == null ? void 0 : a.focusWrap, !0),
604
- virtualFocus: D(
605
- e.virtualFocus,
606
- a == null ? void 0 : a.virtualFocus,
607
- !0
608
- )
609
- })), c = ct(ue(Z({}, e), {
610
- placement: D(
611
- e.placement,
612
- a == null ? void 0 : a.placement,
613
- "bottom-start"
614
- )
615
- })), u = D(
616
- e.value,
617
- a == null ? void 0 : a.value,
618
- e.defaultValue,
619
- ""
620
- ), s = D(
621
- e.selectedValue,
622
- a == null ? void 0 : a.selectedValue,
623
- l == null ? void 0 : l.values,
624
- e.defaultSelectedValue,
625
- ""
626
- ), v = Array.isArray(s), C = ue(Z(Z({}, f.getState()), c.getState()), {
627
- value: u,
628
- selectedValue: s,
629
- resetValueOnSelect: D(
630
- e.resetValueOnSelect,
631
- a == null ? void 0 : a.resetValueOnSelect,
632
- v
633
- ),
634
- resetValueOnHide: D(
635
- e.resetValueOnHide,
636
- a == null ? void 0 : a.resetValueOnHide,
637
- v && !o
638
- ),
639
- activeValue: a == null ? void 0 : a.activeValue
640
- }), d = xt(C, f, c, r);
641
- return so && J(
642
- d,
643
- () => Q(d, ["virtualFocus"], () => {
644
- d.setState("virtualFocus", !1);
645
- })
646
- ), J(d, () => {
647
- if (o)
648
- return sn(
649
- Q(d, ["selectedValue"], (p) => {
650
- Array.isArray(p.selectedValue) && o.setValues(p.selectedValue);
651
- }),
652
- Q(o, ["values"], (p) => {
653
- d.setState("selectedValue", p.values);
654
- })
655
- );
656
- }), J(
657
- d,
658
- () => Q(d, ["resetValueOnHide", "mounted"], (p) => {
659
- p.resetValueOnHide && (p.mounted || d.setState("value", u));
660
- })
661
- ), J(
662
- d,
663
- () => Q(d, ["open"], (p) => {
664
- p.open || (d.setState("activeId", m), d.setState("moves", 0));
665
- })
666
- ), J(
667
- d,
668
- () => Q(d, ["moves", "activeId"], (p, V) => {
669
- p.moves === V.moves && d.setState("activeValue", void 0);
670
- })
671
- ), J(
672
- d,
673
- () => yt(d, ["moves", "renderedItems"], (p, V) => {
674
- if (p.moves === V.moves) return;
675
- const { activeId: y } = d.getState(), g = f.item(y);
676
- d.setState("activeValue", g == null ? void 0 : g.value);
677
- })
678
- ), ue(Z(Z(Z({}, c), f), d), {
679
- tag: o,
680
- setValue: (p) => d.setState("value", p),
681
- resetValue: () => d.setState("value", C.value),
682
- setSelectedValue: (p) => d.setState("selectedValue", p)
683
- });
684
- }
685
- function uo(t) {
686
- const n = lo();
687
- return t = R(x({}, t), {
688
- tag: t.tag !== void 0 ? t.tag : n
689
- }), ft(t);
690
- }
691
- function io(t, n, o) {
692
- return Me(n, [o.tag]), be(t, o, "value", "setValue"), be(t, o, "selectedValue", "setSelectedValue"), be(t, o, "resetValueOnHide"), be(t, o, "resetValueOnSelect"), Object.assign(
693
- pt(
694
- vt(t, n, o),
695
- n,
696
- o
697
- ),
698
- { tag: o.tag }
699
- );
700
- }
701
- function co(t = {}) {
702
- t = uo(t);
703
- const [n, o] = At(ao, t);
704
- return io(n, o, t);
705
- }
706
- var mo = "input";
707
- function Ze(t, n, o) {
708
- if (!o) return !1;
709
- const e = t.find((r) => !r.disabled && r.value);
710
- return (e == null ? void 0 : e.value) === n;
711
- }
712
- function $e(t, n) {
713
- return !n || t == null ? !1 : (t = bn(t), n.length > t.length && n.toLowerCase().indexOf(t.toLowerCase()) === 0);
714
- }
715
- function fo(t) {
716
- return t.type === "input";
717
- }
718
- function vo(t) {
719
- return t === "inline" || t === "list" || t === "both" || t === "none";
720
- }
721
- function po(t) {
722
- const n = t.find((o) => {
723
- var e;
724
- return o.disabled ? !1 : ((e = o.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
725
- });
726
- return n == null ? void 0 : n.id;
727
- }
728
- var bo = te(
729
- function(n) {
730
- var o = n, {
731
- store: e,
732
- focusable: r = !0,
733
- autoSelect: l = !1,
734
- getAutoSelectId: a,
735
- setValueOnChange: m,
736
- showMinLength: f = 0,
737
- showOnChange: c,
738
- showOnMouseDown: u,
739
- showOnClick: s = u,
740
- showOnKeyDown: v,
741
- showOnKeyPress: C = v,
742
- blurActiveItemOnClick: d,
743
- setValueOnClick: p = !0,
744
- moveOnKeyPress: V = !0,
745
- autoComplete: y = "list"
746
- } = o, g = ne(o, [
747
- "store",
748
- "focusable",
749
- "autoSelect",
750
- "getAutoSelectId",
751
- "setValueOnChange",
752
- "showMinLength",
753
- "showOnChange",
754
- "showOnMouseDown",
755
- "showOnClick",
756
- "showOnKeyDown",
757
- "showOnKeyPress",
758
- "blurActiveItemOnClick",
759
- "setValueOnClick",
760
- "moveOnKeyPress",
761
- "autoComplete"
762
- ]);
763
- const W = mt();
764
- e = e || W, me(
765
- e,
766
- process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
767
- );
768
- const K = le(null), [$, k] = cn(), w = le(!1), U = le(!1), b = e.useState(
769
- (i) => i.virtualFocus && l
770
- ), O = y === "inline" || y === "both", [F, B] = de(O);
771
- dn(() => {
772
- O && B(!0);
773
- }, [O]);
774
- const h = e.useState("value"), P = le();
775
- ae(() => Q(e, ["selectedValue", "activeId"], (i, A) => {
776
- P.current = A.selectedValue;
777
- }), []);
778
- const S = e.useState((i) => {
779
- var A;
780
- if (O && F && !(i.activeValue && Array.isArray(i.selectedValue) && (i.selectedValue.includes(i.activeValue) || (A = P.current) != null && A.includes(i.activeValue))))
781
- return i.activeValue;
782
- }), E = e.useState("renderedItems"), q = e.useState("open"), z = e.useState("contentElement"), X = Ee(() => {
783
- if (!O || !F) return h;
784
- if (Ze(
785
- E,
786
- S,
787
- b
788
- )) {
789
- if ($e(h, S)) {
790
- const A = (S == null ? void 0 : S.slice(h.length)) || "";
791
- return h + A;
792
- }
793
- return h;
794
- }
795
- return S || h;
796
- }, [O, F, E, S, b, h]);
797
- ae(() => {
798
- const i = K.current;
799
- if (!i) return;
800
- const A = () => B(!0);
801
- return i.addEventListener("combobox-item-move", A), () => {
802
- i.removeEventListener("combobox-item-move", A);
803
- };
804
- }, []), ae(() => {
805
- if (!O || !F || !S || !Ze(
806
- E,
807
- S,
808
- b
809
- ) || !$e(h, S)) return;
810
- let A = mn;
811
- return queueMicrotask(() => {
812
- const N = K.current;
813
- if (!N) return;
814
- const { start: T, end: Y } = Be(N), ee = h.length, H = S.length;
815
- Pe(N, ee, H), A = () => {
816
- if (!_e(N)) return;
817
- const { start: ce, end: Wt } = Be(N);
818
- ce === ee && Wt === H && Pe(N, T, Y);
819
- };
820
- }), () => A();
821
- }, [
822
- $,
823
- O,
824
- F,
825
- S,
826
- E,
827
- b,
828
- h
829
- ]);
830
- const fe = le(null), ie = G(a), _ = le(null);
831
- ae(() => {
832
- if (!q || !z) return;
833
- const i = fn(z);
834
- if (!i) return;
835
- fe.current = i;
836
- const A = () => {
837
- w.current = !1;
838
- }, N = () => {
839
- if (!e || !w.current) return;
840
- const { activeId: Y } = e.getState();
841
- Y !== null && Y !== _.current && (w.current = !1);
842
- }, T = { passive: !0, capture: !0 };
843
- return i.addEventListener("wheel", A, T), i.addEventListener("touchmove", A, T), i.addEventListener("scroll", N, T), () => {
844
- i.removeEventListener("wheel", A, !0), i.removeEventListener("touchmove", A, !0), i.removeEventListener("scroll", N, !0);
845
- };
846
- }, [q, z, e]), ke(() => {
847
- h && (U.current || (w.current = !0));
848
- }, [h]), ke(() => {
849
- b !== "always" && q || (w.current = q);
850
- }, [b, q]);
851
- const ve = e.useState("resetValueOnSelect");
852
- Me(() => {
853
- var i, A;
854
- const N = w.current;
855
- if (!e || !q || !N && !ve) return;
856
- const { baseElement: T, contentElement: Y, activeId: ee } = e.getState();
857
- if (!(T && !_e(T))) {
858
- if (Y != null && Y.hasAttribute("data-placing")) {
859
- const H = new MutationObserver(k);
860
- return H.observe(Y, { attributeFilter: ["data-placing"] }), () => H.disconnect();
861
- }
862
- if (b && N) {
863
- const H = ie(E), ce = H !== void 0 ? H : (i = po(E)) != null ? i : e.first();
864
- _.current = ce, e.move(ce ?? null);
865
- } else {
866
- const H = (A = e.item(ee || e.first())) == null ? void 0 : A.element;
867
- H && "scrollIntoView" in H && H.scrollIntoView({ block: "nearest", inline: "nearest" });
868
- }
869
- }
870
- }, [
871
- e,
872
- q,
873
- $,
874
- h,
875
- b,
876
- ve,
877
- ie,
878
- E
879
- ]), ae(() => {
880
- if (!O) return;
881
- const i = K.current;
882
- if (!i) return;
883
- const A = [i, z].filter(
884
- (T) => !!T
885
- ), N = (T) => {
886
- A.every((Y) => pn(T, Y)) && (e == null || e.setValue(X));
887
- };
888
- for (const T of A)
889
- T.addEventListener("focusout", N);
890
- return () => {
891
- for (const T of A)
892
- T.removeEventListener("focusout", N);
893
- };
894
- }, [O, z, e, X]);
895
- const pe = (i) => i.currentTarget.value.length >= f, Se = g.onChange, Te = L(c ?? pe), Le = L(
896
- // If the combobox is combined with tags, the value will be set by the tag
897
- // input component.
898
- m ?? !e.tag
899
- ), Re = G((i) => {
900
- if (Se == null || Se(i), i.defaultPrevented || !e) return;
901
- const A = i.currentTarget, { value: N, selectionStart: T, selectionEnd: Y } = A, ee = i.nativeEvent;
902
- if (w.current = !0, fo(ee) && (ee.isComposing && (w.current = !1, U.current = !0), O)) {
903
- const H = ee.inputType === "insertText" || ee.inputType === "insertCompositionText", ce = T === N.length;
904
- B(H && ce);
905
- }
906
- if (Le(i)) {
907
- const H = N === e.getState().value;
908
- e.setValue(N), queueMicrotask(() => {
909
- Pe(A, T, Y);
910
- }), O && b && H && k();
911
- }
912
- Te(i) && e.show(), (!b || !w.current) && e.setActiveId(null);
913
- }), we = g.onCompositionEnd, xe = G((i) => {
914
- w.current = !0, U.current = !1, we == null || we(i), !i.defaultPrevented && b && k();
915
- }), Ke = g.onMouseDown, Nt = L(
916
- d ?? (() => !!(e != null && e.getState().includesBaseElement))
917
- ), Tt = L(p), Lt = L(s ?? pe), Rt = G((i) => {
918
- Ke == null || Ke(i), !i.defaultPrevented && (i.button || i.ctrlKey || e && (Nt(i) && e.setActiveId(null), Tt(i) && e.setValue(X), Lt(i) && rt(i.currentTarget, "mouseup", e.show)));
919
- }), He = g.onKeyDown, Kt = L(C ?? pe), Ht = G((i) => {
920
- if (He == null || He(i), i.repeat || (w.current = !1), i.defaultPrevented || i.ctrlKey || i.altKey || i.shiftKey || i.metaKey || !e) return;
921
- const { open: A } = e.getState();
922
- A || (i.key === "ArrowUp" || i.key === "ArrowDown") && Kt(i) && (i.preventDefault(), e.show());
923
- }), Ue = g.onBlur, Ut = G((i) => {
924
- w.current = !1, Ue == null || Ue(i), i.defaultPrevented;
925
- }), Ft = Ie(g.id), Bt = vo(y) ? y : void 0, jt = e.useState((i) => i.activeId === null);
926
- return g = R(x({
927
- id: Ft,
928
- role: "combobox",
929
- "aria-autocomplete": Bt,
930
- "aria-haspopup": ot(z, "listbox"),
931
- "aria-expanded": q,
932
- "aria-controls": z == null ? void 0 : z.id,
933
- "data-active-item": jt || void 0,
934
- value: X
935
- }, g), {
936
- ref: Ae(K, g.ref),
937
- onChange: Re,
938
- onCompositionEnd: xe,
939
- onMouseDown: Rt,
940
- onKeyDown: Ht,
941
- onBlur: Ut
942
- }), g = St(R(x({
943
- store: e,
944
- focusable: r
945
- }, g), {
946
- // Enable inline autocomplete when the user moves from the combobox input
947
- // to an item.
948
- moveOnKeyPress: (i) => vn(V, i) ? !1 : (O && B(!0), !0)
949
- })), g = En(x({ store: e }, g)), x({ autoComplete: "off" }, g);
950
- }
951
- ), ho = oe(function(n) {
952
- const o = bo(n);
953
- return re(mo, o);
954
- });
955
- function So(t = {}) {
956
- const n = co(t);
957
- return /* @__PURE__ */ I(On, { value: n, children: t.children });
958
- }
959
- var Co = "div";
960
- function go(t, n) {
961
- if (n != null)
962
- return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
963
- }
964
- function Eo(t) {
965
- var n;
966
- return (n = {
967
- menu: "menuitem",
968
- listbox: "option",
969
- tree: "treeitem"
970
- }[t]) != null ? n : "option";
971
- }
972
- var Oo = te(
973
- function(n) {
974
- var o = n, {
975
- store: e,
976
- value: r,
977
- hideOnClick: l,
978
- setValueOnClick: a,
979
- selectValueOnClick: m = !0,
980
- resetValueOnSelect: f,
981
- focusOnHover: c = !1,
982
- moveOnKeyPress: u = !0,
983
- getItem: s
984
- } = o, v = ne(o, [
985
- "store",
986
- "value",
987
- "hideOnClick",
988
- "setValueOnClick",
989
- "selectValueOnClick",
990
- "resetValueOnSelect",
991
- "focusOnHover",
992
- "moveOnKeyPress",
993
- "getItem"
994
- ]), C;
995
- const d = Ct();
996
- e = e || d, me(
997
- e,
998
- process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
999
- );
1000
- const { resetValueOnSelectState: p, multiSelectable: V, selected: y } = It(e, {
1001
- resetValueOnSelectState: "resetValueOnSelect",
1002
- multiSelectable(h) {
1003
- return Array.isArray(h.selectedValue);
1004
- },
1005
- selected(h) {
1006
- return go(h.selectedValue, r);
1007
- }
1008
- }), g = Je(
1009
- (h) => {
1010
- const P = R(x({}, h), { value: r });
1011
- return s ? s(P) : P;
1012
- },
1013
- [r, s]
1014
- );
1015
- a = a ?? !V, l = l ?? (r != null && !V);
1016
- const W = v.onClick, K = L(a), $ = L(m), k = L(
1017
- (C = f ?? p) != null ? C : V
1018
- ), w = L(l), U = G((h) => {
1019
- W == null || W(h), !h.defaultPrevented && (st(h) || at(h) || (r != null && ($(h) && (k(h) && (e == null || e.resetValue()), e == null || e.setSelectedValue((P) => Array.isArray(P) ? P.includes(r) ? P.filter((S) => S !== r) : [...P, r] : r)), K(h) && (e == null || e.setValue(r))), w(h) && (e == null || e.hide())));
1020
- }), b = v.onKeyDown, O = G((h) => {
1021
- if (b == null || b(h), h.defaultPrevented) return;
1022
- const P = e == null ? void 0 : e.getState().baseElement;
1023
- if (!P || _e(P)) return;
1024
- (h.key.length === 1 || h.key === "Backspace" || h.key === "Delete") && (queueMicrotask(() => P.focus()), hn(P) && (e == null || e.setValue(P.value)));
1025
- });
1026
- V && y != null && (v = x({
1027
- "aria-selected": y
1028
- }, v)), v = he(
1029
- v,
1030
- (h) => /* @__PURE__ */ I(xn.Provider, { value: r, children: /* @__PURE__ */ I(yn.Provider, { value: y ?? !1, children: h }) }),
1031
- [r, y]
1032
- );
1033
- const F = Ve(gt);
1034
- v = R(x({
1035
- role: Eo(F),
1036
- children: r
1037
- }, v), {
1038
- onClick: U,
1039
- onKeyDown: O
1040
- });
1041
- const B = L(u);
1042
- return v = wt(R(x({
1043
- store: e
1044
- }, v), {
1045
- getItem: g,
1046
- // Dispatch a custom event on the combobox input when moving to an item
1047
- // with the keyboard so the Combobox component can enable inline
1048
- // autocompletion.
1049
- moveOnKeyPress: (h) => {
1050
- if (!B(h)) return !1;
1051
- const P = new Event("combobox-item-move"), S = e == null ? void 0 : e.getState().baseElement;
1052
- return S == null || S.dispatchEvent(P), !0;
1053
- }
1054
- })), v = Pt(x({ store: e, focusOnHover: c }, v)), v;
1055
- }
1056
- ), xo = lt(
1057
- oe(function(n) {
1058
- const o = Oo(n);
1059
- return re(Co, o);
1060
- })
1061
- ), yo = "div", Ao = te(
1062
- function(n) {
1063
- var o = n, { store: e, alwaysVisible: r } = o, l = ne(o, ["store", "alwaysVisible"]);
1064
- const a = Ct(!0), m = An();
1065
- e = e || m;
1066
- const f = !!e && e === a;
1067
- me(
1068
- e,
1069
- process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
1070
- );
1071
- const c = le(null), u = Ie(l.id), s = e.useState("mounted"), v = ht(s, l.hidden, r), C = v ? R(x({}, l.style), { display: "none" }) : l.style, d = e.useState(
1072
- (k) => Array.isArray(k.selectedValue)
1073
- ), p = ut(c, "role", l.role), y = (p === "listbox" || p === "tree" || p === "grid") && d || void 0, [g, W] = de(!1), K = e.useState("contentElement");
1074
- ke(() => {
1075
- if (!s) return;
1076
- const k = c.current;
1077
- if (!k || K !== k) return;
1078
- const w = () => {
1079
- W(!!k.querySelector("[role='listbox']"));
1080
- }, U = new MutationObserver(w);
1081
- return U.observe(k, {
1082
- subtree: !0,
1083
- childList: !0,
1084
- attributeFilter: ["role"]
1085
- }), w(), () => U.disconnect();
1086
- }, [s, K]), g || (l = x({
1087
- role: "listbox",
1088
- "aria-multiselectable": y
1089
- }, l)), l = he(
1090
- l,
1091
- (k) => /* @__PURE__ */ I(In, { value: e, children: /* @__PURE__ */ I(gt.Provider, { value: p, children: k }) }),
1092
- [e, p]
1093
- );
1094
- const $ = u && (!a || !f) ? e.setContentElement : null;
1095
- return l = R(x({
1096
- id: u,
1097
- hidden: v
1098
- }, l), {
1099
- ref: Ae($, c, l.ref),
1100
- style: C
1101
- }), tt(l);
1102
- }
1103
- ), Io = oe(function(n) {
1104
- const o = Ao(n);
1105
- return re(yo, o);
1106
- }), Ce = { exports: {} }, qe;
1107
- function wo() {
1108
- if (qe) return Ce.exports;
1109
- qe = 1;
1110
- var t = {
1111
- À: "A",
1112
- Á: "A",
1113
- Â: "A",
1114
- Ã: "A",
1115
- Ä: "A",
1116
- Å: "A",
1117
- Ấ: "A",
1118
- Ắ: "A",
1119
- Ẳ: "A",
1120
- Ẵ: "A",
1121
- Ặ: "A",
1122
- Æ: "AE",
1123
- Ầ: "A",
1124
- Ằ: "A",
1125
- Ȃ: "A",
1126
- Ả: "A",
1127
- Ạ: "A",
1128
- Ẩ: "A",
1129
- Ẫ: "A",
1130
- Ậ: "A",
1131
- Ç: "C",
1132
- Ḉ: "C",
1133
- È: "E",
1134
- É: "E",
1135
- Ê: "E",
1136
- Ë: "E",
1137
- Ế: "E",
1138
- Ḗ: "E",
1139
- Ề: "E",
1140
- Ḕ: "E",
1141
- Ḝ: "E",
1142
- Ȇ: "E",
1143
- Ẻ: "E",
1144
- Ẽ: "E",
1145
- Ẹ: "E",
1146
- Ể: "E",
1147
- Ễ: "E",
1148
- Ệ: "E",
1149
- Ì: "I",
1150
- Í: "I",
1151
- Î: "I",
1152
- Ï: "I",
1153
- Ḯ: "I",
1154
- Ȋ: "I",
1155
- Ỉ: "I",
1156
- Ị: "I",
1157
- Ð: "D",
1158
- Ñ: "N",
1159
- Ò: "O",
1160
- Ó: "O",
1161
- Ô: "O",
1162
- Õ: "O",
1163
- Ö: "O",
1164
- Ø: "O",
1165
- Ố: "O",
1166
- Ṍ: "O",
1167
- Ṓ: "O",
1168
- Ȏ: "O",
1169
- Ỏ: "O",
1170
- Ọ: "O",
1171
- Ổ: "O",
1172
- Ỗ: "O",
1173
- Ộ: "O",
1174
- Ờ: "O",
1175
- Ở: "O",
1176
- Ỡ: "O",
1177
- Ớ: "O",
1178
- Ợ: "O",
1179
- Ù: "U",
1180
- Ú: "U",
1181
- Û: "U",
1182
- Ü: "U",
1183
- Ủ: "U",
1184
- Ụ: "U",
1185
- Ử: "U",
1186
- Ữ: "U",
1187
- Ự: "U",
1188
- Ý: "Y",
1189
- à: "a",
1190
- á: "a",
1191
- â: "a",
1192
- ã: "a",
1193
- ä: "a",
1194
- å: "a",
1195
- ấ: "a",
1196
- ắ: "a",
1197
- ẳ: "a",
1198
- ẵ: "a",
1199
- ặ: "a",
1200
- æ: "ae",
1201
- ầ: "a",
1202
- ằ: "a",
1203
- ȃ: "a",
1204
- ả: "a",
1205
- ạ: "a",
1206
- ẩ: "a",
1207
- ẫ: "a",
1208
- ậ: "a",
1209
- ç: "c",
1210
- ḉ: "c",
1211
- è: "e",
1212
- é: "e",
1213
- ê: "e",
1214
- ë: "e",
1215
- ế: "e",
1216
- ḗ: "e",
1217
- ề: "e",
1218
- ḕ: "e",
1219
- ḝ: "e",
1220
- ȇ: "e",
1221
- ẻ: "e",
1222
- ẽ: "e",
1223
- ẹ: "e",
1224
- ể: "e",
1225
- ễ: "e",
1226
- ệ: "e",
1227
- ì: "i",
1228
- í: "i",
1229
- î: "i",
1230
- ï: "i",
1231
- ḯ: "i",
1232
- ȋ: "i",
1233
- ỉ: "i",
1234
- ị: "i",
1235
- ð: "d",
1236
- ñ: "n",
1237
- ò: "o",
1238
- ó: "o",
1239
- ô: "o",
1240
- õ: "o",
1241
- ö: "o",
1242
- ø: "o",
1243
- ố: "o",
1244
- ṍ: "o",
1245
- ṓ: "o",
1246
- ȏ: "o",
1247
- ỏ: "o",
1248
- ọ: "o",
1249
- ổ: "o",
1250
- ỗ: "o",
1251
- ộ: "o",
1252
- ờ: "o",
1253
- ở: "o",
1254
- ỡ: "o",
1255
- ớ: "o",
1256
- ợ: "o",
1257
- ù: "u",
1258
- ú: "u",
1259
- û: "u",
1260
- ü: "u",
1261
- ủ: "u",
1262
- ụ: "u",
1263
- ử: "u",
1264
- ữ: "u",
1265
- ự: "u",
1266
- ý: "y",
1267
- ÿ: "y",
1268
- Ā: "A",
1269
- ā: "a",
1270
- Ă: "A",
1271
- ă: "a",
1272
- Ą: "A",
1273
- ą: "a",
1274
- Ć: "C",
1275
- ć: "c",
1276
- Ĉ: "C",
1277
- ĉ: "c",
1278
- Ċ: "C",
1279
- ċ: "c",
1280
- Č: "C",
1281
- č: "c",
1282
- C̆: "C",
1283
- c̆: "c",
1284
- Ď: "D",
1285
- ď: "d",
1286
- Đ: "D",
1287
- đ: "d",
1288
- Ē: "E",
1289
- ē: "e",
1290
- Ĕ: "E",
1291
- ĕ: "e",
1292
- Ė: "E",
1293
- ė: "e",
1294
- Ę: "E",
1295
- ę: "e",
1296
- Ě: "E",
1297
- ě: "e",
1298
- Ĝ: "G",
1299
- Ǵ: "G",
1300
- ĝ: "g",
1301
- ǵ: "g",
1302
- Ğ: "G",
1303
- ğ: "g",
1304
- Ġ: "G",
1305
- ġ: "g",
1306
- Ģ: "G",
1307
- ģ: "g",
1308
- Ĥ: "H",
1309
- ĥ: "h",
1310
- Ħ: "H",
1311
- ħ: "h",
1312
- Ḫ: "H",
1313
- ḫ: "h",
1314
- Ĩ: "I",
1315
- ĩ: "i",
1316
- Ī: "I",
1317
- ī: "i",
1318
- Ĭ: "I",
1319
- ĭ: "i",
1320
- Į: "I",
1321
- į: "i",
1322
- İ: "I",
1323
- ı: "i",
1324
- IJ: "IJ",
1325
- ij: "ij",
1326
- Ĵ: "J",
1327
- ĵ: "j",
1328
- Ķ: "K",
1329
- ķ: "k",
1330
- Ḱ: "K",
1331
- ḱ: "k",
1332
- K̆: "K",
1333
- k̆: "k",
1334
- Ĺ: "L",
1335
- ĺ: "l",
1336
- Ļ: "L",
1337
- ļ: "l",
1338
- Ľ: "L",
1339
- ľ: "l",
1340
- Ŀ: "L",
1341
- ŀ: "l",
1342
- Ł: "l",
1343
- ł: "l",
1344
- Ḿ: "M",
1345
- ḿ: "m",
1346
- M̆: "M",
1347
- m̆: "m",
1348
- Ń: "N",
1349
- ń: "n",
1350
- Ņ: "N",
1351
- ņ: "n",
1352
- Ň: "N",
1353
- ň: "n",
1354
- ʼn: "n",
1355
- N̆: "N",
1356
- n̆: "n",
1357
- Ō: "O",
1358
- ō: "o",
1359
- Ŏ: "O",
1360
- ŏ: "o",
1361
- Ő: "O",
1362
- ő: "o",
1363
- Œ: "OE",
1364
- œ: "oe",
1365
- P̆: "P",
1366
- p̆: "p",
1367
- Ŕ: "R",
1368
- ŕ: "r",
1369
- Ŗ: "R",
1370
- ŗ: "r",
1371
- Ř: "R",
1372
- ř: "r",
1373
- R̆: "R",
1374
- r̆: "r",
1375
- Ȓ: "R",
1376
- ȓ: "r",
1377
- Ś: "S",
1378
- ś: "s",
1379
- Ŝ: "S",
1380
- ŝ: "s",
1381
- Ş: "S",
1382
- Ș: "S",
1383
- ș: "s",
1384
- ş: "s",
1385
- Š: "S",
1386
- š: "s",
1387
- Ţ: "T",
1388
- ţ: "t",
1389
- ț: "t",
1390
- Ț: "T",
1391
- Ť: "T",
1392
- ť: "t",
1393
- Ŧ: "T",
1394
- ŧ: "t",
1395
- T̆: "T",
1396
- t̆: "t",
1397
- Ũ: "U",
1398
- ũ: "u",
1399
- Ū: "U",
1400
- ū: "u",
1401
- Ŭ: "U",
1402
- ŭ: "u",
1403
- Ů: "U",
1404
- ů: "u",
1405
- Ű: "U",
1406
- ű: "u",
1407
- Ų: "U",
1408
- ų: "u",
1409
- Ȗ: "U",
1410
- ȗ: "u",
1411
- V̆: "V",
1412
- v̆: "v",
1413
- Ŵ: "W",
1414
- ŵ: "w",
1415
- Ẃ: "W",
1416
- ẃ: "w",
1417
- X̆: "X",
1418
- x̆: "x",
1419
- Ŷ: "Y",
1420
- ŷ: "y",
1421
- Ÿ: "Y",
1422
- Y̆: "Y",
1423
- y̆: "y",
1424
- Ź: "Z",
1425
- ź: "z",
1426
- Ż: "Z",
1427
- ż: "z",
1428
- Ž: "Z",
1429
- ž: "z",
1430
- ſ: "s",
1431
- ƒ: "f",
1432
- Ơ: "O",
1433
- ơ: "o",
1434
- Ư: "U",
1435
- ư: "u",
1436
- Ǎ: "A",
1437
- ǎ: "a",
1438
- Ǐ: "I",
1439
- ǐ: "i",
1440
- Ǒ: "O",
1441
- ǒ: "o",
1442
- Ǔ: "U",
1443
- ǔ: "u",
1444
- Ǖ: "U",
1445
- ǖ: "u",
1446
- Ǘ: "U",
1447
- ǘ: "u",
1448
- Ǚ: "U",
1449
- ǚ: "u",
1450
- Ǜ: "U",
1451
- ǜ: "u",
1452
- Ứ: "U",
1453
- ứ: "u",
1454
- Ṹ: "U",
1455
- ṹ: "u",
1456
- Ǻ: "A",
1457
- ǻ: "a",
1458
- Ǽ: "AE",
1459
- ǽ: "ae",
1460
- Ǿ: "O",
1461
- ǿ: "o",
1462
- Þ: "TH",
1463
- þ: "th",
1464
- Ṕ: "P",
1465
- ṕ: "p",
1466
- Ṥ: "S",
1467
- ṥ: "s",
1468
- X́: "X",
1469
- x́: "x",
1470
- Ѓ: "Г",
1471
- ѓ: "г",
1472
- Ќ: "К",
1473
- ќ: "к",
1474
- A̋: "A",
1475
- a̋: "a",
1476
- E̋: "E",
1477
- e̋: "e",
1478
- I̋: "I",
1479
- i̋: "i",
1480
- Ǹ: "N",
1481
- ǹ: "n",
1482
- Ồ: "O",
1483
- ồ: "o",
1484
- Ṑ: "O",
1485
- ṑ: "o",
1486
- Ừ: "U",
1487
- ừ: "u",
1488
- Ẁ: "W",
1489
- ẁ: "w",
1490
- Ỳ: "Y",
1491
- ỳ: "y",
1492
- Ȁ: "A",
1493
- ȁ: "a",
1494
- Ȅ: "E",
1495
- ȅ: "e",
1496
- Ȉ: "I",
1497
- ȉ: "i",
1498
- Ȍ: "O",
1499
- ȍ: "o",
1500
- Ȑ: "R",
1501
- ȑ: "r",
1502
- Ȕ: "U",
1503
- ȕ: "u",
1504
- B̌: "B",
1505
- b̌: "b",
1506
- Č̣: "C",
1507
- č̣: "c",
1508
- Ê̌: "E",
1509
- ê̌: "e",
1510
- F̌: "F",
1511
- f̌: "f",
1512
- Ǧ: "G",
1513
- ǧ: "g",
1514
- Ȟ: "H",
1515
- ȟ: "h",
1516
- J̌: "J",
1517
- ǰ: "j",
1518
- Ǩ: "K",
1519
- ǩ: "k",
1520
- M̌: "M",
1521
- m̌: "m",
1522
- P̌: "P",
1523
- p̌: "p",
1524
- Q̌: "Q",
1525
- q̌: "q",
1526
- Ř̩: "R",
1527
- ř̩: "r",
1528
- Ṧ: "S",
1529
- ṧ: "s",
1530
- V̌: "V",
1531
- v̌: "v",
1532
- W̌: "W",
1533
- w̌: "w",
1534
- X̌: "X",
1535
- x̌: "x",
1536
- Y̌: "Y",
1537
- y̌: "y",
1538
- A̧: "A",
1539
- a̧: "a",
1540
- B̧: "B",
1541
- b̧: "b",
1542
- Ḑ: "D",
1543
- ḑ: "d",
1544
- Ȩ: "E",
1545
- ȩ: "e",
1546
- Ɛ̧: "E",
1547
- ɛ̧: "e",
1548
- Ḩ: "H",
1549
- ḩ: "h",
1550
- I̧: "I",
1551
- i̧: "i",
1552
- Ɨ̧: "I",
1553
- ɨ̧: "i",
1554
- M̧: "M",
1555
- m̧: "m",
1556
- O̧: "O",
1557
- o̧: "o",
1558
- Q̧: "Q",
1559
- q̧: "q",
1560
- U̧: "U",
1561
- u̧: "u",
1562
- X̧: "X",
1563
- x̧: "x",
1564
- Z̧: "Z",
1565
- z̧: "z",
1566
- й: "и",
1567
- Й: "И",
1568
- ё: "е",
1569
- Ё: "Е"
1570
- }, n = Object.keys(t).join("|"), o = new RegExp(n, "g"), e = new RegExp(n, "");
1571
- function r(m) {
1572
- return t[m];
1573
- }
1574
- var l = function(m) {
1575
- return m.replace(o, r);
1576
- }, a = function(m) {
1577
- return !!m.match(e);
1578
- };
1579
- return Ce.exports = l, Ce.exports.has = a, Ce.exports.remove = l, Ce.exports;
1580
- }
1581
- var Po = wo();
1582
- const Vo = /* @__PURE__ */ Gt(Po);
1583
- /**
1584
- * @name match-sorter
1585
- * @license MIT license.
1586
- * @copyright (c) 2020 Kent C. Dodds
1587
- * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
1588
- */
1589
- const j = {
1590
- CASE_SENSITIVE_EQUAL: 7,
1591
- EQUAL: 6,
1592
- STARTS_WITH: 5,
1593
- WORD_STARTS_WITH: 4,
1594
- CONTAINS: 3,
1595
- ACRONYM: 2,
1596
- MATCHES: 1,
1597
- NO_MATCH: 0
1598
- }, ko = (t, n) => String(t.rankedValue).localeCompare(String(n.rankedValue));
1599
- function Dt(t, n, o) {
1600
- o === void 0 && (o = {});
1601
- const {
1602
- keys: e,
1603
- threshold: r = j.MATCHES,
1604
- baseSort: l = ko,
1605
- sorter: a = (c) => c.sort((u, s) => No(u, s, l))
1606
- } = o, m = t.reduce(f, []);
1607
- return a(m).map((c) => {
1608
- let {
1609
- item: u
1610
- } = c;
1611
- return u;
1612
- });
1613
- function f(c, u, s) {
1614
- const v = _o(u, e, n, o), {
1615
- rank: C,
1616
- keyThreshold: d = r
1617
- } = v;
1618
- return C >= d && c.push({
1619
- ...v,
1620
- item: u,
1621
- index: s
1622
- }), c;
1623
- }
1624
- }
1625
- Dt.rankings = j;
1626
- function _o(t, n, o, e) {
1627
- if (!n) {
1628
- const l = t;
1629
- return {
1630
- // ends up being duplicate of 'item' in matches but consistent
1631
- rankedValue: l,
1632
- rank: ze(l, o, e),
1633
- keyIndex: -1,
1634
- keyThreshold: e.threshold
1635
- };
1636
- }
1637
- return Ro(t, n).reduce((l, a, m) => {
1638
- let {
1639
- rank: f,
1640
- rankedValue: c,
1641
- keyIndex: u,
1642
- keyThreshold: s
1643
- } = l, {
1644
- itemValue: v,
1645
- attributes: C
1646
- } = a, d = ze(v, o, e), p = c;
1647
- const {
1648
- minRanking: V,
1649
- maxRanking: y,
1650
- threshold: g
1651
- } = C;
1652
- return d < V && d >= j.MATCHES ? d = V : d > y && (d = y), d > f && (f = d, u = m, s = g, p = v), {
1653
- rankedValue: p,
1654
- rank: f,
1655
- keyIndex: u,
1656
- keyThreshold: s
1657
- };
1658
- }, {
1659
- rankedValue: t,
1660
- rank: j.NO_MATCH,
1661
- keyIndex: -1,
1662
- keyThreshold: e.threshold
1663
- });
1664
- }
1665
- function ze(t, n, o) {
1666
- return t = Ye(t, o), n = Ye(n, o), n.length > t.length ? j.NO_MATCH : t === n ? j.CASE_SENSITIVE_EQUAL : (t = t.toLowerCase(), n = n.toLowerCase(), t === n ? j.EQUAL : t.startsWith(n) ? j.STARTS_WITH : t.includes(` ${n}`) ? j.WORD_STARTS_WITH : t.includes(n) ? j.CONTAINS : n.length === 1 ? j.NO_MATCH : Mo(t).includes(n) ? j.ACRONYM : Do(t, n));
1667
- }
1668
- function Mo(t) {
1669
- let n = "";
1670
- return t.split(" ").forEach((e) => {
1671
- e.split("-").forEach((l) => {
1672
- n += l.substr(0, 1);
1673
- });
1674
- }), n;
1675
- }
1676
- function Do(t, n) {
1677
- let o = 0, e = 0;
1678
- function r(f, c, u) {
1679
- for (let s = u, v = c.length; s < v; s++)
1680
- if (c[s] === f)
1681
- return o += 1, s + 1;
1682
- return -1;
1683
- }
1684
- function l(f) {
1685
- const c = 1 / f, u = o / n.length;
1686
- return j.MATCHES + u * c;
1687
- }
1688
- const a = r(n[0], t, 0);
1689
- if (a < 0)
1690
- return j.NO_MATCH;
1691
- e = a;
1692
- for (let f = 1, c = n.length; f < c; f++) {
1693
- const u = n[f];
1694
- if (e = r(u, t, e), !(e > -1))
1695
- return j.NO_MATCH;
1696
- }
1697
- const m = e - a;
1698
- return l(m);
1699
- }
1700
- function No(t, n, o) {
1701
- const {
1702
- rank: l,
1703
- keyIndex: a
1704
- } = t, {
1705
- rank: m,
1706
- keyIndex: f
1707
- } = n;
1708
- return l === m ? a === f ? o(t, n) : a < f ? -1 : 1 : l > m ? -1 : 1;
1709
- }
1710
- function Ye(t, n) {
1711
- let {
1712
- keepDiacritics: o
1713
- } = n;
1714
- return t = `${t}`, o || (t = Vo(t)), t;
1715
- }
1716
- function To(t, n) {
1717
- typeof n == "object" && (n = n.key);
1718
- let o;
1719
- if (typeof n == "function")
1720
- o = n(t);
1721
- else if (t == null)
1722
- o = null;
1723
- else if (Object.hasOwnProperty.call(t, n))
1724
- o = t[n];
1725
- else {
1726
- if (n.includes("."))
1727
- return Lo(n, t);
1728
- o = null;
1729
- }
1730
- return o == null ? [] : Array.isArray(o) ? o : [String(o)];
1731
- }
1732
- function Lo(t, n) {
1733
- const o = t.split(".");
1734
- let e = [n];
1735
- for (let r = 0, l = o.length; r < l; r++) {
1736
- const a = o[r];
1737
- let m = [];
1738
- for (let f = 0, c = e.length; f < c; f++) {
1739
- const u = e[f];
1740
- if (u != null)
1741
- if (Object.hasOwnProperty.call(u, a)) {
1742
- const s = u[a];
1743
- s != null && m.push(s);
1744
- } else a === "*" && (m = m.concat(u));
1745
- }
1746
- e = m;
1747
- }
1748
- return Array.isArray(e[0]) ? [].concat(...e) : e;
1749
- }
1750
- function Ro(t, n) {
1751
- const o = [];
1752
- for (let e = 0, r = n.length; e < r; e++) {
1753
- const l = n[e], a = Ko(l), m = To(t, l);
1754
- for (let f = 0, c = m.length; f < c; f++)
1755
- o.push({
1756
- itemValue: m[f],
1757
- attributes: a
1758
- });
1759
- }
1760
- return o;
1761
- }
1762
- const Ge = {
1763
- maxRanking: 1 / 0,
1764
- minRanking: -1 / 0
1765
- };
1766
- function Ko(t) {
1767
- return typeof t == "string" ? Ge : {
1768
- ...Ge,
1769
- ...t
1770
- };
1771
- }
1772
- const Jo = (t) => {
1773
- const { baseProps: n, controlProps: o } = Qt(t, {
1774
- className: "component-select-control"
1775
- }), [e, r] = de(""), {
1776
- value: l,
1777
- onChangeValue: a = $t,
1778
- options: m,
1779
- placeholder: f = "Choose an option...",
1780
- searchable: c = !1,
1781
- ...u
1782
- } = o, s = (m || []).map(Zt), v = Ee(() => Dt(s, e, {
1783
- baseSort: (d, p) => d.index < p.index ? -1 : 1,
1784
- keys: ["label", "description"]
1785
- }), [e]), C = c ? Io : Xn;
1786
- return /* @__PURE__ */ I(
1787
- So,
1788
- {
1789
- resetValueOnHide: !0,
1790
- setValue: (d) => {
1791
- zt(() => {
1792
- r(d);
1793
- });
1794
- },
1795
- children: /* @__PURE__ */ I(qn, { value: l, setValue: a, children: /* @__PURE__ */ se(Jt, { ...n, children: [
1796
- /* @__PURE__ */ se(
1797
- $n,
1798
- {
1799
- className: "component-select-control__input",
1800
- ...u,
1801
- children: [
1802
- /* @__PURE__ */ I("div", { className: "component-select-control__value", children: /* @__PURE__ */ I(oo, { fallback: f }) }),
1803
- /* @__PURE__ */ I("div", { className: "component-select-control__caret", children: /* @__PURE__ */ I(qt, {}) })
1804
- ]
1805
- }
1806
- ),
1807
- /* @__PURE__ */ se(
1808
- no,
1809
- {
1810
- className: "component-select-control__popover",
1811
- wrapperProps: {
1812
- className: "component-select-control__popover__wrapper"
1813
- },
1814
- fitViewport: !0,
1815
- flip: !1,
1816
- gutter: 0,
1817
- overflowPadding: 4,
1818
- shift: -1,
1819
- children: [
1820
- /* @__PURE__ */ se(
1821
- "div",
1822
- {
1823
- className: "component-select-control__popover__search-wrapper",
1824
- inert: !c,
1825
- hidden: !c,
1826
- children: [
1827
- /* @__PURE__ */ I(Vt, { className: "component-select-control__popover__search-icon" }),
1828
- /* @__PURE__ */ I(
1829
- ho,
1830
- {
1831
- autoSelect: !0,
1832
- placeholder: "Search...",
1833
- className: "component-select-control__popover__search"
1834
- }
1835
- )
1836
- ]
1837
- }
1838
- ),
1839
- /* @__PURE__ */ I(C, { className: "component-select-control__list", children: v.map((d) => /* @__PURE__ */ se(
1840
- Jn,
1841
- {
1842
- disabled: d.disabled,
1843
- value: d.value,
1844
- className: "component-select-control__option",
1845
- render: /* @__PURE__ */ I(xo, {}),
1846
- children: [
1847
- /* @__PURE__ */ I("div", { className: "component-select-control__option__label", children: d.label }),
1848
- d.description && /* @__PURE__ */ I("div", { className: "component-select-control__option__description", children: d.description })
1849
- ]
1850
- },
1851
- d.value
1852
- )) })
1853
- ]
1854
- }
1855
- )
1856
- ] }) })
1857
- }
1858
- );
1859
- };
1
+ import '../../../assets/style.css';/* empty css */
2
+ import { SelectControl as e } from "./component.js";
3
+ import { o as m } from "../../../options-Cfoqhxw2.js";
1860
4
  export {
1861
- Jo as SelectControl
5
+ m as Options,
6
+ e as SelectControl
1862
7
  };