@yourgoods/ui-smart 0.50.1 → 0.51.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. package/dist/{ProfileEmailDialog-_xFNmM53.js → ProfileEmailDialog-BFVZACzO.js} +306 -306
  2. package/dist/{ProfilePasswordDialog-BRL-NxyC.js → ProfilePasswordDialog-BSB6ZLoY.js} +1 -1
  3. package/dist/{ProfilePhoneDialog-DJzWkfsA.js → ProfilePhoneDialog-BozJVfL9.js} +239 -225
  4. package/dist/components/PEditUserContact/PEditUserContact.vue.d.ts +2 -0
  5. package/dist/components/PEditUserContact/ProfileDialogs/DialogManager.vue.d.ts +2 -0
  6. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewEmailContent.vue.d.ts +3 -1
  7. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/AddNewPhoneContent.vue.d.ts +5 -1
  8. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewEmailContent.vue.d.ts +4 -2
  9. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/NewPhoneContent.vue.d.ts +3 -1
  10. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldEmailContent.vue.d.ts +3 -1
  11. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/OldPhoneContent.vue.d.ts +3 -1
  12. package/dist/components/PEditUserContact/ProfileDialogs/DialogSegments/ThrottlerTimer.vue.d.ts +31 -43
  13. package/dist/components/PEditUserContact/ProfileDialogs/ProfilePhoneDialog.vue.d.ts +2 -0
  14. package/dist/components/PEditUserContact/index.vue.d.ts +2 -0
  15. package/dist/{index-Dt-xD4lU.js → index-DR9kwm5X.js} +196 -190
  16. package/dist/index.js +2 -2
  17. package/dist/types.d.ts +10 -0
  18. package/dist/useRateLimitToast-qLNKIH0n.js +132 -0
  19. package/dist/utils/url.d.ts +2 -0
  20. package/package.json +1 -1
  21. package/dist/useRateLimitToast-DID9XsBg.js +0 -134
