@snmt-react-ui/async-select 1.13.12 → 1.13.13

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,6 +1,6 @@
1
1
  import "./index.css";
2
2
  import { jsx as e, Fragment as F, jsxs as n } from "react/jsx-runtime";
3
- import { forwardRef as J, useState as N, useRef as T, useEffect as O, useCallback as M, useContext as X, useImperativeHandle as o1, createContext as I1, useLayoutEffect as L1, useMemo as H1 } from "react";
3
+ import { forwardRef as J, useState as Z, useRef as T, useEffect as O, useCallback as N, useContext as X, useImperativeHandle as o1, createContext as I1, useLayoutEffect as L1, useMemo as H1 } from "react";
4
4
  import { Select as O1, Tag as V1, Flex as T1, Checkbox as S1, Avatar as W1, Typography as g1, Popover as $1 } from "antd";
5
5
  import { COLORS as a, SNMTUiContext as s1 } from "@snmt-react-ui/core";
6
6
  var j1 = Object.defineProperty, F1 = (i, l, C) => l in i ? j1(i, l, { enumerable: !0, configurable: !0, writable: !0, value: C }) : i[l] = C, P1 = (i, l, C) => F1(i, l + "", C), U1 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
@@ -36,13 +36,13 @@ const G1 = (i, l) => () => {
36
36
  }), i.loadLanguages(l, G1(i, t));
