@reportportal/ui-kit 0.0.1-alpha.228 → 0.0.1-alpha.229

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 (2) hide show
  1. package/dist/autocompletes.js +511 -519
  2. package/package.json +1 -1
@@ -1,197 +1,197 @@
1
- import { jsx as r, jsxs as B, Fragment as fe } from "react/jsx-runtime";
2
- import { useState as oe, useRef as ke, useEffect as pe, useCallback as H, forwardRef as je, useLayoutEffect as He, useMemo as We } from "react";
3
- import { c as J } from "./bind-06a7ff84.js";
4
- import { Scrollbars as Ye } from "rc-scrollbars";
5
- import { B as Ke } from "./bubblesLoader-f3ffa240.js";
6
- import { B as Xe } from "./button-7ab874f3.js";
7
- import { S as Ge } from "./plus-199fb2a8.js";
8
- import { i as Ce } from "./isEmpty-ccacb5ff.js";
9
- import { createPortal as Je } from "react-dom";
10
- import ue from "downshift";
11
- import { useFloating as De, autoUpdate as Fe, flip as Qe, size as Ze } from "@floating-ui/react";
12
- import { F as qe } from "./fieldText-1749da7a.js";
13
- import { S as Oe } from "./dropdown-0260bb66.js";
14
- import { E as $e, A as Ue, T as Ve } from "./constants-85822a6b.js";
15
- import { S as et } from "./close-4d480ef7.js";
16
- import { S as tt } from "./clear-53660571.js";
1
+ import { jsx as r, jsxs as D, Fragment as he } from "react/jsx-runtime";
2
+ import { useState as oe, useRef as Me, useEffect as we, useCallback as Y, forwardRef as Te, useLayoutEffect as je, useMemo as He } from "react";
3
+ import { c as Q } from "./bind-06a7ff84.js";
4
+ import { Scrollbars as We } from "rc-scrollbars";
5
+ import { B as Ye } from "./bubblesLoader-f3ffa240.js";
6
+ import { B as Ke } from "./button-7ab874f3.js";
7
+ import { S as Xe } from "./plus-199fb2a8.js";
8
+ import { i as ze } from "./isEmpty-ccacb5ff.js";
9
+ import { createPortal as Ge } from "react-dom";
10
+ import pe from "downshift";
11
+ import { useFloating as Be, autoUpdate as De, flip as Je, size as Qe } from "@floating-ui/react";
12
+ import { F as Ze } from "./fieldText-1749da7a.js";
13
+ import { S as Fe } from "./dropdown-0260bb66.js";
14
+ import { E as Oe, A as qe, T as Ue } from "./constants-85822a6b.js";
15
+ import { S as Ve } from "./close-4d480ef7.js";
16
+ import { S as et } from "./clear-53660571.js";
17
17
  import "./openEye-950159cb.js";
18
18
  import "./baseIconButton-251479f7.js";
19
19
  import "./spinLoader-c4a53718.js";
20
20
  import "./maxValueDisplay-9be01a75.js";
21
21
  import "./fieldLabel.js";
22
- const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
22
+ const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
23
23
  "selected-item": "_selected-item_1rpph_16",
24
24
  "validation-error": "_validation-error_1rpph_35",
25
25
  "highlight-un-stored-item": "_highlight-un-stored-item_1rpph_40",
26
- disabled: ot,
26
+ disabled: tt,
27
27
  "mobile-disabled": "_mobile-disabled_1rpph_48",
28
28
  "selected-item-text": "_selected-item-text_1rpph_54",
29
29
  "single-line": "_single-line_1rpph_58",
30
30
  "cross-icon": "_cross-icon_1rpph_64",
