urfu-ui-kit-react 2.1.7-next.1 → 2.1.7-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +2 -2
  2. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  3. package/dist/components/Calendar/Calendar.js +232 -194
  4. package/dist/components/Calendar/Calendar.types.d.ts +21 -0
  5. package/dist/components/Calendar/Calendar.types.d.ts.map +1 -1
  6. package/dist/components/Calendar/CalendarSelect.js +38 -38
  7. package/dist/components/Calendar/MaskedDateInput.d.ts +2 -0
  8. package/dist/components/Calendar/MaskedDateInput.d.ts.map +1 -1
  9. package/dist/components/Calendar/MaskedDateInput.js +120 -113
  10. package/dist/components/ColumnSettings/ColumnSettings.d.ts.map +1 -1
  11. package/dist/components/ColumnSettings/ColumnSettings.js +22 -21
  12. package/dist/components/ConfirmModal/ConfirmModal.d.ts +0 -1
  13. package/dist/components/ConfirmModal/ConfirmModal.d.ts.map +1 -1
  14. package/dist/components/ConfirmModal/ConfirmModal.js +11 -12
  15. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  16. package/dist/components/Drawer/Drawer.js +23 -22
  17. package/dist/components/ErrorScreen/ErrorScreen.js +117 -115
  18. package/dist/components/ErrorScreen/ErrorScreenIllustration.js +28 -28
  19. package/dist/components/InputExpandTextarea/InputExpandTextarea.js +1 -1
  20. package/dist/components/InputTime/InputTime.js +12 -12
  21. package/dist/components/Menu/Menu.js +11 -11
  22. package/dist/components/Modal/Modal.js +33 -33
  23. package/dist/components/Pagination/Pagination.js +22 -22
  24. package/dist/components/Preloader/Preloader.d.ts.map +1 -1
  25. package/dist/components/Preloader/Preloader.js +13 -13
  26. package/dist/components/Search/Search.d.ts.map +1 -1
  27. package/dist/components/Search/Search.js +28 -23
  28. package/dist/components/Select/Select.d.ts +2 -0
  29. package/dist/components/Select/Select.d.ts.map +1 -1
  30. package/dist/components/Select/Select.js +21 -19
  31. package/dist/components/Switch/Switch.d.ts.map +1 -1
  32. package/dist/components/Switch/Switch.js +8 -8
  33. package/dist/components/Table/Filter/FilterStringBox.js +8 -8
  34. package/dist/components/Table/Filter/SelectFilter.d.ts.map +1 -1
  35. package/dist/components/Table/Filter/SelectFilter.js +24 -22
  36. package/dist/components/Table/Filter/useFilterOptionsPreload.js +2 -2
  37. package/dist/components/Table/Table.types.d.ts +1 -1
  38. package/dist/components/Table/Table.types.d.ts.map +1 -1
  39. package/dist/components/Table/TableHead.js +6 -6
  40. package/dist/components/Table/TableMobileCard.d.ts.map +1 -1
  41. package/dist/components/Table/TableMobileCard.js +27 -26
  42. package/dist/components/Table/TableMobileView.js +46 -46
  43. package/dist/components/Table/TableRow.js +1 -1
  44. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  45. package/dist/components/Tabs/Tabs.js +25 -24
  46. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  47. package/dist/components/Tooltip/Tooltip.js +37 -36
  48. package/dist/dev/index.js +16 -16
  49. package/dist/dev/types/vanilla/src/dev/panelStyles.d.ts +1 -1
  50. package/dist/hooks/useAutoId.js +3 -3
  51. package/dist/index.d.ts +4 -4
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/shared/kitCopy.js +1 -1
  54. package/dist/shared/kitRegistry.d.ts +2 -2
  55. package/dist/shared/optionStateColors.d.ts +2 -2
  56. package/dist/shared/optionStateColors.js +4 -4
  57. package/dist/style-no-fonts.css +1 -1
  58. package/dist/style.css +1 -1
  59. package/dist/style.layer.css +2 -2
  60. package/dist/style.shell.css +3 -3
  61. package/dist/urfu-ui-kit-react.js +12 -12
  62. package/dist/utils/describeError.d.ts +27 -0
  63. package/dist/utils/describeError.d.ts.map +1 -1
  64. package/dist/vanilla/core/dateMask.js +1 -1
  65. package/dist/vanilla/core/describeError.js +42 -37
  66. package/package.json +1 -1
@@ -2,39 +2,38 @@ import { jsxs as a, jsx as i } from "react/jsx-runtime";
2
2
  import { useAutoId$u as h } from "../../hooks/useAutoId.js";
3
3
  import { Button$u as e } from "../Button/Button.js";
