@yourgoods/ui-smart 0.6.0 → 0.8.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.
- package/dist/{ProfileEmailDialog-B7wtbY4r.js → ProfileEmailDialog-BjvgHxfW.js} +2 -2
- package/dist/{ProfilePasswordDialog-BcDkIa-r.js → ProfilePasswordDialog-CK7FW3qN.js} +1 -1
- package/dist/{ProfilePhoneDialog-DVKCw5iI.js → ProfilePhoneDialog-BgegnRGb.js} +135 -135
- package/dist/{index-CTkYBTqN.js → index-oZ0jE8ma.js} +20 -19
- package/dist/index.js +1 -1
- package/dist/{useRateLimitToast-BtIAIA5I.js → useRateLimitToast-Bo1pAIB5.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as Z, ref as M, reactive as J, watch as j, computed as V, toRefs as se, createElementBlock as k, openBlock as y, createElementVNode as S, createCommentVNode as P, toDisplayString as K, createVNode as b, unref as c, isRef as Q, withCtx as q, createTextVNode as te, Fragment as Oe, createBlock as R, resolveDynamicComponent as Ce, onMounted as Ue } from "vue";
|
|
2
|
-
import { T as de, c as Ve, _ as Ae, u as Fe, a as Re, P as ye, b as ze } from "./useRateLimitToast-
|
|
3
|
-
import { C as D, B as We, p as F, g as He } from "./index-
|
|
2
|
+
import { T as de, c as Ve, _ as Ae, u as Fe, a as Re, P as ye, b as ze } from "./useRateLimitToast-Bo1pAIB5.js";
|
|
3
|
+
import { C as D, B as We, p as F, g as He } from "./index-oZ0jE8ma.js";
|
|
4
4
|
import { PInput as _, IconMailMd as re, PButton as le, IconEyeMd as ge, IconEyeClosedMd as he, PDialog as qe, PTopBar as je, IconCrossMd as _e } from "@profeat/ui-kit";
|
|
5
5
|
const Ge = { class: "dialogDefaultContainerInsideContent" }, Ye = { class: "dialogDefaultContainerTextHint" }, Je = {
|
|
6
6
|
key: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ye, ref as a, reactive as _, computed as u, watch as Z, onMounted as Ce, createElementBlock as S, openBlock as g, Fragment as ge, createVNode as n, unref as o, withCtx as m, createCommentVNode as ee, createElementVNode as r, toDisplayString as V, createBlock as B, resolveDynamicComponent as $, createTextVNode as z } from "vue";
|
|
2
|
-
import { C as I, p as D, g as Ve } from "./index-
|
|
2
|
+
import { C as I, p as D, g as Ve } from "./index-oZ0jE8ma.js";
|
|
3
3
|
import { PDialog as be, PInput as M, IconEyeMd as O, IconEyeClosedMd as U, PButton as F, PTopBar as Te, IconCrossMd as Ie, PTeleportContainer as xe } from "@profeat/ui-kit";
|
|
4
4
|
function ke(b) {
|
|
5
5
|
return { showPasswordRateLimitToast: (P) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createElementBlock as T, openBlock as p, createElementVNode as
|
|
2
|
-
import { T as fe, c as Oe, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-
|
|
1
|
+
import { createElementBlock as T, openBlock as p, createElementVNode as F, defineComponent as re, reactive as ue, watch as Y, ref as O, toRefs as me, computed as A, createCommentVNode as $, createVNode as S, toDisplayString as W, createBlock as H, createTextVNode as X, unref as r, isRef as te, withCtx as K, onMounted as Ue, Fragment as qe } from "vue";
|
|
2
|
+
import { T as fe, c as Oe, a as We, u as je, P as Ee, b as He } from "./useRateLimitToast-Bo1pAIB5.js";
|
|
3
3
|
import { IconTelegramSm as ge, PInput as oe, IconPhoneMd as Ge, IconMailMd as Le, PButton as De, PDialog as Je, PTopBar as Ke, IconCrossMd as Qe, PTeleportContainer as Xe } from "@profeat/ui-kit";
|
|
4
|
-
import { C as
|
|
4
|
+
import { C as q, t as Be, p as _, g as Ie } from "./index-oZ0jE8ma.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(
|
|
11
|
+
function Ze(z, b) {
|
|
12
12
|
return p(), T("svg", Ye, b[0] || (b[0] = [
|
|
13
|
-
|
|
13
|
+
F("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",
|
|
@@ -42,16 +42,16 @@ const ne = { 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(
|
|
46
|
-
const k =
|
|
45
|
+
setup(z, { emit: b }) {
|
|
46
|
+
const k = z, u = b, c = ue({
|
|
47
47
|
touched: { phone: !1, code: !1 },
|
|
48
48
|
phoneModel: k.phone,
|
|
49
49
|
codeModel: k.code
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
Y(
|
|
52
52
|
() => c.phoneModel,
|
|
53
53
|
(i) => u("update:phone", i)
|
|
54
|
-
),
|
|
54
|
+
), Y(
|
|
55
55
|
() => c.codeModel,
|
|
56
56
|
(i) => u("update:code", i)
|
|
57
57
|
);
|
|
@@ -64,18 +64,18 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
64
64
|
const h = i.target;
|
|
65
65
|
let v = ((h == null ? void 0 : h.value) ?? "").replace(/\D/g, "");
|
|
66
66
|
v.length > 4 && (v = v.slice(0, 4)), M.value = v, h && h.value !== v && (h.value = v), v.length === 4 && v !== f.value && (f.value = v, u("on-match-code", { phone: e.value, code: v }));
|
|
67
|
-
},
|
|
67
|
+
}, j = () => u("on-send-code-again", { phone: c.phoneModel }), G = () => {
|
|
68
68
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: c.phoneModel });
|
|
69
69
|
}, { phoneModel: e, codeModel: M, touched: C } = me(c), y = A(() => C.value.phone && !e.value.trim() ? "Введите телефон" : k.phoneError), x = A(() => k.isNotMatchCode ? "Неверный код" : C.value.code ? M.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
70
70
|
return (i, h) => (p(), T("div", _e, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
i.isTg ? (p(),
|
|
71
|
+
F("div", et, [
|
|
72
|
+
F("div", tt, W(i.hintText), 1),
|
|
73
|
+
F("div", ot, [
|
|
74
|
+
i.isTg ? (p(), H(r(ge), { key: 0 })) : (p(), H(r(ne), {
|
|
75
75
|
key: 1,
|
|
76
76
|
style: { "margin-left": "5px" }
|
|
77
77
|
})),
|
|
78
|
-
|
|
78
|
+
X(" " + W(i.isTg ? "Telegram" : "СМС"), 1)
|
|
79
79
|
])
|
|
80
80
|
]),
|
|
81
81
|
i.showPhone ? (p(), T("div", nt, [
|
|
@@ -113,15 +113,15 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
113
113
|
loading: i.loading,
|
|
114
114
|
"rate-limit-text": i.rateLimitText,
|
|
115
115
|
"is-final-limit": i.isFinalLimit,
|
|
116
|
-
"on-send-again":
|
|
116
|
+
"on-send-again": j
|
|
117
117
|
}, {
|
|
118
|
-
extra:
|
|
118
|
+
extra: K(() => [
|
|
119
119
|
i.isTg ? (p(), T("span", {
|
|
120
120
|
key: 0,
|
|
121
121
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: G
|
|
123
123
|
}, [
|
|
124
|
-
|
|
124
|
+
X(W(i.sendCodeBySmsText) + " ", 1),
|
|
125
125
|
S(r(ne), { style: { "margin-left": "5px" } })
|
|
126
126
|
])) : $("", !0)
|
|
127
127
|
]),
|
|
@@ -129,15 +129,15 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
129
129
|
}, 8, ["loading", "rate-limit-text", "is-final-limit"])
|
|
130
130
|
]));
|
|
131
131
|
}
|
|
132
|
-
}),
|
|
133
|
-
const b =
|
|
132
|
+
}), N = (z) => {
|
|
133
|
+
const b = z.replace(/\D/g, "");
|
|
134
134
|
if (b.length >= 10 && b.length <= 15) {
|
|
135
135
|
if (b.startsWith("8"))
|
|
136
136
|
return `+7${b.slice(1)}`;
|
|
137
137
|
if (b.startsWith("7"))
|
|
138
138
|
return `+${b}`;
|
|
139
139
|
}
|
|
140
|
-
return
|
|
140
|
+
return z.trim().startsWith("+") ? z.trim() : `+${b}`;
|
|
141
141
|
}, st = { class: "dialogDefaultContainerInsideContent" }, it = { style: { display: "flex", width: "100%", gap: "4px", "align-items": "center", "justify-content": "center", "text-align": "center" } }, dt = { class: "dialogDefaultContainerTextHint" }, rt = {
|
|
142
142
|
key: 0,
|
|
143
143
|
class: "chip"
|
|
@@ -167,38 +167,38 @@ const ne = { 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(
|
|
171
|
-
const k =
|
|
170
|
+
setup(z, { emit: b }) {
|
|
171
|
+
const k = z, u = b, c = O(!1), g = O(""), f = ue({
|
|
172
172
|
touched: { phone: !1, code: !1 },
|
|
173
173
|
phoneModel: "",
|
|
174
174
|
codeModel: ""
|
|
175
175
|
});
|
|
176
|
-
|
|
176
|
+
Y(
|
|
177
177
|
() => f.phoneModel,
|
|
178
178
|
(n) => {
|
|
179
179
|
u("update:phone", n), g.value = "";
|
|
180
180
|
}
|
|
181
|
-
),
|
|
181
|
+
), Y(
|
|
182
182
|
() => f.codeModel,
|
|
183
183
|
(n) => u("update:code", n)
|
|
184
184
|
);
|
|
185
|
-
const B = (n) => f.touched[n] = !0,
|
|
185
|
+
const B = (n) => f.touched[n] = !0, j = A(() => {
|
|
186
186
|
const o = f.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
187
187
|
return /^\+?\d{10,15}$/.test(o);
|
|
188
|
-
}),
|
|
189
|
-
var
|
|
190
|
-
if (B("phone"), !
|
|
188
|
+
}), G = async () => {
|
|
189
|
+
var Q;
|
|
190
|
+
if (B("phone"), !j.value) {
|
|
191
191
|
g.value = "Это не похоже на номер телефона";
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
const {
|
|
195
195
|
data: { data: n, success: o, message: s }
|
|
196
|
-
} = await Oe(void 0,
|
|
196
|
+
} = await Oe(void 0, N(f.phoneModel));
|
|
197
197
|
if (!o && typeof s == "string" && s.includes("Телефон должен быть в формате")) {
|
|
198
198
|
g.value = "Это не похоже на номер телефона";
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
if (!(((
|
|
201
|
+
if (!(((Q = n == null ? void 0 : n[0]) == null ? void 0 : Q.available) ?? !1)) {
|
|
202
202
|
g.value = "Такой номер уже используется";
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
@@ -214,16 +214,16 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
214
214
|
u("on-send-code-again", { phone: f.phoneModel });
|
|
215
215
|
}, y = () => {
|
|
216
216
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: f.phoneModel });
|
|
217
|
-
}, { phoneModel: x, codeModel: i, touched: h } = me(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""),
|
|
217
|
+
}, { phoneModel: x, codeModel: i, touched: h } = me(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), J = A(() => k.isNotMatchCode ? "Неверный код" : h.value.code ? i.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
218
218
|
return (n, o) => (p(), T("div", st, [
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
F("div", it, [
|
|
220
|
+
F("div", dt, W(c.value ? "Чтобы продолжить, введите код подтверждения из" : n.hintText), 1),
|
|
221
221
|
c.value ? (p(), T("div", rt, [
|
|
222
|
-
n.isTg ? (p(),
|
|
222
|
+
n.isTg ? (p(), H(r(ge), { key: 0 })) : (p(), H(r(ne), {
|
|
223
223
|
key: 1,
|
|
224
224
|
style: { "margin-left": "5px" }
|
|
225
225
|
})),
|
|
226
|
-
|
|
226
|
+
X(" " + W(n.isTg ? "Telegram" : "СМС"), 1)
|
|
227
227
|
])) : $("", !0)
|
|
228
228
|
]),
|
|
229
229
|
n.showPhone ? (p(), T("div", ut, [
|
|
@@ -246,11 +246,11 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
246
246
|
c.value ? $("", !0) : (p(), T("div", ct, [
|
|
247
247
|
S(r(De), {
|
|
248
248
|
style: { width: "100%" },
|
|
249
|
-
disabled: !
|
|
250
|
-
onClick:
|
|
249
|
+
disabled: !j.value,
|
|
250
|
+
onClick: G
|
|
251
251
|
}, {
|
|
252
|
-
default:
|
|
253
|
-
|
|
252
|
+
default: K(() => o[6] || (o[6] = [
|
|
253
|
+
X(" Отправить код ")
|
|
254
254
|
])),
|
|
255
255
|
_: 1,
|
|
256
256
|
__: [6]
|
|
@@ -264,7 +264,7 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
264
264
|
"text-size": "medium",
|
|
265
265
|
label: "Код",
|
|
266
266
|
type: "text",
|
|
267
|
-
error:
|
|
267
|
+
error: J.value,
|
|
268
268
|
onInput: M,
|
|
269
269
|
onBlur: o[5] || (o[5] = (s) => B("code"))
|
|
270
270
|
}, null, 8, ["modelValue", "error"])
|
|
@@ -276,13 +276,13 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
276
276
|
"is-final-limit": n.isFinalLimit,
|
|
277
277
|
"on-send-again": C
|
|
278
278
|
}, {
|
|
279
|
-
extra:
|
|
279
|
+
extra: K(() => [
|
|
280
280
|
n.isTg ? (p(), T("span", {
|
|
281
281
|
key: 0,
|
|
282
282
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
283
283
|
onClick: y
|
|
284
284
|
}, [
|
|
285
|
-
|
|
285
|
+
X(W(n.sendCodeBySmsText) + " ", 1),
|
|
286
286
|
S(r(ne), { style: { "margin-left": "5px" } })
|
|
287
287
|
])) : $("", !0)
|
|
288
288
|
]),
|
|
@@ -317,38 +317,38 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
317
317
|
isTg: { type: Boolean }
|
|
318
318
|
},
|
|
319
319
|
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"],
|
|
320
|
-
setup(
|
|
321
|
-
const k =
|
|
320
|
+
setup(z, { emit: b }) {
|
|
321
|
+
const k = z, u = b, c = O(!1), g = O(""), f = ue({
|
|
322
322
|
touched: { phone: !1, code: !1 },
|
|
323
323
|
phoneModel: "",
|
|
324
324
|
codeModel: ""
|
|
325
325
|
});
|
|
326
|
-
|
|
326
|
+
Y(
|
|
327
327
|
() => f.phoneModel,
|
|
328
328
|
(n) => {
|
|
329
329
|
u("update:phone", n), g.value = "";
|
|
330
330
|
}
|
|
331
|
-
),
|
|
331
|
+
), Y(
|
|
332
332
|
() => f.codeModel,
|
|
333
333
|
(n) => u("update:code", n)
|
|
334
334
|
);
|
|
335
|
-
const B = (n) => f.touched[n] = !0,
|
|
335
|
+
const B = (n) => f.touched[n] = !0, j = A(() => {
|
|
336
336
|
const o = f.phoneModel.trim().replace(/[()\-\s]/g, "");
|
|
337
337
|
return /^\+?\d{10,15}$/.test(o);
|
|
338
|
-
}),
|
|
339
|
-
var
|
|
340
|
-
if (B("phone"), !
|
|
338
|
+
}), G = async () => {
|
|
339
|
+
var Q;
|
|
340
|
+
if (B("phone"), !j.value) {
|
|
341
341
|
g.value = "Это не похоже на номер телефона";
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
344
|
const {
|
|
345
345
|
data: { data: n, success: o, message: s }
|
|
346
|
-
} = await Oe(void 0,
|
|
346
|
+
} = await Oe(void 0, N(f.phoneModel));
|
|
347
347
|
if (!o && typeof s == "string" && s.includes("Телефон должен быть в формате")) {
|
|
348
348
|
g.value = "Это не похоже на номер телефона";
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
|
-
if (!(((
|
|
351
|
+
if (!(((Q = n == null ? void 0 : n[0]) == null ? void 0 : Q.available) ?? !1)) {
|
|
352
352
|
g.value = "Такой номер уже используется";
|
|
353
353
|
return;
|
|
354
354
|
}
|
|
@@ -364,16 +364,16 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
364
364
|
u("on-send-code-again", { phone: f.phoneModel });
|
|
365
365
|
}, y = () => {
|
|
366
366
|
console.debug("onSendCodeViaSms"), u("on-send-only-sms", { phone: f.phoneModel });
|
|
367
|
-
}, { phoneModel: x, codeModel: i, touched: h } = me(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""),
|
|
367
|
+
}, { phoneModel: x, codeModel: i, touched: h } = me(f), v = A(() => g.value ? g.value : h.value.phone && !x.value.trim() ? "Это не похоже на номер телефона" : k.phoneError || ""), J = A(() => k.isNotMatchCode ? "Неверный код" : f.touched.code ? i.value.trim() ? k.codeError ?? null : "Введите код" : "");
|
|
368
368
|
return (n, o) => (p(), T("div", mt, [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
n.isTg ? (p(),
|
|
369
|
+
F("div", ft, [
|
|
370
|
+
F("div", gt, W(c.value ? "Чтобы продолжить, введите код подтверждения из" : n.hintText), 1),
|
|
371
|
+
F("div", yt, [
|
|
372
|
+
n.isTg ? (p(), H(r(ge), { key: 0 })) : (p(), H(r(ne), {
|
|
373
373
|
key: 1,
|
|
374
374
|
style: { "margin-left": "5px" }
|
|
375
375
|
})),
|
|
376
|
-
|
|
376
|
+
X(" " + W(n.isTg ? "Telegram" : "СМС"), 1)
|
|
377
377
|
])
|
|
378
378
|
]),
|
|
379
379
|
n.showPhone ? (p(), T("div", Ct, [
|
|
@@ -396,11 +396,11 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
396
396
|
c.value ? $("", !0) : (p(), T("div", wt, [
|
|
397
397
|
S(r(De), {
|
|
398
398
|
style: { width: "100%" },
|
|
399
|
-
disabled: !
|
|
400
|
-
onClick:
|
|
399
|
+
disabled: !j.value,
|
|
400
|
+
onClick: G
|
|
401
401
|
}, {
|
|
402
|
-
default:
|
|
403
|
-
|
|
402
|
+
default: K(() => o[6] || (o[6] = [
|
|
403
|
+
X(" Отправить код ")
|
|
404
404
|
])),
|
|
405
405
|
_: 1,
|
|
406
406
|
__: [6]
|
|
@@ -414,7 +414,7 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
414
414
|
"text-size": "medium",
|
|
415
415
|
label: "Код",
|
|
416
416
|
type: "text",
|
|
417
|
-
error:
|
|
417
|
+
error: J.value,
|
|
418
418
|
onInput: M,
|
|
419
419
|
onBlur: o[5] || (o[5] = (s) => B("code"))
|
|
420
420
|
}, null, 8, ["modelValue", "error"])
|
|
@@ -426,13 +426,13 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
426
426
|
"is-final-limit": n.isFinalLimit,
|
|
427
427
|
"on-send-again": C
|
|
428
428
|
}, {
|
|
429
|
-
extra:
|
|
429
|
+
extra: K(() => [
|
|
430
430
|
n.isTg ? (p(), T("span", {
|
|
431
431
|
key: 0,
|
|
432
432
|
class: "dialogDefaultContainerSendCodeBySmsText",
|
|
433
433
|
onClick: y
|
|
434
434
|
}, [
|
|
435
|
-
|
|
435
|
+
X(W(n.sendCodeBySmsText) + " ", 1),
|
|
436
436
|
S(r(ne), { style: { "margin-left": "5px" } })
|
|
437
437
|
])) : $("", !0)
|
|
438
438
|
]),
|
|
@@ -459,30 +459,30 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
459
459
|
mode: { default: void 0 }
|
|
460
460
|
},
|
|
461
461
|
emits: ["update:modelValue", "submit-phone", "edit", "close", "clean-input-errors", "on-update-jwt", "update-phone-field", "on-toast"],
|
|
462
|
-
setup(
|
|
463
|
-
const u =
|
|
464
|
-
|
|
462
|
+
setup(z, { expose: b, emit: k }) {
|
|
463
|
+
const u = z, c = k, g = O(u.modelValue);
|
|
464
|
+
Y(
|
|
465
465
|
() => u.modelValue,
|
|
466
466
|
(l) => g.value = l
|
|
467
|
-
),
|
|
468
|
-
const f = A(() => u.language ?? "ru"), B = (l) => Be[f.value] && Be[f.value][l] || (u.title ?? l),
|
|
467
|
+
), Y(g, (l) => c("update:modelValue", l));
|
|
468
|
+
const f = A(() => u.language ?? "ru"), B = (l) => Be[f.value] && Be[f.value][l] || (u.title ?? l), j = A(() => u.title ?? B("Смена номера телефона")), G = A(() => u.hintText ?? B("Чтобы продолжить, введите новый номер")), e = ue({
|
|
469
469
|
oldPhone: u.initialPhone ?? "",
|
|
470
470
|
newPhone: "",
|
|
471
471
|
code: "",
|
|
472
472
|
addPhone: "",
|
|
473
473
|
addCode: ""
|
|
474
|
-
}), M = O(
|
|
474
|
+
}), M = O(q.OLD), C = O(null), y = O(!1), x = O(!1), i = O("tg"), h = A(() => i.value === "tg"), v = O(!1), { startTimer: J, remainingSeconds: n, isAvailableForSendAgain: o, totalRateAttempts: s, currentRateAttempt: ee } = We(), { showRateLimitToast: Q } = He(c), { isEditFlow: ce, getFlow: Ae } = je(O(u.mode)), se = A(() => o.value ? "Повторить" : `${n.value}`), ae = O(le), ie = A(() => ae.value === 0), Ne = (l) => new Promise((a) => setTimeout(a, l));
|
|
475
475
|
async function pe(l = "email") {
|
|
476
476
|
var t;
|
|
477
477
|
return (t = (await Ie("/users/profile/session/get-edit-session", { params: { field: l } })).data) == null ? void 0 : t.data;
|
|
478
478
|
}
|
|
479
479
|
async function ye(l = "phone") {
|
|
480
480
|
var V;
|
|
481
|
-
const t = (V = (await
|
|
481
|
+
const t = (V = (await _("/users/profile/session/create-if-not-exists", {
|
|
482
482
|
field: l,
|
|
483
|
-
oldValue: u.initialPhone
|
|
483
|
+
oldValue: N(u.initialPhone)
|
|
484
484
|
})).data) == null ? void 0 : V.data;
|
|
485
|
-
C.value = (t == null ? void 0 : t.sessionId) ?? null, M.value = (t == null ? void 0 : t.step) ??
|
|
485
|
+
C.value = (t == null ? void 0 : t.sessionId) ?? null, M.value = (t == null ? void 0 : t.step) ?? q.OLD, e.oldPhone = (t == null ? void 0 : t.oldValue) ?? "", e.newPhone = (t == null ? void 0 : t.newValue) ?? "";
|
|
486
486
|
}
|
|
487
487
|
async function ze() {
|
|
488
488
|
try {
|
|
@@ -495,11 +495,11 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
495
495
|
async function Ce(l, a = !1) {
|
|
496
496
|
var t;
|
|
497
497
|
try {
|
|
498
|
-
const V = await
|
|
498
|
+
const V = await _(
|
|
499
499
|
"/users/profile/check-throttler",
|
|
500
500
|
{
|
|
501
501
|
method: "sms",
|
|
502
|
-
phone: l,
|
|
502
|
+
phone: N(l),
|
|
503
503
|
isInvite: a
|
|
504
504
|
},
|
|
505
505
|
{
|
|
@@ -510,22 +510,22 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
510
510
|
);
|
|
511
511
|
await Ne(1e3);
|
|
512
512
|
const w = (t = V.data) == null ? void 0 : t.data;
|
|
513
|
-
return w ? (w.restTimeSec > 0 ? (
|
|
513
|
+
return w ? (w.restTimeSec > 0 ? (J(w.restTimeSec), o.value = !1, s.value = w.attempts.total, ee.value = w.attempts.total - w.attempts.available, ae.value = w.attempts.available ?? le) : o.value = !0, w) : null;
|
|
514
514
|
} catch {
|
|
515
515
|
return null;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
const he = async ({ phone: l }) => (v.value = !0, await
|
|
519
|
-
var V, w, L, D,
|
|
518
|
+
const he = async ({ phone: l }) => (v.value = !0, await Z({ value: l, isOnlySms: !0 })), Z = async ({ value: l, isOnlySms: a, offLoading: t } = {}) => {
|
|
519
|
+
var V, w, L, D, R, E;
|
|
520
520
|
y.value = !0;
|
|
521
521
|
try {
|
|
522
|
-
const m = l ?? e.oldPhone, d = await
|
|
522
|
+
const m = l ?? e.oldPhone, d = await _(
|
|
523
523
|
"/users/profile/phone/contact/send-code",
|
|
524
524
|
{
|
|
525
525
|
sessionId: C.value,
|
|
526
|
-
phone:
|
|
527
|
-
value:
|
|
528
|
-
oldValue:
|
|
526
|
+
phone: N(m),
|
|
527
|
+
value: N(m),
|
|
528
|
+
oldValue: N(e.oldPhone),
|
|
529
529
|
provider: u.provider,
|
|
530
530
|
isOnlySms: a ?? !1
|
|
531
531
|
},
|
|
@@ -539,51 +539,51 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
539
539
|
const P = (w = (V = d == null ? void 0 : d.data) == null ? void 0 : V.data) == null ? void 0 : w.deliveryType;
|
|
540
540
|
if ((P === "tg" || P === "sms") && (i.value = P, P === "tg" && (v.value = !1)), console.debug("sendContactCode before обработка 403 tooManyRequests", d), (d == null ? void 0 : d.status) === 403 && ((L = d.data) != null && L.tooManyRequests)) {
|
|
541
541
|
console.debug("sendContactCode IN обработка 403 tooManyRequests", d);
|
|
542
|
-
const I = (
|
|
542
|
+
const I = (R = (D = d.data) == null ? void 0 : D.tooManyRequests) == null ? void 0 : R.type;
|
|
543
543
|
i.value = I;
|
|
544
|
-
const
|
|
545
|
-
return
|
|
544
|
+
const U = d.data.tooManyRequests;
|
|
545
|
+
return U.restTimeSec > 0 ? (J(U.restTimeSec), s.value = U.attempts.total, ee.value = U.attempts.total - U.attempts.available, ae.value = U.attempts.available ?? le) : o.value = !0, d;
|
|
546
546
|
}
|
|
547
547
|
return console.debug("sendContactCode after обработка 403 tooManyRequests", d), await Ce(m), d;
|
|
548
548
|
} catch (m) {
|
|
549
549
|
const d = (E = m == null ? void 0 : m.data) == null ? void 0 : E.tooManyRequests;
|
|
550
550
|
if ((m == null ? void 0 : m.status) === 403 && d) {
|
|
551
551
|
const { restTimeSec: P, attempts: I } = d;
|
|
552
|
-
return P > 0 ? (
|
|
552
|
+
return P > 0 ? (J(P), s.value = I.total, ee.value = I.total - I.available, ae.value = I.available ?? le) : o.value = !0, m;
|
|
553
553
|
}
|
|
554
554
|
throw m;
|
|
555
555
|
} finally {
|
|
556
556
|
y.value = !1, t && (y.value = !1);
|
|
557
557
|
}
|
|
558
558
|
}, we = async (l, a) => {
|
|
559
|
-
var t, V, w, L, D,
|
|
559
|
+
var t, V, w, L, D, R, E, m;
|
|
560
560
|
y.value = !0;
|
|
561
561
|
try {
|
|
562
562
|
const d = await pe("phone");
|
|
563
563
|
C.value = d.sessionId, M.value = d.step, e.oldPhone = d.oldValue ?? e.oldPhone, e.newPhone = d.newValue ?? e.newPhone;
|
|
564
|
-
const P = await
|
|
565
|
-
phone: a ===
|
|
564
|
+
const P = await _("/users/profile/change/phone/match-code", {
|
|
565
|
+
phone: a === q.NEW ? N(e.newPhone) : N(e.oldPhone),
|
|
566
566
|
sessionId: C.value,
|
|
567
567
|
code: l,
|
|
568
568
|
step: a
|
|
569
|
-
}), I = ((t = P.data) == null ? void 0 : t.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep),
|
|
570
|
-
if (
|
|
569
|
+
}), I = ((t = P.data) == null ? void 0 : t.nextStep) ?? ((w = (V = P.data) == null ? void 0 : V.data) == null ? void 0 : w.nextStep), U = ((D = (L = P.data) == null ? void 0 : L.data) == null ? void 0 : D.rateLimit) ?? ((R = P.data) == null ? void 0 : R.rateLimit) ?? null, Re = ((E = P.data) == null ? void 0 : E.data.success) ?? ((m = P.data) == null ? void 0 : m.success);
|
|
570
|
+
if (Q(U), !Re) {
|
|
571
571
|
x.value = !0;
|
|
572
572
|
return;
|
|
573
573
|
}
|
|
574
574
|
if (!I) return P;
|
|
575
|
-
if (M.value = I, I ===
|
|
575
|
+
if (M.value = I, I === q.NEW) {
|
|
576
576
|
const $e = await pe("phone");
|
|
577
577
|
e.oldPhone = $e.oldValue ?? e.oldPhone, e.newPhone = $e.newValue ?? e.newPhone, e.code = "";
|
|
578
578
|
}
|
|
579
|
-
return I ===
|
|
579
|
+
return I === q.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.oldPhone, code: l }), c("on-toast", { color: "success", text: "Номер телефона изменён" }), c("on-update-jwt", "phone", "edit", e.newPhone), C.value = null, c("close")), P;
|
|
580
580
|
} finally {
|
|
581
581
|
y.value = !1;
|
|
582
582
|
}
|
|
583
|
-
}, Pe = ({ code: l }) => we(l,
|
|
583
|
+
}, Pe = ({ code: l }) => we(l, q.OLD);
|
|
584
584
|
function Te(l) {
|
|
585
585
|
}
|
|
586
|
-
const Se = ({ code: l }) => we(l,
|
|
586
|
+
const Se = ({ code: l }) => we(l, q.NEW);
|
|
587
587
|
function Me(l) {
|
|
588
588
|
}
|
|
589
589
|
const de = () => {
|
|
@@ -602,9 +602,9 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
602
602
|
y.value = !0;
|
|
603
603
|
try {
|
|
604
604
|
if (!C.value) {
|
|
605
|
-
const D = await
|
|
605
|
+
const D = await _("/users/profile/session/bind/create", {
|
|
606
606
|
field: a,
|
|
607
|
-
newValue: l
|
|
607
|
+
newValue: N(l || e.addPhone)
|
|
608
608
|
});
|
|
609
609
|
if (C.value = ((w = (V = D.data) == null ? void 0 : V.data) == null ? void 0 : w.sessionId) ?? ((L = D.data) == null ? void 0 : L.sessionId) ?? null, !C.value)
|
|
610
610
|
throw new Error("не удалось создать bind-сессию (sessionId отсутствует)");
|
|
@@ -632,11 +632,11 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
632
632
|
try {
|
|
633
633
|
if (!C.value)
|
|
634
634
|
throw new Error("bind-сессия не найдена. создайте её через createBindSession.");
|
|
635
|
-
const
|
|
635
|
+
const R = l ?? e.addPhone, E = await _(
|
|
636
636
|
`/users/profile/bind/contact/send-code/${a}`,
|
|
637
637
|
{
|
|
638
638
|
sessionId: C.value,
|
|
639
|
-
phone:
|
|
639
|
+
phone: N(R),
|
|
640
640
|
provider: u.provider,
|
|
641
641
|
isOnlySms: t ?? !1
|
|
642
642
|
},
|
|
@@ -650,31 +650,31 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
650
650
|
const d = (D = E.data) == null ? void 0 : D.tooManyRequests;
|
|
651
651
|
if (E.status === 403 && d) {
|
|
652
652
|
const I = d == null ? void 0 : d.type;
|
|
653
|
-
return i.value = I, d.restTimeSec > 0 ? (
|
|
653
|
+
return i.value = I, d.restTimeSec > 0 ? (J(d.restTimeSec), s.value = d.attempts.total, ee.value = d.attempts.total - d.attempts.available, ae.value = d.attempts.available ?? le) : o.value = !0, E;
|
|
654
654
|
}
|
|
655
|
-
const P = await Ce(
|
|
656
|
-
return P && P.restTimeSec > 0 ? (
|
|
655
|
+
const P = await Ce(R);
|
|
656
|
+
return P && P.restTimeSec > 0 ? (J(P.restTimeSec), o.value = !1) : o.value = !0, E;
|
|
657
657
|
} finally {
|
|
658
658
|
V && (y.value = !1);
|
|
659
659
|
}
|
|
660
660
|
}, Ve = async ({ code: l }) => {
|
|
661
|
-
var a, t, V, w, L, D,
|
|
661
|
+
var a, t, V, w, L, D, R, E;
|
|
662
662
|
y.value = !0;
|
|
663
663
|
try {
|
|
664
664
|
if (!C.value) {
|
|
665
|
-
const
|
|
666
|
-
C.value =
|
|
665
|
+
const U = await xe("phone");
|
|
666
|
+
C.value = U.sessionId, e.addPhone = U.newValue ?? e.addPhone;
|
|
667
667
|
}
|
|
668
|
-
const m = await
|
|
669
|
-
phone: e.addPhone,
|
|
668
|
+
const m = await _("/users/profile/bind/phone/match-code", {
|
|
669
|
+
phone: N(e.addPhone),
|
|
670
670
|
sessionId: C.value,
|
|
671
671
|
code: l
|
|
672
|
-
}), d = ((a = m.data) == null ? void 0 : a.nextStep) ?? ((V = (t = m.data) == null ? void 0 : t.data) == null ? void 0 : V.nextStep), P = ((L = (w = m.data) == null ? void 0 : w.data) == null ? void 0 : L.rateLimit) ?? ((D = m.data) == null ? void 0 : D.rateLimit) ?? null, I = ((
|
|
673
|
-
if (
|
|
672
|
+
}), d = ((a = m.data) == null ? void 0 : a.nextStep) ?? ((V = (t = m.data) == null ? void 0 : t.data) == null ? void 0 : V.nextStep), P = ((L = (w = m.data) == null ? void 0 : w.data) == null ? void 0 : L.rateLimit) ?? ((D = m.data) == null ? void 0 : D.rateLimit) ?? null, I = ((R = m.data) == null ? void 0 : R.data.success) ?? ((E = m.data) == null ? void 0 : E.success);
|
|
673
|
+
if (Q(P), !I) {
|
|
674
674
|
x.value = !0;
|
|
675
675
|
return;
|
|
676
676
|
}
|
|
677
|
-
return d && d ===
|
|
677
|
+
return d && d === q.COMPLETED && (e.code = "", c("update-phone-field", e.addPhone), c("submit-phone", { phone: e.addPhone, code: l }), c("on-update-jwt", "phone", "bind", e.addPhone), c("on-toast", { color: "success", text: "Номер телефона успешно привязан к аккаунту" }), C.value = null, c("close")), m;
|
|
678
678
|
} finally {
|
|
679
679
|
y.value = !1;
|
|
680
680
|
}
|
|
@@ -687,7 +687,7 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
687
687
|
await Fe(), y.value = !1;
|
|
688
688
|
return;
|
|
689
689
|
}
|
|
690
|
-
await ze(), await
|
|
690
|
+
await ze(), await Z({});
|
|
691
691
|
}), b({
|
|
692
692
|
localVisible: g,
|
|
693
693
|
form: e,
|
|
@@ -695,10 +695,10 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
695
695
|
loading: y,
|
|
696
696
|
rateLimitText: se,
|
|
697
697
|
isAvailable: ie,
|
|
698
|
-
title:
|
|
699
|
-
hintText:
|
|
698
|
+
title: j,
|
|
699
|
+
hintText: G,
|
|
700
700
|
handleClose: de,
|
|
701
|
-
sendContactCode:
|
|
701
|
+
sendContactCode: Z,
|
|
702
702
|
sendBindContactCode: ve,
|
|
703
703
|
handleOldCodeSuccess: Pe,
|
|
704
704
|
handleOldCodeError: Te,
|
|
@@ -718,18 +718,18 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
718
718
|
"close-on-click-outside": !0,
|
|
719
719
|
"onClick:outside": de
|
|
720
720
|
}, {
|
|
721
|
-
header:
|
|
722
|
-
|
|
721
|
+
header: K(() => [
|
|
722
|
+
F("div", Mt, [
|
|
723
723
|
S(r(Ke), {
|
|
724
724
|
"slot-left": !1,
|
|
725
725
|
size: "small",
|
|
726
726
|
borded: !0,
|
|
727
727
|
"no-padding": !1
|
|
728
728
|
}, {
|
|
729
|
-
title:
|
|
730
|
-
|
|
729
|
+
title: K(() => [
|
|
730
|
+
F("span", xt, W(r(ce) ? j.value : "Добавление номера телефона"), 1)
|
|
731
731
|
]),
|
|
732
|
-
"right-button":
|
|
732
|
+
"right-button": K(() => [
|
|
733
733
|
S(r(Qe), {
|
|
734
734
|
class: "cross",
|
|
735
735
|
onClick: de
|
|
@@ -739,10 +739,10 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
739
739
|
})
|
|
740
740
|
])
|
|
741
741
|
]),
|
|
742
|
-
default:
|
|
742
|
+
default: K(() => [
|
|
743
743
|
r(ce) ? (p(), T("div", bt, [
|
|
744
|
-
y.value ? (p(),
|
|
745
|
-
M.value === r(
|
|
744
|
+
y.value ? (p(), H(Ee, { key: 0 })) : $("", !0),
|
|
745
|
+
M.value === r(q).OLD ? (p(), H(lt, {
|
|
746
746
|
key: 1,
|
|
747
747
|
phone: e.oldPhone,
|
|
748
748
|
"onUpdate:phone": a[0] || (a[0] = (t) => e.oldPhone = t),
|
|
@@ -753,12 +753,12 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
753
753
|
"is-not-match-code": x.value,
|
|
754
754
|
loading: y.value,
|
|
755
755
|
"is-tg": h.value,
|
|
756
|
-
onOnSendCode: a[2] || (a[2] = (t) =>
|
|
757
|
-
onOnSendCodeAgain: a[3] || (a[3] = (t) =>
|
|
756
|
+
onOnSendCode: a[2] || (a[2] = (t) => Z({ value: e.oldPhone })),
|
|
757
|
+
onOnSendCodeAgain: a[3] || (a[3] = (t) => Z({ value: e.oldPhone, isOnlySms: !h.value && v.value })),
|
|
758
758
|
onOnSendOnlySms: he,
|
|
759
759
|
onOnMatchCode: Pe,
|
|
760
760
|
onOnMatchCodeError: Te
|
|
761
|
-
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(
|
|
761
|
+
}, null, 8, ["phone", "code", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(q).NEW ? (p(), H(vt, {
|
|
762
762
|
key: 2,
|
|
763
763
|
phone: e.newPhone,
|
|
764
764
|
"onUpdate:phone": a[4] || (a[4] = (t) => e.newPhone = t),
|
|
@@ -766,23 +766,23 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
766
766
|
"onUpdate:oldPhone": a[5] || (a[5] = (t) => e.oldPhone = t),
|
|
767
767
|
code: e.code,
|
|
768
768
|
"onUpdate:code": a[6] || (a[6] = (t) => e.code = t),
|
|
769
|
-
"hint-text":
|
|
769
|
+
"hint-text": G.value,
|
|
770
770
|
"rate-limit-text": se.value,
|
|
771
771
|
"is-final-limit": ie.value,
|
|
772
772
|
"is-not-match-code": x.value,
|
|
773
773
|
loading: y.value,
|
|
774
774
|
"is-tg": h.value,
|
|
775
|
-
onOnSendCode: a[7] || (a[7] = (t) =>
|
|
776
|
-
onOnSendCodeAgain: a[8] || (a[8] = (t) =>
|
|
775
|
+
onOnSendCode: a[7] || (a[7] = (t) => Z({ value: e.newPhone })),
|
|
776
|
+
onOnSendCodeAgain: a[8] || (a[8] = (t) => Z({ value: e.newPhone, isOnlySms: !h.value && v.value })),
|
|
777
777
|
onOnSendOnlySms: he,
|
|
778
778
|
onOnMatchCode: Se,
|
|
779
779
|
onOnMatchCodeError: Me,
|
|
780
780
|
onOnClearCodeError: a[9] || (a[9] = (t) => x.value = !1)
|
|
781
|
-
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(
|
|
782
|
-
|
|
781
|
+
}, null, 8, ["phone", "oldPhone", "code", "hint-text", "rate-limit-text", "is-final-limit", "is-not-match-code", "loading", "is-tg"])) : M.value === r(q).COMPLETED ? (p(), T("div", Vt, [
|
|
782
|
+
F("p", null, W(B("Телефон успешно изменен")), 1)
|
|
783
783
|
])) : $("", !0)
|
|
784
784
|
])) : (p(), T("div", kt, [
|
|
785
|
-
y.value ? (p(),
|
|
785
|
+
y.value ? (p(), H(Ee, { key: 0 })) : $("", !0),
|
|
786
786
|
S(St, {
|
|
787
787
|
phone: e.addPhone,
|
|
788
788
|
"onUpdate:phone": a[10] || (a[10] = (t) => e.addPhone = t),
|
|
@@ -790,7 +790,7 @@ const ne = { render: Ze }, _e = { class: "dialogDefaultContainerInsideContent" }
|
|
|
790
790
|
"onUpdate:oldPhone": a[11] || (a[11] = (t) => e.oldPhone = t),
|
|
791
791
|
code: e.addCode,
|
|
792
792
|
"onUpdate:code": a[12] || (a[12] = (t) => e.addCode = t),
|
|
793
|
-
"hint-text": r(ce) ?
|
|
793
|
+
"hint-text": r(ce) ? G.value : "Чтобы продолжить, введите новый номер",
|
|
794
794
|
"rate-limit-text": se.value,
|
|
795
795
|
"is-final-limit": ie.value,
|
|
796
796
|
"is-not-match-code": x.value,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as v, shallowRef as Ve, defineComponent as _, defineAsyncComponent as L, watch as se, createBlock as I, createCommentVNode as E, unref as i, openBlock as h, resolveDynamicComponent as xe, mergeProps as Ae, computed as b, reactive as R, onMounted as $e, createElementBlock as P, Fragment as ie, createVNode as g, createElementVNode as G, withCtx as F, toDisplayString as D, createTextVNode as
|
|
1
|
+
import { ref as v, shallowRef as Ve, defineComponent as _, defineAsyncComponent as L, watch as se, createBlock as I, createCommentVNode as E, unref as i, openBlock as h, resolveDynamicComponent as xe, mergeProps as Ae, computed as b, reactive as R, onMounted as $e, createElementBlock as P, Fragment as ie, createVNode as g, createElementVNode as G, withCtx as F, toDisplayString as D, createTextVNode as J, Teleport as re, Transition as Se, withDirectives as Oe, vShow as Me } from "vue";
|
|
2
2
|
import ze from "axios";
|
|
3
|
-
import { PInputFileUploader as Le, PInput as $, IconFilledEditMd as S, PButton as le, PImageCropper as Re, PToast as Ge, PTeleportContainer as ue, PToastContainer as
|
|
4
|
-
function
|
|
3
|
+
import { PInputFileUploader as Le, PInput as $, IconFilledEditMd as S, PButton as le, PImageCropper as Re, PToast as Ge, PTeleportContainer as ue, PToastContainer as Je } from "@profeat/ui-kit";
|
|
4
|
+
function je(d, r = 2) {
|
|
5
5
|
if (d === 0)
|
|
6
6
|
return "0 B";
|
|
7
7
|
const n = 1024, u = ["B", "KB", "MB", "GB", "TB", "PB", "EB"], w = Math.floor(Math.log(d) / Math.log(n));
|
|
@@ -34,7 +34,7 @@ function _e(d, r) {
|
|
|
34
34
|
baseURL: r,
|
|
35
35
|
headers: {
|
|
36
36
|
Authorization: `Bearer ${d}`,
|
|
37
|
-
|
|
37
|
+
// 'Content-Type': 'application/json',
|
|
38
38
|
"x-throttler-prefix": "throttler_profile_edit"
|
|
39
39
|
},
|
|
40
40
|
validateStatus: () => !0
|
|
@@ -57,16 +57,16 @@ async function We(d) {
|
|
|
57
57
|
throw new Error("Ошибка при получении профиля пользователя");
|
|
58
58
|
return r.data;
|
|
59
59
|
}
|
|
60
|
-
const O = v(null),
|
|
60
|
+
const O = v(null), j = Ve(null);
|
|
61
61
|
function W() {
|
|
62
62
|
return {
|
|
63
63
|
currentDialog: O,
|
|
64
|
-
dialogPayload:
|
|
64
|
+
dialogPayload: j,
|
|
65
65
|
openDialog: (u, w) => {
|
|
66
|
-
O.value = u,
|
|
66
|
+
O.value = u, j.value = w ?? null;
|
|
67
67
|
},
|
|
68
68
|
closeDialog: () => {
|
|
69
|
-
O.value = null,
|
|
69
|
+
O.value = null, j.value = null;
|
|
70
70
|
},
|
|
71
71
|
isDialogOpen: (u) => O.value === u
|
|
72
72
|
};
|
|
@@ -213,9 +213,9 @@ const Ke = {
|
|
|
213
213
|
emits: ["clean-input-errors", "on-update-jwt", "update-phone-field", "update-email-field", "on-password-error", "on-toast"],
|
|
214
214
|
setup(d, { emit: r }) {
|
|
215
215
|
const n = r, u = v(!0), { currentDialog: w, dialogPayload: c, closeDialog: B } = W(), l = {
|
|
216
|
-
email: L(() => import("./ProfileEmailDialog-
|
|
217
|
-
phone: L(() => import("./ProfilePhoneDialog-
|
|
218
|
-
password: L(() => import("./ProfilePasswordDialog-
|
|
216
|
+
email: L(() => import("./ProfileEmailDialog-BjvgHxfW.js")),
|
|
217
|
+
phone: L(() => import("./ProfilePhoneDialog-BgegnRGb.js")),
|
|
218
|
+
password: L(() => import("./ProfilePasswordDialog-CK7FW3qN.js"))
|
|
219
219
|
}, m = ({ email: y }) => {
|
|
220
220
|
n("update-email-field", y);
|
|
221
221
|
}, p = ({ phone: y }) => {
|
|
@@ -326,9 +326,10 @@ const Ke = {
|
|
|
326
326
|
try {
|
|
327
327
|
o.loading = !0;
|
|
328
328
|
const t = new FormData();
|
|
329
|
-
t.append("file", a), await Y(
|
|
330
|
-
|
|
331
|
-
|
|
329
|
+
t.append("file", a), await Y(
|
|
330
|
+
`/users/profile/avatar/${y.value}`,
|
|
331
|
+
t
|
|
332
|
+
);
|
|
332
333
|
} catch {
|
|
333
334
|
} finally {
|
|
334
335
|
o.loading = !1;
|
|
@@ -422,10 +423,10 @@ const Ke = {
|
|
|
422
423
|
"onChange:error": ke
|
|
423
424
|
}, {
|
|
424
425
|
afterLoadLabel: F(() => [
|
|
425
|
-
|
|
426
|
+
J(D(c("Загрузить фото")), 1)
|
|
426
427
|
]),
|
|
427
428
|
subtext: F(() => [
|
|
428
|
-
K.value ? (h(), P("span", Qe, D("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (h(), P("span", Xe, D(`${c("Формат")} ${i(Ye)(o.accept).join(", ")} ${c("до")} ${i(
|
|
429
|
+
K.value ? (h(), P("span", Qe, D("Размер фото слишком большой. Загрузите JPEG, PNG до 10 MB"))) : (h(), P("span", Xe, D(`${c("Формат")} ${i(Ye)(o.accept).join(", ")} ${c("до")} ${i(je)(o.uploadLimit)}`), 1))
|
|
429
430
|
]),
|
|
430
431
|
_: 1
|
|
431
432
|
}, 8, ["modelValue", "src", "accept", "loading", "label", "upload-limit"])) : E("", !0),
|
|
@@ -494,7 +495,7 @@ const Ke = {
|
|
|
494
495
|
onClick: Ie
|
|
495
496
|
}, {
|
|
496
497
|
default: F(() => [
|
|
497
|
-
|
|
498
|
+
J(D(c("Сменить пароль")), 1)
|
|
498
499
|
]),
|
|
499
500
|
_: 1
|
|
500
501
|
})) : E("", !0),
|
|
@@ -503,7 +504,7 @@ const Ke = {
|
|
|
503
504
|
onClick: De
|
|
504
505
|
}, {
|
|
505
506
|
default: F(() => [
|
|
506
|
-
|
|
507
|
+
J(D(c("Сохранить")), 1)
|
|
507
508
|
]),
|
|
508
509
|
_: 1
|
|
509
510
|
}, 8, ["disabled"])
|
|
@@ -566,7 +567,7 @@ const Ke = {
|
|
|
566
567
|
n("on-update-jwt", m, p, y);
|
|
567
568
|
};
|
|
568
569
|
return (m, p) => (h(), P(ie, null, [
|
|
569
|
-
g(i(
|
|
570
|
+
g(i(Je)),
|
|
570
571
|
g(sa, {
|
|
571
572
|
"throttler-prefix": m.throttlerPrefix,
|
|
572
573
|
provider: m.provider,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".icon-locked{pointer-events:auto;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.input-wrapper{position:relative;width:100%}.dialogTitle{z-index:10;width:100%;font-size:16px;font-weight:600;line-height:24px;text-align:center;color:#2b3238}.dialogDefaultContainer{display:flex;align-items:flex-start;flex-direction:column;width:100%;gap:32px;margin-top:16px;padding:10px 16px}.dialogDefaultContainerTextHint{font-weight:400;font-size:14px;line-height:20px;text-align:center;color:#1b1b1b}.dialogDefaultContainerRateLimitText{font-weight:600;font-size:14px;line-height:20px;color:#d0dbe4}.dialogDefaultContainerInsideContent{width:100%;display:flex;flex-direction:column;gap:24px}.dialogDefaultContainerRateLimitTextActive{color:#1c7ef1;cursor:pointer}.dialogDefaultContainerSendCodeBySmsText{color:#1c7ef1;cursor:pointer;font-size:14px;font-weight:600;display:flex;align-items:center;text-align:center}.chip{display:flex;align-items:center;justify-content:center;flex-direction:row;gap:4px;height:24px;font-size:12px;font-weight:600;color:#1b1b1b;padding:4px;line-height:16px;background-color:#b6d7ff4d;border-radius:4px;text-align:center;margin-left:5px}.cross{cursor:pointer;text-align:end}.finalLimitWrapper{display:flex;flex-direction:column;align-items:center;padding:12px 0;gap:12px;width:440px;min-height:94px;background:#e4606026;border-radius:8px}.finalLimitText{text-align:center;font-family:Inter,sans-serif;font-size:14px;line-height:20px;color:#5d7285}.finalLimitLink{font-family:Inter,sans-serif;font-weight:600;font-size:14px;line-height:20px;color:#1c7ef1;text-align:center;cursor:pointer;text-decoration:none}.finalLimitLink:hover{text-decoration:underline}.toastWrapper{position:fixed;bottom:1rem;right:1rem;z-index:9999}.toast{width:100%}.base-container{margin-top:1.5rem;display:flex;flex-direction:column;gap:1.25rem;width:490px;height:428px}.icon-disabled{pointer-events:none;position:absolute;right:1rem;top:1rem;color:#b6c7d6}.centered-overlay{position:absolute;left:50%;top:50%;z-index:1000;height:100%;width:100%;transform:translate(-50%,-50%)}.buttons-container{display:flex;flex-wrap:wrap;gap:12px;justify-content:flex-start}.buttons-container PButton{flex:1 1 100%}._loaderOverlay_cpu73_1[data-v-9e697525]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background:#ffffffb3;border-radius:16px;z-index:99}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { _ as r } from "./index-
|
|
2
|
+
import { _ as r } from "./index-oZ0jE8ma.js";
|
|
3
3
|
export {
|
|
4
4
|
r as PEditUserContact
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as r, defineComponent as L, createElementBlock as f, openBlock as v, normalizeClass as l, createVNode as E, unref as F, computed as T, renderSlot as m, createCommentVNode as $, createElementVNode as o, toDisplayString as y, createTextVNode as p } from "vue";
|
|
2
2
|
import { PLoader as w } from "@profeat/ui-kit";
|
|
3
|
-
import { g as R, p as h } from "./index-
|
|
3
|
+
import { g as R, p as h } from "./index-oZ0jE8ma.js";
|
|
4
4
|
function C(e) {
|
|
5
5
|
const t = Math.floor(e / 60), a = e % 60;
|
|
6
6
|
return `${String(t).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|