@efficiency-point/design-system 0.1.9 → 0.1.10

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.
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { cloneElement as r, forwardRef as i, isValidElement as a, useCallback as o, useEffect as s, useId as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
3
- import { createPortal as p } from "react-dom";
4
- import { createSortedRowModel as m, rowSortingFeature as h, tableFeatures as g, useTable as _ } from "@tanstack/react-table";
5
- import { create as v } from "zustand";
6
- var y = {
2
+ import { cloneElement as r, createContext as i, forwardRef as a, isValidElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
3
+ import { createPortal as h } from "react-dom";
4
+ import { createSortedRowModel as g, rowSortingFeature as _, tableFeatures as v, useTable as y } from "@tanstack/react-table";
5
+ import { create as b } from "zustand";
6
+ var x = {
7
7
  badge: "_badge_1pk53_1",
8
8
  sm: "_sm_1pk53_3",
9
9
  md: "_md_1pk53_5",
@@ -15,24 +15,24 @@ var y = {
15
15
  dot: "_dot_1pk53_17",
16
16
  icon: "_icon_1pk53_19",
17
17
  label: "_label_1pk53_21"
18
- }, b = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
19
- className: `${y.badge} ${y[r]} ${y[i]} ${s}`,
18
+ }, S = ({ children: e, variant: r = "neutral", size: i = "md", dot: a = !1, icon: o, className: s = "" }) => /* @__PURE__ */ n("span", {
19
+ className: `${x.badge} ${x[r]} ${x[i]} ${s}`,
20
20
  children: [
21
21
  a && /* @__PURE__ */ t("span", {
22
- className: y.dot,
22
+ className: x.dot,
23
23
  "aria-hidden": "true"
24
24
  }),
25
25
  o && /* @__PURE__ */ t("span", {
26
- className: y.icon,
26
+ className: x.icon,
27
27
  "aria-hidden": "true",
28
28
  children: o
29
29
  }),
30
30
  /* @__PURE__ */ t("span", {
31
- className: y.label,
31
+ className: x.label,
32
32
  children: e
33
33
  })
34
34
  ]
35
- }), x = {
35
+ }), C = {
36
36
  container: "_container_1h2c4_1",
37
37
  inner: "_inner_1h2c4_21",
38
38
  line: "_line_1h2c4_39",
@@ -44,18 +44,18 @@ var y = {
44
44
  destructive: "_destructive_1h2c4_97",
45
45
  destructiveOutline: "_destructiveOutline_1h2c4_105",
46
46
  grow: "_grow_1h2c4_1"
47
- }, S = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
48
- className: `${x.container} ${x[e]}`,
47
+ }, ee = ({ variant: e = "primary" }) => /* @__PURE__ */ t("div", {
48
+ className: `${C.container} ${C[e]}`,
49
49
  children: /* @__PURE__ */ n("div", {
50
- className: `${x.inner} ${x[e]}`,
50
+ className: `${C.inner} ${C[e]}`,
51
51
  children: [
52
- /* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` }),
53
- /* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` }),
54
- /* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` }),
55
- /* @__PURE__ */ t("div", { className: `${x.line} ${x[e]}` })
52
+ /* @__PURE__ */ t("div", { className: `${C.line} ${C[e]}` }),
53
+ /* @__PURE__ */ t("div", { className: `${C.line} ${C[e]}` }),
54
+ /* @__PURE__ */ t("div", { className: `${C.line} ${C[e]}` }),
55
+ /* @__PURE__ */ t("div", { className: `${C.line} ${C[e]}` })
56
56
  ]
57
57
  })
58
- }), C = {
58
+ }), w = {
59
59
  button: "_button_1gql6_1",
60
60
  sm: "_sm_1gql6_43",
61
61
  md: "_md_1gql6_55",
@@ -67,17 +67,17 @@ var y = {
67
67
  empty: "_empty_1gql6_127",
68
68
  destructive: "_destructive_1gql6_139",
69
69
  destructiveOutline: "_destructiveOutline_1gql6_147"
70
- }, w = i(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, disabled: a, type: o = "button", className: s = "", ...c }, l) => /* @__PURE__ */ t("button", {
70
+ }, T = a(({ children: e, variant: n = "primary", size: r = "md", isLoading: i = !1, disabled: a, type: o = "button", className: s = "", ...c }, l) => /* @__PURE__ */ t("button", {
71
71
  ref: l,
72
- className: `${C.button} ${C[n]} ${C[r]} ${s}`,
72
+ className: `${w.button} ${w[n]} ${w[r]} ${s}`,
73
73
  disabled: a || i,
74
74
  "aria-busy": i || void 0,
75
75
  ...c,
76
76
  type: o,
77
- children: i ? /* @__PURE__ */ t(S, { variant: n }) : e
77
+ children: i ? /* @__PURE__ */ t(ee, { variant: n }) : e
78
78
  }));
79
- w.displayName = "DSButton";
80
- var T = {
79
+ T.displayName = "DSButton";
80
+ var E = {
81
81
  label: "_label_fa00b_1",
82
82
  required: "_required_fa00b_23",
83
83
  error: "_error_fa00b_25",
@@ -86,24 +86,24 @@ var T = {
86
86
  disabled: "_disabled_fa00b_47",
87
87
  message: "_message_fa00b_55",
88
88
  success: "_success_fa00b_71"
89
- }, E = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
90
- className: `${T.label} ${a ? T.disabled : ""} ${o}`,
89
+ }, te = ({ children: e, required: r = !1, optionalText: i, disabled: a = !1, className: o = "", ...s }) => /* @__PURE__ */ n("label", {
90
+ className: `${E.label} ${a ? E.disabled : ""} ${o}`,
91
91
  ...s,
92
92
  children: [
93
93
  /* @__PURE__ */ t("span", { children: e }),
94
94
  r && /* @__PURE__ */ t("span", {
95
- className: T.required,
95
+ className: E.required,
96
96
  "aria-hidden": "true",
97
97
  children: "*"
98
98
  }),
99
99
  i && /* @__PURE__ */ t("span", {
100
- className: T.optional,
100
+ className: E.optional,
101
101
  children: i
102
102
  })
103
103
  ]
104
104
  }), D = ({ children: e, variant: n = "hint", id: r, live: i = !1, className: a = "" }) => /* @__PURE__ */ t("span", {
105
105
  id: r,
106
- className: `${T.message} ${T[n]} ${a}`,
106
+ className: `${E.message} ${E[n]} ${a}`,
107
107
  role: i && n === "error" ? "alert" : void 0,
108
108
  "aria-live": i && n !== "error" ? "polite" : void 0,
109
109
  children: e
@@ -270,30 +270,30 @@ var T = {
270
270
  control: "_control_1gq36_7",
271
271
  disabled: "_disabled_1gq36_13",
272
272
  controlError: "_controlError_1gq36_17"
273
- }, M = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: l = !1, readOnly: u = !1, className: f = "", name: p, id: m, indeterminate: h = !1, ...g }) => {
274
- let _ = c(), v = m ?? `ds-checkbox-${p ?? _}`, y = d(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
275
- return s(() => {
273
+ }, M = ({ checked: e, onChange: r, label: i, hint: a, error: o, disabled: s = !1, readOnly: c = !1, className: d = "", name: f, id: m, indeterminate: h = !1, ...g }) => {
274
+ let _ = u(), v = m ?? `ds-checkbox-${f ?? _}`, y = p(null), b = a ? `${v}-hint` : void 0, x = o ? `${v}-error` : void 0;
275
+ return l(() => {
276
276
  y.current && (y.current.indeterminate = h && !e);
277
277
  }, [e, h]), /* @__PURE__ */ n("div", {
278
- className: `${j.wrapper} ${f}`,
278
+ className: `${j.wrapper} ${d}`,
279
279
  children: [
280
280
  /* @__PURE__ */ n("label", {
281
- className: `${j.label} ${l ? j.disabled : ""}`,
281
+ className: `${j.label} ${s ? j.disabled : ""}`,
282
282
  htmlFor: v,
283
283
  children: [
284
284
  /* @__PURE__ */ t("input", {
285
285
  ref: y,
286
286
  id: v,
287
- name: p,
287
+ name: f,
288
288
  type: "checkbox",
289
289
  checked: e,
290
- disabled: l,
291
- "aria-readonly": u || void 0,
290
+ disabled: s,
291
+ "aria-readonly": c || void 0,
292
292
  "aria-invalid": !!o,
293
293
  "aria-describedby": [b, x].filter(Boolean).join(" ") || void 0,
294
294
  className: j.input,
295
295
  onChange: (e) => {
296
- u || r?.(e.target.checked, e);
296
+ c || r?.(e.target.checked, e);
297
297
  },
298
298
  ...g
299
299
  }),
@@ -394,77 +394,77 @@ var T = {
394
394
  if (!e) return "";
395
395
  let n = `${I(e.getDate())}.${I(e.getMonth() + 1)}.${e.getFullYear()}`, r = `${I(e.getHours())}:${I(e.getMinutes())}`;
396
396
  return t === "date" ? n : t === "time" ? r : `${n} ${r}`;
397
- }, V = (e) => {
397
+ }, ne = (e) => {
398
398
  let t = new Date(e.getFullYear(), e.getMonth(), 1), n = (t.getDay() + 6) % 7, r = new Date(t);
399
399
  return r.setDate(t.getDate() - n), Array.from({ length: 42 }, (e, t) => {
400
400
  let n = new Date(r);
401
401
  return n.setDate(r.getDate() + t), n;
402
402
  });
403
- }, H = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), ee = (e, t, n) => {
403
+ }, V = (e, t) => !!(e && e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate()), H = (e, t, n) => {
404
404
  let r = L(e).getTime();
405
405
  return !!(t && r < L(t).getTime() || n && r > L(n).getTime());
406
- }, U = 8, W = 6, G = ({ value: r, onChange: i, mode: a = "date", label: m, placeholder: h, hint: g, error: _, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, size: C = "md", id: w, name: T, className: O = "" }) => {
407
- let k = c(), j = w ?? `ds-date-time-${T ?? k}`, M = g ? `${j}-hint` : void 0, I = _ ? `${j}-error` : void 0, L = d(null), G = d(null), te = d(null), [K, q] = f(!1), [J, ne] = f(r ?? /* @__PURE__ */ new Date()), [Y, re] = f(R(r, "time")), [ie, ae] = f(null), oe = u(() => V(J), [J]), se = a !== "time", ce = a !== "date";
408
- s(() => {
409
- r && ne(r), re(R(r, "time"));
406
+ }, U = 8, re = 6, W = ({ value: r, onChange: i, mode: a = "date", label: o, placeholder: c, hint: g, error: _, disabled: v = !1, readOnly: y = !1, required: b = !1, min: x, max: S, size: C = "md", id: ee, name: w, className: T = "" }) => {
407
+ let E = u(), O = ee ?? `ds-date-time-${w ?? E}`, k = g ? `${O}-hint` : void 0, j = _ ? `${O}-error` : void 0, M = p(null), I = p(null), L = p(null), [W, G] = m(!1), [K, ie] = m(r ?? /* @__PURE__ */ new Date()), [q, ae] = m(R(r, "time")), [J, Y] = m(null), oe = f(() => ne(K), [K]), se = a !== "time", ce = a !== "date";
408
+ l(() => {
409
+ r && ie(r), ae(R(r, "time"));
410
410
  }, [r]);
411
- let le = o(() => {
412
- let e = G.current, t = te.current;
411
+ let le = s(() => {
412
+ let e = I.current, t = L.current;
413
413
  if (!e || !t) return;
414
- let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - U, o = n.top - U, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(U, n.top - r.height - W) : n.bottom + W, u = n.left, d = i - r.width - U;
415
- ae({
414
+ let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - U, o = n.top - U, s = a < r.height && o > a, c = Math.max(120, s ? o : a), l = s ? Math.max(U, n.top - r.height - re) : n.bottom + re, u = n.left, d = i - r.width - U;
415
+ Y({
416
416
  top: l,
417
417
  left: Math.max(U, Math.min(u, d)),
418
418
  maxHeight: c
419
419
  });
420
420
  }, []);
421
- l(() => {
422
- if (!K) {
423
- ae(null);
421
+ d(() => {
422
+ if (!W) {
423
+ Y(null);
424
424
  return;
425
425
  }
426
426
  return le(), window.addEventListener("resize", le), window.addEventListener("scroll", le, !0), () => {
427
427
  window.removeEventListener("resize", le), window.removeEventListener("scroll", le, !0);
428
428
  };
429
429
  }, [
430
- K,
430
+ W,
431
431
  le,
432
- J,
433
- Y
434
- ]), s(() => {
435
- if (!K) return;
432
+ K,
433
+ q
434
+ ]), l(() => {
435
+ if (!W) return;
436
436
  let e = (e) => {
437
- let t = e.target, n = L.current?.contains(t), r = te.current?.contains(t);
438
- !n && !r && q(!1);
437
+ let t = e.target, n = M.current?.contains(t), r = L.current?.contains(t);
438
+ !n && !r && G(!1);
439
439
  }, t = (e) => {
440
- e.key === "Escape" && (q(!1), G.current?.focus());
440
+ e.key === "Escape" && (G(!1), I.current?.focus());
441
441
  };
442
442
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
443
443
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
444
444
  };
445
- }, [K]);
445
+ }, [W]);
446
446
  let ue = (e) => {
447
- if (ee(e, x, S)) return;
447
+ if (H(e, x, S)) return;
448
448
  let t = a === "date" ? z(R(e, "date"), "date") : new Date(e);
449
- t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && q(!1));
450
- }, X = (e) => {
451
- if (re(e), !e) {
449
+ t && (a !== "date" && t.setHours(r?.getHours() ?? 0, r?.getMinutes() ?? 0, 0, 0), i?.(t), a === "date" && G(!1));
450
+ }, de = (e) => {
451
+ if (ae(e), !e) {
452
452
  i?.(null);
453
453
  return;
454
454
  }
455
455
  let t = z(e, "time");
456
456
  if (!t) return;
457
- let n = new Date(a === "datetime" ? r ?? J : /* @__PURE__ */ new Date());
457
+ let n = new Date(a === "datetime" ? r ?? K : /* @__PURE__ */ new Date());
458
458
  n.setHours(t.getHours(), t.getMinutes(), 0, 0), !(x && n < x || S && n > S) && i?.(n);
459
- }, de = h ?? (a === "date" ? "--.--.----" : a === "time" ? "--:--" : "--.--.---- --:--"), fe = [M, I].filter(Boolean).join(" ") || void 0, pe = K && !y ? /* @__PURE__ */ n("div", {
460
- ref: te,
459
+ }, fe = c ?? (a === "date" ? "--.--.----" : a === "time" ? "--:--" : "--.--.---- --:--"), X = [k, j].filter(Boolean).join(" ") || void 0, pe = W && !y ? /* @__PURE__ */ n("div", {
460
+ ref: L,
461
461
  className: N.panel,
462
462
  role: "dialog",
463
- "aria-label": m ?? de,
464
- style: ie ? {
465
- top: ie.top,
466
- left: ie.left,
467
- maxHeight: ie.maxHeight
463
+ "aria-label": o ?? fe,
464
+ style: J ? {
465
+ top: J.top,
466
+ left: J.left,
467
+ maxHeight: J.maxHeight
468
468
  } : {
469
469
  visibility: "hidden",
470
470
  top: 0,
@@ -478,7 +478,7 @@ var T = {
478
478
  type: "button",
479
479
  className: N.nav,
480
480
  "aria-label": "Предыдущий месяц",
481
- onClick: () => ne(new Date(J.getFullYear(), J.getMonth() - 1, 1)),
481
+ onClick: () => ie(new Date(K.getFullYear(), K.getMonth() - 1, 1)),
482
482
  children: /* @__PURE__ */ t(A, {
483
483
  name: "IconChevron",
484
484
  width: 20,
@@ -489,8 +489,8 @@ var T = {
489
489
  /* @__PURE__ */ t("select", {
490
490
  className: N.monthSelect,
491
491
  "aria-label": "Месяц",
492
- value: J.getMonth(),
493
- onChange: (e) => ne(new Date(J.getFullYear(), Number(e.target.value), 1)),
492
+ value: K.getMonth(),
493
+ onChange: (e) => ie(new Date(K.getFullYear(), Number(e.target.value), 1)),
494
494
  children: F.map((e, n) => /* @__PURE__ */ t("option", {
495
495
  value: n,
496
496
  children: e
@@ -500,14 +500,14 @@ var T = {
500
500
  className: N.yearInput,
501
501
  type: "number",
502
502
  "aria-label": "Год",
503
- value: J.getFullYear(),
504
- onChange: (e) => ne(new Date(Number(e.target.value), J.getMonth(), 1))
503
+ value: K.getFullYear(),
504
+ onChange: (e) => ie(new Date(Number(e.target.value), K.getMonth(), 1))
505
505
  }),
506
506
  /* @__PURE__ */ t("button", {
507
507
  type: "button",
508
508
  className: N.nav,
509
509
  "aria-label": "Следующий месяц",
510
- onClick: () => ne(new Date(J.getFullYear(), J.getMonth() + 1, 1)),
510
+ onClick: () => ie(new Date(K.getFullYear(), K.getMonth() + 1, 1)),
511
511
  children: /* @__PURE__ */ t(A, {
512
512
  name: "IconChevron",
513
513
  width: 20,
@@ -524,11 +524,11 @@ var T = {
524
524
  /* @__PURE__ */ t("div", {
525
525
  className: N.days,
526
526
  children: oe.map((e) => {
527
- let n = H(r, e);
527
+ let n = V(r, e);
528
528
  return /* @__PURE__ */ t("button", {
529
529
  type: "button",
530
- className: `${N.day} ${e.getMonth() === J.getMonth() ? "" : N.outside} ${n ? N.selected : ""}`,
531
- disabled: ee(e, x, S),
530
+ className: `${N.day} ${e.getMonth() === K.getMonth() ? "" : N.outside} ${n ? N.selected : ""}`,
531
+ disabled: H(e, x, S),
532
532
  "aria-pressed": n,
533
533
  onClick: () => ue(e),
534
534
  children: e.getDate()
@@ -540,38 +540,38 @@ var T = {
540
540
  children: [/* @__PURE__ */ t("span", { children: "Время" }), /* @__PURE__ */ t("input", {
541
541
  className: N.timeInput,
542
542
  type: "time",
543
- value: Y,
544
- onChange: (e) => X(e.target.value)
543
+ value: q,
544
+ onChange: (e) => de(e.target.value)
545
545
  })]
546
546
  })]
547
547
  }) : null;
548
548
  return /* @__PURE__ */ n("div", {
549
- ref: L,
550
- className: `${N.wrapper} ${O}`,
549
+ ref: M,
550
+ className: `${N.wrapper} ${T}`,
551
551
  children: [
552
- m && /* @__PURE__ */ t(E, {
553
- htmlFor: j,
552
+ o && /* @__PURE__ */ t(te, {
553
+ htmlFor: O,
554
554
  required: b,
555
555
  disabled: v,
556
- children: m
556
+ children: o
557
557
  }),
558
558
  /* @__PURE__ */ n("button", {
559
- ref: G,
560
- id: j,
561
- name: T,
559
+ ref: I,
560
+ id: O,
561
+ name: w,
562
562
  type: "button",
563
563
  className: `${N.trigger} ${N[C]} ${_ ? N.error : ""}`,
564
564
  disabled: v,
565
565
  "aria-readonly": y || void 0,
566
- "aria-expanded": K,
566
+ "aria-expanded": W,
567
567
  "aria-haspopup": "dialog",
568
- "aria-describedby": fe,
568
+ "aria-describedby": X,
569
569
  onClick: () => {
570
- y || q((e) => !e);
570
+ y || G((e) => !e);
571
571
  },
572
572
  children: [/* @__PURE__ */ t("span", {
573
573
  className: r ? N.value : N.placeholder,
574
- children: B(r, a) || de
574
+ children: B(r, a) || fe
575
575
  }), /* @__PURE__ */ t("span", {
576
576
  className: [N.chevron, pe ? N.chevronOpen : ""].filter(Boolean).join(" "),
577
577
  "aria-hidden": "true",
@@ -582,32 +582,31 @@ var T = {
582
582
  })
583
583
  })]
584
584
  }),
585
- pe && p(pe, document.body),
585
+ pe && h(pe, document.body),
586
586
  g && !_ && /* @__PURE__ */ t(D, {
587
- id: M,
587
+ id: k,
588
588
  children: g
589
589
  }),
590
590
  _ && /* @__PURE__ */ t(D, {
591
- id: I,
591
+ id: j,
592
592
  variant: "error",
593
593
  children: _
594
594
  })
595
595
  ]
596
596
  });
597
- }, te = {
598
- root: "_root_1q42e_1",
599
- legend: "_legend_1q42e_3",
600
- range: "_range_1q42e_5"
601
- }, K = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), q = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
597
+ }, G = {
598
+ root: "_root_q0cvp_1",
599
+ range: "_range_q0cvp_3"
600
+ }, K = (e) => !!(e.from && e.to && e.from.getTime() <= e.to.getTime()), ie = ({ value: e, onChange: r, onDraftChange: i, mode: a = "date", fromLabel: o = "От", toLabel: s = "До", hint: c, error: l, min: u, max: d, disabled: f = !1, readOnly: p = !1, required: m = !1, className: h = "" }) => {
602
601
  let g = l ?? (e.from && e.to && e.from > e.to ? "Дата «От» не может быть позже даты «До»" : void 0), _ = (e) => {
603
602
  i?.(e), K(e) && r?.(e);
604
603
  };
605
604
  return /* @__PURE__ */ n("fieldset", {
606
- className: `${te.root} ${h}`,
605
+ className: `${G.root} ${h}`,
607
606
  disabled: f,
608
607
  children: [/* @__PURE__ */ n("div", {
609
- className: te.range,
610
- children: [/* @__PURE__ */ t(G, {
608
+ className: G.range,
609
+ children: [/* @__PURE__ */ t(W, {
611
610
  value: e.from,
612
611
  mode: a === "datetime" ? "datetime" : a,
613
612
  label: o,
@@ -621,7 +620,7 @@ var T = {
621
620
  ...e,
622
621
  from: t
623
622
  })
624
- }), /* @__PURE__ */ t(G, {
623
+ }), /* @__PURE__ */ t(W, {
625
624
  value: e.to,
626
625
  mode: a === "datetime" ? "datetime" : a,
627
626
  label: s,
@@ -638,7 +637,7 @@ var T = {
638
637
  })]
639
638
  }), c && !g && /* @__PURE__ */ t(D, { children: c })]
640
639
  });
641
- }, J = {
640
+ }, q = {
642
641
  group: "_group_1fs9e_1",
643
642
  skeleton: "_skeleton_1fs9e_3",
644
643
  text: "_text_1fs9e_5",
@@ -646,104 +645,103 @@ var T = {
646
645
  circular: "_circular_1fs9e_9",
647
646
  animated: "_animated_1fs9e_11",
648
647
  "ds-skeleton": "_ds-skeleton_1fs9e_1"
649
- }, ne = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
650
- className: `${J.group} ${o}`,
648
+ }, ae = ({ variant: e = "text", width: n = "100%", height: r, lines: i = 1, animated: a = !0, className: o = "" }) => /* @__PURE__ */ t("span", {
649
+ className: `${q.group} ${o}`,
651
650
  "aria-hidden": "true",
652
651
  children: Array.from({ length: Math.max(1, i) }, (o, s) => /* @__PURE__ */ t("span", {
653
- className: `${J.skeleton} ${J[e]} ${a ? J.animated : ""}`,
652
+ className: `${q.skeleton} ${q[e]} ${a ? q.animated : ""}`,
654
653
  style: {
655
654
  width: s === i - 1 && i > 1 ? "70%" : n,
656
655
  height: r
657
656
  }
658
657
  }, s))
659
- }), Y = {
660
- wrapper: "_wrapper_1gp7o_1",
661
- label: "_label_1gp7o_17",
662
- container: "_container_1gp7o_29",
663
- trigger: "_trigger_1gp7o_37",
664
- disabledText: "_disabledText_1gp7o_39",
665
- sm: "_sm_1gp7o_61",
666
- md: "_md_1gp7o_71",
667
- lg: "_lg_1gp7o_83",
668
- value: "_value_1gp7o_143",
669
- placeholder: "_placeholder_1gp7o_145",
670
- chevron: "_chevron_1gp7o_201",
671
- chevronOpen: "_chevronOpen_1gp7o_227",
672
- menu: "_menu_1gp7o_235",
673
- option: "_option_1gp7o_265",
674
- selected: "_selected_1gp7o_335",
675
- message: "_message_1gp7o_355",
676
- error: "_error_1gp7o_357",
677
- errorState: "_errorState_1gp7o_383"
678
- }, re = 8, ie = 6, ae = 120, oe = (e, t, n) => {
658
+ }), J = {
659
+ wrapper: "_wrapper_2x315_1",
660
+ container: "_container_2x315_17",
661
+ trigger: "_trigger_2x315_25",
662
+ disabledText: "_disabledText_2x315_27",
663
+ sm: "_sm_2x315_49",
664
+ md: "_md_2x315_59",
665
+ lg: "_lg_2x315_71",
666
+ value: "_value_2x315_131",
667
+ placeholder: "_placeholder_2x315_133",
668
+ chevron: "_chevron_2x315_189",
669
+ chevronOpen: "_chevronOpen_2x315_215",
670
+ menu: "_menu_2x315_223",
671
+ option: "_option_2x315_253",
672
+ selected: "_selected_2x315_323",
673
+ message: "_message_2x315_343",
674
+ error: "_error_2x315_345",
675
+ errorState: "_errorState_2x315_371"
676
+ }, Y = 8, oe = 6, se = 120, ce = (e, t, n) => {
679
677
  if (!e.length) return -1;
680
678
  for (let r = 0; r < e.length; r += 1) {
681
679
  let i = (t + r * n + e.length) % e.length;
682
680
  if (!e[i]?.disabled) return i;
683
681
  }
684
682
  return -1;
685
- }, se = (e) => {
683
+ }, le = (e) => {
686
684
  if (typeof e == "number") return e;
687
685
  if (typeof e == "string") {
688
686
  let t = Number.parseFloat(e);
689
687
  if (Number.isFinite(t)) return t;
690
688
  }
691
689
  return Infinity;
692
- }, ce = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", hint: y, className: b = "", required: x = !1, name: S, id: C, needMark: w = !0, maxMenuHeight: T }) => {
693
- let D = c(), O = C ?? `ds-dropdown-${S ?? D}`, k = `${O}-listbox`, [j, M] = f(!1), [N, P] = f(null), F = d(null), I = d(null), L = d(null), R = d([]), z = u(() => e.find((e) => e.value === r), [e, r]), B = y ? `${O}-hint` : void 0, V = _ ? `${O}-error` : void 0, H = [B, V].filter(Boolean).join(" ") || void 0, ee = m && h, U = o(() => {
694
- let e = I.current, t = L.current;
690
+ }, ue = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опцию", disabled: o = !1, stringWhileDisabled: c = !1, label: g, error: _, size: v = "md", hint: y, className: b = "", required: x = !1, name: S, id: C, needMark: ee = !0, maxMenuHeight: w }) => {
691
+ let T = u(), E = C ?? `ds-dropdown-${S ?? T}`, D = `${E}-listbox`, [O, k] = m(!1), [j, M] = m(null), N = p(null), P = p(null), F = p(null), I = p([]), L = f(() => e.find((e) => e.value === r), [e, r]), R = y ? `${E}-hint` : void 0, z = _ ? `${E}-error` : void 0, B = [R, z].filter(Boolean).join(" ") || void 0, ne = o && c, V = s(() => {
692
+ let e = P.current, t = F.current;
695
693
  if (!e || !t) return;
696
- let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - re, o = n.top - re, s = a < r.height && o > a, c = Math.max(ae, s ? o : a), l = se(T), u = Math.min(c, l), d = n.left, f = i - n.width - re, p = Math.max(re, Math.min(d, f)), m = s ? Math.max(re, n.top - r.height - ie) : n.bottom + ie;
697
- P({
694
+ let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight - n.bottom - Y, o = n.top - Y, s = a < r.height && o > a, c = Math.max(se, s ? o : a), l = le(w), u = Math.min(c, l), d = n.left, f = i - n.width - Y, p = Math.max(Y, Math.min(d, f)), m = s ? Math.max(Y, n.top - r.height - oe) : n.bottom + oe;
695
+ M({
698
696
  top: m,
699
697
  left: p,
700
698
  width: n.width,
701
699
  maxHeight: u
702
700
  });
703
- }, [T]);
704
- l(() => {
705
- if (!j) {
706
- P(null);
701
+ }, [w]);
702
+ d(() => {
703
+ if (!O) {
704
+ M(null);
707
705
  return;
708
706
  }
709
- return U(), window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
710
- window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
707
+ return V(), window.addEventListener("resize", V), window.addEventListener("scroll", V, !0), () => {
708
+ window.removeEventListener("resize", V), window.removeEventListener("scroll", V, !0);
711
709
  };
712
710
  }, [
713
- j,
714
- U,
711
+ O,
712
+ V,
715
713
  e.length
716
- ]), s(() => {
717
- if (!j) return;
714
+ ]), l(() => {
715
+ if (!O) return;
718
716
  let e = (e) => {
719
- let t = e.target, n = F.current?.contains(t), r = L.current?.contains(t);
720
- !n && !r && M(!1);
717
+ let t = e.target, n = N.current?.contains(t), r = F.current?.contains(t);
718
+ !n && !r && k(!1);
721
719
  }, t = (e) => {
722
- e.key === "Escape" && (M(!1), I.current?.focus());
720
+ e.key === "Escape" && (k(!1), P.current?.focus());
723
721
  };
724
722
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
725
723
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
726
724
  };
727
- }, [j]);
728
- let W = (t, n) => {
729
- let r = oe(e, t, n);
725
+ }, [O]);
726
+ let H = (t, n) => {
727
+ let r = ce(e, t, n);
730
728
  if (r === -1) return;
731
- let i = R.current[r];
729
+ let i = I.current[r];
732
730
  i?.focus(), i?.scrollIntoView({ block: "nearest" });
733
- }, G = (e) => {
734
- e.disabled || (i?.(e.value, e), M(!1), I.current?.focus());
735
- }, te = j ? /* @__PURE__ */ t("ul", {
736
- ref: L,
737
- id: k,
738
- className: Y.menu,
731
+ }, U = (e) => {
732
+ e.disabled || (i?.(e.value, e), k(!1), P.current?.focus());
733
+ }, re = O ? /* @__PURE__ */ t("ul", {
734
+ ref: F,
735
+ id: D,
736
+ className: J.menu,
739
737
  role: "listbox",
740
738
  "aria-label": g,
741
- style: N ? {
739
+ style: j ? {
742
740
  position: "fixed",
743
- top: N.top,
744
- left: N.left,
745
- width: N.width,
746
- maxHeight: N.maxHeight
741
+ top: j.top,
742
+ left: j.left,
743
+ width: j.width,
744
+ maxHeight: j.maxHeight
747
745
  } : {
748
746
  position: "fixed",
749
747
  top: 0,
@@ -757,32 +755,32 @@ var T = {
757
755
  role: "presentation",
758
756
  children: /* @__PURE__ */ n("button", {
759
757
  ref: (e) => {
760
- R.current[a] = e;
758
+ I.current[a] = e;
761
759
  },
762
760
  type: "button",
763
761
  role: "option",
764
762
  "aria-selected": o,
765
763
  disabled: i.disabled,
766
764
  className: [
767
- Y[v],
768
- Y.option,
769
- o ? Y.selected : ""
765
+ J[v],
766
+ J.option,
767
+ o ? J.selected : ""
770
768
  ].filter(Boolean).join(" "),
771
- onClick: () => G(i),
769
+ onClick: () => U(i),
772
770
  onKeyDown: (t) => {
773
771
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
774
772
  t.preventDefault();
775
773
  let e = t.key === "ArrowDown" ? 1 : -1;
776
- W(a + e, e);
774
+ H(a + e, e);
777
775
  }
778
- if (t.key === "Tab" && M(!1), t.key === "Home" || t.key === "End") {
776
+ if (t.key === "Tab" && k(!1), t.key === "Home" || t.key === "End") {
779
777
  t.preventDefault();
780
778
  let n = t.key === "Home" ? 1 : -1;
781
- W(t.key === "Home" ? 0 : e.length - 1, n);
779
+ H(t.key === "Home" ? 0 : e.length - 1, n);
782
780
  }
783
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), G(i));
781
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), U(i));
784
782
  },
785
- children: [/* @__PURE__ */ t("span", { children: i.label }), o && w && /* @__PURE__ */ t(A, {
783
+ children: [/* @__PURE__ */ t("span", { children: i.label }), o && ee && /* @__PURE__ */ t(A, {
786
784
  name: "IconCheck",
787
785
  width: 16,
788
786
  height: 16
@@ -792,59 +790,59 @@ var T = {
792
790
  })
793
791
  }) : null;
794
792
  return /* @__PURE__ */ n("div", {
795
- ref: F,
793
+ ref: N,
796
794
  className: [
797
- Y.wrapper,
798
- _ ? Y.errorState : "",
795
+ J.wrapper,
796
+ _ ? J.errorState : "",
799
797
  b
800
798
  ].filter(Boolean).join(" "),
801
799
  children: [
802
- g && /* @__PURE__ */ t(E, {
800
+ g && /* @__PURE__ */ t(te, {
803
801
  required: x,
804
- disabled: m,
805
- htmlFor: ee ? void 0 : O,
802
+ disabled: o,
803
+ htmlFor: ne ? void 0 : E,
806
804
  children: g
807
805
  }),
808
806
  /* @__PURE__ */ t("div", {
809
- className: Y.container,
810
- children: ee ? /* @__PURE__ */ t("div", {
811
- id: O,
812
- className: Y.disabledText,
813
- "aria-describedby": H,
814
- children: z?.label ?? a
807
+ className: J.container,
808
+ children: ne ? /* @__PURE__ */ t("div", {
809
+ id: E,
810
+ className: J.disabledText,
811
+ "aria-describedby": B,
812
+ children: L?.label ?? a
815
813
  }) : /* @__PURE__ */ n("button", {
816
- ref: I,
817
- id: O,
814
+ ref: P,
815
+ id: E,
818
816
  type: "button",
819
817
  name: S,
820
- className: `${Y.trigger} ${Y[v]}`,
821
- disabled: m,
818
+ className: `${J.trigger} ${J[v]}`,
819
+ disabled: o,
822
820
  "aria-haspopup": "listbox",
823
- "aria-expanded": j,
824
- "aria-controls": k,
825
- "aria-describedby": H,
821
+ "aria-expanded": O,
822
+ "aria-controls": D,
823
+ "aria-describedby": B,
826
824
  "aria-invalid": !!_,
827
- onClick: () => M((e) => !e),
825
+ onClick: () => k((e) => !e),
828
826
  onKeyDown: (t) => {
829
827
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
830
- t.preventDefault(), M(!0);
828
+ t.preventDefault(), k(!0);
831
829
  let n = t.key === "ArrowDown" ? 1 : -1;
832
830
  requestAnimationFrame(() => {
833
- W(t.key === "ArrowDown" ? 0 : e.length - 1, n);
831
+ H(t.key === "ArrowDown" ? 0 : e.length - 1, n);
834
832
  });
835
833
  }
836
- if (t.key === "Enter" && j) {
834
+ if (t.key === "Enter" && O) {
837
835
  t.preventDefault();
838
836
  let n = e.findIndex((e) => e.value === r);
839
- W(n >= 0 ? n : 0, 1);
837
+ H(n >= 0 ? n : 0, 1);
840
838
  }
841
839
  },
842
840
  children: [/* @__PURE__ */ t("span", {
843
- className: `${z ? Y.value : Y.placeholder}
844
- ${Y[v]}`,
845
- children: z?.label ?? a
841
+ className: `${L ? J.value : J.placeholder}
842
+ ${J[v]}`,
843
+ children: L?.label ?? a
846
844
  }), /* @__PURE__ */ t("span", {
847
- className: [Y.chevron, j ? Y.chevronOpen : ""].filter(Boolean).join(" "),
845
+ className: [J.chevron, O ? J.chevronOpen : ""].filter(Boolean).join(" "),
848
846
  "aria-hidden": "true",
849
847
  children: /* @__PURE__ */ t(A, {
850
848
  name: "IconChevron",
@@ -854,38 +852,38 @@ var T = {
854
852
  })]
855
853
  })
856
854
  }),
857
- j && p(te, document.body),
855
+ O && h(re, document.body),
858
856
  y && !_ && /* @__PURE__ */ t("span", {
859
- id: B,
860
- className: Y.message,
857
+ id: R,
858
+ className: J.message,
861
859
  children: y
862
860
  }),
863
861
  _ && /* @__PURE__ */ t("span", {
864
- id: V,
865
- className: Y.error,
862
+ id: z,
863
+ className: J.error,
866
864
  children: _
867
865
  })
868
866
  ]
869
867
  });
870
- }, le = (e) => `${e.id}:${e.direction}`, ue = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
868
+ }, de = (e) => `${e.id}:${e.direction}`, fe = ({ options: e, value: n, onChange: r, label: i = "Сортировка", placeholder: a = "Выберите сортировку", disabled: o = !1, className: s }) => {
871
869
  let c = e.flatMap((e) => [{
872
- value: le({
870
+ value: de({
873
871
  id: e.id,
874
872
  direction: "asc"
875
873
  }),
876
874
  label: e.ascLabel ?? `${e.label} · по возрастанию`,
877
875
  disabled: e.disabled
878
876
  }, {
879
- value: le({
877
+ value: de({
880
878
  id: e.id,
881
879
  direction: "desc"
882
880
  }),
883
881
  label: e.descLabel ?? `${e.label} · по убыванию`,
884
882
  disabled: e.disabled
885
883
  }]);
886
- return /* @__PURE__ */ t(ce, {
884
+ return /* @__PURE__ */ t(ue, {
887
885
  options: c,
888
- value: n ? le(n) : "",
886
+ value: n ? de(n) : "",
889
887
  label: i,
890
888
  placeholder: a,
891
889
  disabled: o,
@@ -921,10 +919,10 @@ var T = {
921
919
  default: "_default_l2civ_169",
922
920
  tableOnMobile: "_tableOnMobile_l2civ_169",
923
921
  wide: "_wide_l2civ_173"
924
- }, de = g({
925
- rowSortingFeature: h,
926
- sortedRowModel: m()
927
- }), fe = (e, t) => t <= 7 ? Array.from({ length: t }, (e, t) => t) : e <= 3 ? [
922
+ }, pe = v({
923
+ rowSortingFeature: _,
924
+ sortedRowModel: g()
925
+ }), me = (e, t) => t <= 7 ? Array.from({ length: t }, (e, t) => t) : e <= 3 ? [
928
926
  0,
929
927
  1,
930
928
  2,
@@ -948,7 +946,7 @@ var T = {
948
946
  e + 1,
949
947
  "ellipsis-end",
950
948
  t - 1
951
- ], pe = (e, t) => {
949
+ ], he = (e, t) => {
952
950
  let n = /* @__PURE__ */ new Set();
953
951
  for (let t of e) {
954
952
  if (!t.id.trim()) return "Идентификатор колонки не может быть пустым";
@@ -960,36 +958,36 @@ var T = {
960
958
  for (let t of e) if (typeof t.accessor == "string" && !(t.accessor in r)) return `В строке ${n + 1} отсутствует колонка «${t.id}»`;
961
959
  }
962
960
  return null;
963
- }, me = (e, t) => typeof e == "function" ? e(t) : t[e], he = (e) => {
961
+ }, ge = (e, t) => typeof e == "function" ? e(t) : t[e], _e = (e) => {
964
962
  if (e == null || e === "") return null;
965
963
  let t = Date.parse(String(e));
966
964
  return Number.isNaN(t) ? null : t;
967
- }, ge = (e, t, n) => {
968
- let r = he(e.getValue(n)), i = he(t.getValue(n));
965
+ }, ve = (e, t, n) => {
966
+ let r = _e(e.getValue(n)), i = _e(t.getValue(n));
969
967
  return r === null && i === null ? 0 : r === null ? -1 : i === null ? 1 : r - i;
970
- }, _e = (e, t, n) => {
968
+ }, ye = (e, t, n) => {
971
969
  let r = e.getValue(n), i = t.getValue(n);
972
970
  return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(r) - Number(i);
973
- }, ve = (e, t, n) => {
971
+ }, be = (e, t, n) => {
974
972
  let r = e.getValue(n), i = t.getValue(n);
975
973
  return r == null && i == null ? 0 : r == null ? -1 : i == null ? 1 : Number(!!r) - Number(!!i);
976
- }, ye = (e, t, n) => {
974
+ }, xe = (e, t, n) => {
977
975
  let r = String(e.getValue(n) ?? ""), i = String(t.getValue(n) ?? "");
978
976
  return r.localeCompare(i, void 0, {
979
977
  numeric: !0,
980
978
  sensitivity: "base"
981
979
  });
982
- }, be = (e) => {
980
+ }, Se = (e) => {
983
981
  switch (e) {
984
- case "date": return ge;
985
- case "number": return _e;
986
- case "boolean": return ve;
982
+ case "date": return ve;
983
+ case "number": return ye;
984
+ case "boolean": return be;
987
985
  case "text":
988
- case void 0: return ye;
986
+ case void 0: return xe;
989
987
  case "custom": return;
990
988
  }
991
- }, xe = (e) => {
992
- let t = (t) => me(e.accessor, t), n = e.sortFn ?? be(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
989
+ }, Ce = (e) => {
990
+ let t = (t) => ge(e.accessor, t), n = e.sortFn ?? Se(e.dataType), r = e.enableSorting ?? (e.dataType !== "custom" && n !== void 0), i = {
993
991
  id: e.id,
994
992
  accessorFn: t,
995
993
  header: () => e.header,
@@ -1001,56 +999,56 @@ var T = {
1001
999
  sortDescFirst: e.sortDescFirst
1002
1000
  };
1003
1001
  return n !== void 0 && (i.sortFn = n), i;
1004
- }, Se = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: c, renderMobileCard: l, getRowId: d, caption: p, ariaLabel: m, loading: h = !1, error: g, emptyState: v = "Нет данных", stickyHeader: y = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: T = 30, visibleColumnIds: E }) => {
1005
- let [D, O] = f([]), [k, j] = f(0), M = o ?? D, N = M.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), P = Number.isFinite(T) && T > 0 ? Math.floor(T) : 30, F = u(() => {
1006
- if (E === void 0) return e;
1007
- let t = new Set(E);
1002
+ }, we = ({ columns: e, data: r, tableOnMobile: i = !1, breakpoint: a = "default", sorting: o, onSortingChange: s, renderMobileCard: c, getRowId: u, caption: d, ariaLabel: p, loading: h = !1, error: g, emptyState: _ = "Нет данных", stickyHeader: v = !1, maxHeight: b, className: x = "", onRowClick: S, pagination: C = !1, pageSize: ee = 30, visibleColumnIds: w }) => {
1003
+ let [E, te] = m([]), [D, O] = m(0), k = o ?? E, j = k.map((e) => `${e.id}:${e.desc ? "desc" : "asc"}`).join("|"), M = Number.isFinite(ee) && ee > 0 ? Math.floor(ee) : 30, N = f(() => {
1004
+ if (w === void 0) return e;
1005
+ let t = new Set(w);
1008
1006
  return e.filter((e) => t.has(e.id));
1009
- }, [e, E]), I = u(() => F.length === 0 ? "Должна быть видима хотя бы одна колонка" : pe(F, r), [r, F]), L = u(() => F.map(xe), [F]), R = _({
1010
- features: de,
1011
- columns: L,
1007
+ }, [e, w]), P = f(() => N.length === 0 ? "Должна быть видима хотя бы одна колонка" : he(N, r), [r, N]), F = f(() => N.map(Ce), [N]), I = y({
1008
+ features: pe,
1009
+ columns: F,
1012
1010
  data: r,
1013
- state: { sorting: M },
1011
+ state: { sorting: k },
1014
1012
  onSortingChange: (e) => {
1015
- let t = typeof e == "function" ? e(M) : e;
1016
- o === void 0 && O(t), j(0), c?.(t);
1013
+ let t = typeof e == "function" ? e(k) : e;
1014
+ o === void 0 && te(t), O(0), s?.(t);
1017
1015
  },
1018
- getRowId: d
1019
- }), z = R.getRowModel().rows, B = C ? Math.max(1, Math.ceil(z.length / P)) : 1, V = Math.min(k, B - 1), H = u(() => C ? z.slice(V * P, (V + 1) * P) : z, [
1020
- P,
1016
+ getRowId: u
1017
+ }), L = I.getRowModel().rows, R = C ? Math.max(1, Math.ceil(L.length / M)) : 1, z = Math.min(D, R - 1), B = f(() => C ? L.slice(z * M, (z + 1) * M) : L, [
1018
+ M,
1021
1019
  C,
1022
- V,
1023
- z
1024
- ]), ee = u(() => F.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
1020
+ z,
1021
+ L
1022
+ ]), ne = f(() => N.filter((e) => e.enableSorting ?? e.dataType !== "custom").map((e) => ({
1025
1023
  id: e.id,
1026
1024
  label: typeof e.header == "string" ? e.header : e.id
1027
- })), [F]), U = u(() => fe(V, B), [B, V]), W = [
1025
+ })), [N]), V = f(() => me(z, R), [R, z]), H = [
1028
1026
  X.root,
1029
1027
  a === "wide" ? X.wide : X.default,
1030
1028
  i ? X.tableOnMobile : "",
1031
1029
  x
1032
- ].filter(Boolean).join(" "), G = I ?? g, te = C && !h && !G && z.length > P, K = V * P + 1, q = Math.min((V + 1) * P, z.length);
1033
- return s(() => {
1034
- j(0);
1030
+ ].filter(Boolean).join(" "), U = P ?? g, re = C && !h && !U && L.length > M, W = z * M + 1, G = Math.min((z + 1) * M, L.length);
1031
+ return l(() => {
1032
+ O(0);
1035
1033
  }, [
1036
1034
  r,
1037
- P,
1035
+ M,
1038
1036
  C,
1039
- N
1040
- ]), s(() => {
1041
- k >= B && j(B - 1);
1042
- }, [B, k]), /* @__PURE__ */ n("section", {
1043
- className: W,
1037
+ j
1038
+ ]), l(() => {
1039
+ D >= R && O(R - 1);
1040
+ }, [R, D]), /* @__PURE__ */ n("section", {
1041
+ className: H,
1044
1042
  "aria-busy": h,
1045
1043
  children: [
1046
- !i && !h && !G && H.length > 0 && ee.length > 0 && /* @__PURE__ */ t(ue, {
1044
+ !i && !h && !U && B.length > 0 && ne.length > 0 && /* @__PURE__ */ t(fe, {
1047
1045
  className: X.mobileSort,
1048
- options: ee,
1049
- value: M[0] ? {
1050
- id: M[0].id,
1051
- direction: M[0].desc ? "desc" : "asc"
1046
+ options: ne,
1047
+ value: k[0] ? {
1048
+ id: k[0].id,
1049
+ direction: k[0].desc ? "desc" : "asc"
1052
1050
  } : null,
1053
- onChange: (e) => R.setSorting([{
1051
+ onChange: (e) => I.setSorting([{
1054
1052
  id: e.id,
1055
1053
  desc: e.direction === "desc"
1056
1054
  }])
@@ -1060,12 +1058,12 @@ var T = {
1060
1058
  style: { maxHeight: b },
1061
1059
  children: /* @__PURE__ */ n("table", {
1062
1060
  className: X.table,
1063
- "aria-label": m,
1061
+ "aria-label": p,
1064
1062
  children: [
1065
- p && /* @__PURE__ */ t("caption", { children: p }),
1063
+ d && /* @__PURE__ */ t("caption", { children: d }),
1066
1064
  /* @__PURE__ */ t("thead", {
1067
- className: y ? X.sticky : "",
1068
- children: R.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
1065
+ className: v ? X.sticky : "",
1066
+ children: I.getHeaderGroups().map((e) => /* @__PURE__ */ t("tr", { children: e.headers.map((e) => {
1069
1067
  let r = e.column.getIsSorted(), i = e.column.getCanSort(), a = e.column.getToggleSortingHandler();
1070
1068
  return /* @__PURE__ */ t("th", {
1071
1069
  scope: "col",
@@ -1075,7 +1073,7 @@ var T = {
1075
1073
  className: X.sortButton,
1076
1074
  disabled: !i,
1077
1075
  onClick: a,
1078
- children: [/* @__PURE__ */ t(R.FlexRender, { header: e }), /* @__PURE__ */ t(A, {
1076
+ children: [/* @__PURE__ */ t(I.FlexRender, { header: e }), /* @__PURE__ */ t(A, {
1079
1077
  name: r === "asc" ? "IconSortAscending" : r === "desc" ? "IconSortDescending" : "IconSort",
1080
1078
  width: 16,
1081
1079
  height: 16
@@ -1085,17 +1083,17 @@ var T = {
1085
1083
  }) }, e.id))
1086
1084
  }),
1087
1085
  /* @__PURE__ */ t("tbody", { children: h ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
1088
- colSpan: F.length,
1089
- children: /* @__PURE__ */ t(ne, { lines: 3 })
1090
- }) }) : G ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
1086
+ colSpan: N.length,
1087
+ children: /* @__PURE__ */ t(ae, { lines: 3 })
1088
+ }) }) : U ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
1091
1089
  className: X.state,
1092
- colSpan: F.length,
1093
- children: G
1094
- }) }) : H.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
1090
+ colSpan: N.length,
1091
+ children: U
1092
+ }) }) : B.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
1095
1093
  className: X.state,
1096
- colSpan: F.length,
1097
- children: v
1098
- }) }) : H.map((e) => /* @__PURE__ */ t("tr", {
1094
+ colSpan: N.length,
1095
+ children: _
1096
+ }) }) : B.map((e) => /* @__PURE__ */ t("tr", {
1099
1097
  className: S ? X.clickableRow : void 0,
1100
1098
  onClick: () => S?.(e.original),
1101
1099
  onKeyDown: (t) => {
@@ -1103,7 +1101,7 @@ var T = {
1103
1101
  },
1104
1102
  tabIndex: S ? 0 : void 0,
1105
1103
  role: S ? "button" : void 0,
1106
- children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(R.FlexRender, { cell: e }) }, e.id))
1104
+ children: e.getAllCells().map((e) => /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(I.FlexRender, { cell: e }) }, e.id))
1107
1105
  }, e.id)) })
1108
1106
  ]
1109
1107
  })
@@ -1111,22 +1109,22 @@ var T = {
1111
1109
  !i && /* @__PURE__ */ t("div", {
1112
1110
  className: X.cards,
1113
1111
  role: "list",
1114
- "aria-label": m ?? p,
1115
- children: h ? /* @__PURE__ */ t(ne, { lines: 4 }) : G ? /* @__PURE__ */ t("div", {
1112
+ "aria-label": p ?? d,
1113
+ children: h ? /* @__PURE__ */ t(ae, { lines: 4 }) : U ? /* @__PURE__ */ t("div", {
1116
1114
  className: X.state,
1117
- children: G
1118
- }) : H.length === 0 ? /* @__PURE__ */ t("div", {
1115
+ children: U
1116
+ }) : B.length === 0 ? /* @__PURE__ */ t("div", {
1119
1117
  className: X.state,
1120
- children: v
1121
- }) : H.map((e) => {
1122
- if (l) return /* @__PURE__ */ t("div", {
1118
+ children: _
1119
+ }) : B.map((e) => {
1120
+ if (c) return /* @__PURE__ */ t("div", {
1123
1121
  role: "listitem",
1124
- children: l({
1122
+ children: c({
1125
1123
  row: e.original,
1126
- columns: F
1124
+ columns: N
1127
1125
  })
1128
1126
  }, e.id);
1129
- let r = F.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), i = r.find((e) => e.mobile?.primary) ?? r.find((e) => e.mobile?.mobileVariant !== "actions"), a = (t) => me(t.accessor, e.original), o = (t) => t.mobile?.renderMobile?.(e.original, a(t)) ?? t.cell?.(e.original, a(t)) ?? String(a(t) ?? "");
1127
+ let r = N.filter((e) => !e.mobile?.hideOnMobile).sort((e, t) => (e.mobile?.mobileOrder ?? 0) - (t.mobile?.mobileOrder ?? 0)), i = r.find((e) => e.mobile?.primary) ?? r.find((e) => e.mobile?.mobileVariant !== "actions"), a = (t) => ge(t.accessor, e.original), o = (t) => t.mobile?.renderMobile?.(e.original, a(t)) ?? t.cell?.(e.original, a(t)) ?? String(a(t) ?? "");
1130
1128
  return /* @__PURE__ */ n("article", {
1131
1129
  role: "listitem",
1132
1130
  className: X.card,
@@ -1141,29 +1139,29 @@ var T = {
1141
1139
  }, e.id);
1142
1140
  })
1143
1141
  }),
1144
- te && /* @__PURE__ */ n("nav", {
1142
+ re && /* @__PURE__ */ n("nav", {
1145
1143
  className: X.pagination,
1146
1144
  "aria-label": "Пагинация таблицы",
1147
1145
  children: [/* @__PURE__ */ n("span", {
1148
1146
  className: X.paginationRange,
1149
1147
  "aria-live": "polite",
1150
1148
  children: [
1151
- K,
1149
+ W,
1152
1150
  "–",
1153
- q,
1151
+ G,
1154
1152
  " из ",
1155
- z.length
1153
+ L.length
1156
1154
  ]
1157
1155
  }), /* @__PURE__ */ n("div", {
1158
1156
  className: X.paginationControls,
1159
1157
  children: [
1160
- /* @__PURE__ */ n(w, {
1158
+ /* @__PURE__ */ n(T, {
1161
1159
  variant: "empty",
1162
1160
  size: "md",
1163
- disabled: V === 0,
1161
+ disabled: z === 0,
1164
1162
  "aria-label": "Предыдущая страница",
1165
1163
  onClick: () => {
1166
- j((e) => Math.max(0, e - 1));
1164
+ O((e) => Math.max(0, e - 1));
1167
1165
  },
1168
1166
  children: [/* @__PURE__ */ t(A, {
1169
1167
  name: "IconChevron",
@@ -1177,14 +1175,14 @@ var T = {
1177
1175
  }),
1178
1176
  /* @__PURE__ */ t("div", {
1179
1177
  className: X.pageNumbers,
1180
- children: U.map((e) => typeof e == "number" ? /* @__PURE__ */ t(w, {
1181
- variant: e === V ? "secondary" : "empty",
1178
+ children: V.map((e) => typeof e == "number" ? /* @__PURE__ */ t(T, {
1179
+ variant: e === z ? "secondary" : "empty",
1182
1180
  size: "md",
1183
1181
  className: X.pageButton,
1184
1182
  "aria-label": `Перейти на страницу ${e + 1}`,
1185
- "aria-current": e === V ? "page" : void 0,
1183
+ "aria-current": e === z ? "page" : void 0,
1186
1184
  onClick: () => {
1187
- j(e);
1185
+ O(e);
1188
1186
  },
1189
1187
  children: e + 1
1190
1188
  }, e) : /* @__PURE__ */ t("span", {
@@ -1193,13 +1191,13 @@ var T = {
1193
1191
  children: "…"
1194
1192
  }, e))
1195
1193
  }),
1196
- /* @__PURE__ */ n(w, {
1194
+ /* @__PURE__ */ n(T, {
1197
1195
  variant: "empty",
1198
1196
  size: "md",
1199
- disabled: V === B - 1,
1197
+ disabled: z === R - 1,
1200
1198
  "aria-label": "Следующая страница",
1201
1199
  onClick: () => {
1202
- j((e) => Math.min(B - 1, e + 1));
1200
+ O((e) => Math.min(R - 1, e + 1));
1203
1201
  },
1204
1202
  children: [/* @__PURE__ */ t("span", {
1205
1203
  className: X.paginationButtonLabel,
@@ -1216,69 +1214,69 @@ var T = {
1216
1214
  })
1217
1215
  ]
1218
1216
  });
1219
- }, Ce = 8, we = 6, Te = 120, Ee = (e) => {
1217
+ }, Te = 8, Ee = 6, De = 120, Oe = (e) => {
1220
1218
  if (typeof e == "number") return e;
1221
1219
  if (typeof e == "string") {
1222
1220
  let t = Number.parseFloat(e);
1223
1221
  if (Number.isFinite(t)) return t;
1224
1222
  }
1225
1223
  return Infinity;
1226
- }, De = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: m = !1, stringWhileDisabled: h = !1, label: g, error: _, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: w = !1, needMark: T = !0, maxMenuHeight: D }) => {
1227
- let O = c(), k = C ?? `ds-dropdown-multiple-${S ?? O}`, j = `${k}-listbox`, [M, N] = f(!1), [P, F] = f(null), I = d(null), L = d(null), R = d(null), z = d([]), B = u(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), V = b ? `${k}-hint` : void 0, H = _ ? `${k}-error` : void 0, ee = [V, H].filter(Boolean).join(" ") || void 0, U = m && h, W = o(() => {
1228
- let e = L.current, t = R.current;
1224
+ }, ke = ({ options: e, value: r, onChange: i, placeholder: a = "Выберите опции", disabled: o = !1, stringWhileDisabled: c = !1, label: g, error: _, size: v = "md", required: y = !1, hint: b, className: x = "", name: S, id: C, closeOnSelect: ee = !1, needMark: w = !0, maxMenuHeight: T }) => {
1225
+ let E = u(), D = C ?? `ds-dropdown-multiple-${S ?? E}`, O = `${D}-listbox`, [k, j] = m(!1), [M, N] = m(null), P = p(null), F = p(null), I = p(null), L = p([]), R = f(() => e.filter((e) => r.includes(e.value)), [e, r]).map((e) => e.label).join(", "), z = b ? `${D}-hint` : void 0, B = _ ? `${D}-error` : void 0, ne = [z, B].filter(Boolean).join(" ") || void 0, V = o && c, H = s(() => {
1226
+ let e = F.current, t = I.current;
1229
1227
  if (!e || !t) return;
1230
- let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom - Ce, a = n.top - Ce, o = i < r.height && a > i, s = Math.max(Te, o ? a : i), c = window.innerWidth - n.width - Ce;
1231
- F({
1232
- top: o ? Math.max(Ce, n.top - r.height - we) : n.bottom + we,
1233
- left: Math.max(Ce, Math.min(n.left, c)),
1228
+ let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = window.innerHeight - n.bottom - Te, a = n.top - Te, o = i < r.height && a > i, s = Math.max(De, o ? a : i), c = window.innerWidth - n.width - Te;
1229
+ N({
1230
+ top: o ? Math.max(Te, n.top - r.height - Ee) : n.bottom + Ee,
1231
+ left: Math.max(Te, Math.min(n.left, c)),
1234
1232
  width: n.width,
1235
- maxHeight: Math.min(s, Ee(D))
1233
+ maxHeight: Math.min(s, Oe(T))
1236
1234
  });
1237
- }, [D]);
1238
- l(() => {
1239
- if (!M) {
1240
- F(null);
1235
+ }, [T]);
1236
+ d(() => {
1237
+ if (!k) {
1238
+ N(null);
1241
1239
  return;
1242
1240
  }
1243
- return W(), window.addEventListener("resize", W), window.addEventListener("scroll", W, !0), () => {
1244
- window.removeEventListener("resize", W), window.removeEventListener("scroll", W, !0);
1241
+ return H(), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
1242
+ window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
1245
1243
  };
1246
1244
  }, [
1247
- M,
1245
+ k,
1248
1246
  e.length,
1249
- W
1250
- ]), s(() => {
1251
- if (!M) return;
1247
+ H
1248
+ ]), l(() => {
1249
+ if (!k) return;
1252
1250
  let e = (e) => {
1253
1251
  let t = e.target;
1254
- !I.current?.contains(t) && !R.current?.contains(t) && N(!1);
1252
+ !P.current?.contains(t) && !I.current?.contains(t) && j(!1);
1255
1253
  }, t = (e) => {
1256
- e.key === "Escape" && (N(!1), L.current?.focus());
1254
+ e.key === "Escape" && (j(!1), F.current?.focus());
1257
1255
  };
1258
1256
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
1259
1257
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
1260
1258
  };
1261
- }, [M]);
1262
- let G = (t, n) => {
1263
- let r = oe(e, t, n);
1264
- r !== -1 && (z.current[r]?.focus(), z.current[r]?.scrollIntoView({ block: "nearest" }));
1265
- }, te = (t) => {
1259
+ }, [k]);
1260
+ let U = (t, n) => {
1261
+ let r = ce(e, t, n);
1262
+ r !== -1 && (L.current[r]?.focus(), L.current[r]?.scrollIntoView({ block: "nearest" }));
1263
+ }, re = (t) => {
1266
1264
  if (t.disabled) return;
1267
1265
  let n = r.includes(t.value) ? r.filter((e) => e !== t.value) : [...r, t.value];
1268
- i?.(n, e.filter((e) => n.includes(e.value))), w && (N(!1), L.current?.focus());
1269
- }, K = M ? /* @__PURE__ */ t("ul", {
1270
- ref: R,
1271
- id: j,
1272
- className: Y.menu,
1266
+ i?.(n, e.filter((e) => n.includes(e.value))), ee && (j(!1), F.current?.focus());
1267
+ }, W = k ? /* @__PURE__ */ t("ul", {
1268
+ ref: I,
1269
+ id: O,
1270
+ className: J.menu,
1273
1271
  role: "listbox",
1274
1272
  "aria-label": g,
1275
1273
  "aria-multiselectable": "true",
1276
- style: P ? {
1274
+ style: M ? {
1277
1275
  position: "fixed",
1278
- top: P.top,
1279
- left: P.left,
1280
- width: P.width,
1281
- maxHeight: P.maxHeight
1276
+ top: M.top,
1277
+ left: M.left,
1278
+ width: M.width,
1279
+ maxHeight: M.maxHeight
1282
1280
  } : {
1283
1281
  position: "fixed",
1284
1282
  top: 0,
@@ -1292,32 +1290,32 @@ var T = {
1292
1290
  role: "presentation",
1293
1291
  children: /* @__PURE__ */ n("button", {
1294
1292
  ref: (e) => {
1295
- z.current[a] = e;
1293
+ L.current[a] = e;
1296
1294
  },
1297
1295
  type: "button",
1298
1296
  role: "option",
1299
1297
  "aria-selected": o,
1300
1298
  disabled: i.disabled,
1301
1299
  className: [
1302
- Y[v],
1303
- Y.option,
1304
- o ? Y.selected : ""
1300
+ J[v],
1301
+ J.option,
1302
+ o ? J.selected : ""
1305
1303
  ].filter(Boolean).join(" "),
1306
- onClick: () => te(i),
1304
+ onClick: () => re(i),
1307
1305
  onKeyDown: (t) => {
1308
1306
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
1309
1307
  t.preventDefault();
1310
1308
  let e = t.key === "ArrowDown" ? 1 : -1;
1311
- G(a + e, e);
1309
+ U(a + e, e);
1312
1310
  }
1313
1311
  if (t.key === "Home" || t.key === "End") {
1314
1312
  t.preventDefault();
1315
1313
  let n = t.key === "Home" ? 1 : -1;
1316
- G(t.key === "Home" ? 0 : e.length - 1, n);
1314
+ U(t.key === "Home" ? 0 : e.length - 1, n);
1317
1315
  }
1318
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), te(i)), t.key === "Tab" && N(!1);
1316
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), re(i)), t.key === "Tab" && j(!1);
1319
1317
  },
1320
- children: [/* @__PURE__ */ t("span", { children: i.label }), o && T && /* @__PURE__ */ t(A, {
1318
+ children: [/* @__PURE__ */ t("span", { children: i.label }), o && w && /* @__PURE__ */ t(A, {
1321
1319
  name: "IconCheck",
1322
1320
  width: 16,
1323
1321
  height: 16
@@ -1327,51 +1325,51 @@ var T = {
1327
1325
  })
1328
1326
  }) : null;
1329
1327
  return /* @__PURE__ */ n("div", {
1330
- ref: I,
1328
+ ref: P,
1331
1329
  className: [
1332
- Y.wrapper,
1333
- _ ? Y.errorState : "",
1330
+ J.wrapper,
1331
+ _ ? J.errorState : "",
1334
1332
  x
1335
1333
  ].filter(Boolean).join(" "),
1336
1334
  children: [
1337
- g && /* @__PURE__ */ t(E, {
1338
- htmlFor: U ? void 0 : k,
1335
+ g && /* @__PURE__ */ t(te, {
1336
+ htmlFor: V ? void 0 : D,
1339
1337
  required: y,
1340
- disabled: m,
1338
+ disabled: o,
1341
1339
  children: g
1342
1340
  }),
1343
1341
  /* @__PURE__ */ t("div", {
1344
- className: Y.container,
1345
- children: U ? /* @__PURE__ */ t("div", {
1346
- id: k,
1347
- className: `${Y.disabledText} ${Y[v]}`,
1348
- "aria-describedby": ee,
1349
- children: B || a
1342
+ className: J.container,
1343
+ children: V ? /* @__PURE__ */ t("div", {
1344
+ id: D,
1345
+ className: `${J.disabledText} ${J[v]}`,
1346
+ "aria-describedby": ne,
1347
+ children: R || a
1350
1348
  }) : /* @__PURE__ */ n("button", {
1351
- ref: L,
1352
- id: k,
1349
+ ref: F,
1350
+ id: D,
1353
1351
  type: "button",
1354
1352
  name: S,
1355
- className: `${Y.trigger} ${Y[v]}`,
1356
- disabled: m,
1353
+ className: `${J.trigger} ${J[v]}`,
1354
+ disabled: o,
1357
1355
  "aria-haspopup": "listbox",
1358
- "aria-expanded": M,
1359
- "aria-controls": j,
1360
- "aria-describedby": ee,
1356
+ "aria-expanded": k,
1357
+ "aria-controls": O,
1358
+ "aria-describedby": ne,
1361
1359
  "aria-invalid": !!_,
1362
- onClick: () => N((e) => !e),
1360
+ onClick: () => j((e) => !e),
1363
1361
  onKeyDown: (t) => {
1364
1362
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
1365
- t.preventDefault(), N(!0);
1363
+ t.preventDefault(), j(!0);
1366
1364
  let n = t.key === "ArrowDown" ? 1 : -1;
1367
- requestAnimationFrame(() => G(t.key === "ArrowDown" ? 0 : e.length - 1, n));
1365
+ requestAnimationFrame(() => U(t.key === "ArrowDown" ? 0 : e.length - 1, n));
1368
1366
  }
1369
1367
  },
1370
1368
  children: [/* @__PURE__ */ t("span", {
1371
- className: `${B ? Y.value : Y.placeholder} ${Y[v]}`,
1372
- children: B || a
1369
+ className: `${R ? J.value : J.placeholder} ${J[v]}`,
1370
+ children: R || a
1373
1371
  }), /* @__PURE__ */ t("span", {
1374
- className: [Y.chevron, M ? Y.chevronOpen : ""].filter(Boolean).join(" "),
1372
+ className: [J.chevron, k ? J.chevronOpen : ""].filter(Boolean).join(" "),
1375
1373
  "aria-hidden": "true",
1376
1374
  children: /* @__PURE__ */ t(A, {
1377
1375
  name: "IconChevron",
@@ -1381,20 +1379,20 @@ var T = {
1381
1379
  })]
1382
1380
  })
1383
1381
  }),
1384
- M && p(K, document.body),
1382
+ k && h(W, document.body),
1385
1383
  b && !_ && /* @__PURE__ */ t("span", {
1386
- id: V,
1387
- className: Y.message,
1384
+ id: z,
1385
+ className: J.message,
1388
1386
  children: b
1389
1387
  }),
1390
1388
  _ && /* @__PURE__ */ t("span", {
1391
- id: H,
1392
- className: Y.error,
1389
+ id: B,
1390
+ className: J.error,
1393
1391
  children: _
1394
1392
  })
1395
1393
  ]
1396
1394
  });
1397
- }, Oe = {
1395
+ }, Ae = {
1398
1396
  wrapper: "_wrapper_yuep3_1",
1399
1397
  control: "_control_yuep3_3",
1400
1398
  input: "_input_yuep3_7",
@@ -1404,40 +1402,40 @@ var T = {
1404
1402
  lg: "_lg_yuep3_69",
1405
1403
  inputError: "_inputError_yuep3_81",
1406
1404
  trailingAction: "_trailingAction_yuep3_83"
1407
- }, ke = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: p, error: m, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: w = "Скрыть пароль", passwordHiddenLabel: T = "Показать пароль", onFocus: O, ...k }) => {
1408
- let j = c(), M = v ?? `ds-input-${_ ?? j}`, N = d(null), [P, F] = f(!1), I = h ? `${M}-hint` : void 0, L = m ? `${M}-error` : void 0, R = String(e ?? ""), z = [I, L].filter(Boolean).join(" ") || void 0, B = C ? P ? "text" : "password" : i;
1409
- return s(() => {
1410
- C || F(!1);
1405
+ }, je = ({ value: e, onChange: r, type: i = "text", placeholder: a = "", disabled: o = !1, readOnly: s = !1, stringWhileDisabled: c = !1, label: d, error: f, hint: h, className: g = "", name: _, id: v, size: y = "md", clearable: b = !0, required: x = !1, selectTextOnFocus: S = !1, isPassword: C = !1, passwordVisibleLabel: ee = "Скрыть пароль", passwordHiddenLabel: w = "Показать пароль", onFocus: T, ...E }) => {
1406
+ let O = u(), k = v ?? `ds-input-${_ ?? O}`, j = p(null), [M, N] = m(!1), P = h ? `${k}-hint` : void 0, F = f ? `${k}-error` : void 0, I = String(e ?? ""), L = [P, F].filter(Boolean).join(" ") || void 0, R = C ? M ? "text" : "password" : i;
1407
+ return l(() => {
1408
+ C || N(!1);
1411
1409
  }, [C]), /* @__PURE__ */ n("div", {
1412
- className: `${Oe.wrapper} ${g}`,
1410
+ className: `${Ae.wrapper} ${g}`,
1413
1411
  children: [
1414
- p && /* @__PURE__ */ t(E, {
1415
- htmlFor: M,
1412
+ d && /* @__PURE__ */ t(te, {
1413
+ htmlFor: k,
1416
1414
  required: x,
1417
1415
  disabled: o,
1418
- children: p
1416
+ children: d
1419
1417
  }),
1420
- o && u ? /* @__PURE__ */ t("div", {
1421
- id: M,
1422
- className: Oe.disabledText,
1423
- "aria-describedby": z,
1424
- children: R || a
1418
+ o && c ? /* @__PURE__ */ t("div", {
1419
+ id: k,
1420
+ className: Ae.disabledText,
1421
+ "aria-describedby": L,
1422
+ children: I || a
1425
1423
  }) : /* @__PURE__ */ n("div", {
1426
- className: Oe.control,
1424
+ className: Ae.control,
1427
1425
  children: [
1428
1426
  /* @__PURE__ */ t("input", {
1429
- ref: N,
1430
- id: M,
1427
+ ref: j,
1428
+ id: k,
1431
1429
  name: _,
1432
- type: B,
1433
- value: R,
1430
+ type: R,
1431
+ value: I,
1434
1432
  placeholder: a,
1435
1433
  disabled: o,
1436
- readOnly: l,
1434
+ readOnly: s,
1437
1435
  required: x,
1438
- "aria-invalid": !!m,
1439
- "aria-describedby": z,
1440
- className: `${Oe.input} ${Oe[y]} ${m ? Oe.inputError : ""}`,
1436
+ "aria-invalid": !!f,
1437
+ "aria-describedby": L,
1438
+ className: `${Ae.input} ${Ae[y]} ${f ? Ae.inputError : ""}`,
1441
1439
  onChange: (e) => {
1442
1440
  if (i === "number" && !C) {
1443
1441
  let t = e.target.value === "" ? "" : Number(e.target.value);
@@ -1447,29 +1445,29 @@ var T = {
1447
1445
  r?.(e.target.value, e);
1448
1446
  },
1449
1447
  onFocus: (e) => {
1450
- S && e.currentTarget.value && e.currentTarget.select(), O?.(e);
1448
+ S && e.currentTarget.value && e.currentTarget.select(), T?.(e);
1451
1449
  },
1452
- ...k
1450
+ ...E
1453
1451
  }),
1454
1452
  C && /* @__PURE__ */ t("button", {
1455
1453
  type: "button",
1456
- className: Oe.trailingAction,
1454
+ className: Ae.trailingAction,
1457
1455
  disabled: o,
1458
- "aria-label": P ? w : T,
1459
- "aria-pressed": P,
1460
- onClick: () => F((e) => !e),
1456
+ "aria-label": M ? ee : w,
1457
+ "aria-pressed": M,
1458
+ onClick: () => N((e) => !e),
1461
1459
  children: /* @__PURE__ */ t(A, {
1462
- name: P ? "IconEyeOff" : "IconEye",
1460
+ name: M ? "IconEyeOff" : "IconEye",
1463
1461
  width: 20,
1464
1462
  height: 20
1465
1463
  })
1466
1464
  }),
1467
- !C && b && R && !o && !l && /* @__PURE__ */ t("button", {
1465
+ !C && b && I && !o && !s && /* @__PURE__ */ t("button", {
1468
1466
  type: "button",
1469
- className: Oe.trailingAction,
1467
+ className: Ae.trailingAction,
1470
1468
  "aria-label": "Очистить поле",
1471
1469
  onClick: () => {
1472
- let e = N.current;
1470
+ let e = j.current;
1473
1471
  e && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
1474
1472
  },
1475
1473
  children: /* @__PURE__ */ t(A, {
@@ -1480,21 +1478,21 @@ var T = {
1480
1478
  })
1481
1479
  ]
1482
1480
  }),
1483
- h && !m && /* @__PURE__ */ t(D, {
1484
- id: I,
1481
+ h && !f && /* @__PURE__ */ t(D, {
1482
+ id: P,
1485
1483
  children: h
1486
1484
  }),
1487
- m && /* @__PURE__ */ t(D, {
1488
- id: L,
1485
+ f && /* @__PURE__ */ t(D, {
1486
+ id: F,
1489
1487
  variant: "error",
1490
- children: m
1488
+ children: f
1491
1489
  })
1492
1490
  ]
1493
1491
  });
1494
- }, Ae = (e, t) => {
1492
+ }, Me = (e, t) => {
1495
1493
  let n = t.trim().toLocaleLowerCase();
1496
1494
  return n ? e.filter((e) => e.label.toLocaleLowerCase().includes(n) || e.value.toLocaleLowerCase().includes(n)) : e;
1497
- }, je = (e, t, n) => {
1495
+ }, Ne = (e, t, n) => {
1498
1496
  if (!e.length) return -1;
1499
1497
  for (let r = 0; r < e.length; r += 1) {
1500
1498
  let i = (t + r * n + e.length) % e.length;
@@ -1518,83 +1516,83 @@ var T = {
1518
1516
  selected: "_selected_1uxs8_205",
1519
1517
  active: "_active_1uxs8_205",
1520
1518
  visuallyHidden: "_visuallyHidden_1uxs8_217"
1521
- }, Me = 8, Ne = 6, Pe = 5, Fe = {
1519
+ }, Pe = 8, Fe = 6, Ie = 5, Le = {
1522
1520
  sm: 20,
1523
1521
  md: 30,
1524
1522
  lg: 40
1525
- }, Ie = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: m = "Ничего не найдено", disabled: h = !1, readOnly: g = !1, stringWhileDisabled: _ = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: w, id: T, needMark: O = !0 }) => {
1526
- let k = c(), j = T ?? `ds-search-dropdown-${w ?? k}`, M = `${j}-listbox`, N = `${j}-status`, P = b ? `${j}-hint` : void 0, F = y ? `${j}-error` : void 0, I = [
1527
- N,
1528
- P,
1529
- F
1530
- ].filter(Boolean).join(" "), L = d(null), R = d(null), z = d([]), [B, V] = f(!1), [H, ee] = f(""), [U, W] = f(-1), [G, te] = f(null), K = u(() => e.find((e) => e.value === r), [e, r]), q = u(() => Ae(e, H), [e, H]), J = h && _, ne = U >= 0 ? q[U] : void 0;
1531
- s(() => ee(K?.label ?? ""), [K?.label, r]);
1532
- let Y = o(() => L.current?.querySelector("input") ?? null, []), re = o((e, t) => je(q, e, t), [q]), ie = o((e) => {
1533
- W(e), !(e < 0) && requestAnimationFrame(() => z.current[e]?.scrollIntoView({ block: "nearest" }));
1534
- }, []), ae = o(() => {
1535
- let e = Y();
1523
+ }, Re = ({ options: e, value: r, onChange: i, placeholder: a = "Начните вводить", noResultsText: o = "Ничего не найдено", disabled: c = !1, readOnly: g = !1, stringWhileDisabled: _ = !1, label: v, error: y, hint: b, size: x = "md", required: S = !1, className: C = "", name: ee, id: w, needMark: T = !0 }) => {
1524
+ let E = u(), O = w ?? `ds-search-dropdown-${ee ?? E}`, k = `${O}-listbox`, j = `${O}-status`, M = b ? `${O}-hint` : void 0, N = y ? `${O}-error` : void 0, P = [
1525
+ j,
1526
+ M,
1527
+ N
1528
+ ].filter(Boolean).join(" "), F = p(null), I = p(null), L = p([]), [R, z] = m(!1), [B, ne] = m(""), [V, H] = m(-1), [U, re] = m(null), W = f(() => e.find((e) => e.value === r), [e, r]), G = f(() => Me(e, B), [e, B]), K = c && _, ie = V >= 0 ? G[V] : void 0;
1529
+ l(() => ne(W?.label ?? ""), [W?.label, r]);
1530
+ let q = s(() => F.current?.querySelector("input") ?? null, []), ae = s((e, t) => Ne(G, e, t), [G]), J = s((e) => {
1531
+ H(e), !(e < 0) && requestAnimationFrame(() => L.current[e]?.scrollIntoView({ block: "nearest" }));
1532
+ }, []), Y = s(() => {
1533
+ let e = q();
1536
1534
  if (!e) return;
1537
- let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(q.length, Pe)) * Fe[x] + 2, r = window.innerHeight - t.bottom - Me, i = t.top - Me, a = r < n && i > r, o = a ? i : r, s = Math.max(Fe[x] + 2, Math.min(n, o)), c = window.innerWidth - t.width - Me, l = Math.max(Me, Math.min(t.left, c)), u = a ? Math.max(Me, t.top - s - Ne) : t.bottom + Ne;
1538
- te({
1535
+ let t = e.getBoundingClientRect(), n = Math.max(1, Math.min(G.length, Ie)) * Le[x] + 2, r = window.innerHeight - t.bottom - Pe, i = t.top - Pe, a = r < n && i > r, o = a ? i : r, s = Math.max(Le[x] + 2, Math.min(n, o)), c = window.innerWidth - t.width - Pe, l = Math.max(Pe, Math.min(t.left, c)), u = a ? Math.max(Pe, t.top - s - Fe) : t.bottom + Fe;
1536
+ re({
1539
1537
  top: u,
1540
1538
  left: l,
1541
1539
  width: t.width,
1542
1540
  maxHeight: s
1543
1541
  });
1544
1542
  }, [
1545
- q.length,
1546
- Y,
1543
+ G.length,
1544
+ q,
1547
1545
  x
1548
1546
  ]);
1549
- l(() => {
1550
- if (!B) {
1551
- te(null);
1547
+ d(() => {
1548
+ if (!R) {
1549
+ re(null);
1552
1550
  return;
1553
1551
  }
1554
- return ae(), window.addEventListener("resize", ae), window.addEventListener("scroll", ae, !0), () => {
1555
- window.removeEventListener("resize", ae), window.removeEventListener("scroll", ae, !0);
1552
+ return Y(), window.addEventListener("resize", Y), window.addEventListener("scroll", Y, !0), () => {
1553
+ window.removeEventListener("resize", Y), window.removeEventListener("scroll", Y, !0);
1556
1554
  };
1557
- }, [B, ae]), s(() => {
1558
- if (!B) return;
1555
+ }, [R, Y]), l(() => {
1556
+ if (!R) return;
1559
1557
  let e = (e) => {
1560
1558
  let t = e.target;
1561
- !L.current?.contains(t) && !R.current?.contains(t) && (V(!1), W(-1));
1559
+ !F.current?.contains(t) && !I.current?.contains(t) && (z(!1), H(-1));
1562
1560
  };
1563
1561
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
1564
- }, [B]);
1562
+ }, [R]);
1565
1563
  let oe = () => {
1566
- h || g || (V(!0), W(re(0, 1)));
1564
+ c || g || (z(!0), H(ae(0, 1)));
1567
1565
  }, se = (e) => {
1568
- e.disabled || (ee(e.label), V(!1), W(-1), i?.(e.value, e), Y()?.focus());
1569
- }, ce = B ? /* @__PURE__ */ t("ul", {
1570
- ref: R,
1571
- id: M,
1566
+ e.disabled || (ne(e.label), z(!1), H(-1), i?.(e.value, e), q()?.focus());
1567
+ }, ce = R ? /* @__PURE__ */ t("ul", {
1568
+ ref: I,
1569
+ id: k,
1572
1570
  className: Z.menu,
1573
1571
  role: "listbox",
1574
1572
  "aria-label": v,
1575
- style: G ? {
1576
- top: G.top,
1577
- left: G.left,
1578
- width: G.width,
1579
- maxHeight: G.maxHeight
1573
+ style: U ? {
1574
+ top: U.top,
1575
+ left: U.left,
1576
+ width: U.width,
1577
+ maxHeight: U.maxHeight
1580
1578
  } : {
1581
1579
  top: 0,
1582
1580
  left: 0,
1583
1581
  visibility: "hidden",
1584
1582
  maxHeight: 0
1585
1583
  },
1586
- children: q.length === 0 ? /* @__PURE__ */ t("li", {
1584
+ children: G.length === 0 ? /* @__PURE__ */ t("li", {
1587
1585
  className: `${Z.empty} ${Z[x]}`,
1588
- children: m
1589
- }) : q.map((e, i) => {
1590
- let a = e.value === r, o = i === U;
1586
+ children: o
1587
+ }) : G.map((e, i) => {
1588
+ let a = e.value === r, o = i === V;
1591
1589
  return /* @__PURE__ */ t("li", {
1592
1590
  role: "presentation",
1593
1591
  children: /* @__PURE__ */ n("button", {
1594
1592
  ref: (e) => {
1595
- z.current[i] = e;
1593
+ L.current[i] = e;
1596
1594
  },
1597
- id: `${j}-option-${i}`,
1595
+ id: `${O}-option-${i}`,
1598
1596
  type: "button",
1599
1597
  role: "option",
1600
1598
  tabIndex: -1,
@@ -1608,10 +1606,10 @@ var T = {
1608
1606
  o ? Z.active : ""
1609
1607
  ].filter(Boolean).join(" "),
1610
1608
  onPointerMove: () => {
1611
- e.disabled || W(i);
1609
+ e.disabled || H(i);
1612
1610
  },
1613
1611
  onClick: () => se(e),
1614
- children: [/* @__PURE__ */ t("span", { children: e.label }), a && O && /* @__PURE__ */ t(A, {
1612
+ children: [/* @__PURE__ */ t("span", { children: e.label }), a && T && /* @__PURE__ */ t(A, {
1615
1613
  name: "IconCheck",
1616
1614
  width: 16,
1617
1615
  height: 16
@@ -1621,30 +1619,30 @@ var T = {
1621
1619
  })
1622
1620
  }) : null;
1623
1621
  return /* @__PURE__ */ n("div", {
1624
- ref: L,
1622
+ ref: F,
1625
1623
  className: [
1626
1624
  Z.wrapper,
1627
1625
  y ? Z.errorState : "",
1628
1626
  C
1629
1627
  ].filter(Boolean).join(" "),
1630
1628
  children: [
1631
- v && /* @__PURE__ */ t(E, {
1632
- htmlFor: J ? void 0 : j,
1629
+ v && /* @__PURE__ */ t(te, {
1630
+ htmlFor: K ? void 0 : O,
1633
1631
  required: S,
1634
- disabled: h,
1632
+ disabled: c,
1635
1633
  children: v
1636
1634
  }),
1637
- J ? /* @__PURE__ */ t("div", {
1635
+ K ? /* @__PURE__ */ t("div", {
1638
1636
  className: `${Z.disabledText} ${Z[x]}`,
1639
- children: K?.label ?? a
1637
+ children: W?.label ?? a
1640
1638
  }) : /* @__PURE__ */ n("div", {
1641
1639
  className: Z.control,
1642
- children: [/* @__PURE__ */ t(ke, {
1643
- id: j,
1644
- name: w,
1645
- value: H,
1640
+ children: [/* @__PURE__ */ t(je, {
1641
+ id: O,
1642
+ name: ee,
1643
+ value: B,
1646
1644
  placeholder: a,
1647
- disabled: h,
1645
+ disabled: c,
1648
1646
  readOnly: g,
1649
1647
  required: S,
1650
1648
  size: x,
@@ -1653,33 +1651,33 @@ var T = {
1653
1651
  className: `${Z.inputHost} ${Z[x]}`,
1654
1652
  onFocus: oe,
1655
1653
  onChange: (t) => {
1656
- let n = String(t), r = Ae(e, n);
1657
- ee(n), V(!0), W(je(r, 0, 1));
1654
+ let n = String(t), r = Me(e, n);
1655
+ ne(n), z(!0), H(Ne(r, 0, 1));
1658
1656
  },
1659
1657
  role: "combobox",
1660
1658
  "aria-autocomplete": "list",
1661
- "aria-expanded": B,
1662
- "aria-controls": M,
1663
- "aria-activedescendant": ne ? `${j}-option-${U}` : void 0,
1659
+ "aria-expanded": R,
1660
+ "aria-controls": k,
1661
+ "aria-activedescendant": ie ? `${O}-option-${V}` : void 0,
1664
1662
  "aria-invalid": !!y,
1665
- "aria-describedby": I,
1663
+ "aria-describedby": P,
1666
1664
  onClick: oe,
1667
1665
  onKeyDown: (e) => {
1668
- if (!(h || g)) {
1666
+ if (!(c || g)) {
1669
1667
  if (e.key === "ArrowDown" || e.key === "ArrowUp") {
1670
1668
  e.preventDefault();
1671
- let t = e.key === "ArrowDown" ? 1 : -1, n = U >= 0 ? U + t : t === 1 ? 0 : q.length - 1;
1672
- V(!0), ie(re(n, t));
1669
+ let t = e.key === "ArrowDown" ? 1 : -1, n = V >= 0 ? V + t : t === 1 ? 0 : G.length - 1;
1670
+ z(!0), J(ae(n, t));
1673
1671
  } else if (e.key === "Home" || e.key === "End") {
1674
- if (!B) return;
1672
+ if (!R) return;
1675
1673
  e.preventDefault();
1676
1674
  let t = e.key === "Home" ? 1 : -1;
1677
- ie(re(e.key === "Home" ? 0 : q.length - 1, t));
1678
- } else e.key === "Enter" && B && ne ? (e.preventDefault(), se(ne)) : e.key === "Escape" && B ? (e.preventDefault(), V(!1), W(-1)) : e.key === "Tab" && (V(!1), W(-1));
1675
+ J(ae(e.key === "Home" ? 0 : G.length - 1, t));
1676
+ } else e.key === "Enter" && R && ie ? (e.preventDefault(), se(ie)) : e.key === "Escape" && R ? (e.preventDefault(), z(!1), H(-1)) : e.key === "Tab" && (z(!1), H(-1));
1679
1677
  }
1680
1678
  }
1681
1679
  }), /* @__PURE__ */ t("span", {
1682
- className: `${Z.chevron} ${B ? Z.chevronOpen : ""}`,
1680
+ className: `${Z.chevron} ${R ? Z.chevronOpen : ""}`,
1683
1681
  "aria-hidden": "true",
1684
1682
  children: /* @__PURE__ */ t(A, {
1685
1683
  name: "IconChevron",
@@ -1688,43 +1686,43 @@ var T = {
1688
1686
  })
1689
1687
  })]
1690
1688
  }),
1691
- B && typeof document < "u" && p(ce, document.body),
1689
+ R && typeof document < "u" && h(ce, document.body),
1692
1690
  /* @__PURE__ */ n("span", {
1693
- id: N,
1691
+ id: j,
1694
1692
  className: Z.visuallyHidden,
1695
1693
  "aria-live": "polite",
1696
- children: ["Найдено вариантов: ", q.length]
1694
+ children: ["Найдено вариантов: ", G.length]
1697
1695
  }),
1698
1696
  b && !y && /* @__PURE__ */ t(D, {
1699
- id: P,
1697
+ id: M,
1700
1698
  children: b
1701
1699
  }),
1702
1700
  y && /* @__PURE__ */ t(D, {
1703
- id: F,
1701
+ id: N,
1704
1702
  variant: "error",
1705
1703
  children: y
1706
1704
  })
1707
1705
  ]
1708
1706
  });
1709
- }, Le = {
1707
+ }, ze = {
1710
1708
  root: "_root_1gjqg_1",
1711
1709
  header: "_header_1gjqg_21",
1712
1710
  title: "_title_1gjqg_41",
1713
1711
  dismiss: "_dismiss_1gjqg_55",
1714
1712
  content: "_content_1gjqg_65"
1715
- }, Re = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: l = "" }) => {
1716
- let u = `ds-info-block-${c()}`;
1713
+ }, Be = ({ title: e, children: r, dismissible: i = !1, onDismiss: a, dismissLabel: o = "Закрыть информационный блок", headingAs: s = "h3", className: c = "" }) => {
1714
+ let l = `ds-info-block-${u()}`;
1717
1715
  return /* @__PURE__ */ n("section", {
1718
- className: `${Le.root} ${l}`,
1719
- "aria-labelledby": u,
1716
+ className: `${ze.root} ${c}`,
1717
+ "aria-labelledby": l,
1720
1718
  children: [/* @__PURE__ */ n("header", {
1721
- className: Le.header,
1719
+ className: ze.header,
1722
1720
  children: [/* @__PURE__ */ t(s, {
1723
- id: u,
1724
- className: Le.title,
1721
+ id: l,
1722
+ className: ze.title,
1725
1723
  children: e
1726
- }), i && /* @__PURE__ */ t(w, {
1727
- className: Le.dismiss,
1724
+ }), i && /* @__PURE__ */ t(T, {
1725
+ className: ze.dismiss,
1728
1726
  variant: "empty",
1729
1727
  onClick: a,
1730
1728
  "aria-label": o,
@@ -1735,29 +1733,29 @@ var T = {
1735
1733
  })
1736
1734
  })]
1737
1735
  }), /* @__PURE__ */ t("div", {
1738
- className: Le.content,
1736
+ className: ze.content,
1739
1737
  children: r
1740
1738
  })]
1741
1739
  });
1742
- }, ze = {
1740
+ }, Ve = {
1743
1741
  wrapper: "_wrapper_ecmvo_1",
1744
1742
  input: "_input_ecmvo_21",
1745
1743
  switch: "_switch_ecmvo_35",
1746
1744
  thumb: "_thumb_ecmvo_67",
1747
1745
  label: "_label_ecmvo_113",
1748
1746
  disabled: "_disabled_ecmvo_125"
1749
- }, Be = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: l, id: u, value: d }) => {
1750
- let f = c(), p = u ?? `ds-radio-button-${l ?? f}`;
1747
+ }, He = ({ checked: e, onChange: r, label: i, disabled: a = !1, readOnly: o = !1, className: s = "", name: c, id: l, value: d }) => {
1748
+ let f = u(), p = l ?? `ds-radio-button-${c ?? f}`;
1751
1749
  return /* @__PURE__ */ n("label", {
1752
1750
  htmlFor: p,
1753
- className: `${ze.wrapper} ${a ? ze.disabled : ""} ${s}`,
1751
+ className: `${Ve.wrapper} ${a ? Ve.disabled : ""} ${s}`,
1754
1752
  children: [
1755
1753
  /* @__PURE__ */ t("input", {
1756
1754
  id: p,
1757
- className: ze.input,
1755
+ className: Ve.input,
1758
1756
  type: "checkbox",
1759
1757
  role: "switch",
1760
- name: l,
1758
+ name: c,
1761
1759
  value: d,
1762
1760
  checked: e,
1763
1761
  disabled: a,
@@ -1767,21 +1765,21 @@ var T = {
1767
1765
  }
1768
1766
  }),
1769
1767
  /* @__PURE__ */ t("span", {
1770
- className: ze.switch,
1768
+ className: Ve.switch,
1771
1769
  "aria-hidden": "true",
1772
- children: /* @__PURE__ */ t("span", { className: ze.thumb })
1770
+ children: /* @__PURE__ */ t("span", { className: Ve.thumb })
1773
1771
  }),
1774
1772
  i && /* @__PURE__ */ t("span", {
1775
- className: ze.label,
1773
+ className: Ve.label,
1776
1774
  children: i
1777
1775
  })
1778
1776
  ]
1779
1777
  });
1780
- }, Ve = {
1778
+ }, Ue = {
1781
1779
  root: "_root_13nj5_1",
1782
1780
  grid: "_grid_13nj5_3",
1783
1781
  actions: "_actions_13nj5_5"
1784
- }, He = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
1782
+ }, We = ({ filters: e, values: r, onChange: i, onApply: a, onReset: o, applyMode: s = "instant", loading: c = !1, disabled: l = !1, className: u = "" }) => {
1785
1783
  let d = (e, t) => {
1786
1784
  let n = {
1787
1785
  ...r,
@@ -1790,11 +1788,11 @@ var T = {
1790
1788
  i?.(n, e), s === "instant" && a?.(n);
1791
1789
  };
1792
1790
  return /* @__PURE__ */ n("section", {
1793
- className: `${Ve.root} ${u}`,
1791
+ className: `${Ue.root} ${u}`,
1794
1792
  "aria-label": "Фильтры",
1795
1793
  "aria-busy": c,
1796
1794
  children: [/* @__PURE__ */ t("div", {
1797
- className: Ve.grid,
1795
+ className: Ue.grid,
1798
1796
  children: e.filter((e) => !e.hidden).map((e) => {
1799
1797
  let n = l || c || e.disabled, i = r[e.id];
1800
1798
  if (e.type === "input") {
@@ -1804,19 +1802,19 @@ var T = {
1804
1802
  placeholder: e.placeholder,
1805
1803
  disabled: n
1806
1804
  };
1807
- return e.inputType === "number" ? /* @__PURE__ */ t(ke, {
1805
+ return e.inputType === "number" ? /* @__PURE__ */ t(je, {
1808
1806
  ...r,
1809
1807
  type: "number",
1810
1808
  value: i ?? "",
1811
1809
  onChange: (t) => d(e.id, t)
1812
- }, e.id) : /* @__PURE__ */ t(ke, {
1810
+ }, e.id) : /* @__PURE__ */ t(je, {
1813
1811
  ...r,
1814
1812
  type: "text",
1815
1813
  value: String(i ?? ""),
1816
1814
  onChange: (t) => d(e.id, t)
1817
1815
  }, e.id);
1818
1816
  }
1819
- if (e.type === "dropdown") return /* @__PURE__ */ t(ce, {
1817
+ if (e.type === "dropdown") return /* @__PURE__ */ t(ue, {
1820
1818
  size: "lg",
1821
1819
  label: e.label,
1822
1820
  hint: e.hint,
@@ -1826,7 +1824,7 @@ var T = {
1826
1824
  disabled: n,
1827
1825
  onChange: (t) => d(e.id, t)
1828
1826
  }, e.id);
1829
- if (e.type === "multiple") return /* @__PURE__ */ t(De, {
1827
+ if (e.type === "multiple") return /* @__PURE__ */ t(ke, {
1830
1828
  size: "lg",
1831
1829
  label: e.label,
1832
1830
  hint: e.hint,
@@ -1843,7 +1841,7 @@ var T = {
1843
1841
  disabled: n,
1844
1842
  onChange: (t) => d(e.id, t)
1845
1843
  }, e.id);
1846
- if (e.type === "radio") return /* @__PURE__ */ t(Be, {
1844
+ if (e.type === "radio") return /* @__PURE__ */ t(He, {
1847
1845
  label: e.label,
1848
1846
  checked: !!i,
1849
1847
  disabled: n,
@@ -1853,7 +1851,7 @@ var T = {
1853
1851
  from: null,
1854
1852
  to: null
1855
1853
  };
1856
- return /* @__PURE__ */ t(q, {
1854
+ return /* @__PURE__ */ t(ie, {
1857
1855
  hint: e.hint,
1858
1856
  mode: e.mode,
1859
1857
  min: e.min,
@@ -1864,13 +1862,13 @@ var T = {
1864
1862
  }, e.id);
1865
1863
  })
1866
1864
  }), (o || s === "manual") && /* @__PURE__ */ n("div", {
1867
- className: Ve.actions,
1868
- children: [o && /* @__PURE__ */ t(w, {
1865
+ className: Ue.actions,
1866
+ children: [o && /* @__PURE__ */ t(T, {
1869
1867
  variant: "destructiveOutline",
1870
1868
  disabled: l || c,
1871
1869
  onClick: o,
1872
1870
  children: "Сбросить"
1873
- }), s === "manual" && /* @__PURE__ */ t(w, {
1871
+ }), s === "manual" && /* @__PURE__ */ t(T, {
1874
1872
  isLoading: c,
1875
1873
  disabled: l,
1876
1874
  onClick: () => a?.(r),
@@ -1878,7 +1876,7 @@ var T = {
1878
1876
  })]
1879
1877
  })]
1880
1878
  });
1881
- }, Ue = {
1879
+ }, Ge = {
1882
1880
  wrapper: "_wrapper_8w6xl_1",
1883
1881
  dropzone: "_dropzone_8w6xl_3",
1884
1882
  dragActive: "_dragActive_8w6xl_5",
@@ -1891,71 +1889,71 @@ var T = {
1891
1889
  file: "_file_8w6xl_17",
1892
1890
  fileName: "_fileName_8w6xl_21",
1893
1891
  fileSize: "_fileSize_8w6xl_23"
1894
- }, We = (e) => `${e.name}:${e.size}:${e.lastModified}`, Ge = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Ke = (e, t) => !t || t.split(",").map((e) => e.trim().toLowerCase()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t), qe = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: l, label: u, hint: p, error: m, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: T }) => {
1895
- let O = c(), k = y ?? `ds-file-input-${v ?? O}`, j = d(null), M = d(0), [N, P] = f(!1), F = p ? `${k}-hint` : void 0, I = m ? `${k}-error` : void 0, L = [F, I].filter(Boolean).join(" ") || void 0, R = !g && !_, z = (e) => {
1896
- let t = [], n = new Set(r.map(We)), c = e.filter((e) => Ke(e, o) ? s !== void 0 && e.size > s ? (t.push({
1892
+ }, Ke = (e) => `${e.name}:${e.size}:${e.lastModified}`, qe = (e) => e < 1024 ? `${e} Б` : e < 1048576 ? `${(e / 1024).toFixed(1)} КБ` : `${(e / 1024 / 1024).toFixed(1)} МБ`, Je = (e, t) => !t || t.split(",").map((e) => e.trim().toLowerCase()).some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t), Ye = ({ value: r, onChange: i, multiple: a = !1, accept: o, maxSize: s, maxFiles: c, label: l, hint: d, error: f, required: h = !1, disabled: g = !1, readOnly: _ = !1, name: v, id: y, className: b = "", dropLabel: x = "Перетащите файлы в эту область", browseLabel: S = "Выбрать файлы", addMoreLabel: C = "Добавить ещё", onReject: ee }) => {
1893
+ let w = u(), E = y ?? `ds-file-input-${v ?? w}`, O = p(null), k = p(0), [j, M] = m(!1), N = d ? `${E}-hint` : void 0, P = f ? `${E}-error` : void 0, F = [N, P].filter(Boolean).join(" ") || void 0, I = !g && !_, L = (e) => {
1894
+ let t = [], n = new Set(r.map(Ke)), l = e.filter((e) => Je(e, o) ? s !== void 0 && e.size > s ? (t.push({
1897
1895
  file: e,
1898
1896
  reason: "maxSize"
1899
- }), !1) : !n.has(We(e)) && (n.add(We(e)), !0) : (t.push({
1897
+ }), !1) : !n.has(Ke(e)) && (n.add(Ke(e)), !0) : (t.push({
1900
1898
  file: e,
1901
1899
  reason: "accept"
1902
- }), !1)), u = a ? l : 1, d = a ? [...r, ...c] : c.slice(-1);
1900
+ }), !1)), u = a ? c : 1, d = a ? [...r, ...l] : l.slice(-1);
1903
1901
  u !== void 0 && d.length > u && (d.slice(u).forEach((e) => t.push({
1904
1902
  file: e,
1905
1903
  reason: "maxFiles"
1906
- })), d = d.slice(0, u)), t.length && T?.(t), c.length && i?.(d), j.current && (j.current.value = "");
1904
+ })), d = d.slice(0, u)), t.length && ee?.(t), l.length && i?.(d), O.current && (O.current.value = "");
1907
1905
  };
1908
1906
  return /* @__PURE__ */ n("div", {
1909
- className: `${Ue.wrapper} ${b}`,
1907
+ className: `${Ge.wrapper} ${b}`,
1910
1908
  children: [
1911
- u && /* @__PURE__ */ t(E, {
1912
- htmlFor: k,
1909
+ l && /* @__PURE__ */ t(te, {
1910
+ htmlFor: E,
1913
1911
  required: h,
1914
1912
  disabled: g,
1915
- children: u
1913
+ children: l
1916
1914
  }),
1917
1915
  /* @__PURE__ */ n("div", {
1918
- className: `${Ue.dropzone} ${N ? Ue.dragActive : ""} ${g ? Ue.disabled : ""} ${m ? Ue.error : ""}`,
1916
+ className: `${Ge.dropzone} ${j ? Ge.dragActive : ""} ${g ? Ge.disabled : ""} ${f ? Ge.error : ""}`,
1919
1917
  onDragEnter: (e) => {
1920
- e.preventDefault(), R && ++M.current === 1 && P(!0);
1918
+ e.preventDefault(), I && ++k.current === 1 && M(!0);
1921
1919
  },
1922
1920
  onDragOver: (e) => e.preventDefault(),
1923
1921
  onDragLeave: (e) => {
1924
- e.preventDefault(), --M.current <= 0 && (M.current = 0, P(!1));
1922
+ e.preventDefault(), --k.current <= 0 && (k.current = 0, M(!1));
1925
1923
  },
1926
1924
  onDrop: (e) => {
1927
- e.preventDefault(), M.current = 0, P(!1), R && z(Array.from(e.dataTransfer.files));
1925
+ e.preventDefault(), k.current = 0, M(!1), I && L(Array.from(e.dataTransfer.files));
1928
1926
  },
1929
1927
  children: [/* @__PURE__ */ t("input", {
1930
- ref: j,
1931
- id: k,
1928
+ ref: O,
1929
+ id: E,
1932
1930
  name: v,
1933
- className: Ue.nativeInput,
1931
+ className: Ge.nativeInput,
1934
1932
  type: "file",
1935
1933
  multiple: a,
1936
1934
  accept: o,
1937
1935
  required: h && r.length === 0,
1938
- disabled: !R,
1939
- "aria-describedby": L,
1940
- "aria-invalid": !!m,
1941
- onChange: (e) => z(Array.from(e.target.files ?? []))
1936
+ disabled: !I,
1937
+ "aria-describedby": F,
1938
+ "aria-invalid": !!f,
1939
+ onChange: (e) => L(Array.from(e.target.files ?? []))
1942
1940
  }), r.length ? /* @__PURE__ */ n(e, { children: [
1943
1941
  /* @__PURE__ */ t("ul", {
1944
- className: Ue.files,
1942
+ className: Ge.files,
1945
1943
  "aria-live": "polite",
1946
1944
  children: r.map((e, a) => /* @__PURE__ */ n("li", {
1947
- className: Ue.file,
1945
+ className: Ge.file,
1948
1946
  children: [
1949
1947
  /* @__PURE__ */ t("span", {
1950
- className: Ue.fileName,
1948
+ className: Ge.fileName,
1951
1949
  title: e.name,
1952
1950
  children: e.name
1953
1951
  }),
1954
1952
  /* @__PURE__ */ t("span", {
1955
- className: Ue.fileSize,
1956
- children: Ge(e.size)
1953
+ className: Ge.fileSize,
1954
+ children: qe(e.size)
1957
1955
  }),
1958
- R && /* @__PURE__ */ t(w, {
1956
+ I && /* @__PURE__ */ t(T, {
1959
1957
  variant: "empty",
1960
1958
  size: "sm",
1961
1959
  "aria-label": `Удалить файл ${e.name}`,
@@ -1967,25 +1965,25 @@ var T = {
1967
1965
  })
1968
1966
  })
1969
1967
  ]
1970
- }, We(e)))
1968
+ }, Ke(e)))
1971
1969
  }),
1972
- R && (a || r.length === 0) && /* @__PURE__ */ t(w, {
1973
- className: Ue.browseButton,
1970
+ I && (a || r.length === 0) && /* @__PURE__ */ t(T, {
1971
+ className: Ge.browseButton,
1974
1972
  size: "sm",
1975
- onClick: () => j.current?.click(),
1973
+ onClick: () => O.current?.click(),
1976
1974
  children: C
1977
1975
  }),
1978
- R && !a && /* @__PURE__ */ t(w, {
1979
- className: Ue.browseButton,
1976
+ I && !a && /* @__PURE__ */ t(T, {
1977
+ className: Ge.browseButton,
1980
1978
  size: "sm",
1981
- onClick: () => j.current?.click(),
1979
+ onClick: () => O.current?.click(),
1982
1980
  children: S
1983
1981
  })
1984
1982
  ] }) : /* @__PURE__ */ n("div", {
1985
- className: Ue.empty,
1983
+ className: Ge.empty,
1986
1984
  children: [
1987
1985
  /* @__PURE__ */ t("span", {
1988
- className: Ue.uploadIcon,
1986
+ className: Ge.uploadIcon,
1989
1987
  "aria-hidden": "true",
1990
1988
  children: /* @__PURE__ */ t(A, {
1991
1989
  name: "IconUpload",
@@ -1993,27 +1991,27 @@ var T = {
1993
1991
  height: 24
1994
1992
  })
1995
1993
  }),
1996
- /* @__PURE__ */ t("strong", { children: N ? "Отпустите файлы здесь" : x }),
1997
- !N && R && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(w, {
1998
- onClick: () => j.current?.click(),
1994
+ /* @__PURE__ */ t("strong", { children: j ? "Отпустите файлы здесь" : x }),
1995
+ !j && I && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", { children: "или" }), /* @__PURE__ */ t(T, {
1996
+ onClick: () => O.current?.click(),
1999
1997
  children: S
2000
1998
  })] })
2001
1999
  ]
2002
2000
  })]
2003
2001
  }),
2004
- p && !m && /* @__PURE__ */ t(D, {
2005
- id: F,
2006
- children: p
2002
+ d && !f && /* @__PURE__ */ t(D, {
2003
+ id: N,
2004
+ children: d
2007
2005
  }),
2008
- m && /* @__PURE__ */ t(D, {
2009
- id: I,
2006
+ f && /* @__PURE__ */ t(D, {
2007
+ id: P,
2010
2008
  variant: "error",
2011
2009
  live: !0,
2012
- children: m
2010
+ children: f
2013
2011
  })
2014
2012
  ]
2015
2013
  });
2016
- }, Je = {
2014
+ }, Xe = {
2017
2015
  wrapper: "_wrapper_1bwdq_1",
2018
2016
  control: "_control_1bwdq_15",
2019
2017
  textarea: "_textarea_1bwdq_25",
@@ -2027,89 +2025,89 @@ var T = {
2027
2025
  clearAction: "_clearAction_1bwdq_171",
2028
2026
  messages: "_messages_1bwdq_251",
2029
2027
  counter: "_counter_1bwdq_265"
2030
- }, Ye = 2;
2031
- function Xe(e) {
2028
+ }, Ze = 2;
2029
+ function Qe(e) {
2032
2030
  let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight);
2033
2031
  return Number.isFinite(n) ? n : Number.parseFloat(t.fontSize) * 1.4;
2034
2032
  }
2035
- function Ze({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, readOnly: l = !1, stringWhileDisabled: u = !1, label: f, error: p, hint: m, className: h = "", name: g, id: _, size: v = "md", clearable: y = !1, required: b = !1, maxLength: x, showCount: S = !1, minRows: C = Ye, maxRows: w, autoResize: T = !0, ...O }) {
2036
- let k = c(), j = _ ?? `ds-textarea-${g ?? k}`, M = d(null), N = m ? `${j}-hint` : void 0, P = p ? `${j}-error` : void 0, F = S && x ? `${j}-count` : void 0, I = [
2037
- N,
2038
- P,
2039
- F
2040
- ].filter(Boolean).join(" ") || void 0, L = Math.max(1, C), R = w === void 0 ? void 0 : Math.max(L, w), z = o(() => {
2041
- let e = M.current;
2042
- if (!e || !T) return;
2043
- let t = window.getComputedStyle(e), n = Xe(e), r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom) + Number.parseFloat(t.borderTopWidth) + Number.parseFloat(t.borderBottomWidth), i = n * L + r, a = R === void 0 ? Infinity : n * R + r;
2033
+ function $e({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, readOnly: o = !1, stringWhileDisabled: c = !1, label: d, error: f, hint: m, className: h = "", name: g, id: _, size: v = "md", clearable: y = !1, required: b = !1, maxLength: x, showCount: S = !1, minRows: C = Ze, maxRows: ee, autoResize: w = !0, ...T }) {
2034
+ let E = u(), O = _ ?? `ds-textarea-${g ?? E}`, k = p(null), j = m ? `${O}-hint` : void 0, M = f ? `${O}-error` : void 0, N = S && x ? `${O}-count` : void 0, P = [
2035
+ j,
2036
+ M,
2037
+ N
2038
+ ].filter(Boolean).join(" ") || void 0, F = Math.max(1, C), I = ee === void 0 ? void 0 : Math.max(F, ee), L = s(() => {
2039
+ let e = k.current;
2040
+ if (!e || !w) return;
2041
+ let t = window.getComputedStyle(e), n = Qe(e), r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom) + Number.parseFloat(t.borderTopWidth) + Number.parseFloat(t.borderBottomWidth), i = n * F + r, a = I === void 0 ? Infinity : n * I + r;
2044
2042
  e.style.height = "auto";
2045
2043
  let o = Math.min(Math.max(e.scrollHeight, i), a);
2046
2044
  e.style.height = `${o}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
2047
2045
  }, [
2048
- T,
2049
- R,
2050
- L
2046
+ w,
2047
+ I,
2048
+ F
2051
2049
  ]);
2052
- s(() => {
2053
- z();
2054
- }, [z, e]), s(() => {
2055
- if (!T) return;
2056
- window.addEventListener("resize", z);
2057
- let e = M.current?.parentElement, t;
2050
+ l(() => {
2051
+ L();
2052
+ }, [L, e]), l(() => {
2053
+ if (!w) return;
2054
+ window.addEventListener("resize", L);
2055
+ let e = k.current?.parentElement, t;
2058
2056
  if (e && typeof ResizeObserver < "u") {
2059
2057
  let n = e.getBoundingClientRect().width;
2060
2058
  t = new ResizeObserver(([e]) => {
2061
- !e || e.contentRect.width === n || (n = e.contentRect.width, z());
2059
+ !e || e.contentRect.width === n || (n = e.contentRect.width, L());
2062
2060
  }), t.observe(e);
2063
2061
  }
2064
2062
  return () => {
2065
- window.removeEventListener("resize", z), t?.disconnect();
2063
+ window.removeEventListener("resize", L), t?.disconnect();
2066
2064
  };
2067
- }, [T, z]);
2068
- let B = (e) => {
2069
- r?.(e.target.value, e), z();
2070
- }, V = () => {
2071
- let e = M.current;
2072
- e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), z());
2073
- }, H = { "--ds-textarea-min-rows": L };
2065
+ }, [w, L]);
2066
+ let R = (e) => {
2067
+ r?.(e.target.value, e), L();
2068
+ }, z = () => {
2069
+ let e = k.current;
2070
+ e && ((Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus(), L());
2071
+ }, B = { "--ds-textarea-min-rows": F };
2074
2072
  return /* @__PURE__ */ n("div", {
2075
- className: `${Je.wrapper} ${h}`,
2073
+ className: `${Xe.wrapper} ${h}`,
2076
2074
  children: [
2077
- f && /* @__PURE__ */ t(E, {
2078
- htmlFor: j,
2075
+ d && /* @__PURE__ */ t(te, {
2076
+ htmlFor: O,
2079
2077
  required: b,
2080
2078
  disabled: a,
2081
- children: f
2079
+ children: d
2082
2080
  }),
2083
- a && u ? /* @__PURE__ */ t("div", {
2084
- id: j,
2085
- className: `${Je.disabledText} ${Je[v]}`,
2086
- style: H,
2087
- "aria-describedby": I,
2081
+ a && c ? /* @__PURE__ */ t("div", {
2082
+ id: O,
2083
+ className: `${Xe.disabledText} ${Xe[v]}`,
2084
+ style: B,
2085
+ "aria-describedby": P,
2088
2086
  children: e || i
2089
2087
  }) : /* @__PURE__ */ n("div", {
2090
- className: Je.control,
2088
+ className: Xe.control,
2091
2089
  children: [/* @__PURE__ */ t("textarea", {
2092
- ref: M,
2093
- id: j,
2090
+ ref: k,
2091
+ id: O,
2094
2092
  name: g,
2095
2093
  value: e,
2096
2094
  placeholder: i,
2097
2095
  disabled: a,
2098
- readOnly: l,
2096
+ readOnly: o,
2099
2097
  required: b,
2100
2098
  maxLength: x,
2101
- rows: L,
2102
- style: H,
2103
- "aria-invalid": !!p,
2104
- "aria-describedby": I,
2105
- className: `${Je.textarea} ${Je[v]} ${T ? Je.autoResize : Je.manualResize} ${p ? Je.textareaError : ""}`,
2106
- onChange: B,
2107
- ...O
2108
- }), y && e && !a && !l && /* @__PURE__ */ t("button", {
2099
+ rows: F,
2100
+ style: B,
2101
+ "aria-invalid": !!f,
2102
+ "aria-describedby": P,
2103
+ className: `${Xe.textarea} ${Xe[v]} ${w ? Xe.autoResize : Xe.manualResize} ${f ? Xe.textareaError : ""}`,
2104
+ onChange: R,
2105
+ ...T
2106
+ }), y && e && !a && !o && /* @__PURE__ */ t("button", {
2109
2107
  type: "button",
2110
- className: Je.clearAction,
2108
+ className: Xe.clearAction,
2111
2109
  "aria-label": "Очистить поле",
2112
- onClick: V,
2110
+ onClick: z,
2113
2111
  children: /* @__PURE__ */ t(A, {
2114
2112
  name: "IconCross",
2115
2113
  width: 20,
@@ -2117,21 +2115,21 @@ function Ze({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
2117
2115
  })
2118
2116
  })]
2119
2117
  }),
2120
- (m || p || F) && /* @__PURE__ */ n("div", {
2121
- className: Je.messages,
2118
+ (m || f || N) && /* @__PURE__ */ n("div", {
2119
+ className: Xe.messages,
2122
2120
  children: [
2123
- m && !p && /* @__PURE__ */ t(D, {
2124
- id: N,
2121
+ m && !f && /* @__PURE__ */ t(D, {
2122
+ id: j,
2125
2123
  children: m
2126
2124
  }),
2127
- p && /* @__PURE__ */ t(D, {
2128
- id: P,
2125
+ f && /* @__PURE__ */ t(D, {
2126
+ id: M,
2129
2127
  variant: "error",
2130
- children: p
2128
+ children: f
2131
2129
  }),
2132
- F && /* @__PURE__ */ n("span", {
2133
- id: F,
2134
- className: Je.counter,
2130
+ N && /* @__PURE__ */ n("span", {
2131
+ id: N,
2132
+ className: Xe.counter,
2135
2133
  children: [
2136
2134
  e.length,
2137
2135
  " / ",
@@ -2145,67 +2143,83 @@ function Ze({ value: e, onChange: r, placeholder: i = "", disabled: a = !1, read
2145
2143
  }
2146
2144
  //#endregion
2147
2145
  //#region src/components/DSModal/modal.store.ts
2148
- var Qe = 0, Q = v((e) => ({
2146
+ var et = 0, Q = b((e, t) => ({
2149
2147
  modals: [],
2150
2148
  openModal: (t, n = {}, r = {}) => {
2151
- Qe += 1;
2152
- let i = `ds-modal-${Qe}`;
2149
+ et += 1;
2150
+ let i = `ds-modal-${et}`;
2153
2151
  return e((e) => ({ modals: [...e.modals, {
2154
2152
  id: i,
2155
2153
  name: t,
2156
2154
  payload: n,
2155
+ title: r.title,
2156
+ description: r.description,
2157
2157
  closeOnEscape: r.closeOnEscape ?? !0,
2158
- closeOnBackdrop: r.closeOnBackdrop ?? !0
2158
+ closeOnBackdrop: r.closeOnBackdrop ?? !0,
2159
+ onClose: r.onClose
2159
2160
  }] })), i;
2160
2161
  },
2161
- closeModal: (t) => e((e) => ({ modals: e.modals.filter((e) => e.id !== t) })),
2162
- closeTopModal: () => e((e) => ({ modals: e.modals.slice(0, -1) })),
2163
- closeAllModals: () => e({ modals: [] })
2164
- })), $e = () => Q.setState({ modals: [] }), et = {
2165
- layer: "_layer_1opno_1",
2166
- backdrop: "_backdrop_1opno_3",
2167
- panel: "_panel_1opno_5",
2168
- header: "_header_1opno_9",
2169
- title: "_title_1opno_11",
2170
- description: "_description_1opno_13",
2171
- content: "_content_1opno_15",
2172
- close: "_close_1opno_17"
2173
- }, tt = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", nt = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: l = "", role: u = "dialog" }) => {
2174
- let f = c(), p = c(), m = d(null), h = Q((e) => e.closeModal);
2175
- return s(() => {
2176
- let e = document.activeElement, t = m.current;
2177
- return (t?.querySelector(tt) ?? t)?.focus(), () => e?.focus();
2162
+ closeModal: (n) => {
2163
+ let r = t().modals.find((e) => e.id === n);
2164
+ r && (e((e) => ({ modals: e.modals.filter((e) => e.id !== n) })), r.onClose?.());
2165
+ },
2166
+ closeTopModal: () => {
2167
+ let n = t().modals.at(-1);
2168
+ n && (e((e) => ({ modals: e.modals.slice(0, -1) })), n.onClose?.());
2169
+ },
2170
+ closeAllModals: () => {
2171
+ let n = t().modals;
2172
+ n.length && (e({ modals: [] }), n.forEach((e) => e.onClose?.()));
2173
+ }
2174
+ })), tt = () => {
2175
+ Q.getState().closeAllModals(), et = 0;
2176
+ }, nt = {
2177
+ layer: "_layer_d4mga_1",
2178
+ backdrop: "_backdrop_d4mga_3",
2179
+ panel: "_panel_d4mga_5",
2180
+ header: "_header_d4mga_9",
2181
+ title: "_title_d4mga_11",
2182
+ description: "_description_d4mga_13",
2183
+ content: "_content_d4mga_15",
2184
+ close: "_close_d4mga_19"
2185
+ }, rt = "button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex=\"-1\"])", it = i({});
2186
+ function at(e) {
2187
+ if (e.key !== "Tab") return;
2188
+ let t = Array.from(e.currentTarget.querySelectorAll(rt));
2189
+ if (!t.length) {
2190
+ e.preventDefault();
2191
+ return;
2192
+ }
2193
+ let n = t[0], r = t.at(-1);
2194
+ e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
2195
+ }
2196
+ var ot = ({ children: e, title: r, description: i, modalId: a, closeLabel: o = "Закрыть модальное окно", className: s = "", role: d = "dialog" }) => {
2197
+ let f = c(it), m = r ?? f.title, h = i ?? f.description, g = u(), _ = u(), v = p(null), y = Q((e) => e.closeModal), b = m != null, x = h != null;
2198
+ return l(() => {
2199
+ let e = document.activeElement, t = v.current;
2200
+ return (t?.querySelector(rt) ?? t)?.focus(), () => e?.focus();
2178
2201
  }, []), /* @__PURE__ */ n("div", {
2179
- ref: m,
2180
- className: `${et.panel} ${l}`,
2181
- role: u,
2202
+ ref: v,
2203
+ className: `${nt.panel} ${s}`,
2204
+ role: d,
2182
2205
  "aria-modal": "true",
2183
- "aria-labelledby": r ? f : void 0,
2184
- "aria-describedby": i ? p : void 0,
2206
+ "aria-labelledby": b ? g : void 0,
2207
+ "aria-describedby": x ? _ : void 0,
2185
2208
  tabIndex: -1,
2186
- onKeyDown: (e) => {
2187
- if (e.key !== "Tab") return;
2188
- let t = Array.from(m.current?.querySelectorAll(tt) ?? []);
2189
- if (!t.length) {
2190
- e.preventDefault();
2191
- return;
2192
- }
2193
- let n = t[0], r = t[t.length - 1];
2194
- e.shiftKey && document.activeElement === n ? (e.preventDefault(), r?.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n?.focus());
2195
- },
2209
+ onKeyDown: at,
2196
2210
  children: [
2197
- (r || o) && /* @__PURE__ */ n("header", {
2198
- className: et.header,
2199
- children: [r && /* @__PURE__ */ t("h2", {
2200
- id: f,
2201
- className: et.title,
2202
- children: r
2203
- }), /* @__PURE__ */ t(w, {
2204
- className: et.close,
2211
+ (b || o) && /* @__PURE__ */ n("header", {
2212
+ className: nt.header,
2213
+ children: [b && /* @__PURE__ */ t("h2", {
2214
+ id: g,
2215
+ className: nt.title,
2216
+ children: m
2217
+ }), /* @__PURE__ */ t(T, {
2218
+ className: nt.close,
2205
2219
  variant: "empty",
2206
2220
  size: "sm",
2207
2221
  "aria-label": o,
2208
- onClick: () => h(a),
2222
+ onClick: () => y(a),
2209
2223
  children: /* @__PURE__ */ t(A, {
2210
2224
  name: "IconCross",
2211
2225
  width: 24,
@@ -2213,126 +2227,153 @@ var Qe = 0, Q = v((e) => ({
2213
2227
  })
2214
2228
  })]
2215
2229
  }),
2216
- i && /* @__PURE__ */ t("p", {
2217
- id: p,
2218
- className: et.description,
2219
- children: i
2230
+ x && /* @__PURE__ */ t("p", {
2231
+ id: _,
2232
+ className: nt.description,
2233
+ children: h
2220
2234
  }),
2221
2235
  /* @__PURE__ */ t("div", {
2222
- className: et.content,
2236
+ className: nt.content,
2223
2237
  children: e
2224
2238
  })
2225
2239
  ]
2226
2240
  });
2227
- }, rt = ({ registry: e }) => {
2241
+ }, st = ({ registry: e }) => {
2228
2242
  let n = Q((e) => e.modals), r = Q((e) => e.closeModal), i = Q((e) => e.closeAllModals);
2229
- return s(() => {
2243
+ return l(() => {
2230
2244
  let e = (e) => {
2231
2245
  if (e.key !== "Escape") return;
2232
2246
  let t = Q.getState().modals.at(-1);
2233
2247
  t?.closeOnEscape && r(t.id);
2234
2248
  };
2235
2249
  return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2236
- }, [r]), !n.length || typeof document > "u" ? null : p(/* @__PURE__ */ t("div", {
2237
- className: et.layer,
2250
+ }, [r]), l(() => {
2251
+ n.forEach((t) => {
2252
+ e[t.name] || r(t.id);
2253
+ });
2254
+ }, [
2255
+ r,
2256
+ n,
2257
+ e
2258
+ ]), !n.length || typeof document > "u" ? null : h(/* @__PURE__ */ t("div", {
2259
+ className: nt.layer,
2238
2260
  "aria-label": "Модальные окна",
2239
2261
  children: n.map((a, o) => {
2240
2262
  let s = e[a.name];
2241
2263
  return s ? /* @__PURE__ */ t("div", {
2242
- className: et.backdrop,
2264
+ className: nt.backdrop,
2243
2265
  "aria-hidden": o !== n.length - 1 || void 0,
2266
+ inert: o !== n.length - 1 || void 0,
2244
2267
  onMouseDown: (e) => {
2245
2268
  e.target === e.currentTarget && a.closeOnBackdrop && r(a.id);
2246
2269
  },
2247
- children: /* @__PURE__ */ t(s, {
2248
- ...a.payload,
2249
- modalId: a.id,
2250
- close: () => r(a.id),
2251
- closeAll: i
2270
+ children: /* @__PURE__ */ t(it.Provider, {
2271
+ value: {
2272
+ title: a.title ?? a.payload.title,
2273
+ description: a.description ?? a.payload.description
2274
+ },
2275
+ children: /* @__PURE__ */ t(s, {
2276
+ ...a.payload,
2277
+ modalId: a.id,
2278
+ close: () => r(a.id),
2279
+ closeAll: i
2280
+ })
2252
2281
  })
2253
2282
  }, a.id) : null;
2254
2283
  })
2255
2284
  }), document.body);
2256
- }, it = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
2285
+ }, ct = ({ registry: r, children: i, lockBodyScroll: a = !0 }) => {
2257
2286
  let o = Q((e) => e.modals.length);
2258
- return s(() => {
2287
+ return l(() => {
2259
2288
  if (!a || o === 0) return;
2260
2289
  let e = document.body.style.overflow;
2261
2290
  return document.body.style.overflow = "hidden", () => {
2262
2291
  document.body.style.overflow = e;
2263
2292
  };
2264
- }, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(rt, { registry: r })] });
2265
- }, at = (e) => e, ot = {
2293
+ }, [a, o]), /* @__PURE__ */ n(e, { children: [i, /* @__PURE__ */ t(st, { registry: r })] });
2294
+ }, lt = (e) => e, ut = {
2266
2295
  message: "_message_1vtru_1",
2267
2296
  actions: "_actions_1vtru_3"
2268
- }, st = /* @__PURE__ */ new Map(), ct = 0, lt = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
2297
+ }, dt = /* @__PURE__ */ new Map(), ft = 0, pt = ({ modalId: e, close: r, title: i = "Подтверждение", message: a = "Продолжить действие?", confirmLabel: o = "Подтвердить", cancelLabel: s = "Отмена", tone: c = "default", requestId: l }) => {
2269
2298
  let u = (e) => {
2270
- st.get(l)?.(e), st.delete(l), r();
2299
+ dt.get(l)?.(e), dt.delete(l), r();
2271
2300
  };
2272
- return /* @__PURE__ */ n(nt, {
2301
+ return /* @__PURE__ */ n(ot, {
2273
2302
  modalId: e,
2274
2303
  title: i,
2275
2304
  role: "alertdialog",
2276
2305
  children: [/* @__PURE__ */ t("p", {
2277
- className: ot.message,
2306
+ className: ut.message,
2278
2307
  children: a
2279
2308
  }), /* @__PURE__ */ n("div", {
2280
- className: ot.actions,
2281
- children: [/* @__PURE__ */ t(w, {
2309
+ className: ut.actions,
2310
+ children: [/* @__PURE__ */ t(T, {
2282
2311
  variant: "outline",
2283
2312
  onClick: () => u(!1),
2284
2313
  children: s
2285
- }), /* @__PURE__ */ t(w, {
2314
+ }), /* @__PURE__ */ t(T, {
2286
2315
  variant: c === "danger" ? "destructive" : "primary",
2287
2316
  onClick: () => u(!0),
2288
2317
  children: o
2289
2318
  })]
2290
2319
  })]
2291
2320
  });
2292
- }, ut = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(nt, {
2321
+ }, mt = ({ modalId: e, close: r, title: i = "Ошибка", message: a, closeLabel: o = "Закрыть" }) => /* @__PURE__ */ n(ot, {
2293
2322
  modalId: e,
2294
2323
  title: i,
2295
2324
  role: "alertdialog",
2296
2325
  children: [/* @__PURE__ */ t("p", {
2297
- className: ot.message,
2326
+ className: ut.message,
2298
2327
  children: a
2299
2328
  }), /* @__PURE__ */ t("div", {
2300
- className: ot.actions,
2301
- children: /* @__PURE__ */ t(w, {
2329
+ className: ut.actions,
2330
+ children: /* @__PURE__ */ t(T, {
2302
2331
  onClick: r,
2303
2332
  children: o
2304
2333
  })
2305
2334
  })]
2306
- }), dt = at({
2307
- ConfirmModal: lt,
2308
- ErrorModal: ut
2309
- }), ft = () => {
2335
+ }), ht = lt({
2336
+ ConfirmModal: pt,
2337
+ ErrorModal: mt
2338
+ }), gt = () => {
2310
2339
  let e = Q((e) => e.openModal);
2311
2340
  return (t = {}) => new Promise((n) => {
2312
- ct += 1;
2313
- let r = `confirm-${ct}`;
2314
- st.set(r, n), e("ConfirmModal", {
2341
+ ft += 1;
2342
+ let r = `confirm-${ft}`;
2343
+ dt.set(r, n), e("ConfirmModal", {
2315
2344
  ...t,
2316
2345
  requestId: r
2317
- }, { closeOnEscape: !1 });
2346
+ }, {
2347
+ closeOnEscape: !1,
2348
+ onClose: () => {
2349
+ dt.get(r)?.(!1), dt.delete(r);
2350
+ }
2351
+ });
2318
2352
  });
2319
- }, pt = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", mt = () => {
2353
+ }, _t = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "Произошла неизвестная ошибка", vt = () => {
2320
2354
  let e = Q((e) => e.openModal);
2321
2355
  return { showError: (t, n) => e("ErrorModal", {
2322
2356
  title: n,
2323
- message: pt(t)
2357
+ message: _t(t)
2324
2358
  }) };
2325
- }, ht = v(() => ({})), gt = v(() => ({})), _t = () => {
2326
- let e = Q((e) => e.modals), t = Q((e) => e.openModal);
2327
- return {
2328
- openModal: (e, n = {}, r) => t(e, n, r),
2329
- closeModal: Q((e) => e.closeModal),
2330
- closeTopModal: Q((e) => e.closeTopModal),
2331
- closeAllModals: Q((e) => e.closeAllModals),
2332
- isOpen: (t) => e.some((e) => e.name === t),
2359
+ }, yt = b(() => ({})), bt = b(() => ({})), xt = () => {
2360
+ let e = Q((e) => e.modals), t = Q((e) => e.openModal), n = Q((e) => e.closeModal), r = Q((e) => e.closeTopModal), i = Q((e) => e.closeAllModals), a = s((e, n = {}, r) => t(e, n, r), [t]), o = s((t) => e.some((e) => e.name === t), [e]);
2361
+ return f(() => ({
2362
+ openModal: a,
2363
+ closeModal: n,
2364
+ closeTopModal: r,
2365
+ closeAllModals: i,
2366
+ isOpen: o,
2333
2367
  count: e.length
2334
- };
2335
- }, vt = {
2368
+ }), [
2369
+ i,
2370
+ n,
2371
+ r,
2372
+ o,
2373
+ e.length,
2374
+ a
2375
+ ]);
2376
+ }, St = {
2336
2377
  wrapper: "_wrapper_1qbyz_1",
2337
2378
  container: "_container_1qbyz_15",
2338
2379
  inner: "_inner_1qbyz_35",
@@ -2340,42 +2381,41 @@ var Qe = 0, Q = v((e) => ({
2340
2381
  jump: "_jump_1qbyz_1",
2341
2382
  cube__inner: "_cube__inner_1qbyz_67",
2342
2383
  morph: "_morph_1qbyz_1"
2343
- }, yt = () => /* @__PURE__ */ t("div", {
2344
- className: vt.wrapper,
2384
+ }, Ct = () => /* @__PURE__ */ t("div", {
2385
+ className: St.wrapper,
2345
2386
  children: /* @__PURE__ */ t("div", {
2346
- className: vt.container,
2387
+ className: St.container,
2347
2388
  children: /* @__PURE__ */ n("div", {
2348
- className: vt.inner,
2389
+ className: St.inner,
2349
2390
  children: [
2350
2391
  /* @__PURE__ */ t("div", {
2351
- className: vt.cube,
2352
- children: /* @__PURE__ */ t("div", { className: vt.cube__inner })
2392
+ className: St.cube,
2393
+ children: /* @__PURE__ */ t("div", { className: St.cube__inner })
2353
2394
  }),
2354
2395
  /* @__PURE__ */ t("div", {
2355
- className: vt.cube,
2356
- children: /* @__PURE__ */ t("div", { className: vt.cube__inner })
2396
+ className: St.cube,
2397
+ children: /* @__PURE__ */ t("div", { className: St.cube__inner })
2357
2398
  }),
2358
2399
  /* @__PURE__ */ t("div", {
2359
- className: vt.cube,
2360
- children: /* @__PURE__ */ t("div", { className: vt.cube__inner })
2400
+ className: St.cube,
2401
+ children: /* @__PURE__ */ t("div", { className: St.cube__inner })
2361
2402
  })
2362
2403
  ]
2363
2404
  })
2364
2405
  })
2365
- }), bt = {
2366
- viewport: "_viewport_15mi5_1",
2367
- "top-right": "_top-right_15mi5_3",
2368
- "top-left": "_top-left_15mi5_5",
2369
- "bottom-right": "_bottom-right_15mi5_7",
2370
- "bottom-left": "_bottom-left_15mi5_9",
2371
- toast: "_toast_15mi5_11",
2372
- body: "_body_15mi5_13",
2373
- icon: "_icon_15mi5_15",
2374
- info: "_info_15mi5_17",
2375
- success: "_success_15mi5_19",
2376
- warning: "_warning_15mi5_21",
2377
- error: "_error_15mi5_23"
2378
- }, xt = {
2406
+ }), wt = {
2407
+ viewport: "_viewport_joq18_1",
2408
+ "top-right": "_top-right_joq18_3",
2409
+ "top-left": "_top-left_joq18_5",
2410
+ "bottom-right": "_bottom-right_joq18_7",
2411
+ "bottom-left": "_bottom-left_joq18_9",
2412
+ toast: "_toast_joq18_11",
2413
+ body: "_body_joq18_13",
2414
+ info: "_info_joq18_15",
2415
+ success: "_success_joq18_17",
2416
+ warning: "_warning_joq18_19",
2417
+ error: "_error_joq18_21"
2418
+ }, Tt = {
2379
2419
  info: {
2380
2420
  name: "IconInfoCircle",
2381
2421
  color: "var(--color-primary)"
@@ -2392,14 +2432,14 @@ var Qe = 0, Q = v((e) => ({
2392
2432
  name: "IconWarning",
2393
2433
  color: "var(--color-error)"
2394
2434
  }
2395
- }, St = ({ toast: e, onClose: r }) => {
2396
- let [i, a] = f(!1), o = d(e.duration), c = d(Date.now());
2397
- return s(() => {
2435
+ }, Et = ({ toast: e, onClose: r }) => {
2436
+ let [i, a] = m(!1), o = p(e.duration), s = p(Date.now());
2437
+ return l(() => {
2398
2438
  if (i || e.duration <= 0) return;
2399
- c.current = Date.now();
2439
+ s.current = Date.now();
2400
2440
  let t = setTimeout(() => r(e.id), o.current);
2401
2441
  return () => {
2402
- clearTimeout(t), o.current = Math.max(0, o.current - (Date.now() - c.current));
2442
+ clearTimeout(t), o.current = Math.max(0, o.current - (Date.now() - s.current));
2403
2443
  };
2404
2444
  }, [
2405
2445
  r,
@@ -2407,7 +2447,7 @@ var Qe = 0, Q = v((e) => ({
2407
2447
  e.duration,
2408
2448
  e.id
2409
2449
  ]), /* @__PURE__ */ n("article", {
2410
- className: `${bt.toast} ${bt[e.variant]}`,
2450
+ className: `${wt.toast} ${wt[e.variant]}`,
2411
2451
  role: e.variant === "error" ? "alert" : "status",
2412
2452
  "aria-live": e.variant === "error" ? "assertive" : "polite",
2413
2453
  onMouseEnter: () => a(!0),
@@ -2416,16 +2456,16 @@ var Qe = 0, Q = v((e) => ({
2416
2456
  onBlur: () => a(!1),
2417
2457
  children: [
2418
2458
  /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(A, {
2419
- ...xt[e.variant],
2459
+ ...Tt[e.variant],
2420
2460
  width: 24,
2421
2461
  height: 24
2422
2462
  }) }),
2423
2463
  /* @__PURE__ */ n("div", {
2424
- className: bt.body,
2464
+ className: wt.body,
2425
2465
  children: [
2426
2466
  e.title && /* @__PURE__ */ t("strong", { children: e.title }),
2427
2467
  /* @__PURE__ */ t("div", { children: e.message }),
2428
- e.action && /* @__PURE__ */ t(w, {
2468
+ e.action && /* @__PURE__ */ t(T, {
2429
2469
  variant: "empty",
2430
2470
  size: "sm",
2431
2471
  onClick: () => {
@@ -2435,7 +2475,7 @@ var Qe = 0, Q = v((e) => ({
2435
2475
  })
2436
2476
  ]
2437
2477
  }),
2438
- e.closable && /* @__PURE__ */ t(w, {
2478
+ e.closable && /* @__PURE__ */ t(T, {
2439
2479
  variant: "empty",
2440
2480
  size: "sm",
2441
2481
  "aria-label": "Закрыть уведомление",
@@ -2448,11 +2488,11 @@ var Qe = 0, Q = v((e) => ({
2448
2488
  })
2449
2489
  ]
2450
2490
  });
2451
- }, Ct = 0, wt = v((e) => ({
2491
+ }, Dt = 0, Ot = b((e) => ({
2452
2492
  toasts: [],
2453
2493
  showToast: (t) => {
2454
- Ct += 1;
2455
- let n = `ds-toast-${Ct}`;
2494
+ Dt += 1;
2495
+ let n = `ds-toast-${Dt}`;
2456
2496
  return e((e) => ({ toasts: [...e.toasts, {
2457
2497
  variant: "info",
2458
2498
  duration: 5e3,
@@ -2463,48 +2503,48 @@ var Qe = 0, Q = v((e) => ({
2463
2503
  },
2464
2504
  removeToast: (t) => e((e) => ({ toasts: e.toasts.filter((e) => e.id !== t) })),
2465
2505
  clearToasts: () => e({ toasts: [] })
2466
- })), Tt = () => wt.setState({ toasts: [] }), Et = ({ position: e = "top-right" }) => {
2467
- let n = wt((e) => e.toasts), r = wt((e) => e.removeToast);
2506
+ })), kt = () => Ot.setState({ toasts: [] }), At = ({ position: e = "top-right" }) => {
2507
+ let n = Ot((e) => e.toasts), r = Ot((e) => e.removeToast);
2468
2508
  return /* @__PURE__ */ t("div", {
2469
- className: `${bt.viewport} ${bt[e]}`,
2509
+ className: `${wt.viewport} ${wt[e]}`,
2470
2510
  "aria-label": "Уведомления",
2471
- children: n.map((e) => /* @__PURE__ */ t(St, {
2511
+ children: n.map((e) => /* @__PURE__ */ t(Et, {
2472
2512
  toast: e,
2473
2513
  onClose: r
2474
2514
  }, e.id))
2475
2515
  });
2476
- }, Dt = () => {
2477
- let e = wt((e) => e.showToast), t = wt((e) => e.removeToast), n = wt((e) => e.clearToasts), r = o((t) => e({
2516
+ }, jt = () => {
2517
+ let e = Ot((e) => e.showToast), t = Ot((e) => e.removeToast), n = Ot((e) => e.clearToasts), r = s((t) => e({
2478
2518
  ...t,
2479
2519
  variant: "info"
2480
- }), [e]), i = o((t) => e({
2520
+ }), [e]), i = s((t) => e({
2481
2521
  ...t,
2482
2522
  variant: "success"
2483
- }), [e]), a = o((t) => e({
2523
+ }), [e]), a = s((t) => e({
2484
2524
  ...t,
2485
2525
  variant: "warning"
2486
- }), [e]), s = o((t) => e({
2526
+ }), [e]), o = s((t) => e({
2487
2527
  ...t,
2488
2528
  variant: "error"
2489
2529
  }), [e]);
2490
- return u(() => ({
2530
+ return f(() => ({
2491
2531
  showToast: e,
2492
2532
  infoToast: r,
2493
2533
  successToast: i,
2494
2534
  warningToast: a,
2495
- errorToast: s,
2535
+ errorToast: o,
2496
2536
  removeToast: t,
2497
2537
  clearToasts: n
2498
2538
  }), [
2499
2539
  n,
2500
- s,
2540
+ o,
2501
2541
  r,
2502
2542
  t,
2503
2543
  e,
2504
2544
  i,
2505
2545
  a
2506
2546
  ]);
2507
- }, Ot = {
2547
+ }, Mt = {
2508
2548
  root: "_root_s9o0g_1",
2509
2549
  tooltip: "_tooltip_s9o0g_3",
2510
2550
  "ds-tooltip-in": "_ds-tooltip-in_s9o0g_1",
@@ -2512,20 +2552,20 @@ var Qe = 0, Q = v((e) => ({
2512
2552
  bottom: "_bottom_s9o0g_7",
2513
2553
  left: "_left_s9o0g_9",
2514
2554
  right: "_right_s9o0g_11"
2515
- }, kt = ({ content: e, children: i, placement: o = "top", delay: l = 450, disabled: u = !1, maxWidth: p = 280, className: m = "" }) => {
2516
- let h = c(), [g, _] = f(!1), v = d(null), y = () => {
2517
- u || !e || (v.current = setTimeout(() => _(!0), l));
2555
+ }, Nt = ({ content: e, children: i, placement: a = "top", delay: s = 450, disabled: c = !1, maxWidth: d = 280, className: f = "" }) => {
2556
+ let h = u(), [g, _] = m(!1), v = p(null), y = () => {
2557
+ c || !e || (v.current = setTimeout(() => _(!0), s));
2518
2558
  }, b = () => {
2519
2559
  v.current && clearTimeout(v.current), _(!1);
2520
2560
  };
2521
- if (s(() => {
2561
+ if (l(() => {
2522
2562
  let e = (e) => {
2523
2563
  e.key === "Escape" && b();
2524
2564
  };
2525
2565
  return document.addEventListener("keydown", e), () => {
2526
2566
  document.removeEventListener("keydown", e), v.current && clearTimeout(v.current);
2527
2567
  };
2528
- }, []), !a(i)) return i;
2568
+ }, []), !o(i)) return i;
2529
2569
  let x = r(i, {
2530
2570
  "aria-describedby": g ? h : void 0,
2531
2571
  onMouseEnter: y,
@@ -2534,17 +2574,17 @@ var Qe = 0, Q = v((e) => ({
2534
2574
  onBlur: b
2535
2575
  });
2536
2576
  return /* @__PURE__ */ n("span", {
2537
- className: `${Ot.root} ${m}`,
2577
+ className: `${Mt.root} ${f}`,
2538
2578
  onPointerDown: g ? b : y,
2539
2579
  children: [x, g && /* @__PURE__ */ t("span", {
2540
2580
  id: h,
2541
2581
  role: "tooltip",
2542
- className: `${Ot.tooltip} ${Ot[o]}`,
2543
- style: { maxWidth: p },
2582
+ className: `${Mt.tooltip} ${Mt[a]}`,
2583
+ style: { maxWidth: d },
2544
2584
  children: e
2545
2585
  })]
2546
2586
  });
2547
- }, At = (e) => {
2587
+ }, Pt = (e) => {
2548
2588
  if (!Number.isFinite(e) || e < 0) return "00:00";
2549
2589
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = `${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}`;
2550
2590
  return n ? `${n}:${a}` : a;
@@ -2577,43 +2617,43 @@ var Qe = 0, Q = v((e) => ({
2577
2617
  settingsActionLabel: "_settingsActionLabel_1oxvl_677",
2578
2618
  caption: "_caption_1oxvl_689",
2579
2619
  fullscreen: "_fullscreen_1oxvl_703"
2580
- }, jt = 2500, Mt = 5, Nt = .05, Pt = [
2620
+ }, Ft = 2500, It = 5, Lt = .05, Rt = [
2581
2621
  .5,
2582
2622
  .75,
2583
2623
  1,
2584
2624
  1.25,
2585
2625
  1.5,
2586
2626
  2
2587
- ], Ft = ({ sources: r, tracks: i = [], title: a, aspectRatio: c = "16 / 9", objectFit: l = "contain", loading: u = !1, error: p, fallback: m, className: h = "", controls: g = !0, playsInline: _ = !0, ...v }) => {
2588
- let y = d(null), b = d(null), x = d(null), C = d(void 0), [T, E] = f(!1), [D, O] = f(r.length > 0), [k, j] = f(!1), [M, N] = f(!1), [P, F] = f(!1), [I, L] = f(0), [R, z] = f(0), [B, V] = f(0), [H, ee] = f(1), [U, W] = f(!!v.muted), [G, te] = f(1), [K, q] = f(!!v.loop), [J, ne] = f(-1), [Y, re] = f(!1), [ie, ae] = f(!0), [oe, se] = f(!1), [ce, le] = f(!1), ue = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), X = i.map((e, t) => ({
2627
+ ], zt = ({ sources: r, tracks: i = [], title: a, aspectRatio: o = "16 / 9", objectFit: c = "contain", loading: u = !1, error: d, fallback: f, className: h = "", controls: g = !0, playsInline: _ = !0, ...v }) => {
2628
+ let y = p(null), b = p(null), x = p(null), S = p(void 0), [C, w] = m(!1), [E, te] = m(r.length > 0), [D, O] = m(!1), [k, j] = m(!1), [M, N] = m(!1), [P, F] = m(0), [I, L] = m(0), [R, z] = m(0), [B, ne] = m(1), [V, H] = m(!!v.muted), [U, re] = m(1), [W, G] = m(!!v.loop), [K, ie] = m(-1), [q, ae] = m(!1), [J, Y] = m(!0), [oe, se] = m(!1), [ce, le] = m(!1), ue = r.map(({ src: e, type: t }) => `${e}:${t ?? ""}`).join("|"), de = i.map((e, t) => ({
2589
2629
  track: e,
2590
2630
  index: t
2591
- })).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), de = p ?? (T ? "Не удалось воспроизвести видео" : void 0), fe = u || D && !de && r.length > 0, pe = !fe && !de && r.length === 0, me = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, he = o(() => {
2592
- ae(!0), window.clearTimeout(C.current), M && !Y && (C.current = window.setTimeout(() => ae(!1), jt));
2593
- }, [M, Y]);
2594
- s(() => {
2595
- E(!1), O(r.length > 0), j(!1), N(!1), F(!1), L(0), z(0), V(0);
2596
- }, [ue, r.length]), s(() => (he(), () => window.clearTimeout(C.current)), [he]), s(() => {
2631
+ })).filter(({ track: e }) => e.kind === "captions" || e.kind === "subtitles"), fe = d ?? (C ? "Не удалось воспроизвести видео" : void 0), X = u || E && !fe && r.length > 0, pe = !X && !fe && r.length === 0, me = typeof document < "u" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled, he = s(() => {
2632
+ Y(!0), window.clearTimeout(S.current), k && !q && (S.current = window.setTimeout(() => Y(!1), Ft));
2633
+ }, [k, q]);
2634
+ l(() => {
2635
+ w(!1), te(r.length > 0), O(!1), j(!1), N(!1), F(0), L(0), z(0);
2636
+ }, [ue, r.length]), l(() => (he(), () => window.clearTimeout(S.current)), [he]), l(() => {
2597
2637
  let e = () => se(document.fullscreenElement === b.current), t = () => le(document.pictureInPictureElement === x.current);
2598
2638
  return document.addEventListener("fullscreenchange", e), document.addEventListener("enterpictureinpicture", t), document.addEventListener("leavepictureinpicture", t), () => {
2599
2639
  document.removeEventListener("fullscreenchange", e), document.removeEventListener("enterpictureinpicture", t), document.removeEventListener("leavepictureinpicture", t);
2600
2640
  };
2601
- }, []), s(() => {
2602
- if (!Y) return;
2641
+ }, []), l(() => {
2642
+ if (!q) return;
2603
2643
  let e = (e) => {
2604
- y.current?.contains(e.target) || re(!1);
2644
+ y.current?.contains(e.target) || ae(!1);
2605
2645
  };
2606
2646
  return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
2607
- }, [Y]);
2647
+ }, [q]);
2608
2648
  let ge = async () => {
2609
2649
  let e = x.current;
2610
- if (!(!e || de || fe)) {
2650
+ if (!(!e || fe || X)) {
2611
2651
  if (e.paused || e.ended) {
2612
2652
  e.ended && (e.currentTime = 0);
2613
2653
  try {
2614
2654
  await e.play();
2615
2655
  } catch {
2616
- E(!0);
2656
+ w(!0);
2617
2657
  }
2618
2658
  } else e.pause();
2619
2659
  }
@@ -2625,7 +2665,7 @@ var Qe = 0, Q = v((e) => ({
2625
2665
  t && (t.volume = Math.min(1, Math.max(0, e)), t.muted = t.volume === 0);
2626
2666
  }, ye = (e) => {
2627
2667
  let t = x.current;
2628
- !t || !R || (t.currentTime = Math.min(R, Math.max(0, e)), L(t.currentTime));
2668
+ !t || !I || (t.currentTime = Math.min(I, Math.max(0, e)), F(t.currentTime));
2629
2669
  }, be = async () => {
2630
2670
  if (b.current) try {
2631
2671
  document.fullscreenElement ? await document.exitFullscreen() : await b.current.requestFullscreen();
@@ -2643,18 +2683,18 @@ var Qe = 0, Q = v((e) => ({
2643
2683
  let t = x.current;
2644
2684
  t && (Array.from(t.textTracks).forEach((t, n) => {
2645
2685
  t.mode = n === e ? "showing" : "disabled";
2646
- }), ne(e));
2686
+ }), ie(e));
2647
2687
  }, Ce = (e) => {
2648
2688
  let t = e.target;
2649
2689
  if (/^(INPUT|SELECT|BUTTON)$/.test(t.tagName)) return;
2650
2690
  let n = e.key.toLowerCase();
2651
- n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(), be()) : n === "c" && X.length ? (e.preventDefault(), Se(J === -1 ? X[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), ye(I + (e.key === "ArrowRight" ? Mt : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), ve(H + (e.key === "ArrowUp" ? Nt : -.05))) : e.key === "Escape" && re(!1), he();
2691
+ n === " " || n === "k" ? (e.preventDefault(), ge()) : n === "m" ? (e.preventDefault(), _e()) : n === "f" ? (e.preventDefault(), be()) : n === "c" && de.length ? (e.preventDefault(), Se(K === -1 ? de[0].index : -1)) : e.key === "ArrowLeft" || e.key === "ArrowRight" ? (e.preventDefault(), ye(P + (e.key === "ArrowRight" ? It : -5))) : e.key === "ArrowUp" || e.key === "ArrowDown" ? (e.preventDefault(), ve(B + (e.key === "ArrowUp" ? Lt : -.05))) : e.key === "Escape" && ae(!1), he();
2652
2692
  }, we = () => {
2653
2693
  let e = x.current;
2654
- E(!1), O(!0), e?.load();
2694
+ w(!1), te(!0), e?.load();
2655
2695
  }, Te = {
2656
- "--video-progress": `${R ? I / R * 100 : 0}%`,
2657
- "--video-buffered": `${B * 100}%`
2696
+ "--video-progress": `${I ? P / I * 100 : 0}%`,
2697
+ "--video-buffered": `${R * 100}%`
2658
2698
  };
2659
2699
  return /* @__PURE__ */ n("figure", {
2660
2700
  ref: y,
@@ -2663,14 +2703,14 @@ var Qe = 0, Q = v((e) => ({
2663
2703
  children: [/* @__PURE__ */ n("div", {
2664
2704
  ref: b,
2665
2705
  className: `${$.frame} ${oe ? $.fullscreen : ""}`,
2666
- style: { aspectRatio: c },
2667
- "aria-busy": fe || void 0,
2706
+ style: { aspectRatio: o },
2707
+ "aria-busy": X || void 0,
2668
2708
  tabIndex: g && r.length ? 0 : void 0,
2669
2709
  onPointerMove: he,
2670
2710
  onPointerDown: he,
2671
2711
  onFocusCapture: he,
2672
2712
  onMouseLeave: () => {
2673
- M && !Y && ae(!1);
2713
+ k && !q && Y(!1);
2674
2714
  },
2675
2715
  children: [
2676
2716
  r.length > 0 && /* @__PURE__ */ n("video", {
@@ -2679,9 +2719,9 @@ var Qe = 0, Q = v((e) => ({
2679
2719
  "aria-label": a,
2680
2720
  controls: !1,
2681
2721
  playsInline: _,
2682
- loop: K,
2722
+ loop: W,
2683
2723
  className: $.video,
2684
- style: { objectFit: l },
2724
+ style: { objectFit: c },
2685
2725
  onClick: (e) => {
2686
2726
  v.onClick?.(e), ge();
2687
2727
  },
@@ -2689,56 +2729,56 @@ var Qe = 0, Q = v((e) => ({
2689
2729
  v.onDoubleClick?.(e), be();
2690
2730
  },
2691
2731
  onLoadStart: (e) => {
2692
- O(!0), v.onLoadStart?.(e);
2732
+ te(!0), v.onLoadStart?.(e);
2693
2733
  },
2694
2734
  onLoadedMetadata: (e) => {
2695
- z(e.currentTarget.duration || 0);
2696
- let t = X.find(({ track: e }) => e.default);
2735
+ L(e.currentTarget.duration || 0);
2736
+ let t = de.find(({ track: e }) => e.default);
2697
2737
  Se(t?.index ?? -1), v.onLoadedMetadata?.(e);
2698
2738
  },
2699
2739
  onDurationChange: (e) => {
2700
- z(e.currentTarget.duration || 0), v.onDurationChange?.(e);
2740
+ L(e.currentTarget.duration || 0), v.onDurationChange?.(e);
2701
2741
  },
2702
2742
  onTimeUpdate: (e) => {
2703
- L(e.currentTarget.currentTime), v.onTimeUpdate?.(e);
2743
+ F(e.currentTarget.currentTime), v.onTimeUpdate?.(e);
2704
2744
  },
2705
2745
  onProgress: (e) => {
2706
2746
  let t = e.currentTarget;
2707
- t.duration && t.buffered.length && V(t.buffered.end(t.buffered.length - 1) / t.duration), v.onProgress?.(e);
2747
+ t.duration && t.buffered.length && z(t.buffered.end(t.buffered.length - 1) / t.duration), v.onProgress?.(e);
2708
2748
  },
2709
2749
  onLoadedData: (e) => {
2710
- O(!1), j(!1), v.onLoadedData?.(e);
2750
+ te(!1), O(!1), v.onLoadedData?.(e);
2711
2751
  },
2712
2752
  onCanPlay: (e) => {
2713
- O(!1), j(!1), v.onCanPlay?.(e);
2753
+ te(!1), O(!1), v.onCanPlay?.(e);
2714
2754
  },
2715
2755
  onWaiting: (e) => {
2716
- j(!0), v.onWaiting?.(e);
2756
+ O(!0), v.onWaiting?.(e);
2717
2757
  },
2718
2758
  onPlaying: (e) => {
2719
- N(!0), F(!1), j(!1), v.onPlaying?.(e);
2759
+ j(!0), N(!1), O(!1), v.onPlaying?.(e);
2720
2760
  },
2721
2761
  onPlay: (e) => {
2722
- N(!0), v.onPlay?.(e);
2762
+ j(!0), v.onPlay?.(e);
2723
2763
  },
2724
2764
  onPause: (e) => {
2725
- N(!1), v.onPause?.(e);
2765
+ j(!1), v.onPause?.(e);
2726
2766
  },
2727
2767
  onEnded: (e) => {
2728
- N(!1), F(!0), ae(!0), v.onEnded?.(e);
2768
+ j(!1), N(!0), Y(!0), v.onEnded?.(e);
2729
2769
  },
2730
2770
  onVolumeChange: (e) => {
2731
- ee(e.currentTarget.volume), W(e.currentTarget.muted), v.onVolumeChange?.(e);
2771
+ ne(e.currentTarget.volume), H(e.currentTarget.muted), v.onVolumeChange?.(e);
2732
2772
  },
2733
2773
  onRateChange: (e) => {
2734
- te(e.currentTarget.playbackRate), v.onRateChange?.(e);
2774
+ re(e.currentTarget.playbackRate), v.onRateChange?.(e);
2735
2775
  },
2736
2776
  onError: (e) => {
2737
- O(!1), j(!1), E(!0), v.onError?.(e);
2777
+ te(!1), O(!1), w(!0), v.onError?.(e);
2738
2778
  },
2739
2779
  children: [r.map((e) => /* @__PURE__ */ t("source", { ...e }, `${e.src}-${e.type}`)), i.map((e) => /* @__PURE__ */ t("track", { ...e }, `${e.src}-${e.srcLang}`))]
2740
2780
  }),
2741
- fe && /* @__PURE__ */ n("div", {
2781
+ X && /* @__PURE__ */ n("div", {
2742
2782
  className: $.overlay,
2743
2783
  role: "status",
2744
2784
  "aria-live": "polite",
@@ -2747,15 +2787,15 @@ var Qe = 0, Q = v((e) => ({
2747
2787
  "aria-hidden": "true",
2748
2788
  children: /* @__PURE__ */ t("div", {
2749
2789
  className: $.loaderScale,
2750
- children: /* @__PURE__ */ t(yt, {})
2790
+ children: /* @__PURE__ */ t(Ct, {})
2751
2791
  })
2752
2792
  }), /* @__PURE__ */ t("span", { children: "Загрузка видео" })]
2753
2793
  }),
2754
- !fe && k && !de && /* @__PURE__ */ t("div", {
2794
+ !X && D && !fe && /* @__PURE__ */ t("div", {
2755
2795
  className: $.buffering,
2756
2796
  role: "status",
2757
2797
  "aria-label": "Буферизация видео",
2758
- children: /* @__PURE__ */ t(S, { variant: "empty" })
2798
+ children: /* @__PURE__ */ t(ee, { variant: "empty" })
2759
2799
  }),
2760
2800
  pe && /* @__PURE__ */ n("div", {
2761
2801
  className: `${$.state} ${$.empty}`,
@@ -2768,10 +2808,10 @@ var Qe = 0, Q = v((e) => ({
2768
2808
  height: 40
2769
2809
  }),
2770
2810
  /* @__PURE__ */ t("strong", { children: "Видео отсутствует" }),
2771
- m ?? /* @__PURE__ */ t("span", { children: "Источник видео не указан" })
2811
+ f ?? /* @__PURE__ */ t("span", { children: "Источник видео не указан" })
2772
2812
  ]
2773
2813
  }),
2774
- !fe && de && /* @__PURE__ */ n("div", {
2814
+ !X && fe && /* @__PURE__ */ n("div", {
2775
2815
  className: `${$.state} ${$.error}`,
2776
2816
  role: "alert",
2777
2817
  children: [
@@ -2781,8 +2821,8 @@ var Qe = 0, Q = v((e) => ({
2781
2821
  width: 40,
2782
2822
  height: 40
2783
2823
  }),
2784
- m ?? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", { children: "Видео недоступно" }), /* @__PURE__ */ t("span", { children: de })] }),
2785
- r.length > 0 && /* @__PURE__ */ t(w, {
2824
+ f ?? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", { children: "Видео недоступно" }), /* @__PURE__ */ t("span", { children: fe })] }),
2825
+ r.length > 0 && /* @__PURE__ */ t(T, {
2786
2826
  size: "sm",
2787
2827
  variant: "secondary",
2788
2828
  onClick: we,
@@ -2790,7 +2830,7 @@ var Qe = 0, Q = v((e) => ({
2790
2830
  })
2791
2831
  ]
2792
2832
  }),
2793
- !fe && !de && P && /* @__PURE__ */ t("button", {
2833
+ !X && !fe && M && /* @__PURE__ */ t("button", {
2794
2834
  type: "button",
2795
2835
  className: $.replay,
2796
2836
  "aria-label": "Воспроизвести заново",
@@ -2801,32 +2841,32 @@ var Qe = 0, Q = v((e) => ({
2801
2841
  height: 28
2802
2842
  })
2803
2843
  }),
2804
- g && r.length > 0 && !fe && !de && /* @__PURE__ */ n("div", {
2805
- className: `${$.controlsLayer} ${ie || !M ? $.controlsVisible : ""}`,
2844
+ g && r.length > 0 && !X && !fe && /* @__PURE__ */ n("div", {
2845
+ className: `${$.controlsLayer} ${J || !k ? $.controlsVisible : ""}`,
2806
2846
  onClick: (e) => e.stopPropagation(),
2807
- children: [Y && /* @__PURE__ */ n("div", {
2847
+ children: [q && /* @__PURE__ */ n("div", {
2808
2848
  className: $.settings,
2809
2849
  role: "dialog",
2810
2850
  "aria-label": "Настройки видео",
2811
2851
  children: [
2812
2852
  /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Скорость" }), /* @__PURE__ */ t("select", {
2813
- value: G,
2853
+ value: U,
2814
2854
  onChange: (e) => {
2815
2855
  let t = Number(e.target.value);
2816
2856
  x.current && (x.current.playbackRate = t);
2817
2857
  },
2818
- children: Pt.map((e) => /* @__PURE__ */ n("option", {
2858
+ children: Rt.map((e) => /* @__PURE__ */ n("option", {
2819
2859
  value: e,
2820
2860
  children: [e, "×"]
2821
2861
  }, e))
2822
2862
  })] }),
2823
- X.length > 0 && /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Субтитры" }), /* @__PURE__ */ n("select", {
2824
- value: J,
2863
+ de.length > 0 && /* @__PURE__ */ n("label", { children: [/* @__PURE__ */ t("span", { children: "Субтитры" }), /* @__PURE__ */ n("select", {
2864
+ value: K,
2825
2865
  onChange: (e) => Se(Number(e.target.value)),
2826
2866
  children: [/* @__PURE__ */ t("option", {
2827
2867
  value: -1,
2828
2868
  children: "Выключены"
2829
- }), X.map(({ track: e, index: n }) => /* @__PURE__ */ t("option", {
2869
+ }), de.map(({ track: e, index: n }) => /* @__PURE__ */ t("option", {
2830
2870
  value: n,
2831
2871
  children: e.label
2832
2872
  }, `${e.srcLang}-${e.label}`))]
@@ -2834,9 +2874,9 @@ var Qe = 0, Q = v((e) => ({
2834
2874
  /* @__PURE__ */ n("button", {
2835
2875
  type: "button",
2836
2876
  className: $.settingsAction,
2837
- "aria-pressed": K,
2838
- onClick: () => q((e) => !e),
2839
- children: [/* @__PURE__ */ t("span", { children: "Повтор" }), /* @__PURE__ */ t("span", { children: K ? "Вкл." : "Выкл." })]
2877
+ "aria-pressed": W,
2878
+ onClick: () => G((e) => !e),
2879
+ children: [/* @__PURE__ */ t("span", { children: "Повтор" }), /* @__PURE__ */ t("span", { children: W ? "Вкл." : "Выкл." })]
2840
2880
  }),
2841
2881
  me && /* @__PURE__ */ t("button", {
2842
2882
  type: "button",
@@ -2861,11 +2901,11 @@ var Qe = 0, Q = v((e) => ({
2861
2901
  children: /* @__PURE__ */ t("button", {
2862
2902
  type: "button",
2863
2903
  className: `${$.controlButton} ${$.playButton}`,
2864
- "aria-label": M ? "Пауза" : "Воспроизвести",
2865
- title: M ? "Пауза (K)" : "Воспроизвести (K)",
2904
+ "aria-label": k ? "Пауза" : "Воспроизвести",
2905
+ title: k ? "Пауза (K)" : "Воспроизвести (K)",
2866
2906
  onClick: () => void ge(),
2867
2907
  children: /* @__PURE__ */ t(A, {
2868
- name: M ? "IconPause" : "IconPlay",
2908
+ name: k ? "IconPause" : "IconPlay",
2869
2909
  width: 24,
2870
2910
  height: 24
2871
2911
  })
@@ -2876,12 +2916,12 @@ var Qe = 0, Q = v((e) => ({
2876
2916
  children: [/* @__PURE__ */ t("button", {
2877
2917
  type: "button",
2878
2918
  className: $.controlButton,
2879
- "aria-label": U ? "Включить звук" : "Выключить звук",
2880
- "aria-pressed": U,
2919
+ "aria-label": V ? "Включить звук" : "Выключить звук",
2920
+ "aria-pressed": V,
2881
2921
  title: "Звук (M)",
2882
2922
  onClick: _e,
2883
2923
  children: /* @__PURE__ */ t(A, {
2884
- name: U || H === 0 ? "IconVolumeMuted" : "IconVolume",
2924
+ name: V || B === 0 ? "IconVolumeMuted" : "IconVolume",
2885
2925
  width: 22,
2886
2926
  height: 22
2887
2927
  })
@@ -2891,9 +2931,9 @@ var Qe = 0, Q = v((e) => ({
2891
2931
  min: 0,
2892
2932
  max: 1,
2893
2933
  step: .05,
2894
- value: U ? 0 : H,
2934
+ value: V ? 0 : B,
2895
2935
  "aria-label": "Громкость",
2896
- "aria-valuetext": `${Math.round((U ? 0 : H) * 100)}%`,
2936
+ "aria-valuetext": `${Math.round((V ? 0 : B) * 100)}%`,
2897
2937
  onChange: (e) => ve(Number(e.target.value))
2898
2938
  })]
2899
2939
  }),
@@ -2902,23 +2942,23 @@ var Qe = 0, Q = v((e) => ({
2902
2942
  children: [
2903
2943
  /* @__PURE__ */ t("span", {
2904
2944
  className: $.time,
2905
- children: At(I)
2945
+ children: Pt(P)
2906
2946
  }),
2907
2947
  /* @__PURE__ */ t("input", {
2908
2948
  className: $.timeline,
2909
2949
  style: Te,
2910
2950
  type: "range",
2911
2951
  min: 0,
2912
- max: R || 0,
2952
+ max: I || 0,
2913
2953
  step: .01,
2914
- value: Math.min(I, R || 0),
2954
+ value: Math.min(P, I || 0),
2915
2955
  "aria-label": "Позиция воспроизведения",
2916
- "aria-valuetext": `${At(I)} из ${At(R)}`,
2956
+ "aria-valuetext": `${Pt(P)} из ${Pt(I)}`,
2917
2957
  onChange: (e) => ye(Number(e.target.value))
2918
2958
  }),
2919
2959
  /* @__PURE__ */ t("span", {
2920
2960
  className: $.time,
2921
- children: At(R)
2961
+ children: Pt(I)
2922
2962
  })
2923
2963
  ]
2924
2964
  }),
@@ -2928,9 +2968,9 @@ var Qe = 0, Q = v((e) => ({
2928
2968
  type: "button",
2929
2969
  className: $.controlButton,
2930
2970
  "aria-label": "Настройки",
2931
- "aria-expanded": Y,
2971
+ "aria-expanded": q,
2932
2972
  title: "Настройки",
2933
- onClick: () => re((e) => !e),
2973
+ onClick: () => ae((e) => !e),
2934
2974
  children: /* @__PURE__ */ t(A, {
2935
2975
  name: "IconSettings",
2936
2976
  width: 22,
@@ -2958,7 +2998,7 @@ var Qe = 0, Q = v((e) => ({
2958
2998
  children: a
2959
2999
  })]
2960
3000
  });
2961
- }, It = {
3001
+ }, Bt = {
2962
3002
  root: "_root_1tdda_1",
2963
3003
  trigger: "_trigger_1tdda_15",
2964
3004
  heading: "_heading_1tdda_41",
@@ -2968,7 +3008,7 @@ var Qe = 0, Q = v((e) => ({
2968
3008
  open: "_open_1tdda_91",
2969
3009
  content: "_content_1tdda_99",
2970
3010
  contentInner: "_contentInner_1tdda_119"
2971
- }, Lt = (e, t, n, r = 16) => {
3011
+ }, Vt = (e, t, n, r = 16) => {
2972
3012
  if (t > Math.max(0, n - r * 2)) {
2973
3013
  let t = e - r;
2974
3014
  return Math.abs(t) <= 1 ? {
@@ -2990,17 +3030,17 @@ var Qe = 0, Q = v((e) => ({
2990
3030
  alignment: "none",
2991
3031
  delta: 0
2992
3032
  };
2993
- }, Rt = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: l, autoScrollOnOpen: u = !0, scrollOffset: p = 16, className: m = "" }) => {
2994
- let h = c(), [g, _] = f(a), v = o ?? g, y = d(null), b = d(null), x = d(v);
2995
- return s(() => {
3033
+ }, Ht = ({ title: e, subtitle: r, children: i, defaultOpen: a = !1, open: o, onOpenChange: s, autoScrollOnOpen: c = !0, scrollOffset: d = 16, className: f = "" }) => {
3034
+ let h = u(), [g, _] = m(a), v = o ?? g, y = p(null), b = p(null), x = p(v);
3035
+ return l(() => {
2996
3036
  let e = x.current;
2997
- if (x.current = v, !v || e || !u) return;
3037
+ if (x.current = v, !v || e || !c) return;
2998
3038
  let t = y.current, n = b.current;
2999
3039
  if (!t || !n || typeof window > "u") return;
3000
3040
  let r = !1, i = () => {
3001
3041
  if (r) return;
3002
3042
  r = !0;
3003
- let e = t.getBoundingClientRect(), n = Lt(e.top, e.height, window.innerHeight, p);
3043
+ let e = t.getBoundingClientRect(), n = Vt(e.top, e.height, window.innerHeight, d);
3004
3044
  if (n.alignment === "none") return;
3005
3045
  let i = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
3006
3046
  window.scrollBy({
@@ -3016,32 +3056,32 @@ var Qe = 0, Q = v((e) => ({
3016
3056
  n.removeEventListener("transitionend", a), window.clearTimeout(o);
3017
3057
  };
3018
3058
  }, [
3019
- u,
3059
+ c,
3020
3060
  v,
3021
- p
3061
+ d
3022
3062
  ]), /* @__PURE__ */ n("section", {
3023
3063
  ref: y,
3024
- className: `${It.root} ${v ? It.open : ""} ${m}`,
3064
+ className: `${Bt.root} ${v ? Bt.open : ""} ${f}`,
3025
3065
  children: [/* @__PURE__ */ n("button", {
3026
3066
  type: "button",
3027
- className: It.trigger,
3067
+ className: Bt.trigger,
3028
3068
  "aria-expanded": v,
3029
3069
  "aria-controls": h,
3030
3070
  onClick: () => {
3031
3071
  let e = !v;
3032
- o === void 0 && _(e), l?.(e);
3072
+ o === void 0 && _(e), s?.(e);
3033
3073
  },
3034
3074
  children: [/* @__PURE__ */ n("span", {
3035
- className: It.heading,
3075
+ className: Bt.heading,
3036
3076
  children: [/* @__PURE__ */ t("span", {
3037
- className: It.title,
3077
+ className: Bt.title,
3038
3078
  children: e
3039
3079
  }), r && /* @__PURE__ */ t("span", {
3040
- className: It.subtitle,
3080
+ className: Bt.subtitle,
3041
3081
  children: r
3042
3082
  })]
3043
3083
  }), /* @__PURE__ */ t("span", {
3044
- className: It.icon,
3084
+ className: Bt.icon,
3045
3085
  "aria-hidden": "true",
3046
3086
  children: /* @__PURE__ */ t(A, {
3047
3087
  name: "IconChevron",
@@ -3052,17 +3092,17 @@ var Qe = 0, Q = v((e) => ({
3052
3092
  }), /* @__PURE__ */ t("div", {
3053
3093
  ref: b,
3054
3094
  id: h,
3055
- className: It.content,
3095
+ className: Bt.content,
3056
3096
  "aria-hidden": !v,
3057
3097
  children: /* @__PURE__ */ t("div", {
3058
- className: It.contentInner,
3098
+ className: Bt.contentInner,
3059
3099
  children: i
3060
3100
  })
3061
3101
  })]
3062
3102
  });
3063
- }, zt = ({ children: e, containerId: t = "overlay-root" }) => {
3064
- let [n, r] = f(null);
3065
- return s(() => {
3103
+ }, Ut = ({ children: e, containerId: t = "overlay-root" }) => {
3104
+ let [n, r] = m(null);
3105
+ return l(() => {
3066
3106
  let e = document.getElementById(t);
3067
3107
  if (e) {
3068
3108
  r(e);
@@ -3072,7 +3112,7 @@ var Qe = 0, Q = v((e) => ({
3072
3112
  return n.id = t, document.body.appendChild(n), r(n), () => {
3073
3113
  n.childElementCount === 0 && n.parentElement && n.remove();
3074
3114
  };
3075
- }, [t]), n ? p(e, n) : null;
3115
+ }, [t]), n ? h(e, n) : null;
3076
3116
  };
3077
3117
  //#endregion
3078
- export { lt as ConfirmModal, Rt as DSAccordion, b as DSBadge, w as DSButton, M as DSCheckbox, Se as DSDataTable, q as DSDateRange, G as DSDateTimePicker, ce as DSDropDown, De as DSDropDownMultiple, E as DSFieldLabel, D as DSFieldMessage, qe as DSFileInput, He as DSFilters, A as DSIcon, Re as DSInfoBlock, ke as DSInput, S as DSLoader, rt as DSModal, nt as DSModalFrame, yt as DSPageLoader, zt as DSPortal, Be as DSRadioButton, Ie as DSSearchDropDown, ne as DSSkeleton, ue as DSSort, Ze as DSTextarea, St as DSToast, Et as DSToastProvider, kt as DSTooltip, Ft as DSVideoPlayerFrame, ut as ErrorModal, it as ModalSystemProvider, dt as builtInModalRegistry, at as defineModalRegistry, R as formatDateTimeLocalValue, Lt as getDSAccordionScrollTarget, fe as getDSDataTablePaginationItems, pt as getErrorMessage, oe as getNextEnabledOptionIndex, K as isValidDateRange, z as parseDateTimeLocalValue, $e as resetModalStore, Tt as resetToastStore, ft as useConfirmModal, ht as useConfirmModalStore, mt as useErrorModal, gt as useErrorModalStore, _t as useModals, Q as useModalsStore, Dt as useToast, wt as useToastStore, pe as validateDSDataTableData };
3118
+ export { pt as ConfirmModal, Ht as DSAccordion, S as DSBadge, T as DSButton, M as DSCheckbox, we as DSDataTable, ie as DSDateRange, W as DSDateTimePicker, ue as DSDropDown, ke as DSDropDownMultiple, te as DSFieldLabel, D as DSFieldMessage, Ye as DSFileInput, We as DSFilters, A as DSIcon, Be as DSInfoBlock, je as DSInput, ee as DSLoader, st as DSModal, ot as DSModalFrame, Ct as DSPageLoader, Ut as DSPortal, He as DSRadioButton, Re as DSSearchDropDown, ae as DSSkeleton, fe as DSSort, $e as DSTextarea, Et as DSToast, At as DSToastProvider, Nt as DSTooltip, zt as DSVideoPlayerFrame, mt as ErrorModal, ct as ModalSystemProvider, ht as builtInModalRegistry, lt as defineModalRegistry, R as formatDateTimeLocalValue, Vt as getDSAccordionScrollTarget, me as getDSDataTablePaginationItems, _t as getErrorMessage, ce as getNextEnabledOptionIndex, K as isValidDateRange, z as parseDateTimeLocalValue, tt as resetModalStore, kt as resetToastStore, gt as useConfirmModal, yt as useConfirmModalStore, vt as useErrorModal, bt as useErrorModalStore, xt as useModals, Q as useModalsStore, jt as useToast, Ot as useToastStore, he as validateDSDataTableData };