4
4
  import { Modal$u as _ } from "../Modal/Modal.js";
5
- /* empty css */
6
5
  /* empty css */
7
- const k = ({
6
+ const j = ({
8
7
  active: m,
9
8
  title: c,
10
9
  description: r,
11
10
  onCancel: t,
12
- onConfirm: o,
11
+ onConfirm: l,
13
12
  confirmText: d = "Да",
14
13
  cancelText: n = "Нет",
15
14
  confirmVariant: s = "primary",
16
15
  confirmDisabled: u = !1,
17
- className: p = "",
18
- ...f
16
+ className: f = "",
17
+ ...p
19
18
  }) => {
20
- const l = h(void 0, "u-confirm-modal-title");
19
+ const o = h(void 0, "u-confirm-modal-title");
21
20
  return /* @__PURE__ */ a(
22
21
  _,
23
22
  {
24
- ...f,
25
- ariaLabelledBy: l,
23
+ ...p,
24
+ ariaLabelledBy: o,
26
25
  active: m,
27
26
  onCancel: t,
28
- className: `u-react-confirm-modal ${p}`,
27
+ className: `u-react-confirm-modal ${f}`,
29
28
  children: [
30
- /* @__PURE__ */ i("h3", { id: l, className: "u-react-confirm-modal__title", children: c }),
29
+ /* @__PURE__ */ i("h3", { id: o, className: "u-react-confirm-modal__title", children: c }),
31
30
  r ? /* @__PURE__ */ i("div", { className: "u-react-confirm-modal__description", children: r }) : null,
32
31
  /* @__PURE__ */ a("div", { className: "u-react-confirm-modal__actions", children: [
33
32
  /* @__PURE__ */ i(e, { type: "button", variant: "simple", onClick: t, children: n }),
34
- o ? /* @__PURE__ */ i(e, { type: "button", variant: s, disabled: u, onClick: o, children: d }) : null
33
+ l ? /* @__PURE__ */ i(e, { type: "button", variant: s, disabled: u, onClick: l, children: d }) : null
35
34
  ] })
36
35
  ]
37
36
  }
38
37
  );
39
38
  };
40
- export { k as ConfirmModal$u };
39
+ export { j as ConfirmModal$u };
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,qDAAqD,CAAC;AAE7D;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,oKAgBpB,gBAAgB,gCAyElB,CAAC"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,0BAA0B,CAAC;AAClC,OAAO,qDAAqD,CAAC;AAG7D;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,oKAgBpB,gBAAgB,gCAyElB,CAAC"}
@@ -1,15 +1,16 @@
1
1
  import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
- import { useRef as N, useId as R, useEffect as l } from "react";
3
- import { createPortal as F } from "react-dom";
4
- import { useMountTransition$u as T } from "../../hooks/useMountTransition.js";
5
- import { useModalFocus$u as j, ModalFocusContext$u as D, isTopModal$u as H } from "../Modal/useModalFocus.js";
6
- import { getPortalScopeProps$u as L } from "../../shared/uiKitDefaults.js";
2
+ import { useRef as N, useEffect as l } from "react";
3
+ import { createPortal as R } from "react-dom";
4
+ import { useMountTransition$u as F } from "../../hooks/useMountTransition.js";
5
+ import { useModalFocus$u as T, ModalFocusContext$u as j, isTopModal$u as A } from "../Modal/useModalFocus.js";
6
+ import { getPortalScopeProps$u as D } from "../../shared/uiKitDefaults.js";
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import { lockKitScroll$u as O, ownKitNode$u as S, isKitEventHandled$u as A, markKitEventHandled$u as B } from "../../vanilla/core/kitRegistry.js";
10
+ import { useAutoId$u as H } from "../../hooks/useAutoId.js";
11
+ import { lockKitScroll$u as L, ownKitNode$u as O, isKitEventHandled$u as S, markKitEventHandled$u as B } from "../../vanilla/core/kitRegistry.js";
11
12
  import { MOTION_MS$u as q } from "../../vanilla/core/motion.js";
12
- const er = ({
13
+ const tr = ({
13
14
  open: r,
14
15
  onClose: s,
15
16
  side: k = "right",
@@ -26,26 +27,26 @@ const er = ({
26
27
  trapFocus: K = !0,
27
28
  initialFocus: P = "first"
28
29
  }) => {
29
- const n = N(null), w = R(), { shouldRender: _, status: h, isAnimated: b } = T({ isOpen: r, duration: q.base }), { scope: i, onFocusCapture: $ } = j(n, r, K, P), d = N(s);
30
- if (d.current = s, l(() => {
30
+ const i = N(null), w = H(void 0, "u-drawer-title"), { shouldRender: _, status: h, isAnimated: b } = F({ isOpen: r, duration: q.base }), { scope: n, onFocusCapture: $ } = T(i, r, K, P), o = N(s);
31
+ if (o.current = s, l(() => {
31
32
  if (!r || !p) return;
32
- const t = (o) => {
33
- o.key !== "Escape" || o.defaultPrevented || A(o) || !H(i) || (B(o), d.current());
33
+ const t = (d) => {
34
+ d.key !== "Escape" || d.defaultPrevented || S(d) || !A(n) || (B(d), o.current());
34
35
  };
35
36
  return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
36
- }, [r, p, i]), l(() => {
37
+ }, [r, p, n]), l(() => {
37
38
  if (!(!r || !v))
38
- return O();
39
+ return L();
39
40
  }, [r, v]), l(() => {
40
- const t = n.current;
41
- return t ? S(t) : void 0;
41
+ const t = i.current;
42
+ return t ? O(t) : void 0;
42
43
  }, [_]), !_ || typeof document > "u") return null;
43
44
  const C = b && h !== "open", I = b && h === "exiting", y = x ?? (a ? w : void 0);
44
- return F(
45
- /* @__PURE__ */ e(D.Provider, { value: i, children: /* @__PURE__ */ u(
45
+ return R(
46
+ /* @__PURE__ */ e(j.Provider, { value: n, children: /* @__PURE__ */ u(
46
47
  "div",
47
48
  {
48
- ...L(),
49
+ ...D(),
49
50
  className: `u-drawer u-drawer--${k}${C ? " u-drawer--hidden" : ""}${I ? " u-drawer--leaving" : ""}${f ? ` ${f}` : ""}`,
50
51
  children: [
51
52
  /* @__PURE__ */ e(
@@ -53,13 +54,13 @@ const er = ({
53
54
  {
54
55
  className: "u-drawer__backdrop",
55
56
  "aria-hidden": "true",
56
- onClick: E ? () => d.current() : void 0
57
+ onClick: E ? () => o.current() : void 0
57
58
  }
58
59
  ),
59
60
  /* @__PURE__ */ u(
60
61
  "div",
61
62
  {
62
- ref: n,
63
+ ref: i,
63
64
  className: "u-drawer__panel",
64
65
  role: "dialog",
65
66
  tabIndex: -1,
@@ -71,7 +72,7 @@ const er = ({
71
72
  children: [
72
73
  /* @__PURE__ */ u("div", { className: "u-drawer__header", children: [
73
74
  a ? /* @__PURE__ */ e("h2", { id: w, className: "u-drawer__title", children: a }) : null,
74
- /* @__PURE__ */ e("button", { type: "button", className: "u-button-cross u-drawer__close", "aria-label": "Закрыть", onClick: () => d.current() })
75
+ /* @__PURE__ */ e("button", { type: "button", className: "u-button-cross u-drawer__close", "aria-label": "Закрыть", onClick: () => o.current() })
75
76
  ] }),
76
77
  /* @__PURE__ */ e("div", { className: "u-drawer__body", children: M }),
77
78
  m ? /* @__PURE__ */ e("div", { className: "u-drawer__footer", children: m }) : null
@@ -84,4 +85,4 @@ const er = ({
84
85
  document.body
85
86
  );
86
87
  };
87
- export { er as Drawer$u };
88
+ export { tr as Drawer$u };
@@ -1,15 +1,15 @@
1
- import { jsxs as a, jsx as o, Fragment as le } from "react/jsx-runtime";
2
- import { useRef as P, useState as y, useEffect as ce, useLayoutEffect as ve, useMemo as Ee } from "react";
3
- import { useAutoId$u as be } from "../../hooks/useAutoId.js";
1
+ import { jsxs as a, jsx as n, Fragment as ne } from "react/jsx-runtime";
2
+ import { useRef as x, useState as y, useEffect as oe, useLayoutEffect as Ee, useMemo as be } from "react";
3
+ import { useAutoId$u as we } from "../../hooks/useAutoId.js";
4
4
  import { Button$u as N } from "../Button/Button.js";
5
5
  import { Card$u as Ce } from "../Card/Card.js";
6
- import { Message$u as we } from "../Message/Message.js";
7
- import { Modal$u as ge } from "../Modal/Modal.js";
8
- import { ErrorScreenIllustration$u as ye, ErrorScreenDecor$u as q } from "./ErrorScreenIllustration.js";
6
+ import { Message$u as ge } from "../Message/Message.js";
7
+ import { Modal$u as ye } from "../Modal/Modal.js";
8
+ import { ErrorScreenIllustration$u as Ne, ErrorScreenDecor$u as j } from "./ErrorScreenIllustration.js";
9
9
  /* empty css */
10
10
  /* empty css */
11
- import { describeError$u as Ne, DEFAULT_SUPPORT_EMAIL$u as Se, DEFAULT_SUPPORT_LABEL$u as Le, formatErrorDetails$u as Re, getErrorReportConfig$u as ke, supportMailto$u as Ae } from "../../vanilla/core/describeError.js";
12
- const _e = {
11
+ import { describeError$u as Se, DEFAULT_SUPPORT_EMAIL$u as Le, DEFAULT_SUPPORT_LABEL$u as Re, supportMailto$u as le, formatErrorDetails$u as Ae, getErrorReportConfig$u as _e } from "../../vanilla/core/describeError.js";
12
+ const ke = {
13
13
  notFound: { code: "404", title: "Страница не найдена", text: "Возможно, страница была удалена или адрес введён с ошибкой." },
14
14
  forbidden: { code: "403", title: "Нет доступа к странице", text: "Права вашей роли не позволяют открыть этот раздел." },
15
15
  serverError: { code: "500", title: "Ошибка в работе сервиса", text: "Попробуйте обновить страницу. Если ошибка повторится, обратитесь в техническую поддержку." },
@@ -20,64 +20,64 @@ const _e = {
20
20
  serverError: "error",
21
21
  maintenance: "maintenance"
22
22
  }, Oe = '[id^="__qiankun_microapp_wrapper_for_"]';
23
- function Ie() {
23
+ function De() {
24
24
  return typeof window < "u" && !!window.__POWERED_BY_QIANKUN__;
25
25
  }
26
- function xe(r) {
26
+ function Ie(r) {
27
27
  for (let e = r.parentElement; e && e !== document.body; e = e.parentElement) {
28
- const { overflowY: t } = getComputedStyle(e);
29
- if (t === "auto" || t === "scroll") return e;
28
+ const { overflowY: o } = getComputedStyle(e);
29
+ if (o === "auto" || o === "scroll") return e;
30
30
  }
31
31
  return r;
32
32
  }
33
- function Pe(r, e) {
34
- const t = [];
35
- for (let n = r; n && n !== e; n = n.parentElement) {
36
- const d = n.parentElement;
33
+ function xe(r, e) {
34
+ const o = [];
35
+ for (let t = r; t && t !== e; t = t.parentElement) {
36
+ const d = t.parentElement;
37
37
  if (!d) break;
38
38
  for (const i of Array.from(d.children))
39
- i !== n && i instanceof HTMLElement && !i.inert && (i.inert = !0, t.push(i));
39
+ i !== t && i instanceof HTMLElement && !i.inert && (i.inert = !0, o.push(i));
40
40
  }
41
- return () => t.forEach((n) => {
42
- n.inert = !1;
41
+ return () => o.forEach((t) => {
42
+ t.inert = !1;
43
43
  });
44
44
  }
45
45
  function Je({
46
46
  variant: r,
47
47
  error: e,
48
- subject: t,
49
- operation: n,
48
+ subject: o,
49
+ operation: t,
50
50
  notFoundIsPage: d,
51
51
  onRetry: i,
52
52
  onLogin: u,
53
53
  onHome: m,
54
54
  showDetails: b,
55
- supportEmail: C,
55
+ supportEmail: w,
56
56
  supportLabel: S,
57
57
  onSupport: L,
58
- title: z,
58
+ title: P,
59
59
  text: R,
60
60
  code: p,
61
- illustration: k,
61
+ illustration: A,
62
62
  reasons: h,
63
63
  reasonsTitle: F,
64
64
  onAction: s,
65
- actionLabel: A,
65
+ actionLabel: _,
66
66
  secondaryActionLabel: K,
67
67
  onSecondaryAction: Y,
68
68
  loading: V = !1,
69
- className: B = "",
70
- fullScreen: w = !1
69
+ className: z = "",
70
+ fullScreen: C = !1
71
71
  }) {
72
- const G = P(null), J = P(null), D = P(null), [ie] = y(Ie), [se, ae] = y(null), [ue, de] = y(!1), v = w && ie && !ue;
73
- ce(() => {
72
+ const G = x(null), J = x(null), B = x(null), [ce] = y(De), [ie, se] = y(null), [ae, de] = y(!1), v = C && ce && !ae;
73
+ oe(() => {
74
74
  const c = G.current;
75
- if (!w || v || !c) return;
76
- const f = (T) => T.preventDefault();
77
- return c.setAttribute("closedby", "none"), c.addEventListener("cancel", f), c.showModal(), oe(D.current), () => {
75
+ if (!C || v || !c) return;
76
+ const f = (O) => O.preventDefault();
77
+ return c.setAttribute("closedby", "none"), c.addEventListener("cancel", f), c.showModal(), te(B.current), () => {
78
78
  c.removeEventListener("cancel", f), c.close();
79
79
  };
80
- }, [w, v]), ve(() => {
80
+ }, [C, v]), Ee(() => {
81
81
  const c = J.current;
82
82
  if (!v || !c) return;
83
83
  const f = c.closest(Oe);
@@ -85,48 +85,48 @@ function Je({
85
85
  de(!0);
86
86
  return;
87
87
  }
88
- const T = xe(f), O = () => {
89
- const I = T.getBoundingClientRect();
90
- ae({ top: I.top, left: I.left, width: I.width, height: I.height });
88
+ const O = Ie(f), D = () => {
89
+ const I = O.getBoundingClientRect();
90
+ se({ top: I.top, left: I.left, width: I.width, height: I.height });
91
91
  };
92
- O();
93
- const E = typeof ResizeObserver > "u" ? null : new ResizeObserver(O);
94
- E == null || E.observe(T), window.addEventListener("resize", O);
95
- const he = Pe(c, f), j = document.activeElement instanceof HTMLElement ? document.activeElement : null;
96
- return oe(D.current), () => {
97
- E == null || E.disconnect(), window.removeEventListener("resize", O), he(), j == null || j.focus();
92
+ D();
93
+ const E = typeof ResizeObserver > "u" ? null : new ResizeObserver(D);
94
+ E == null || E.observe(O), window.addEventListener("resize", D);
95
+ const ve = xe(c, f), W = document.activeElement instanceof HTMLElement ? document.activeElement : null;
96
+ return te(B.current), () => {
97
+ E == null || E.disconnect(), window.removeEventListener("resize", D), ve(), W == null || W.focus();
98
98
  };
99
99
  }, [v]);
100
- const l = Ee(() => {
100
+ const l = be(() => {
101
101
  if (e == null) return;
102
- const c = Ne(e, { subject: t, operation: n, notFoundIsPage: d });
102
+ const c = Se(e, { subject: o, operation: t, notFoundIsPage: d });
103
103
  return c.group === "aborted" ? void 0 : c;
104
- }, [e, t, n, d]), X = r ?? (l == null ? void 0 : l.variant) ?? "serverError", _ = _e[X], M = p !== void 0 ? p : l ? l.code : _.code, U = k ?? (p != null ? "none" : Te[X]), g = h != null && h.length ? h : null, $ = M ?? void 0, H = z ?? (l == null ? void 0 : l.title) ?? _.title, Q = typeof H == "string" ? H : _.title, me = !!(K && Y), Z = ze(l, { onAction: s, actionLabel: A, onRetry: i, onLogin: u, onHome: m }), ee = Me({ supportEmail: C, supportLabel: S, onSupport: L }), re = !!l && b !== !1, [fe, te] = y(!1), pe = [
104
+ }, [e, o, t, d]), X = r ?? (l == null ? void 0 : l.variant) ?? "serverError", k = ke[X], M = p !== void 0 ? p : l ? l.code : k.code, U = A ?? (p != null ? "none" : Te[X]), g = h != null && h.length ? h : null, $ = M ?? void 0, H = P ?? (l == null ? void 0 : l.title) ?? k.title, T = typeof H == "string" ? H : k.title, ue = !!(K && Y), Z = Pe(l, { onAction: s, actionLabel: _, onRetry: i, onLogin: u, onHome: m }), ee = Me({ supportEmail: w, supportLabel: S, onSupport: L }), me = !!l && b !== !1, [fe, pe] = y(!1), he = [
105
105
  "u-error-screen-card",
106
106
  U !== "none" && "u-error-screen-card--illustrated",
107
107
  g && "u-error-screen-card--reasons"
108
- ].filter(Boolean).join(" "), W = /* @__PURE__ */ a(Ce, { className: pe, children: [
109
- U !== "none" ? /* @__PURE__ */ o(ye, { name: U }) : M !== null && /* @__PURE__ */ o("span", { className: "u-error-screen-code", "aria-hidden": "true", children: M }),
108
+ ].filter(Boolean).join(" "), Q = /* @__PURE__ */ a(Ce, { className: he, children: [
109
+ U !== "none" ? /* @__PURE__ */ n(Ne, { name: U }) : M !== null && /* @__PURE__ */ n("span", { className: "u-error-screen-code", "aria-hidden": "true", children: M }),
110
110
  /* @__PURE__ */ a("div", { className: "u-error-screen-message", children: [
111
- /* @__PURE__ */ o("p", { className: "u-error-screen-title", children: H }),
112
- (R !== void 0 || l || !g) && /* @__PURE__ */ o("p", { className: "u-error-screen-description", children: De(R ?? (l == null ? void 0 : l.text) ?? _.text, ee.email, re ? () => te(!0) : void 0) }),
111
+ /* @__PURE__ */ n("p", { className: "u-error-screen-title", children: H }),
112
+ (R !== void 0 || l || !g) && /* @__PURE__ */ n("p", { className: "u-error-screen-description", children: Be(R ?? (l == null ? void 0 : l.text) ?? k.text, ee.email, l ? { ...l, title: T } : void 0) }),
113
113
  g && /* @__PURE__ */ a("div", { className: "u-error-screen-reasons", children: [
114
- /* @__PURE__ */ o("p", { className: "u-error-screen-reasons-title", children: F ?? (g.length > 1 ? "Причины" : "Причина") }),
115
- /* @__PURE__ */ o("ul", { className: "u-error-screen-reasons-list", children: g.map((c, f) => /* @__PURE__ */ o("li", { children: c }, f)) })
114
+ /* @__PURE__ */ n("p", { className: "u-error-screen-reasons-title", children: F ?? (g.length > 1 ? "Причины" : "Причина") }),
115
+ /* @__PURE__ */ n("ul", { className: "u-error-screen-reasons-list", children: g.map((c, f) => /* @__PURE__ */ n("li", { children: c }, f)) })
116
116
  ] })
117
117
  ] }),
118
- /* @__PURE__ */ a("div", { className: "u-error-screen-actions", ref: D, children: [
119
- me && /* @__PURE__ */ o(N, { size: "small", variant: "simple", disabled: V, onClick: Y, children: K }),
120
- /* @__PURE__ */ o(N, { size: "small", loading: V, onClick: Z.onClick, children: Z.label })
118
+ /* @__PURE__ */ a("div", { className: "u-error-screen-actions", ref: B, children: [
119
+ ue && /* @__PURE__ */ n(N, { size: "small", variant: "simple", disabled: V, onClick: Y, children: K }),
120
+ /* @__PURE__ */ n(N, { size: "small", loading: V, onClick: Z.onClick, children: Z.label })
121
121
  ] }),
122
- l && re && /* @__PURE__ */ o(
122
+ l && me && /* @__PURE__ */ n(
123
123
  Ue,
124
124
  {
125
- description: { ...l, title: Q },
126
- inDialog: w && !v,
125
+ description: { ...l, title: T },
126
+ inDialog: C && !v,
127
127
  support: ee,
128
128
  open: fe,
129
- onOpenChange: te
129
+ onOpenChange: pe
130
130
  }
131
131
  )
132
132
  ] });
@@ -135,118 +135,120 @@ function Je({
135
135
  {
136
136
  ref: J,
137
137
  role: "dialog",
138
- "aria-label": Q,
139
- style: se ?? void 0,
138
+ "aria-label": T,
139
+ style: ie ?? void 0,
140
140
  "data-error-code": $,
141
- className: `u-error-screen u-error-screen-fullscreen u-error-screen-area ${B}`,
141
+ className: `u-error-screen u-error-screen-fullscreen u-error-screen-area ${z}`,
142
142
  children: [
143
- /* @__PURE__ */ o(q, {}),
144
- W
143
+ /* @__PURE__ */ n(j, {}),
144
+ Q
145
145
  ]
146
146
  }
147
- ) : w ? /* @__PURE__ */ a(
147
+ ) : C ? /* @__PURE__ */ a(
148
148
  "dialog",
149
149
  {
150
150
  ref: G,
151
- className: `u-error-screen u-error-screen-fullscreen ${B}`,
152
- "aria-label": Q,
151
+ className: `u-error-screen u-error-screen-fullscreen ${z}`,
152
+ "aria-label": T,
153
153
  "data-error-code": $,
154
154
  children: [
155
- /* @__PURE__ */ o(q, {}),
156
- W
155
+ /* @__PURE__ */ n(j, {}),
156
+ Q
157
157
  ]
158
158
  }
159
- ) : /* @__PURE__ */ a("div", { className: `u-error-screen ${B}`, role: "alert", "data-error-code": $, children: [
160
- /* @__PURE__ */ o(q, {}),
161
- W
159
+ ) : /* @__PURE__ */ a("div", { className: `u-error-screen ${z}`, role: "alert", "data-error-code": $, children: [
160
+ /* @__PURE__ */ n(j, {}),
161
+ Q
162
162
  ] });
163
163
  }
164
- const ne = () => window.location.reload();
165
- function oe(r) {
164
+ const re = () => window.location.reload();
165
+ function te(r) {
166
166
  var e;
167
167
  (e = r == null ? void 0 : r.querySelector("button:last-of-type")) == null || e.focus();
168
168
  }
169
- function ze(r, e) {
170
- const t = e.actionLabel;
171
- if (e.onAction) return { label: t ?? (r ? "Повторить" : "Обновить страницу"), onClick: e.onAction };
172
- if (!r) return { label: t ?? "Обновить страницу", onClick: e.onRetry ?? ne };
173
- const n = { label: t ?? "Обновить страницу", onClick: ne };
169
+ function Pe(r, e) {
170
+ const o = e.actionLabel;
171
+ if (e.onAction) return { label: o ?? (r ? "Повторить" : "Обновить страницу"), onClick: e.onAction };
172
+ if (!r) return { label: o ?? "Обновить страницу", onClick: e.onRetry ?? re };
173
+ const t = { label: o ?? "Обновить страницу", onClick: re };
174
174
  switch (r.action) {
175
175
  case "login":
176
- return e.onLogin ? { label: t ?? r.actionLabel, onClick: e.onLogin } : n;
176
+ return e.onLogin ? { label: o ?? r.actionLabel, onClick: e.onLogin } : t;
177
177
  case "home":
178
- return e.onHome ? { label: t ?? r.actionLabel, onClick: e.onHome } : n;
178
+ return e.onHome ? { label: o ?? r.actionLabel, onClick: e.onHome } : t;
179
179
  case "retry":
180
180
  case "wait":
181
181
  case "fix":
182
- return e.onRetry ? { label: t ?? r.actionLabel, onClick: e.onRetry } : n;
182
+ return e.onRetry ? { label: o ?? r.actionLabel, onClick: e.onRetry } : t;
183
183
  default:
184
- return n;
184
+ return t;
185
185
  }
186
186
  }
187
- const Be = 2e3, x = "техническую поддержку";
188
- function De(r, e, t) {
189
- if (typeof r != "string") return r;
190
- const n = r.indexOf(x);
191
- return n < 0 || !e && !t ? r : /* @__PURE__ */ a(le, { children: [
192
- r.slice(0, n),
193
- t ? /* @__PURE__ */ o("button", { type: "button", className: "u-link u-error-screen-support-link", onClick: t, children: x }) : x,
194
- e && `: ${e}`,
195
- r.slice(n + x.length)
187
+ const ze = 2e3, q = "техническую поддержку";
188
+ function Be(r, e, o) {
189
+ if (typeof r != "string" || !e) return r;
190
+ const t = r.indexOf(q) + q.length;
191
+ if (t < q.length) return r;
192
+ const d = o ? le(o, e) : `mailto:${e}`;
193
+ return /* @__PURE__ */ a(ne, { children: [
194
+ r.slice(0, t),
195
+ ": ",
196
+ /* @__PURE__ */ n("a", { className: "u-link", href: d, children: e }),
197
+ r.slice(t)
196
198
  ] });
197
199
  }
198
200
  function Me(r) {
199
- const e = ke();
200
- return { email: r.supportEmail !== void 0 ? r.supportEmail : e.supportEmail !== void 0 ? e.supportEmail : Se, label: r.supportLabel ?? e.supportLabel ?? Le, onSupport: r.onSupport ?? e.onSupport };
201
+ const e = _e();
202
+ return { email: r.supportEmail !== void 0 ? r.supportEmail : e.supportEmail !== void 0 ? e.supportEmail : Le, label: r.supportLabel ?? e.supportLabel ?? Re, onSupport: r.onSupport ?? e.onSupport };
201
203
  }
202
- function Ue({ description: r, support: e, inDialog: t, open: n, onOpenChange: d }) {
203
- const i = e.email, [u, m] = y("idle"), b = P(null), C = Re(r), S = () => {
204
+ function Ue({ description: r, support: e, inDialog: o, open: t, onOpenChange: d }) {
205
+ const i = e.email, [u, m] = y("idle"), b = x(null), w = Ae(r), S = () => {
204
206
  const s = window.getSelection();
205
207
  s && b.current && s.selectAllChildren(b.current);
206
- }, L = (s, A) => {
208
+ }, L = (s, _) => {
207
209
  if (!navigator.clipboard) {
208
- S(), A();
210
+ S(), _();
209
211
  return;
210
212
  }
211
- navigator.clipboard.writeText(C).then(s, () => {
212
- S(), A();
213
+ navigator.clipboard.writeText(w).then(s, () => {
214
+ S(), _();
213
215
  });
214
- }, z = () => L(() => m("copied"), () => m("selected")), R = () => {
215
- const s = i ? Ae(r, i) : null;
216
+ }, P = () => L(() => m("copied"), () => m("selected")), R = () => {
217
+ const s = i ? le(r, i) : null;
216
218
  if (e.onSupport) {
217
- e.onSupport({ report: C, description: r, mailto: s });
219
+ e.onSupport({ report: w, description: r, mailto: s });
218
220
  return;
219
221
  }
220
222
  s && (L(() => m("mailCopied"), () => m("mailSelected")), window.open(s, "_self"));
221
223
  };
222
- ce(() => {
224
+ oe(() => {
223
225
  if (u !== "copied") return;
224
- const s = setTimeout(() => m("idle"), Be);
226
+ const s = setTimeout(() => m("idle"), ze);
225
227
  return () => clearTimeout(s);
226
228
  }, [u]);
227
- const p = u === "copied" ? "Скопировано" : u === "selected" ? "Выделено — нажмите Ctrl+C" : "Скопировать", k = u === "mailCopied" ? `Открываем письмо. Если почта не открылась — текст скопирован, вставьте его в письмо на ${i}` : u === "mailSelected" ? `Открываем письмо. Если почта не открылась — текст выделен: нажмите Ctrl+C и вставьте его в письмо на ${i}` : "", h = be(void 0, "u-error-screen-details-title");
228
- return /* @__PURE__ */ a(le, { children: [
229
- /* @__PURE__ */ o(N, { size: "small", variant: "text", onClick: () => d(!0), children: "Подробности для технической поддержки" }),
229
+ const p = u === "copied" ? "Скопировано" : u === "selected" ? "Выделено — нажмите Ctrl+C" : "Скопировать", A = u === "mailCopied" ? `Открываем письмо. Если почта не открылась — текст скопирован, вставьте его в письмо на ${i}` : u === "mailSelected" ? `Открываем письмо. Если почта не открылась — текст выделен: нажмите Ctrl+C и вставьте его в письмо на ${i}` : "", h = we(void 0, "u-error-screen-details-title");
230
+ return /* @__PURE__ */ a(ne, { children: [
231
+ /* @__PURE__ */ n(N, { size: "small", variant: "text", onClick: () => d(!0), children: "Подробности для технической поддержки" }),
230
232
  /* @__PURE__ */ a(
231
- ge,
233
+ ye,
232
234
  {
233
- active: n,
235
+ active: t,
234
236
  onCancel: () => {
235
237
  d(!1), m("idle");
236
238
  },
237
239
  unmountOnClose: !0,
238
- portalOn: !t,
240
+ portalOn: !o,
239
241
  ariaLabelledBy: h,
240
242
  maxWidth: "640px",
241
243
  className: "u-error-screen-details-modal",
242
244
  children: [
243
- /* @__PURE__ */ o("h3", { id: h, className: "u-error-screen-details-title", children: "Подробности для технической поддержки" }),
244
- /* @__PURE__ */ o("pre", { ref: b, className: "u-error-screen-report", children: C }),
245
+ /* @__PURE__ */ n("h3", { id: h, className: "u-error-screen-details-title", children: "Подробности для технической поддержки" }),
246
+ /* @__PURE__ */ n("pre", { ref: b, className: "u-error-screen-report", children: w }),
245
247
  /* @__PURE__ */ a("div", { className: "u-error-screen-copy", children: [
246
- /* @__PURE__ */ o(N, { size: "small", variant: "text", onClick: z, children: p }),
247
- (i || e.onSupport) && /* @__PURE__ */ o(N, { size: "small", onClick: R, children: e.label })
248
+ /* @__PURE__ */ n(N, { size: "small", variant: "text", onClick: P, children: p }),
249
+ (i || e.onSupport) && /* @__PURE__ */ n(N, { size: "small", onClick: R, children: e.label })
248
250
  ] }),
249
- /* @__PURE__ */ o("div", { className: "u-error-screen-copy-status", role: "status", "aria-live": "polite", children: k ? /* @__PURE__ */ o(we, { size: "small", children: k }) : u !== "idle" && /* @__PURE__ */ o("span", { className: "u-error-screen-sr-only", children: p }) })
251
+ /* @__PURE__ */ n("div", { className: "u-error-screen-copy-status", role: "status", "aria-live": "polite", children: A ? /* @__PURE__ */ n(ge, { size: "small", children: A }) : u !== "idle" && /* @__PURE__ */ n("span", { className: "u-error-screen-sr-only", children: p }) })
250
252
  ]
251
253
  }
252
254
  )