37
37
  }, q1 = function(i, l) {
38
38
  let C = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
39
- const t = l.languages[0], h = l.options ? l.options.fallbackLng : !1, r = l.languages[l.languages.length - 1];
39
+ const t = l.languages[0], h = l.options ? l.options.fallbackLng : !1, d = l.languages[l.languages.length - 1];
40
40
  if (t.toLowerCase() === "cimode") return !0;
41
- const d = (w, s) => {
41
+ const r = (w, s) => {
42
42
  const o = l.services.backendConnector.state[`${w}|${s}`];
43
43
  return o === -1 || o === 2;
44
44
  };
45
- return C.bindI18n && C.bindI18n.indexOf("languageChanging") > -1 && l.services.backendConnector.backend && l.isLanguageChangingTo && !d(l.isLanguageChangingTo, i) ? !1 : !!(l.hasResourceBundle(t, i) || !l.services.backendConnector.backend || l.options.resources && !l.options.partialBundledLanguages || d(t, i) && (!h || d(r, i)));
45
+ return C.bindI18n && C.bindI18n.indexOf("languageChanging") > -1 && l.services.backendConnector.backend && l.isLanguageChangingTo && !r(l.isLanguageChangingTo, i) ? !1 : !!(l.hasResourceBundle(t, i) || !l.services.backendConnector.backend || l.options.resources && !l.options.partialBundledLanguages || r(t, i) && (!h || r(d, i)));
46
46
  }, J1 = function(i, l) {
47
47
  let C = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
48
48
  return !l.languages || !l.languages.length ? (u1("i18n.languages were undefined or empty", l.languages), !0) : l.options.ignoreJSONStructure !== void 0 ? l.hasLoadedNamespace(i, {
@@ -101,57 +101,57 @@ const c2 = (i, l) => {
101
101
  return O(() => {
102
102
  C.current = i;
103
103
  }, [i, l]), C.current;
104
- }, K1 = (i, l, C, t) => i.getFixedT(l, C, t), n2 = (i, l, C, t) => M(K1(i, l, C, t), [i, l, C, t]), r2 = function(i) {
104
+ }, K1 = (i, l, C, t) => i.getFixedT(l, C, t), n2 = (i, l, C, t) => N(K1(i, l, C, t), [i, l, C, t]), r2 = function(i) {
105
105
  let l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
106
106
  const {
107
107
  i18n: C
108
108
  } = l, {
109
109
  i18n: t,
110
110
  defaultNS: h
111
- } = X(s2) || {}, r = C || t || o2();
112
- if (r && !r.reportNamespaces && (r.reportNamespaces = new a2()), !r) {
111
+ } = X(s2) || {}, d = C || t || o2();
112
+ if (d && !d.reportNamespaces && (d.reportNamespaces = new a2()), !d) {
113
113
  u1("You will need to pass in an i18next instance by using initReactI18next");
114
- const H = (_, k) => q(k) ? k : X1(k) && q(k.defaultValue) ? k.defaultValue : Array.isArray(_) ? _[_.length - 1] : _, p = [H, {}, !1];
115
- return p.t = H, p.i18n = {}, p.ready = !1, p;
114
+ const H = (_, k) => q(k) ? k : X1(k) && q(k.defaultValue) ? k.defaultValue : Array.isArray(_) ? _[_.length - 1] : _, g = [H, {}, !1];
115
+ return g.t = H, g.i18n = {}, g.ready = !1, g;
116
116
  }
117
- r.options.react && r.options.react.wait !== void 0 && u1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
118
- const d = {
117
+ d.options.react && d.options.react.wait !== void 0 && u1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
118
+ const r = {
119
119
  ...t2(),
120
- ...r.options.react,
120
+ ...d.options.react,
121
121
  ...l
122
122
  }, {
123
123
  useSuspense: w,
124
124
  keyPrefix: s
125
- } = d;
125
+ } = r;
126
126
  let o = i;
127
- o = q(o) ? [o] : o || ["translation"], r.reportNamespaces.addUsedNamespaces && r.reportNamespaces.addUsedNamespaces(o);
128
- const c = (r.isInitialized || r.initializedStoreOnce) && o.every((H) => J1(H, r, d)), Z = n2(r, l.lng || null, d.nsMode === "fallback" ? o : o[0], s), m = () => Z, g = () => K1(r, l.lng || null, d.nsMode === "fallback" ? o : o[0], s), [E, x] = N(m);
127
+ o = q(o) ? [o] : o || ["translation"], d.reportNamespaces.addUsedNamespaces && d.reportNamespaces.addUsedNamespaces(o);
128
+ const c = (d.isInitialized || d.initializedStoreOnce) && o.every((H) => J1(H, d, r)), v = n2(d, l.lng || null, r.nsMode === "fallback" ? o : o[0], s), p = () => v, M = () => K1(d, l.lng || null, r.nsMode === "fallback" ? o : o[0], s), [E, x] = Z(p);
129
129
  let B = o.join();
130
130
  l.lng && (B = `${l.lng}${B}`);
131
131
  const I = c2(B), A = T(!0);
132
132
  O(() => {
133
133
  const {
134
134
  bindI18n: H,
135
- bindI18nStore: p
136
- } = d;
137
- A.current = !0, !c && !w && (l.lng ? x1(r, l.lng, o, () => {
138
- A.current && x(g);
139
- }) : R1(r, o, () => {
140
- A.current && x(g);
141
- })), c && I && I !== B && A.current && x(g);
135
+ bindI18nStore: g
136
+ } = r;
137
+ A.current = !0, !c && !w && (l.lng ? x1(d, l.lng, o, () => {
138
+ A.current && x(M);
139
+ }) : R1(d, o, () => {
140
+ A.current && x(M);
141
+ })), c && I && I !== B && A.current && x(M);
142
142
  const _ = () => {
143
- A.current && x(g);
143
+ A.current && x(M);
144
144
  };
145
- return H && r && r.on(H, _), p && r && r.store.on(p, _), () => {
146
- A.current = !1, H && r && H.split(" ").forEach((k) => r.off(k, _)), p && r && p.split(" ").forEach((k) => r.store.off(k, _));
145
+ return H && d && d.on(H, _), g && d && d.store.on(g, _), () => {
146
+ A.current = !1, H && d && H.split(" ").forEach((k) => d.off(k, _)), g && d && g.split(" ").forEach((k) => d.store.off(k, _));
147
147
  };
148
- }, [r, B]), O(() => {
149
- A.current && c && x(m);
150
- }, [r, s, c]);
151
- const S = [E, r, c];
152
- if (S.t = E, S.i18n = r, S.ready = c, c || !c && !w) return S;
148
+ }, [d, B]), O(() => {
149
+ A.current && c && x(p);
150
+ }, [d, s, c]);
151
+ const S = [E, d, c];
152
+ if (S.t = E, S.i18n = d, S.ready = c, c || !c && !w) return S;
153
153
  throw new Promise((H) => {
154
- l.lng ? x1(r, l.lng, o, () => H()) : R1(r, o, () => H());
154
+ l.lng ? x1(d, l.lng, o, () => H()) : R1(d, o, () => H());
155
155
  });
156
156
  }, w1 = ({
157
157
  children: i,
@@ -159,8 +159,8 @@ const c2 = (i, l) => {
159
159
  flexWrap: C = "nowrap",
160
160
  alignItems: t = "normal",
161
161
  justifyContent: h = "normal",
162
- flex: r,
163
- gap: d,
162
+ flex: d,
163
+ gap: r,
164
164
  padding: w
165
165
  }) => /* @__PURE__ */ e(
166
166
  T1,
@@ -170,41 +170,41 @@ const c2 = (i, l) => {
170
170
  wrap: C,
171
171
  align: t,
172
172
  justify: h,
173
- flex: r,
174
- gap: d,
173
+ flex: d,
174
+ gap: r,
175
175
  style: { padding: w },
176
176
  children: i
177
177
  }
178
178
  ), d2 = (i, { enabled: l = !0 } = {}) => {
179
- const [C, t] = N(!1), h = M(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), r = M(() => {
180
- const d = h();
181
- if (!d) {
179
+ const [C, t] = Z(!1), h = N(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), d = N(() => {
180
+ const r = h();
181
+ if (!r) {
182
182
  t(!1);
183
183
  return;
184
184
  }
185
185
  const w = {
186
- whiteSpace: d.style.whiteSpace,
187
- overflow: d.style.overflow,
188
- textOverflow: d.style.textOverflow
186
+ whiteSpace: r.style.whiteSpace,
187
+ overflow: r.style.overflow,
188
+ textOverflow: r.style.textOverflow
189
189
  };
190
- Object.assign(d.style, {
190
+ Object.assign(r.style, {
191
191
  whiteSpace: "nowrap",
192
192
  overflow: "hidden",
193
193
  textOverflow: "clip"
194
194
  });
195
- const s = d.scrollWidth > d.offsetWidth + 1;
196
- Object.assign(d.style, w), t(s);
195
+ const s = r.scrollWidth > r.offsetWidth + 1;
196
+ Object.assign(r.style, w), t(s);
197
197
  }, [h]);
198
198
  return L1(() => {
199
- const d = h();
200
- if (!d) {
199
+ const r = h();
200
+ if (!r) {
201
201
  t(!1);
202
202
  return;
203
203
  }
204
- r();
205
- const w = new ResizeObserver(r);
206
- return w.observe(d), () => w.disconnect();
207
- }, [h, r]), C;
204
+ d();
205
+ const w = new ResizeObserver(d);
206
+ return w.observe(r), () => w.disconnect();
207
+ }, [h, d]), C;
208
208
  }, { Title: w2, Text: L2 } = g1, g2 = {
209
209
  h1: 1,
210
210
  h2: 2,
@@ -217,37 +217,39 @@ const c2 = (i, l) => {
217
217
  color: C,
218
218
  children: t,
219
219
  onClick: h,
220
- collapsed: r,
221
- whiteSpace: d = "normal",
220
+ whiteSpace: d,
222
221
  /** This prop allows you to enable tooltip if text size is too big */
223
- trim: w = !1
224
- }, s) => {
225
- const o = T(null);
226
- o1(s, () => o.current);
227
- const c = d2(o, { enabled: w }), Z = l === "h1" || l === "h2" || l === "h3" || l === "h4";
228
- let m = `snmt-typography snmt-typography-${l}`;
229
- i && i !== "inherit" && (m += ` snmt-typography-align-${i}`), r && (m += " collapsed");
230
- const g = {
231
- className: m,
232
- style: { color: C, whiteSpace: w ? "nowrap" : d, display: w ? "block" : "" },
222
+ trim: r = !1
223
+ }, w) => {
224
+ const s = T(null);
225
+ o1(w, () => s.current);
226
+ const o = d2(s, { enabled: r }), c = l === "h1" || l === "h2" || l === "h3" || l === "h4";
227
+ let v = `snmt-typography snmt-typography-${l}`;
228
+ i && i !== "inherit" && (v += ` snmt-typography-align-${i}`);
229
+ const p = {
230
+ className: v,
231
+ style: {
232
+ color: C,
233
+ whiteSpace: d
234
+ },
233
235
  onClick: h,
234
- ref: o,
235
- ellipsis: w && c ? {
236
+ ref: s,
237
+ ellipsis: r && o ? {
236
238
  tooltip: {
237
239
  title: t,
238
240
  overlayClassName: "snmt-tooltip"
239
241
  }
240
242
  } : void 0
241
243
  };
242
- return Z ? /* @__PURE__ */ e(w2, { level: g2[l], ...g, children: t }) : /* @__PURE__ */ e(L2, { ...g, children: t });
244
+ return c ? /* @__PURE__ */ e(w2, { level: g2[l], ...p, children: t }) : /* @__PURE__ */ e(L2, { ...p, children: t });
243
245
  }
244
246
  ), m2 = ({ label: i, variant: l = "small", src: C, fallbackText: t }) => {
245
- const h = C != null && C.trim() ? C : void 0, r = {
247
+ const h = C != null && C.trim() ? C : void 0, d = {
246
248
  large: 80,
247
249
  medium: 48,
248
250
  small: 32,
249
251
  xsmall: 20
250
- }, d = {
252
+ }, r = {
251
253
  large: "h2",
252
254
  medium: "h4",
253
255
  small: "body2",
@@ -269,8 +271,8 @@ const c2 = (i, l) => {
269
271
  {
270
272
  className: `snmt-avatar ${h ? "image" : ""}`,
271
273
  src: h,
272
- size: r[l],
273
- children: /* @__PURE__ */ e(A1, { color: a.GREY_LIGHT_0, variant: d[l], children: !h && t })
274
+ size: d[l],
275
+ children: /* @__PURE__ */ e(A1, { color: a.GREY_LIGHT_0, variant: r[l], children: !h && t })
274
276
  }
275
277
  ),
276
278
  i && /* @__PURE__ */ e(
@@ -285,35 +287,35 @@ const c2 = (i, l) => {
285
287
  }
286
288
  );
287
289
  }, p2 = (i, { enabled: l = !0 } = {}) => {
288
- const [C, t] = N(!1), h = M(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), r = M(() => {
289
- const d = h();
290
- if (!d) {
290
+ const [C, t] = Z(!1), h = N(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), d = N(() => {
291
+ const r = h();
292
+ if (!r) {
291
293
  t(!1);
292
294
  return;
293
295
  }
294
296
  const w = {
295
- whiteSpace: d.style.whiteSpace,
296
- overflow: d.style.overflow,
297
- textOverflow: d.style.textOverflow
297
+ whiteSpace: r.style.whiteSpace,
298
+ overflow: r.style.overflow,
299
+ textOverflow: r.style.textOverflow
298
300
  };
299
- Object.assign(d.style, {
301
+ Object.assign(r.style, {
300
302
  whiteSpace: "nowrap",
301
303
  overflow: "hidden",
302
304
  textOverflow: "clip"
303
305
  });
304
- const s = d.scrollWidth > d.offsetWidth + 1;
305
- Object.assign(d.style, w), t(s);
306
+ const s = r.scrollWidth > r.offsetWidth + 1;
307
+ Object.assign(r.style, w), t(s);
306
308
  }, [h]);
307
309
  return L1(() => {
308
- const d = h();
309
- if (!d) {
310
+ const r = h();
311
+ if (!r) {
310
312
  t(!1);
311
313
  return;
312
314
  }
313
- r();
314
- const w = new ResizeObserver(r);
315
- return w.observe(d), () => w.disconnect();
316
- }, [h, r]), C;
315
+ d();
316
+ const w = new ResizeObserver(d);
317
+ return w.observe(r), () => w.disconnect();
318
+ }, [h, d]), C;
317
319
  }, { Title: f2, Text: v2 } = g1, k2 = {
318
320
  h1: 1,
319
321
  h2: 2,
@@ -326,29 +328,31 @@ const c2 = (i, l) => {
326
328
  color: C,
327
329
  children: t,
328
330
  onClick: h,
329
- collapsed: r,
330
- whiteSpace: d = "normal",
331
+ whiteSpace: d,
331
332
  /** This prop allows you to enable tooltip if text size is too big */
332
- trim: w = !1
333
- }, s) => {
334
- const o = T(null);
335
- o1(s, () => o.current);
336
- const c = p2(o, { enabled: w }), Z = l === "h1" || l === "h2" || l === "h3" || l === "h4";
337
- let m = `snmt-typography snmt-typography-${l}`;
338
- i && i !== "inherit" && (m += ` snmt-typography-align-${i}`), r && (m += " collapsed");
339
- const g = {
340
- className: m,
341
- style: { color: C, whiteSpace: w ? "nowrap" : d, display: w ? "block" : "" },
333
+ trim: r = !1
334
+ }, w) => {
335
+ const s = T(null);
336
+ o1(w, () => s.current);
337
+ const o = p2(s, { enabled: r }), c = l === "h1" || l === "h2" || l === "h3" || l === "h4";
338
+ let v = `snmt-typography snmt-typography-${l}`;
339
+ i && i !== "inherit" && (v += ` snmt-typography-align-${i}`);
340
+ const p = {
341
+ className: v,
342
+ style: {
343
+ color: C,
344
+ whiteSpace: d
345
+ },
342
346
  onClick: h,
343
- ref: o,
344
- ellipsis: w && c ? {
347
+ ref: s,
348
+ ellipsis: r && o ? {
345
349
  tooltip: {
346
350
  title: t,
347
351
  overlayClassName: "snmt-tooltip"
348
352
  }
349
353
  } : void 0
350
354
  };
351
- return Z ? /* @__PURE__ */ e(f2, { level: k2[l], ...g, children: t }) : /* @__PURE__ */ e(v2, { ...g, children: t });
355
+ return c ? /* @__PURE__ */ e(f2, { level: k2[l], ...p, children: t }) : /* @__PURE__ */ e(v2, { ...p, children: t });
352
356
  }
353
357
  ), N2 = ({
354
358
  checked: i = !0,
@@ -356,9 +360,9 @@ const c2 = (i, l) => {
356
360
  label: C,
357
361
  onChange: t,
358
362
  disabled: h = !1,
359
- disableUncheck: r = !1
363
+ disableUncheck: d = !1
360
364
  }) => {
361
- const [d, w] = N(i), [s, o] = N(l);
365
+ const [r, w] = Z(i), [s, o] = Z(l);
362
366
  O(() => {
363
367
  w(i), o(l);
364
368
  }, [i, l]);
@@ -367,10 +371,10 @@ const c2 = (i, l) => {
367
371
  S1,
368
372
  {
369
373
  className: `snmt-checkbox snmt-checkbox-${c}`,
370
- checked: d,
374
+ checked: r,
371
375
  indeterminate: s,
372
- onChange: (Z) => {
373
- r && d || (o(!1), w(Z.target.checked), t && t(Z));
376
+ onChange: (v) => {
377
+ d && r || (o(!1), w(v.target.checked), t && t(v));
374
378
  },
375
379
  disabled: h,
376
380
  children: C && /* @__PURE__ */ e(
@@ -2644,10 +2648,10 @@ const c2 = (i, l) => {
2644
2648
  height: C,
2645
2649
  color: t,
2646
2650
  className: h,
2647
- disabled: r = !1,
2648
- onClick: d
2651
+ disabled: d = !1,
2652
+ onClick: r
2649
2653
  }) => {
2650
- const { theme: w } = X(s1), s = r ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = r ? void 0 : d, c = d && !r ? `${h || ""} clickable` : h;
2654
+ const { theme: w } = X(s1), s = d ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = d ? void 0 : r, c = r && !d ? `${h || ""} clickable` : h;
2651
2655
  return /* @__PURE__ */ e(F, { children: (() => {
2652
2656
  switch (i) {
2653
2657
  case "arrow1Down":
@@ -2805,35 +2809,35 @@ const c2 = (i, l) => {
2805
2809
  }
2806
2810
  })() });
2807
2811
  }, E5 = (i, { enabled: l = !0 } = {}) => {
2808
- const [C, t] = N(!1), h = M(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), r = M(() => {
2809
- const d = h();
2810
- if (!d) {
2812
+ const [C, t] = Z(!1), h = N(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), d = N(() => {
2813
+ const r = h();
2814
+ if (!r) {
2811
2815
  t(!1);
2812
2816
  return;
2813
2817
  }
2814
2818
  const w = {
2815
- whiteSpace: d.style.whiteSpace,
2816
- overflow: d.style.overflow,
2817
- textOverflow: d.style.textOverflow
2819
+ whiteSpace: r.style.whiteSpace,
2820
+ overflow: r.style.overflow,
2821
+ textOverflow: r.style.textOverflow
2818
2822
  };
2819
- Object.assign(d.style, {
2823
+ Object.assign(r.style, {
2820
2824
  whiteSpace: "nowrap",
2821
2825
  overflow: "hidden",
2822
2826
  textOverflow: "clip"
2823
2827
  });
2824
- const s = d.scrollWidth > d.offsetWidth + 1;
2825
- Object.assign(d.style, w), t(s);
2828
+ const s = r.scrollWidth > r.offsetWidth + 1;
2829
+ Object.assign(r.style, w), t(s);
2826
2830
  }, [h]);
2827
2831
  return L1(() => {
2828
- const d = h();
2829
- if (!d) {
2832
+ const r = h();
2833
+ if (!r) {
2830
2834
  t(!1);
2831
2835
  return;
2832
2836
  }
2833
- r();
2834
- const w = new ResizeObserver(r);
2835
- return w.observe(d), () => w.disconnect();
2836
- }, [h, r]), C;
2837
+ d();
2838
+ const w = new ResizeObserver(d);
2839
+ return w.observe(r), () => w.disconnect();
2840
+ }, [h, d]), C;
2837
2841
  }, { Title: G5, Text: K5 } = g1, Y5 = {
2838
2842
  h1: 1,
2839
2843
  h2: 2,
@@ -2846,29 +2850,31 @@ const c2 = (i, l) => {
2846
2850
  color: C,
2847
2851
  children: t,
2848
2852
  onClick: h,
2849
- collapsed: r,
2850
- whiteSpace: d = "normal",
2853
+ whiteSpace: d,
2851
2854
  /** This prop allows you to enable tooltip if text size is too big */
2852
- trim: w = !1
2853
- }, s) => {
2854
- const o = T(null);
2855
- o1(s, () => o.current);
2856
- const c = E5(o, { enabled: w }), Z = l === "h1" || l === "h2" || l === "h3" || l === "h4";
2857
- let m = `snmt-typography snmt-typography-${l}`;
2858
- i && i !== "inherit" && (m += ` snmt-typography-align-${i}`), r && (m += " collapsed");
2859
- const g = {
2860
- className: m,
2861
- style: { color: C, whiteSpace: w ? "nowrap" : d, display: w ? "block" : "" },
2855
+ trim: r = !1
2856
+ }, w) => {
2857
+ const s = T(null);
2858
+ o1(w, () => s.current);
2859
+ const o = E5(s, { enabled: r }), c = l === "h1" || l === "h2" || l === "h3" || l === "h4";
2860
+ let v = `snmt-typography snmt-typography-${l}`;
2861
+ i && i !== "inherit" && (v += ` snmt-typography-align-${i}`);
2862
+ const p = {
2863
+ className: v,
2864
+ style: {
2865
+ color: C,
2866
+ whiteSpace: d
2867
+ },
2862
2868
  onClick: h,
2863
- ref: o,
2864
- ellipsis: w && c ? {
2869
+ ref: s,
2870
+ ellipsis: r && o ? {
2865
2871
  tooltip: {
2866
2872
  title: t,
2867
2873
  overlayClassName: "snmt-tooltip"
2868
2874
  }
2869
2875
  } : void 0
2870
2876
  };
2871
- return Z ? /* @__PURE__ */ e(G5, { level: Y5[l], ...g, children: t }) : /* @__PURE__ */ e(K5, { ...g, children: t });
2877
+ return c ? /* @__PURE__ */ e(G5, { level: Y5[l], ...p, children: t }) : /* @__PURE__ */ e(K5, { ...p, children: t });
2872
2878
  }
2873
2879
  ), b5 = ({
2874
2880
  width: i = 20,
@@ -5131,10 +5137,10 @@ const c2 = (i, l) => {
5131
5137
  height: C,
5132
5138
  color: t,
5133
5139
  className: h,
5134
- disabled: r = !1,
5135
- onClick: d
5140
+ disabled: d = !1,
5141
+ onClick: r
5136
5142
  }) => {
5137
- const { theme: w } = X(s1), s = r ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = r ? void 0 : d, c = d && !r ? `${h || ""} clickable` : h;
5143
+ const { theme: w } = X(s1), s = d ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = d ? void 0 : r, c = r && !d ? `${h || ""} clickable` : h;
5138
5144
  return /* @__PURE__ */ e(F, { children: (() => {
5139
5145
  switch (i) {
5140
5146
  case "arrow1Down":
@@ -5297,22 +5303,22 @@ const c2 = (i, l) => {
5297
5303
  size: C = "small",
5298
5304
  onClose: t,
5299
5305
  closable: h = !0,
5300
- disabled: r = !1
5306
+ disabled: d = !1
5301
5307
  }) => {
5302
- const d = C === "small" ? 10 : 12.5, w = () => {
5303
- r || t == null || t();
5308
+ const r = C === "small" ? 10 : 12.5, w = () => {
5309
+ d || t == null || t();
5304
5310
  };
5305
5311
  return /* @__PURE__ */ e(
5306
5312
  V1,
5307
5313
  {
5308
- className: `snmt-tag ${C} ${r ? "disabled" : ""}`,
5314
+ className: `snmt-tag ${C} ${d ? "disabled" : ""}`,
5309
5315
  closeIcon: /* @__PURE__ */ e(
5310
5316
  F7,
5311
5317
  {
5312
5318
  name: "cancelCircle",
5313
- color: r ? a.GREY_DARK_1 : a.GREY_DARK_2,
5314
- width: d,
5315
- height: d,
5319
+ color: d ? a.GREY_DARK_1 : a.GREY_DARK_2,
5320
+ width: r,
5321
+ height: r,
5316
5322
  onClick: w
5317
5323
  }
5318
5324
  ),
@@ -5323,42 +5329,42 @@ const c2 = (i, l) => {
5323
5329
  B5,
5324
5330
  {
5325
5331
  variant: C === "small" ? "body4" : "body2",
5326
- color: r ? a.GREY_DARK_2 : a.GREY_DARK_5,
5332
+ color: d ? a.GREY_DARK_2 : a.GREY_DARK_5,
5327
5333
  children: i
5328
5334
  }
5329
5335
  ) : i
5330
5336
  }
5331
5337
  );
5332
5338
  }, P7 = (i, { enabled: l = !0 } = {}) => {
5333
- const [C, t] = N(!1), h = M(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), r = M(() => {
5334
- const d = h();
5335
- if (!d) {
5339
+ const [C, t] = Z(!1), h = N(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), d = N(() => {
5340
+ const r = h();
5341
+ if (!r) {
5336
5342
  t(!1);
5337
5343
  return;
5338
5344
  }
5339
5345
  const w = {
5340
- whiteSpace: d.style.whiteSpace,
5341
- overflow: d.style.overflow,
5342
- textOverflow: d.style.textOverflow
5346
+ whiteSpace: r.style.whiteSpace,
5347
+ overflow: r.style.overflow,
5348
+ textOverflow: r.style.textOverflow
5343
5349
  };
5344
- Object.assign(d.style, {
5350
+ Object.assign(r.style, {
5345
5351
  whiteSpace: "nowrap",
5346
5352
  overflow: "hidden",
5347
5353
  textOverflow: "clip"
5348
5354
  });
5349
- const s = d.scrollWidth > d.offsetWidth + 1;
5350
- Object.assign(d.style, w), t(s);
5355
+ const s = r.scrollWidth > r.offsetWidth + 1;
5356
+ Object.assign(r.style, w), t(s);
5351
5357
  }, [h]);
5352
5358
  return L1(() => {
5353
- const d = h();
5354
- if (!d) {
5359
+ const r = h();
5360
+ if (!r) {
5355
5361
  t(!1);
5356
5362
  return;
5357
5363
  }
5358
- r();
5359
- const w = new ResizeObserver(r);
5360
- return w.observe(d), () => w.disconnect();
5361
- }, [h, r]), C;
5364
+ d();
5365
+ const w = new ResizeObserver(d);
5366
+ return w.observe(r), () => w.disconnect();
5367
+ }, [h, d]), C;
5362
5368
  }, { Title: U7, Text: z7 } = g1, q7 = {
5363
5369
  h1: 1,
5364
5370
  h2: 2,
@@ -5371,29 +5377,31 @@ const c2 = (i, l) => {
5371
5377
  color: C,
5372
5378
  children: t,
5373
5379
  onClick: h,
5374
- collapsed: r,
5375
- whiteSpace: d = "normal",
5380
+ whiteSpace: d,
5376
5381
  /** This prop allows you to enable tooltip if text size is too big */
5377
- trim: w = !1
5378
- }, s) => {
5379
- const o = T(null);
5380
- o1(s, () => o.current);
5381
- const c = P7(o, { enabled: w }), Z = l === "h1" || l === "h2" || l === "h3" || l === "h4";
5382
- let m = `snmt-typography snmt-typography-${l}`;
5383
- i && i !== "inherit" && (m += ` snmt-typography-align-${i}`), r && (m += " collapsed");
5384
- const g = {
5385
- className: m,
5386
- style: { color: C, whiteSpace: w ? "nowrap" : d, display: w ? "block" : "" },
5382
+ trim: r = !1
5383
+ }, w) => {
5384
+ const s = T(null);
5385
+ o1(w, () => s.current);
5386
+ const o = P7(s, { enabled: r }), c = l === "h1" || l === "h2" || l === "h3" || l === "h4";
5387
+ let v = `snmt-typography snmt-typography-${l}`;
5388
+ i && i !== "inherit" && (v += ` snmt-typography-align-${i}`);
5389
+ const p = {
5390
+ className: v,
5391
+ style: {
5392
+ color: C,
5393
+ whiteSpace: d
5394
+ },
5387
5395
  onClick: h,
5388
- ref: o,
5389
- ellipsis: w && c ? {
5396
+ ref: s,
5397
+ ellipsis: r && o ? {
5390
5398
  tooltip: {
5391
5399
  title: t,
5392
5400
  overlayClassName: "snmt-tooltip"
5393
5401
  }
5394
5402
  } : void 0
5395
5403
  };
5396
- return Z ? /* @__PURE__ */ e(U7, { level: q7[l], ...g, children: t }) : /* @__PURE__ */ e(z7, { ...g, children: t });
5404
+ return c ? /* @__PURE__ */ e(U7, { level: q7[l], ...p, children: t }) : /* @__PURE__ */ e(z7, { ...p, children: t });
5397
5405
  }
5398
5406
  ), X7 = ({
5399
5407
  children: i,
@@ -5401,18 +5409,18 @@ const c2 = (i, l) => {
5401
5409
  isOpen: C,
5402
5410
  setIsOpen: t,
5403
5411
  placement: h = "topRight",
5404
- noPadding: r = !1,
5405
- trigger: d = "click"
5412
+ noPadding: d = !1,
5413
+ trigger: r = "click"
5406
5414
  }) => {
5407
- const [w, s] = N(!1);
5415
+ const [w, s] = Z(!1);
5408
5416
  return /* @__PURE__ */ e(
5409
5417
  $1,
5410
5418
  {
5411
5419
  content: l,
5412
5420
  arrow: !1,
5413
5421
  placement: h,
5414
- trigger: d,
5415
- overlayClassName: `snmt-popover ${r ? "" : "padding"}`,
5422
+ trigger: r,
5423
+ overlayClassName: `snmt-popover ${d ? "" : "padding"}`,
5416
5424
  open: C ?? w,
5417
5425
  onOpenChange: (o) => {
5418
5426
  s(o), t == null || t(o);
@@ -5421,35 +5429,35 @@ const c2 = (i, l) => {
5421
5429
  }
5422
5430
  );
5423
5431
  }, Q7 = (i, { enabled: l = !0 } = {}) => {
5424
- const [C, t] = N(!1), h = M(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), r = M(() => {
5425
- const d = h();
5426
- if (!d) {
5432
+ const [C, t] = Z(!1), h = N(() => !l || !i || typeof i == "function" ? null : i.current, [l, i]), d = N(() => {
5433
+ const r = h();
5434
+ if (!r) {
5427
5435
  t(!1);
5428
5436
  return;
5429
5437
  }
5430
5438
  const w = {
5431
- whiteSpace: d.style.whiteSpace,
5432
- overflow: d.style.overflow,
5433
- textOverflow: d.style.textOverflow
5439
+ whiteSpace: r.style.whiteSpace,
5440
+ overflow: r.style.overflow,
5441
+ textOverflow: r.style.textOverflow
5434
5442
  };
5435
- Object.assign(d.style, {
5443
+ Object.assign(r.style, {
5436
5444
  whiteSpace: "nowrap",
5437
5445
  overflow: "hidden",
5438
5446
  textOverflow: "clip"
5439
5447
  });
5440
- const s = d.scrollWidth > d.offsetWidth + 1;
5441
- Object.assign(d.style, w), t(s);
5448
+ const s = r.scrollWidth > r.offsetWidth + 1;
5449
+ Object.assign(r.style, w), t(s);
5442
5450
  }, [h]);
5443
5451
  return L1(() => {
5444
- const d = h();
5445
- if (!d) {
5452
+ const r = h();
5453
+ if (!r) {
5446
5454
  t(!1);
5447
5455
  return;
5448
5456
  }
5449
- r();
5450
- const w = new ResizeObserver(r);
5451
- return w.observe(d), () => w.disconnect();
5452
- }, [h, r]), C;
5457
+ d();
5458
+ const w = new ResizeObserver(d);
5459
+ return w.observe(r), () => w.disconnect();
5460
+ }, [h, d]), C;
5453
5461
  }, { Title: C9, Text: l9 } = g1, e9 = {
5454
5462
  h1: 1,
5455
5463
  h2: 2,
@@ -5462,29 +5470,31 @@ const c2 = (i, l) => {
5462
5470
  color: C,
5463
5471
  children: t,
5464
5472
  onClick: h,
5465
- collapsed: r,
5466
- whiteSpace: d = "normal",
5473
+ whiteSpace: d,
5467
5474
  /** This prop allows you to enable tooltip if text size is too big */
5468
- trim: w = !1
5469
- }, s) => {
5470
- const o = T(null);
5471
- o1(s, () => o.current);
5472
- const c = Q7(o, { enabled: w }), Z = l === "h1" || l === "h2" || l === "h3" || l === "h4";
5473
- let m = `snmt-typography snmt-typography-${l}`;
5474
- i && i !== "inherit" && (m += ` snmt-typography-align-${i}`), r && (m += " collapsed");
5475
- const g = {
5476
- className: m,
5477
- style: { color: C, whiteSpace: w ? "nowrap" : d, display: w ? "block" : "" },
5475
+ trim: r = !1
5476
+ }, w) => {
5477
+ const s = T(null);
5478
+ o1(w, () => s.current);
5479
+ const o = Q7(s, { enabled: r }), c = l === "h1" || l === "h2" || l === "h3" || l === "h4";
5480
+ let v = `snmt-typography snmt-typography-${l}`;
5481
+ i && i !== "inherit" && (v += ` snmt-typography-align-${i}`);
5482
+ const p = {
5483
+ className: v,
5484
+ style: {
5485
+ color: C,
5486
+ whiteSpace: d
5487
+ },
5478
5488
  onClick: h,
5479
- ref: o,
5480
- ellipsis: w && c ? {
5489
+ ref: s,
5490
+ ellipsis: r && o ? {
5481
5491
  tooltip: {
5482
5492
  title: t,
5483
5493
  overlayClassName: "snmt-tooltip"
5484
5494
  }
5485
5495
  } : void 0
5486
5496
  };
5487
- return Z ? /* @__PURE__ */ e(C9, { level: e9[l], ...g, children: t }) : /* @__PURE__ */ e(l9, { ...g, children: t });
5497
+ return c ? /* @__PURE__ */ e(C9, { level: e9[l], ...p, children: t }) : /* @__PURE__ */ e(l9, { ...p, children: t });
5488
5498
  }
5489
5499
  ), i9 = ({
5490
5500
  width: i = 20,
@@ -7747,10 +7757,10 @@ const c2 = (i, l) => {
7747
7757
  height: C,
7748
7758
  color: t,
7749
7759
  className: h,
7750
- disabled: r = !1,
7751
- onClick: d
7760
+ disabled: d = !1,
7761
+ onClick: r
7752
7762
  }) => {
7753
- const { theme: w } = X(s1), s = r ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = r ? void 0 : d, c = d && !r ? `${h || ""} clickable` : h;
7763
+ const { theme: w } = X(s1), s = d ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = d ? void 0 : r, c = r && !d ? `${h || ""} clickable` : h;
7754
7764
  return /* @__PURE__ */ e(F, { children: (() => {
7755
7765
  switch (i) {
7756
7766
  case "arrow1Down":
@@ -7913,7 +7923,7 @@ const c2 = (i, l) => {
7913
7923
  size: C = "medium",
7914
7924
  width: t
7915
7925
  }) => {
7916
- const h = C === "medium" ? "body2" : C === "small" ? "body4" : "caption", r = C === "xsmall" ? "purple" : l, d = {
7926
+ const h = C === "medium" ? "body2" : C === "small" ? "body4" : "caption", d = C === "xsmall" ? "purple" : l, r = {
7917
7927
  cyan: a.CYAN_LIGHT,
7918
7928
  red: a.NOTIFICATION_ERROR_LIGHT,
7919
7929
  orange: a.NOTIFICATION_WARNING_LIGHT,
@@ -7927,7 +7937,7 @@ const c2 = (i, l) => {
7927
7937
  {
7928
7938
  className: `snmt-regular-badge snmt-regular-badge--${C}`,
7929
7939
  style: {
7930
- background: d[r],
7940
+ background: r[d],
7931
7941
  width: t ?? "fit-content"
7932
7942
  },
7933
7943
  children: /* @__PURE__ */ e(B1, { variant: h, color: a.GREY_DARK_4, children: i })
@@ -7960,12 +7970,12 @@ const c2 = (i, l) => {
7960
7970
  }
7961
7971
  ),
7962
7972
  canceled: /* @__PURE__ */ e(N1, { name: "cancelCircle", width: 14, height: 14, color: a.GREY_DARK_2 })
7963
- }, r = {
7973
+ }, d = {
7964
7974
  approved: a.NOTIFICATION_SUCCESS_LIGHT,
7965
7975
  pending: a.NOTIFICATION_WARNING_LIGHT,
7966
7976
  rejected: a.NOTIFICATION_ERROR_LIGHT,
7967
7977
  canceled: a.GREY_LIGHT_2
7968
- }, d = {
7978
+ }, r = {
7969
7979
  approved: a.NOTIFICATION_SUCCESS_DARK,
7970
7980
  pending: a.NOTIFICATION_WARNING_DARK,
7971
7981
  rejected: a.NOTIFICATION_ERROR_DARK,
@@ -7975,10 +7985,10 @@ const c2 = (i, l) => {
7975
7985
  V1,
7976
7986
  {
7977
7987
  className: `snmt-status-badge snmt-status-badge--${C ? "with-icon" : "without-icon"}`,
7978
- style: { background: r[l], width: t ?? "fit-content" },
7988
+ style: { background: d[l], width: t ?? "fit-content" },
7979
7989
  children: [
7980
7990
  C && h[l],
7981
- /* @__PURE__ */ e(B1, { variant: "body4", color: d[l], children: i })
7991
+ /* @__PURE__ */ e(B1, { variant: "body4", color: r[l], children: i })
7982
7992
  ]
7983
7993
  }
7984
7994
  );
@@ -8000,27 +8010,27 @@ const g4 = ({
8000
8010
  maxWidth: C,
8001
8011
  closable: t = !0,
8002
8012
  disabled: h,
8003
- options: r,
8004
- extraOptions: d,
8013
+ options: d,
8014
+ extraOptions: r,
8005
8015
  selectedItemVariant: w = "default"
8006
8016
  }) => {
8007
- const { locale: s } = X(s1), { t: o } = r2("common", { lng: s }), [c, Z] = N(!1);
8017
+ const { locale: s } = X(s1), { t: o } = r2("common", { lng: s }), [c, v] = Z(!1);
8008
8018
  if (O(() => {
8009
- i.length || Z(!1);
8019
+ i.length || v(!1);
8010
8020
  }, [i]), !i.length)
8011
8021
  return null;
8012
- const m = (g) => {
8022
+ const p = (M) => {
8013
8023
  var E, x;
8014
- return ((E = r == null ? void 0 : r.find((I) => I.value === g)) == null ? void 0 : E.label) || ((x = d == null ? void 0 : d.find((I) => I.value === g)) == null ? void 0 : x.label) || g;
8024
+ return ((E = d == null ? void 0 : d.find((I) => I.value === M)) == null ? void 0 : E.label) || ((x = r == null ? void 0 : r.find((I) => I.value === M)) == null ? void 0 : x.label) || M;
8015
8025
  };
8016
8026
  return /* @__PURE__ */ n(
8017
8027
  X7,
8018
8028
  {
8019
8029
  content: (
8020
8030
  // 90: paddings + margins + gaps and so on
8021
- /* @__PURE__ */ e("div", { style: { maxWidth: C - 90 }, className: "snmt-popover-from-select", children: /* @__PURE__ */ e(w1, { gap: 6, flexWrap: "wrap", children: i.map(({ value: g }) => {
8022
- const E = w === "badge" && r.find(
8023
- (x) => x.label === m(g)
8031
+ /* @__PURE__ */ e("div", { style: { maxWidth: C - 90 }, className: "snmt-popover-from-select", children: /* @__PURE__ */ e(w1, { gap: 6, flexWrap: "wrap", children: i.map(({ value: M }) => {
8032
+ const E = w === "badge" && d.find(
8033
+ (x) => x.label === p(M)
8024
8034
  );
8025
8035
  return w === "badge" ? /* @__PURE__ */ e(
8026
8036
  b1,
@@ -8028,24 +8038,24 @@ const g4 = ({
8028
8038
  variant: "regular",
8029
8039
  size: "small",
8030
8040
  color: E ? E.color : void 0,
8031
- text: m(g)
8041
+ text: p(M)
8032
8042
  },
8033
- g
8043
+ M
8034
8044
  ) : /* @__PURE__ */ e(
8035
8045
  Y1,
8036
8046
  {
8037
- onClose: () => l(g),
8047
+ onClose: () => l(M),
8038
8048
  closable: t,
8039
8049
  disabled: h,
8040
- children: m(g)
8050
+ children: p(M)
8041
8051
  },
8042
- g
8052
+ M
8043
8053
  );
8044
8054
  }) }) })
8045
8055
  ),
8046
8056
  placement: "bottomRight",
8047
8057
  isOpen: c,
8048
- setIsOpen: Z,
8058
+ setIsOpen: v,
8049
8059
  children: [
8050
8060
  i.length,
8051
8061
  " ",
@@ -10326,10 +10336,10 @@ const g4 = ({
10326
10336
  height: C,
10327
10337
  color: t,
10328
10338
  className: h,
10329
- disabled: r = !1,
10330
- onClick: d
10339
+ disabled: d = !1,
10340
+ onClick: r
10331
10341
  }) => {
10332
- const { theme: w } = X(s1), s = r ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = r ? void 0 : d, c = d && !r ? `${h || ""} clickable` : h;
10342
+ const { theme: w } = X(s1), s = d ? w && w === "dark" ? a.GREY_LIGHT_4 : a.GREY_DARK_1 : t, o = d ? void 0 : r, c = r && !d ? `${h || ""} clickable` : h;
10333
10343
  return /* @__PURE__ */ e(F, { children: (() => {
10334
10344
  switch (i) {
10335
10345
  case "arrow1Down":
@@ -10493,11 +10503,11 @@ const g4 = ({
10493
10503
  disabled: t = !1,
10494
10504
  onClick: h
10495
10505
  }) => {
10496
- const r = x0(l, t), d = R0(l, t);
10506
+ const d = x0(l, t), r = R0(l, t);
10497
10507
  return /* @__PURE__ */ e(
10498
10508
  "button",
10499
10509
  {
10500
- className: `snmt-arrow-button${d ? ` snmt-arrow-button${d}` : ""}`,
10510
+ className: `snmt-arrow-button${r ? ` snmt-arrow-button${r}` : ""}`,
10501
10511
  onClick: h,
10502
10512
  disabled: t,
10503
10513
  children: /* @__PURE__ */ e(
@@ -10505,7 +10515,7 @@ const g4 = ({
10505
10515
  {
10506
10516
  name: i,
10507
10517
  className: "snmt-arrow-button-icon-rotation" + (l && !t ? `-${C}` : "-initial"),
10508
- color: r
10518
+ color: d
10509
10519
  }
10510
10520
  )
10511
10521
  }
@@ -10522,15 +10532,15 @@ const A0 = J((i, l) => {
10522
10532
  value: C,
10523
10533
  onChange: t,
10524
10534
  placeholder: h,
10525
- mode: r,
10526
- search: d = !1,
10535
+ mode: d,
10536
+ search: r = !1,
10527
10537
  options: w,
10528
10538
  width: s,
10529
10539
  disabled: o = !1,
10530
10540
  required: c = !1,
10531
- clearable: Z = !0,
10532
- scrollThresholdValue: m = 50,
10533
- onSearchChange: g,
10541
+ clearable: v = !0,
10542
+ scrollThresholdValue: p = 50,
10543
+ onSearchChange: M,
10534
10544
  onDropdownVisibleChange: E,
10535
10545
  onScrollToEnd: x,
10536
10546
  onPopupScroll: B,
@@ -10538,60 +10548,60 @@ const A0 = J((i, l) => {
10538
10548
  extraOptions: A,
10539
10549
  dropdownRender: S,
10540
10550
  optionRender: H,
10541
- isLoading: p,
10551
+ isLoading: g,
10542
10552
  readOnly: _,
10543
10553
  error: k,
10544
10554
  selectedItemVariant: b = "default",
10545
10555
  variant: G = "outlined"
10546
10556
  } = i;
10547
10557
  let Q;
10548
- r && r !== "single" && (Q = i.overflowBehaviour ?? "responsive");
10549
- const [Y, U] = N(!1), [z, m1] = N(!1), [W, a1] = N(!1), [c1, C1] = N(!0), [u, $] = N(C), n1 = T(null), l1 = r === "single" && b === "badge";
10558
+ d && d !== "single" && (Q = i.overflowBehaviour ?? "responsive");
10559
+ const [Y, U] = Z(!1), [z, m1] = Z(!1), [W, a1] = Z(!1), [c1, C1] = Z(!0), [u, $] = Z(C), n1 = T(null), l1 = d === "single" && b === "badge";
10550
10560
  O(() => {
10551
10561
  $(C);
10552
10562
  }, [C]);
10553
10563
  const p1 = (L) => {
10554
10564
  U(L), E && E(L);
10555
- }, f1 = (L, f) => {
10565
+ }, f1 = (L, m) => {
10556
10566
  var V;
10557
- return !!((V = f == null ? void 0 : f.label) != null && V.toString().toLowerCase().includes(L.toLowerCase()));
10567
+ return !!((V = m == null ? void 0 : m.label) != null && V.toString().toLowerCase().includes(L.toLowerCase()));
10558
10568
  }, v1 = () => {
10559
10569
  m1(!0);
10560
10570
  }, k1 = () => {
10561
10571
  m1(!1);
10562
- }, P = M(
10572
+ }, P = N(
10563
10573
  (L) => {
10564
- let f = null;
10574
+ let m = null;
10565
10575
  if (l1) {
10566
10576
  const V = Array.isArray(L) ? L : [];
10567
- f = V.length > 1 ? [V[V.length - 1]] : V;
10568
- const r1 = f.length > 0 ? f[0] : null;
10569
- t == null || t(r1), $(f);
10577
+ m = V.length > 1 ? [V[V.length - 1]] : V;
10578
+ const r1 = m.length > 0 ? m[0] : null;
10579
+ t == null || t(r1), $(m);
10570
10580
  return;
10571
10581
  }
10572
- if (r && r !== "single") {
10582
+ if (d && d !== "single") {
10573
10583
  const V = L;
10574
10584
  t == null || t(V), $(V);
10575
10585
  return;
10576
10586
  }
10577
- f = Array.isArray(L) ? null : L || null, t == null || t(f), $(f);
10587
+ m = Array.isArray(L) ? null : L || null, t == null || t(m), $(m);
10578
10588
  },
10579
- [r, t, l1]
10580
- ), M1 = M(() => {
10589
+ [d, t, l1]
10590
+ ), M1 = N(() => {
10581
10591
  if (!(_ || o)) {
10582
- if (r) {
10592
+ if (d) {
10583
10593
  P([]);
10584
10594
  return;
10585
10595
  }
10586
10596
  P("");
10587
10597
  }
10588
- }, [o, P, r, _]), e1 = M(
10598
+ }, [o, P, d, _]), e1 = N(
10589
10599
  (L) => {
10590
- const f = u.filter((V) => V !== L);
10591
- P(f), $(f);
10600
+ const m = u.filter((V) => V !== L);
10601
+ P(m), $(m);
10592
10602
  },
10593
10603
  [P, u]
10594
- ), v = M(
10604
+ ), f = N(
10595
10605
  (L) => (u == null ? void 0 : u.indexOf(L)) === 0 ? (
10596
10606
  // if the search input is empty
10597
10607
  // then display the placeholder, else do not display it
@@ -10601,16 +10611,16 @@ const A0 = J((i, l) => {
10601
10611
  ), D = (L) => {
10602
10612
  L.preventDefault(), L.stopPropagation();
10603
10613
  }, j = async (L) => {
10604
- const { target: f } = L;
10605
- f.scrollTop + f.offsetHeight >= f.scrollHeight - m && (x == null || x(!0)), B && await B(L);
10606
- }, R = M(
10614
+ const { target: m } = L;
10615
+ m.scrollTop + m.offsetHeight >= m.scrollHeight - p && (x == null || x(!0)), B && await B(L);
10616
+ }, R = N(
10607
10617
  (L) => {
10608
- var f, V;
10609
- return ((f = w.find((t1) => t1.value === L)) == null ? void 0 : f.label) || ((V = A == null ? void 0 : A.find((t1) => t1.value === L)) == null ? void 0 : V.label) || L;
10618
+ var m, V;
10619
+ return ((m = w.find((t1) => t1.value === L)) == null ? void 0 : m.label) || ((V = A == null ? void 0 : A.find((t1) => t1.value === L)) == null ? void 0 : V.label) || L;
10610
10620
  },
10611
10621
  [A, w]
10612
- ), K = M(
10613
- (L, f = "default") => {
10622
+ ), K = N(
10623
+ (L, m = "default") => {
10614
10624
  var V;
10615
10625
  return /* @__PURE__ */ e(
10616
10626
  g4,
@@ -10622,17 +10632,17 @@ const A0 = J((i, l) => {
10622
10632
  closable: !_,
10623
10633
  options: w,
10624
10634
  extraOptions: A,
10625
- selectedItemVariant: f
10635
+ selectedItemVariant: m
10626
10636
  }
10627
10637
  );
10628
10638
  },
10629
10639
  [o, A, e1, w, _]
10630
- ), y = M(
10631
- ({ label: L, value: f, mode: V }) => {
10640
+ ), y = N(
10641
+ ({ label: L, value: m, mode: V }) => {
10632
10642
  if (V === "filter")
10633
- return v(f);
10643
+ return f(m);
10634
10644
  {
10635
- const r1 = b === "badge" && w.find((y1) => y1.label === L), t1 = typeof L == "object" ? L : R(f);
10645
+ const r1 = b === "badge" && w.find((y1) => y1.label === L), t1 = typeof L == "object" ? L : R(m);
10636
10646
  return /* @__PURE__ */ e("div", { onMouseDown: D, className: "tag-wrapper", children: b === "badge" ? /* @__PURE__ */ e(
10637
10647
  b1,
10638
10648
  {
@@ -10641,10 +10651,10 @@ const A0 = J((i, l) => {
10641
10651
  color: r1 ? r1.color : "cyan",
10642
10652
  text: t1
10643
10653
  }
10644
- ) : /* @__PURE__ */ e(Y1, { onClose: () => e1(f), disabled: o, children: t1 }) });
10654
+ ) : /* @__PURE__ */ e(Y1, { onClose: () => e1(m), disabled: o, children: t1 }) });
10645
10655
  }
10646
10656
  },
10647
- [o, R, e1, v, b, w]
10657
+ [o, R, e1, f, b, w]
10648
10658
  ), i1 = Array.isArray(u) && u.length > 0 || !!u && typeof u == "string" && u.trim() !== "";
10649
10659
  return /* @__PURE__ */ n(
10650
10660
  "div",
@@ -10655,7 +10665,7 @@ const A0 = J((i, l) => {
10655
10665
  "div",
10656
10666
  {
10657
10667
  className: `snmt-select ${z ? "snmt-select-focused" : ""}
10658
- ${r ? "" : "snmt-select-single"}
10668
+ ${d ? "" : "snmt-select-single"}
10659
10669
  ${_ ? "snmt-select-read-only" : ""}
10660
10670
  ${Q === "static" ? "snmt-select-static" : ""}
10661
10671
  ${G === "borderless" ? "snmt-select-borderless" : ""}`,
@@ -10669,16 +10679,16 @@ const A0 = J((i, l) => {
10669
10679
  popupClassName: _ ? "dropdown-read-only" : "",
10670
10680
  id: I,
10671
10681
  ref: l,
10672
- showSearch: !!d,
10673
- filterOption: d && f1,
10682
+ showSearch: !!r,
10683
+ filterOption: r && f1,
10674
10684
  onDropdownVisibleChange: p1,
10675
10685
  disabled: o,
10676
10686
  value: u || void 0,
10677
10687
  labelRender: (L) => {
10678
- const f = R(L.value);
10679
- return o ? /* @__PURE__ */ e("span", { style: { color: a.GREY_DARK_1 }, children: f }) : f;
10688
+ const m = R(L.value);
10689
+ return o ? /* @__PURE__ */ e("span", { style: { color: a.GREY_DARK_1 }, children: m }) : m;
10680
10690
  },
10681
- mode: D0(r, l1),
10691
+ mode: D0(d, l1),
10682
10692
  variant: G,
10683
10693
  onChange: P,
10684
10694
  onFocus: v1,
@@ -10686,17 +10696,17 @@ const A0 = J((i, l) => {
10686
10696
  onMouseEnter: () => a1(!0),
10687
10697
  onMouseLeave: () => a1(!1),
10688
10698
  onSearch: (L) => {
10689
- C1(!L), g && g(L);
10699
+ C1(!L), M && M(L);
10690
10700
  },
10691
10701
  onSelect: () => C1(!0),
10692
10702
  onDeselect: () => C1(!0),
10693
- tagRender: (L) => y({ ...L, mode: r }),
10703
+ tagRender: (L) => y({ ...L, mode: d }),
10694
10704
  maxTagCount: Q === "responsive" ? "responsive" : void 0,
10695
10705
  maxTagPlaceholder: (L) => K(L, b),
10696
10706
  onPopupScroll: j,
10697
- prefix: p && /* @__PURE__ */ e(D1, { size: "small" }),
10698
- suffixIcon: /* @__PURE__ */ e("div", { className: "wrapper-suffix-icon", children: r !== "filter" && /* @__PURE__ */ n(F, { children: [
10699
- u && !!u.length && Z && /* @__PURE__ */ e(
10707
+ prefix: g && /* @__PURE__ */ e(D1, { size: "small" }),
10708
+ suffixIcon: /* @__PURE__ */ e("div", { className: "wrapper-suffix-icon", children: d !== "filter" && /* @__PURE__ */ n(F, { children: [
10709
+ u && !!u.length && v && /* @__PURE__ */ e(
10700
10710
  "div",
10701
10711
  {
10702
10712
  onClick: M1,
@@ -10733,7 +10743,7 @@ const A0 = J((i, l) => {
10733
10743
  options: w,
10734
10744
  optionRender: (L) => H ? H(L.data) : /* @__PURE__ */ n(w1, { justifyContent: "space-between", alignItems: "center", flex: "1", children: [
10735
10745
  /* @__PURE__ */ n(w1, { alignItems: "center", gap: 12, children: [
10736
- r && /* @__PURE__ */ e(
10746
+ d && /* @__PURE__ */ e(
10737
10747
  N2,
10738
10748
  {
10739
10749
  checked: !!(u != null && u.includes(L.value))
@@ -10751,18 +10761,18 @@ const A0 = J((i, l) => {
10751
10761
  /* @__PURE__ */ e("span", { children: L.label })
10752
10762
  ] })
10753
10763
  ] }),
10754
- !r && u === L.value && /* @__PURE__ */ e(d1, { name: "check", color: a.BLUE_DARK_1 })
10764
+ !d && u === L.value && /* @__PURE__ */ e(d1, { name: "check", color: a.BLUE_DARK_1 })
10755
10765
  ] }),
10756
10766
  dropdownRender: (L) => /* @__PURE__ */ n("div", { className: "dropdown-container", children: [
10757
10767
  /* @__PURE__ */ e("div", { className: "dropdown-menu", children: S ? S(L) : L }),
10758
- p && /* @__PURE__ */ e("div", { className: "loading-overlay", children: /* @__PURE__ */ e(D1, {}) })
10768
+ g && /* @__PURE__ */ e("div", { className: "loading-overlay", children: /* @__PURE__ */ e(D1, {}) })
10759
10769
  ] })
10760
10770
  }
10761
10771
  ),
10762
10772
  h && G !== "borderless" && /* @__PURE__ */ e(
10763
10773
  "label",
10764
10774
  {
10765
- className: `${z || i1 ? "label-floating" : ""} ${o ? "label-disabled" : ""} ${z ? "label-focused" : ""} ${p ? "label-loading" : ""} ${k ? "label-error" : ""}`,
10775
+ className: `${z || i1 ? "label-floating" : ""} ${o ? "label-disabled" : ""} ${z ? "label-focused" : ""} ${g ? "label-loading" : ""} ${k ? "label-error" : ""}`,
10766
10776
  children: c ? `${h}*` : h
10767
10777
  }
10768
10778
  ),
@@ -10801,10 +10811,10 @@ function E0(i, l = 500) {
10801
10811
  return O(() => () => {
10802
10812
  C.current && clearTimeout(C.current);
10803
10813
  }, []), (...h) => {
10804
- const r = setTimeout(() => {
10814
+ const d = setTimeout(() => {
10805
10815
  i(...h);
10806
10816
  }, l);
10807
- clearTimeout(C.current), C.current = r;
10817
+ clearTimeout(C.current), C.current = d;
10808
10818
  };
10809
10819
  }
10810
10820
  function E1(i) {
@@ -10820,15 +10830,15 @@ const Z1 = 100, h1 = {
10820
10830
  loadOptions: C,
10821
10831
  width: t,
10822
10832
  onChange: h,
10823
- id: r,
10824
- disabled: d,
10833
+ id: d,
10834
+ disabled: r,
10825
10835
  scrollThresholdValue: w,
10826
10836
  placeholder: s,
10827
10837
  mode: o,
10828
10838
  loadOnClosedState: c,
10829
- preloadOptions: Z,
10830
- extraOptions: m,
10831
- onDropdownVisibleChange: g,
10839
+ preloadOptions: v,
10840
+ extraOptions: p,
10841
+ onDropdownVisibleChange: M,
10832
10842
  optionRender: E,
10833
10843
  dropdownRender: x,
10834
10844
  readOnly: B,
@@ -10836,18 +10846,18 @@ const Z1 = 100, h1 = {
10836
10846
  required: A = !1,
10837
10847
  error: S,
10838
10848
  variant: H = "outlined"
10839
- } = i, [p, _] = N(), [k, b] = N(h1), [G, Q] = N(!1), [Y, U] = N(), [z, m1] = N(!1), [W, a1] = N(
10840
- m ?? []
10841
- ), c1 = E1(k.offset), C1 = E1(Y), [u, $] = N(!1), n1 = T(!1), l1 = M(
10849
+ } = i, [g, _] = Z(), [k, b] = Z(h1), [G, Q] = Z(!1), [Y, U] = Z(), [z, m1] = Z(!1), [W, a1] = Z(
10850
+ p ?? []
10851
+ ), c1 = E1(k.offset), C1 = E1(Y), [u, $] = Z(!1), n1 = T(!1), l1 = N(
10842
10852
  async ({
10843
- limit: v = Z1,
10853
+ limit: f = Z1,
10844
10854
  offset: D,
10845
10855
  search: j
10846
10856
  }) => {
10847
10857
  Q(!0);
10848
10858
  try {
10849
10859
  const R = await C({
10850
- limit: v,
10860
+ limit: f,
10851
10861
  offset: D,
10852
10862
  search: j
10853
10863
  });
@@ -10864,50 +10874,50 @@ const Z1 = 100, h1 = {
10864
10874
  }
10865
10875
  },
10866
10876
  [C]
10867
- ), p1 = E0((v) => {
10868
- U(v), v || b(h1);
10869
- }), f1 = M(
10870
- (v) => p1(v),
10877
+ ), p1 = E0((f) => {
10878
+ U(f), f || b(h1);
10879
+ }), f1 = N(
10880
+ (f) => p1(f),
10871
10881
  [p1]
10872
- ), v1 = M(
10873
- async (v) => {
10874
- G || v && k.count && k.count > ((p == null ? void 0 : p.length) ?? 0) && b((D) => ({
10882
+ ), v1 = N(
10883
+ async (f) => {
10884
+ G || f && k.count && k.count > ((g == null ? void 0 : g.length) ?? 0) && b((D) => ({
10875
10885
  ...D,
10876
10886
  offset: D.offset + Z1
10877
10887
  }));
10878
10888
  },
10879
- [G, p == null ? void 0 : p.length, k.count]
10880
- ), k1 = M(
10881
- (v) => {
10882
- m1(v), !v && Y && (U(void 0), b(h1), $(!0)), g == null || g(v);
10889
+ [G, g == null ? void 0 : g.length, k.count]
10890
+ ), k1 = N(
10891
+ (f) => {
10892
+ m1(f), !f && Y && (U(void 0), b(h1), $(!0)), M == null || M(f);
10883
10893
  },
10884
- [g, Y]
10894
+ [M, Y]
10885
10895
  );
10886
10896
  O(() => {
10887
10897
  if (!n1.current || G) return;
10888
- (u || z && (c1 !== k.offset || C1 !== Y || !p)) && (l1({ offset: k.offset, limit: Z1, search: Y }), u && $(!1));
10889
- }, [u, z, k.offset, Y, c1, C1, p, G]), O(() => {
10890
- (c || Z) && l1(h1), n1.current = !0;
10898
+ (u || z && (c1 !== k.offset || C1 !== Y || !g)) && (l1({ offset: k.offset, limit: Z1, search: Y }), u && $(!1));
10899
+ }, [u, z, k.offset, Y, c1, C1, g, G]), O(() => {
10900
+ (c || v) && l1(h1), n1.current = !0;
10891
10901
  }, []), O(() => {
10892
- m && a1((v) => {
10893
- const D = m.filter(
10894
- (j) => !v.some((R) => R.value === j.value)
10902
+ p && a1((f) => {
10903
+ const D = p.filter(
10904
+ (j) => !f.some((R) => R.value === j.value)
10895
10905
  );
10896
- return [...v, ...D];
10906
+ return [...f, ...D];
10897
10907
  });
10898
- }, [m]);
10899
- const P = M(
10900
- (v) => {
10901
- h && h(v);
10908
+ }, [p]);
10909
+ const P = N(
10910
+ (f) => {
10911
+ h && h(f);
10902
10912
  let D = [];
10903
- if (o ? D = Array.isArray(v) ? v : [] : D = v ? [v] : [], Y) {
10913
+ if (o ? D = Array.isArray(f) ? f : [] : D = f ? [f] : [], Y) {
10904
10914
  const j = D.filter(
10905
10915
  (R) => !(W != null && W.some((K) => K.value === R))
10906
10916
  );
10907
10917
  j.length > 0 && a1((R = []) => [
10908
10918
  ...R,
10909
10919
  ...j.map((K) => {
10910
- const y = p == null ? void 0 : p.find((i1) => i1.value === K);
10920
+ const y = g == null ? void 0 : g.find((i1) => i1.value === K);
10911
10921
  return {
10912
10922
  value: K,
10913
10923
  label: (y == null ? void 0 : y.label) ?? K,
@@ -10918,10 +10928,10 @@ const Z1 = 100, h1 = {
10918
10928
  ]), U(void 0), b(h1), $(!0);
10919
10929
  }
10920
10930
  },
10921
- [h, Y, o, p, W]
10931
+ [h, Y, o, g, W]
10922
10932
  ), M1 = H1(
10923
10933
  () => ({
10924
- id: r,
10934
+ id: d,
10925
10935
  width: t,
10926
10936
  onChange: P,
10927
10937
  ref: l,
@@ -10931,7 +10941,7 @@ const Z1 = 100, h1 = {
10931
10941
  onDropdownVisibleChange: k1,
10932
10942
  scrollThresholdValue: w,
10933
10943
  onScrollToEnd: v1,
10934
- disabled: d,
10944
+ disabled: r,
10935
10945
  isLoading: G,
10936
10946
  optionRender: E,
10937
10947
  dropdownRender: x,
@@ -10942,7 +10952,7 @@ const Z1 = 100, h1 = {
10942
10952
  variant: H
10943
10953
  }),
10944
10954
  [
10945
- r,
10955
+ d,
10946
10956
  t,
10947
10957
  P,
10948
10958
  l,
@@ -10951,7 +10961,7 @@ const Z1 = 100, h1 = {
10951
10961
  k1,
10952
10962
  w,
10953
10963
  v1,
10954
- d,
10964
+ r,
10955
10965
  G,
10956
10966
  E,
10957
10967
  x,
@@ -10968,7 +10978,7 @@ const Z1 = 100, h1 = {
10968
10978
  }
10969
10979
  }));
10970
10980
  const e1 = H1(() => {
10971
- const v = o && o !== "single", D = i.selectedItemVariant === "badge", j = D ? p || [] : p || [], R = W, K = i, i1 = v ? {
10981
+ const f = o && o !== "single", D = i.selectedItemVariant === "badge", j = D ? g || [] : g || [], R = W, K = i, i1 = f ? {
10972
10982
  mode: o,
10973
10983
  overflowBehaviour: K.overflowBehaviour,
10974
10984
  value: K.value
@@ -10983,7 +10993,7 @@ const Z1 = 100, h1 = {
10983
10993
  options: j,
10984
10994
  extraOptions: R
10985
10995
  };
10986
- }, [o, i, M1, W, p]);
10996
+ }, [o, i, M1, W, g]);
10987
10997
  return /* @__PURE__ */ e("div", { className: "snmt-async-select", children: /* @__PURE__ */ e(A0, { ...e1 }) });
10988
10998
  });
10989
10999
  export {