@@ -1,16 +1,16 @@
1
- import { createElementBlock as S, openBlock as h, createElementVNode as H, defineComponent as he, reactive as ve, watch as _, ref as O, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as x, toDisplayString as G, createBlock as J, createTextVNode as Z, unref as r, isRef as le, withCtx as X, onMounted as We, Fragment as je } from "vue";
2
- import { T as we, c as Ne, a as He, u as Ge, P as Oe, b as Je } from "./useRateLimitToast-DID9XsBg.js";
3
- import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Ke, IconMailMd as Re, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
4
- import { C as j, t as De, p as te, g as Ae } from "./index-Dt-xD4lU.js";
1
+ import { createElementBlock as S, openBlock as v, createElementVNode as G, defineComponent as he, reactive as ve, watch as _, ref as D, toRefs as Ce, computed as I, createCommentVNode as B, createVNode as b, toDisplayString as q, createBlock as J, createTextVNode as X, unref as r, isRef as le, withCtx as Y, onMounted as We, Fragment as je } from "vue";
2
+ import { _ as we, c as Ne, a as He, u as Ge, P as De, b as Je } from "./useRateLimitToast-qLNKIH0n.js";
3
+ import { IconTelegramSm as Pe, PInput as se, IconPhoneMd as Re, IconMailMd as Ke, PButton as ze, PDialog as Qe, PTopBar as Xe, IconCrossMd as Ye, PTeleportContainer as Ze } from "@profeat/ui-kit";
4
+ import { C as H, t as Oe, p as te, g as Ae } from "./index-DR9kwm5X.js";
5
5
  const _e = {
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 et(U, b) {
12
- return h(), S("svg", _e, b[0] || (b[0] = [
13
- H("path", {
11
+ function et(U, V) {
12
+ return v(), S("svg", _e, V[0] || (V[0] = [
13
+ G("path", {
14
14
  fill: "#1C7EF1",
15
15
  "fill-rule": "evenodd",
16
16
  d: "M1 0a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1zm1.5 2a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5zM6 13a1 1 0 1 0 0 2 1 1 0 0 0 0-2",
@@ -18,13 +18,13 @@ function et(U, b) {
18
18
  }, null, -1)
19
19
  ]));
20
20
  }
21
- const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }, ot = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, nt = { class: "dialogDefaultContainerTextHint" }, at = { class: "chip" }, lt = {
21
+ const de = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }, ot = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, nt = { class: "dialogDefaultContainerTextHint" }, at = { class: "chip" }, lt = {
22
22
  key: 0,
23
23
  class: "input-wrapper"
24
24
  }, st = {
25
25
  key: 1,
26
26
  class: "input-wrapper"
27
- }, it = /* @__PURE__ */ he({
27
+ }, dt = /* @__PURE__ */ he({
28
28
  __name: "OldPhoneContent",
29
29
  props: {
30
30
  phone: {},
@@ -39,105 +39,107 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
39
39
  isFinalLimit: { type: Boolean },
40
40
  isNotMatchCode: { type: Boolean },
41
41
  loading: { type: Boolean },
42
- isTg: { type: Boolean }
42
+ isTg: { type: Boolean },
43
+ product: {}
43
44
  },
44
45
  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(U, { emit: b }) {
46
- const E = U, u = b, c = ve({
46
+ setup(U, { emit: V }) {
47
+ const E = U, u = V, c = ve({
47
48
  touched: { phone: !1, code: !1 },
48
49
  phoneModel: E.phone,
49
50
  codeModel: E.code
50
51
  });
51
52
  _(
52
53
  () => c.phoneModel,
53
- (v) => u("update:phone", v)
54
+ (h) => u("update:phone", h)
54
55
  ), _(
55
56
  () => c.codeModel,
56
- (v) => u("update:code", v)
57
+ (h) => u("update:code", h)
57
58
  );
58
- const f = (v) => {
59
- c.touched[v] = !0;
59
+ const f = (h) => {
60
+ c.touched[h] = !0;
60
61
  };
61
- let p = O("");
62
- const z = (v) => {
63
- const y = v.target;
64
- let d = ((y == null ? void 0 : y.value) ?? "").replace(/\D/g, "");
65
- d.length < 4 && u("on-clear-code-error"), d.length > 4 && (d = d.slice(0, 4)), V.value = d, y && y.value !== d && (y.value = d), d.length === 4 && d !== p.value && (p.value = d, u("on-match-code", { phone: e.value, code: d }));
66
- }, Y = () => u("on-send-code-again", { phone: c.phoneModel }), K = () => {
62
+ let p = D("");
63
+ const z = (h) => {
64
+ const y = h.target;
65
+ let i = ((y == null ? void 0 : y.value) ?? "").replace(/\D/g, "");
66
+ i.length < 4 && u("on-clear-code-error"), i.length > 4 && (i = i.slice(0, 4)), x.value = i, y && y.value !== i && (y.value = i), i.length === 4 && i !== p.value && (p.value = i, u("on-match-code", { phone: e.value, code: i }));
67
+ }, Z = () => u("on-send-code-again", { phone: c.phoneModel }), K = () => {
67
68
  u("on-send-only-sms", { phone: c.phoneModel });
68
- }, { phoneModel: e, codeModel: V, touched: P } = Ce(c), C = I(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), D = I(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? V.value.trim() ? E.codeError ?? null : "Введите код" : "");
69
- return (v, y) => (h(), S("div", tt, [
70
- H("div", ot, [
71
- H("div", nt, G(v.hintText), 1),
72
- H("div", at, [
73
- v.isTg ? (h(), J(r(Pe), { key: 0 })) : (h(), J(r(ie), {
69
+ }, { phoneModel: e, codeModel: x, touched: P } = Ce(c), C = I(() => P.value.phone && !e.value.trim() ? "Введите телефон" : E.phoneError), O = I(() => E.isNotMatchCode ? "Неверный код" : P.value.code ? x.value.trim() ? E.codeError ?? null : "Введите код" : "");
70
+ return (h, y) => (v(), S("div", tt, [
71
+ G("div", ot, [
72
+ G("div", nt, q(h.hintText), 1),
73
+ G("div", at, [
74
+ h.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
74
75
  key: 1,
75
76
  style: { "margin-left": "5px" }
76
77
  })),
77
- Z(" " + G(v.isTg ? "Telegram" : "СМС"), 1)
78
+ X(" " + q(h.isTg ? "Telegram" : "СМС"), 1)
78
79
  ])
79
80
  ]),
80
- v.showPhone ? (h(), S("div", lt, [
81
- x(r(se), {
81
+ h.showPhone ? (v(), S("div", lt, [
82
+ b(r(se), {
82
83
  modelValue: r(e),
83
- "onUpdate:modelValue": y[0] || (y[0] = (d) => le(e) ? e.value = d : null),
84
+ "onUpdate:modelValue": y[0] || (y[0] = (i) => le(e) ? e.value = i : null),
84
85
  size: "large",
85
86
  "text-size": "medium",
86
87
  label: "Телефон",
87
88
  type: "tel",
88
89
  error: C.value,
89
90
  disabled: !0,
90
- onBlur: y[1] || (y[1] = (d) => f("phone")),
91
- onInput: y[2] || (y[2] = (d) => f("phone"))
91
+ onBlur: y[1] || (y[1] = (i) => f("phone")),
92
+ onInput: y[2] || (y[2] = (i) => f("phone"))
92
93
  }, null, 8, ["modelValue", "error"]),
93
- x(r(Ke), {
94
+ b(r(Re), {
94
95
  class: "icon-locked",
95
- onClick: y[3] || (y[3] = (d) => v.$emit("edit", "phone"))
96
+ onClick: y[3] || (y[3] = (i) => h.$emit("edit", "phone"))
96
97
  })
97
98
  ])) : B("", !0),
98
- v.showCode ? (h(), S("div", st, [
99
- x(r(se), {
100
- modelValue: r(V),
101
- "onUpdate:modelValue": y[4] || (y[4] = (d) => le(V) ? V.value = d : null),
99
+ h.showCode ? (v(), S("div", st, [
100
+ b(r(se), {
101
+ modelValue: r(x),
102
+ "onUpdate:modelValue": y[4] || (y[4] = (i) => le(x) ? x.value = i : null),
102
103
  size: "large",
103
104
  "text-size": "medium",
104
105
  label: "Код",
105
106
  type: "text",
106
- error: D.value,
107
+ error: O.value,
107
108
  onInput: z,
108
- onBlur: y[5] || (y[5] = (d) => f("code"))
109
+ onBlur: y[5] || (y[5] = (i) => f("code"))
109
110
  }, null, 8, ["modelValue", "error"])
110
111
  ])) : B("", !0),
111
- x(we, {
112
- loading: v.loading,
113
- "rate-limit-text": v.rateLimitText,
114
- "is-final-limit": v.isFinalLimit,
115
- "on-send-again": Y
112
+ b(we, {
113
+ loading: h.loading,
114
+ "rate-limit-text": h.rateLimitText,
115
+ "is-final-limit": h.isFinalLimit,
116
+ "on-send-again": Z,
117
+ product: h.product
116
118
  }, {
117
- extra: X(() => [
118
- v.isTg ? (h(), S("span", {
119
+ extra: Y(() => [
120
+ h.isTg ? (v(), S("span", {
119
121
  key: 0,
120
122
  class: "dialogDefaultContainerSendCodeBySmsText",
121
123
  onClick: K
122
124
  }, [
123
- Z(G(v.sendCodeBySmsText) + " ", 1),
124
- x(r(ie), { style: { "margin-left": "5px" } })
125
+ X(q(h.sendCodeBySmsText) + " ", 1),
126
+ b(r(de), { style: { "margin-left": "5px" } })
125
127
  ])) : B("", !0)
126
128
  ]),
127
129
  _: 1
128
- }, 8, ["loading", "rate-limit-text", "is-final-limit"])
130
+ }, 8, ["loading", "rate-limit-text", "is-final-limit", "product"])
129
131
  ]));
130
132
  }
131
133
  }), F = (U) => {
132
- const b = U.replace(/\D/g, "");
133
- if (b.length >= 10 && b.length <= 15) {
134
- if (b.startsWith("8"))
135
- return `+7${b.slice(1)}`;
136
- if (b.startsWith("7"))
137
- return `+${b}`;
134
+ const V = U.replace(/\D/g, "");
135
+ if (V.length >= 10 && V.length <= 15) {
136
+ if (V.startsWith("8"))
137
+ return `+7${V.slice(1)}`;
138
+ if (V.startsWith("7"))
139
+ return `+${V}`;
138
140
  }
139
- return U.trim().startsWith("+") ? U.trim() : `+${b}`;
140
- }, dt = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, ut = { class: "dialogDefaultContainerTextHint" }, ct = {
141
+ return U.trim().startsWith("+") ? U.trim() : `+${V}`;
142
+ }, it = { class: "dialogDefaultContainerInsideContent" }, rt = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, ut = { class: "dialogDefaultContainerTextHint" }, ct = {
141
143
  key: 0,
142
144
  class: "chip"
143
145
  }, pt = {
@@ -163,11 +165,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
163
165
  isFinalLimit: { type: Boolean },
164
166
  isNotMatchCode: { type: Boolean, default: !1 },
165
167
  loading: { type: Boolean },
166
- isTg: { type: Boolean }
168
+ isTg: { type: Boolean },
169
+ product: {}
167
170
  },
168
171
  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"],
169
- setup(U, { emit: b }) {
170
- const E = U, u = b, c = O(!1), f = O(""), p = ve({
172
+ setup(U, { emit: V }) {
173
+ const E = U, u = V, c = D(!1), f = D(""), p = ve({
171
174
  touched: { phone: !1, code: !1 },
172
175
  phoneModel: "",
173
176
  codeModel: ""
@@ -181,12 +184,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
181
184
  () => p.codeModel,
182
185
  (t) => u("update:code", t)
183
186
  );
184
- const z = (t) => p.touched[t] = !0, Y = (t) => p.touched[t] = !1, K = () => {
185
- f.value = "", Y("phone");
187
+ const z = (t) => p.touched[t] = !0, Z = (t) => p.touched[t] = !1, K = () => {
188
+ f.value = "", Z("phone");
186
189
  }, e = I(() => {
187
190
  const l = p.phoneModel.trim().replace(/[()\-\s]/g, "");
188
191
  return /^\+?\d{10,15}$/.test(l);
189
- }), V = I(() => !e.value || !!f.value), P = async () => {
192
+ }), x = I(() => !e.value || !!f.value), P = async () => {
190
193
  var t;
191
194
  try {
192
195
  if (z("phone"), !e.value) {
@@ -203,38 +206,38 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
203
206
  console.error("Неизвестная ошибка при проверке доступности телефона:", l), f.value = "Это не похоже на номер телефона";
204
207
  }
205
208
  };
206
- let C = O("");
207
- const D = (t) => {
209
+ let C = D("");
210
+ const O = (t) => {
208
211
  const l = t.target;
209
212
  let s = ((l == null ? void 0 : l.value) ?? "").replace(/\D/g, "");
210
- s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), L.value = s, l && l.value !== s && (l.value = s), s.length === 4 && s !== C.value && (C.value = s, u("on-match-code", { phone: d.value, code: s }));
211
- }, v = () => {
213
+ s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4)), L.value = s, l && l.value !== s && (l.value = s), s.length === 4 && s !== C.value && (C.value = s, u("on-match-code", { phone: i.value, code: s }));
214
+ }, h = () => {
212
215
  u("on-send-code-again", { phone: p.phoneModel });
213
216
  }, y = () => {
214
217
  u("on-send-only-sms", { phone: p.phoneModel });
215
- }, { phoneModel: d, codeModel: L, touched: de } = Ce(p), A = I(() => {
218
+ }, { phoneModel: i, codeModel: L, touched: ie } = Ce(p), A = I(() => {
216
219
  if (f.value) return f.value;
217
220
  if (p.touched.phone) {
218
221
  if (!p.phoneModel.trim()) return "Введите номер телефона";
219
222
  if (!e.value) return "Это не похоже на номер телефона";
220
223
  }
221
224
  return E.phoneError || "";
222
- }), Q = I(() => E.isNotMatchCode ? "Неверный код" : de.value.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
223
- return (t, l) => (h(), S("div", dt, [
224
- H("div", rt, [
225
- H("div", ut, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
226
- c.value ? (h(), S("div", ct, [
227
- t.isTg ? (h(), J(r(Pe), { key: 0 })) : (h(), J(r(ie), {
225
+ }), Q = I(() => E.isNotMatchCode ? "Неверный код" : ie.value.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
226
+ return (t, l) => (v(), S("div", it, [
227
+ G("div", rt, [
228
+ G("div", ut, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
229
+ c.value ? (v(), S("div", ct, [
230
+ t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
228
231
  key: 1,
229
232
  style: { "margin-left": "5px" }
230
233
  })),
231
- Z(" " + G(t.isTg ? "Telegram" : "СМС"), 1)
234
+ X(" " + q(t.isTg ? "Telegram" : "СМС"), 1)
232
235
  ])) : B("", !0)
233
236
  ]),
234
- t.showPhone ? (h(), S("div", pt, [
235
- x(r(se), {
236
- modelValue: r(d),
237
- "onUpdate:modelValue": l[0] || (l[0] = (s) => le(d) ? d.value = s : null),
237
+ t.showPhone ? (v(), S("div", pt, [
238
+ b(r(se), {
239
+ modelValue: r(i),
240
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => le(i) ? i.value = s : null),
238
241
  size: "large",
239
242
  "text-size": "medium",
240
243
  label: "Телефон",
@@ -243,26 +246,26 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
243
246
  onBlur: l[1] || (l[1] = (s) => z("phone")),
244
247
  onInput: K
245
248
  }, null, 8, ["modelValue", "error"]),
246
- x(r(Re), {
249
+ b(r(Ke), {
247
250
  class: "icon-locked",
248
251
  onClick: l[2] || (l[2] = (s) => t.$emit("edit", "phone"))
249
252
  })
250
253
  ])) : B("", !0),
251
- c.value ? B("", !0) : (h(), S("div", ht, [
252
- x(r(ze), {
254
+ c.value ? B("", !0) : (v(), S("div", ht, [
255
+ b(r(ze), {
253
256
  style: { width: "100%" },
254
- disabled: V.value,
257
+ disabled: x.value,
255
258
  onClick: P
256
259
  }, {
257
- default: X(() => l[5] || (l[5] = [
258
- Z(" Отправить код ")
260
+ default: Y(() => l[5] || (l[5] = [
261
+ X(" Отправить код ")
259
262
  ])),
260
263
  _: 1,
261
264
  __: [5]
262
265
  }, 8, ["disabled"])
263
266
  ])),
264
- c.value ? (h(), S("div", vt, [
265
- x(r(se), {
267
+ c.value ? (v(), S("div", vt, [
268
+ b(r(se), {
266
269
  modelValue: r(L),
267
270
  "onUpdate:modelValue": l[3] || (l[3] = (s) => le(L) ? L.value = s : null),
268
271
  size: "large",
@@ -270,29 +273,30 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
270
273
  label: "Код",
271
274
  type: "text",
272
275
  error: Q.value,
273
- onInput: D,
276
+ onInput: O,
274
277
  onBlur: l[4] || (l[4] = (s) => z("code"))
275
278
  }, null, 8, ["modelValue", "error"])
276
279
  ])) : B("", !0),
277
- !t.loading && c.value ? (h(), S("div", mt, [
278
- x(we, {
280
+ !t.loading && c.value ? (v(), S("div", mt, [
281
+ b(we, {
279
282
  loading: t.loading,
280
283
  "rate-limit-text": t.rateLimitText,
281
284
  "is-final-limit": t.isFinalLimit,
282
- "on-send-again": v
285
+ "on-send-again": h,
286
+ product: t.product
283
287
  }, {
284
- extra: X(() => [
285
- t.isTg ? (h(), S("span", {
288
+ extra: Y(() => [
289
+ t.isTg ? (v(), S("span", {
286
290
  key: 0,
287
291
  class: "dialogDefaultContainerSendCodeBySmsText",
288
292
  onClick: y
289
293
  }, [
290
- Z(G(t.sendCodeBySmsText) + " ", 1),
291
- x(r(ie), { style: { "margin-left": "5px" } })
294
+ X(q(t.sendCodeBySmsText) + " ", 1),
295
+ b(r(de), { style: { "margin-left": "5px" } })
292
296
  ])) : B("", !0)
293
297
  ]),
294
298
  _: 1
295
- }, 8, ["loading", "rate-limit-text", "is-final-limit"])
299
+ }, 8, ["loading", "rate-limit-text", "is-final-limit", "product"])
296
300
  ])) : B("", !0)
297
301
  ]));
298
302
  }
@@ -308,7 +312,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
308
312
  }, St = {
309
313
  key: 2,
310
314
  class: "input-wrapper"
311
- }, Mt = { key: 3 }, xt = /* @__PURE__ */ he({
315
+ }, Mt = { key: 3 }, bt = /* @__PURE__ */ he({
312
316
  __name: "AddNewPhoneContent",
313
317
  props: {
314
318
  phone: {},
@@ -322,11 +326,13 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
322
326
  isFinalLimit: { type: Boolean },
323
327
  isNotMatchCode: { type: Boolean },
324
328
  loading: { type: Boolean },
325
- isTg: { type: Boolean }
329
+ isTg: { type: Boolean },
330
+ product: {},
331
+ onDisableAddPhone: { type: Boolean, default: !1 }
326
332
  },
327
333
  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"],
328
- setup(U, { emit: b }) {
329
- const E = U, u = b, c = O(!1), f = O(""), p = ve({
334
+ setup(U, { emit: V }) {
335
+ const E = U, u = V, c = D(!1), f = D(""), p = ve({
330
336
  touched: { phone: !1, code: !1 },
331
337
  phoneModel: "",
332
338
  codeModel: ""
@@ -340,12 +346,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
340
346
  () => p.codeModel,
341
347
  (t) => u("update:code", t)
342
348
  );
343
- const z = (t) => p.touched[t] = !0, Y = (t) => p.touched[t] = !1, K = () => {
344
- f.value = "", Y("phone");
349
+ const z = (t) => p.touched[t] = !0, Z = (t) => p.touched[t] = !1, K = () => {
350
+ f.value = "", Z("phone");
345
351
  }, e = I(() => {
346
352
  const l = p.phoneModel.trim().replace(/[()\-\s]/g, "");
347
353
  return /^\+?\d{10,15}$/.test(l);
348
- }), V = I(() => !e.value || !!f.value), P = async () => {
354
+ }), x = I(() => !e.value || !!f.value), P = async () => {
349
355
  var t;
350
356
  try {
351
357
  if (z("phone"), !e.value) {
@@ -363,15 +369,15 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
363
369
  }
364
370
  };
365
371
  let C = "";
366
- const D = (t) => {
372
+ const O = (t) => {
367
373
  const l = t.target;
368
374
  let s = l.value.replace(/\D/g, "");
369
375
  s.length < 4 && u("on-clear-code-error"), s.length > 4 && (s = s.slice(0, 4), l.value = s), p.codeModel = s, s.length === 4 && s !== C && (C = s, u("on-match-code", { phone: p.phoneModel, code: s }));
370
- }, v = () => {
376
+ }, h = () => {
371
377
  u("on-send-code-again", { phone: p.phoneModel });
372
378
  }, y = () => {
373
379
  u("on-send-only-sms", { phone: p.phoneModel });
374
- }, { phoneModel: d, codeModel: L, touched: de } = Ce(p), A = I(() => {
380
+ }, { phoneModel: i, codeModel: L, touched: ie } = Ce(p), A = I(() => {
375
381
  if (f.value) return f.value;
376
382
  if (p.touched.phone) {
377
383
  if (!p.phoneModel.trim()) return "Введите номер телефона";
@@ -379,49 +385,51 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
379
385
  }
380
386
  return E.phoneError || "";
381
387
  }), Q = I(() => E.isNotMatchCode ? "Неверный код" : p.touched.code ? L.value.trim() ? E.codeError ?? null : "Введите код" : "");
382
- return (t, l) => (h(), S("div", yt, [
383
- H("div", gt, [
384
- H("div", Ct, G(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
385
- c.value ? (h(), S("div", wt, [
386
- t.isTg ? (h(), J(r(Pe), { key: 0 })) : (h(), J(r(ie), {
388
+ return (t, l) => (v(), S("div", yt, [
389
+ G("div", gt, [
390
+ G("div", Ct, q(c.value ? "Чтобы продолжить, введите код подтверждения из" : t.hintText), 1),
391
+ c.value ? (v(), S("div", wt, [
392
+ t.isTg ? (v(), J(r(Pe), { key: 0 })) : (v(), J(r(de), {
387
393
  key: 1,
388
394
  style: { "margin-left": "5px" }
389
395
  })),
390
- Z(" " + G(t.isTg ? "Telegram" : "СМС"), 1)
396
+ X(" " + q(t.isTg ? "Telegram" : "СМС"), 1)
391
397
  ])) : B("", !0)
392
398
  ]),
393
- t.showPhone ? (h(), S("div", Pt, [
394
- x(r(se), {
395
- modelValue: r(d),
396
- "onUpdate:modelValue": l[0] || (l[0] = (s) => le(d) ? d.value = s : null),
399
+ t.showPhone ? (v(), S("div", Pt, [
400
+ b(r(se), {
401
+ modelValue: r(i),
402
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => le(i) ? i.value = s : null),
397
403
  size: "large",
398
404
  "text-size": "medium",
399
405
  label: "Телефон",
400
406
  type: "tel",
401
407
  error: A.value,
408
+ disabled: !!t.onDisableAddPhone,
402
409
  onBlur: l[1] || (l[1] = (s) => z("phone")),
403
410
  onInput: K
404
- }, null, 8, ["modelValue", "error"]),
405
- x(r(Re), {
411
+ }, null, 8, ["modelValue", "error", "disabled"]),
412
+ X(" " + q("fuck off: " + t.onDisableAddPhone) + " ", 1),
413
+ b(r(Re), {
406
414
  class: "icon-locked",
407
415
  onClick: l[2] || (l[2] = (s) => t.$emit("edit", "phone"))
408
416
  })
409
417
  ])) : B("", !0),
410
- c.value ? B("", !0) : (h(), S("div", Tt, [
411
- x(r(ze), {
418
+ c.value ? B("", !0) : (v(), S("div", Tt, [
419
+ b(r(ze), {
412
420
  style: { width: "100%" },
413
- disabled: V.value,
421
+ disabled: x.value,
414
422
  onClick: P
415
423
  }, {
416
- default: X(() => l[5] || (l[5] = [
417
- Z(" Отправить код ")
424
+ default: Y(() => l[5] || (l[5] = [
425
+ X(" Отправить код ")
418
426
  ])),
419
427
  _: 1,
420
428
  __: [5]
421
429
  }, 8, ["disabled"])
422
430
  ])),
423
- c.value ? (h(), S("div", St, [
424
- x(r(se), {
431
+ c.value ? (v(), S("div", St, [
432
+ b(r(se), {
425
433
  modelValue: r(L),
426
434
  "onUpdate:modelValue": l[3] || (l[3] = (s) => le(L) ? L.value = s : null),
427
435
  size: "large",
@@ -429,33 +437,34 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
429
437
  label: "Код",
430
438
  type: "text",
431
439
  error: Q.value,
432
- onInput: D,
440
+ onInput: O,
433
441
  onBlur: l[4] || (l[4] = (s) => z("code"))
434
442
  }, null, 8, ["modelValue", "error"])
435
443
  ])) : B("", !0),
436
- c.value ? (h(), S("div", Mt, [
437
- x(we, {
444
+ c.value ? (v(), S("div", Mt, [
445
+ b(we, {
438
446
  loading: t.loading,
439
447
  "rate-limit-text": t.rateLimitText,
440
448
  "is-final-limit": t.isFinalLimit,
441
- "on-send-again": v
449
+ "on-send-again": h,
450
+ product: t.product
442
451
  }, {
443
- extra: X(() => [
444
- t.isTg ? (h(), S("span", {
452
+ extra: Y(() => [
453
+ t.isTg ? (v(), S("span", {
445
454
  key: 0,
446
455
  class: "dialogDefaultContainerSendCodeBySmsText",
447
456
  onClick: y
448
457
  }, [
449
- Z(G(t.sendCodeBySmsText) + " ", 1),
450
- x(r(ie), { style: { "margin-left": "5px" } })
458
+ X(q(t.sendCodeBySmsText) + " ", 1),
459
+ b(r(de), { style: { "margin-left": "5px" } })
451
460
  ])) : B("", !0)
452
461
  ]),
453
462
  _: 1
454
- }, 8, ["loading", "rate-limit-text", "is-final-limit"])
463
+ }, 8, ["loading", "rate-limit-text", "is-final-limit", "product"])
455
464
  ])) : B("", !0)
456
465
  ]));
457
466
  }
458
- }), kt = { class: "text-center w-full" }, Vt = { class: "dialogTitle" }, bt = {
467
+ }), kt = { class: "text-center w-full" }, xt = { class: "dialogTitle" }, Vt = {
459
468
  key: 0,
460
469
  class: "dialogDefaultContainer"
461
470
  }, $t = { key: 3 }, Bt = {
@@ -470,22 +479,23 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
470
479
  initialPhone: { default: "" },
471
480
  language: {},
472
481
  provider: {},
482
+ onDisableAddPhone: { type: Boolean, default: !1 },
473
483
  mode: { default: void 0 }
474
484
  },
475
485
  emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
476
- setup(U, { expose: b, emit: E }) {
477
- const u = U, c = E, f = O(u.modelValue);
486
+ setup(U, { expose: V, emit: E }) {
487
+ const u = U, c = E, f = D(u.modelValue);
478
488
  _(
479
489
  () => u.modelValue,
480
490
  (n) => f.value = n
481
491
  ), _(f, (n) => c("update:modelValue", n));
482
- const p = I(() => u.language ?? "ru"), z = (n) => De[p.value] && De[p.value][n] || (u.title ?? n), Y = I(() => u.title ?? z("Смена номера телефона")), K = I(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
492
+ const p = I(() => u.language ?? "ru"), z = (n) => Oe[p.value] && Oe[p.value][n] || (u.title ?? n), Z = I(() => u.title ?? z("Смена номера телефона")), K = I(() => u.hintText ?? z("Чтобы продолжить, введите новый номер")), e = ve({
483
493
  oldPhone: u.initialPhone ?? "",
484
494
  newPhone: "",
485
495
  code: "",
486
496
  addPhone: "",
487
497
  addCode: ""
488
- }), V = O(j.OLD), P = O(null), C = O(!1), D = O(!1), v = O("tg"), y = I(() => v.value === "tg"), d = O(!1), { startTimer: L, remainingSeconds: de, isAvailableForSendAgain: A, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: l } = Je(c), { isEditFlow: s, getFlow: me } = Ge(O(u.mode)), re = I(() => A.value ? "Повторить" : `${de.value}`), oe = O(ae), ue = I(() => oe.value === 0), Fe = (n) => new Promise((a) => setTimeout(a, n));
498
+ }), x = D(H.OLD), P = D(null), C = D(!1), O = D(!1), h = D("tg"), y = I(() => h.value === "tg"), i = D(!1), { startTimer: L, remainingSeconds: ie, isAvailableForSendAgain: A, totalRateAttempts: Q, currentRateAttempt: t } = He(), { showRateLimitToast: l } = Je(c), { isEditFlow: s, getFlow: me } = Ge(D(u.mode)), re = I(() => A.value ? "Повторить" : `${ie.value}`), oe = D(ae), ue = I(() => oe.value === 0), Fe = (n) => new Promise((a) => setTimeout(a, n));
489
499
  async function fe(n = "email") {
490
500
  var o;
491
501
  return (o = (await Ae("/users/profile/session/get-edit-session", { params: { field: n } })).data) == null ? void 0 : o.data;
@@ -496,12 +506,12 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
496
506
  field: n,
497
507
  oldValue: F(u.initialPhone)
498
508
  })).data) == null ? void 0 : $.data;
499
- return P.value = (o == null ? void 0 : o.sessionId) ?? null, V.value = (o == null ? void 0 : o.step) ?? j.OLD, e.oldPhone = (o == null ? void 0 : o.oldValue) ?? "", e.newPhone = (o == null ? void 0 : o.newValue) ?? "", o;
509
+ return P.value = (o == null ? void 0 : o.sessionId) ?? null, x.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) ?? "", o;
500
510
  }
501
511
  async function Ue() {
502
512
  try {
503
513
  const n = await fe("phone");
504
- return P.value = n.sessionId, V.value = n.step, e.oldPhone = n.oldValue ?? "", n.sessionId ? n : await Te("phone");
514
+ return P.value = n.sessionId, x.value = n.step, e.oldPhone = n.oldValue ?? "", n.sessionId ? n : await Te("phone");
505
515
  } catch {
506
516
  return await Te("phone");
507
517
  }
@@ -518,7 +528,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
518
528
  },
519
529
  {
520
530
  headers: {
521
- "x-only-sms": d.value ?? !1
531
+ "x-only-sms": i.value ?? !1
522
532
  }
523
533
  }
524
534
  );
@@ -529,8 +539,8 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
529
539
  return null;
530
540
  }
531
541
  }
532
- const ye = async ({ phone: n }) => (d.value = !0, await ee({ value: n, isOnlySms: !0 })), ee = async ({ value: n, isOnlySms: a, offLoading: o } = {}) => {
533
- var $, T, N, R, q, W, w;
542
+ const ye = async ({ phone: n }) => (i.value = !0, await ee({ value: n, isOnlySms: !0 })), ee = async ({ value: n, isOnlySms: a, offLoading: o } = {}) => {
543
+ var $, T, N, R, W, j, w;
534
544
  C.value = !0;
535
545
  try {
536
546
  const g = n ?? e.oldPhone, m = await te(
@@ -548,62 +558,62 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
548
558
  "x-only-sms": a ?? !1
549
559
  }
550
560
  }
551
- ), i = (T = ($ = m == null ? void 0 : m.data) == null ? void 0 : $.data) == null ? void 0 : T.deliveryType;
552
- if ((i === "tg" || i === "sms") && (v.value = i, i === "tg" && (d.value = !1)), (m == null ? void 0 : m.status) === 403 && ((N = m.data) != null && N.tooManyRequests)) {
553
- const M = (q = (R = m.data) == null ? void 0 : R.tooManyRequests) == null ? void 0 : q.type;
554
- v.value = M;
561
+ ), d = (T = ($ = m == null ? void 0 : m.data) == null ? void 0 : $.data) == null ? void 0 : T.deliveryType;
562
+ if ((d === "tg" || d === "sms") && (h.value = d, d === "tg" && (i.value = !1)), (m == null ? void 0 : m.status) === 403 && ((N = m.data) != null && N.tooManyRequests)) {
563
+ const M = (W = (R = m.data) == null ? void 0 : R.tooManyRequests) == null ? void 0 : W.type;
564
+ h.value = M;
555
565
  const k = m.data.tooManyRequests;
556
566
  return k.restTimeSec > 0 ? (L(k.restTimeSec), Q.value = k.attempts.total, t.value = k.attempts.total - k.attempts.available, oe.value = k.attempts.available ?? ae) : A.value = !0, m;
557
567
  }
558
568
  return m;
559
569
  } catch (g) {
560
- if ((g == null ? void 0 : g.status) === 403 && ((w = (W = g == null ? void 0 : g.response) == null ? void 0 : W.data) != null && w.tooManyRequests)) {
570
+ if ((g == null ? void 0 : g.status) === 403 && ((w = (j = g == null ? void 0 : g.response) == null ? void 0 : j.data) != null && w.tooManyRequests)) {
561
571
  const m = g.response.data.tooManyRequests.type;
562
- v.value = m;
563
- const i = g.response.data.tooManyRequests;
564
- return i.restTimeSec > 0 ? (L(i.restTimeSec), Q.value = i.attempts.total, t.value = i.attempts.total - i.attempts.available, oe.value = i.attempts.available ?? ae) : A.value = !0, g;
572
+ h.value = m;
573
+ const d = g.response.data.tooManyRequests;
574
+ return d.restTimeSec > 0 ? (L(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : A.value = !0, g;
565
575
  }
566
576
  throw g;
567
577
  } finally {
568
578
  await Se(n ?? e.oldPhone), C.value = !1, o && (C.value = !1);
569
579
  }
570
580
  }, Me = async (n, a) => {
571
- var o, $, T, N, R, q, W, w, g, m, i;
581
+ var o, $, T, N, R, W, j, w, g, m, d;
572
582
  C.value = !0;
573
583
  try {
574
584
  const M = await fe("phone");
575
- P.value = M.sessionId, V.value = M.step, e.oldPhone = M.oldValue ?? e.oldPhone, e.newPhone = M.newValue ?? e.newPhone;
585
+ P.value = M.sessionId, x.value = M.step, e.oldPhone = M.oldValue ?? e.oldPhone, e.newPhone = M.newValue ?? e.newPhone;
576
586
  const k = await te("/users/profile/change/phone/match-code", {
577
- phone: a === j.NEW ? F(e.newPhone) : F(e.oldPhone),
587
+ phone: a === H.NEW ? F(e.newPhone) : F(e.oldPhone),
578
588
  sessionId: P.value,
579
589
  code: n,
580
590
  step: a
581
- }), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((q = k.data) == null ? void 0 : q.rateLimit) ?? null;
582
- if (!(((W = k.data) == null ? void 0 : W.data.success) ?? ((w = k.data) == null ? void 0 : w.success))) {
583
- l(pe), D.value = !0;
591
+ }), ne = ((o = k.data) == null ? void 0 : o.nextStep) ?? ((T = ($ = k.data) == null ? void 0 : $.data) == null ? void 0 : T.nextStep), pe = ((R = (N = k.data) == null ? void 0 : N.data) == null ? void 0 : R.rateLimit) ?? ((W = k.data) == null ? void 0 : W.rateLimit) ?? null;
592
+ if (!(((j = k.data) == null ? void 0 : j.data.success) ?? ((w = k.data) == null ? void 0 : w.success))) {
593
+ l(pe), O.value = !0;
584
594
  return;
585
595
  }
586
596
  if (!ne) return k;
587
- if (V.value = ne, ne === j.NEW) {
597
+ if (x.value = ne, ne === H.NEW) {
588
598
  const Ie = await fe("phone");
589
599
  e.oldPhone = Ie.oldValue ?? e.oldPhone, e.newPhone = Ie.newValue ?? e.newPhone, e.code = "";
590
600
  }
591
- return ne === j.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: n }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), P.value = null, c("close")), k;
601
+ return ne === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: n }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), P.value = null, c("close")), k;
592
602
  } catch (M) {
593
603
  const k = (m = (g = M == null ? void 0 : M.response) == null ? void 0 : g.data) == null ? void 0 : m.rateLimit;
594
- if (((i = M == null ? void 0 : M.response) == null ? void 0 : i.status) === 429 && k) {
595
- l(k), D.value = !0;
604
+ if (((d = M == null ? void 0 : M.response) == null ? void 0 : d.status) === 429 && k) {
605
+ l(k), O.value = !0;
596
606
  return;
597
607
  }
598
608
  throw M;
599
609
  } finally {
600
610
  C.value = !1;
601
611
  }
602
- }, xe = ({ code: n }) => Me(n, j.OLD);
612
+ }, be = ({ code: n }) => Me(n, H.OLD);
603
613
  function ke(n) {
604
614
  }
605
- const Ve = ({ code: n }) => Me(n, j.NEW);
606
- function be(n) {
615
+ const xe = ({ code: n }) => Me(n, H.NEW);
616
+ function Ve(n) {
607
617
  }
608
618
  const ce = () => {
609
619
  c("close"), f.value = !1;
@@ -635,7 +645,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
635
645
  async function qe() {
636
646
  try {
637
647
  const n = await $e("phone");
638
- P.value = n.sessionId, V.value = n.step, e.addPhone = n.newValue ?? "", n.sessionId || await Be({ field: "phone", value: e.addPhone });
648
+ P.value = n.sessionId, x.value = n.step, e.addPhone = n.newValue ?? "", n.sessionId || await Be({ field: "phone", value: e.addPhone });
639
649
  } catch {
640
650
  await Be({ field: "phone", value: e.addPhone });
641
651
  }
@@ -646,7 +656,7 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
646
656
  isOnlySms: o = !1,
647
657
  offLoading: $ = !0
648
658
  } = {}) => {
649
- var T, N, R, q, W;
659
+ var T, N, R, W, j;
650
660
  C.value = !0;
651
661
  try {
652
662
  if (!P.value)
@@ -665,17 +675,17 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
665
675
  }
666
676
  }
667
677
  ), m = (N = (T = g == null ? void 0 : g.data) == null ? void 0 : T.data) == null ? void 0 : N.deliveryType;
668
- (m === "tg" || m === "sms") && (v.value = m, m === "tg" && (d.value = !1));
669
- const i = (R = g.data) == null ? void 0 : R.tooManyRequests;
670
- if (g.status === 403 && i) {
671
- const M = i == null ? void 0 : i.type;
672
- return v.value = M, i.restTimeSec > 0 ? (L(i.restTimeSec), Q.value = i.attempts.total, t.value = i.attempts.total - i.attempts.available, oe.value = i.attempts.available ?? ae) : A.value = !0, g;
678
+ (m === "tg" || m === "sms") && (h.value = m, m === "tg" && (i.value = !1));
679
+ const d = (R = g.data) == null ? void 0 : R.tooManyRequests;
680
+ if (g.status === 403 && d) {
681
+ const M = d == null ? void 0 : d.type;
682
+ return h.value = M, d.restTimeSec > 0 ? (L(d.restTimeSec), Q.value = d.attempts.total, t.value = d.attempts.total - d.attempts.available, oe.value = d.attempts.available ?? ae) : A.value = !0, g;
673
683
  }
674
684
  return g;
675
685
  } catch (w) {
676
- if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((W = (q = w == null ? void 0 : w.response) == null ? void 0 : q.data) != null && W.tooManyRequests)) {
686
+ if (console.error("sendContactCode catch error: ", w), (w == null ? void 0 : w.status) === 403 && ((j = (W = w == null ? void 0 : w.response) == null ? void 0 : W.data) != null && j.tooManyRequests)) {
677
687
  const g = w.response.data.tooManyRequests.type;
678
- v.value = g;
688
+ h.value = g;
679
689
  const m = w.response.data.tooManyRequests;
680
690
  return m.restTimeSec > 0 ? (L(m.restTimeSec), Q.value = m.attempts.total, t.value = m.attempts.total - m.attempts.available, oe.value = m.attempts.available ?? ae, A.value = !1) : A.value = !0, w;
681
691
  }
@@ -685,30 +695,30 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
685
695
  w && w.restTimeSec > 0 ? (L(w.restTimeSec), A.value = !1) : A.value = !0, $ && (C.value = !1);
686
696
  }
687
697
  }, Ee = async ({ code: n }) => {
688
- var a, o, $, T, N, R, q, W, w, g, m;
698
+ var a, o, $, T, N, R, W, j, w, g, m;
689
699
  C.value = !0;
690
700
  try {
691
701
  if (!P.value) {
692
702
  const pe = await $e("phone");
693
703
  P.value = pe.sessionId, e.addPhone = pe.newValue ?? e.addPhone;
694
704
  }
695
- const i = await te("/users/profile/bind/phone/match-code", {
705
+ const d = await te("/users/profile/bind/phone/match-code", {
696
706
  phone: F(e.addPhone),
697
707
  sessionId: P.value,
698
708
  code: n
699
- }), M = ((a = i.data) == null ? void 0 : a.nextStep) ?? (($ = (o = i.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), k = ((N = (T = i.data) == null ? void 0 : T.data) == null ? void 0 : N.rateLimit) ?? ((R = i.data) == null ? void 0 : R.rateLimit) ?? null;
700
- if (!(((q = i.data) == null ? void 0 : q.data.success) ?? ((W = i.data) == null ? void 0 : W.success))) {
701
- l(k), D.value = !0;
709
+ }), M = ((a = d.data) == null ? void 0 : a.nextStep) ?? (($ = (o = d.data) == null ? void 0 : o.data) == null ? void 0 : $.nextStep), k = ((N = (T = d.data) == null ? void 0 : T.data) == null ? void 0 : N.rateLimit) ?? ((R = d.data) == null ? void 0 : R.rateLimit) ?? null;
710
+ if (!(((W = d.data) == null ? void 0 : W.data.success) ?? ((j = d.data) == null ? void 0 : j.success))) {
711
+ l(k), O.value = !0;
702
712
  return;
703
713
  }
704
- return M && M === j.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: n }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, c("close")), i;
705
- } catch (i) {
706
- const M = (g = (w = i == null ? void 0 : i.response) == null ? void 0 : w.data) == null ? void 0 : g.rateLimit;
707
- if (((m = i == null ? void 0 : i.response) == null ? void 0 : m.status) === 429 && M) {
708
- l(M), D.value = !0;
714
+ return M && M === H.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: n }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), P.value = null, c("close")), d;
715
+ } catch (d) {
716
+ const M = (g = (w = d == null ? void 0 : d.response) == null ? void 0 : w.data) == null ? void 0 : g.rateLimit;
717
+ if (((m = d == null ? void 0 : d.response) == null ? void 0 : m.status) === 429 && M) {
718
+ l(M), O.value = !0;
709
719
  return;
710
720
  }
711
- throw i;
721
+ throw d;
712
722
  } finally {
713
723
  C.value = !1;
714
724
  }
@@ -722,26 +732,26 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
722
732
  return;
723
733
  }
724
734
  (await Ue()).step === "old" && await ee({}), C.value = !1;
725
- }), b({
735
+ }), V({
726
736
  localVisible: f,
727
737
  form: e,
728
- currentStep: V,
738
+ currentStep: x,
729
739
  loading: C,
730
740
  rateLimitText: re,
731
741
  isAvailable: ue,
732
- title: Y,
742
+ title: Z,
733
743
  hintText: K,
734
744
  handleClose: ce,
735
745
  sendContactCode: ee,
736
746
  sendBindContactCode: ge,
737
- handleOldCodeSuccess: xe,
747
+ handleOldCodeSuccess: be,
738
748
  handleOldCodeError: ke,
739
- handleNewCodeSuccess: Ve,
740
- handleNewCodeError: be,
749
+ handleNewCodeSuccess: xe,
750
+ handleNewCodeError: Ve,
741
751
  matchBindCode: Ee,
742
752
  matchBindCodeError: Le
743
- }), (n, a) => (h(), S(je, null, [
744
- x(r(Qe), {
753
+ }), (n, a) => (v(), S(je, null, [
754
+ b(r(Qe), {
745
755
  modelValue: f.value,
746
756
  "onUpdate:modelValue": [
747
757
  a[15] || (a[15] = (o) => f.value = o),
@@ -752,19 +762,19 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
752
762
  "close-on-click-outside": !0,
753
763
  "onClick:outside": ce
754
764
  }, {
755
- header: X(() => [
756
- H("div", kt, [
757
- x(r(Xe), {
765
+ header: Y(() => [
766
+ G("div", kt, [
767
+ b(r(Xe), {
758
768
  "slot-left": !1,
759
769
  size: "small",
760
770
  borded: !0,
761
771
  "no-padding": !1
762
772
  }, {
763
- title: X(() => [
764
- H("span", Vt, G(r(s) ? Y.value : "Добавление номера телефона"), 1)
773
+ title: Y(() => [
774
+ G("span", xt, q(r(s) ? Z.value : "Добавление номера телефона"), 1)
765
775
  ]),
766
- "right-button": X(() => [
767
- x(r(Ye), {
776
+ "right-button": Y(() => [
777
+ b(r(Ye), {
768
778
  class: "cross",
769
779
  onClick: ce
770
780
  })
@@ -773,10 +783,10 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
773
783
  })
774
784
  ])
775
785
  ]),
776
- default: X(() => [
777
- r(s) ? (h(), S("div", bt, [
778
- C.value ? (h(), J(Oe, { key: 0 })) : B("", !0),
779
- V.value === r(j).OLD ? (h(), J(it, {
786
+ default: Y(() => [
787
+ r(s) ? (v(), S("div", Vt, [
788
+ C.value ? (v(), J(De, { key: 0 })) : B("", !0),
789
+ x.value === r(H).OLD ? (v(), J(dt, {
780
790
  key: 1,
781
791
  phone: e.oldPhone,
782
792
  "onUpdate:phone": a[0] || (a[0] = (o) => e.oldPhone = o),
@@ -784,15 +794,16 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
784
794
  "onUpdate:code": a[1] || (a[1] = (o) => e.code = o),
785
795
  "rate-limit-text": re.value,
786
796
  "is-final-limit": ue.value,
787
- "is-not-match-code": D.value,
797
+ "is-not-match-code": O.value,
788
798
  loading: C.value,
789
799
  "is-tg": y.value,
800
+ product: n.provider,
790
801
  onOnSendCode: a[2] || (a[2] = (o) => ee({ value: e.oldPhone })),
791
- onOnSendCodeAgain: a[3] || (a[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !y.value && d.value })),
802
+ onOnSendCodeAgain: a[3] || (a[3] = (o) => ee({ value: e.oldPhone, isOnlySms: !y.value && i.value })),
792
803
  onOnSendOnlySms: ye,
793
- onOnMatchCode: xe,
804
+ onOnMatchCode: be,
794
805
  onOnMatchCodeError: ke
795
- }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : V.value === r(j).NEW ? (h(), J(ft, {
806
+ }, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(H).NEW ? (v(), J(ft, {
796
807
  key: 2,
797
808
  phone: e.newPhone,
798
809
  "onUpdate:phone": a[4] || (a[4] = (o) => e.newPhone = o),
@@ -803,21 +814,22 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
803
814
  "hint-text": K.value,
804
815
  "rate-limit-text": re.value,
805
816
  "is-final-limit": ue.value,
806
- "is-not-match-code": D.value,
817
+ "is-not-match-code": O.value,
807
818
  loading: C.value,
808
819
  "is-tg": y.value,
820
+ product: n.provider,
809
821
  onOnSendCode: a[7] || (a[7] = (o) => ee({ value: e.newPhone })),
810
- onOnSendCodeAgain: a[8] || (a[8] = (o) => ee({ value: e.newPhone, isOnlySms: !y.value && d.value })),
822
+ onOnSendCodeAgain: a[8] || (a[8] = (o) => ee({ value: e.newPhone, isOnlySms: !y.value && i.value })),
811
823
  onOnSendOnlySms: ye,
812
- onOnMatchCode: Ve,
813
- onOnMatchCodeError: be,
814
- onOnClearCodeError: a[9] || (a[9] = (o) => D.value = !1)
815
- }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : V.value === r(j).COMPLETED ? (h(), S("div", $t, [
816
- H("p", null, G(z("Телефон успешно изменен")), 1)
824
+ onOnMatchCode: xe,
825
+ onOnMatchCodeError: Ve,
826
+ onOnClearCodeError: a[9] || (a[9] = (o) => O.value = !1)
827
+ }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "product"])) : x.value === r(H).COMPLETED ? (v(), S("div", $t, [
828
+ G("p", null, q(z("Телефон успешно изменен")), 1)
817
829
  ])) : B("", !0)
818
- ])) : (h(), S("div", Bt, [
819
- C.value ? (h(), J(Oe, { key: 0 })) : B("", !0),
820
- x(xt, {
830
+ ])) : (v(), S("div", Bt, [
831
+ C.value ? (v(), J(De, { key: 0 })) : B("", !0),
832
+ b(bt, {
821
833
  phone: e.addPhone,
822
834
  "onUpdate:phone": a[10] || (a[10] = (o) => e.addPhone = o),
823
835
  oldPhone: e.oldPhone,
@@ -827,20 +839,22 @@ const ie = { render: et }, tt = { class: "dialogDefaultContainerInsideContent" }
827
839
  "hint-text": r(s) ? K.value : "Чтобы продолжить, введите новый номер",
828
840
  "rate-limit-text": re.value,
829
841
  "is-final-limit": ue.value,
830
- "is-not-match-code": D.value,
842
+ "is-not-match-code": O.value,
831
843
  loading: C.value,
832
844
  "is-tg": y.value,
845
+ "on-disable-add-phone": n.onDisableAddPhone,
846
+ product: n.provider,
833
847
  onOnSendCode: a[13] || (a[13] = (o) => ge({ value: e.addPhone, field: "phone" })),
834
- onOnSendCodeAgain: a[14] || (a[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !y.value && d.value })),
848
+ onOnSendCodeAgain: a[14] || (a[14] = (o) => ge({ value: e.addPhone, field: "phone", isOnlySms: !y.value && i.value })),
835
849
  onOnSendOnlySms: ye,
836
850
  onOnMatchCode: Ee,
837
851
  onOnMatchCodeError: Le
838
- }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])
852
+ }, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg", "on-disable-add-phone", "product"])
839
853
  ]))
840
854
  ]),
841
855
  _: 1
842
856
  }, 8, ["modelValue"]),
843
- x(r(Ze))
857
+ b(r(Ze))
844
858
  ], 64));
845
859
  }
846
860
  });