@huyooo/ui 0.11.2 → 0.11.5

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 (98) hide show
  1. package/dist/AuthkitAppSetting-CSHkDxQT.js +1914 -0
  2. package/dist/{Clipboard---tG2Zxz.js → Clipboard-CRZDADLE.js} +1 -1
  3. package/dist/{Contact-BEUbBGiB.js → Contact-Y0Yczmc9.js} +8 -7
  4. package/dist/{CustomTable-CVZ4mFzi.js → CustomTable-BUkwlbzN.js} +3 -2
  5. package/dist/{FeedbackItem-CN041vTm.js → FeedbackItem-D7MpOmoM.js} +3 -3
  6. package/dist/FeedbackModal-CvNF1D-5.js +1050 -0
  7. package/dist/LandingPageFAQ-CZJXvor9.js +80 -0
  8. package/dist/LandingPageLinkGroup-DDNRivMt.js +521 -0
  9. package/dist/LandingPageSectionHeader-D_74W4My.js +69 -0
  10. package/dist/{LandingPageSectionTabs-B6ZVxR47.js → LandingPageSectionTabs-Ce3_Rc2L.js} +354 -426
  11. package/dist/MessageHandle-B12koVQL.js +924 -0
  12. package/dist/MessageList-Bo6YCfRO.js +233 -0
  13. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-F6neJUg3.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-DxDn6Ok8.js} +2 -2
  14. package/dist/PaySubscriptions-B8jAtG5n.js +515 -0
  15. package/dist/PricingPlans-CO26OcbJ.js +210 -0
  16. package/dist/ReferrerReferees-D_Iiw9wZ.js +106 -0
  17. package/dist/{Upload.vue_vue_type_script_setup_true_lang-D_-oMTOo.js → Upload.vue_vue_type_script_setup_true_lang-CbVSY_vt.js} +1 -1
  18. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DpVadjMH.js +508 -0
  19. package/dist/WidthContainer-B6d4xrGT.js +693 -0
  20. package/dist/{apiClients-9b4zNZ2S.js → apiClients-DVz12LeW.js} +81 -75
  21. package/dist/authkit.d.ts +7 -0
  22. package/dist/authkit.js +52 -45
  23. package/dist/common/globalConfig.d.ts +2 -2
  24. package/dist/common/userMenuModal.d.ts +1 -0
  25. package/dist/common.js +2 -2
  26. package/dist/components/Authkit/AppSetting/AuthkitOAuthBinding.vue.d.ts +31 -0
  27. package/dist/components/Authkit/AppSetting/AuthkitPhoneBinding.vue.d.ts +14 -0
  28. package/dist/components/Authkit/AppSetting/AuthkitPhoneVerify.vue.d.ts +66 -0
  29. package/dist/components/Authkit/Auth/AuthkitBindPhone.vue.d.ts +27 -0
  30. package/dist/components/Authkit/Auth/AuthkitEmailUpdate.vue.d.ts +11 -1
  31. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +2 -2
  32. package/dist/components/Authkit/Auth/AuthkitOauthItem.vue.d.ts +1 -1
  33. package/dist/components/Authkit/Auth/AuthkitPasswordAuth.vue.d.ts +11 -1
  34. package/dist/components/Authkit/Auth/AuthkitPhonePasswordUpdateAndVerify.vue.d.ts +68 -0
  35. package/dist/components/Authkit/Auth/AuthkitSignInEmailCode.vue.d.ts +68 -0
  36. package/dist/components/Authkit/Auth/AuthkitSwitchSignUpOrResetPassword.vue.d.ts +15 -3
  37. package/dist/components/Authkit/AuthkitOAuthCallbackProvider.vue.d.ts +11 -0
  38. package/dist/components/Authkit/AuthkitProvider.vue.d.ts +45 -0
  39. package/dist/components/Feedback/FeedbackBubbleEnd.vue.d.ts +9 -0
  40. package/dist/components/Feedback/FeedbackBubbleStart.vue.d.ts +11 -6
  41. package/dist/components/LandingPage/LandingPageSections.vue.d.ts +1 -1
  42. package/dist/components/Pay/PaySubscriptions.vue.d.ts +2 -1
  43. package/dist/components/Pay/PricingFAQ.vue.d.ts +17 -0
  44. package/dist/components/Pay/PricingPlans.vue.d.ts +12 -0
  45. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +2 -2
  46. package/dist/components/UserMenu/parts/UserSubscriptionBaseInformation.vue.d.ts +8 -0
  47. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +26 -0
  48. package/dist/composables/Authkit/useAuthkitAuth.d.ts +21 -9
  49. package/dist/composables/Authkit/useEnsureAuthenticated.d.ts +26 -0
  50. package/dist/composables/Authkit/useOauth.d.ts +4 -1
  51. package/dist/composables/Billing/useBillingPlans.d.ts +201 -0
  52. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +280 -0
  53. package/dist/composables/Billing/useSubscriptionCheckout.d.ts +12 -0
  54. package/dist/composables/UserMenu/useUserMenu.d.ts +5 -1
  55. package/dist/composables.d.ts +2 -0
  56. package/dist/composables.js +25 -22
  57. package/dist/feedback.js +3 -3
  58. package/dist/index-D3Kp6R4z.js +4 -0
  59. package/dist/landingPage.js +42 -40
  60. package/dist/main.js +285 -269
  61. package/dist/message.js +19 -18
  62. package/dist/pay.d.ts +5 -0
  63. package/dist/pay.js +9 -2
  64. package/dist/privateCom.js +1 -1
  65. package/dist/referrer.js +1 -1
  66. package/dist/style.css +1 -1
  67. package/dist/types/api/auth.generated.d.ts +103 -39
  68. package/dist/types/api/billing.generated.d.ts +61 -28
  69. package/dist/types/api.d.ts +1 -1
  70. package/dist/types/app.d.ts +14 -0
  71. package/dist/upload.js +2 -2
  72. package/dist/{useAuthkitAppsAuthPageInfo-494yLvsu.js → useAuthkitAppsAuthPageInfo-Du5d6VK-.js} +20 -7
  73. package/dist/{useAuthkitCreateAndUpdate-DyRtFxZS.js → useAuthkitCreateAndUpdate-Bc9D5C6R.js} +1 -1
  74. package/dist/useAuthkitUsersProfile-CQGyvL7g.js +201 -0
  75. package/dist/{useDownloads-DaeIY0E9.js → useDownloads-BFx1a-f9.js} +1 -1
  76. package/dist/useEnsureAuthenticated-Cc64hF1O.js +2247 -0
  77. package/dist/{useLegalLinks-CPbWqlu6.js → useLegalLinks-Deksq9h-.js} +2 -2
  78. package/dist/{useMessageNotifications-Dg5q-C_o.js → useMessageNotifications-DY5xKtif.js} +1 -1
  79. package/dist/{useSEO-CXX9dcBx.js → useSEO-CvfzTZA9.js} +2 -2
  80. package/dist/useSubscriptionCheckout-BgQJN61l.js +345 -0
  81. package/dist/{useTableHandle-Cjq4gcC0.js → useTableHandle-D71P3Ez_.js} +1 -1
  82. package/dist/{useUploadCos-DiJmmbRf.js → useUploadCos-N5pim6q1.js} +501 -515
  83. package/dist/useUserMenu-ClPBlvaM.js +44 -0
  84. package/dist/user.js +12 -13
  85. package/dist/utils/apiMiddlewares.d.ts +6 -0
  86. package/package.json +1 -1
  87. package/dist/AuthkitAppSetting-BCrLMpLg.js +0 -1322
  88. package/dist/AuthkitSignInPhone-DmCQ2fWs.js +0 -1721
  89. package/dist/FeedbackModal-aI28o-w5.js +0 -1053
  90. package/dist/LandingPageSectionHeader-Cs1x8i3q.js +0 -584
  91. package/dist/MessageHandle-BV1nKlxs.js +0 -1147
  92. package/dist/PaySubscriptions-B3gI1Eme.js +0 -408
  93. package/dist/ReferrerReferees-DJzPo7X5.js +0 -106
  94. package/dist/UserAccountMenu-CJ9KKVYa.js +0 -371
  95. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-ClAXNSgl.js +0 -81
  96. package/dist/WidthContainer-BG10rumn.js +0 -669
  97. package/dist/useAuthkitUsersProfile-lGlQP54m.js +0 -186
  98. package/dist/useUserMenu-B3HKZKJ4.js +0 -43
