@reportportal/ui-kit 0.0.1-alpha.263 → 0.0.1-alpha.265

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