31
- input: st
32
- }, ae = J.bind(nt), rt = (t) => t.scrollWidth > t.clientWidth, lt = ({
31
+ input: ot
32
+ }, me = Q.bind(st), nt = (t) => t.scrollWidth > t.clientWidth, rt = ({
33
33
  item: t,
34
34
  onRemoveItem: e,
35
35
  disabled: n = !1,
36
36
  mobileDisabled: o = !1,
37
37
  parseValueToString: s,
38
38
  error: l = !1,
39
- editItem: w,
39
+ editItem: h,
40
40
  editable: u = !1,
41
- getAdditionalCreationCondition: b = () => !0,
42
- storedOption: N = !0,
43
- highlightUnStoredItem: _ = !1,
44
- variant: M = "light",
45
- getItemName: I,
46
- singleLine: f = !1,
47
- className: R,
48
- textClassName: L
41
+ getAdditionalCreationCondition: v = () => !0,
42
+ storedOption: g = !0,
43
+ highlightUnStoredItem: p = !1,
44
+ variant: z = "light",
45
+ getItemName: k,
46
+ singleLine: m = !1,
47
+ className: L,
48
+ textClassName: P
49
49
  }) => {
50
- const [y, E] = oe(!1), [z, D] = oe(""), [i, a] = oe(!1), d = ke(null), c = () => {
51
- !n && u && !N && (D((I == null ? void 0 : I(t)) || (s == null ? void 0 : s(t)) || ""), E(!0));
52
- }, g = (P) => {
53
- D(P.target.value);
54
- }, k = (P) => {
55
- const $ = b(z);
56
- P.key === "Enter" && $ && (w(t, z), E(!1), D(""));
57
- }, h = () => {
58
- E(!1), D("");
59
- }, S = (P) => {
60
- P.stopPropagation(), e(t);
61
- }, A = (s == null ? void 0 : s(t)) || "";
62
- pe(() => {
63
- if (d.current && f) {
64
- const P = () => {
65
- d.current && a(rt(d.current));
50
+ const [b, x] = oe(!1), [A, F] = oe(""), [c, i] = oe(!1), a = Me(null), d = () => {
51
+ !n && u && !g && (F((k == null ? void 0 : k(t)) || (s == null ? void 0 : s(t)) || ""), x(!0));
52
+ }, y = (B) => {
53
+ F(B.target.value);
54
+ }, C = (B) => {
55
+ const j = v(A);
56
+ B.key === "Enter" && j && (h(t, A), x(!1), F(""));
57
+ }, _ = () => {
58
+ x(!1), F("");
59
+ }, N = (B) => {
60
+ B.stopPropagation(), e(t);
61
+ }, R = (s == null ? void 0 : s(t)) || "";
62
+ we(() => {
63
+ if (a.current && m) {
64
+ const B = () => {
65
+ a.current && i(nt(a.current));
66
66
  };
67
- if (P(), typeof ResizeObserver < "u") {
68
- const $ = new ResizeObserver(P);
69
- return $.observe(d.current), () => $.disconnect();
67
+ if (B(), typeof ResizeObserver < "u") {
68
+ const j = new ResizeObserver(B);
69
+ return j.observe(a.current), () => j.disconnect();
70
70
  }
71
71
  } else
72
- a(!1);
73
- }, [A, f]);
74
- const V = ae(
72
+ i(!1);
73
+ }, [R, m]);
74
+ const ee = me(
75
75
  "selected-item-text",
76
76
  {
77
- "single-line": f
77
+ "single-line": m
78
78
  },
79
- L
80
- ), O = ae(
79
+ P
80
+ ), $ = me(
81
81
  "selected-item",
82
- M,
82
+ z,
83
83
  {
84
84
  [`validation-${l}`]: l,
85
85
  disabled: n,
86
86
  "mobile-disabled": o,
87
- "highlight-un-stored-item": _ && !N
87
+ "highlight-un-stored-item": p && !g
88
88
  },
89
- R
89
+ L
90
90
  );
91
- return y ? /* @__PURE__ */ r(
91
+ return b ? /* @__PURE__ */ r(
92
92
  "input",
93
93
  {
94
94
  autoFocus: !0,
95
- value: z,
96
- onChange: g,
97
- onKeyDown: k,
98
- onBlur: h,
99
- className: ae("input")
95
+ value: A,
96
+ onChange: y,
97
+ onKeyDown: C,
98
+ onBlur: _,
99
+ className: me("input")
100
100
  }
101
- ) : /* @__PURE__ */ B("div", { className: O, onClick: c, children: [
101
+ ) : /* @__PURE__ */ D("div", { className: $, onClick: d, children: [
102
102
  /* @__PURE__ */ r(
103
103
  "span",
104
104
  {
105
- ref: d,
106
- className: V,
107
- title: f && i ? A : void 0,
108
- children: A
105
+ ref: a,
106
+ className: ee,
107
+ title: m && c ? R : void 0,
108
+ children: R
109
109
  }
110
110
  ),
111
111
  !n && /* @__PURE__ */ r(
112
112
  "button",
113
113
  {
114
114
  type: "button",
115
- className: ae("cross-icon", {
115
+ className: me("cross-icon", {
116
116
  [`validation-${l}`]: l,
117
117
  "mobile-disabled": o,
118
118
  disabled: n
119
119
  }),
120
- onClick: S,
121
- children: /* @__PURE__ */ r(et, {})
120
+ onClick: N,
121
+ children: /* @__PURE__ */ r(Ve, {})
122
122
  }
123
123
  )
124
124
  ] });
125
- }, ct = ({
125
+ }, lt = ({
126
126
  items: t = [],
127
127
  parseValueToString: e,
128
128
  getItemValidationErrorType: n,
129
129
  storedItemsMap: o = {},
130
130
  highlightUnStoredItem: s = !1,
131
131
  renderCustomSelectedItem: l,
132
- selectedItemSingleLine: w,
132
+ selectedItemSingleLine: h,
133
133
  selectedItemClassName: u,
134
- selectedItemTextClassName: b,
135
- ...N
136
- }) => t.map((_) => l ? l(_) : /* @__PURE__ */ r(
137
- lt,
134
+ selectedItemTextClassName: v,
135
+ ...g
136
+ }) => t.map((p) => l ? l(p) : /* @__PURE__ */ r(
137
+ rt,
138
138
  {
139
139
  parseValueToString: e,
140
- error: (n == null ? void 0 : n(_)) || "",
141
- item: _,
142
- storedOption: !!o[e(_)],
140
+ error: (n == null ? void 0 : n(p)) || "",
141
+ item: p,
142
+ storedOption: !!o[e(p)],
143
143
  highlightUnStoredItem: s,
144
- singleLine: w,
144
+ singleLine: h,
145
145
  className: u,
146
- textClassName: b,
147
- ...N
146
+ textClassName: v,
147
+ ...g
148
148
  },
149
- e == null ? void 0 : e(_)
150
- )), it = "_prompt_1xfmd_16", at = {
151
- prompt: it
152
- }, dt = J.bind(at), ut = ({ children: t = null }) => /* @__PURE__ */ r("div", { className: dt("prompt"), children: t }), mt = "_item_zw4ux_16", ft = "_divider_zw4ux_24", pt = "_active_zw4ux_49", _t = "_value_zw4ux_55", ht = "_tag_zw4ux_69", wt = "_disabled_zw4ux_80", vt = {
153
- item: mt,
154
- divider: ft,
149
+ e == null ? void 0 : e(p)
150
+ )), ct = "_prompt_1xfmd_16", it = {
151
+ prompt: ct
152
+ }, at = Q.bind(it), dt = ({ children: t = null }) => /* @__PURE__ */ r("div", { className: at("prompt"), children: t }), ut = "_item_zw4ux_16", mt = "_divider_zw4ux_24", ft = "_active_zw4ux_49", pt = "_value_zw4ux_55", _t = "_tag_zw4ux_69", ht = "_disabled_zw4ux_80", wt = {
153
+ item: ut,
154
+ divider: mt,
155
155
  "new-item": "_new-item_zw4ux_31",
156
- active: pt,
157
- value: _t,
156
+ active: ft,
157
+ value: pt,
158
158
  "key-variant": "_key-variant_zw4ux_66",
159
- tag: ht,
159
+ tag: _t,
160
160
  "button-active": "_button-active_zw4ux_80",
161
- disabled: wt,
161
+ disabled: ht,
162
162
  "value-variant": "_value-variant_zw4ux_100"
163
- }, U = J.bind(vt), Le = ({
163
+ }, V = Q.bind(wt), Re = ({
164
164
  isActive: t = !1,
165
165
  isSelected: e = !1,
166
166
  isNew: n = !1,
167
167
  children: o = null,
168
168
  disabled: s = !1,
169
169
  optionVariant: l = "",
170
- newItemButtonText: w = "",
170
+ newItemButtonText: h = "",
171
171
  ...u
172
172
  }) => {
173
- const b = () => w || (l === "key-variant" ? "New key" : "New value");
174
- return n ? /* @__PURE__ */ B(fe, { children: [
175
- /* @__PURE__ */ r("div", { className: U("divider") }),
176
- /* @__PURE__ */ B(
173
+ const v = () => h || (l === "key-variant" ? "New key" : "New value");
174
+ return n ? /* @__PURE__ */ D(he, { children: [
175
+ /* @__PURE__ */ r("div", { className: V("divider") }),
176
+ /* @__PURE__ */ D(
177
177
  "li",
178
178
  {
179
- className: U("new-item", l, {
179
+ className: V("new-item", l, {
180
180
  active: t,
181
181
  selected: e,
182
182
  disabled: s
183
183
  }),
184
184
  ...u,
185
185
  children: [
186
- /* @__PURE__ */ r("span", { className: U("value"), children: o }),
186
+ /* @__PURE__ */ r("span", { className: V("value"), children: o }),
187
187
  /* @__PURE__ */ r(
188
- Xe,
188
+ Ke,
189
189
  {
190
190
  ...!s && u,
191
- className: U({ "button-active": t }),
192
- icon: /* @__PURE__ */ r(Ge, {}),
191
+ className: V({ "button-active": t }),
192
+ icon: /* @__PURE__ */ r(Xe, {}),
193
193
  variant: "text",
194
- children: b()
194
+ children: v()
195
195
  }
196
196
  )
197
197
  ]
@@ -200,94 +200,94 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
200
200
  ] }) : /* @__PURE__ */ r(
201
201
  "li",
202
202
  {
203
- className: U("item", l, {
203
+ className: V("item", l, {
204
204
  active: t,
205
205
  selected: e,
206
206
  disabled: s
207
207
  }),
208
208
  ...s ? {} : u,
209
- children: /* @__PURE__ */ r("span", { className: U("label", "tag"), children: o })
209
+ children: /* @__PURE__ */ r("span", { className: V("label", "tag"), children: o })
210
210
  }
211
211
  );
212
- }, bt = "_container_12uzd_16", yt = {
213
- container: bt,
212
+ }, vt = "_container_12uzd_16", bt = {
213
+ container: vt,
214
214
  "empty-list-message": "_empty-list-message_12uzd_20",
215
215
  "limitation-item": "_limitation-item_12uzd_28"
216
- }, de = J.bind(yt), gt = (t) => {
216
+ }, fe = Q.bind(bt), yt = (t) => {
217
217
  const {
218
218
  options: e,
219
219
  async: n,
220
220
  inputValue: o,
221
221
  loading: s,
222
222
  createWithoutConfirmation: l,
223
- customEmptyListMessage: w,
223
+ customEmptyListMessage: h,
224
224
  customNoMatchesMessage: u,
225
- optionVariant: b,
226
- newItemButtonText: N,
227
- renderOption: _,
228
- getUniqKey: M,
229
- getItemProps: I,
230
- parseValueToString: f,
231
- limitationText: R = "Too many results. Type to search",
232
- optionsLimit: L = 0,
233
- shouldShowEmptyListMessage: y = !0
234
- } = t, E = H(() => (e || []).filter((h) => f(h).toUpperCase().indexOf((o.toUpperCase() || "").trim()) > -1), [o, e, f]), z = H(
235
- (h, S, A = !1) => _ ? _(h, S, A, I) : /* @__PURE__ */ r(
236
- Le,
225
+ optionVariant: v,
226
+ newItemButtonText: g,
227
+ renderOption: p,
228
+ getUniqKey: z,
229
+ getItemProps: k,
230
+ parseValueToString: m,
231
+ limitationText: L = "Too many results. Type to search",
232
+ optionsLimit: P = 0,
233
+ shouldShowEmptyListMessage: b = !0
234
+ } = t, x = Y(() => (e || []).filter((_) => m(_).toUpperCase().indexOf((o.toUpperCase() || "").trim()) > -1), [o, e, m]), A = Y(
235
+ (_, N, R = !1) => p ? p(_, N, R, k) : /* @__PURE__ */ r(
236
+ Re,
237
237
  {
238
- optionVariant: b,
239
- ...I({ item: h, index: S }),
240
- isNew: A,
241
- newItemButtonText: N,
242
- children: f(h)
238
+ optionVariant: v,
239
+ ...k({ item: _, index: N }),
240
+ isNew: R,
241
+ newItemButtonText: g,
242
+ children: m(_)
243
243
  },
244
- (M == null ? void 0 : M(h)) || f(h)
244
+ (z == null ? void 0 : z(_)) || m(_)
245
245
  ),
246
- [I, M, N, b, f, _]
247
- ), D = H(
248
- (h) => h.length ? h.map((S, A) => z(S, A)) : "",
249
- [z]
250
- ), i = H(
251
- (h) => {
252
- const S = h.length;
253
- return /* @__PURE__ */ r("div", { className: de({ container: !S }), children: /* @__PURE__ */ r(
254
- Le,
246
+ [k, z, g, v, m, p]
247
+ ), F = Y(
248
+ (_) => _.length ? _.map((N, R) => A(N, R)) : "",
249
+ [A]
250
+ ), c = Y(
251
+ (_) => {
252
+ const N = _.length;
253
+ return /* @__PURE__ */ r("div", { className: fe({ container: !N }), children: /* @__PURE__ */ r(
254
+ Re,
255
255
  {
256
- optionVariant: b,
256
+ optionVariant: v,
257
257
  isNew: !0,
258
- newItemButtonText: N,
259
- ...I({ item: o, index: S }),
260
- children: f(o)
258
+ newItemButtonText: g,
259
+ ...k({ item: o, index: N }),
260
+ children: m(o)
261
261
  },
262
- f(o)
262
+ m(o)
263
263
  ) });
264
264
  },
265
- [I, o, N, b, f]
266
- ), a = H(
267
- (h) => s ? /* @__PURE__ */ B(fe, { children: [
268
- /* @__PURE__ */ r(ut, { children: /* @__PURE__ */ r(Ke, {}) }),
269
- !l && i(h)
265
+ [k, o, g, v, m]
266
+ ), i = Y(
267
+ (_) => s ? /* @__PURE__ */ D(he, { children: [
268
+ /* @__PURE__ */ r(dt, { children: /* @__PURE__ */ r(Ye, {}) }),
269
+ !l && c(_)
270
270
  ] }) : "",
271
- [l, s, i]
272
- ), d = H(() => {
273
- const h = (e == null ? void 0 : e.length) === 0 ? w || "No available options" : u || "No matches found";
274
- return /* @__PURE__ */ r("div", { className: de("empty-list-message"), children: h });
275
- }, [w, u, e == null ? void 0 : e.length]), c = n ? e : E(), g = a(e);
276
- if (g)
277
- return g;
278
- const k = Ce(c);
279
- return k && !y && l ? null : /* @__PURE__ */ B("div", { className: de({ container: e.length }), children: [
280
- /* @__PURE__ */ B(Ye, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
281
- k ? y && d() : D(c),
282
- (c == null ? void 0 : c.length) > L && L > 0 && R ? /* @__PURE__ */ r("li", { className: de("limitation-item"), "aria-hidden": "true", children: R }) : null
271
+ [l, s, c]
272
+ ), a = Y(() => {
273
+ const _ = (e == null ? void 0 : e.length) === 0 ? h || "No available options" : u || "No matches found";
274
+ return /* @__PURE__ */ r("div", { className: fe("empty-list-message"), children: _ });
275
+ }, [h, u, e == null ? void 0 : e.length]), d = n ? e : x(), y = i(e);
276
+ if (y)
277
+ return y;
278
+ const C = ze(d);
279
+ return C && !b && l ? null : /* @__PURE__ */ D("div", { className: fe({ container: e.length }), children: [
280
+ /* @__PURE__ */ D(We, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
281
+ C ? b && a() : F(d),
282
+ (d == null ? void 0 : d.length) > P && P > 0 && L ? /* @__PURE__ */ r("li", { className: fe("limitation-item"), "aria-hidden": "true", children: L }) : null
283
283
  ] }),
284
- !l && i(c)
284
+ !l && c(d)
285
285
  ] });
286
- }, xt = "_menu_f64z5_16", Nt = "_opened_f64z5_34", Et = "_dark_f64z5_37", St = {
287
- menu: xt,
288
- opened: Nt,
289
- dark: Et
290
- }, It = J.bind(St), kt = (t, e) => !t || t <= e.trim().length, Te = je(
286
+ }, gt = "_menu_f64z5_16", xt = "_opened_f64z5_34", Nt = "_dark_f64z5_37", Et = {
287
+ menu: gt,
288
+ opened: xt,
289
+ dark: Nt
290
+ }, St = Q.bind(Et), It = (t, e) => !t || t <= e.trim().length, $e = Te(
291
291
  ({
292
292
  isOpen: t = !1,
293
293
  style: e = {},
@@ -295,115 +295,115 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
295
295
  isDropdownMode: o,
296
296
  inputValue: s = "",
297
297
  className: l = "",
298
- portalMenuAttribute: w = null,
298
+ portalMenuAttribute: h = null,
299
299
  ...u
300
- }, b) => /* @__PURE__ */ r(
300
+ }, v) => /* @__PURE__ */ r(
301
301
  "ul",
302
302
  {
303
- ref: b,
304
- className: It(
303
+ ref: v,
304
+ className: St(
305
305
  "menu",
306
- { opened: t && (o || kt(n, s)) },
306
+ { opened: t && (o || It(n, s)) },
307
307
  l
308
308
  ),
309
309
  style: e,
310
- ...w ? { [w]: "" } : {},
311
- children: /* @__PURE__ */ r(gt, { inputValue: s, ...u })
310
+ ...h ? { [h]: "" } : {},
311
+ children: /* @__PURE__ */ r(yt, { inputValue: s, ...u })
312
312
  }
313
313
  )
314
- ), Pe = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", me = (t, e) => {
314
+ ), Le = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", _e = (t, e) => {
315
315
  var o;
316
- return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((o = Object.entries(t)) != null && o.every(([s, l]) => me(l, e[s]))));
317
- }, Ct = (t, e, n) => typeof t == "string" ? t === e : n ? (() => {
316
+ return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((o = Object.entries(t)) != null && o.every(([s, l]) => _e(l, e[s]))));
317
+ }, kt = (t, e, n) => typeof t == "string" ? t === e : n ? (() => {
318
318
  const o = n(t);
319
319
  return t[o] === e[o];
320
- })() : !1, Mt = ({
320
+ })() : !1, Ct = ({
321
321
  options: t = [],
322
322
  onChange: e,
323
323
  selectedItems: n = [],
324
324
  handleUnStoredItemCb: o = null,
325
325
  existingItemsMap: s = {},
326
326
  children: l,
327
- customizeNewSelectedValue: w = (_) => _,
327
+ customizeNewSelectedValue: h = (p) => p,
328
328
  getOptionUniqKey: u,
329
- getOptionUniqKeyValue: b,
330
- ...N
329
+ getOptionUniqKeyValue: v,
330
+ ...g
331
331
  }) => {
332
- const [_, M] = oe(s), I = (i, a) => {
333
- const d = {
334
- ..._
332
+ const [p, z] = oe(s), k = (c, i) => {
333
+ const a = {
334
+ ...p
335
335
  };
336
- i.forEach((c) => {
337
- if (t.find((g) => Ct(g, c, u))) {
338
- const g = Pe(c, u);
339
- d[g] = !0;
336
+ c.forEach((d) => {
337
+ if (t.find((y) => kt(y, d, u))) {
338
+ const y = Le(d, u);
339
+ a[y] = !0;
340
340
  }
341
- }), M(d), a(d);
342
- }, f = (i, a) => {
343
- const d = Pe(i, u);
344
- if (d in _) {
345
- const c = { ..._ };
346
- delete c[d], M(c), a(c);
341
+ }), z(a), i(a);
342
+ }, m = (c, i) => {
343
+ const a = Le(c, u);
344
+ if (a in p) {
345
+ const d = { ...p };
346
+ delete d[a], z(d), i(d);
347
347
  } else
348
- a(_);
349
- }, R = (i, a) => {
350
- const d = w(i), c = Array.isArray(d) ? d : [d], k = [...n.filter((S) => c.indexOf(S) < 0), ...c];
351
- e == null || e(k, a), I(c, (S) => o == null ? void 0 : o(k, S));
352
- }, L = (i, a) => {
353
- const d = n.indexOf(i), c = [...n];
354
- c.splice(d, 1, a), e == null || e(c, null);
355
- }, y = (i, a) => {
356
- const d = n.filter((g) => !me(g, i));
357
- e == null || e(d, a), f(i, (g) => o == null ? void 0 : o(d, g));
358
- }, E = (i, a) => {
359
- i && R(i, a);
360
- }, z = (i) => ({
361
- removeItem: y,
362
- editItem: L,
348
+ i(p);
349
+ }, L = (c, i) => {
350
+ const a = h(c), d = Array.isArray(a) ? a : [a], C = [...n.filter((N) => d.indexOf(N) < 0), ...d];
351
+ e == null || e(C, i), k(d, (N) => o == null ? void 0 : o(C, N));
352
+ }, P = (c, i) => {
353
+ const a = n.indexOf(c), d = [...n];
354
+ d.splice(a, 1, i), e == null || e(d, null);
355
+ }, b = (c, i) => {
356
+ const a = n.filter((y) => !_e(y, c));
357
+ e == null || e(a, i), m(c, (y) => o == null ? void 0 : o(a, y));
358
+ }, x = (c, i) => {
359
+ c && L(c, i);
360
+ }, A = (c) => ({
361
+ removeItem: b,
362
+ editItem: P,
363
363
  handleChange: e,
364
- getOptionUniqKeyValue: b,
365
- storedItemsMap: _,
366
- ...i
364
+ getOptionUniqKeyValue: v,
365
+ storedItemsMap: p,
366
+ ...c
367
367
  });
368
368
  return /* @__PURE__ */ r(
369
- ue,
369
+ pe,
370
370
  {
371
- ...N,
372
- stateReducer: (i, a) => {
373
- switch (a.type) {
374
- case ue.stateChangeTypes.keyDownEnter:
375
- case ue.stateChangeTypes.clickItem:
371
+ ...g,
372
+ stateReducer: (c, i) => {
373
+ switch (i.type) {
374
+ case pe.stateChangeTypes.keyDownEnter:
375
+ case pe.stateChangeTypes.clickItem:
376
376
  return {
377
- ...a,
378
- highlightedIndex: i.highlightedIndex,
377
+ ...i,
378
+ highlightedIndex: c.highlightedIndex,
379
379
  inputValue: ""
380
380
  };
381
381
  default:
382
- return a;
382
+ return i;
383
383
  }
384
384
  },
385
- onChange: E,
385
+ onChange: x,
386
386
  selectedItem: null,
387
- children: (i) => l == null ? void 0 : l(z(i))
387
+ children: (c) => l == null ? void 0 : l(A(c))
388
388
  }
389
389
  );
390
- }, zt = "_autocomplete_1so4a_16", At = "_disabled_1so4a_32", Rt = "_error_1so4a_35", Lt = "_touched_1so4a_35", Pt = "_input_1so4a_77", Bt = {
391
- autocomplete: zt,
390
+ }, Mt = "_autocomplete_1so4a_16", zt = "_disabled_1so4a_32", At = "_error_1so4a_35", Rt = "_touched_1so4a_35", Lt = "_input_1so4a_77", Pt = {
391
+ autocomplete: Mt,
392
392
  "autocomplete-wrapper": "_autocomplete-wrapper_1so4a_28",
393
- disabled: At,
394
- error: Rt,
395
- touched: Lt,
393
+ disabled: zt,
394
+ error: At,
395
+ touched: Rt,
396
396
  "clear-icon": "_clear-icon_1so4a_46",
397
397
  "clear-icon--disabled": "_clear-icon--disabled_1so4a_56",
398
398
  "autocomplete-input": "_autocomplete-input_1so4a_60",
399
399
  "single-line-mode": "_single-line-mode_1so4a_68",
400
400
  "mobile-disabled": "_mobile-disabled_1so4a_72",
401
- input: Pt,
401
+ input: Lt,
402
402
  "type-number": "_type-number_1so4a_101",
403
403
  "error-text": "_error-text_1so4a_112",
404
404
  "dropdown-button": "_dropdown-button_1so4a_121",
405
405
  "icon-reversed": "_icon-reversed_1so4a_129"
406
- }, G = J.bind(Bt), uo = (t) => {
406
+ }, J = Q.bind(Pt), ao = (t) => {
407
407
  const {
408
408
  options: e = [],
409
409
  loading: n = !1,
@@ -411,141 +411,143 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
411
411
  },
412
412
  value: s = [],
413
413
  placeholder: l = "",
414
- error: w = "",
414
+ error: h = "",
415
415
  touched: u = !1,
416
- creatable: b = !1,
417
- editable: N = !1,
418
- onChange: _ = () => {
416
+ creatable: v = !1,
417
+ editable: g = !1,
418
+ onChange: p = () => {
419
419
  },
420
- onFocus: M = () => {
420
+ onFocus: z = () => {
421
421
  },
422
- onBlur: I = () => {
422
+ onBlur: k = () => {
423
423
  },
424
- disabled: f = !1,
425
- isDropdownMode: R = !1,
426
- mobileDisabled: L = !1,
427
- inputProps: y = {},
428
- parseValueToString: E = (m) => m == null ? "" : String(m),
429
- maxLength: z = null,
430
- async: D = !1,
431
- customClass: i = "",
432
- createWithoutConfirmation: a = !1,
433
- getItemValidationErrorType: d = null,
434
- clearItemsError: c = () => {
424
+ disabled: m = !1,
425
+ isDropdownMode: L = !1,
426
+ mobileDisabled: P = !1,
427
+ inputProps: b = {},
428
+ parseValueToString: x = (f) => f == null ? "" : String(f),
429
+ maxLength: A = null,
430
+ async: F = !1,
431
+ customClass: c = "",
432
+ createWithoutConfirmation: i = !1,
433
+ getItemValidationErrorType: a = null,
434
+ clearItemsError: d = () => {
435
435
  },
436
- getAdditionalCreationCondition: g = () => !0,
437
- highlightUnStoredItem: k = !1,
438
- parseInputValueFn: h = null,
439
- handleUnStoredItemCb: S = null,
440
- dataAutomationId: A = "",
441
- existingItemsMap: V = {},
442
- customizeNewSelectedValue: O = (m) => m,
443
- renderCustomSelectedItem: P,
444
- useFixedPositioning: $,
445
- newItemButtonText: _e = "",
446
- menuClassName: Y = "",
436
+ getAdditionalCreationCondition: y = () => !0,
437
+ highlightUnStoredItem: C = !1,
438
+ parseInputValueFn: _ = null,
439
+ handleUnStoredItemCb: N = null,
440
+ dataAutomationId: R = "",
441
+ existingItemsMap: ee = {},
442
+ customizeNewSelectedValue: $ = (f) => f,
443
+ renderCustomSelectedItem: B,
444
+ useFixedPositioning: j,
445
+ newItemButtonText: ve = "",
446
+ menuClassName: K = "",
447
447
  selectedItemSingleLine: se,
448
448
  selectedItemClassName: ne,
449
449
  selectedItemTextClassName: re,
450
- ...he
451
- } = t, { refs: le, floatingStyles: K } = De({
450
+ ...be
451
+ } = t, { refs: le, floatingStyles: Z } = Be({
452
452
  placement: "bottom-start",
453
- strategy: $ ? "fixed" : "absolute",
454
- whileElementsMounted: Fe
455
- }), we = s.length === 0 && !f ? l : "", ee = ke(null);
456
- pe(() => {
457
- c();
458
- }, [c, s]);
459
- const ve = (m, x) => {
460
- _(m, x);
461
- }, be = (m, x, C) => ({ item: v, index: j, ...W }) => m({
462
- item: v,
463
- index: j,
464
- isSelected: C.some((te) => me(te, v)),
465
- ...W,
466
- isActive: x === j
467
- }), ye = ({
468
- event: m,
469
- removeItem: x,
470
- inputValue: C
453
+ strategy: j ? "fixed" : "absolute",
454
+ whileElementsMounted: De
455
+ }), ye = s.length === 0 && !m ? l : "", te = Me(null);
456
+ we(() => {
457
+ d();
458
+ }, [d, s]);
459
+ const ge = (f, E) => {
460
+ p(f, E);
461
+ }, xe = (f, E, I) => ({ item: S, index: G, ...H }) => f({
462
+ item: S,
463
+ index: G,
464
+ isSelected: I.some((W) => _e(W, S)),
465
+ ...H,
466
+ isActive: E === G
467
+ }), w = ({
468
+ event: f,
469
+ removeItem: E,
470
+ inputValue: I
471
471
  }) => {
472
- m.key === "Backspace" && !C && s.length && x(s[s.length - 1], null);
473
- }, p = ({
474
- inputValue: m,
475
- selectItem: x,
476
- clearSelection: C
472
+ f.key === "Backspace" && !I && s.length && E(s[s.length - 1], null);
473
+ }, T = ({
474
+ inputValue: f,
475
+ selectItem: E,
476
+ clearSelection: I
477
477
  }) => {
478
- if (h) {
479
- const v = h(m);
480
- (v.length ? v : [m]).forEach((W) => x(W)), C();
478
+ if (_) {
479
+ const S = _(f);
480
+ (S.length ? S : [f]).forEach((H) => E(H)), I();
481
481
  } else
482
- x(m), C();
483
- }, T = (m) => (x) => {
484
- m(x, null), ee.current && ee.current.focus();
485
- }, Q = e.filter((m) => s.every((x) => !me(x, m)));
482
+ E(f), I();
483
+ }, q = (f) => (E) => {
484
+ f(E, null), te.current && te.current.focus();
485
+ }, X = e.filter((f) => s.every((E) => !_e(E, f)));
486
486
  return /* @__PURE__ */ r(
487
- Mt,
487
+ Ct,
488
488
  {
489
- onChange: ve,
490
- itemToString: E,
489
+ onChange: ge,
490
+ itemToString: x,
491
491
  selectedItems: s,
492
492
  onStateChange: o,
493
493
  options: e,
494
- existingItemsMap: V,
495
- handleUnStoredItemCb: S,
496
- customizeNewSelectedValue: O,
494
+ existingItemsMap: ee,
495
+ handleUnStoredItemCb: N,
496
+ customizeNewSelectedValue: $,
497
497
  children: ({
498
- getInputProps: m,
499
- getItemProps: x,
500
- isOpen: C,
501
- inputValue: v = "",
502
- highlightedIndex: j,
503
- removeItem: W,
504
- editItem: te,
505
- openMenu: Z,
506
- selectItem: ge,
507
- clearSelection: ce,
508
- toggleMenu: xe,
509
- storedItemsMap: q,
510
- getRootProps: Ne
498
+ getInputProps: f,
499
+ getItemProps: E,
500
+ isOpen: I,
501
+ inputValue: S = "",
502
+ highlightedIndex: G,
503
+ removeItem: H,
504
+ editItem: W,
505
+ openMenu: ce,
506
+ selectItem: ie,
507
+ clearSelection: ae,
508
+ toggleMenu: U,
509
+ storedItemsMap: Ne,
510
+ getRootProps: Ee
511
511
  }) => {
512
- const Ee = Ne(void 0, { suppressRefError: !0 }), Me = v ?? "";
513
- return /* @__PURE__ */ B("div", { ...Ee, className: G("autocomplete-wrapper"), children: [
514
- /* @__PURE__ */ B(fe, { children: [
515
- /* @__PURE__ */ B(
512
+ const Se = Ee(void 0, { suppressRefError: !0 }), de = {
513
+ ...Se,
514
+ ref: (M) => (le.setReference(M), Se.ref(M))
515
+ }, Ie = S ?? "";
516
+ return /* @__PURE__ */ D("div", { ...de, className: J("autocomplete-wrapper"), children: [
517
+ /* @__PURE__ */ D(he, { children: [
518
+ /* @__PURE__ */ D(
516
519
  "div",
517
520
  {
518
- ref: le.setReference,
519
- className: G("autocomplete", i, {
520
- "mobile-disabled": L,
521
- error: w,
521
+ className: J("autocomplete", c, {
522
+ "mobile-disabled": P,
523
+ error: h,
522
524
  touched: u,
523
- disabled: f
525
+ disabled: m
524
526
  }),
525
527
  children: [
526
- /* @__PURE__ */ B(
528
+ /* @__PURE__ */ D(
527
529
  "div",
528
530
  {
529
- className: G("autocomplete-input", {
530
- "mobile-disabled": L,
531
+ className: J("autocomplete-input", {
532
+ "mobile-disabled": P,
531
533
  "single-line-mode": se
532
534
  }),
533
535
  children: [
534
536
  /* @__PURE__ */ r(
535
- ct,
537
+ lt,
536
538
  {
537
539
  items: s,
538
- onRemoveItem: T(W),
539
- disabled: f,
540
- mobileDisabled: L,
541
- parseValueToString: E,
542
- getItemValidationErrorType: d,
543
- renderCustomSelectedItem: P,
544
- editItem: te,
545
- editable: N,
546
- getAdditionalCreationCondition: g,
547
- storedItemsMap: q,
548
- highlightUnStoredItem: k,
540
+ onRemoveItem: q(H),
541
+ disabled: m,
542
+ mobileDisabled: P,
543
+ parseValueToString: x,
544
+ getItemValidationErrorType: a,
545
+ renderCustomSelectedItem: B,
546
+ editItem: W,
547
+ editable: g,
548
+ getAdditionalCreationCondition: y,
549
+ storedItemsMap: Ne,
550
+ highlightUnStoredItem: C,
549
551
  selectedItemSingleLine: se,
550
552
  selectedItemClassName: ne,
551
553
  selectedItemTextClassName: re
@@ -554,91 +556,91 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
554
556
  /* @__PURE__ */ r(
555
557
  "input",
556
558
  {
557
- ...m({
558
- ref: ee,
559
- placeholder: we,
560
- maxLength: z,
559
+ ...f({
560
+ ref: te,
561
+ placeholder: ye,
562
+ maxLength: A,
561
563
  onFocus: () => {
562
- R && Z(), M();
564
+ L && ce(), z();
563
565
  },
564
- onKeyDown: (F) => {
565
- F.key === $e && v && b && g(v) && p({
566
- inputValue: v,
567
- selectItem: ge,
568
- clearSelection: ce
569
- }), ye({ event: F, removeItem: W, inputValue: v });
566
+ onKeyDown: (M) => {
567
+ M.key === Oe && S && v && y(S) && T({
568
+ inputValue: S,
569
+ selectItem: ie,
570
+ clearSelection: ae
571
+ }), w({ event: M, removeItem: H, inputValue: S });
570
572
  },
571
573
  onBlur: () => {
572
- I(), v && b && g(v) && p({
573
- inputValue: v,
574
- selectItem: ge,
575
- clearSelection: ce
574
+ k(), S && v && y(S) && T({
575
+ inputValue: S,
576
+ selectItem: ie,
577
+ clearSelection: ae
576
578
  });
577
579
  },
578
- disabled: f,
579
- ...y
580
+ disabled: m,
581
+ ...b
580
582
  }),
581
- className: G("input", { disabled: f }, y.className),
582
- "data-automation-id": A
583
+ className: J("input", { disabled: m }, b.className),
584
+ "data-automation-id": R
583
585
  }
584
586
  )
585
587
  ]
586
588
  }
587
589
  ),
588
- (y == null ? void 0 : y.clearable) && !Ce(s) && /* @__PURE__ */ r(
590
+ (b == null ? void 0 : b.clearable) && !ze(s) && /* @__PURE__ */ r(
589
591
  "button",
590
592
  {
591
593
  type: "button",
592
- className: G("clear-icon", { "clear-icon--disabled": f }),
594
+ className: J("clear-icon", { "clear-icon--disabled": m }),
593
595
  onClick: () => {
594
- var F;
595
- return !f && ((F = y == null ? void 0 : y.onClear) == null ? void 0 : F.call(y));
596
+ var M;
597
+ return !m && ((M = b == null ? void 0 : b.onClear) == null ? void 0 : M.call(b));
596
598
  },
597
- onMouseDown: (F) => F.preventDefault(),
598
- children: /* @__PURE__ */ r(tt, {})
599
+ onMouseDown: (M) => M.preventDefault(),
600
+ children: /* @__PURE__ */ r(et, {})
599
601
  }
600
602
  ),
601
- R && /* @__PURE__ */ r(
603
+ L && /* @__PURE__ */ r(
602
604
  "button",
603
605
  {
604
606
  type: "button",
605
- className: G("dropdown-button", { "icon-reversed": C }),
606
- onClick: () => xe(),
607
+ className: J("dropdown-button", { "icon-reversed": I }),
608
+ onClick: () => U(),
607
609
  "aria-label": "Toggle dropdown",
608
- "aria-expanded": C,
609
- children: /* @__PURE__ */ r(Oe, {})
610
+ "aria-expanded": I,
611
+ children: /* @__PURE__ */ r(Fe, {})
610
612
  }
611
613
  )
612
614
  ]
613
615
  }
614
616
  ),
615
- w && u && /* @__PURE__ */ r("span", { className: G("error-text"), children: w })
617
+ h && u && /* @__PURE__ */ r("span", { className: J("error-text"), children: h })
616
618
  ] }),
617
619
  /* @__PURE__ */ r(
618
- Te,
620
+ $e,
619
621
  {
620
- isOpen: C,
622
+ isOpen: I,
621
623
  loading: n,
622
- async: D,
624
+ async: F,
623
625
  ref: le.setFloating,
624
- newItemButtonText: _e,
625
- isDropdownMode: R,
626
- style: K,
627
- inputValue: Me.trim(),
628
- getItemProps: be(x, j, s),
629
- parseValueToString: E,
630
- createWithoutConfirmation: a,
631
- options: Q,
632
- className: Y,
633
- ...he
626
+ newItemButtonText: ve,
627
+ isDropdownMode: L,
628
+ style: Z,
629
+ inputValue: Ie.trim(),
630
+ getItemProps: xe(E, G, s),
631
+ parseValueToString: x,
632
+ createWithoutConfirmation: i,
633
+ options: X,
634
+ className: K,
635
+ ...be
634
636
  }
635
637
  )
636
638
  ] });
637
639
  }
638
640
  }
639
641
  );
640
- }, Dt = ({ skip: t }) => {
641
- He(() => {
642
+ }, Bt = ({ skip: t }) => {
643
+ je(() => {
642
644
  if (t)
643
645
  return;
644
646
  let e = window.scrollY, n = !0;
@@ -652,15 +654,15 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
652
654
  e = window.scrollY, window.addEventListener("scroll", l, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
653
655
  e = window.scrollY, s();
654
656
  });
655
- const w = setTimeout(() => {
657
+ const h = setTimeout(() => {
656
658
  n = !1;
657
659
  }, o);
658
660
  return () => {
659
- clearTimeout(w), window.removeEventListener("scroll", l, { capture: !0 });
661
+ clearTimeout(h), window.removeEventListener("scroll", l, { capture: !0 });
660
662
  };
661
663
  }, [t]);
662
- }, Ft = ({ skip: t, reference: e }) => {
663
- pe(() => {
664
+ }, Dt = ({ skip: t, reference: e }) => {
665
+ we(() => {
664
666
  if (t)
665
667
  return;
666
668
  const n = () => {
@@ -671,8 +673,8 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
671
673
  window.removeEventListener("resize", n);
672
674
  };
673
675
  }, [t, e]);
674
- }, Ot = ({ skip: t, onClose: e, menuRef: n }) => {
675
- pe(() => {
676
+ }, Ft = ({ skip: t, onClose: e, menuRef: n }) => {
677
+ we(() => {
676
678
  if (t)
677
679
  return;
678
680
  const o = (s) => {
@@ -683,21 +685,21 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
683
685
  window.removeEventListener("scroll", o, !0);
684
686
  };
685
687
  }, [t, e, n]);
686
- }, $t = {
688
+ }, Ot = {
687
689
  "input-wrapper": "_input-wrapper_d9vma_1",
688
690
  "dropdown-button": "_dropdown-button_d9vma_6",
689
691
  "icon-reversed": "_icon-reversed_d9vma_14"
690
- }, Be = J.bind($t), Tt = 0, jt = Qe({
692
+ }, Pe = Q.bind(Ot), $t = 0, Tt = Je({
691
693
  fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
692
694
  boundary: document == null ? void 0 : document.documentElement,
693
695
  rootBoundary: "viewport"
694
- }), Ht = Ze({
696
+ }), jt = Qe({
695
697
  apply({ rects: t, elements: e }) {
696
698
  Object.assign(e.floating.style, {
697
699
  width: `${t.reference.width}px`
698
700
  });
699
701
  }
700
- }), mo = (t) => {
702
+ }), uo = (t) => {
701
703
  const {
702
704
  options: e = [],
703
705
  value: n,
@@ -706,184 +708,174 @@ const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
706
708
  },
707
709
  onFocus: l = () => {
708
710
  },
709
- onBlur: w = () => {
711
+ onBlur: h = () => {
710
712
  },
711
713
  disabled: u = !1,
712
- inputProps: b = {},
713
- parseValueToString: N = (p) => p === null ? "" : String(p),
714
- minLength: _ = 1,
715
- skipOptionCreation: M = !1,
716
- maxLength: I = null,
717
- optionVariant: f = "",
718
- isRequired: R = !1,
719
- error: L = "",
720
- touched: y = !1,
721
- setTouch: E = () => {
714
+ inputProps: v = {},
715
+ parseValueToString: g = (w) => w === null ? "" : String(w),
716
+ minLength: p = 1,
717
+ skipOptionCreation: z = !1,
718
+ maxLength: k = null,
719
+ optionVariant: m = "",
720
+ isRequired: L = !1,
721
+ error: P = "",
722
+ touched: b = !1,
723
+ setTouch: x = () => {
722
724
  },
723
- createWithoutConfirmation: z = !1,
724
- menuClassName: D = "",
725
- icon: i,
726
- isDropdownMode: a = !1,
727
- isOptionUnique: d,
728
- refFunction: c,
729
- stateReducer: g,
730
- onStateChange: k,
731
- useFixedPositioning: h,
732
- dropdownMatchInputWidth: S = !1,
733
- withMenuFlip: A = !1,
734
- newItemButtonText: V = "",
735
- menuPortalRoot: O,
736
- ...P
737
- } = t, [$, _e] = oe(!1), Y = ke(null), se = H(() => {
738
- var p;
739
- return (p = Y.current) == null ? void 0 : p.call(Y);
740
- }, []), ne = !$ || !O, re = O || h ? "fixed" : "absolute", he = !$ || re === "absolute", le = We(
725
+ createWithoutConfirmation: A = !1,
726
+ menuClassName: F = "",
727
+ icon: c,
728
+ isDropdownMode: i = !1,
729
+ isOptionUnique: a,
730
+ refFunction: d,
731
+ stateReducer: y,
732
+ onStateChange: C,
733
+ useFixedPositioning: _,
734
+ dropdownMatchInputWidth: N = !1,
735
+ withMenuFlip: R = !1,
736
+ newItemButtonText: ee = "",
737
+ menuPortalRoot: $,
738
+ ...B
739
+ } = t, [j, ve] = oe(!1), K = Me(null), se = Y(() => {
740
+ var w;
741
+ return (w = K.current) == null ? void 0 : w.call(K);
742
+ }, []), ne = !j || !$, re = $ || _ ? "fixed" : "absolute", be = !j || re === "absolute", le = He(
741
743
  () => [
742
- ...A ? [jt] : [],
743
- ...S ? [Ht] : []
744
+ ...R ? [Tt] : [],
745
+ ...N ? [jt] : []
744
746
  ],
745
- [A, S]
746
- ), { refs: K, floatingStyles: we } = De({
747
+ [R, N]
748
+ ), { refs: Z, floatingStyles: ye } = Be({
747
749
  placement: "bottom-start",
748
- whileElementsMounted: Fe,
750
+ whileElementsMounted: De,
749
751
  strategy: re,
750
752
  middleware: le
751
- }), ee = H(
752
- (p) => {
753
- if (K.setReference(p), !!c) {
754
- if (typeof c == "function") {
755
- c(p);
756
- return;
757
- }
758
- c.current = p;
759
- }
760
- },
761
- [K, c]
762
- );
763
- Dt({ skip: ne }), Ft({ skip: ne, reference: K.reference }), Ot({
764
- skip: he,
753
+ });
754
+ Bt({ skip: ne }), Dt({ skip: ne, reference: Z.reference }), Ft({
755
+ skip: be,
765
756
  onClose: se,
766
- menuRef: K.floating
757
+ menuRef: Z.floating
767
758
  });
768
- const ve = (p, T, Q) => ({ item: m, index: x, ...C }) => p({
769
- item: m,
770
- index: x,
771
- isSelected: Q !== null && Q === m,
772
- ...C,
773
- isActive: T === x
774
- }), be = (p, T) => {
775
- p.key === Ve && (p.preventDefault(), T(e.length));
776
- }, ye = H(
777
- (p, ...T) => {
778
- (p == null ? void 0 : p.isOpen) !== void 0 && _e(p.isOpen), k == null || k(p, ...T);
759
+ const te = (w, T, q) => ({ item: X, index: f, ...E }) => w({
760
+ item: X,
761
+ index: f,
762
+ isSelected: q !== null && q === X,
763
+ ...E,
764
+ isActive: T === f
765
+ }), ge = (w, T) => {
766
+ w.key === Ue && (w.preventDefault(), T(e.length));
767
+ }, xe = Y(
768
+ (w, ...T) => {
769
+ (w == null ? void 0 : w.isOpen) !== void 0 && ve(w.isOpen), C == null || C(w, ...T);
779
770
  },
780
- [k]
771
+ [C]
781
772
  );
782
773
  return /* @__PURE__ */ r(
783
- ue,
774
+ pe,
784
775
  {
785
776
  onChange: s,
786
- itemToString: N,
777
+ itemToString: g,
787
778
  selectedItem: n,
788
- onStateChange: ye,
789
- defaultHighlightedIndex: Tt,
790
- stateReducer: g,
779
+ onStateChange: xe,
780
+ defaultHighlightedIndex: $t,
781
+ stateReducer: y,
791
782
  children: ({
792
- getInputProps: p,
783
+ getInputProps: w,
793
784
  getItemProps: T,
794
- setHighlightedIndex: Q,
795
- toggleMenu: m,
796
- openMenu: x,
797
- closeMenu: C,
798
- isOpen: v,
799
- inputValue: j,
800
- highlightedIndex: W,
801
- getRootProps: te,
802
- selectItem: Z
785
+ setHighlightedIndex: q,
786
+ toggleMenu: X,
787
+ openMenu: f,
788
+ closeMenu: E,
789
+ isOpen: I,
790
+ inputValue: S,
791
+ highlightedIndex: G,
792
+ getRootProps: H,
793
+ selectItem: W
803
794
  }) => {
804
- const ce = {
805
- ...te(void 0, { suppressRefError: !0 })
795
+ const ce = H(void 0, { suppressRefError: !0 }), ie = {
796
+ ...ce,
797
+ ref: (O) => (Z.setReference(O), ce.ref(O))
806
798
  };
807
- Y.current || (Y.current = C);
808
- const xe = j ?? "", { onClear: q, clearable: Ne, ...Ee } = b, F = Ne && n !== null, ze = (...X) => {
809
- Z(null), q == null || q(...X);
810
- }, Ae = /* @__PURE__ */ r(
811
- Te,
799
+ K.current || (K.current = E);
800
+ const ae = S ?? "", { onClear: U, clearable: Ne, ...Ee } = v, de = Ne && n !== null, Ie = (...O) => {
801
+ W(null), U == null || U(...O);
802
+ }, M = /* @__PURE__ */ r(
803
+ $e,
812
804
  {
813
- isOpen: v,
814
- isDropdownMode: a,
815
- style: we,
816
- ref: K.setFloating,
817
- portalMenuAttribute: O ? Ue : null,
818
- minLength: _,
819
- inputValue: (j || "").trim(),
820
- getItemProps: ve(T, W, n),
821
- parseValueToString: N,
822
- optionVariant: f,
823
- createWithoutConfirmation: z,
824
- className: D,
805
+ isOpen: I,
806
+ isDropdownMode: i,
807
+ style: ye,
808
+ ref: Z.setFloating,
809
+ portalMenuAttribute: $ ? qe : null,
810
+ minLength: p,
811
+ inputValue: (S || "").trim(),
812
+ getItemProps: te(T, G, n),
813
+ parseValueToString: g,
814
+ optionVariant: m,
815
+ createWithoutConfirmation: A,
816
+ className: F,
825
817
  options: e,
826
- newItemButtonText: V,
827
- ...P
818
+ newItemButtonText: ee,
819
+ ...B
828
820
  }
829
821
  );
830
- return /* @__PURE__ */ B(fe, { children: [
831
- /* @__PURE__ */ B("div", { className: Be("input-wrapper"), ...ce, children: [
822
+ return /* @__PURE__ */ D(he, { children: [
823
+ /* @__PURE__ */ D("div", { className: Pe("input-wrapper"), ...ie, children: [
832
824
  /* @__PURE__ */ r(
833
- qe,
825
+ Ze,
834
826
  {
835
- ...p({
827
+ ...w({
836
828
  placeholder: u ? "" : o,
837
- maxLength: I || void 0,
829
+ maxLength: k || void 0,
838
830
  onFocus: () => {
839
- a && !v && (x(), E == null || E(!0)), l();
831
+ i && !I && (f(), x == null || x(!0)), l();
840
832
  },
841
- ref: ee,
842
- onKeyDown: (X) => {
843
- X.key === $e && X.preventDefault(), j && v && be(X, Q);
833
+ ref: d,
834
+ onKeyDown: (O) => {
835
+ O.key === Oe && O.preventDefault(), S && I && ge(O, q);
844
836
  },
845
- onBlur: (X) => {
846
- const ie = xe.trim(), Se = !Ce(ie), Re = Se ? e.find((Ie) => N(Ie) === ie) : void 0;
847
- Z(Re || (!M && z && Se ? ie : null)), w(X), d == null || d(
848
- Se ? !e.some((Ie) => N(Ie) === ie) : null
849
- ), a && v && m(), E == null || E(!0);
837
+ onBlur: (O) => {
838
+ const ue = ae.trim(), ke = !ze(ue), Ae = ke ? e.find((Ce) => g(Ce) === ue) : void 0;
839
+ W(Ae || (!z && A && ke ? ue : null)), h(O), a == null || a(
840
+ ke ? !e.some((Ce) => g(Ce) === ue) : null
841
+ ), i && I && X(), x == null || x(!0);
850
842
  },
851
843
  disabled: u,
852
844
  defaultWidth: !1,
853
- isRequired: R,
854
- touched: y,
855
- error: L,
845
+ isRequired: L,
846
+ touched: b,
847
+ error: P,
856
848
  ...Ee,
857
- clearable: F,
858
- onClear: F ? ze : q,
859
- endIcon: a && !i ? /* @__PURE__ */ r(
849
+ clearable: de,
850
+ onClear: de ? Ie : U,
851
+ endIcon: i && !c ? /* @__PURE__ */ r(
860
852
  "button",
861
853
  {
862
854
  type: "button",
863
- className: Be("dropdown-button", { "icon-reversed": v }),
864
- onClick: () => m(),
855
+ className: Pe("dropdown-button", { "icon-reversed": I }),
856
+ onClick: () => X(),
865
857
  "aria-label": "Toggle dropdown",
866
- "aria-expanded": v,
867
- children: /* @__PURE__ */ r(Oe, {})
858
+ "aria-expanded": I,
859
+ children: /* @__PURE__ */ r(Fe, {})
868
860
  }
869
- ) : i,
870
- minLength: a ? 0 : _
861
+ ) : c,
862
+ minLength: i ? 0 : p
871
863
  })
872
864
  }
873
865
  ),
874
- !O && Ae
866
+ !$ && M
875
867
  ] }),
876
- O && Je(Ae, O)
868
+ $ && Ge(M, $)
877
869
  ] });
878
870
  }
879
871
  }
880
872
  );
881
873
  };
882
874
  export {
883
- Te as AutocompleteMenu,
884
- Le as AutocompleteOption,
885
- gt as AutocompleteOptions,
886
- ut as AutocompletePrompt,
887
- uo as MultipleAutocomplete,
888
- mo as SingleAutocomplete
875
+ $e as AutocompleteMenu,
876
+ Re as AutocompleteOption,
877
+ yt as AutocompleteOptions,
878
+ dt as AutocompletePrompt,
879
+ ao as MultipleAutocomplete,
880
+ uo as SingleAutocomplete
889
881
  };