@yourgoods/ui-smart 0.23.0 → 0.24.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,15 +1,15 @@
1
- import { createElementBlock as b, openBlock as p, createElementVNode as U, defineComponent as ce, reactive as pe, watch as te, ref as D, toRefs as fe, computed as z, createCommentVNode as E, createVNode as S, toDisplayString as G, createBlock as X, createTextVNode as oe, unref as r, isRef as se, withCtx as _, onMounted as Ue, Fragment as je } from "vue";
2
- import { T as ge, c as Oe, a as qe, u as We, P as Be, b as He } from "./useRateLimitToast-CF0qx7i_.js";
1
+ import { createElementBlock as S, openBlock as p, createElementVNode as U, defineComponent as ce, reactive as pe, watch as te, ref as D, toRefs as fe, computed as z, createCommentVNode as $, createVNode as T, toDisplayString as K, createBlock as Q, createTextVNode as oe, unref as r, isRef as se, withCtx as _, onMounted as Ue, Fragment as je } from "vue";
2
+ import { T as ge, c as Oe, a as qe, u as We, P as Be, b as He } from "./useRateLimitToast-BSzwSahA.js";
3
3
  import { IconTelegramSm as ye, PInput as de, IconPhoneMd as Ke, IconMailMd as De, PButton as Ae, PDialog as Ge, PTopBar as Je, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
4
- import { C as K, t as Ie, p as le, g as Le } from "./index-Du1aTQoC.js";
4
+ import { C as H, t as Ie, p as le, g as Le } from "./index-BMP0GdRz.js";
5
5
  const Ye = {
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
7
  width: "12",
8
8
  height: "16",
9
9
  fill: "none"
10
10
  };
11
- function Ze(R, x) {
12
- return p(), b("svg", Ye, x[0] || (x[0] = [
11
+ function Ze(R, V) {
12
+ return p(), S("svg", Ye, V[0] || (V[0] = [
13
13
  U("path", {
14
14
  fill: "#1C7EF1",
15
15
  "fill-rule": "evenodd",
@@ -42,11 +42,11 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
42
42
  isTg: { type: Boolean }
43
43
  },
44
44
  emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
45
- setup(R, { emit: x }) {
46
- const k = R, u = x, c = pe({
45
+ setup(R, { emit: V }) {
46
+ const E = R, u = V, c = pe({
47
47
  touched: { phone: !1, code: !1 },
48
- phoneModel: k.phone,
49
- codeModel: k.code
48
+ phoneModel: E.phone,
49
+ codeModel: E.code
50
50
  });
51
51
  te(
52
52
  () => c.phoneModel,
@@ -63,23 +63,23 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
63
63
  u("on-clear-code-error");
64
64
  const h = d.target;
65
65
  let m = ((h == null ? void 0 : h.value) ?? "").replace(/\D/g, "");
66
- m.length > 4 && (m = m.slice(0, 4)), T.value = m, h && h.value !== m && (h.value = m), m.length === 4 && m !== g.value && (g.value = m, u("on-match-code", { phone: e.value, code: m }));
67
- }, J = () => u("on-send-code-again", { phone: c.phoneModel }), Y = () => {
66
+ m.length > 4 && (m = m.slice(0, 4)), M.value = m, h && h.value !== m && (h.value = m), m.length === 4 && m !== g.value && (g.value = m, u("on-match-code", { phone: e.value, code: m }));
67
+ }, G = () => u("on-send-code-again", { phone: c.phoneModel }), X = () => {
68
68
  console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: c.phoneModel });
69
- }, { phoneModel: e, codeModel: T, touched: C } = fe(c), y = z(() => C.value.phone && !e.value.trim() ? "Введите телефон" : k.phoneError), M = z(() => k.isNotMatchCode ? "Неверный код" : C.value.code ? T.value.trim() ? k.codeError ?? null : "Введите код" : "");
70
- return (d, h) => (p(), b("div", _e, [
69
+ }, { phoneModel: e, codeModel: M, touched: C } = fe(c), y = z(() => C.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), x = z(() => E.isNotMatchCode ? "Неверный код" : C.value.code ? M.value.trim() ? E.codeError ?? null : "Введите код" : "");
70
+ return (d, h) => (p(), S("div", _e, [
71
71
  U("div", eo, [
72
- U("div", oo, G(d.hintText), 1),
72
+ U("div", oo, K(d.hintText), 1),
73
73
  U("div", to, [
74
- d.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
74
+ d.isTg ? (p(), Q(r(ye), { key: 0 })) : (p(), Q(r(ie), {
75
75
  key: 1,
76
76
  style: { "margin-left": "5px" }
77
77
  })),
78
- oe(" " + G(d.isTg ? "Telegram" : "СМС"), 1)
78
+ oe(" " + K(d.isTg ? "Telegram" : "СМС"), 1)
79
79
  ])
80
80
  ]),
81
- d.showPhone ? (p(), b("div", no, [
82
- S(r(de), {
81
+ d.showPhone ? (p(), S("div", no, [
82
+ T(r(de), {
83
83
  modelValue: r(e),
84
84
  "onUpdate:modelValue": h[0] || (h[0] = (m) => se(e) ? e.value = m : null),
85
85
  size: "large",
@@ -91,53 +91,53 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
91
91
  onBlur: h[1] || (h[1] = (m) => v("phone")),
92
92
  onInput: h[2] || (h[2] = (m) => v("phone"))
93
93
  }, null, 8, ["modelValue", "error"]),
94
- S(r(Ke), {
94
+ T(r(Ke), {
95
95
  class: "icon-locked",
96
96
  onClick: h[3] || (h[3] = (m) => d.$emit("edit", "phone"))
97
97
  })
98
- ])) : E("", !0),
99
- d.showCode ? (p(), b("div", ao, [
100
- S(r(de), {
101
- modelValue: r(T),
102
- "onUpdate:modelValue": h[4] || (h[4] = (m) => se(T) ? T.value = m : null),
98
+ ])) : $("", !0),
99
+ d.showCode ? (p(), S("div", ao, [
100
+ T(r(de), {
101
+ modelValue: r(M),
102
+ "onUpdate:modelValue": h[4] || (h[4] = (m) => se(M) ? M.value = m : null),
103
103
  size: "large",
104
104
  "text-size": "medium",
105
105
  label: "Код",
106
106
  type: "text",
107
- error: M.value,
107
+ error: x.value,
108
108
  onInput: L,
109
109
  onBlur: h[5] || (h[5] = (m) => v("code"))
110
110
  }, null, 8, ["modelValue", "error"])
111
- ])) : E("", !0),
112
- S(ge, {
111
+ ])) : $("", !0),
112
+ T(ge, {
113
113
  loading: d.loading,
114
114
  "rate-limit-text": d.rateLimitText,
115
115
  "is-final-limit": d.isFinalLimit,
116
- "on-send-again": J
116
+ "on-send-again": G
117
117
  }, {
118
118
  extra: _(() => [
119
- d.isTg ? (p(), b("span", {
119
+ d.isTg ? (p(), S("span", {
120
120
  key: 0,
121
121
  class: "dialogDefaultContainerSendCodeBySmsText",
122
- onClick: Y
122
+ onClick: X
123
123
  }, [
124
- oe(G(d.sendCodeBySmsText) + " ", 1),
125
- S(r(ie), { style: { "margin-left": "5px" } })
126
- ])) : E("", !0)
124
+ oe(K(d.sendCodeBySmsText) + " ", 1),
125
+ T(r(ie), { style: { "margin-left": "5px" } })
126
+ ])) : $("", !0)
127
127
  ]),
128
128
  _: 1
129
129
  }, 8, ["loading", "rate-limit-text", "is-final-limit"])
130
130
  ]));
131
131
  }
132
132
  }), F = (R) => {
133
- const x = R.replace(/\D/g, "");
134
- if (x.length >= 10 && x.length <= 15) {
135
- if (x.startsWith("8"))
136
- return `+7${x.slice(1)}`;
137
- if (x.startsWith("7"))
138
- return `+${x}`;
133
+ const V = R.replace(/\D/g, "");
134
+ if (V.length >= 10 && V.length <= 15) {
135
+ if (V.startsWith("8"))
136
+ return `+7${V.slice(1)}`;
137
+ if (V.startsWith("7"))
138
+ return `+${V}`;
139
139
  }
140
- return R.trim().startsWith("+") ? R.trim() : `+${x}`;
140
+ return R.trim().startsWith("+") ? R.trim() : `+${V}`;
141
141
  }, so = { class: "dialogDefaultContainerInsideContent" }, io = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, ro = { class: "dialogDefaultContainerTextHint" }, uo = {
142
142
  key: 0,
143
143
  class: "chip"
@@ -167,8 +167,8 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
167
167
  isTg: { type: Boolean }
168
168
  },
169
169
  emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
170
- setup(R, { emit: x }) {
171
- const k = R, u = x, c = D(!1), v = D(""), g = pe({
170
+ setup(R, { emit: V }) {
171
+ const E = R, u = V, c = D(!1), v = D(""), g = pe({
172
172
  touched: { phone: !1, code: !1 },
173
173
  phoneModel: "",
174
174
  codeModel: ""
@@ -182,33 +182,31 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
182
182
  () => g.codeModel,
183
183
  (l) => u("update:code", l)
184
184
  );
185
- const L = (l) => g.touched[l] = !0, J = z(() => {
186
- const n = g.phoneModel.trim().replace(/[()\-\s]/g, "");
187
- return /^\+?\d{10,15}$/.test(n);
188
- }), Y = async () => {
189
- var l, n;
185
+ const L = (l) => g.touched[l] = !0, G = z(() => {
186
+ const t = g.phoneModel.trim().replace(/[()\-\s]/g, "");
187
+ return /^\+?\d{10,15}$/.test(t);
188
+ }), X = async () => {
189
+ var l, t;
190
190
  try {
191
- if (L("phone"), !J.value) {
191
+ if (L("phone"), !G.value) {
192
192
  v.value = "Это не похоже на номер телефона";
193
193
  return;
194
194
  }
195
- const {
196
- data: { data: o, success: $, message: B }
197
- } = await Oe(void 0, F(g.phoneModel));
198
- if (!(((l = o == null ? void 0 : o[0]) == null ? void 0 : l.available) ?? !1)) {
195
+ const n = await Oe(void 0, F(g.phoneModel)), { data: P } = n.data;
196
+ if (!(((l = P == null ? void 0 : P[0]) == null ? void 0 : l.available) ?? !1)) {
199
197
  v.value = "Такой номер уже используется";
200
198
  return;
201
199
  }
202
- v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
203
- } catch (o) {
204
- console.debug(o);
205
- const $ = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, B = $ == null ? void 0 : $.message;
200
+ v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), c.value = !0;
201
+ } catch (n) {
202
+ console.debug(n);
203
+ const P = (t = n == null ? void 0 : n.response) == null ? void 0 : t.data, B = P == null ? void 0 : P.message;
206
204
  if (console.debug("global middle check onSendCode: ", {
207
- errorData: $,
205
+ errorData: P,
208
206
  message: B,
209
207
  phoneTakenError: v
210
208
  }), B) {
211
- const j = Array.isArray(B) ? B.join(" ") : String(B), ne = j.toLowerCase(), Q = [
209
+ const Z = Array.isArray(B) ? B.join(" ") : String(B), ne = Z.toLowerCase(), J = [
212
210
  "телефон должен быть в формате",
213
211
  "valid phone number",
214
212
  "phone must be a valid phone number",
@@ -217,107 +215,107 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
217
215
  "newValue must be a valid phone number",
218
216
  "addValue must be a valid phone number",
219
217
  "addPhone must be a valid phone number"
220
- ], q = Q.some(
218
+ ], j = J.some(
221
219
  (ee) => ne.includes(ee)
222
220
  );
223
221
  if (console.debug("global end check onSendCode: ", {
224
- errorMessage: j,
222
+ errorMessage: Z,
225
223
  lowerCaseError: ne,
226
- phoneValidationKeywords: Q,
227
- hasPhoneError: q
228
- }), q) {
224
+ phoneValidationKeywords: J,
225
+ hasPhoneError: j
226
+ }), j) {
229
227
  v.value = "Это не похоже на номер телефона";
230
228
  return;
231
229
  }
232
230
  }
233
- console.error("Неизвестная ошибка при проверке доступности телефона:", o), v.value = "Произошла ошибка сервера. Попробуйте позже";
231
+ console.error("Неизвестная ошибка при проверке доступности телефона:", n), v.value = "Произошла ошибка сервера. Попробуйте позже";
234
232
  }
235
233
  };
236
234
  let e = D("");
237
- const T = (l) => {
235
+ const M = (l) => {
238
236
  u("on-clear-code-error");
239
- const n = l.target;
240
- let o = ((n == null ? void 0 : n.value) ?? "").replace(/\D/g, "");
241
- o.length > 4 && (o = o.slice(0, 4)), d.value = o, n && n.value !== o && (n.value = o), o.length === 4 && o !== e.value && (e.value = o, u("on-match-code", { phone: M.value, code: o }));
237
+ const t = l.target;
238
+ let n = ((t == null ? void 0 : t.value) ?? "").replace(/\D/g, "");
239
+ n.length > 4 && (n = n.slice(0, 4)), d.value = n, t && t.value !== n && (t.value = n), n.length === 4 && n !== e.value && (e.value = n, u("on-match-code", { phone: x.value, code: n }));
242
240
  }, C = () => {
243
241
  u("on-send-code-again", { phone: g.phoneModel });
244
242
  }, y = () => {
245
243
  console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: g.phoneModel });
246
- }, { phoneModel: M, codeModel: d, touched: h } = fe(g), m = z(() => v.value ? v.value : h.value.phone && !M.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), Z = z(() => k.isNotMatchCode ? "Неверный код" : h.value.code ? d.value.trim() ? k.codeError ?? null : "Введите код" : "");
247
- return (l, n) => (p(), b("div", so, [
244
+ }, { phoneModel: x, codeModel: d, touched: h } = fe(g), m = z(() => v.value ? v.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : E.phoneError || ""), Y = z(() => E.isNotMatchCode ? "Неверный код" : h.value.code ? d.value.trim() ? E.codeError ?? null : "Введите код" : "");
245
+ return (l, t) => (p(), S("div", so, [
248
246
  U("div", io, [
249
- U("div", ro, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
250
- c.value ? (p(), b("div", uo, [
251
- l.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
247
+ U("div", ro, K(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
248
+ c.value ? (p(), S("div", uo, [
249
+ l.isTg ? (p(), Q(r(ye), { key: 0 })) : (p(), Q(r(ie), {
252
250
  key: 1,
253
251
  style: { "margin-left": "5px" }
254
252
  })),
255
- oe(" " + G(l.isTg ? "Telegram" : "СМС"), 1)
256
- ])) : E("", !0)
253
+ oe(" " + K(l.isTg ? "Telegram" : "СМС"), 1)
254
+ ])) : $("", !0)
257
255
  ]),
258
- l.showPhone ? (p(), b("div", co, [
259
- S(r(de), {
260
- modelValue: r(M),
261
- "onUpdate:modelValue": n[0] || (n[0] = (o) => se(M) ? M.value = o : null),
256
+ l.showPhone ? (p(), S("div", co, [
257
+ T(r(de), {
258
+ modelValue: r(x),
259
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => se(x) ? x.value = n : null),
262
260
  size: "large",
263
261
  "text-size": "medium",
264
262
  label: "Телефон",
265
263
  type: "tel",
266
264
  error: m.value,
267
- onBlur: n[1] || (n[1] = (o) => L("phone")),
268
- onInput: n[2] || (n[2] = (o) => L("phone"))
265
+ onBlur: t[1] || (t[1] = (n) => L("phone")),
266
+ onInput: t[2] || (t[2] = (n) => L("phone"))
269
267
  }, null, 8, ["modelValue", "error"]),
270
- S(r(De), {
268
+ T(r(De), {
271
269
  class: "icon-locked",
272
- onClick: n[3] || (n[3] = (o) => l.$emit("edit", "phone"))
270
+ onClick: t[3] || (t[3] = (n) => l.$emit("edit", "phone"))
273
271
  })
274
- ])) : E("", !0),
275
- c.value ? E("", !0) : (p(), b("div", po, [
276
- S(r(Ae), {
272
+ ])) : $("", !0),
273
+ c.value ? $("", !0) : (p(), S("div", po, [
274
+ T(r(Ae), {
277
275
  style: { width: "100%" },
278
- disabled: !J.value,
279
- onClick: Y
276
+ disabled: !G.value,
277
+ onClick: X
280
278
  }, {
281
- default: _(() => n[6] || (n[6] = [
279
+ default: _(() => t[6] || (t[6] = [
282
280
  oe(" Отправить код ")
283
281
  ])),
284
282
  _: 1,
285
283
  __: [6]
286
284
  }, 8, ["disabled"])
287
285
  ])),
288
- c.value ? (p(), b("div", ho, [
289
- S(r(de), {
286
+ c.value ? (p(), S("div", ho, [
287
+ T(r(de), {
290
288
  modelValue: r(d),
291
- "onUpdate:modelValue": n[4] || (n[4] = (o) => se(d) ? d.value = o : null),
289
+ "onUpdate:modelValue": t[4] || (t[4] = (n) => se(d) ? d.value = n : null),
292
290
  size: "large",
293
291
  "text-size": "medium",
294
292
  label: "Код",
295
293
  type: "text",
296
- error: Z.value,
297
- onInput: T,
298
- onBlur: n[5] || (n[5] = (o) => L("code"))
294
+ error: Y.value,
295
+ onInput: M,
296
+ onBlur: t[5] || (t[5] = (n) => L("code"))
299
297
  }, null, 8, ["modelValue", "error"])
300
- ])) : E("", !0),
301
- !l.loading && c.value ? (p(), b("div", vo, [
302
- S(ge, {
298
+ ])) : $("", !0),
299
+ !l.loading && c.value ? (p(), S("div", vo, [
300
+ T(ge, {
303
301
  loading: l.loading,
304
302
  "rate-limit-text": l.rateLimitText,
305
303
  "is-final-limit": l.isFinalLimit,
306
304
  "on-send-again": C
307
305
  }, {
308
306
  extra: _(() => [
309
- l.isTg ? (p(), b("span", {
307
+ l.isTg ? (p(), S("span", {
310
308
  key: 0,
311
309
  class: "dialogDefaultContainerSendCodeBySmsText",
312
310
  onClick: y
313
311
  }, [
314
- oe(G(l.sendCodeBySmsText) + " ", 1),
315
- S(r(ie), { style: { "margin-left": "5px" } })
316
- ])) : E("", !0)
312
+ oe(K(l.sendCodeBySmsText) + " ", 1),
313
+ T(r(ie), { style: { "margin-left": "5px" } })
314
+ ])) : $("", !0)
317
315
  ]),
318
316
  _: 1
319
317
  }, 8, ["loading", "rate-limit-text", "is-final-limit"])
320
- ])) : E("", !0)
318
+ ])) : $("", !0)
321
319
  ]));
322
320
  }
323
321
  }), fo = { class: "dialogDefaultContainerInsideContent" }, go = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, yo = { class: "dialogDefaultContainerTextHint" }, Co = { class: "chip" }, wo = {
@@ -346,8 +344,8 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
346
344
  isTg: { type: Boolean }
347
345
  },
348
346
  emits: ["update:phone", "update:code", "edit", "on-match-code", "on-match-code-error", "on-send-code", "on-send-code-again", "on-send-only-sms", "on-clear-code-error"],
349
- setup(R, { emit: x }) {
350
- const k = R, u = x, c = D(!1), v = D(""), g = pe({
347
+ setup(R, { emit: V }) {
348
+ const E = R, u = V, c = D(!1), v = D(""), g = pe({
351
349
  touched: { phone: !1, code: !1 },
352
350
  phoneModel: "",
353
351
  codeModel: ""
@@ -361,32 +359,30 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
361
359
  () => g.codeModel,
362
360
  (l) => u("update:code", l)
363
361
  );
364
- const L = (l) => g.touched[l] = !0, J = z(() => {
365
- const n = g.phoneModel.trim().replace(/[()\-\s]/g, "");
366
- return /^\+?\d{10,15}$/.test(n);
367
- }), Y = async () => {
368
- var l, n;
362
+ const L = (l) => g.touched[l] = !0, G = z(() => {
363
+ const t = g.phoneModel.trim().replace(/[()\-\s]/g, "");
364
+ return /^\+?\d{10,15}$/.test(t);
365
+ }), X = async () => {
366
+ var l, t;
369
367
  try {
370
- if (L("phone"), !J.value) {
368
+ if (L("phone"), !G.value) {
371
369
  v.value = "Это не похоже на номер телефона";
372
370
  return;
373
371
  }
374
- const {
375
- data: { data: o, success: $, message: B }
376
- } = await Oe(void 0, F(g.phoneModel));
377
- if (!(((l = o == null ? void 0 : o[0]) == null ? void 0 : l.available) ?? !1)) {
372
+ const n = await Oe(void 0, F(g.phoneModel)), { data: P } = n.data;
373
+ if (!(((l = P == null ? void 0 : P[0]) == null ? void 0 : l.available) ?? !1)) {
378
374
  v.value = "Такой номер уже используется";
379
375
  return;
380
376
  }
381
- v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: k.oldPhone, offLoading: !0 }), c.value = !0;
382
- } catch (o) {
383
- const $ = (n = o == null ? void 0 : o.response) == null ? void 0 : n.data, B = $ == null ? void 0 : $.message;
377
+ v.value = "", u("on-send-code", { phone: g.phoneModel, prevPhone: E.oldPhone, offLoading: !0 }), c.value = !0;
378
+ } catch (n) {
379
+ const P = (t = n == null ? void 0 : n.response) == null ? void 0 : t.data, B = P == null ? void 0 : P.message;
384
380
  if (console.debug("global middle check onSendCode: ", {
385
- errorData: $,
381
+ errorData: P,
386
382
  message: B,
387
383
  phoneTakenError: v
388
384
  }), B) {
389
- const j = Array.isArray(B) ? B.join(" ") : String(B), ne = j.toLowerCase(), Q = [
385
+ const Z = Array.isArray(B) ? B.join(" ") : String(B), ne = Z.toLowerCase(), J = [
390
386
  "телефон должен быть в формате",
391
387
  "valid phone number",
392
388
  "phone must be a valid phone number",
@@ -395,107 +391,107 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
395
391
  "newValue must be a valid phone number",
396
392
  "addValue must be a valid phone number",
397
393
  "addPhone must be a valid phone number"
398
- ], q = Q.some(
394
+ ], j = J.some(
399
395
  (ee) => ne.includes(ee)
400
396
  );
401
397
  if (console.debug("global end check onSendCode: ", {
402
- errorMessage: j,
398
+ errorMessage: Z,
403
399
  lowerCaseError: ne,
404
- phoneValidationKeywords: Q,
405
- hasPhoneError: q
406
- }), q) {
400
+ phoneValidationKeywords: J,
401
+ hasPhoneError: j
402
+ }), j) {
407
403
  v.value = "Это не похоже на номер телефона";
408
404
  return;
409
405
  }
410
406
  }
411
- console.error("Неизвестная ошибка при проверке доступности телефона:", o), v.value = "Произошла ошибка сервера. Попробуйте позже";
407
+ console.error("Неизвестная ошибка при проверке доступности телефона:", n), v.value = "Произошла ошибка сервера. Попробуйте позже";
412
408
  }
413
409
  };
414
410
  let e = "";
415
- const T = (l) => {
411
+ const M = (l) => {
416
412
  u("on-clear-code-error");
417
- const n = l.target;
418
- let o = n.value.replace(/\D/g, "");
419
- o.length > 4 && (o = o.slice(0, 4), n.value = o), g.codeModel = o, o.length === 4 && o !== e && (e = o, u("on-match-code", { phone: g.phoneModel, code: o }));
413
+ const t = l.target;
414
+ let n = t.value.replace(/\D/g, "");
415
+ n.length > 4 && (n = n.slice(0, 4), t.value = n), g.codeModel = n, n.length === 4 && n !== e && (e = n, u("on-match-code", { phone: g.phoneModel, code: n }));
420
416
  }, C = () => {
421
417
  u("on-send-code-again", { phone: g.phoneModel });
422
418
  }, y = () => {
423
419
  console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: g.phoneModel });
424
- }, { phoneModel: M, codeModel: d, touched: h } = fe(g), m = z(() => v.value ? v.value : h.value.phone && !M.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), Z = z(() => k.isNotMatchCode ? "Неверный код" : g.touched.code ? d.value.trim() ? k.codeError ?? null : "Введите код" : "");
425
- return (l, n) => (p(), b("div", fo, [
420
+ }, { phoneModel: x, codeModel: d, touched: h } = fe(g), m = z(() => v.value ? v.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : E.phoneError || ""), Y = z(() => E.isNotMatchCode ? "Неверный код" : g.touched.code ? d.value.trim() ? E.codeError ?? null : "Введите код" : "");
421
+ return (l, t) => (p(), S("div", fo, [
426
422
  U("div", go, [
427
- U("div", yo, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
423
+ U("div", yo, K(c.value ? "Чтобы продолжить, введите код подтверждения из" : l.hintText), 1),
428
424
  U("div", Co, [
429
- l.isTg ? (p(), X(r(ye), { key: 0 })) : (p(), X(r(ie), {
425
+ l.isTg ? (p(), Q(r(ye), { key: 0 })) : (p(), Q(r(ie), {
430
426
  key: 1,
431
427
  style: { "margin-left": "5px" }
432
428
  })),
433
- oe(" " + G(l.isTg ? "Telegram" : "СМС"), 1)
429
+ oe(" " + K(l.isTg ? "Telegram" : "СМС"), 1)
434
430
  ])
435
431
  ]),
436
- l.showPhone ? (p(), b("div", wo, [
437
- S(r(de), {
438
- modelValue: r(M),
439
- "onUpdate:modelValue": n[0] || (n[0] = (o) => se(M) ? M.value = o : null),
432
+ l.showPhone ? (p(), S("div", wo, [
433
+ T(r(de), {
434
+ modelValue: r(x),
435
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => se(x) ? x.value = n : null),
440
436
  size: "large",
441
437
  "text-size": "medium",
442
438
  label: "Телефон",
443
439
  type: "tel",
444
440
  error: m.value,
445
- onBlur: n[1] || (n[1] = (o) => L("phone")),
446
- onInput: n[2] || (n[2] = (o) => L("phone"))
441
+ onBlur: t[1] || (t[1] = (n) => L("phone")),
442
+ onInput: t[2] || (t[2] = (n) => L("phone"))
447
443
  }, null, 8, ["modelValue", "error"]),
448
- S(r(De), {
444
+ T(r(De), {
449
445
  class: "icon-locked",
450
- onClick: n[3] || (n[3] = (o) => l.$emit("edit", "phone"))
446
+ onClick: t[3] || (t[3] = (n) => l.$emit("edit", "phone"))
451
447
  })
452
- ])) : E("", !0),
453
- c.value ? E("", !0) : (p(), b("div", Po, [
454
- S(r(Ae), {
448
+ ])) : $("", !0),
449
+ c.value ? $("", !0) : (p(), S("div", Po, [
450
+ T(r(Ae), {
455
451
  style: { width: "100%" },
456
- disabled: !J.value,
457
- onClick: Y
452
+ disabled: !G.value,
453
+ onClick: X
458
454
  }, {
459
- default: _(() => n[6] || (n[6] = [
455
+ default: _(() => t[6] || (t[6] = [
460
456
  oe(" Отправить код ")
461
457
  ])),
462
458
  _: 1,
463
459
  __: [6]
464
460
  }, 8, ["disabled"])
465
461
  ])),
466
- c.value ? (p(), b("div", bo, [
467
- S(r(de), {
462
+ c.value ? (p(), S("div", bo, [
463
+ T(r(de), {
468
464
  modelValue: r(d),
469
- "onUpdate:modelValue": n[4] || (n[4] = (o) => se(d) ? d.value = o : null),
465
+ "onUpdate:modelValue": t[4] || (t[4] = (n) => se(d) ? d.value = n : null),
470
466
  size: "large",
471
467
  "text-size": "medium",
472
468
  label: "Код",
473
469
  type: "text",
474
- error: Z.value,
475
- onInput: T,
476
- onBlur: n[5] || (n[5] = (o) => L("code"))
470
+ error: Y.value,
471
+ onInput: M,
472
+ onBlur: t[5] || (t[5] = (n) => L("code"))
477
473
  }, null, 8, ["modelValue", "error"])
478
- ])) : E("", !0),
479
- c.value ? (p(), b("div", So, [
480
- S(ge, {
474
+ ])) : $("", !0),
475
+ c.value ? (p(), S("div", So, [
476
+ T(ge, {
481
477
  loading: l.loading,
482
478
  "rate-limit-text": l.rateLimitText,
483
479
  "is-final-limit": l.isFinalLimit,
484
480
  "on-send-again": C
485
481
  }, {
486
482
  extra: _(() => [
487
- l.isTg ? (p(), b("span", {
483
+ l.isTg ? (p(), S("span", {
488
484
  key: 0,
489
485
  class: "dialogDefaultContainerSendCodeBySmsText",
490
486
  onClick: y
491
487
  }, [
492
- oe(G(l.sendCodeBySmsText) + " ", 1),
493
- S(r(ie), { style: { "margin-left": "5px" } })
494
- ])) : E("", !0)
488
+ oe(K(l.sendCodeBySmsText) + " ", 1),
489
+ T(r(ie), { style: { "margin-left": "5px" } })
490
+ ])) : $("", !0)
495
491
  ]),
496
492
  _: 1
497
493
  }, 8, ["loading", "rate-limit-text", "is-final-limit"])
498
- ])) : E("", !0)
494
+ ])) : $("", !0)
499
495
  ]));
500
496
  }
501
497
  }), Mo = { class: "text-center w-full" }, xo = { class: "dialogTitle" }, Vo = {
@@ -516,43 +512,43 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
516
512
  mode: { default: void 0 }
517
513
  },
518
514
  emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
519
- setup(R, { expose: x, emit: k }) {
520
- const u = R, c = k, v = D(u.modelValue);
515
+ setup(R, { expose: V, emit: E }) {
516
+ const u = R, c = E, v = D(u.modelValue);
521
517
  te(
522
518
  () => u.modelValue,
523
519
  (s) => v.value = s
524
520
  ), te(v, (s) => c("update:modelValue", s));
525
- const g = z(() => u.language ?? "ru"), L = (s) => Ie[g.value] && Ie[g.value][s] || (u.title ?? s), J = z(() => u.title ?? L("Смена номера телефона")), Y = z(() => u.hintText ?? L("Чтобы продолжить, введите новый номер")), e = pe({
521
+ const g = z(() => u.language ?? "ru"), L = (s) => Ie[g.value] && Ie[g.value][s] || (u.title ?? s), G = z(() => u.title ?? L("Смена номера телефона")), X = z(() => u.hintText ?? L("Чтобы продолжить, введите новый номер")), e = pe({
526
522
  oldPhone: u.initialPhone ?? "",
527
523
  newPhone: "",
528
524
  code: "",
529
525
  addPhone: "",
530
526
  addCode: ""
531
- }), T = D(K.OLD), C = D(null), y = D(!1), M = D(!1), d = D("tg"), h = z(() => d.value === "tg"), m = D(!1), { startTimer: Z, remainingSeconds: l, isAvailableForSendAgain: n, totalRateAttempts: o, currentRateAttempt: $ } = qe(), { showRateLimitToast: B } = He(c), { isEditFlow: j, getFlow: ne } = We(D(u.mode)), Q = z(() => n.value ? "Повторить" : `${l.value}`), q = D(re), ee = z(() => q.value === 0), Ne = (s) => new Promise((a) => setTimeout(a, s));
527
+ }), M = D(H.OLD), C = D(null), y = D(!1), x = D(!1), d = D("tg"), h = z(() => d.value === "tg"), m = D(!1), { startTimer: Y, remainingSeconds: l, isAvailableForSendAgain: t, totalRateAttempts: n, currentRateAttempt: P } = qe(), { showRateLimitToast: B } = He(c), { isEditFlow: Z, getFlow: ne } = We(D(u.mode)), J = z(() => t.value ? "Повторить" : `${l.value}`), j = D(re), ee = z(() => j.value === 0), Ne = (s) => new Promise((a) => setTimeout(a, s));
532
528
  async function he(s = "email") {
533
- var t;
534
- return (t = (await Le("/users/profile/session/get-edit-session", { params: { field: s } })).data) == null ? void 0 : t.data;
529
+ var o;
530
+ return (o = (await Le("/users/profile/session/get-edit-session", { params: { field: s } })).data) == null ? void 0 : o.data;
535
531
  }
536
532
  async function Ce(s = "phone") {
537
- var V;
538
- const t = (V = (await le("/users/profile/session/create-if-not-exists", {
533
+ var k;
534
+ const o = (k = (await le("/users/profile/session/create-if-not-exists", {
539
535
  field: s,
540
536
  oldValue: F(u.initialPhone)
541
- })).data) == null ? void 0 : V.data;
542
- C.value = (t == null ? void 0 : t.sessionId) ?? null, T.value = (t == null ? void 0 : t.step) ?? K.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "";
537
+ })).data) == null ? void 0 : k.data;
538
+ C.value = (o == null ? void 0 : o.sessionId) ?? null, M.value = (o == null ? void 0 : o.step) ?? H.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "";
543
539
  }
544
540
  async function ze() {
545
541
  try {
546
542
  const s = await he("phone");
547
- C.value = s.sessionId, T.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
543
+ C.value = s.sessionId, M.value = s.step, e.oldPhone = s.oldValue ?? "", s.sessionId || await Ce("phone");
548
544
  } catch {
549
545
  await Ce("phone");
550
546
  }
551
547
  }
552
548
  async function we(s, a = !1) {
553
- var t;
549
+ var o;
554
550
  try {
555
- const V = await le(
551
+ const k = await le(
556
552
  "/users/profile/check-throttler",
557
553
  {
558
554
  method: "sms",
@@ -566,14 +562,14 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
566
562
  }
567
563
  );
568
564
  await Ne(1e3);
569
- const w = (t = V.data) == null ? void 0 : t.data;
570
- return w ? (w.restTimeSec > 0 ? (Z(w.restTimeSec), n.value = !1, o.value = w.attempts.total, $.value = w.attempts.total - w.attempts.available, q.value = w.attempts.available ?? re) : n.value = !0, w) : null;
565
+ const w = (o = k.data) == null ? void 0 : o.data;
566
+ return w ? (w.restTimeSec > 0 ? (Y(w.restTimeSec), t.value = !1, n.value = w.attempts.total, P.value = w.attempts.total - w.attempts.available, j.value = w.attempts.available ?? re) : t.value = !0, w) : null;
571
567
  } catch {
572
568
  return null;
573
569
  }
574
570
  }
575
- const ve = async ({ phone: s }) => (m.value = !0, await ae({ value: s, isOnlySms: !0 })), ae = async ({ value: s, isOnlySms: a, offLoading: t } = {}) => {
576
- var V, w, A, N, W, I;
571
+ const ve = async ({ phone: s }) => (m.value = !0, await ae({ value: s, isOnlySms: !0 })), ae = async ({ value: s, isOnlySms: a, offLoading: o } = {}) => {
572
+ var k, w, A, N, q, I;
577
573
  y.value = !0;
578
574
  try {
579
575
  const f = s ?? e.oldPhone, i = await le(
@@ -593,69 +589,69 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
593
589
  }
594
590
  );
595
591
  console.debug("response sendContactCode: ", i);
596
- const P = (w = (V = i == null ? void 0 : i.data) == null ? void 0 : V.data) == null ? void 0 : w.deliveryType;
597
- if ((P === "tg" || P === "sms") && (d.value = P, P === "tg" && (m.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", i), (i == null ? void 0 : i.status) === 403 && ((A = i.data) != null && A.tooManyRequests)) {
592
+ const b = (w = (k = i == null ? void 0 : i.data) == null ? void 0 : k.data) == null ? void 0 : w.deliveryType;
593
+ if ((b === "tg" || b === "sms") && (d.value = b, b === "tg" && (m.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", i), (i == null ? void 0 : i.status) === 403 && ((A = i.data) != null && A.tooManyRequests)) {
598
594
  console.debug("sendContactCode IN обработка 403 tooManyRequests", i);
599
- const O = (W = (N = i.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : W.type;
595
+ const O = (q = (N = i.data) == null ? void 0 : N.tooManyRequests) == null ? void 0 : q.type;
600
596
  d.value = O;
601
- const H = i.data.tooManyRequests;
602
- return H.restTimeSec > 0 ? (Z(H.restTimeSec), o.value = H.attempts.total, $.value = H.attempts.total - H.attempts.available, q.value = H.attempts.available ?? re) : n.value = !0, i;
597
+ const W = i.data.tooManyRequests;
598
+ return W.restTimeSec > 0 ? (Y(W.restTimeSec), n.value = W.attempts.total, P.value = W.attempts.total - W.attempts.available, j.value = W.attempts.available ?? re) : t.value = !0, i;
603
599
  }
604
600
  return console.debug("sendContactCode after обработка 403 tooManyRequests", i), await we(f), i;
605
601
  } catch (f) {
606
602
  const i = (I = f == null ? void 0 : f.data) == null ? void 0 : I.tooManyRequests;
607
603
  if ((f == null ? void 0 : f.status) === 403 && i) {
608
- const { restTimeSec: P, attempts: O } = i;
609
- return P > 0 ? (Z(P), o.value = O.total, $.value = O.total - O.available, q.value = O.available ?? re) : n.value = !0, f;
604
+ const { restTimeSec: b, attempts: O } = i;
605
+ return b > 0 ? (Y(b), n.value = O.total, P.value = O.total - O.available, j.value = O.available ?? re) : t.value = !0, f;
610
606
  }
611
607
  throw f;
612
608
  } finally {
613
- y.value = !1, t && (y.value = !1);
609
+ y.value = !1, o && (y.value = !1);
614
610
  }
615
611
  }, Pe = async (s, a) => {
616
- var t, V, w, A, N, W, I, f;
612
+ var o, k, w, A, N, q, I, f;
617
613
  y.value = !0;
618
614
  try {
619
615
  const i = await he("phone");
620
- C.value = i.sessionId, T.value = i.step, e.oldPhone = i.oldValue ?? e.oldPhone, e.newPhone = i.newValue ?? e.newPhone;
621
- const P = await le("/users/profile/change/phone/match-code", {
622
- phone: a === K.NEW ? F(e.newPhone) : F(e.oldPhone),
616
+ C.value = i.sessionId, M.value = i.step, e.oldPhone = i.oldValue ?? e.oldPhone, e.newPhone = i.newValue ?? e.newPhone;
617
+ const b = await le("/users/profile/change/phone/match-code", {
618
+ phone: a === H.NEW ? F(e.newPhone) : F(e.oldPhone),
623
619
  sessionId: C.value,
624
620
  code: s,
625
621
  step: a
626
- }), O = ((t = P.data) == null ? void 0 : t.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep), H = ((N = (A = P.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((W = P.data) == null ? void 0 : W.rateLimit) ?? null, Re = ((I = P.data) == null ? void 0 : I.data.success) ?? ((f = P.data) == null ? void 0 : f.success);
627
- if (B(H), !Re) {
628
- M.value = !0;
622
+ }), O = ((o = b.data) == null ? void 0 : o.nextStep) ?? ((w = (k = b.data) == null ? void 0 : k.data) == null ? void 0 : w.nextStep), W = ((N = (A = b.data) == null ? void 0 : A.data) == null ? void 0 : N.rateLimit) ?? ((q = b.data) == null ? void 0 : q.rateLimit) ?? null, Re = ((I = b.data) == null ? void 0 : I.data.success) ?? ((f = b.data) == null ? void 0 : f.success);
623
+ if (B(W), !Re) {
624
+ x.value = !0;
629
625
  return;
630
626
  }
631
- if (!O) return P;
632
- if (T.value = O, O === K.NEW) {
627
+ if (!O) return b;
628
+ if (M.value = O, O === H.NEW) {
633
629
  const $e = await he("phone");
634
630
  e.oldPhone = $e.oldValue ?? e.oldPhone, e.newPhone = $e.newValue ?? e.newPhone, e.code = "";
635
631
  }
636
- return O === K.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: s }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), C.value = null, c("close")), P;
632
+ return O === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: s }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), C.value = null, c("close")), b;
637
633
  } finally {
638
634
  y.value = !1;
639
635
  }
640
- }, be = ({ code: s }) => Pe(s, K.OLD);
636
+ }, be = ({ code: s }) => Pe(s, H.OLD);
641
637
  function Se(s) {
642
638
  }
643
- const Te = ({ code: s }) => Pe(s, K.NEW);
639
+ const Te = ({ code: s }) => Pe(s, H.NEW);
644
640
  function Me(s) {
645
641
  }
646
642
  const ue = () => {
647
643
  c("close"), v.value = !1;
648
644
  };
649
645
  async function xe(s = "phone") {
650
- var t;
651
- return (t = (await Le("/users/profile/session/get-bind-session", { params: { field: s } })).data) == null ? void 0 : t.data;
646
+ var o;
647
+ return (o = (await Le("/users/profile/session/get-bind-session", { params: { field: s } })).data) == null ? void 0 : o.data;
652
648
  }
653
649
  async function Ve({
654
650
  value: s,
655
651
  field: a = "phone",
656
- offLoading: t = !0
652
+ offLoading: o = !0
657
653
  }) {
658
- var V, w, A;
654
+ var k, w, A;
659
655
  y.value = !0;
660
656
  try {
661
657
  if (!C.value) {
@@ -663,17 +659,17 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
663
659
  field: a,
664
660
  newValue: F(s || e.addPhone)
665
661
  });
666
- if (C.value = ((w = (V = N.data) == null ? void 0 : V.data) == null ? void 0 : w.sessionId) ?? ((A = N.data) == null ? void 0 : A.sessionId) ?? null, !C.value)
662
+ if (C.value = ((w = (k = N.data) == null ? void 0 : k.data) == null ? void 0 : w.sessionId) ?? ((A = N.data) == null ? void 0 : A.sessionId) ?? null, !C.value)
667
663
  throw new Error("не удалось создать bind-сессию (sessionId отсутствует)");
668
664
  }
669
665
  } finally {
670
- t && (y.value = !1);
666
+ o && (y.value = !1);
671
667
  }
672
668
  }
673
669
  async function Fe() {
674
670
  try {
675
671
  const s = await xe("phone");
676
- C.value = s.sessionId, T.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
672
+ C.value = s.sessionId, M.value = s.step, e.addPhone = s.newValue ?? "", s.sessionId || await Ve({ field: "phone", value: e.addPhone });
677
673
  } catch {
678
674
  await Ve({ field: "phone", value: e.addPhone });
679
675
  }
@@ -681,25 +677,25 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
681
677
  const me = async ({
682
678
  value: s,
683
679
  field: a = "phone",
684
- isOnlySms: t = !1,
685
- offLoading: V = !0
680
+ isOnlySms: o = !1,
681
+ offLoading: k = !0
686
682
  } = {}) => {
687
683
  var w, A, N;
688
684
  y.value = !0;
689
685
  try {
690
686
  if (!C.value)
691
687
  throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
692
- const W = s ?? e.addPhone, I = await le(
688
+ const q = s ?? e.addPhone, I = await le(
693
689
  `/users/profile/bind/contact/send-code/${a}`,
694
690
  {
695
691
  sessionId: C.value,
696
- phone: F(W),
692
+ phone: F(q),
697
693
  provider: u.provider,
698
- isOnlySms: t ?? !1
694
+ isOnlySms: o ?? !1
699
695
  },
700
696
  {
701
697
  headers: {
702
- "x-only-sms": t ?? !1
698
+ "x-only-sms": o ?? !1
703
699
  }
704
700
  }
705
701
  ), f = (A = (w = I == null ? void 0 : I.data) == null ? void 0 : w.data) == null ? void 0 : A.deliveryType;
@@ -707,31 +703,31 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
707
703
  const i = (N = I.data) == null ? void 0 : N.tooManyRequests;
708
704
  if (I.status === 403 && i) {
709
705
  const O = i == null ? void 0 : i.type;
710
- return d.value = O, i.restTimeSec > 0 ? (Z(i.restTimeSec), o.value = i.attempts.total, $.value = i.attempts.total - i.attempts.available, q.value = i.attempts.available ?? re) : n.value = !0, I;
706
+ return d.value = O, i.restTimeSec > 0 ? (Y(i.restTimeSec), n.value = i.attempts.total, P.value = i.attempts.total - i.attempts.available, j.value = i.attempts.available ?? re) : t.value = !0, I;
711
707
  }
712
- const P = await we(W);
713
- return P && P.restTimeSec > 0 ? (Z(P.restTimeSec), n.value = !1) : n.value = !0, I;
708
+ const b = await we(q);
709
+ return b && b.restTimeSec > 0 ? (Y(b.restTimeSec), t.value = !1) : t.value = !0, I;
714
710
  } finally {
715
- V && (y.value = !1);
711
+ k && (y.value = !1);
716
712
  }
717
713
  }, ke = async ({ code: s }) => {
718
- var a, t, V, w, A, N, W, I;
714
+ var a, o, k, w, A, N, q, I;
719
715
  y.value = !0;
720
716
  try {
721
717
  if (!C.value) {
722
- const H = await xe("phone");
723
- C.value = H.sessionId, e.addPhone = H.newValue ?? e.addPhone;
718
+ const W = await xe("phone");
719
+ C.value = W.sessionId, e.addPhone = W.newValue ?? e.addPhone;
724
720
  }
725
721
  const f = await le("/users/profile/bind/phone/match-code", {
726
722
  phone: F(e.addPhone),
727
723
  sessionId: C.value,
728
724
  code: s
729
- }), i = ((a = f.data) == null ? void 0 : a.nextStep) ?? ((V = (t = f.data) == null ? void 0 : t.data) == null ? void 0 : V.nextStep), P = ((A = (w = f.data) == null ? void 0 : w.data) == null ? void 0 : A.rateLimit) ?? ((N = f.data) == null ? void 0 : N.rateLimit) ?? null, O = ((W = f.data) == null ? void 0 : W.data.success) ?? ((I = f.data) == null ? void 0 : I.success);
730
- if (B(P), !O) {
731
- M.value = !0;
725
+ }), i = ((a = f.data) == null ? void 0 : a.nextStep) ?? ((k = (o = f.data) == null ? void 0 : o.data) == null ? void 0 : k.nextStep), b = ((A = (w = f.data) == null ? void 0 : w.data) == null ? void 0 : A.rateLimit) ?? ((N = f.data) == null ? void 0 : N.rateLimit) ?? null, O = ((q = f.data) == null ? void 0 : q.data.success) ?? ((I = f.data) == null ? void 0 : I.success);
726
+ if (B(b), !O) {
727
+ x.value = !0;
732
728
  return;
733
729
  }
734
- return i && i === K.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: s }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), C.value = null, c("close")), f;
730
+ return i && i === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: s }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), C.value = null, c("close")), f;
735
731
  } finally {
736
732
  y.value = !1;
737
733
  }
@@ -745,15 +741,15 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
745
741
  return;
746
742
  }
747
743
  await ze(), await ae({});
748
- }), x({
744
+ }), V({
749
745
  localVisible: v,
750
746
  form: e,
751
- currentStep: T,
747
+ currentStep: M,
752
748
  loading: y,
753
- rateLimitText: Q,
749
+ rateLimitText: J,
754
750
  isAvailable: ee,
755
- title: J,
756
- hintText: Y,
751
+ title: G,
752
+ hintText: X,
757
753
  handleClose: ue,
758
754
  sendContactCode: ae,
759
755
  sendBindContactCode: me,
@@ -763,11 +759,11 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
763
759
  handleNewCodeError: Me,
764
760
  matchBindCode: ke,
765
761
  matchBindCodeError: Ee
766
- }), (s, a) => (p(), b(je, null, [
767
- S(r(Ge), {
762
+ }), (s, a) => (p(), S(je, null, [
763
+ T(r(Ge), {
768
764
  modelValue: v.value,
769
765
  "onUpdate:modelValue": [
770
- a[15] || (a[15] = (t) => v.value = t),
766
+ a[15] || (a[15] = (o) => v.value = o),
771
767
  ue
772
768
  ],
773
769
  width: "small",
@@ -777,17 +773,17 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
777
773
  }, {
778
774
  header: _(() => [
779
775
  U("div", Mo, [
780
- S(r(Je), {
776
+ T(r(Je), {
781
777
  "slot-left": !1,
782
778
  size: "small",
783
779
  borded: !0,
784
780
  "no-padding": !1
785
781
  }, {
786
782
  title: _(() => [
787
- U("span", xo, G(r(j) ? J.value : "Добавление номера телефона"), 1)
783
+ U("span", xo, K(r(Z) ? G.value : "Добавление номера телефона"), 1)
788
784
  ]),
789
785
  "right-button": _(() => [
790
- S(r(Qe), {
786
+ T(r(Qe), {
791
787
  class: "cross",
792
788
  onClick: ue
793
789
  })
@@ -797,64 +793,64 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
797
793
  ])
798
794
  ]),
799
795
  default: _(() => [
800
- r(j) ? (p(), b("div", Vo, [
801
- y.value ? (p(), X(Be, { key: 0 })) : E("", !0),
802
- T.value === r(K).OLD ? (p(), X(lo, {
796
+ r(Z) ? (p(), S("div", Vo, [
797
+ y.value ? (p(), Q(Be, { key: 0 })) : $("", !0),
798
+ M.value === r(H).OLD ? (p(), Q(lo, {
803
799
  key: 1,
804
800
  phone: e.oldPhone,
805
- "onUpdate:phone": a[0] || (a[0] = (t) => e.oldPhone = t),
801
+ "onUpdate:phone": a[0] || (a[0] = (o) => e.oldPhone = o),
806
802
  code: e.code,
807
- "onUpdate:code": a[1] || (a[1] = (t) => e.code = t),
808
- "rate-limit-text": Q.value,
803
+ "onUpdate:code": a[1] || (a[1] = (o) => e.code = o),
804
+ "rate-limit-text": J.value,
809
805
  "is-final-limit": ee.value,
810
- "is-not-match-code": M.value,
806
+ "is-not-match-code": x.value,
811
807
  loading: y.value,
812
808
  "is-tg": h.value,
813
- onOnSendCode: a[2] || (a[2] = (t) => ae({ value: e.oldPhone })),
814
- onOnSendCodeAgain: a[3] || (a[3] = (t) => ae({ value: e.oldPhone, isOnlySms: !h.value && m.value })),
809
+ onOnSendCode: a[2] || (a[2] = (o) => ae({ value: e.oldPhone })),
810
+ onOnSendCodeAgain: a[3] || (a[3] = (o) => ae({ value: e.oldPhone, isOnlySms: !h.value && m.value })),
815
811
  onOnSendOnlySms: ve,
816
812
  onOnMatchCode: be,
817
813
  onOnMatchCodeError: Se
818
- }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : T.value === r(K).NEW ? (p(), X(mo, {
814
+ }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(H).NEW ? (p(), Q(mo, {
819
815
  key: 2,
820
816
  phone: e.newPhone,
821
- "onUpdate:phone": a[4] || (a[4] = (t) => e.newPhone = t),
817
+ "onUpdate:phone": a[4] || (a[4] = (o) => e.newPhone = o),
822
818
  oldPhone: e.oldPhone,
823
- "onUpdate:oldPhone": a[5] || (a[5] = (t) => e.oldPhone = t),
819
+ "onUpdate:oldPhone": a[5] || (a[5] = (o) => e.oldPhone = o),
824
820
  code: e.code,
825
- "onUpdate:code": a[6] || (a[6] = (t) => e.code = t),
826
- "hint-text": Y.value,
827
- "rate-limit-text": Q.value,
821
+ "onUpdate:code": a[6] || (a[6] = (o) => e.code = o),
822
+ "hint-text": X.value,
823
+ "rate-limit-text": J.value,
828
824
  "is-final-limit": ee.value,
829
- "is-not-match-code": M.value,
825
+ "is-not-match-code": x.value,
830
826
  loading: y.value,
831
827
  "is-tg": h.value,
832
- onOnSendCode: a[7] || (a[7] = (t) => ae({ value: e.newPhone })),
833
- onOnSendCodeAgain: a[8] || (a[8] = (t) => ae({ value: e.newPhone, isOnlySms: !h.value && m.value })),
828
+ onOnSendCode: a[7] || (a[7] = (o) => ae({ value: e.newPhone })),
829
+ onOnSendCodeAgain: a[8] || (a[8] = (o) => ae({ value: e.newPhone, isOnlySms: !h.value && m.value })),
834
830
  onOnSendOnlySms: ve,
835
831
  onOnMatchCode: Te,
836
832
  onOnMatchCodeError: Me,
837
- onOnClearCodeError: a[9] || (a[9] = (t) => M.value = !1)
838
- }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : T.value === r(K).COMPLETED ? (p(), b("div", ko, [
839
- U("p", null, G(L("Телефон успешно изменен")), 1)
840
- ])) : E("", !0)
841
- ])) : (p(), b("div", Eo, [
842
- y.value ? (p(), X(Be, { key: 0 })) : E("", !0),
843
- S(To, {
833
+ onOnClearCodeError: a[9] || (a[9] = (o) => x.value = !1)
834
+ }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(H).COMPLETED ? (p(), S("div", ko, [
835
+ U("p", null, K(L("Телефон успешно изменен")), 1)
836
+ ])) : $("", !0)
837
+ ])) : (p(), S("div", Eo, [
838
+ y.value ? (p(), Q(Be, { key: 0 })) : $("", !0),
839
+ T(To, {
844
840
  phone: e.addPhone,
845
- "onUpdate:phone": a[10] || (a[10] = (t) => e.addPhone = t),
841
+ "onUpdate:phone": a[10] || (a[10] = (o) => e.addPhone = o),
846
842
  oldPhone: e.oldPhone,
847
- "onUpdate:oldPhone": a[11] || (a[11] = (t) => e.oldPhone = t),
843
+ "onUpdate:oldPhone": a[11] || (a[11] = (o) => e.oldPhone = o),
848
844
  code: e.addCode,
849
- "onUpdate:code": a[12] || (a[12] = (t) => e.addCode = t),
850
- "hint-text": r(j) ? Y.value : "Чтобы продолжить, введите новый номер",
851
- "rate-limit-text": Q.value,
845
+ "onUpdate:code": a[12] || (a[12] = (o) => e.addCode = o),
846
+ "hint-text": r(Z) ? X.value : "Чтобы продолжить, введите новый номер",
847
+ "rate-limit-text": J.value,
852
848
  "is-final-limit": ee.value,
853
- "is-not-match-code": M.value,
849
+ "is-not-match-code": x.value,
854
850
  loading: y.value,
855
851
  "is-tg": h.value,
856
- onOnSendCode: a[13] || (a[13] = (t) => me({ value: e.addPhone, field: "phone" })),
857
- onOnSendCodeAgain: a[14] || (a[14] = (t) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && m.value })),
852
+ onOnSendCode: a[13] || (a[13] = (o) => me({ value: e.addPhone, field: "phone" })),
853
+ onOnSendCodeAgain: a[14] || (a[14] = (o) => me({ value: e.addPhone, field: "phone", isOnlySms: !h.value && m.value })),
858
854
  onOnSendOnlySms: ve,
859
855
  onOnMatchCode: ke,
860
856
  onOnMatchCodeError: Ee
@@ -863,7 +859,7 @@ const ie = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
863
859
  ]),
864
860
  _: 1
865
861
  }, 8, ["modelValue"]),
866
- S(r(Xe))
862
+ T(r(Xe))
867
863
  ], 64));
868
864
  }
869
865
  });