@yourgoods/ui-smart 0.9.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as Oe, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
- import { T as de, c as Ve, _ as Ae, u as Fe, a as Re, P as ye, b as ze } from "./useRateLimitToast-Ca_UAVLG.js";
3
- import { C as D, B as We, p as F, g as He } from "./index-DDRxZ_O5.js";
4
- import { PInput as _, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as _e } from "@profeat/ui-kit";
5
- const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
1
+ import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as De, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
2
+ import { T as de, c as Ve, u as Ae, a as Fe, P as ye, b as Re } from "./useRateLimitToast-C4lhBszJ.js";
3
+ import { C as D, _ as ze, B as We, p as F, g as He } from "./index-Cj73EGum.js";
4
+ import { PInput as G, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as Ge } from "@profeat/ui-kit";
5
+ const Ye = { class: "dialogDefaultContainerInsideContent" }, _e = { class: "dialogDefaultContainerTextHint" }, Je = {
6
6
  key: 0,
7
7
  class: "input-wrapper"
8
8
  }, Ke = {
@@ -63,14 +63,14 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
63
63
  }), v.value = !0;
64
64
  };
65
65
  let $ = "";
66
- const O = (i) => {
66
+ const N = (i) => {
67
67
  r("on-clear-code-error");
68
68
  const l = i.target;
69
69
  let d = l.value.replace(/\D/g, "");
70
70
  d.length > 4 && (d = d.slice(0, 4)), l.value = d, n.codeModel = d, d.length === 4 && d !== $ && ($ = d, r("on-match-code", { email: n.emailModel, code: d }));
71
71
  }, B = () => {
72
72
  r("on-send-code-again", { email: n.emailModel });
73
- }, N = V(() => {
73
+ }, O = V(() => {
74
74
  if (e.value) return e.value;
75
75
  if (n.touched.email) {
76
76
  if (!n.emailModel.trim()) return "Введите e-mail";
@@ -80,17 +80,17 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
80
80
  }), E = V(() => p.isNotMatchCode ? "Неверный код" : n.touched.code ? h.value.trim() ? p.codeError ?? null : "Введите код" : ""), { emailModel: m, codeModel: h } = se(n);
81
81
  return (i, l) => {
82
82
  const d = de;
83
- return y(), k("div", Ge, [
84
- S("div", Ye, K(v.value ? "Введите код подтверждения" : i.hintText), 1),
83
+ return y(), k("div", Ye, [
84
+ S("div", _e, K(v.value ? "Введите код подтверждения" : i.hintText), 1),
85
85
  i.showEmail ? (y(), k("div", Je, [
86
- b(c(_), {
86
+ b(c(G), {
87
87
  modelValue: c(m),
88
88
  "onUpdate:modelValue": l[0] || (l[0] = (C) => Q(m) ? m.value = C : null),
89
89
  size: "large",
90
90
  "text-size": "medium",
91
91
  label: "Почта",
92
92
  type: "email",
93
- error: N.value,
93
+ error: O.value,
94
94
  onBlur: l[1] || (l[1] = (C) => g("email")),
95
95
  onInput: l[2] || (l[2] = (C) => g("email"))
96
96
  }, null, 8, ["modelValue", "error"]),
@@ -113,7 +113,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
113
113
  }, 8, ["disabled"])
114
114
  ])),
115
115
  v.value ? (y(), k("div", Qe, [
116
- b(c(_), {
116
+ b(c(G), {
117
117
  modelValue: c(h),
118
118
  "onUpdate:modelValue": l[4] || (l[4] = (C) => Q(h) ? h.value = C : null),
119
119
  size: "large",
@@ -121,7 +121,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
121
121
  label: "Код",
122
122
  type: "text",
123
123
  error: E.value,
124
- onInput: O,
124
+ onInput: N,
125
125
  onBlur: l[5] || (l[5] = (C) => g("code"))
126
126
  }, null, 8, ["modelValue", "error"])
127
127
  ])) : P("", !0),
@@ -152,23 +152,23 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
152
152
  const p = U, r = M(!1), v = M(""), e = M(""), n = J({
153
153
  newPassword: !1,
154
154
  newPasswordConfirm: !1
155
- }), g = M(D.NEW), s = M(!1), u = M(!1), $ = V(() => s.value ? "text" : "password"), O = V(() => u.value ? "text" : "password"), B = () => {
155
+ }), g = M(D.NEW), s = M(!1), u = M(!1), $ = V(() => s.value ? "text" : "password"), N = V(() => u.value ? "text" : "password"), B = () => {
156
156
  s.value = !s.value;
157
- }, N = () => {
157
+ }, O = () => {
158
158
  u.value = !u.value;
159
159
  }, E = V(() => n.newPassword ? v.value.trim() ? v.value.trim().length < Te ? `Пароль слишком короткий. Введите хотя бы ${Te} символов` : "" : "Введите пароль" : ""), m = V(() => n.newPasswordConfirm ? e.value.trim() ? e.value !== v.value ? "Пароли не совпадают" : "" : "Повторите пароль" : ""), h = V(() => !!(E.value || m.value)), i = V(() => r.value || !v.value.trim() || !e.value.trim() ? !0 : h.value), l = () => {
160
160
  p("update:modelValue", !1), p("close");
161
161
  }, d = async () => {
162
162
  p("update-user", v.value);
163
163
  };
164
- return (C, f) => (y(), k(Oe, null, [
164
+ return (C, f) => (y(), k(De, null, [
165
165
  S("div", et, [
166
166
  S("div", tt, [
167
167
  f[7] || (f[7] = S("div", { class: "dialogDefaultContainerTextHint" }, K("Установите новый пароль для защиты аккаунта. Пароль должен содержать не менее 8 символов."), -1)),
168
168
  S("div", lt, [
169
- b(c(_), {
169
+ b(c(G), {
170
170
  modelValue: v.value,
171
- "onUpdate:modelValue": f[0] || (f[0] = (G) => v.value = G),
171
+ "onUpdate:modelValue": f[0] || (f[0] = (Y) => v.value = Y),
172
172
  size: "large",
173
173
  "text-size": "medium",
174
174
  label: "Новый пароль",
@@ -183,20 +183,20 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
183
183
  }))
184
184
  ]),
185
185
  S("div", at, [
186
- b(c(_), {
186
+ b(c(G), {
187
187
  modelValue: e.value,
188
- "onUpdate:modelValue": f[3] || (f[3] = (G) => e.value = G),
188
+ "onUpdate:modelValue": f[3] || (f[3] = (Y) => e.value = Y),
189
189
  size: "large",
190
190
  "text-size": "medium",
191
191
  label: "Повторите новый пароль",
192
- type: O.value,
192
+ type: N.value,
193
193
  error: m.value,
194
194
  onBlur: f[4] || (f[4] = () => n.newPasswordConfirm = !0),
195
195
  onInput: f[5] || (f[5] = () => n.newPasswordConfirm = !0)
196
196
  }, null, 8, ["modelValue", "type", "error"]),
197
197
  (y(), R(Ce(u.value ? c(ge) : c(he)), {
198
198
  class: "icon-locked",
199
- onClick: N
199
+ onClick: O
200
200
  }))
201
201
  ]),
202
202
  S("div", ot, [
@@ -280,13 +280,13 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
280
280
  h.length > 4 && (h = h.slice(0, 4)), $.value = h, m && m.value !== h && (m.value = h), h.length === 4 && h !== n.value && (n.value = h, r("on-match-code", { email: u.value, code: h }));
281
281
  }, s = () => {
282
282
  r("on-send-code-again", { email: u.value });
283
- }, { emailModel: u, codeModel: $, touched: O } = se(v), B = V(() => O.value.email && !u.value.trim() ? "Введите e-mail" : p.emailError), N = V(() => p.isNotMatchCode ? "Неверный код" : O.value.code ? $.value.trim() ? p.codeError ?? null : "Введите код" : "");
283
+ }, { emailModel: u, codeModel: $, touched: N } = se(v), B = V(() => N.value.email && !u.value.trim() ? "Введите e-mail" : p.emailError), O = V(() => p.isNotMatchCode ? "Неверный код" : N.value.code ? $.value.trim() ? p.codeError ?? null : "Введите код" : "");
284
284
  return (E, m) => {
285
285
  const h = de;
286
286
  return y(), k("div", rt, [
287
287
  S("div", ut, K(E.hintText), 1),
288
288
  E.showEmail ? (y(), k("div", mt, [
289
- b(c(_), {
289
+ b(c(G), {
290
290
  modelValue: c(u),
291
291
  "onUpdate:modelValue": m[0] || (m[0] = (i) => Q(u) ? u.value = i : null),
292
292
  size: "large",
@@ -304,14 +304,14 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
304
304
  })
305
305
  ])) : P("", !0),
306
306
  E.showCode ? (y(), k("div", ct, [
307
- b(c(_), {
307
+ b(c(G), {
308
308
  modelValue: c($),
309
309
  "onUpdate:modelValue": m[4] || (m[4] = (i) => Q($) ? $.value = i : null),
310
310
  size: "large",
311
311
  "text-size": "medium",
312
312
  label: "Код",
313
313
  type: "text",
314
- error: N.value,
314
+ error: O.value,
315
315
  onInput: g,
316
316
  onBlur: m[5] || (m[5] = (i) => e("code"))
317
317
  }, null, 8, ["modelValue", "error"])
@@ -325,7 +325,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
325
325
  ]);
326
326
  };
327
327
  }
328
- }), pt = /* @__PURE__ */ Ae(vt, [["__scopeId", "data-v-5e561fbe"]]), ft = { class: "dialogDefaultContainerInsideContent" }, Et = { class: "dialogDefaultContainerTextHint" }, wt = {
328
+ }), pt = /* @__PURE__ */ ze(vt, [["__scopeId", "data-v-5e561fbe"]]), ft = { class: "dialogDefaultContainerInsideContent" }, Et = { class: "dialogDefaultContainerTextHint" }, wt = {
329
329
  key: 0,
330
330
  class: "input-wrapper"
331
331
  }, Ct = {
@@ -380,14 +380,14 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
380
380
  e.value = "", r("on-send-code", { email: n.emailModel, prevEmail: p.oldEmail, offLoading: !0 }), v.value = !0;
381
381
  };
382
382
  let $ = "";
383
- const O = (l) => {
383
+ const N = (l) => {
384
384
  r("on-clear-code-error");
385
385
  const d = l.target;
386
386
  let C = d.value.replace(/\D/g, "");
387
387
  C.length > 4 && (C = C.slice(0, 4), d.value = C), n.codeModel = C, C.length === 4 && C !== $ && ($ = C, r("on-match-code", { email: n.emailModel, code: C }));
388
388
  }, B = () => {
389
389
  r("on-send-code-again", { email: n.emailModel });
390
- }, { emailModel: N, codeModel: E, touched: m } = se(n), h = V(() => {
390
+ }, { emailModel: O, codeModel: E, touched: m } = se(n), h = V(() => {
391
391
  if (e.value) return e.value;
392
392
  if (n.touched.email) {
393
393
  if (!n.emailModel.trim()) return "Введите e-mail";
@@ -400,9 +400,9 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
400
400
  return y(), k("div", ft, [
401
401
  S("div", Et, K(v.value ? "Введите код подтверждения" : l.hintText), 1),
402
402
  l.showEmail ? (y(), k("div", wt, [
403
- b(c(_), {
404
- modelValue: c(N),
405
- "onUpdate:modelValue": d[0] || (d[0] = (f) => Q(N) ? N.value = f : null),
403
+ b(c(G), {
404
+ modelValue: c(O),
405
+ "onUpdate:modelValue": d[0] || (d[0] = (f) => Q(O) ? O.value = f : null),
406
406
  size: "large",
407
407
  "text-size": "medium",
408
408
  label: "Почта",
@@ -430,7 +430,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
430
430
  }, 8, ["disabled"])
431
431
  ])),
432
432
  v.value ? (y(), k("div", yt, [
433
- b(c(_), {
433
+ b(c(G), {
434
434
  modelValue: c(E),
435
435
  "onUpdate:modelValue": d[4] || (d[4] = (f) => Q(E) ? E.value = f : null),
436
436
  size: "large",
@@ -438,7 +438,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
438
438
  label: "Код",
439
439
  type: "text",
440
440
  error: i.value,
441
- onInput: O,
441
+ onInput: N,
442
442
  onBlur: d[5] || (d[5] = (f) => g("code"))
443
443
  }, null, 8, ["modelValue", "error"])
444
444
  ])) : P("", !0),
@@ -478,7 +478,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
478
478
  code: "",
479
479
  addEmail: "",
480
480
  addCode: ""
481
- }), n = J({ email: !1, code: !1 }), g = M(D.OLD), s = M(null), u = M(!1), $ = M(!1), O = M(!1), B = M(We.VERIFY_EMAIL), N = V(() => B.value === "password-flow"), E = V(() => C.value ? p.title : N.value ? "Добавление пароля" : "Добавление почты"), { startTimer: m, remainingSeconds: h, isAvailableForSendAgain: i, totalRateAttempts: l, currentRateAttempt: d } = Re(), { isEditFlow: C, getFlow: f } = Fe(M(p.mode ?? "edit")), { showRateLimitToast: G } = ze(r), ue = V(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), me = V(() => n.code && !e.code.trim() ? "Введите код" : ""), ae = V(() => i.value ? "Повторить" : `${h.value}`), W = M(Me), be = V(() => W.value === 0), $e = (a) => new Promise((t) => setTimeout(t, a));
481
+ }), n = J({ email: !1, code: !1 }), g = M(D.OLD), s = M(null), u = M(!1), $ = M(!1), N = M(!1), B = M(We.VERIFY_EMAIL), O = V(() => B.value === "password-flow"), E = V(() => C.value ? p.title : O.value ? "Добавление пароля" : "Добавление почты"), { startTimer: m, remainingSeconds: h, isAvailableForSendAgain: i, totalRateAttempts: l, currentRateAttempt: d } = Fe(), { isEditFlow: C, getFlow: f } = Ae(M(p.mode ?? "edit")), { showRateLimitToast: Y } = Re(r), ue = V(() => n.email && !e.oldEmail.trim() ? "Введите e-mail" : ""), me = V(() => n.code && !e.code.trim() ? "Введите код" : ""), ae = V(() => i.value ? "Повторить" : `${h.value}`), W = M(Me), be = V(() => W.value === 0), $e = (a) => new Promise((t) => setTimeout(t, a));
482
482
  j(
483
483
  () => p.modelValue,
484
484
  (a) => v.value = a
@@ -553,15 +553,15 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
553
553
  sessionId: s.value,
554
554
  code: a,
555
555
  step: t
556
- }), ee = ((o = A.data) == null ? void 0 : o.nextStep) ?? ((T = (w = A.data) == null ? void 0 : w.data) == null ? void 0 : T.nextStep) ?? null, Ne = ((x = (I = A.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((H = A.data) == null ? void 0 : H.rateLimit) ?? null, De = A.data.data.success ?? A.data.success;
557
- if (G(Ne), !De) {
556
+ }), ee = ((o = A.data) == null ? void 0 : o.nextStep) ?? ((T = (w = A.data) == null ? void 0 : w.data) == null ? void 0 : T.nextStep) ?? null, Ne = ((x = (I = A.data) == null ? void 0 : I.data) == null ? void 0 : x.rateLimit) ?? ((H = A.data) == null ? void 0 : H.rateLimit) ?? null, Oe = A.data.data.success ?? A.data.success;
557
+ if (Y(Ne), !Oe) {
558
558
  $.value = !0;
559
559
  return;
560
560
  }
561
561
  if (ee) {
562
562
  if (g.value = ee, g.value === D.NEW) {
563
- const Y = await ie();
564
- e.oldEmail = (Y == null ? void 0 : Y.oldValue) ?? e.oldEmail, e.newEmail = (Y == null ? void 0 : Y.newValue) ?? e.newEmail, e.code = "";
563
+ const _ = await ie();
564
+ e.oldEmail = (_ == null ? void 0 : _.oldValue) ?? e.oldEmail, e.newEmail = (_ == null ? void 0 : _.newValue) ?? e.newEmail, e.code = "";
565
565
  }
566
566
  g.value === D.COMPLETED && (e.code = "", r("submit-email", { email: e.addEmail, code: a }), r("on-toast", { color: "success", text: "E-mail изменён" }), r("on-update-jwt", "email", "edit", e.newEmail), s.value = null, r("close"));
567
567
  }
@@ -626,8 +626,8 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
626
626
  }), H = ((a = x.data) == null ? void 0 : a.nextStep) ?? ((o = (t = x.data) == null ? void 0 : t.data) == null ? void 0 : o.nextStep);
627
627
  B.value = H ?? B.value;
628
628
  const L = ((T = (w = x.data) == null ? void 0 : w.data) == null ? void 0 : T.rateLimit) ?? ((I = x.data) == null ? void 0 : I.rateLimit) ?? null, A = x.data.data.success ?? x.data.success;
629
- if (G(L), !A) {
630
- O.value = !0;
629
+ if (Y(L), !A) {
630
+ N.value = !0;
631
631
  return;
632
632
  }
633
633
  } catch {
@@ -664,7 +664,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
664
664
  }), (a, t) => (y(), R(c(qe), {
665
665
  modelValue: v.value,
666
666
  "onUpdate:modelValue": [
667
- t[17] || (t[17] = (o) => v.value = o),
667
+ t[18] || (t[18] = (o) => v.value = o),
668
668
  oe
669
669
  ],
670
670
  width: "small",
@@ -684,7 +684,7 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
684
684
  S("span", Mt, K(E.value), 1)
685
685
  ]),
686
686
  "right-button": q(() => [
687
- b(c(_e), {
687
+ b(c(Ge), {
688
688
  class: "cross",
689
689
  onClick: oe
690
690
  })
@@ -740,11 +740,11 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
740
740
  }, null, 8, ["email", "oldEmail", "code", "email-error", "code-error", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"])) : P("", !0)
741
741
  ])) : (y(), k("div", bt, [
742
742
  u.value ? (y(), R(ye, { key: 0 })) : P("", !0),
743
- N.value ? (y(), R(dt, {
743
+ O.value ? (y(), R(dt, {
744
744
  key: 2,
745
745
  "model-value": v.value,
746
746
  "email-session-id": s.value,
747
- "onUpdate:modelValue": t[16] || (t[16] = (o) => r("update:modelValue", o)),
747
+ "onUpdate:modelValue": t[17] || (t[17] = (o) => r("update:modelValue", o)),
748
748
  onUpdateUser: Pe,
749
749
  onClose: ke
750
750
  }, null, 8, ["model-value", "email-session-id"])) : (y(), R(Ze, {
@@ -758,12 +758,13 @@ const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dial
758
758
  "hint-text": c(C) ? a.hintText : "Чтобы продолжить, введите новый адрес вашей почты",
759
759
  "rate-limit-text": ae.value,
760
760
  "is-final-limit": be.value,
761
- "is-not-match-code": O.value,
761
+ "is-not-match-code": N.value,
762
762
  loading: u.value,
763
763
  onOnSendCode: t[14] || (t[14] = (o) => we({ value: e.addEmail, field: "email" })),
764
764
  onOnSendCodeAgain: t[15] || (t[15] = (o) => we({ value: e.addEmail, field: "email" })),
765
765
  onOnMatchCode: Be,
766
- onOnMatchCodeError: Le
766
+ onOnMatchCodeError: Le,
767
+ onOnClearCodeError: t[16] || (t[16] = (o) => N.value = !1)
767
768
  }, null, 8, ["email", "oldEmail", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading"]))
768
769
  ]))
769
770
  ])
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
2
- import { C as I, p as D, g as Ve } from "./index-DDRxZ_O5.js";
2
+ import { C as I, p as D, g as Ve } from "./index-Cj73EGum.js";
3
3
  import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
4
4
  function ke(b) {
5
5
  return { showPasswordRateLimitToast: (P) => {
@@ -1,7 +1,7 @@
1
1
  import { createElementBlock as T, openBlock as p, createElementVNode as F, defineComponent as re, reactive as ue, watch as Y, ref as O, toRefs as me, computed as A, createCommentVNode as $, createVNode as S, toDisplayString as W, createBlock as H, createTextVNode as X, unref as r, isRef as te, withCtx as K, onMounted as Ue, Fragment as qe } from "vue";
2
- import { T as fe, c as Oe, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-Ca_UAVLG.js";
2
+ import { T as fe, c as Oe, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-C4lhBszJ.js";
3
3
  import { IconTelegramSm as ge, PInput as oe, IconPhoneMd as Ge, IconMailMd as Le, PButton as De, PDialog as Je, PTopBar as Ke, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
4
- import { C as q, t as Be, p as _, g as Ie } from "./index-DDRxZ_O5.js";
4
+ import { C as q, t as Be, p as _, g as Ie } from "./index-Cj73EGum.js";
5
5
  const Ye = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
@@ -1,11 +1,11 @@
1
- import { ref as v, shallowRef as Ve, defineComponent as _, defineAsyncComponent as L, watch as se, createBlock as I, createCommentVNode as E, unref as i, openBlock as h, resolveDynamicComponent as xe, mergeProps as Ae, computed as b, reactive as R, onMounted as $e, createElementBlock as P, Fragment as ie, createVNode as g, createElementVNode as G, withCtx as F, toDisplayString as D, createTextVNode as J, Teleport as re, Transition as Se, withDirectives as Oe, vShow as Me } from "vue";
1
+ import { ref as h, shallowRef as xe, defineComponent as Y, defineAsyncComponent as R, watch as se, createBlock as I, createCommentVNode as N, unref as u, openBlock as w, resolveDynamicComponent as Ae, mergeProps as $e, computed as C, reactive as G, onMounted as Se, createElementBlock as P, Fragment as ie, createVNode as f, createElementVNode as $, withCtx as D, toDisplayString as F, createTextVNode as _, Teleport as re, Transition as Oe, withDirectives as Me, vShow as Le } from "vue";
2
2
  import ze from "axios";
3
- import { PInputFileUploader as Le, PInput as $, IconFilledEditMd as S, PButton as le, PImageCropper as Re, PToast as Ge, PTeleportContainer as ue, PToastContainer as Je } from "@profeat/ui-kit";
4
- function je(d, r = 2) {
5
- if (d === 0)
3
+ import { PInputFileUploader as Re, PInput as S, IconFilledEditMd as O, PButton as le, PImageCropper as Ge, PToast as _e, PTeleportContainer as ue, PToastContainer as Je } from "@profeat/ui-kit";
4
+ function je(m, r = 2) {
5
+ if (m === 0)
6
6
  return "0 B";
7
- const n = 1024, u = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], w = Math.floor(Math.log(d) / Math.log(n));
8
- return `${Number.parseFloat((d / n ** w).toFixed(r))} ${u[w]}`;
7
+ const n = 1024, s = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], v = Math.floor(Math.log(m) / Math.log(n));
8
+ return `${Number.parseFloat((m / n ** v).toFixed(r))} ${s[v]}`;
9
9
  }
10
10
  const qe = {
11
11
  "image/jpeg": "JPEG",
@@ -15,25 +15,25 @@ const qe = {
15
15
  "application/zip": "ZIP Archive"
16
16
  // ...
17
17
  };
18
- function Ye(d) {
19
- return d.map((r) => {
18
+ function Ye(m) {
19
+ return m.map((r) => {
20
20
  var n;
21
21
  return qe[r] || ((n = r.split("/")[1]) == null ? void 0 : n.toUpperCase());
22
22
  });
23
23
  }
24
- const da = {
24
+ const ga = {
25
25
  OLD: "old",
26
26
  NEW: "new",
27
27
  COMPLETED: "completed"
28
- }, pa = {
28
+ }, va = {
29
29
  VERIFY_EMAIL: "verify-email"
30
30
  };
31
- let q = null;
32
- function _e(d, r) {
33
- q = ze.create({
31
+ let j = null;
32
+ function We(m, r) {
33
+ j = ze.create({
34
34
  baseURL: r,
35
35
  headers: {
36
- Authorization: `Bearer ${d}`,
36
+ Authorization: `Bearer ${m}`,
37
37
  // 'Content-Type': 'application/json',
38
38
  "x-throttler-prefix": "throttler_profile_edit"
39
39
  },
@@ -41,37 +41,37 @@ function _e(d, r) {
41
41
  });
42
42
  }
43
43
  function me() {
44
- if (!q)
44
+ if (!j)
45
45
  throw new Error("Axios instance not initialized. Call initAxios(token, baseUrl) first.");
46
- return q;
46
+ return j;
47
47
  }
48
- async function Y(d, r, n) {
49
- return me().post(d, r, n);
48
+ async function q(m, r, n) {
49
+ return me().post(m, r, n);
50
50
  }
51
- async function ca(d, r) {
52
- return me().get(d, r);
51
+ async function ha(m, r) {
52
+ return me().get(m, r);
53
53
  }
54
- async function We(d) {
55
- const r = await Y("/users/profile/me", d);
54
+ async function Ke(m) {
55
+ const r = await q("/users/profile/me", m);
56
56
  if (console.log("---res: ", r), r.status !== 200 && r.status !== 201 || !r.data)
57
57
  throw new Error("Ошибка при получении профиля пользователя");
58
58
  return r.data;
59
59
  }
60
- const O = v(null), j = Ve(null);
60
+ const M = h(null), J = xe(null);
61
61
  function W() {
62
62
  return {
63
- currentDialog: O,
64
- dialogPayload: j,
65
- openDialog: (u, w) => {
66
- O.value = u, j.value = w ?? null;
63
+ currentDialog: M,
64
+ dialogPayload: J,
65
+ openDialog: (s, v) => {
66
+ M.value = s, J.value = v ?? null;
67
67
  },
68
68
  closeDialog: () => {
69
- O.value = null, j.value = null;
69
+ M.value = null, J.value = null;
70
70
  },
71
- isDialogOpen: (u) => O.value === u
71
+ isDialogOpen: (s) => M.value === s
72
72
  };
73
73
  }
74
- const Ke = {
74
+ const Ze = {
75
75
  ru: {
76
76
  Имя: "Имя",
77
77
  Фамилия: "Фамилия",
@@ -204,57 +204,57 @@ const Ke = {
204
204
  "Введите новый номер телефона": "Enter a new phone number",
205
205
  "Телефон успешно изменен": "Phone number successfully changed"
206
206
  }
207
- }, Ze = /* @__PURE__ */ _({
207
+ }, He = /* @__PURE__ */ Y({
208
208
  __name: "DialogManager",
209
209
  props: {
210
210
  language: {},
211
211
  provider: {}
212
212
  },
213
213
  emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
214
- setup(d, { emit: r }) {
215
- const n = r, u = v(!0), { currentDialog: w, dialogPayload: c, closeDialog: B } = W(), l = {
216
- email: L(() => import("./ProfileEmailDialog-Buthe7kM.js")),
217
- phone: L(() => import("./ProfilePhoneDialog-B-TDgEiG.js")),
218
- password: L(() => import("./ProfilePasswordDialog-Brk_CGyv.js"))
219
- }, m = ({ email: y }) => {
214
+ setup(m, { emit: r }) {
215
+ const n = r, s = h(!0), { currentDialog: v, dialogPayload: g, closeDialog: U } = W(), l = {
216
+ email: R(() => import("./ProfileEmailDialog-CRNFwK3-.js")),
217
+ phone: R(() => import("./ProfilePhoneDialog-BGzDmnCm.js")),
218
+ password: R(() => import("./ProfilePasswordDialog-DW4dkNt4.js"))
219
+ }, d = ({ email: y }) => {
220
220
  n("update-email-field", y);
221
221
  }, p = ({ phone: y }) => {
222
222
  n("update-phone-field", y);
223
223
  };
224
- return se(w, (y) => {
225
- u.value = !!y;
226
- }), (y, s) => i(w) ? (h(), I(xe(l[i(w)]), Ae({
224
+ return se(v, (y) => {
225
+ s.value = !!y;
226
+ }), (y, i) => u(v) ? (w(), I(Ae(l[u(v)]), $e({
227
227
  key: 0,
228
- modelValue: u.value,
229
- "onUpdate:modelValue": s[0] || (s[0] = (f) => u.value = f),
228
+ modelValue: s.value,
229
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => s.value = c),
230
230
  language: y.language,
231
231
  provider: y.provider
232
- }, i(c), {
233
- onClose: i(B),
234
- onCleanInputErrors: s[1] || (s[1] = (f) => n("clean-input-errors")),
235
- onOnUpdateJwt: s[2] || (s[2] = (f, N, o) => n("on-update-jwt", f, N, o)),
236
- onSubmitEmail: m,
232
+ }, u(g), {
233
+ onClose: u(U),
234
+ onCleanInputErrors: i[1] || (i[1] = (c) => n("clean-input-errors")),
235
+ onOnUpdateJwt: i[2] || (i[2] = (c, E, o) => n("on-update-jwt", c, E, o)),
236
+ onSubmitEmail: d,
237
237
  onSubmitPhone: p,
238
- onOnPasswordError: s[3] || (s[3] = (f, N) => n("on-password-error", f, N)),
239
- onOnToast: s[4] || (s[4] = (f) => n("on-toast", f))
240
- }), null, 16, ["modelValue", "language", "provider", "onClose"])) : E("", !0);
238
+ onOnPasswordError: i[3] || (i[3] = (c, E) => n("on-password-error", c, E)),
239
+ onOnToast: i[4] || (i[4] = (c) => n("on-toast", c))
240
+ }), null, 16, ["modelValue", "language", "provider", "onClose"])) : N("", !0);
241
241
  }
242
- }), He = { class: "base-container" }, Qe = { key: 0 }, Xe = { key: 1 }, ea = {
242
+ }), Qe = { class: "base-container" }, Xe = { class: "avatar-wrapper" }, ea = { key: 0 }, aa = { key: 1 }, ta = {
243
+ key: 0,
244
+ class: "input-wrapper"
245
+ }, oa = {
243
246
  key: 1,
244
247
  class: "input-wrapper"
245
- }, aa = {
248
+ }, na = {
246
249
  key: 2,
247
250
  class: "input-wrapper"
248
- }, ta = {
251
+ }, ra = {
249
252
  key: 3,
250
253
  class: "input-wrapper"
251
- }, oa = {
252
- key: 4,
253
- class: "input-wrapper"
254
- }, na = { class: "buttons-container" }, ra = {
254
+ }, la = { class: "buttons-container" }, sa = {
255
255
  key: 0,
256
256
  class: "centered-overlay"
257
- }, la = { class: "toastWrapper" }, sa = /* @__PURE__ */ _({
257
+ }, ia = { class: "toastWrapper" }, ua = /* @__PURE__ */ Y({
258
258
  __name: "PEditUserContact",
259
259
  props: {
260
260
  language: {},
@@ -266,8 +266,8 @@ const Ke = {
266
266
  fields: {}
267
267
  },
268
268
  emits: ["open-email-dialog", "open-phone-dialog", "open-password-dialog", "on-update-jwt", "on-password-error", "update-tokens"],
269
- setup(d, { emit: r }) {
270
- const n = d, u = r, w = b(() => n.language ?? "ru"), c = (e) => Ke[w.value][e] || e, { openDialog: B } = W(), l = R({ firstName: "", lastName: "" }), m = v({ firstName: "", lastName: "" }), p = R({ firstName: !1, lastName: !1, email: !1, phone: !1 }), y = v(""), s = v(""), f = v(""), N = v(!1), o = R({
269
+ setup(m, { emit: r }) {
270
+ const n = m, s = r, v = C(() => n.language ?? "ru"), g = (e) => Ze[v.value][e] || e, { openDialog: U } = W(), l = G({ firstName: "", lastName: "" }), d = h({ firstName: "", lastName: "" }), p = G({ firstName: !1, lastName: !1, email: !1, phone: !1 }), y = h(""), i = h(""), c = h(""), E = h(!1), o = G({
271
271
  value: null,
272
272
  loading: !1,
273
273
  accept: ["image/png", "image/jpeg"],
@@ -275,27 +275,25 @@ const Ke = {
275
275
  // 10mb вроде
276
276
  imageBinary: null,
277
277
  imageContent: ""
278
- }), K = v(!1), V = v(!1), x = v(!1), Z = v(!0), H = v(!0), Q = v(void 0), X = v(""), de = b(() => ae(l.firstName, p.firstName)), pe = b(() => ae(l.lastName, p.lastName)), ce = b(() => p.email && !s.value.trim() ? "Введите e-mail" : ""), fe = b(() => p.phone && !f.value.trim() ? "Введите номер телефона" : ""), U = (e) => n.fields.some((a) => a.key === e), ee = (e) => e && e.trim() ? "edit" : "bind", M = () => setTimeout(() => {
278
+ }), K = h(!1), V = h(!1), x = h(!1), Z = h(!0), H = h(!0), Q = h(void 0), X = h(""), de = C(() => ae(l.firstName, p.firstName)), pe = C(() => ae(l.lastName, p.lastName)), ce = C(() => p.email && !i.value.trim() ? "Введите e-mail" : ""), fe = C(() => p.phone && !c.value.trim() ? "Введите номер телефона" : ""), B = (e) => n.fields.some((a) => a.key === e), ee = (e) => e && e.trim() ? "edit" : "bind", L = () => setTimeout(() => {
279
279
  var e;
280
280
  return (e = document.activeElement) == null ? void 0 : e.blur();
281
- }, 0), ge = b(() => !!(s.value && s.value.trim() !== ""));
282
- b(() => o.imageContent ? c("Загрузить другое фото") : c("Загрузить фото"));
283
- const ae = (e, a) => {
281
+ }, 0), ge = C(() => !!(i.value && i.value.trim() !== "")), ve = C(() => o.imageContent ? g("Загрузить другое фото") : g("Загрузить фото")), ae = (e, a) => {
284
282
  if (!a) return "";
285
283
  const t = e.trim();
286
284
  return t ? t.length < 2 ? "Поле должно содержать минимум 2 символа" : "" : "Введите значение";
287
- }, ve = (e) => B("email", { mode: e ? "edit" : "bind", initialEmail: e }), he = () => {
288
- M(), u("open-email-dialog", s.value, ee(s.value)), ve(s.value);
289
- }, we = () => {
290
- M(), u("open-phone-dialog", f.value, ee(f.value));
291
- }, ye = async (e, a, t) => {
292
- e === "email" && t && (s.value = t), e === "phone" && t && (f.value = t), u("on-update-jwt");
285
+ }, he = (e) => U("email", { mode: e ? "edit" : "bind", initialEmail: e }), we = () => {
286
+ L(), s("open-email-dialog", i.value, ee(i.value)), he(i.value);
287
+ }, ye = () => {
288
+ L(), s("open-phone-dialog", c.value, ee(c.value));
289
+ }, Ee = async (e, a, t) => {
290
+ e === "email" && t && (i.value = t), e === "phone" && t && (c.value = t), s("on-update-jwt");
293
291
  }, Ne = (e) => {
294
- f.value = e;
295
- }, Ee = (e) => {
296
- s.value = e;
297
- }, Pe = (e, a) => {
298
- x.value = !0, u("on-password-error", e, a);
292
+ c.value = e;
293
+ }, Pe = (e) => {
294
+ console.debug("emitUpdateEmailField, цепочка такая: profileEmailDialog -> DialogManager -> PEditUserContact", e), i.value = e;
295
+ }, be = (e, a) => {
296
+ x.value = !0, s("on-password-error", e, a);
299
297
  }, Ce = () => {
300
298
  Z.value = !1, H.value = !1;
301
299
  }, z = (e) => {
@@ -305,47 +303,47 @@ const Ke = {
305
303
  const a = l[e];
306
304
  a.length > 40 && (l[e] = a.slice(0, 40), console.debug(`[Input Limit] Поле '${e}' достигло 40 символов. Ввод обрезан.`));
307
305
  }
308
- }, be = (e) => {
306
+ }, ke = (e) => {
309
307
  if (!e) {
310
308
  o.imageContent = "", o.imageBinary = null, o.value = null;
311
309
  return;
312
310
  }
313
- o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", N.value = !0;
314
- }, ke = () => {
311
+ o.value = e, o.imageBinary = e.fileBinary ?? null, o.imageContent = e.fileContent ?? "", E.value = !0;
312
+ }, Te = () => {
315
313
  K.value = !0;
316
314
  }, te = async (e, a, t = "image/png") => {
317
315
  if (!e) return null;
318
316
  const T = await (await fetch(e)).blob();
319
317
  return new File([T], a, { type: t });
320
- }, Te = () => {
321
- o.value = null, o.imageBinary = null, o.imageContent = "", N.value = !1;
318
+ }, Ue = () => {
319
+ o.value = null, o.imageBinary = null, o.imageContent = "", E.value = !1;
322
320
  }, Be = async (e) => {
323
- if (N.value = !1, o.imageContent = e, !o.imageBinary) return;
321
+ if (E.value = !1, o.imageContent = e, !o.imageBinary) return;
324
322
  const a = await te(e, o.imageBinary.name, o.imageBinary.type || "image/png");
325
323
  if (a)
326
324
  try {
327
325
  o.loading = !0;
328
326
  const t = new FormData();
329
- t.append("file", a), await Y(`/users/profile/avatar/${y.value}`, t, { headers: { "Content-Type": void 0 } });
327
+ t.append("file", a), await q(`/users/profile/avatar/${y.value}`, t, { headers: { "Content-Type": void 0 } });
330
328
  } catch (t) {
331
329
  console.error(t);
332
330
  } finally {
333
331
  o.loading = !1;
334
332
  }
335
- }, Ue = async (e) => {
333
+ }, De = async (e) => {
336
334
  o.imageContent = e ?? "", o.imageBinary && (o.imageBinary = await te(
337
335
  e ?? "",
338
336
  o.imageBinary.name,
339
337
  o.imageBinary.type || "image/png"
340
338
  ));
341
- }, oe = v(!1), ne = async (e) => {
339
+ }, oe = h(!1), ne = async (e) => {
342
340
  var t, k;
343
341
  const a = (t = l[e]) == null ? void 0 : t.trim();
344
342
  if (a)
345
343
  try {
346
344
  oe.value = !0;
347
- const C = (k = (await Y("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : k.data;
348
- C != null && C.user && (l.firstName = C.user.firstName ?? l.firstName, l.lastName = C.user.lastName ?? l.lastName, m.value = {
345
+ const b = (k = (await q("/users/profile/update-name", { [e]: a })).data) == null ? void 0 : k.data;
346
+ b != null && b.user && (l.firstName = b.user.firstName ?? l.firstName, l.lastName = b.user.lastName ?? l.lastName, d.value = {
349
347
  firstName: l.firstName,
350
348
  lastName: l.lastName
351
349
  });
@@ -358,104 +356,106 @@ const Ke = {
358
356
  var e;
359
357
  if (!n.accessToken) throw new Error("Access token не передан в props");
360
358
  try {
361
- const t = (e = (await We({
359
+ const t = (e = (await Ke({
362
360
  accessToken: n.accessToken,
363
361
  refreshToken: n.refreshToken ?? "",
364
362
  excludeFields: []
365
363
  })).data) == null ? void 0 : e.user;
366
364
  if (!t) throw new Error("user data отсутствует в response");
367
- y.value = t.userId ?? "", l.firstName = t.privateFirstName ?? "", l.lastName = t.privateLastName ?? "", s.value = t.email ?? "", f.value = t.phoneNumber ?? "", o.imageContent = t.avatar ?? "", m.value = { firstName: t.privateFirstName ?? "", lastName: t.privateLastName ?? "" };
365
+ y.value = t.userId ?? "", l.firstName = t.privateFirstName ?? "", l.lastName = t.privateLastName ?? "", i.value = t.email ?? "", c.value = t.phoneNumber ?? "", o.imageContent = t.avatar ?? "", d.value = { firstName: t.privateFirstName ?? "", lastName: t.privateLastName ?? "" };
368
366
  } catch {
369
367
  }
370
368
  };
371
369
  se(
372
370
  () => [l.firstName, l.lastName],
373
371
  ([e, a]) => {
374
- const t = e.trim(), k = a.trim(), T = t !== m.value.firstName.trim() || k !== m.value.lastName.trim(), C = t.length >= 2 && k.length >= 2;
375
- V.value = T && C;
372
+ const t = e.trim(), k = a.trim(), T = t !== d.value.firstName.trim() || k !== d.value.lastName.trim(), b = t.length >= 2 && k.length >= 2;
373
+ V.value = T && b;
376
374
  },
377
375
  { immediate: !0 }
378
376
  );
379
- const De = async () => {
377
+ const Ie = async () => {
380
378
  if (V.value)
381
379
  try {
382
- await Promise.all([ne("firstName"), ne("lastName")]), V.value = !1, u("on-update-jwt"), z({ color: "success", text: "Изменения сохранены" });
380
+ await Promise.all([ne("firstName"), ne("lastName")]), V.value = !1, s("on-update-jwt"), z({ color: "success", text: "Изменения сохранены" });
383
381
  } catch (e) {
384
382
  console.error(e), z({
385
383
  color: "error",
386
- text: c("Не удалось сохранить изменения. Попробуйте позже")
384
+ text: g("Не удалось сохранить изменения. Попробуйте позже")
387
385
  });
388
386
  }
389
- }, Ie = () => {
390
- M(), u("open-password-dialog");
387
+ }, Ve = () => {
388
+ L(), s("open-password-dialog");
391
389
  };
392
- return $e(async () => {
390
+ return Se(async () => {
393
391
  if (!n.accessToken) throw new Error("Access token не передан в props");
394
392
  if (!n.requestUrl) throw new Error("auth-backend url не передан в props");
395
- _e(n.accessToken, n.requestUrl), await Fe();
396
- }), (e, a) => (h(), P(ie, null, [
397
- g(Ze, {
398
- language: w.value,
393
+ We(n.accessToken, n.requestUrl), await Fe();
394
+ }), (e, a) => (w(), P(ie, null, [
395
+ f(He, {
396
+ language: v.value,
399
397
  provider: e.provider,
400
398
  onCleanInputErrors: Ce,
401
- onOnUpdateJwt: ye,
399
+ onOnUpdateJwt: Ee,
402
400
  onUpdatePhoneField: Ne,
403
- onUpdateEmailField: Ee,
404
- onOnPasswordError: Pe,
401
+ onUpdateEmailField: Pe,
402
+ onOnPasswordError: be,
405
403
  onOnToast: z
406
404
  }, null, 8, ["language", "provider"]),
407
- G("div", He, [
408
- U("avatar") ? (h(), I(i(Le), {
409
- key: 0,
410
- modelValue: o.value,
411
- "onUpdate:modelValue": [
412
- a[0] || (a[0] = (t) => o.value = t),
413
- a[1] || (a[1] = (t) => be(t))
414
- ],
415
- type: "img",
416
- src: o.imageContent,
417
- accept: o.accept,
418
- loading: o.loading,
419
- label: c("Загрузить фото"),
420
- "upload-limit": o.uploadLimit,
421
- "onChange:error": ke
422
- }, {
423
- afterLoadLabel: F(() => [
424
- J(D(c("Загрузить фото")), 1)
425
- ]),
426
- subtext: F(() => [
427
- K.value ? (h(), P("span", Qe, D("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (h(), P("span", Xe, D(`${c("Формат")} ${i(Ye)(o.accept).join(", ")} ${c("до")} ${i(je)(o.uploadLimit)}`), 1))
428
- ]),
429
- _: 1
430
- }, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : E("", !0),
431
- U("firstName") ? (h(), P("div", ea, [
432
- g(i($), {
405
+ $("div", Qe, [
406
+ $("div", Xe, [
407
+ B("avatar") ? (w(), I(u(Re), {
408
+ key: 0,
409
+ modelValue: o.value,
410
+ "onUpdate:modelValue": [
411
+ a[0] || (a[0] = (t) => o.value = t),
412
+ a[1] || (a[1] = (t) => ke(t))
413
+ ],
414
+ type: "img",
415
+ src: o.imageContent,
416
+ accept: o.accept,
417
+ loading: o.loading,
418
+ label: g("Загрузить фото"),
419
+ "upload-limit": o.uploadLimit,
420
+ "onChange:error": Te
421
+ }, {
422
+ afterLoadLabel: D(() => [
423
+ _(F(ve.value), 1)
424
+ ]),
425
+ subtext: D(() => [
426
+ K.value ? (w(), P("span", ea, F("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (w(), P("span", aa, F(`${g("Формат")} ${u(Ye)(o.accept).join(", ")} ${g("до")} ${u(je)(o.uploadLimit)}`), 1))
427
+ ]),
428
+ _: 1
429
+ }, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : N("", !0)
430
+ ]),
431
+ B("firstName") ? (w(), P("div", ta, [
432
+ f(u(S), {
433
433
  modelValue: l.firstName,
434
434
  "onUpdate:modelValue": a[2] || (a[2] = (t) => l.firstName = t),
435
435
  size: "large",
436
- label: c("Имя"),
436
+ label: g("Имя"),
437
437
  error: de.value,
438
438
  onBlur: a[3] || (a[3] = (t) => p.firstName = !0),
439
439
  onInput: a[4] || (a[4] = (t) => A("firstName"))
440
440
  }, null, 8, ["modelValue", "label", "error"]),
441
- g(i(S), { class: "icon-locked" })
442
- ])) : E("", !0),
443
- U("lastName") ? (h(), P("div", aa, [
444
- g(i($), {
441
+ f(u(O), { class: "icon-locked" })
442
+ ])) : N("", !0),
443
+ B("lastName") ? (w(), P("div", oa, [
444
+ f(u(S), {
445
445
  modelValue: l.lastName,
446
446
  "onUpdate:modelValue": a[5] || (a[5] = (t) => l.lastName = t),
447
447
  size: "large",
448
- label: c("Фамилия"),
448
+ label: g("Фамилия"),
449
449
  error: pe.value,
450
450
  onBlur: a[6] || (a[6] = (t) => p.lastName = !0),
451
451
  onInput: a[7] || (a[7] = (t) => A("lastName"))
452
452
  }, null, 8, ["modelValue", "label", "error"]),
453
- g(i(S), { class: "icon-locked" })
454
- ])) : E("", !0),
455
- U("email") ? (h(), P("div", ta, [
456
- g(i($), {
457
- modelValue: s.value,
458
- "onUpdate:modelValue": a[8] || (a[8] = (t) => s.value = t),
453
+ f(u(O), { class: "icon-locked" })
454
+ ])) : N("", !0),
455
+ B("email") ? (w(), P("div", na, [
456
+ f(u(S), {
457
+ modelValue: i.value,
458
+ "onUpdate:modelValue": a[8] || (a[8] = (t) => i.value = t),
459
459
  size: "large",
460
460
  "text-size": "medium",
461
461
  label: "E-mail",
@@ -465,84 +465,89 @@ const Ke = {
465
465
  error: ce.value && H.value,
466
466
  onBlur: a[9] || (a[9] = (t) => p.email = !0),
467
467
  onInput: a[10] || (a[10] = (t) => A("email")),
468
- onClick: he
468
+ onClick: we
469
469
  }, null, 8, ["modelValue", "error"]),
470
- g(i(S), { class: "icon-locked" })
471
- ])) : E("", !0),
472
- U("phone") ? (h(), P("div", oa, [
473
- g(i($), {
474
- modelValue: f.value,
475
- "onUpdate:modelValue": a[11] || (a[11] = (t) => f.value = t),
470
+ f(u(O), { class: "icon-locked" })
471
+ ])) : N("", !0),
472
+ B("phone") ? (w(), P("div", ra, [
473
+ f(u(S), {
474
+ modelValue: c.value,
475
+ "onUpdate:modelValue": a[11] || (a[11] = (t) => c.value = t),
476
476
  size: "large",
477
477
  "text-size": "medium",
478
- label: c("Номер телефона"),
478
+ label: g("Номер телефона"),
479
479
  type: "tel",
480
480
  readonly: "",
481
481
  style: { cursor: "pointer" },
482
482
  error: fe.value && Z.value,
483
483
  onBlur: a[12] || (a[12] = (t) => p.phone = !0),
484
484
  onInput: a[13] || (a[13] = (t) => A("phone")),
485
- onClick: we
485
+ onClick: ye
486
486
  }, null, 8, ["modelValue", "label", "error"]),
487
- g(i(S), { class: "icon-locked" })
488
- ])) : E("", !0),
489
- G("div", na, [
490
- ge.value ? (h(), I(i(le), {
487
+ f(u(O), { class: "icon-locked" })
488
+ ])) : N("", !0),
489
+ $("div", la, [
490
+ ge.value ? (w(), I(u(le), {
491
491
  key: 0,
492
492
  color: "secondary",
493
- onClick: Ie
493
+ onClick: Ve
494
494
  }, {
495
- default: F(() => [
496
- J(D(c("Сменить пароль")), 1)
495
+ default: D(() => [
496
+ _(F(g("Сменить пароль")), 1)
497
497
  ]),
498
498
  _: 1
499
- })) : E("", !0),
500
- g(i(le), {
499
+ })) : N("", !0),
500
+ f(u(le), {
501
501
  disabled: !V.value,
502
- onClick: De
502
+ onClick: Ie
503
503
  }, {
504
- default: F(() => [
505
- J(D(c("Сохранить")), 1)
504
+ default: D(() => [
505
+ _(F(g("Сохранить")), 1)
506
506
  ]),
507
507
  _: 1
508
508
  }, 8, ["disabled"])
509
509
  ])
510
510
  ]),
511
- N.value ? (h(), I(re, {
511
+ E.value ? (w(), I(re, {
512
512
  key: 0,
513
513
  to: "body"
514
514
  }, [
515
- N.value ? (h(), P("div", ra, [
516
- g(i(Re), {
515
+ E.value ? (w(), P("div", sa, [
516
+ f(u(Ge), {
517
517
  "circle-mode": !0,
518
518
  "model-value": o.imageContent,
519
- onClose: Te,
519
+ onClose: Ue,
520
520
  onSave: a[14] || (a[14] = (t) => Be(t)),
521
- "onUpdate:modelValue": a[15] || (a[15] = (t) => Ue(t))
521
+ "onUpdate:modelValue": a[15] || (a[15] = (t) => De(t))
522
522
  }, null, 8, ["model-value"])
523
- ])) : E("", !0)
524
- ])) : E("", !0),
525
- (h(), I(re, { to: "#toast-root" }, [
526
- G("div", la, [
527
- g(Se, { name: "list" }, {
528
- default: F(() => [
529
- Oe(g(i(Ge), {
523
+ ])) : N("", !0)
524
+ ])) : N("", !0),
525
+ (w(), I(re, { to: "#toast-root" }, [
526
+ $("div", ia, [
527
+ f(Oe, { name: "list" }, {
528
+ default: D(() => [
529
+ Me(f(u(_e), {
530
530
  class: "toast",
531
531
  color: Q.value,
532
532
  text: X.value,
533
533
  onClose: a[16] || (a[16] = (t) => x.value = !1)
534
534
  }, null, 8, ["color", "text"]), [
535
- [Me, x.value]
535
+ [Le, x.value]
536
536
  ])
537
537
  ]),
538
538
  _: 1
539
539
  })
540
540
  ])
541
541
  ])),
542
- g(i(ue))
542
+ f(u(ue))
543
543
  ], 64));
544
544
  }
545
- }), fa = /* @__PURE__ */ _({
545
+ }), ma = (m, r) => {
546
+ const n = m.__vccOpts || m;
547
+ for (const [s, v] of r)
548
+ n[s] = v;
549
+ return n;
550
+ }, da = /* @__PURE__ */ ma(ua, [["__scopeId", "data-v-72be8bf7"]]), wa = /* @__PURE__ */ Y({
546
551
  __name: "index",
547
552
  props: {
548
553
  throttlerPrefix: {},
@@ -554,40 +559,41 @@ const Ke = {
554
559
  fields: {}
555
560
  },
556
561
  emits: ["on-update-jwt", "update-tokens"],
557
- setup(d, { emit: r }) {
558
- const n = r, { openDialog: u } = W(), w = (m, p) => {
559
- u("email", { initialEmail: m, mode: p });
560
- }, c = (m, p) => {
561
- u("phone", { initialPhone: m, mode: p });
562
- }, B = () => {
563
- u("password");
564
- }, l = (m, p, y) => {
565
- n("on-update-jwt", m, p, y);
562
+ setup(m, { emit: r }) {
563
+ const n = r, { openDialog: s } = W(), v = (d, p) => {
564
+ s("email", { initialEmail: d, mode: p });
565
+ }, g = (d, p) => {
566
+ s("phone", { initialPhone: d, mode: p });
567
+ }, U = () => {
568
+ s("password");
569
+ }, l = (d, p, y) => {
570
+ n("on-update-jwt", d, p, y);
566
571
  };
567
- return (m, p) => (h(), P(ie, null, [
568
- g(i(Je)),
569
- g(sa, {
570
- "throttler-prefix": m.throttlerPrefix,
571
- provider: m.provider,
572
- "request-url": m.requestUrl,
573
- language: m.language,
574
- fields: m.fields,
575
- "access-token": m.accessToken,
576
- "refresh-token": m.refreshToken,
577
- onOpenEmailDialog: w,
578
- onOpenPhoneDialog: c,
579
- onOpenPasswordDialog: B,
572
+ return (d, p) => (w(), P(ie, null, [
573
+ f(u(Je)),
574
+ f(da, {
575
+ "throttler-prefix": d.throttlerPrefix,
576
+ provider: d.provider,
577
+ "request-url": d.requestUrl,
578
+ language: d.language,
579
+ fields: d.fields,
580
+ "access-token": d.accessToken,
581
+ "refresh-token": d.refreshToken,
582
+ onOpenEmailDialog: v,
583
+ onOpenPhoneDialog: g,
584
+ onOpenPasswordDialog: U,
580
585
  onOnUpdateJwt: l
581
586
  }, null, 8, ["throttler-prefix", "provider", "request-url", "language", "fields", "access-token", "refresh-token"]),
582
- g(i(ue))
587
+ f(u(ue))
583
588
  ], 64));
584
589
  }
585
590
  });
586
591
  export {
587
- pa as B,
588
- da as C,
589
- fa as _,
590
- ca as g,
591
- Y as p,
592
- Ke as t
592
+ va as B,
593
+ ga as C,
594
+ ma as _,
595
+ wa as a,
596
+ ha as g,
597
+ q as p,
598
+ Ze as t
593
599
  };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- import { _ as r } from "./index-DDRxZ_O5.js";
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".avatar-wrapper[data-v-72be8bf7] .p-avatar__overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-72be8bf7]:hover .p-avatar__overlay{opacity:1!important}.avatar-wrapper[data-v-72be8bf7] .wide-img .overlay{opacity:0!important;transition:opacity .2s ease}.avatar-wrapper[data-v-72be8bf7]:hover .wide-img .overlay{opacity:1!important}.icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import { a as o } from "./index-Cj73EGum.js";
3
3
  export {
4
- r as PEditUserContact
4
+ o as PEditUserContact
5
5
  };
@@ -1,13 +1,13 @@
1
- import { ref as r, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as l, createVNode as E, unref as F, computed as T, renderSlot as m, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
1
+ import { ref as l, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as r, createVNode as E, unref as F, computed as T, renderSlot as m, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
2
2
  import { PLoader as w } from "@profeat/ui-kit";
3
- import { g as R, p as h } from "./index-DDRxZ_O5.js";
3
+ import { _ as g, g as R, p as h } from "./index-Cj73EGum.js";
4
4
  function C(e) {
5
5
  const t = Math.floor(e / 60), a = e % 60;
6
6
  return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
7
7
  }
8
8
  function x() {
9
9
  let e = null;
10
- const t = r(0), a = r(!1), s = r("00:00"), u = r(0), n = r(0), i = r(!1);
10
+ const t = l(0), a = l(!1), s = l("00:00"), u = l(0), n = l(0), i = l(!1);
11
11
  return {
12
12
  startTimer: (c, d) => {
13
13
  e && clearInterval(e), i.value = !1, t.value = c, a.value = c > 0, s.value = C(c);
@@ -27,7 +27,7 @@ const S = /* @__PURE__ */ L({
27
27
  __name: "ProfileOverlayLoading",
28
28
  setup(e) {
29
29
  return (t, a) => (v(), f("div", {
30
- class: l(t.$style.loaderOverlay)
30
+ class: r(t.$style.loaderOverlay)
31
31
  }, [
32
32
  E(F(w), {
33
33
  class: "relative m-auto",
@@ -37,16 +37,11 @@ const S = /* @__PURE__ */ L({
37
37
  }
38
38
  }), B = "_loaderOverlay_cpu73_1", b = {
39
39
  loaderOverlay: B
40
- }, g = (e, t) => {
41
- const a = e.__vccOpts || e;
42
- for (const [s, u] of t)
43
- a[s] = u;
44
- return a;
45
40
  }, A = {
46
41
  $style: b
47
42
  }, z = /* @__PURE__ */ g(S, [["__cssModules", A], ["__scopeId", "data-v-9e697525"]]);
48
43
  function j(e) {
49
- const t = r("edit"), a = T(() => e.value === "edit" && t.value === "edit");
44
+ const t = l("edit"), a = T(() => e.value === "edit" && t.value === "edit");
50
45
  return {
51
46
  modeFlowFromBack: t,
52
47
  isEditFlow: a,
@@ -67,19 +62,19 @@ const M = L({
67
62
  setup(e) {
68
63
  return { isRepeat: T(() => e.rateLimitText === "Повторить"), defaultClass: "dialogDefaultContainerRateLimitText", activeClass: "dialogDefaultContainerRateLimitTextActive", finalWrapperClass: "finalLimitWrapper", finalTextClass: "finalLimitText", finalLinkClass: "finalLimitLink" };
69
64
  }
70
- }), _ = {
65
+ }), D = {
71
66
  key: 0,
72
67
  class: "spacer",
73
68
  style: { height: "20px", width: "100%" }
74
- }, D = { key: 1 }, O = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, I = { style: { display: "inline" } };
69
+ }, O = { key: 1 }, _ = { style: { display: "flex", "align-items": "center", "justify-content": "space-between" } }, I = { style: { display: "inline" } };
75
70
  function N(e, t, a, s, u, n) {
76
- return e.loading ? (v(), f("div", _)) : (v(), f("div", D, [
71
+ return e.loading ? (v(), f("div", D)) : (v(), f("div", O, [
77
72
  e.isFinalLimit ? e.isFinalLimit && e.rateLimitText !== "Повторить" ? m(e.$slots, "final", { key: 1 }, () => [
78
73
  o("div", {
79
- class: l(e.finalWrapperClass)
74
+ class: r(e.finalWrapperClass)
80
75
  }, [
81
76
  o("div", {
82
- class: l(e.finalTextClass)
77
+ class: r(e.finalTextClass)
83
78
  }, [
84
79
  t[1] || (t[1] = p(" Вы слишком часто запрашивали код. ")),
85
80
  t[2] || (t[2] = o("br", null, null, -1)),
@@ -88,16 +83,16 @@ function N(e, t, a, s, u, n) {
88
83
  o("span", I, [
89
84
  t[3] || (t[3] = p(" Если есть вопросы — ")),
90
85
  o("a", {
91
- class: l(e.finalLinkClass),
86
+ class: r(e.finalLinkClass),
92
87
  href: "https://t.me/yourSupportLink",
93
88
  target: "_blank"
94
89
  }, "пишите в Telegram.", 2)
95
90
  ])
96
91
  ], 2)
97
92
  ]) : $("", !0) : m(e.$slots, "active", { key: 0 }, () => [
98
- o("div", O, [
93
+ o("div", _, [
99
94
  o("span", {
100
- class: l([e.defaultClass, { [e.activeClass]: e.isRepeat }]),
95
+ class: r([e.defaultClass, { [e.activeClass]: e.isRepeat }]),
101
96
  onClick: t[0] || (t[0] = (i) => e.isRepeat && e.onSendAgain())
102
97
  }, y(e.isRepeat ? "Повторить" : `Повторить через ${e.rateLimitText}`), 3),
103
98
  m(e.$slots, "extra")
@@ -133,7 +128,6 @@ function J(e) {
133
128
  export {
134
129
  z as P,
135
130
  G as T,
136
- g as _,
137
131
  x as a,
138
132
  J as b,
139
133
  H as c,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yourgoods/ui-smart",
3
- "version": "0.9.0",
3
+ "version": "0.13.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",