@@ -0,0 +1,1914 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ import { U as ye } from "./index-D3Kp6R4z.js";
4
+ import { defineComponent as O, computed as I, openBlock as h, createElementBlock as j, normalizeStyle as be, normalizeClass as ke, createElementVNode as C, ref as y, createBlock as z, unref as e, withCtx as t, createVNode as o, createTextVNode as k, onMounted as ee, onUnmounted as fe, withDirectives as _e, toDisplayString as B, vShow as we, Fragment as J, createCommentVNode as P, renderList as ze, watch as ne, isRef as Ve } from "vue";
5
+ import { Form as Q, FormItem as U, Avatar as re, Input as N, Textarea as Ce, Button as A, Message as G, Alert as F, Link as Ie, Space as ce, InputPassword as $e, Result as Pe, Modal as Se } from "@arco-design/web-vue";
6
+ /* empty css */
7
+ import { e as x, g as Y, i as me } from "./apiClients-DVz12LeW.js";
8
+ /* empty css */
9
+ import { u as Ae } from "./useUploadCos-N5pim6q1.js";
10
+ import { _ as Ue, g as xe, i as qe } from "./plugin-vue_export-helper-LjDO2Zua.js";
11
+ import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ import { a as te, u as Te } from "./useAuthkitUsersProfile-CQGyvL7g.js";
13
+ import { Icon as Be } from "@iconify/vue";
14
+ import { u as pe } from "./useAuthkitAppsAuthPageInfo-Du5d6VK-.js";
15
+ import { M as Ee } from "./Menu-Cy2ZPeaz.js";
16
+ import { u as Re } from "./useAuthkitCreateAndUpdate-Bc9D5C6R.js";
17
+ const Le = O({
18
+ name: "IconCamera",
19
+ props: {
20
+ size: {
21
+ type: [Number, String]
22
+ },
23
+ strokeWidth: {
24
+ type: Number,
25
+ default: 4
26
+ },
27
+ strokeLinecap: {
28
+ type: String,
29
+ default: "butt",
30
+ validator: (c) => ["butt", "round", "square"].includes(c)
31
+ },
32
+ strokeLinejoin: {
33
+ type: String,
34
+ default: "miter",
35
+ validator: (c) => ["arcs", "bevel", "miter", "miter-clip", "round"].includes(c)
36
+ },
37
+ rotate: Number,
38
+ spin: Boolean
39
+ },
40
+ emits: {
41
+ click: (c) => !0
42
+ },
43
+ setup(c, {
44
+ emit: i
45
+ }) {
46
+ const v = xe("icon"), m = I(() => [v, `${v}-camera`, {
47
+ [`${v}-spin`]: c.spin
48
+ }]), s = I(() => {
49
+ const l = {};
50
+ return c.size && (l.fontSize = qe(c.size) ? `${c.size}px` : c.size), c.rotate && (l.transform = `rotate(${c.rotate}deg)`), l;
51
+ });
52
+ return {
53
+ cls: m,
54
+ innerStyle: s,
55
+ onClick: (l) => {
56
+ i("click", l);
57
+ }
58
+ };
59
+ }
60
+ }), Ne = ["stroke-width", "stroke-linecap", "stroke-linejoin"];
61
+ function Me(c, i, v, m, s, g) {
62
+ return h(), j("svg", {
63
+ viewBox: "0 0 48 48",
64
+ fill: "none",
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ stroke: "currentColor",
67
+ class: ke(c.cls),
68
+ style: be(c.innerStyle),
69
+ "stroke-width": c.strokeWidth,
70
+ "stroke-linecap": c.strokeLinecap,
71
+ "stroke-linejoin": c.strokeLinejoin,
72
+ onClick: i[0] || (i[0] = (...l) => c.onClick && c.onClick(...l))
73
+ }, i[1] || (i[1] = [C("path", {
74
+ d: "m33 12-1.862-3.724A.5.5 0 0 0 30.691 8H17.309a.5.5 0 0 0-.447.276L15 12m16 14a7 7 0 1 1-14 0 7 7 0 0 1 14 0ZM7 40h34a1 1 0 0 0 1-1V13a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1v26a1 1 0 0 0 1 1Z"
75
+ }, null, -1)]), 14, Ne);
76
+ }
77
+ var se = /* @__PURE__ */ Ue(Le, [["render", Me]]);
78
+ const Oe = Object.assign(se, {
79
+ install: (c, i) => {
80
+ var v;
81
+ const m = (v = i == null ? void 0 : i.iconPrefix) != null ? v : "";
82
+ c.component(m + se.name, se);
83
+ }
84
+ }), De = {
85
+ class: "handle"
86
+ }, Fe = /* @__PURE__ */ O({
87
+ __name: "AuthkitPersonalInformation",
88
+ props: {
89
+ size: {
90
+ type: String,
91
+ required: !0
92
+ }
93
+ },
94
+ emits: ["submit"],
95
+ setup(c, {
96
+ emit: i
97
+ }) {
98
+ const v = i, m = c, s = y({
99
+ id: void 0,
100
+ nickname: "",
101
+ description: "",
102
+ avatar: "",
103
+ avatarUrl: ""
104
+ }), g = y(!1), l = y(), a = y(!1), V = {
105
+ color: "var(--huyooo-accent-primary)"
106
+ };
107
+ async function u() {
108
+ a.value = !0;
109
+ const {
110
+ data: n
111
+ } = await x.users.profile.post({});
112
+ a.value = !1, n && (s.value.id = n.id, s.value.nickname = n.nickname, s.value.description = n.description, s.value.avatar = n.avatar, s.value.avatarUrl = n.avatarUrl);
113
+ }
114
+ async function r() {
115
+ if (!await l.value.validate()) {
116
+ a.value = !0;
117
+ const f = {
118
+ id: s.value.id,
119
+ nickname: s.value.nickname,
120
+ description: s.value.description,
121
+ avatar: s.value.avatar
122
+ }, {
123
+ data: w,
124
+ error: R
125
+ } = await x.users.update.baseInfo.post(f);
126
+ a.value = !1, !R && w && (G.success("更新成功"), s.value.avatarUrl = w.avatarUrl, v("submit"));
127
+ }
128
+ }
129
+ u();
130
+ const p = () => {
131
+ const {
132
+ uploadFile: n
133
+ } = Ae(), f = document.createElement("input");
134
+ f.type = "file", f.accept = "image/*", f.style.display = "none", document.body.append(f), f.addEventListener("change", async (w) => {
135
+ var L;
136
+ const S = (L = w.target.files) == null ? void 0 : L[0];
137
+ if (S) {
138
+ g.value = !0;
139
+ try {
140
+ n({
141
+ bucketId: Y.avatarBucketId,
142
+ file: S,
143
+ onFileFinish(D, M, K) {
144
+ g.value = !0;
145
+ const _ = {
146
+ id: s.value.id,
147
+ nickname: s.value.nickname,
148
+ description: s.value.description,
149
+ avatar: K.Key
150
+ };
151
+ (async () => {
152
+ const {
153
+ error: $
154
+ } = await x.users.update.baseInfo.post(_);
155
+ g.value = !1, $ || (G.success("更新成功"), u(), v("submit"));
156
+ })();
157
+ },
158
+ onError(D) {
159
+ console.error("上传图片失败"), g.value = !1;
160
+ }
161
+ });
162
+ } catch (D) {
163
+ console.error("上传图片失败", D), g.value = !1;
164
+ }
165
+ }
166
+ f.remove();
167
+ }), f.click();
168
+ };
169
+ return (n, f) => (h(), z(e(Q), {
170
+ ref_key: "formRef",
171
+ ref: l,
172
+ model: s.value,
173
+ "auto-label-width": "",
174
+ size: m.size
175
+ }, {
176
+ default: t(() => [o(e(U), {
177
+ field: "avatar",
178
+ label: "头像",
179
+ rules: [{
180
+ required: !1,
181
+ message: "请上传头像"
182
+ }]
183
+ }, {
184
+ default: t(() => [o(e(re), {
185
+ "image-url": s.value.avatarUrl,
186
+ size: 42,
187
+ "object-fit": "cover",
188
+ "trigger-icon-style": V,
189
+ onClick: p
190
+ }, {
191
+ "trigger-icon": t(() => [o(e(Oe))]),
192
+ _: 1
193
+ }, 8, ["image-url"])]),
194
+ _: 1
195
+ }), o(e(U), {
196
+ field: "nickname",
197
+ label: "昵称",
198
+ rules: [{
199
+ required: !1,
200
+ message: "请输入昵称"
201
+ }]
202
+ }, {
203
+ default: t(() => [o(e(N), {
204
+ modelValue: s.value.nickname,
205
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => s.value.nickname = w),
206
+ placeholder: "请输入昵称"
207
+ }, null, 8, ["modelValue"])]),
208
+ _: 1
209
+ }), o(e(U), {
210
+ field: "description",
211
+ label: "简介",
212
+ rules: [{
213
+ required: !1,
214
+ message: "请输入描述"
215
+ }]
216
+ }, {
217
+ default: t(() => [o(e(Ce), {
218
+ modelValue: s.value.description,
219
+ "onUpdate:modelValue": f[1] || (f[1] = (w) => s.value.description = w),
220
+ placeholder: "请输入描述",
221
+ "allow-clear": "",
222
+ "auto-size": {
223
+ minRows: 5
224
+ }
225
+ }, null, 8, ["modelValue"])]),
226
+ _: 1
227
+ }), o(e(U), {
228
+ field: "",
229
+ label: "",
230
+ rules: []
231
+ }, {
232
+ default: t(() => [C("div", De, [o(e(A), {
233
+ type: "primary",
234
+ loading: a.value,
235
+ onClick: r
236
+ }, {
237
+ default: t(() => [...f[2] || (f[2] = [k(" 提交 ", -1)])]),
238
+ _: 1
239
+ }, 8, ["loading"])])]),
240
+ _: 1
241
+ })]),
242
+ _: 1
243
+ }, 8, ["model", "size"]));
244
+ }
245
+ }), je = /* @__PURE__ */ W(Fe, [["__scopeId", "data-v-1d138326"]]), He = /* @__PURE__ */ O({
246
+ __name: "AuthkitSendVerifyCode",
247
+ props: {
248
+ size: {
249
+ type: String,
250
+ required: !0
251
+ },
252
+ loading: {
253
+ type: Boolean,
254
+ required: !0,
255
+ default: () => !1
256
+ }
257
+ },
258
+ emits: ["send"],
259
+ setup(c, {
260
+ expose: i,
261
+ emit: v
262
+ }) {
263
+ const m = v, s = c, g = y(!1);
264
+ let l;
265
+ const a = y(0), V = I(() => a.value.toString().padStart(2, "0")), u = I(() => a.value > 0), r = () => {
266
+ g.value && (a.value <= 0 ? (clearInterval(l), g.value = !1) : a.value--);
267
+ };
268
+ function p() {
269
+ m("send");
270
+ }
271
+ function n() {
272
+ a.value = 60, g.value = !0, l && clearInterval(l), l = setInterval(r, 1e3);
273
+ }
274
+ return ee(() => {
275
+ }), i({
276
+ startCountFn: n
277
+ }), fe(() => {
278
+ l && clearInterval(l);
279
+ }), (f, w) => (h(), z(e(A), {
280
+ class: "OAuthItem",
281
+ type: "primary",
282
+ size: s.size,
283
+ disabled: u.value,
284
+ loading: s.loading,
285
+ onClick: p
286
+ }, {
287
+ default: t(() => [w[0] || (w[0] = C("span", null, " 发送验证码", -1)), _e(C("span", {
288
+ class: "verify-code-timer"
289
+ }, B(`(${V.value})`), 513), [[we, u.value]])]),
290
+ _: 1
291
+ }, 8, ["size", "disabled", "loading"]));
292
+ }
293
+ }), ie = /* @__PURE__ */ W(He, [["__scopeId", "data-v-2883dc6d"]]), We = {
294
+ class: "sendVerifyCodeItem"
295
+ }, Ke = {
296
+ class: "handle"
297
+ }, Ge = /* @__PURE__ */ O({
298
+ __name: "AuthkitEmailVerify",
299
+ props: {
300
+ email: {
301
+ type: String,
302
+ required: !0,
303
+ default: () => ""
304
+ },
305
+ size: {
306
+ type: String,
307
+ required: !0
308
+ }
309
+ },
310
+ emits: ["next"],
311
+ setup(c, {
312
+ emit: i
313
+ }) {
314
+ const v = i, m = c, s = I(() => me(m.email)), g = y(), l = y(!1), a = y(!1), V = y(), u = y({
315
+ userToken: void 0,
316
+ emailVerifyId: void 0
317
+ });
318
+ async function r() {
319
+ l.value = !0;
320
+ const {
321
+ data: n
322
+ } = await x.verify.email.retry.post({
323
+ email: m.email,
324
+ purpose: "bindEmail"
325
+ });
326
+ l.value = !1, n && (u.value.emailVerifyId = n.emailVerifyId, g.value.startCountFn());
327
+ }
328
+ async function p() {
329
+ if (!await V.value.validate(["userToken"])) {
330
+ a.value = !0;
331
+ const {
332
+ error: f
333
+ } = await x.verify.email.post({
334
+ email: m.email,
335
+ userToken: u.value.userToken,
336
+ emailVerifyId: u.value.emailVerifyId,
337
+ purpose: "bindEmail"
338
+ });
339
+ a.value = !1, f || v("next");
340
+ }
341
+ }
342
+ return (n, f) => (h(), z(e(Q), {
343
+ ref_key: "formRef",
344
+ ref: V,
345
+ model: u.value,
346
+ "auto-label-width": "",
347
+ size: m.size
348
+ }, {
349
+ default: t(() => [o(e(U), {
350
+ field: "email",
351
+ label: "邮箱",
352
+ rules: [{
353
+ required: !1,
354
+ message: "请输入邮箱"
355
+ }, {
356
+ type: "email",
357
+ message: "请输入有效的邮箱"
358
+ }]
359
+ }, {
360
+ default: t(() => [k(B(s.value), 1)]),
361
+ _: 1
362
+ }), o(e(U), {
363
+ field: "userToken",
364
+ label: "验证码",
365
+ "hide-label": "",
366
+ rules: [{
367
+ required: !0,
368
+ message: "请输入验证码"
369
+ }]
370
+ }, {
371
+ default: t(() => [C("div", We, [o(e(N), {
372
+ modelValue: u.value.userToken,
373
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => u.value.userToken = w),
374
+ placeholder: "请输入验证码"
375
+ }, null, 8, ["modelValue"]), o(ie, {
376
+ ref_key: "SendVerifyCodeRef",
377
+ ref: g,
378
+ size: m.size,
379
+ loading: l.value,
380
+ style: {
381
+ "margin-left": "10px"
382
+ },
383
+ onSend: r
384
+ }, null, 8, ["size", "loading"])])]),
385
+ _: 1
386
+ }), o(e(U), {
387
+ field: "",
388
+ label: "",
389
+ rules: []
390
+ }, {
391
+ default: t(() => [C("div", Ke, [o(e(A), {
392
+ loading: a.value,
393
+ type: "primary",
394
+ onClick: p
395
+ }, {
396
+ default: t(() => [...f[1] || (f[1] = [k(" 提交 ", -1)])]),
397
+ _: 1
398
+ }, 8, ["loading"])])]),
399
+ _: 1
400
+ })]),
401
+ _: 1
402
+ }, 8, ["model", "size"]));
403
+ }
404
+ }), ue = /* @__PURE__ */ W(Ge, [["__scopeId", "data-v-f4247d73"]]), Ze = {
405
+ class: "sendVerifyCodeItem"
406
+ }, Je = {
407
+ class: "handle"
408
+ }, Qe = /* @__PURE__ */ O({
409
+ __name: "AuthkitPhoneVerify",
410
+ props: {
411
+ phone: {
412
+ type: String,
413
+ required: !0
414
+ },
415
+ size: {
416
+ type: String,
417
+ required: !0
418
+ }
419
+ },
420
+ emits: ["next"],
421
+ setup(c, {
422
+ emit: i
423
+ }) {
424
+ const v = i, m = c, s = y(), g = y(!1), l = y(!1), a = y(), V = y({
425
+ code: void 0
426
+ }), u = I(() => {
427
+ const n = m.phone.trim();
428
+ return n.length < 7 ? n : `${n.slice(0, 3)}****${n.slice(-4)}`;
429
+ });
430
+ async function r() {
431
+ g.value = !0;
432
+ const {
433
+ error: n
434
+ } = await x.verify.sms.send.post({
435
+ phone: m.phone,
436
+ purpose: "resetPassword"
437
+ });
438
+ g.value = !1, n || s.value.startCountFn();
439
+ }
440
+ async function p() {
441
+ if (!await a.value.validate(["code"])) {
442
+ l.value = !0;
443
+ const {
444
+ error: f
445
+ } = await x.verify.sms.verify.post({
446
+ phone: m.phone,
447
+ code: V.value.code,
448
+ purpose: "resetPassword"
449
+ });
450
+ l.value = !1, f || v("next");
451
+ }
452
+ }
453
+ return (n, f) => (h(), z(e(Q), {
454
+ ref_key: "formRef",
455
+ ref: a,
456
+ model: V.value,
457
+ "auto-label-width": "",
458
+ size: m.size
459
+ }, {
460
+ default: t(() => [o(e(U), {
461
+ field: "phone",
462
+ label: "手机号"
463
+ }, {
464
+ default: t(() => [k(B(u.value), 1)]),
465
+ _: 1
466
+ }), o(e(U), {
467
+ field: "code",
468
+ label: "验证码",
469
+ "hide-label": "",
470
+ rules: [{
471
+ required: !0,
472
+ message: "请输入验证码"
473
+ }]
474
+ }, {
475
+ default: t(() => [C("div", Ze, [o(e(N), {
476
+ modelValue: V.value.code,
477
+ "onUpdate:modelValue": f[0] || (f[0] = (w) => V.value.code = w),
478
+ placeholder: "请输入验证码"
479
+ }, null, 8, ["modelValue"]), o(ie, {
480
+ ref_key: "sendVerifyCodeRef",
481
+ ref: s,
482
+ size: m.size,
483
+ loading: g.value,
484
+ style: {
485
+ "margin-left": "10px"
486
+ },
487
+ onSend: r
488
+ }, null, 8, ["size", "loading"])])]),
489
+ _: 1
490
+ }), o(e(U), {
491
+ field: "",
492
+ label: "",
493
+ rules: []
494
+ }, {
495
+ default: t(() => [C("div", Je, [o(e(A), {
496
+ loading: l.value,
497
+ type: "primary",
498
+ onClick: p
499
+ }, {
500
+ default: t(() => [...f[1] || (f[1] = [k("提交", -1)])]),
501
+ _: 1
502
+ }, 8, ["loading"])])]),
503
+ _: 1
504
+ })]),
505
+ _: 1
506
+ }, 8, ["model", "size"]));
507
+ }
508
+ }), ve = /* @__PURE__ */ W(Qe, [["__scopeId", "data-v-2a868807"]]), Xe = {
509
+ class: "handle"
510
+ }, Ye = /* @__PURE__ */ O({
511
+ __name: "AuthkitPasswordUpdate",
512
+ props: {
513
+ size: {
514
+ type: String,
515
+ required: !0
516
+ }
517
+ },
518
+ emits: ["submit"],
519
+ setup(c, {
520
+ emit: i
521
+ }) {
522
+ const v = i, m = y(!1), s = y(), g = c, l = y({
523
+ oldPassword: "",
524
+ password: "",
525
+ confirmPassword: ""
526
+ });
527
+ async function a() {
528
+ if (!await s.value.validate()) {
529
+ m.value = !0;
530
+ const u = {
531
+ password: l.value.password
532
+ }, {
533
+ error: r
534
+ } = await x.users.update.password.post(u);
535
+ m.value = !1, r || v("submit", u);
536
+ }
537
+ }
538
+ return (V, u) => (h(), z(e(Q), {
539
+ ref_key: "formRef",
540
+ ref: s,
541
+ model: l.value,
542
+ "auto-label-width": "",
543
+ size: g.size
544
+ }, {
545
+ default: t(() => [o(e(U), {
546
+ field: "oldPassword",
547
+ label: "当前密码",
548
+ "hide-label": "",
549
+ rules: [{
550
+ required: !0,
551
+ message: "请输入当前密码"
552
+ }]
553
+ }, {
554
+ default: t(() => [o(e(N), {
555
+ modelValue: l.value.oldPassword,
556
+ "onUpdate:modelValue": u[0] || (u[0] = (r) => l.value.oldPassword = r),
557
+ placeholder: "请输入当前密码",
558
+ type: "password"
559
+ }, null, 8, ["modelValue"])]),
560
+ _: 1
561
+ }), o(e(U), {
562
+ field: "password",
563
+ label: "新密码",
564
+ "hide-label": "",
565
+ rules: [{
566
+ required: !0,
567
+ message: "新密码请输入"
568
+ }, {
569
+ minLength: 10,
570
+ message: "新密码不能少于10字符"
571
+ }]
572
+ }, {
573
+ default: t(() => [o(e(N), {
574
+ modelValue: l.value.password,
575
+ "onUpdate:modelValue": u[1] || (u[1] = (r) => l.value.password = r),
576
+ placeholder: "请输入新密码",
577
+ type: "password"
578
+ }, null, 8, ["modelValue"])]),
579
+ _: 1
580
+ }), o(e(U), {
581
+ field: "confirmPassword",
582
+ label: "确认密码",
583
+ "hide-label": "",
584
+ rules: [{
585
+ required: !0,
586
+ message: "请输入确认密码"
587
+ }, {
588
+ minLength: 10,
589
+ message: "确认密码不能少于10字符"
590
+ }, {
591
+ validator: (r, p) => {
592
+ r !== l.value.password ? p("两次密码输入不一致,请重新输入") : p();
593
+ }
594
+ }]
595
+ }, {
596
+ default: t(() => [o(e(N), {
597
+ modelValue: l.value.confirmPassword,
598
+ "onUpdate:modelValue": u[2] || (u[2] = (r) => l.value.confirmPassword = r),
599
+ placeholder: "请输入确认密码密码",
600
+ type: "password"
601
+ }, null, 8, ["modelValue"])]),
602
+ _: 1
603
+ }, 8, ["rules"]), o(e(U), {
604
+ field: "",
605
+ label: "",
606
+ rules: []
607
+ }, {
608
+ default: t(() => [C("div", Xe, [o(e(A), {
609
+ type: "primary",
610
+ loading: m.value,
611
+ onClick: a
612
+ }, {
613
+ default: t(() => [...u[3] || (u[3] = [k(" 提交 ", -1)])]),
614
+ _: 1
615
+ }, 8, ["loading"])])]),
616
+ _: 1
617
+ })]),
618
+ _: 1
619
+ }, 8, ["model", "size"]));
620
+ }
621
+ }), et = /* @__PURE__ */ W(Ye, [["__scopeId", "data-v-f8bd086f"]]), tt = /* @__PURE__ */ O({
622
+ __name: "AuthkitSetPassword",
623
+ props: {
624
+ size: {
625
+ type: String,
626
+ required: !0
627
+ }
628
+ },
629
+ setup(c) {
630
+ const {
631
+ userProfile: i,
632
+ loading: v,
633
+ fetchUserProfile: m,
634
+ isLoggedIn: s
635
+ } = te(), g = y("hidden"), l = c;
636
+ function a(r) {
637
+ g.value = r;
638
+ }
639
+ function V(r) {
640
+ G.success("密码修改成功"), g.value = "hidden", m();
641
+ }
642
+ function u() {
643
+ g.value = "update";
644
+ }
645
+ return ee(() => {
646
+ s.value && !i.value && m();
647
+ }), (r, p) => {
648
+ var n, f, w, R, S, L, D, M;
649
+ return h(), j(J, null, [!((n = e(i)) != null && n.email) && !((f = e(i)) != null && f.phone) ? (h(), z(e(F), {
650
+ key: 0,
651
+ title: "先绑定账号"
652
+ }, {
653
+ action: t(() => [o(e(A), {
654
+ size: l.size,
655
+ type: "primary",
656
+ onClick: p[0] || (p[0] = (K) => a("update"))
657
+ }, {
658
+ default: t(() => [...p[2] || (p[2] = [k(" 去绑定邮箱 ", -1)])]),
659
+ _: 1
660
+ }, 8, ["size"])]),
661
+ default: t(() => [p[3] || (p[3] = k(" 请先绑定邮箱或手机号,再设置登录密码。 ", -1))]),
662
+ _: 1
663
+ })) : P("", !0), ((w = e(i)) != null && w.email || (R = e(i)) != null && R.phone) && g.value === "hidden" ? (h(), z(e(F), {
664
+ key: 1,
665
+ title: "更改密码"
666
+ }, {
667
+ action: t(() => [o(e(A), {
668
+ size: l.size,
669
+ type: "primary",
670
+ onClick: p[1] || (p[1] = (K) => a("verify"))
671
+ }, {
672
+ default: t(() => [...p[4] || (p[4] = [k("更改密码", -1)])]),
673
+ _: 1
674
+ }, 8, ["size"])]),
675
+ default: t(() => [p[5] || (p[5] = k(" 为了账户安全,修改密码前会先验证身份。 ", -1))]),
676
+ _: 1
677
+ })) : P("", !0), g.value === "update" ? (h(), z(et, {
678
+ key: 2,
679
+ size: l.size,
680
+ loading: e(v),
681
+ onSubmit: V
682
+ }, null, 8, ["size", "loading"])) : P("", !0), g.value === "verify" && ((S = e(i)) != null && S.email) ? (h(), z(ue, {
683
+ key: 3,
684
+ size: l.size,
685
+ email: (L = e(i)) == null ? void 0 : L.email,
686
+ onNext: u
687
+ }, null, 8, ["size", "email"])) : P("", !0), g.value === "verify" && !((D = e(i)) != null && D.email) && ((M = e(i)) != null && M.phone) ? (h(), z(ve, {
688
+ key: 4,
689
+ size: l.size,
690
+ phone: e(i).phone,
691
+ onNext: u
692
+ }, null, 8, ["size", "phone"])) : P("", !0)], 64);
693
+ };
694
+ }
695
+ }), at = {
696
+ class: "content"
697
+ }, lt = {
698
+ class: "sendVerifyCodeItem"
699
+ }, it = {
700
+ class: "handle"
701
+ }, ot = /* @__PURE__ */ O({
702
+ __name: "AuthkitEmailUpdate",
703
+ props: {
704
+ size: {
705
+ type: String,
706
+ required: !0
707
+ },
708
+ loading: {
709
+ type: Boolean,
710
+ required: !0,
711
+ default: () => !0
712
+ },
713
+ purpose: {
714
+ type: String,
715
+ default: "signUp"
716
+ }
717
+ },
718
+ emits: ["submit"],
719
+ setup(c, {
720
+ emit: i
721
+ }) {
722
+ const v = i, m = c, s = y(), g = y(!1), l = y(), a = y({
723
+ email: void 0,
724
+ userToken: void 0,
725
+ emailVerifyId: void 0,
726
+ password: void 0,
727
+ confirmPassword: void 0,
728
+ referrerId: void 0
729
+ });
730
+ async function V() {
731
+ if (!await l.value.validateField(["email"])) {
732
+ g.value = !0;
733
+ const {
734
+ data: p
735
+ } = await x.verify.email.retry.post({
736
+ email: a.value.email,
737
+ purpose: m.purpose
738
+ });
739
+ g.value = !1, p && (a.value.emailVerifyId = p.emailVerifyId, s.value.startCountFn());
740
+ }
741
+ }
742
+ async function u() {
743
+ l.value.validate().then((r) => {
744
+ r || v("submit", a.value);
745
+ });
746
+ }
747
+ return (r, p) => (h(), j("div", at, [o(e(Q), {
748
+ ref_key: "formRef",
749
+ ref: l,
750
+ model: a.value,
751
+ size: m.size,
752
+ "auto-label-width": ""
753
+ }, {
754
+ default: t(() => [o(e(U), {
755
+ field: "email",
756
+ label: "邮箱",
757
+ "hide-label": "",
758
+ rules: [{
759
+ required: !0,
760
+ message: "请输入邮箱"
761
+ }, {
762
+ type: "email",
763
+ message: "请输入有效的邮箱"
764
+ }]
765
+ }, {
766
+ default: t(() => [o(e(N), {
767
+ modelValue: a.value.email,
768
+ "onUpdate:modelValue": p[0] || (p[0] = (n) => a.value.email = n),
769
+ placeholder: "请输入邮箱",
770
+ autocomplete: "email username",
771
+ type: "email"
772
+ }, null, 8, ["modelValue"])]),
773
+ _: 1
774
+ }), o(e(U), {
775
+ field: "userToken",
776
+ label: "验证码",
777
+ "hide-label": "",
778
+ rules: [{
779
+ required: !0,
780
+ message: "请输入验证码"
781
+ }]
782
+ }, {
783
+ default: t(() => [C("div", lt, [o(e(N), {
784
+ modelValue: a.value.userToken,
785
+ "onUpdate:modelValue": p[1] || (p[1] = (n) => a.value.userToken = n),
786
+ placeholder: "请输入验证码",
787
+ autocomplete: "one-time-code"
788
+ }, null, 8, ["modelValue"]), o(ie, {
789
+ ref_key: "SendVerifyCodeRef",
790
+ ref: s,
791
+ size: m.size,
792
+ loading: g.value,
793
+ style: {
794
+ "margin-left": "10px"
795
+ },
796
+ onSend: V
797
+ }, null, 8, ["size", "loading"])])]),
798
+ _: 1
799
+ }), o(e(U), {
800
+ field: "password",
801
+ label: "密码",
802
+ "hide-label": "",
803
+ rules: [{
804
+ required: !0,
805
+ message: "密码请输入"
806
+ }, {
807
+ minLength: 10,
808
+ message: "密码不能少于10字符"
809
+ }]
810
+ }, {
811
+ default: t(() => [o(e(N), {
812
+ modelValue: a.value.password,
813
+ "onUpdate:modelValue": p[2] || (p[2] = (n) => a.value.password = n),
814
+ placeholder: "请输入密码",
815
+ type: "password",
816
+ autocomplete: "new-password"
817
+ }, null, 8, ["modelValue"])]),
818
+ _: 1
819
+ }), o(e(U), {
820
+ field: "confirmPassword",
821
+ label: "确认密码",
822
+ "hide-label": "",
823
+ rules: [{
824
+ required: !0,
825
+ message: "请输入确认密码"
826
+ }, {
827
+ minLength: 10,
828
+ message: "确认密码不能少于10字符"
829
+ }, {
830
+ validator: (n, f) => {
831
+ n !== a.value.password ? f("两次密码输入不一致,请重新输入") : f();
832
+ }
833
+ }]
834
+ }, {
835
+ default: t(() => [o(e(N), {
836
+ modelValue: a.value.confirmPassword,
837
+ "onUpdate:modelValue": p[3] || (p[3] = (n) => a.value.confirmPassword = n),
838
+ placeholder: "请输入确认密码密码",
839
+ type: "password",
840
+ autocomplete: "new-password"
841
+ }, null, 8, ["modelValue"])]),
842
+ _: 1
843
+ }, 8, ["rules"]), o(e(U), {
844
+ field: "referrerId",
845
+ label: "邀请人",
846
+ "hide-label": "",
847
+ rules: [{
848
+ required: !1,
849
+ message: "请输入邀请人ID"
850
+ }]
851
+ }, {
852
+ default: t(() => [o(e(N), {
853
+ modelValue: a.value.referrerId,
854
+ "onUpdate:modelValue": p[4] || (p[4] = (n) => a.value.referrerId = n),
855
+ placeholder: "邀请人ID(可选)",
856
+ autocomplete: "off"
857
+ }, null, 8, ["modelValue"])]),
858
+ _: 1
859
+ }), C("div", it, [o(e(A), {
860
+ type: "primary",
861
+ loading: m.loading,
862
+ long: "",
863
+ size: m.size,
864
+ onClick: u
865
+ }, {
866
+ default: t(() => [...p[5] || (p[5] = [k(" 提交 ", -1)])]),
867
+ _: 1
868
+ }, 8, ["loading", "size"])])]),
869
+ _: 1
870
+ }, 8, ["model", "size"])]));
871
+ }
872
+ }), nt = /* @__PURE__ */ W(ot, [["__scopeId", "data-v-3ecbfe7d"]]), st = /* @__PURE__ */ O({
873
+ __name: "AuthkitEmailBinding",
874
+ props: {
875
+ size: {
876
+ type: String,
877
+ required: !0
878
+ }
879
+ },
880
+ setup(c) {
881
+ const {
882
+ userProfile: i,
883
+ loading: v,
884
+ fetchUserProfile: m
885
+ } = te(), s = y("hidden"), g = c;
886
+ function l(u) {
887
+ s.value = u;
888
+ }
889
+ async function a(u) {
890
+ v.value = !0;
891
+ const r = {
892
+ email: u.email,
893
+ userToken: u.userToken,
894
+ emailVerifyId: u.emailVerifyId,
895
+ password: u.password || ""
896
+ // API 要求 password,但绑定邮箱时可能不需要,传空字符串
897
+ }, {
898
+ error: p
899
+ } = await x.users.update.email.post(r);
900
+ v.value = !1, p || (G.success("绑定成功"), s.value = "hidden", m());
901
+ }
902
+ function V() {
903
+ s.value = "update";
904
+ }
905
+ return ee(() => {
906
+ i.value || m();
907
+ }), (u, r) => {
908
+ var p, n, f;
909
+ return h(), j(J, null, [!((p = e(i)) != null && p.email) && s.value === "hidden" ? (h(), z(e(F), {
910
+ key: 0,
911
+ title: "绑定邮箱"
912
+ }, {
913
+ action: t(() => [o(e(A), {
914
+ size: g.size,
915
+ type: "primary",
916
+ onClick: r[0] || (r[0] = (w) => l("update"))
917
+ }, {
918
+ default: t(() => [...r[2] || (r[2] = [k(" 绑定邮箱 ", -1)])]),
919
+ _: 1
920
+ }, 8, ["size"])]),
921
+ default: t(() => [r[3] || (r[3] = k(" 您还未绑定邮箱,请点击绑定邮箱 ", -1))]),
922
+ _: 1
923
+ })) : P("", !0), (n = e(i)) != null && n.email && s.value === "hidden" ? (h(), z(e(F), {
924
+ key: 1,
925
+ title: "更改邮箱"
926
+ }, {
927
+ action: t(() => [o(e(A), {
928
+ size: g.size,
929
+ type: "primary",
930
+ onClick: r[1] || (r[1] = (w) => l("verify"))
931
+ }, {
932
+ default: t(() => [...r[4] || (r[4] = [k(" 更改邮箱 ", -1)])]),
933
+ _: 1
934
+ }, 8, ["size"])]),
935
+ default: t(() => {
936
+ var w;
937
+ return [k(B(`您绑定的邮箱为${e(me)((w = e(i)) == null ? void 0 : w.email)}`) + " ", 1)];
938
+ }),
939
+ _: 1
940
+ })) : P("", !0), s.value === "update" ? (h(), z(nt, {
941
+ key: 2,
942
+ loading: e(v),
943
+ size: g.size,
944
+ purpose: "bindEmail",
945
+ onSubmit: a
946
+ }, null, 8, ["loading", "size"])) : P("", !0), s.value === "verify" ? (h(), z(ue, {
947
+ key: 3,
948
+ size: g.size,
949
+ email: (f = e(i)) == null ? void 0 : f.email,
950
+ onNext: V
951
+ }, null, 8, ["size", "email"])) : P("", !0)], 64);
952
+ };
953
+ }
954
+ }), rt = /* @__PURE__ */ W(st, [["__scopeId", "data-v-cc86ecd6"]]), ut = {
955
+ class: "BindPhone"
956
+ }, dt = {
957
+ class: "header"
958
+ }, ct = {
959
+ class: "title"
960
+ }, ft = {
961
+ class: "subtitle"
962
+ }, mt = {
963
+ class: "content"
964
+ }, pt = {
965
+ class: "sendVerifyCodeItem"
966
+ }, vt = {
967
+ class: "handle"
968
+ }, gt = {
969
+ key: 0,
970
+ class: "skip"
971
+ }, ht = /* @__PURE__ */ O({
972
+ __name: "AuthkitBindPhone",
973
+ props: {
974
+ size: {
975
+ type: String,
976
+ required: !0
977
+ },
978
+ loading: {
979
+ type: Boolean,
980
+ required: !0,
981
+ default: () => !1
982
+ },
983
+ showSkip: {
984
+ type: Boolean,
985
+ default: !1
986
+ },
987
+ title: {
988
+ type: String,
989
+ default: "绑定手机号"
990
+ },
991
+ subtitle: {
992
+ type: String,
993
+ default: "请绑定手机号以完成账号设置"
994
+ },
995
+ submitText: {
996
+ type: String,
997
+ default: "绑定手机号"
998
+ }
999
+ },
1000
+ emits: ["submit", "skip"],
1001
+ setup(c, {
1002
+ emit: i
1003
+ }) {
1004
+ const v = i, m = c, s = y(), g = y(!1), l = y(), a = y({
1005
+ phone: void 0,
1006
+ code: void 0
1007
+ });
1008
+ async function V() {
1009
+ if (!await l.value.validateField(["phone"])) {
1010
+ g.value = !0;
1011
+ const {
1012
+ error: n
1013
+ } = await x.verify.sms.send.post({
1014
+ phone: a.value.phone,
1015
+ purpose: "bindPhone"
1016
+ });
1017
+ g.value = !1, n || s.value.startCountFn();
1018
+ }
1019
+ }
1020
+ async function u() {
1021
+ l.value.validate().then((p) => {
1022
+ p || v("submit", {
1023
+ phone: a.value.phone,
1024
+ code: a.value.code
1025
+ });
1026
+ });
1027
+ }
1028
+ function r() {
1029
+ v("skip");
1030
+ }
1031
+ return (p, n) => (h(), j("div", ut, [C("div", dt, [C("h3", ct, B(m.title), 1), C("p", ft, B(m.subtitle), 1)]), C("div", mt, [o(e(Q), {
1032
+ ref_key: "formRef",
1033
+ ref: l,
1034
+ model: a.value,
1035
+ size: m.size,
1036
+ "auto-label-width": ""
1037
+ }, {
1038
+ default: t(() => [o(e(U), {
1039
+ field: "phone",
1040
+ label: "手机号",
1041
+ "hide-label": "",
1042
+ rules: [{
1043
+ required: !0,
1044
+ message: "请输入手机号"
1045
+ }, {
1046
+ match: /^1[3-9]\d{9}$/,
1047
+ message: "请输入有效的手机号"
1048
+ }]
1049
+ }, {
1050
+ default: t(() => [o(e(N), {
1051
+ modelValue: a.value.phone,
1052
+ "onUpdate:modelValue": n[0] || (n[0] = (f) => a.value.phone = f),
1053
+ placeholder: "请输入手机号",
1054
+ autocomplete: "tel",
1055
+ type: "tel"
1056
+ }, null, 8, ["modelValue"])]),
1057
+ _: 1
1058
+ }), o(e(U), {
1059
+ field: "code",
1060
+ label: "验证码",
1061
+ "hide-label": "",
1062
+ rules: [{
1063
+ required: !0,
1064
+ message: "请输入验证码"
1065
+ }]
1066
+ }, {
1067
+ default: t(() => [C("div", pt, [o(e(N), {
1068
+ modelValue: a.value.code,
1069
+ "onUpdate:modelValue": n[1] || (n[1] = (f) => a.value.code = f),
1070
+ placeholder: "请输入验证码",
1071
+ autocomplete: "one-time-code"
1072
+ }, null, 8, ["modelValue"]), o(ie, {
1073
+ ref_key: "SendVerifyCodeRef",
1074
+ ref: s,
1075
+ size: m.size,
1076
+ loading: g.value,
1077
+ style: {
1078
+ "margin-left": "10px"
1079
+ },
1080
+ onSend: V
1081
+ }, null, 8, ["size", "loading"])])]),
1082
+ _: 1
1083
+ }), C("div", vt, [o(e(A), {
1084
+ type: "primary",
1085
+ loading: m.loading,
1086
+ long: "",
1087
+ size: m.size,
1088
+ onClick: u
1089
+ }, {
1090
+ default: t(() => [k(B(m.submitText), 1)]),
1091
+ _: 1
1092
+ }, 8, ["loading", "size"])])]),
1093
+ _: 1
1094
+ }, 8, ["model", "size"])]), m.showSkip ? (h(), j("div", gt, [o(e(Ie), {
1095
+ onClick: r
1096
+ }, {
1097
+ default: t(() => [...n[2] || (n[2] = [k("稍后绑定", -1)])]),
1098
+ _: 1
1099
+ })])) : P("", !0)]));
1100
+ }
1101
+ }), yt = /* @__PURE__ */ W(ht, [["__scopeId", "data-v-bb70264d"]]), bt = /* @__PURE__ */ O({
1102
+ __name: "AuthkitPhoneBinding",
1103
+ props: {
1104
+ size: {
1105
+ type: String,
1106
+ required: !0
1107
+ }
1108
+ },
1109
+ setup(c) {
1110
+ const {
1111
+ userProfile: i,
1112
+ loading: v,
1113
+ fetchUserProfile: m
1114
+ } = te(), s = y("hidden"), g = c, l = I(() => {
1115
+ var r;
1116
+ const u = ((r = i.value) == null ? void 0 : r.phone) || "";
1117
+ return u.length < 7 ? u : `${u.slice(0, 3)}****${u.slice(-4)}`;
1118
+ });
1119
+ function a(u) {
1120
+ s.value = u;
1121
+ }
1122
+ async function V(u) {
1123
+ var n, f;
1124
+ v.value = !0;
1125
+ const r = (n = i.value) != null && n.phone ? x.users.update.myPhone.post({
1126
+ phone: u.phone,
1127
+ code: u.code
1128
+ }) : x.auth.bind.phone.post({
1129
+ phone: u.phone,
1130
+ code: u.code
1131
+ }), {
1132
+ error: p
1133
+ } = await r;
1134
+ v.value = !1, p || (G.success((f = i.value) != null && f.phone ? "更改成功" : "绑定成功"), s.value = "hidden", m());
1135
+ }
1136
+ return ee(() => {
1137
+ i.value || m();
1138
+ }), (u, r) => {
1139
+ var p, n, f, w, R;
1140
+ return h(), j(J, null, [!((p = e(i)) != null && p.phone) && s.value === "hidden" ? (h(), z(e(F), {
1141
+ key: 0,
1142
+ title: "绑定手机号"
1143
+ }, {
1144
+ action: t(() => [o(e(A), {
1145
+ size: g.size,
1146
+ type: "primary",
1147
+ onClick: r[0] || (r[0] = (S) => a("update"))
1148
+ }, {
1149
+ default: t(() => [...r[2] || (r[2] = [k("绑定手机号", -1)])]),
1150
+ _: 1
1151
+ }, 8, ["size"])]),
1152
+ default: t(() => [r[3] || (r[3] = k(" 您还未绑定手机号,请点击绑定手机号。 ", -1))]),
1153
+ _: 1
1154
+ })) : P("", !0), (n = e(i)) != null && n.phone && s.value === "hidden" ? (h(), z(e(F), {
1155
+ key: 1,
1156
+ title: "已绑定手机号"
1157
+ }, {
1158
+ action: t(() => [o(e(A), {
1159
+ size: g.size,
1160
+ type: "primary",
1161
+ onClick: r[1] || (r[1] = (S) => a("update"))
1162
+ }, {
1163
+ default: t(() => [...r[4] || (r[4] = [k("更改手机号", -1)])]),
1164
+ _: 1
1165
+ }, 8, ["size"])]),
1166
+ default: t(() => [k(B(`您绑定的手机号为 ${l.value}`) + " ", 1)]),
1167
+ _: 1
1168
+ })) : P("", !0), s.value === "update" ? (h(), z(yt, {
1169
+ key: 2,
1170
+ loading: e(v),
1171
+ size: g.size,
1172
+ title: (f = e(i)) != null && f.phone ? "更改手机号" : "绑定手机号",
1173
+ subtitle: (w = e(i)) != null && w.phone ? "请输入新的手机号并完成短信验证" : "请绑定手机号以完成账号设置",
1174
+ "submit-text": (R = e(i)) != null && R.phone ? "更改手机号" : "绑定手机号",
1175
+ onSubmit: V
1176
+ }, null, 8, ["loading", "size", "title", "subtitle", "submit-text"])) : P("", !0)], 64);
1177
+ };
1178
+ }
1179
+ });
1180
+ function ge() {
1181
+ return Y.oauthCallbackUrl ? Y.oauthCallbackUrl : `${window.location.origin}/`;
1182
+ }
1183
+ function kt() {
1184
+ const c = window.location.pathname + window.location.search + window.location.hash, i = new URLSearchParams(window.location.search);
1185
+ !i.has("token") && !i.has("error") && !i.has("bindSuccess") && sessionStorage.setItem("auth_redirect", c);
1186
+ }
1187
+ async function ae(c, i) {
1188
+ const v = Y.appId;
1189
+ if (!v) {
1190
+ console.error(`${c} OAuth 失败: appId 未配置`);
1191
+ return;
1192
+ }
1193
+ const m = ge(), s = {
1194
+ appId: v,
1195
+ referrerId: i == null ? void 0 : i.referrerId,
1196
+ redirectUri: m
1197
+ };
1198
+ kt();
1199
+ const g = {
1200
+ github: () => x.oauth.github.login.get(s),
1201
+ google: () => x.oauth.google.login.get(s),
1202
+ microsoft: () => x.oauth.microsoft.login.get(s),
1203
+ wechat: () => x.oauth.wechat.login.get(s)
1204
+ };
1205
+ try {
1206
+ const {
1207
+ data: l
1208
+ } = await g[c]();
1209
+ l != null && l.redirectUri ? window.location.href = l.redirectUri : console.error(`${c} OAuth 重定向URL为空`);
1210
+ } catch (l) {
1211
+ console.error(`${c} OAuth 授权失败:`, l);
1212
+ }
1213
+ }
1214
+ function _t(c) {
1215
+ ae("github", {
1216
+ referrerId: c
1217
+ });
1218
+ }
1219
+ function wt(c) {
1220
+ ae("google", {
1221
+ referrerId: c
1222
+ });
1223
+ }
1224
+ function zt(c) {
1225
+ ae("microsoft", {
1226
+ referrerId: c
1227
+ });
1228
+ }
1229
+ function Vt(c) {
1230
+ ae("wechat", {
1231
+ referrerId: c
1232
+ });
1233
+ }
1234
+ function Ct() {
1235
+ return {
1236
+ githubAuth: _t,
1237
+ googleAuth: wt,
1238
+ microsoftAuth: zt,
1239
+ wechatAuth: Vt,
1240
+ startOauth: ae,
1241
+ getOauthCallbackUrl: ge
1242
+ };
1243
+ }
1244
+ const It = {
1245
+ class: "oauth-binding-account"
1246
+ }, $t = {
1247
+ class: "oauth-binding-account__info"
1248
+ }, Pt = {
1249
+ class: "oauth-binding-account__provider"
1250
+ }, St = {
1251
+ class: "oauth-binding-account__name"
1252
+ }, At = {
1253
+ class: "oauth-binding-verify-actions"
1254
+ }, Ut = /* @__PURE__ */ O({
1255
+ __name: "AuthkitOAuthBinding",
1256
+ props: {
1257
+ provider: {
1258
+ type: String,
1259
+ required: !0
1260
+ },
1261
+ label: {
1262
+ type: String,
1263
+ required: !0
1264
+ },
1265
+ size: {
1266
+ type: String,
1267
+ required: !0
1268
+ }
1269
+ },
1270
+ setup(c) {
1271
+ const i = c, {
1272
+ userProfile: v,
1273
+ fetchUserProfile: m
1274
+ } = te(), {
1275
+ appsData: s
1276
+ } = pe(), {
1277
+ getOauthCallbackUrl: g
1278
+ } = Ct(), l = y("hidden"), a = y(), V = y(!1);
1279
+ let u;
1280
+ const r = I(() => {
1281
+ var d;
1282
+ return ((d = v.value) == null ? void 0 : d[i.provider]) || null;
1283
+ }), p = I(() => {
1284
+ const d = r.value;
1285
+ return d ? d.login || d.name || d.nickname || d.displayName || d.userPrincipalName || d.email || d.mail || d.openid || i.label : "";
1286
+ }), n = I(() => {
1287
+ const d = r.value;
1288
+ return (d == null ? void 0 : d.avatar_url) || (d == null ? void 0 : d.picture) || (d == null ? void 0 : d.headimgurl) || "";
1289
+ }), f = I(() => ({
1290
+ github: "bi:github",
1291
+ google: "flat-color-icons:google",
1292
+ microsoft: "logos:microsoft-icon",
1293
+ wechat: "ri:wechat-fill"
1294
+ })[i.provider]), w = I(() => {
1295
+ const d = s.value.authMethods;
1296
+ return d.signUp.email || d.login.emailPassword || d.login.emailCode;
1297
+ }), R = I(() => {
1298
+ const d = s.value.authMethods;
1299
+ return d.signUp.phone || d.login.phonePassword || d.login.phoneCode;
1300
+ }), S = I(() => {
1301
+ var d;
1302
+ return w.value && !!((d = v.value) != null && d.email);
1303
+ }), L = I(() => {
1304
+ var d;
1305
+ return R.value && !!((d = v.value) != null && d.phone);
1306
+ }), D = I(() => {
1307
+ const d = [];
1308
+ return S.value && d.push("email"), L.value && d.push("phone"), d;
1309
+ }), M = I(() => w.value || R.value), K = I(() => l.value !== "hidden" && D.value.length > 1 && !a.value), _ = I(() => {
1310
+ var d;
1311
+ return l.value !== "hidden" && a.value === "email" && !!((d = v.value) != null && d.email);
1312
+ }), $ = I(() => {
1313
+ var d;
1314
+ return l.value !== "hidden" && a.value === "phone" && !!((d = v.value) != null && d.phone);
1315
+ }), H = I(() => l.value === "unbind" ? "解绑" : "绑定");
1316
+ function E(d) {
1317
+ if (d === "hidden") {
1318
+ l.value = d, a.value = void 0;
1319
+ return;
1320
+ }
1321
+ if (!M.value) {
1322
+ d === "bind" && T(), d === "unbind" && X();
1323
+ return;
1324
+ }
1325
+ const q = D.value;
1326
+ if (q.length === 0) {
1327
+ G.error("请先绑定应用已开启的邮箱或手机号后再操作第三方账号");
1328
+ return;
1329
+ }
1330
+ l.value = d, a.value = q.length === 1 ? q[0] : void 0;
1331
+ }
1332
+ function b(d) {
1333
+ a.value = d;
1334
+ }
1335
+ async function T() {
1336
+ const d = Y.appId;
1337
+ if (!d) {
1338
+ console.error(`${i.label} OAuth 失败: appId 未配置`);
1339
+ return;
1340
+ }
1341
+ const q = g(), le = {
1342
+ github: () => x.oauth.github.login.get({
1343
+ appId: d,
1344
+ mode: "bind",
1345
+ redirectUri: q
1346
+ }),
1347
+ google: () => x.oauth.google.login.get({
1348
+ appId: d,
1349
+ mode: "bind",
1350
+ redirectUri: q
1351
+ }),
1352
+ microsoft: () => x.oauth.microsoft.login.get({
1353
+ appId: d,
1354
+ mode: "bind",
1355
+ redirectUri: q
1356
+ }),
1357
+ wechat: () => x.oauth.wechat.login.get({
1358
+ appId: d,
1359
+ mode: "bind",
1360
+ redirectUri: q
1361
+ })
1362
+ }, {
1363
+ data: Z
1364
+ } = await le[i.provider]();
1365
+ Z != null && Z.redirectUri && (V.value = !0, window.open(Z.redirectUri, "_blank"));
1366
+ }
1367
+ async function X() {
1368
+ const {
1369
+ error: d
1370
+ } = await x.users.unbind.oauth.post({
1371
+ provider: i.provider
1372
+ });
1373
+ d || (G.success("解绑成功"), l.value = "hidden", m());
1374
+ }
1375
+ function de() {
1376
+ l.value === "bind" && (l.value = "hidden", T()), l.value === "unbind" && X();
1377
+ }
1378
+ function he() {
1379
+ V.value && m();
1380
+ }
1381
+ return ee(() => {
1382
+ v.value || m(), u = setInterval(he, 1e3);
1383
+ }), fe(() => {
1384
+ u && clearInterval(u);
1385
+ }), (d, q) => {
1386
+ var le, Z;
1387
+ return h(), j(J, null, [!r.value && l.value === "hidden" ? (h(), z(e(F), {
1388
+ key: 0,
1389
+ title: `绑定${i.label}`
1390
+ }, {
1391
+ action: t(() => [o(e(A), {
1392
+ size: i.size,
1393
+ type: "primary",
1394
+ onClick: q[0] || (q[0] = (oe) => E("bind"))
1395
+ }, {
1396
+ default: t(() => [k(" 绑定" + B(i.label), 1)]),
1397
+ _: 1
1398
+ }, 8, ["size"])]),
1399
+ default: t(() => [k(" 您还未绑定" + B(i.label) + "账号,请点击绑定。 ", 1)]),
1400
+ _: 1
1401
+ }, 8, ["title"])) : P("", !0), r.value && l.value === "hidden" ? (h(), z(e(F), {
1402
+ key: 1,
1403
+ title: `解绑${i.label}`
1404
+ }, {
1405
+ action: t(() => [o(e(A), {
1406
+ size: i.size,
1407
+ type: "primary",
1408
+ onClick: q[1] || (q[1] = (oe) => E("unbind"))
1409
+ }, {
1410
+ default: t(() => [k(" 解绑" + B(i.label), 1)]),
1411
+ _: 1
1412
+ }, 8, ["size"])]),
1413
+ default: t(() => [C("div", It, [n.value ? (h(), z(e(re), {
1414
+ key: 0,
1415
+ class: "oauth-binding-account__avatar",
1416
+ "image-url": n.value,
1417
+ size: 42
1418
+ }, null, 8, ["image-url"])) : (h(), z(e(re), {
1419
+ key: 1,
1420
+ class: "oauth-binding-account__avatar oauth-binding-account__avatar--placeholder",
1421
+ size: 42
1422
+ }, {
1423
+ default: t(() => [o(e(Be), {
1424
+ icon: f.value,
1425
+ width: 22
1426
+ }, null, 8, ["icon"])]),
1427
+ _: 1
1428
+ })), C("div", $t, [C("div", Pt, B(i.label), 1), C("div", St, B(p.value), 1)])])]),
1429
+ _: 1
1430
+ }, 8, ["title"])) : P("", !0), K.value ? (h(), z(e(F), {
1431
+ key: 2,
1432
+ title: `${H.value}前验证身份`
1433
+ }, {
1434
+ action: t(() => [C("div", At, [S.value ? (h(), z(e(A), {
1435
+ key: 0,
1436
+ size: i.size,
1437
+ type: "primary",
1438
+ onClick: q[2] || (q[2] = (oe) => b("email"))
1439
+ }, {
1440
+ default: t(() => [...q[4] || (q[4] = [k(" 邮箱验证 ", -1)])]),
1441
+ _: 1
1442
+ }, 8, ["size"])) : P("", !0), L.value ? (h(), z(e(A), {
1443
+ key: 1,
1444
+ size: i.size,
1445
+ type: "primary",
1446
+ onClick: q[3] || (q[3] = (oe) => b("phone"))
1447
+ }, {
1448
+ default: t(() => [...q[5] || (q[5] = [k(" 手机验证 ", -1)])]),
1449
+ _: 1
1450
+ }, 8, ["size"])) : P("", !0)])]),
1451
+ default: t(() => [q[6] || (q[6] = k(" 请选择一种已绑定的验证方式。 ", -1))]),
1452
+ _: 1
1453
+ }, 8, ["title"])) : P("", !0), _.value ? (h(), z(ue, {
1454
+ key: 3,
1455
+ size: i.size,
1456
+ email: (le = e(v)) == null ? void 0 : le.email,
1457
+ onNext: de
1458
+ }, null, 8, ["size", "email"])) : P("", !0), $.value ? (h(), z(ve, {
1459
+ key: 4,
1460
+ size: i.size,
1461
+ phone: ((Z = e(v)) == null ? void 0 : Z.phone) || "",
1462
+ onNext: de
1463
+ }, null, 8, ["size", "phone"])) : P("", !0)], 64);
1464
+ };
1465
+ }
1466
+ }), xt = /* @__PURE__ */ W(Ut, [["__scopeId", "data-v-6ab5f9c4"]]), qt = {
1467
+ class: "dependency-list"
1468
+ }, Tt = {
1469
+ class: "label"
1470
+ }, Bt = {
1471
+ class: "count"
1472
+ }, Et = {
1473
+ class: "action-bar"
1474
+ }, Rt = {
1475
+ class: "verify-code-row"
1476
+ }, Lt = /* @__PURE__ */ O({
1477
+ __name: "AuthkitAccountDelete",
1478
+ props: {
1479
+ size: {
1480
+ type: String,
1481
+ required: !0
1482
+ }
1483
+ },
1484
+ emits: ["deleted"],
1485
+ setup(c, {
1486
+ emit: i
1487
+ }) {
1488
+ const v = c, m = i, {
1489
+ userProfile: s,
1490
+ clearUserProfile: g
1491
+ } = te(), {
1492
+ clearAuth: l
1493
+ } = Te(), a = y("check"), V = y(!1), u = y([]), r = y(!1), p = y(""), n = y(0);
1494
+ let f = null;
1495
+ const w = I(() => {
1496
+ var X;
1497
+ const E = ((X = s.value) == null ? void 0 : X.email) || "";
1498
+ if (!E) return "";
1499
+ const [b, T] = E.split("@");
1500
+ return b.length <= 2 ? E : `${b.slice(0, 2)}***@${T}`;
1501
+ }), R = y(), S = y({
1502
+ userToken: "",
1503
+ password: "",
1504
+ confirmText: ""
1505
+ }), L = y(!1);
1506
+ function D(E, b) {
1507
+ E !== "注销" ? b('请输入"注销"以确认操作') : b();
1508
+ }
1509
+ async function M() {
1510
+ var E;
1511
+ if (V.value = !0, V.value = !1, !((E = s.value) != null && E.email)) {
1512
+ G.error("账号未绑定邮箱,无法进行注销验证。请先绑定邮箱");
1513
+ return;
1514
+ }
1515
+ a.value = "sendCode";
1516
+ }
1517
+ async function K() {
1518
+ var b;
1519
+ if (!((b = s.value) != null && b.email)) {
1520
+ G.error("请先绑定邮箱");
1521
+ return;
1522
+ }
1523
+ r.value = !0;
1524
+ const {
1525
+ data: E
1526
+ } = await x.verify.email.retry.post({
1527
+ email: s.value.email,
1528
+ purpose: "deleteAccount"
1529
+ });
1530
+ r.value = !1, E && (p.value = E.emailVerifyId, G.success("验证码已发送"), a.value = "confirm", _());
1531
+ }
1532
+ function _() {
1533
+ n.value = 60, f && clearInterval(f), f = setInterval(() => {
1534
+ n.value--, n.value <= 0 && f && (clearInterval(f), f = null);
1535
+ }, 1e3);
1536
+ }
1537
+ async function $() {
1538
+ var T;
1539
+ if (await ((T = R.value) == null ? void 0 : T.validate())) return;
1540
+ L.value = !0;
1541
+ const {
1542
+ error: b
1543
+ } = await x.users.deleteAccount.post({
1544
+ password: S.value.password,
1545
+ userToken: S.value.userToken,
1546
+ emailVerifyId: p.value,
1547
+ confirmText: S.value.confirmText
1548
+ });
1549
+ L.value = !1, b || (a.value = "success", g(), l(), m("deleted"));
1550
+ }
1551
+ function H() {
1552
+ window.location.href = "/";
1553
+ }
1554
+ return (E, b) => a.value === "check" ? (h(), z(e(F), {
1555
+ key: 0,
1556
+ type: "warning",
1557
+ title: "注销账号"
1558
+ }, {
1559
+ action: t(() => [o(e(A), {
1560
+ size: v.size,
1561
+ type: "primary",
1562
+ status: "danger",
1563
+ loading: V.value,
1564
+ onClick: M
1565
+ }, {
1566
+ default: t(() => [k(B(V.value ? "检查中..." : "开始注销"), 1)]),
1567
+ _: 1
1568
+ }, 8, ["size", "loading"])]),
1569
+ default: t(() => [b[6] || (b[6] = k(" 注销账号后,登录凭据、第三方绑定和当前登录态会被清除;历史订单、用量、审计等业务记录会保留用于对账和安全追溯。 ", -1))]),
1570
+ _: 1
1571
+ })) : a.value === "dependencies" ? (h(), j(J, {
1572
+ key: 1
1573
+ }, [o(e(F), {
1574
+ type: "error",
1575
+ title: "无法注销账号"
1576
+ }, {
1577
+ default: t(() => [...b[7] || (b[7] = [k(" 您的账号下还有以下资源,请先处理后再注销: ", -1)])]),
1578
+ _: 1
1579
+ }), C("div", qt, [(h(!0), j(J, null, ze(u.value, (T) => (h(), j("div", {
1580
+ key: T.type,
1581
+ class: "dependency-item"
1582
+ }, [C("span", Tt, B(T.label), 1), C("span", Bt, B(T.count) + " 个", 1)]))), 128))]), C("div", Et, [o(e(A), {
1583
+ size: v.size,
1584
+ onClick: b[0] || (b[0] = (T) => a.value = "check")
1585
+ }, {
1586
+ default: t(() => [...b[8] || (b[8] = [k("返回", -1)])]),
1587
+ _: 1
1588
+ }, 8, ["size"])])], 64)) : a.value === "sendCode" ? (h(), z(e(F), {
1589
+ key: 2,
1590
+ type: "normal",
1591
+ title: "身份验证"
1592
+ }, {
1593
+ action: t(() => [o(e(ce), null, {
1594
+ default: t(() => [o(e(A), {
1595
+ size: v.size,
1596
+ onClick: b[1] || (b[1] = (T) => a.value = "check")
1597
+ }, {
1598
+ default: t(() => [...b[9] || (b[9] = [k("取消", -1)])]),
1599
+ _: 1
1600
+ }, 8, ["size"]), o(e(A), {
1601
+ size: v.size,
1602
+ type: "primary",
1603
+ loading: r.value,
1604
+ onClick: K
1605
+ }, {
1606
+ default: t(() => [k(B(r.value ? "发送中..." : "发送验证码"), 1)]),
1607
+ _: 1
1608
+ }, 8, ["size", "loading"])]),
1609
+ _: 1
1610
+ })]),
1611
+ default: t(() => [k(" 为确保账号安全,我们将向您的邮箱 " + B(w.value) + " 发送验证码 ", 1)]),
1612
+ _: 1
1613
+ })) : a.value === "confirm" ? (h(), j(J, {
1614
+ key: 3
1615
+ }, [o(e(F), {
1616
+ type: "warning",
1617
+ title: "确认注销"
1618
+ }, {
1619
+ default: t(() => [k(" 验证码已发送至 " + B(w.value) + ",注销后该账号将无法继续登录,请谨慎操作 ", 1)]),
1620
+ _: 1
1621
+ }), o(e(Q), {
1622
+ ref_key: "formRef",
1623
+ ref: R,
1624
+ model: S.value,
1625
+ size: v.size,
1626
+ class: "confirm-form",
1627
+ layout: "vertical"
1628
+ }, {
1629
+ default: t(() => [o(e(U), {
1630
+ field: "userToken",
1631
+ label: "邮箱验证码",
1632
+ rules: [{
1633
+ required: !0,
1634
+ message: "请输入验证码"
1635
+ }]
1636
+ }, {
1637
+ default: t(() => [C("div", Rt, [o(e(N), {
1638
+ modelValue: S.value.userToken,
1639
+ "onUpdate:modelValue": b[2] || (b[2] = (T) => S.value.userToken = T),
1640
+ placeholder: "请输入6位验证码",
1641
+ "max-length": 6,
1642
+ "allow-clear": ""
1643
+ }, null, 8, ["modelValue"]), o(e(A), {
1644
+ disabled: n.value > 0,
1645
+ loading: r.value,
1646
+ onClick: K
1647
+ }, {
1648
+ default: t(() => [k(B(n.value > 0 ? `${n.value}s 后重发` : "重新发送"), 1)]),
1649
+ _: 1
1650
+ }, 8, ["disabled", "loading"])])]),
1651
+ _: 1
1652
+ }), o(e(U), {
1653
+ field: "password",
1654
+ label: "登录密码",
1655
+ rules: [{
1656
+ required: !0,
1657
+ message: "请输入密码"
1658
+ }]
1659
+ }, {
1660
+ default: t(() => [o(e($e), {
1661
+ modelValue: S.value.password,
1662
+ "onUpdate:modelValue": b[3] || (b[3] = (T) => S.value.password = T),
1663
+ placeholder: "请输入您的登录密码",
1664
+ "allow-clear": ""
1665
+ }, null, 8, ["modelValue"])]),
1666
+ _: 1
1667
+ }), o(e(U), {
1668
+ field: "confirmText",
1669
+ label: "请输入「注销」以确认",
1670
+ rules: [{
1671
+ required: !0,
1672
+ message: "请输入确认文字"
1673
+ }, {
1674
+ validator: D
1675
+ }]
1676
+ }, {
1677
+ default: t(() => [o(e(N), {
1678
+ modelValue: S.value.confirmText,
1679
+ "onUpdate:modelValue": b[4] || (b[4] = (T) => S.value.confirmText = T),
1680
+ placeholder: "注销",
1681
+ "allow-clear": ""
1682
+ }, null, 8, ["modelValue"])]),
1683
+ _: 1
1684
+ }, 8, ["rules"]), o(e(U), null, {
1685
+ default: t(() => [o(e(ce), null, {
1686
+ default: t(() => [o(e(A), {
1687
+ onClick: b[5] || (b[5] = (T) => a.value = "check")
1688
+ }, {
1689
+ default: t(() => [...b[10] || (b[10] = [k("取消", -1)])]),
1690
+ _: 1
1691
+ }), o(e(A), {
1692
+ type: "primary",
1693
+ status: "danger",
1694
+ loading: L.value,
1695
+ onClick: $
1696
+ }, {
1697
+ default: t(() => [k(B(L.value ? "注销中..." : "确认注销"), 1)]),
1698
+ _: 1
1699
+ }, 8, ["loading"])]),
1700
+ _: 1
1701
+ })]),
1702
+ _: 1
1703
+ })]),
1704
+ _: 1
1705
+ }, 8, ["model", "size"])], 64)) : a.value === "success" ? (h(), z(e(Pe), {
1706
+ key: 4,
1707
+ status: "success",
1708
+ title: "账号已注销"
1709
+ }, {
1710
+ subtitle: t(() => [...b[11] || (b[11] = [k(" 您的账号已成功注销,登录凭据和绑定身份已清除 ", -1)])]),
1711
+ extra: t(() => [o(e(A), {
1712
+ type: "primary",
1713
+ onClick: H
1714
+ }, {
1715
+ default: t(() => [...b[12] || (b[12] = [k("返回首页", -1)])]),
1716
+ _: 1
1717
+ })]),
1718
+ _: 1
1719
+ })) : P("", !0);
1720
+ }
1721
+ }), Nt = /* @__PURE__ */ W(Lt, [["__scopeId", "data-v-da2ecd73"]]), Mt = {
1722
+ class: "content"
1723
+ }, Ot = {
1724
+ class: "left"
1725
+ }, Dt = {
1726
+ class: "right"
1727
+ }, Ft = /* @__PURE__ */ O({
1728
+ __name: "AuthkitAppSetting",
1729
+ emits: ["confirm", "cancel"],
1730
+ setup(c, {
1731
+ expose: i,
1732
+ emit: v
1733
+ }) {
1734
+ const m = v;
1735
+ function s() {
1736
+ m("cancel");
1737
+ }
1738
+ function g() {
1739
+ M.value = !1, m("cancel");
1740
+ }
1741
+ const l = y("large"), a = y(["PersonalInformation"]), V = [{
1742
+ provider: "github",
1743
+ name: "GitHub",
1744
+ meta: {
1745
+ icon: "bi:github"
1746
+ }
1747
+ }, {
1748
+ provider: "google",
1749
+ name: "Google",
1750
+ meta: {
1751
+ icon: "flat-color-icons:google"
1752
+ }
1753
+ }, {
1754
+ provider: "microsoft",
1755
+ name: "Microsoft",
1756
+ meta: {
1757
+ icon: "logos:microsoft-icon"
1758
+ }
1759
+ }, {
1760
+ provider: "wechat",
1761
+ name: "微信",
1762
+ meta: {
1763
+ icon: "ri:wechat-fill"
1764
+ }
1765
+ }], {
1766
+ appsData: u,
1767
+ appsAuthPageInfoApi: r
1768
+ } = pe(), p = I(() => {
1769
+ const _ = u.value.authMethods;
1770
+ return _.signUp.email || _.login.emailPassword || _.login.emailCode;
1771
+ }), n = I(() => {
1772
+ const _ = u.value.authMethods;
1773
+ return _.signUp.phone || _.login.phonePassword || _.login.phoneCode;
1774
+ }), f = I(() => {
1775
+ const _ = u.value.authMethods;
1776
+ return _.login.emailPassword || _.login.phonePassword;
1777
+ }), w = I(() => V.filter((_) => {
1778
+ var $, H;
1779
+ return (H = ($ = u.value.oauth) == null ? void 0 : $[_.provider]) == null ? void 0 : H.enabled;
1780
+ }).map((_) => ({
1781
+ ..._,
1782
+ path: `OAuthBinding:${_.provider}`
1783
+ }))), R = I(() => {
1784
+ const _ = [];
1785
+ p.value && _.push({
1786
+ name: "邮箱",
1787
+ path: "EmailBinding",
1788
+ meta: {
1789
+ icon: "ic:baseline-email"
1790
+ }
1791
+ }), n.value && _.push({
1792
+ name: "手机号",
1793
+ path: "PhoneBinding",
1794
+ meta: {
1795
+ icon: "mingcute:phone-fill"
1796
+ }
1797
+ }), f.value && _.push({
1798
+ name: "登录密码",
1799
+ path: "SetPassword",
1800
+ meta: {
1801
+ icon: "mdi:password"
1802
+ }
1803
+ }), _.push({
1804
+ name: "注销账号",
1805
+ path: "AccountDelete",
1806
+ meta: {
1807
+ icon: "mdi:account-remove"
1808
+ }
1809
+ });
1810
+ const $ = [{
1811
+ name: "个人信息",
1812
+ path: "PersonalInformation",
1813
+ meta: {
1814
+ icon: "mingcute:user-edit-fill"
1815
+ },
1816
+ children: []
1817
+ }, {
1818
+ name: "账户管理",
1819
+ path: "AccountManage",
1820
+ meta: {
1821
+ icon: "mingcute:badge-fill"
1822
+ },
1823
+ children: _
1824
+ }];
1825
+ return w.value.length > 0 && $.push({
1826
+ name: "第三方账户",
1827
+ path: "AccountBinding",
1828
+ meta: {
1829
+ icon: "mingcute:link-fill"
1830
+ },
1831
+ children: w.value
1832
+ }), $;
1833
+ }), S = I(() => w.value.find((_) => _.path === a.value[0]));
1834
+ function L(_) {
1835
+ const $ = _.path;
1836
+ a.value = [$];
1837
+ }
1838
+ const {
1839
+ changeType: D,
1840
+ show: M
1841
+ } = Re(m);
1842
+ ne(M, (_) => {
1843
+ _ && r();
1844
+ }), ne(w, (_) => {
1845
+ a.value[0].startsWith("OAuthBinding:") && !_.some(($) => $.path === a.value[0]) && (a.value = ["PersonalInformation"]);
1846
+ }), ne(R, (_) => {
1847
+ const $ = a.value[0];
1848
+ _.some((E) => {
1849
+ var b;
1850
+ return E.path === $ || ((b = E.children) == null ? void 0 : b.some((T) => T.path === $));
1851
+ }) || (a.value = ["PersonalInformation"]);
1852
+ });
1853
+ function K(_, $) {
1854
+ M.value = $, D.value = "编辑";
1855
+ }
1856
+ return i({
1857
+ setData: K
1858
+ }), (_, $) => (h(), z(e(Se), {
1859
+ visible: e(M),
1860
+ "onUpdate:visible": $[1] || ($[1] = (H) => Ve(M) ? M.value = H : null),
1861
+ "unmount-on-close": "",
1862
+ "body-class": "AppSettingbodyClass",
1863
+ "mask-closable": !1,
1864
+ footer: !1,
1865
+ width: e(ye),
1866
+ onCancel: s
1867
+ }, {
1868
+ title: t(() => [...$[2] || ($[2] = [k(" 用户信息 ", -1)])]),
1869
+ default: t(() => [C("div", Mt, [C("div", Ot, [o(Ee, {
1870
+ "selected-keys": a.value,
1871
+ "onUpdate:selectedKeys": $[0] || ($[0] = (H) => a.value = H),
1872
+ menus: R.value,
1873
+ onChange: L
1874
+ }, null, 8, ["selected-keys", "menus"])]), C("div", Dt, [a.value[0] === "PersonalInformation" ? (h(), z(je, {
1875
+ key: 0,
1876
+ size: l.value
1877
+ }, null, 8, ["size"])) : P("", !0), a.value[0] === "EmailBinding" ? (h(), z(rt, {
1878
+ key: 1,
1879
+ size: l.value
1880
+ }, null, 8, ["size"])) : P("", !0), a.value[0] === "PhoneBinding" ? (h(), z(bt, {
1881
+ key: 2,
1882
+ size: l.value
1883
+ }, null, 8, ["size"])) : P("", !0), a.value[0] === "SetPassword" ? (h(), z(tt, {
1884
+ key: 3,
1885
+ size: l.value
1886
+ }, null, 8, ["size"])) : P("", !0), S.value ? (h(), z(xt, {
1887
+ key: 4,
1888
+ provider: S.value.provider,
1889
+ label: S.value.name,
1890
+ size: l.value
1891
+ }, null, 8, ["provider", "label", "size"])) : P("", !0), a.value[0] === "AccountDelete" ? (h(), z(Nt, {
1892
+ key: 5,
1893
+ size: l.value,
1894
+ onDeleted: g
1895
+ }, null, 8, ["size"])) : P("", !0)])])]),
1896
+ _: 1
1897
+ }, 8, ["visible", "width"]));
1898
+ }
1899
+ }), na = /* @__PURE__ */ W(Ft, [["__scopeId", "data-v-4fd771b8"]]);
1900
+ export {
1901
+ na as A,
1902
+ yt as B,
1903
+ rt as E,
1904
+ xt as O,
1905
+ et as P,
1906
+ ie as S,
1907
+ bt as _,
1908
+ nt as a,
1909
+ ue as b,
1910
+ je as c,
1911
+ ve as d,
1912
+ tt as e,
1913
+ Ct as u
1914
+ };