@huyooo/ui 2.0.6 → 2.0.8

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 (41) hide show
  1. package/dist/{AuthkitAppSetting-D_94iUEG.js → AuthkitAppSetting-eXw1JiyT.js} +787 -752
  2. package/dist/{Contact-CBGSJC2q.js → Contact-C5T90358.js} +2 -2
  3. package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-CnvQjQFT.js → FeedbackModal.vue_vue_type_script_setup_true_lang-B3CA1z6v.js} +2 -2
  4. package/dist/LegalDocViewer-Dxl4FngI.js +2481 -0
  5. package/dist/{PaySubscriptions-BSkcUqHk.js → PaySubscriptions-Bv6LQ_Pf.js} +1 -1
  6. package/dist/{PricingPlans-CyFvgf18.js → PricingPlans-CQaXgOIR.js} +3 -3
  7. package/dist/{ReferrerReferees-BU9IEQgz.js → ReferrerReferees-D4VEC8QJ.js} +1 -1
  8. package/dist/{Upload.vue_vue_type_script_setup_true_lang-oa6LJgCY.js → Upload.vue_vue_type_script_setup_true_lang-CgZQOZYt.js} +1 -1
  9. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-DqgwJ7r3.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BdibAudA.js} +204 -181
  10. package/dist/{WidthContainer-BIRNIRX5.js → WidthContainer-AZl-9MdF.js} +6 -6
  11. package/dist/authkit.d.ts +1 -0
  12. package/dist/authkit.js +51 -50
  13. package/dist/common/globalConfig.d.ts +0 -5
  14. package/dist/common.js +1 -1
  15. package/dist/components/Authkit/Auth/AuthkitOauthCallback.vue.d.ts +1 -3
  16. package/dist/components/UserMenu/parts/UserMenuAuthPlaceholder.vue.d.ts +7 -0
  17. package/dist/composables/Authkit/oauthCallback.d.ts +14 -0
  18. package/dist/composables/Authkit/useAuthkitUsersProfile.d.ts +2 -0
  19. package/dist/composables/Authkit/useOAuthCallbackHandler.d.ts +11 -0
  20. package/dist/composables/Authkit/useOauth.d.ts +3 -3
  21. package/dist/composables.js +8 -8
  22. package/dist/feedback.js +1 -1
  23. package/dist/{fetchAuthPageAboutUs-CP5a7jIo.js → fetchAuthPageAboutUs-DV7ArpNZ.js} +1 -1
  24. package/dist/main.js +194 -193
  25. package/dist/pay.js +3 -3
  26. package/dist/privateCom.js +1 -1
  27. package/dist/referrer.js +1 -1
  28. package/dist/{runtime-qs4IasEB.js → runtime-Dp7MgwhI.js} +115 -116
  29. package/dist/style.css +1 -1
  30. package/dist/upload.js +2 -2
  31. package/dist/{useAuthkitAuth-BPTZUSkM.js → useAuthkitAuth-cHrJMM8E.js} +48 -47
  32. package/dist/useAuthkitUsersProfile-CTd6PP-a.js +50 -0
  33. package/dist/{useEnsureAuthenticated-CncOvj2H.js → useEnsureAuthenticated-C8qS8DLL.js} +1 -1
  34. package/dist/{useLegalDocs-BZlntAI7.js → useLegalDocs-C4qk5CTb.js} +1 -1
  35. package/dist/{usePageSEO-DwhbUUjW.js → usePageSEO-Dl6_kBWP.js} +1 -1
  36. package/dist/{useRoutePermission-BrQX7NTq.js → useRoutePermission-B_g-WmDZ.js} +50 -42
  37. package/dist/{useSubscriptionCheckout-BDDCRxSs.js → useSubscriptionCheckout-CYU2Ke0y.js} +1 -1
  38. package/dist/user.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/LegalDocViewer-DeDXQX3X.js +0 -2492
  41. package/dist/useAuthkitUsersProfile-CW_exa7E.js +0 -39
@@ -0,0 +1,2481 @@
1
+ import { defineComponent as V, computed as $, openBlock as l, createElementBlock as k, normalizeStyle as G, normalizeClass as he, renderSlot as Z, createBlock as S, unref as e, createCommentVNode as I, createElementVNode as _, toDisplayString as x, ref as A, createVNode as a, withCtx as p, createTextVNode as O, watchEffect as ne, Fragment as D, renderList as re, useModel as Ce, watch as ye, mergeModels as Ue, useSlots as $e, onMounted as E, onUnmounted as ue, Teleport as Re } from "vue";
2
+ import { useRouter as be, useRoute as Te } from "vue-router";
3
+ /* empty css */
4
+ /* empty css */
5
+ import "./userMenuModal-D-nDaYqM.js";
6
+ import { Message as X, Form as H, FormItem as P, Input as C, Button as L, Link as Y, Tabs as de, TabPane as ce, Checkbox as qe, Modal as Oe, List as xe, ListItem as ie, ListItemMeta as oe, Avatar as te, Alert as fe, Spin as Le, Empty as Be } from "@arco-design/web-vue";
7
+ import { a as M, u as N } from "./useAuthkitAuth-cHrJMM8E.js";
8
+ import { g as B, u as we } from "./apiClients-Ctcq8NZs.js";
9
+ import { u as j } from "./useAuthkitAppsAuthPageInfo-DZ1p-P3Q.js";
10
+ import { o as ve, j as Me, k as ge, l as _e, u as Fe, m as De, n as Ee, p as Q, q as He, i as ke, S as W, r as K, s as Se, t as ze, v as le, w as Ge, x as Ne, b as je } from "./AuthkitAppSetting-eXw1JiyT.js";
11
+ import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
+ /* empty css */
13
+ import "./index-Cn6LcfZO.js";
14
+ /* empty css */
15
+ import { u as Ie, L as We, i as Ke } from "./useLegalDocs-C4qk5CTb.js";
16
+ import { u as pe } from "./runtime-Dp7MgwhI.js";
17
+ import { u as Ae } from "./useAuthkitUsersProfile-CTd6PP-a.js";
18
+ /* empty css */
19
+ /* empty css */
20
+ import "./CustomTable-HDwqEcmB.js";
21
+ /* empty css */
22
+ import { TiptapEditor as Je, TiptapTitle as Qe } from "@huyooo/vue-tiptap";
23
+ import { f as Xe } from "./fetchAuthPageAboutUs-DV7ArpNZ.js";
24
+ const Ye = ["title", "aria-label", "disabled"], Ze = {
25
+ key: 0,
26
+ class: "OAuthItem__spinner"
27
+ }, et = /* @__PURE__ */ V({
28
+ __name: "AuthkitOauthItem",
29
+ props: {
30
+ size: {
31
+ type: String,
32
+ required: !0
33
+ },
34
+ icon: {
35
+ type: String,
36
+ default: ""
37
+ },
38
+ label: {
39
+ type: String,
40
+ required: !0
41
+ },
42
+ loading: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: !1
49
+ }
50
+ },
51
+ setup(b) {
52
+ const r = b, u = $(() => ({
53
+ width: `${ge}px`,
54
+ height: `${ge}px`,
55
+ padding: `${Me}px`,
56
+ "--oauth-icon-size": `${ve}px`
57
+ }));
58
+ return (o, h) => (l(), k("button", {
59
+ class: he(["OAuthItem", {
60
+ "OAuthItem--loading": r.loading
61
+ }]),
62
+ type: "button",
63
+ title: r.label,
64
+ "aria-label": r.label,
65
+ disabled: r.disabled || r.loading,
66
+ style: G(u.value)
67
+ }, [r.loading ? (l(), k("span", Ze)) : Z(o.$slots, "icon", {
68
+ key: 1
69
+ }, () => [r.icon ? (l(), S(_e, {
70
+ key: 0,
71
+ icon: r.icon,
72
+ size: e(ve)
73
+ }, null, 8, ["icon", "size"])) : I("", !0)], !0)], 14, Ye));
74
+ }
75
+ }), J = /* @__PURE__ */ U(et, [["__scopeId", "data-v-e00c1d80"]]), tt = {
76
+ class: "OAuthList"
77
+ }, st = {
78
+ key: 0,
79
+ class: "OAuthDivider"
80
+ }, at = {
81
+ key: 1,
82
+ class: "OAuthHint"
83
+ }, it = /* @__PURE__ */ V({
84
+ __name: "AuthkitOauthList",
85
+ props: {
86
+ size: {
87
+ type: String,
88
+ default: () => "large"
89
+ }
90
+ },
91
+ emits: ["passkeySubmit"],
92
+ setup(b, {
93
+ emit: r
94
+ }) {
95
+ const u = r, {
96
+ appsData: o
97
+ } = j(), {
98
+ loading: h,
99
+ supported: g,
100
+ loginWithPasskey: i,
101
+ formatError: s
102
+ } = Fe(), {
103
+ githubAuth: d,
104
+ googleAuth: v,
105
+ microsoftAuth: t,
106
+ wechatAuth: f
107
+ } = ke(), {
108
+ acceptedTerms: n,
109
+ ensureTermsAcceptedForSignIn: w
110
+ } = M();
111
+ function c(R) {
112
+ w() && R({
113
+ acceptedTerms: n.value ? !0 : void 0
114
+ });
115
+ }
116
+ const m = b, y = $(() => o.value.authMethods.login.passkey && De() || ""), z = $(() => {
117
+ const R = o.value.oauth, T = R.google.enabled || R.microsoft.enabled || R.github.enabled || R.wechat.enabled, F = o.value.authMethods.login.passkey;
118
+ return T || F;
119
+ });
120
+ async function q() {
121
+ if (w())
122
+ try {
123
+ const R = await i();
124
+ if (!R)
125
+ return;
126
+ u("passkeySubmit", R);
127
+ } catch (R) {
128
+ const T = s(R);
129
+ if (R instanceof Error && R.name === "NotAllowedError") {
130
+ X.warning(T);
131
+ return;
132
+ }
133
+ X.error(T);
134
+ }
135
+ }
136
+ return (R, T) => (l(), k("div", tt, [z.value ? (l(), k("div", st, [...T[4] || (T[4] = [_("span", null, "其他登录方式", -1)])])) : I("", !0), _("div", {
137
+ class: "OAuthIcons",
138
+ style: G({
139
+ gap: `${e(Ee)}px`
140
+ })
141
+ }, [e(o).oauth.google.enabled ? (l(), S(J, {
142
+ key: 0,
143
+ icon: e(Q).google,
144
+ label: "Google",
145
+ size: m.size,
146
+ onClick: T[0] || (T[0] = (F) => c(e(v)))
147
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).oauth.github.enabled ? (l(), S(J, {
148
+ key: 1,
149
+ icon: e(Q).github,
150
+ label: "Github",
151
+ size: m.size,
152
+ onClick: T[1] || (T[1] = (F) => c(e(d)))
153
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).oauth.microsoft.enabled ? (l(), S(J, {
154
+ key: 2,
155
+ icon: e(Q).microsoft,
156
+ label: "Microsoft",
157
+ size: m.size,
158
+ onClick: T[2] || (T[2] = (F) => c(e(t)))
159
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).oauth.wechat.enabled ? (l(), S(J, {
160
+ key: 3,
161
+ icon: e(Q).wechat,
162
+ label: "微信",
163
+ size: m.size,
164
+ onClick: T[3] || (T[3] = (F) => c(e(f)))
165
+ }, null, 8, ["icon", "size"])) : I("", !0), e(o).authMethods.login.passkey ? (l(), S(J, {
166
+ key: 4,
167
+ icon: e(He),
168
+ label: "Passkey",
169
+ size: m.size,
170
+ loading: e(h),
171
+ disabled: !e(g),
172
+ onClick: q
173
+ }, null, 8, ["icon", "size", "loading", "disabled"])) : I("", !0)], 4), y.value ? (l(), k("p", at, x(y.value), 1)) : I("", !0)]));
174
+ }
175
+ }), ot = /* @__PURE__ */ U(it, [["__scopeId", "data-v-aa6a61de"]]), lt = {
176
+ class: "content"
177
+ }, nt = {
178
+ class: "sendVerifyCodeItem"
179
+ }, rt = {
180
+ class: "handle"
181
+ }, ut = /* @__PURE__ */ V({
182
+ __name: "AuthkitPasswordUpdateAndVerify",
183
+ props: {
184
+ size: {
185
+ type: String,
186
+ required: !0
187
+ },
188
+ loading: {
189
+ type: Boolean,
190
+ required: !0,
191
+ default: () => !0
192
+ }
193
+ },
194
+ emits: ["signIn", "submit"],
195
+ setup(b, {
196
+ emit: r
197
+ }) {
198
+ const u = r, o = b, h = A(), g = A(!1), i = A(), s = A({
199
+ email: void 0,
200
+ userToken: void 0,
201
+ emailVerifyId: void 0,
202
+ password: void 0,
203
+ confirmPassword: void 0
204
+ });
205
+ async function d() {
206
+ if (!await i.value.validateField(["email"])) {
207
+ g.value = !0;
208
+ const f = await B().auth.verify.email.retry.post({
209
+ email: s.value.email,
210
+ purpose: "resetPassword"
211
+ });
212
+ g.value = !1, f.data && (s.value.emailVerifyId = f.data.emailVerifyId), K(h.value, f);
213
+ }
214
+ }
215
+ async function v() {
216
+ i.value.validate().then((t) => {
217
+ t || u("submit", s.value);
218
+ });
219
+ }
220
+ return (t, f) => (l(), k("div", lt, [a(e(H), {
221
+ ref_key: "formRef",
222
+ ref: i,
223
+ model: s.value,
224
+ size: o.size,
225
+ "auto-label-width": ""
226
+ }, {
227
+ default: p(() => [a(e(P), {
228
+ field: "email",
229
+ label: "邮箱",
230
+ "hide-label": "",
231
+ rules: [{
232
+ required: !0,
233
+ message: "请输入邮箱"
234
+ }, {
235
+ type: "email",
236
+ message: "请输入有效的邮箱"
237
+ }]
238
+ }, {
239
+ default: p(() => [a(e(C), {
240
+ modelValue: s.value.email,
241
+ "onUpdate:modelValue": f[0] || (f[0] = (n) => s.value.email = n),
242
+ placeholder: "请输入邮箱"
243
+ }, null, 8, ["modelValue"])]),
244
+ _: 1
245
+ }), a(e(P), {
246
+ field: "userToken",
247
+ label: "验证码",
248
+ "hide-label": "",
249
+ rules: [{
250
+ required: !0,
251
+ message: "请输入验证码"
252
+ }]
253
+ }, {
254
+ default: p(() => [_("div", nt, [a(e(C), {
255
+ modelValue: s.value.userToken,
256
+ "onUpdate:modelValue": f[1] || (f[1] = (n) => s.value.userToken = n),
257
+ placeholder: "请输入验证码"
258
+ }, null, 8, ["modelValue"]), a(W, {
259
+ ref_key: "SendVerifyCodeRef",
260
+ ref: h,
261
+ size: o.size,
262
+ loading: g.value,
263
+ style: {
264
+ "margin-left": "10px"
265
+ },
266
+ onSend: d
267
+ }, null, 8, ["size", "loading"])])]),
268
+ _: 1
269
+ }), a(e(P), {
270
+ field: "password",
271
+ label: "密码",
272
+ "hide-label": "",
273
+ rules: [{
274
+ required: !0,
275
+ message: "密码请输入"
276
+ }, {
277
+ minLength: 10,
278
+ message: "密码不能少于10字符"
279
+ }]
280
+ }, {
281
+ default: p(() => [a(e(C), {
282
+ modelValue: s.value.password,
283
+ "onUpdate:modelValue": f[2] || (f[2] = (n) => s.value.password = n),
284
+ placeholder: "请输入密码",
285
+ type: "password",
286
+ autocomplete: ""
287
+ }, null, 8, ["modelValue"])]),
288
+ _: 1
289
+ }), a(e(P), {
290
+ field: "confirmPassword",
291
+ label: "确认密码",
292
+ "hide-label": "",
293
+ rules: [{
294
+ required: !0,
295
+ message: "请输入确认密码"
296
+ }, {
297
+ minLength: 10,
298
+ message: "确认密码不能少于10字符"
299
+ }, {
300
+ validator: (n, w) => {
301
+ n !== s.value.password ? w("两次密码输入不一致,请重新输入") : w();
302
+ }
303
+ }]
304
+ }, {
305
+ default: p(() => [a(e(C), {
306
+ modelValue: s.value.confirmPassword,
307
+ "onUpdate:modelValue": f[3] || (f[3] = (n) => s.value.confirmPassword = n),
308
+ placeholder: "请输入确认密码密码",
309
+ type: "password",
310
+ autocomplete: ""
311
+ }, null, 8, ["modelValue"])]),
312
+ _: 1
313
+ }, 8, ["rules"]), _("div", rt, [a(e(L), {
314
+ type: "primary",
315
+ loading: o.loading,
316
+ long: "",
317
+ size: o.size,
318
+ onClick: v
319
+ }, {
320
+ default: p(() => [...f[4] || (f[4] = [O(" 提交 ", -1)])]),
321
+ _: 1
322
+ }, 8, ["loading", "size"])])]),
323
+ _: 1
324
+ }, 8, ["model", "size"])]));
325
+ }
326
+ }), dt = /* @__PURE__ */ U(ut, [["__scopeId", "data-v-4091e418"]]), ct = {
327
+ class: "content"
328
+ }, pt = {
329
+ class: "sendVerifyCodeItem"
330
+ }, mt = /* @__PURE__ */ V({
331
+ __name: "AuthkitPhonePasswordUpdateAndVerify",
332
+ props: {
333
+ size: {
334
+ type: String,
335
+ required: !0
336
+ },
337
+ loading: {
338
+ type: Boolean,
339
+ required: !0,
340
+ default: () => !0
341
+ }
342
+ },
343
+ emits: ["submit"],
344
+ setup(b, {
345
+ emit: r
346
+ }) {
347
+ const u = r, o = b, h = A(), g = A(!1), i = A(), s = A({
348
+ phone: void 0,
349
+ code: void 0,
350
+ password: void 0,
351
+ confirmPassword: void 0
352
+ }), d = [{
353
+ required: !0,
354
+ message: "请输入确认密码"
355
+ }, {
356
+ minLength: 10,
357
+ message: "确认密码不能少于10字符"
358
+ }, {
359
+ validator: (f, n) => {
360
+ if (f !== s.value.password) {
361
+ n("两次密码输入不一致,请重新输入");
362
+ return;
363
+ }
364
+ n();
365
+ }
366
+ }];
367
+ async function v() {
368
+ if (!await i.value.validateField(["phone"])) {
369
+ g.value = !0;
370
+ const n = await B().auth.verify.sms.send.post({
371
+ phone: s.value.phone,
372
+ purpose: "resetPassword"
373
+ });
374
+ g.value = !1, K(h.value, n);
375
+ }
376
+ }
377
+ async function t() {
378
+ i.value.validate().then((f) => {
379
+ f || u("submit", {
380
+ method: "phone",
381
+ phone: s.value.phone,
382
+ code: s.value.code,
383
+ password: s.value.password
384
+ });
385
+ });
386
+ }
387
+ return (f, n) => (l(), k("div", ct, [a(e(H), {
388
+ ref_key: "formRef",
389
+ ref: i,
390
+ model: s.value,
391
+ size: o.size,
392
+ "auto-label-width": ""
393
+ }, {
394
+ default: p(() => [a(e(P), {
395
+ field: "phone",
396
+ label: "手机号",
397
+ "hide-label": "",
398
+ rules: [{
399
+ required: !0,
400
+ message: "请输入手机号"
401
+ }, {
402
+ match: /^1[3-9]\d{9}$/,
403
+ message: "请输入有效的手机号"
404
+ }]
405
+ }, {
406
+ default: p(() => [a(e(C), {
407
+ modelValue: s.value.phone,
408
+ "onUpdate:modelValue": n[0] || (n[0] = (w) => s.value.phone = w),
409
+ placeholder: "请输入手机号",
410
+ autocomplete: "tel",
411
+ type: "tel"
412
+ }, null, 8, ["modelValue"])]),
413
+ _: 1
414
+ }), a(e(P), {
415
+ field: "code",
416
+ label: "验证码",
417
+ "hide-label": "",
418
+ rules: [{
419
+ required: !0,
420
+ message: "请输入验证码"
421
+ }]
422
+ }, {
423
+ default: p(() => [_("div", pt, [a(e(C), {
424
+ modelValue: s.value.code,
425
+ "onUpdate:modelValue": n[1] || (n[1] = (w) => s.value.code = w),
426
+ placeholder: "请输入验证码",
427
+ autocomplete: "one-time-code"
428
+ }, null, 8, ["modelValue"]), a(W, {
429
+ ref_key: "SendVerifyCodeRef",
430
+ ref: h,
431
+ size: o.size,
432
+ loading: g.value,
433
+ style: {
434
+ "margin-left": "10px"
435
+ },
436
+ onSend: v
437
+ }, null, 8, ["size", "loading"])])]),
438
+ _: 1
439
+ }), a(e(P), {
440
+ field: "password",
441
+ label: "密码",
442
+ "hide-label": "",
443
+ rules: [{
444
+ required: !0,
445
+ message: "密码请输入"
446
+ }, {
447
+ minLength: 10,
448
+ message: "密码不能少于10字符"
449
+ }]
450
+ }, {
451
+ default: p(() => [a(e(C), {
452
+ modelValue: s.value.password,
453
+ "onUpdate:modelValue": n[2] || (n[2] = (w) => s.value.password = w),
454
+ placeholder: "请输入密码",
455
+ type: "password",
456
+ autocomplete: "new-password"
457
+ }, null, 8, ["modelValue"])]),
458
+ _: 1
459
+ }), a(e(P), {
460
+ field: "confirmPassword",
461
+ label: "确认密码",
462
+ "hide-label": "",
463
+ rules: d
464
+ }, {
465
+ default: p(() => [a(e(C), {
466
+ modelValue: s.value.confirmPassword,
467
+ "onUpdate:modelValue": n[3] || (n[3] = (w) => s.value.confirmPassword = w),
468
+ placeholder: "请输入确认密码",
469
+ type: "password",
470
+ autocomplete: "new-password"
471
+ }, null, 8, ["modelValue"])]),
472
+ _: 1
473
+ }), a(e(L), {
474
+ type: "primary",
475
+ loading: o.loading,
476
+ long: "",
477
+ size: o.size,
478
+ onClick: t
479
+ }, {
480
+ default: p(() => [...n[4] || (n[4] = [O(" 提交 ", -1)])]),
481
+ _: 1
482
+ }, 8, ["loading", "size"])]),
483
+ _: 1
484
+ }, 8, ["model", "size"])]));
485
+ }
486
+ }), ft = /* @__PURE__ */ U(mt, [["__scopeId", "data-v-a01a994e"]]), vt = {
487
+ class: "SwitchSignIn"
488
+ }, gt = /* @__PURE__ */ V({
489
+ __name: "AuthkitSwitchSignIn",
490
+ emits: ["switchSignIn"],
491
+ setup(b, {
492
+ emit: r
493
+ }) {
494
+ const u = r;
495
+ function o() {
496
+ u("switchSignIn");
497
+ }
498
+ return (h, g) => (l(), k("div", vt, [_("span", null, [g[1] || (g[1] = _("span", null, "已经有账号?", -1)), a(e(Y), {
499
+ style: {
500
+ padding: "0px"
501
+ },
502
+ onClick: o
503
+ }, {
504
+ default: p(() => [...g[0] || (g[0] = [O("去登录", -1)])]),
505
+ _: 1
506
+ })])]));
507
+ }
508
+ }), me = /* @__PURE__ */ U(gt, [["__scopeId", "data-v-c09d6c18"]]), ht = {
509
+ class: "ResetPassword"
510
+ }, yt = {
511
+ key: 0,
512
+ class: "tabsContainer"
513
+ }, bt = {
514
+ key: 3,
515
+ class: "empty"
516
+ }, wt = /* @__PURE__ */ V({
517
+ __name: "AuthkitResetPassword",
518
+ props: {
519
+ size: {
520
+ type: String,
521
+ required: !0,
522
+ default: () => "large"
523
+ },
524
+ loading: {
525
+ type: Boolean,
526
+ required: !0,
527
+ default: () => !0
528
+ }
529
+ },
530
+ emits: ["switchSignIn", "submit"],
531
+ setup(b, {
532
+ emit: r
533
+ }) {
534
+ const u = r, o = b, {
535
+ appsData: h
536
+ } = j(), g = $(() => h.value.authMethods), i = $(() => {
537
+ const t = [];
538
+ return g.value.login.emailPassword && t.push({
539
+ key: "email",
540
+ title: "邮箱找回"
541
+ }), g.value.login.phonePassword && t.push({
542
+ key: "phone",
543
+ title: "手机号找回"
544
+ }), t;
545
+ }), s = A("email");
546
+ ne(() => {
547
+ var t;
548
+ i.value.some((f) => f.key === s.value) || (s.value = ((t = i.value[0]) == null ? void 0 : t.key) || "email");
549
+ });
550
+ function d() {
551
+ u("switchSignIn");
552
+ }
553
+ async function v(t) {
554
+ u("submit", {
555
+ method: s.value,
556
+ ...t
557
+ });
558
+ }
559
+ return (t, f) => (l(), k("div", ht, [i.value.length > 1 ? (l(), k("div", yt, [a(e(de), {
560
+ "active-key": s.value,
561
+ "onUpdate:activeKey": f[0] || (f[0] = (n) => s.value = n)
562
+ }, {
563
+ default: p(() => [(l(!0), k(D, null, re(i.value, (n) => (l(), S(e(ce), {
564
+ key: n.key,
565
+ title: n.title
566
+ }, null, 8, ["title"]))), 128))]),
567
+ _: 1
568
+ }, 8, ["active-key"])])) : I("", !0), s.value === "email" && g.value.login.emailPassword ? (l(), S(dt, {
569
+ key: 1,
570
+ loading: b.loading,
571
+ size: o.size,
572
+ onSubmit: v
573
+ }, null, 8, ["loading", "size"])) : s.value === "phone" && g.value.login.phonePassword ? (l(), S(ft, {
574
+ key: 2,
575
+ loading: b.loading,
576
+ size: o.size,
577
+ onSubmit: v
578
+ }, null, 8, ["loading", "size"])) : (l(), k("div", bt, "当前应用未开放找回密码")), a(me, {
579
+ onSwitchSignIn: d
580
+ })]));
581
+ }
582
+ }), _t = /* @__PURE__ */ U(wt, [["__scopeId", "data-v-90d789bb"]]);
583
+ let se = null, ae = null;
584
+ function kt(b) {
585
+ se = b.onPrivacyPolicy ?? null, ae = b.onUserServiceAgreement ?? null;
586
+ }
587
+ function St() {
588
+ se == null || se();
589
+ }
590
+ function zt() {
591
+ ae == null || ae();
592
+ }
593
+ const It = {
594
+ key: 2
595
+ }, At = /* @__PURE__ */ V({
596
+ __name: "AuthkitServiceAgreementAndPrivacyProtection",
597
+ props: /* @__PURE__ */ Ue({
598
+ currentView: {}
599
+ }, {
600
+ acceptedTerms: {
601
+ type: Boolean,
602
+ default: !1
603
+ },
604
+ acceptedTermsModifiers: {}
605
+ }),
606
+ emits: ["update:acceptedTerms"],
607
+ setup(b) {
608
+ const {
609
+ config: r
610
+ } = pe(), u = b, o = Ce(b, "acceptedTerms"), {
611
+ getLink: h,
612
+ openLegalDoc: g
613
+ } = Ie(), {
614
+ termsShaking: i,
615
+ requiresAcceptanceForSignUp: s,
616
+ requiresAcceptanceForOAuth: d,
617
+ syncAcceptedTerms: v
618
+ } = M();
619
+ ye(o, (z) => {
620
+ v(z);
621
+ });
622
+ const t = $(() => {
623
+ const z = h("userServiceAgreement");
624
+ return z != null && z.configured ? z : void 0;
625
+ }), f = $(() => {
626
+ const z = h("privacyPolicy");
627
+ return z != null && z.configured ? z : void 0;
628
+ }), n = $(() => !!(t.value || f.value)), w = $(() => u.currentView === "signUp" ? s() : u.currentView === "signIn" ? d() : !1), c = $(() => n.value && w.value);
629
+ function m() {
630
+ if (r.legalDocsMode === "builtin") {
631
+ g("userServiceAgreement");
632
+ return;
633
+ }
634
+ zt();
635
+ }
636
+ function y() {
637
+ if (r.legalDocsMode === "builtin") {
638
+ g("privacyPolicy");
639
+ return;
640
+ }
641
+ St();
642
+ }
643
+ return (z, q) => c.value ? (l(), k("div", {
644
+ key: 0,
645
+ class: he(["ServiceAgreementAndPrivacyProtection", {
646
+ "terms-shake": e(i)
647
+ }])
648
+ }, [n.value ? (l(), k(D, {
649
+ key: 0
650
+ }, [w.value ? (l(), S(e(qe), {
651
+ key: 0,
652
+ modelValue: o.value,
653
+ "onUpdate:modelValue": q[0] || (q[0] = (R) => o.value = R),
654
+ class: "terms-checkbox"
655
+ }, {
656
+ default: p(() => [...q[1] || (q[1] = [_("span", {
657
+ class: "terms-text"
658
+ }, "我已阅读并同意", -1)])]),
659
+ _: 1
660
+ }, 8, ["modelValue"])) : I("", !0), t.value ? (l(), S(e(Y), {
661
+ key: 1,
662
+ onClick: m
663
+ }, {
664
+ default: p(() => [O(x(t.value.label), 1)]),
665
+ _: 1
666
+ })) : I("", !0), t.value && f.value ? (l(), k("span", It, "和")) : I("", !0), f.value ? (l(), S(e(Y), {
667
+ key: 3,
668
+ onClick: y
669
+ }, {
670
+ default: p(() => [O(x(f.value.label), 1)]),
671
+ _: 1
672
+ })) : I("", !0)], 64)) : I("", !0)], 2)) : I("", !0);
673
+ }
674
+ }), ee = /* @__PURE__ */ U(At, [["__scopeId", "data-v-a0c2f361"]]), Pt = {
675
+ class: "content"
676
+ }, Vt = {
677
+ class: "handle"
678
+ }, Ct = /* @__PURE__ */ V({
679
+ __name: "AuthkitPasswordAuth",
680
+ props: {
681
+ size: {
682
+ type: String,
683
+ required: !0
684
+ },
685
+ loading: {
686
+ type: Boolean,
687
+ required: !0,
688
+ default: () => !0
689
+ },
690
+ allowPhone: {
691
+ type: Boolean,
692
+ default: !1
693
+ }
694
+ },
695
+ emits: ["submit"],
696
+ setup(b, {
697
+ emit: r
698
+ }) {
699
+ const u = r, {
700
+ useTermsFormField: o
701
+ } = M(), {
702
+ showTermsField: h,
703
+ termsRules: g
704
+ } = o("signIn"), i = b, s = A(), d = A({
705
+ identifier: void 0,
706
+ password: void 0,
707
+ acceptedTerms: !1
708
+ });
709
+ async function v() {
710
+ s.value.validate().then((t) => {
711
+ t || u("submit", d.value);
712
+ });
713
+ }
714
+ return (t, f) => (l(), k("div", Pt, [a(e(H), {
715
+ ref_key: "formRef",
716
+ ref: s,
717
+ model: d.value,
718
+ size: i.size,
719
+ "auto-label-width": ""
720
+ }, {
721
+ default: p(() => [a(e(P), {
722
+ field: "identifier",
723
+ label: "邮箱或手机号",
724
+ "hide-label": "",
725
+ rules: [{
726
+ required: !0,
727
+ message: "请输入邮箱或手机号"
728
+ }]
729
+ }, {
730
+ default: p(() => [a(e(C), {
731
+ modelValue: d.value.identifier,
732
+ "onUpdate:modelValue": f[0] || (f[0] = (n) => d.value.identifier = n),
733
+ placeholder: i.allowPhone ? "请输入邮箱或手机号" : "请输入邮箱",
734
+ autocomplete: "email username"
735
+ }, null, 8, ["modelValue", "placeholder"])]),
736
+ _: 1
737
+ }), a(e(P), {
738
+ field: "password",
739
+ label: "密码",
740
+ "hide-label": "",
741
+ rules: [{
742
+ required: !0,
743
+ message: "请输入密码"
744
+ }]
745
+ }, {
746
+ default: p(() => [a(e(C), {
747
+ modelValue: d.value.password,
748
+ "onUpdate:modelValue": f[1] || (f[1] = (n) => d.value.password = n),
749
+ placeholder: "请输入密码",
750
+ type: "password",
751
+ autocomplete: "current-password"
752
+ }, null, 8, ["modelValue"])]),
753
+ _: 1
754
+ }), _("div", Vt, [a(e(L), {
755
+ type: "primary",
756
+ loading: i.loading,
757
+ long: "",
758
+ size: i.size,
759
+ onClick: v
760
+ }, {
761
+ default: p(() => [...f[3] || (f[3] = [O(" 登录 ", -1)])]),
762
+ _: 1
763
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
764
+ key: 0,
765
+ field: "acceptedTerms",
766
+ "hide-label": "",
767
+ rules: e(g)
768
+ }, {
769
+ default: p(() => [a(ee, {
770
+ "accepted-terms": d.value.acceptedTerms,
771
+ "onUpdate:acceptedTerms": f[2] || (f[2] = (n) => d.value.acceptedTerms = n),
772
+ "current-view": "signIn"
773
+ }, null, 8, ["accepted-terms"])]),
774
+ _: 1
775
+ }, 8, ["rules"])) : I("", !0)])]),
776
+ _: 1
777
+ }, 8, ["model", "size"])]));
778
+ }
779
+ }), Ut = /* @__PURE__ */ U(Ct, [["__scopeId", "data-v-cca59a39"]]), $t = {
780
+ class: "SignInPhone"
781
+ }, Rt = {
782
+ class: "content"
783
+ }, Tt = {
784
+ class: "sendVerifyCodeItem"
785
+ }, qt = {
786
+ class: "handle"
787
+ }, Ot = /* @__PURE__ */ V({
788
+ __name: "AuthkitSignInPhone",
789
+ props: {
790
+ size: {
791
+ type: String,
792
+ required: !0
793
+ },
794
+ loading: {
795
+ type: Boolean,
796
+ required: !0,
797
+ default: () => !1
798
+ }
799
+ },
800
+ emits: ["submit"],
801
+ setup(b, {
802
+ emit: r
803
+ }) {
804
+ const u = r, {
805
+ useTermsFormField: o
806
+ } = M(), {
807
+ showTermsField: h,
808
+ termsRules: g
809
+ } = o("signIn"), i = b, s = A(), d = A(!1), v = A(), t = A({
810
+ phone: void 0,
811
+ code: void 0,
812
+ acceptedTerms: !1
813
+ });
814
+ async function f() {
815
+ if (!await v.value.validateField(["phone"])) {
816
+ d.value = !0;
817
+ const c = await B().auth.verify.sms.send.post({
818
+ phone: t.value.phone,
819
+ purpose: "signIn"
820
+ });
821
+ d.value = !1, K(s.value, c);
822
+ }
823
+ }
824
+ async function n() {
825
+ v.value.validate().then((w) => {
826
+ w || u("submit", {
827
+ identifier: t.value.phone,
828
+ code: t.value.code,
829
+ method: "code"
830
+ });
831
+ });
832
+ }
833
+ return (w, c) => (l(), k("div", $t, [_("div", Rt, [a(e(H), {
834
+ ref_key: "formRef",
835
+ ref: v,
836
+ model: t.value,
837
+ size: i.size,
838
+ "auto-label-width": ""
839
+ }, {
840
+ default: p(() => [a(e(P), {
841
+ field: "phone",
842
+ label: "手机号",
843
+ "hide-label": "",
844
+ rules: [{
845
+ required: !0,
846
+ message: "请输入手机号"
847
+ }, {
848
+ match: /^1[3-9]\d{9}$/,
849
+ message: "请输入有效的手机号"
850
+ }]
851
+ }, {
852
+ default: p(() => [a(e(C), {
853
+ modelValue: t.value.phone,
854
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => t.value.phone = m),
855
+ placeholder: "请输入手机号",
856
+ autocomplete: "tel",
857
+ type: "tel"
858
+ }, null, 8, ["modelValue"])]),
859
+ _: 1
860
+ }), a(e(P), {
861
+ field: "code",
862
+ label: "验证码",
863
+ "hide-label": "",
864
+ rules: [{
865
+ required: !0,
866
+ message: "请输入验证码"
867
+ }]
868
+ }, {
869
+ default: p(() => [_("div", Tt, [a(e(C), {
870
+ modelValue: t.value.code,
871
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => t.value.code = m),
872
+ placeholder: "请输入验证码",
873
+ autocomplete: "one-time-code"
874
+ }, null, 8, ["modelValue"]), a(W, {
875
+ ref_key: "SendVerifyCodeRef",
876
+ ref: s,
877
+ size: i.size,
878
+ loading: d.value,
879
+ style: {
880
+ "margin-left": "10px"
881
+ },
882
+ onSend: f
883
+ }, null, 8, ["size", "loading"])])]),
884
+ _: 1
885
+ }), _("div", qt, [a(e(L), {
886
+ type: "primary",
887
+ loading: i.loading,
888
+ long: "",
889
+ size: i.size,
890
+ onClick: n
891
+ }, {
892
+ default: p(() => [...c[3] || (c[3] = [O(" 登录 ", -1)])]),
893
+ _: 1
894
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
895
+ key: 0,
896
+ field: "acceptedTerms",
897
+ "hide-label": "",
898
+ rules: e(g)
899
+ }, {
900
+ default: p(() => [a(ee, {
901
+ "accepted-terms": t.value.acceptedTerms,
902
+ "onUpdate:acceptedTerms": c[2] || (c[2] = (m) => t.value.acceptedTerms = m),
903
+ "current-view": "signIn"
904
+ }, null, 8, ["accepted-terms"])]),
905
+ _: 1
906
+ }, 8, ["rules"])) : I("", !0)])]),
907
+ _: 1
908
+ }, 8, ["model", "size"])])]));
909
+ }
910
+ }), xt = /* @__PURE__ */ U(Ot, [["__scopeId", "data-v-ef67e91c"]]), Lt = {
911
+ class: "SignInEmailCode"
912
+ }, Bt = {
913
+ class: "sendVerifyCodeItem"
914
+ }, Mt = {
915
+ class: "handle"
916
+ }, Ft = /* @__PURE__ */ V({
917
+ __name: "AuthkitSignInEmailCode",
918
+ props: {
919
+ size: {
920
+ type: String,
921
+ required: !0
922
+ },
923
+ loading: {
924
+ type: Boolean,
925
+ required: !0,
926
+ default: () => !1
927
+ }
928
+ },
929
+ emits: ["submit"],
930
+ setup(b, {
931
+ emit: r
932
+ }) {
933
+ const u = r, {
934
+ useTermsFormField: o
935
+ } = M(), {
936
+ showTermsField: h,
937
+ termsRules: g
938
+ } = o("signIn"), i = b, s = A(), d = A(!1), v = A(), t = A({
939
+ email: void 0,
940
+ code: void 0,
941
+ emailVerifyId: "",
942
+ acceptedTerms: !1
943
+ });
944
+ async function f() {
945
+ var c;
946
+ if (!await v.value.validateField(["email"])) {
947
+ d.value = !0;
948
+ const m = await B().auth.verify.email.retry.post({
949
+ email: t.value.email,
950
+ purpose: "signIn"
951
+ });
952
+ d.value = !1, (c = m.data) != null && c.emailVerifyId && (t.value.emailVerifyId = m.data.emailVerifyId), K(s.value, m);
953
+ }
954
+ }
955
+ async function n() {
956
+ v.value.validate().then((w) => {
957
+ w || u("submit", {
958
+ identifier: t.value.email,
959
+ code: t.value.code,
960
+ emailVerifyId: t.value.emailVerifyId,
961
+ method: "code"
962
+ });
963
+ });
964
+ }
965
+ return (w, c) => (l(), k("div", Lt, [a(e(H), {
966
+ ref_key: "formRef",
967
+ ref: v,
968
+ model: t.value,
969
+ size: i.size,
970
+ "auto-label-width": ""
971
+ }, {
972
+ default: p(() => [a(e(P), {
973
+ field: "email",
974
+ "hide-label": "",
975
+ rules: [{
976
+ required: !0,
977
+ message: "请输入邮箱"
978
+ }, {
979
+ type: "email",
980
+ message: "请输入有效的邮箱"
981
+ }]
982
+ }, {
983
+ default: p(() => [a(e(C), {
984
+ modelValue: t.value.email,
985
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => t.value.email = m),
986
+ placeholder: "请输入邮箱",
987
+ autocomplete: "email"
988
+ }, null, 8, ["modelValue"])]),
989
+ _: 1
990
+ }), a(e(P), {
991
+ field: "code",
992
+ "hide-label": "",
993
+ rules: [{
994
+ required: !0,
995
+ message: "请输入验证码"
996
+ }]
997
+ }, {
998
+ default: p(() => [_("div", Bt, [a(e(C), {
999
+ modelValue: t.value.code,
1000
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => t.value.code = m),
1001
+ placeholder: "请输入验证码",
1002
+ autocomplete: "one-time-code"
1003
+ }, null, 8, ["modelValue"]), a(W, {
1004
+ ref_key: "SendVerifyCodeRef",
1005
+ ref: s,
1006
+ size: i.size,
1007
+ loading: d.value,
1008
+ style: {
1009
+ "margin-left": "10px"
1010
+ },
1011
+ onSend: f
1012
+ }, null, 8, ["size", "loading"])])]),
1013
+ _: 1
1014
+ }), _("div", Mt, [a(e(L), {
1015
+ type: "primary",
1016
+ loading: i.loading,
1017
+ long: "",
1018
+ size: i.size,
1019
+ onClick: n
1020
+ }, {
1021
+ default: p(() => [...c[3] || (c[3] = [O(" 登录 ", -1)])]),
1022
+ _: 1
1023
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
1024
+ key: 0,
1025
+ field: "acceptedTerms",
1026
+ "hide-label": "",
1027
+ rules: e(g)
1028
+ }, {
1029
+ default: p(() => [a(ee, {
1030
+ "accepted-terms": t.value.acceptedTerms,
1031
+ "onUpdate:acceptedTerms": c[2] || (c[2] = (m) => t.value.acceptedTerms = m),
1032
+ "current-view": "signIn"
1033
+ }, null, 8, ["accepted-terms"])]),
1034
+ _: 1
1035
+ }, 8, ["rules"])) : I("", !0)])]),
1036
+ _: 1
1037
+ }, 8, ["model", "size"])]));
1038
+ }
1039
+ }), Dt = /* @__PURE__ */ U(Ft, [["__scopeId", "data-v-fee4702f"]]), Et = {
1040
+ class: "SwitchSignUpOrResetPassword"
1041
+ }, Ht = {
1042
+ key: 0
1043
+ }, Gt = /* @__PURE__ */ V({
1044
+ __name: "AuthkitSwitchSignUpOrResetPassword",
1045
+ props: {
1046
+ showSignUp: {
1047
+ type: Boolean,
1048
+ default: !0
1049
+ },
1050
+ showResetPassword: {
1051
+ type: Boolean,
1052
+ default: !0
1053
+ }
1054
+ },
1055
+ emits: ["switchSignUp", "switchResetPassword"],
1056
+ setup(b, {
1057
+ emit: r
1058
+ }) {
1059
+ const u = b, o = r;
1060
+ function h() {
1061
+ o("switchSignUp");
1062
+ }
1063
+ function g() {
1064
+ o("switchResetPassword");
1065
+ }
1066
+ return (i, s) => (l(), k("div", Et, [u.showSignUp ? (l(), k("span", Ht, [s[1] || (s[1] = _("span", null, " 还没有账户?", -1)), a(e(Y), {
1067
+ style: {
1068
+ padding: "0px"
1069
+ },
1070
+ onClick: h
1071
+ }, {
1072
+ default: p(() => [...s[0] || (s[0] = [O("去注册?", -1)])]),
1073
+ _: 1
1074
+ })])) : I("", !0), u.showResetPassword ? (l(), S(e(Y), {
1075
+ key: 1,
1076
+ style: {
1077
+ padding: "0px"
1078
+ },
1079
+ onClick: g
1080
+ }, {
1081
+ default: p(() => [...s[2] || (s[2] = [O(" 忘记密码? ", -1)])]),
1082
+ _: 1
1083
+ })) : I("", !0)]));
1084
+ }
1085
+ }), Nt = /* @__PURE__ */ U(Gt, [["__scopeId", "data-v-6ca7b1f2"]]), jt = {
1086
+ class: "SignIn"
1087
+ }, Wt = {
1088
+ key: 0,
1089
+ class: "tabsContainer"
1090
+ }, Kt = /* @__PURE__ */ V({
1091
+ __name: "AuthkitSignIn",
1092
+ props: {
1093
+ size: {
1094
+ type: String,
1095
+ required: !0
1096
+ },
1097
+ loading: {
1098
+ type: Boolean,
1099
+ required: !0,
1100
+ default: () => !0
1101
+ }
1102
+ },
1103
+ emits: ["submit", "switchSignUp", "switchResetPassword"],
1104
+ setup(b, {
1105
+ emit: r
1106
+ }) {
1107
+ const u = r, o = b, h = $e(), g = $(() => !!h.OAuth), {
1108
+ appsData: i
1109
+ } = j(), {
1110
+ signUpAuthEnabled: s
1111
+ } = M(), d = $(() => i.value.authMethods), v = $(() => s.value && (d.value.signUp.email || d.value.signUp.phone)), t = $(() => d.value.login.emailPassword || d.value.login.phonePassword), f = $(() => {
1112
+ const y = [];
1113
+ return (d.value.login.emailPassword || d.value.login.phonePassword) && y.push({
1114
+ key: "password",
1115
+ title: "密码登录"
1116
+ }), d.value.login.phoneCode && y.push({
1117
+ key: "phoneCode",
1118
+ title: "手机验证码登录"
1119
+ }), d.value.login.emailCode && y.push({
1120
+ key: "emailCode",
1121
+ title: "邮箱验证码登录"
1122
+ }), y;
1123
+ }), n = A("password");
1124
+ ne(() => {
1125
+ var y;
1126
+ f.value.some((z) => z.key === n.value) || (n.value = ((y = f.value[0]) == null ? void 0 : y.key) || "password");
1127
+ });
1128
+ function w() {
1129
+ u("switchSignUp");
1130
+ }
1131
+ function c() {
1132
+ u("switchResetPassword");
1133
+ }
1134
+ async function m(y) {
1135
+ u("submit", {
1136
+ method: n.value === "password" ? "password" : "code",
1137
+ ...y
1138
+ });
1139
+ }
1140
+ return (y, z) => (l(), k("div", jt, [f.value.length > 1 ? (l(), k("div", Wt, [a(e(de), {
1141
+ "active-key": n.value,
1142
+ "onUpdate:activeKey": z[0] || (z[0] = (q) => n.value = q)
1143
+ }, {
1144
+ default: p(() => [(l(!0), k(D, null, re(f.value, (q) => (l(), S(e(ce), {
1145
+ key: q.key,
1146
+ title: q.title
1147
+ }, null, 8, ["title"]))), 128))]),
1148
+ _: 1
1149
+ }, 8, ["active-key"])])) : I("", !0), n.value === "password" && (d.value.login.emailPassword || d.value.login.phonePassword) ? (l(), S(Ut, {
1150
+ key: 1,
1151
+ loading: o.loading,
1152
+ size: o.size,
1153
+ "allow-phone": d.value.login.phonePassword,
1154
+ onSubmit: m
1155
+ }, null, 8, ["loading", "size", "allow-phone"])) : n.value === "phoneCode" ? (l(), S(xt, {
1156
+ key: 2,
1157
+ loading: o.loading,
1158
+ size: o.size,
1159
+ onSubmit: m
1160
+ }, null, 8, ["loading", "size"])) : n.value === "emailCode" ? (l(), S(Dt, {
1161
+ key: 3,
1162
+ loading: o.loading,
1163
+ size: o.size,
1164
+ onSubmit: m
1165
+ }, null, 8, ["loading", "size"])) : I("", !0), g.value ? Z(y.$slots, "OAuth", {
1166
+ key: 4
1167
+ }, void 0, !0) : I("", !0), a(Nt, {
1168
+ "show-sign-up": v.value,
1169
+ "show-reset-password": t.value,
1170
+ onSwitchSignUp: w,
1171
+ onSwitchResetPassword: c
1172
+ }, null, 8, ["show-sign-up", "show-reset-password"])]));
1173
+ }
1174
+ }), Jt = /* @__PURE__ */ U(Kt, [["__scopeId", "data-v-a7aef80e"]]), Qt = {
1175
+ class: "content"
1176
+ }, Xt = {
1177
+ class: "sendVerifyCodeItem"
1178
+ }, Yt = {
1179
+ class: "handle"
1180
+ }, Zt = /* @__PURE__ */ V({
1181
+ __name: "AuthkitEmailUpdate",
1182
+ props: {
1183
+ size: {
1184
+ type: String,
1185
+ required: !0
1186
+ },
1187
+ loading: {
1188
+ type: Boolean,
1189
+ required: !0,
1190
+ default: () => !0
1191
+ },
1192
+ purpose: {
1193
+ type: String,
1194
+ default: "signUp"
1195
+ }
1196
+ },
1197
+ emits: ["submit"],
1198
+ setup(b, {
1199
+ emit: r
1200
+ }) {
1201
+ const u = r, {
1202
+ useTermsFormField: o
1203
+ } = M(), {
1204
+ showTermsField: h,
1205
+ termsRules: g
1206
+ } = o("signUp"), i = b, s = A(), d = A(!1), v = A(), t = A({
1207
+ email: void 0,
1208
+ userToken: void 0,
1209
+ emailVerifyId: void 0,
1210
+ password: void 0,
1211
+ confirmPassword: void 0,
1212
+ inviteCode: void 0,
1213
+ acceptedTerms: !1
1214
+ });
1215
+ E(() => {
1216
+ const w = Se();
1217
+ w && (t.value.inviteCode = w);
1218
+ });
1219
+ async function f() {
1220
+ if (!await v.value.validateField(["email"])) {
1221
+ d.value = !0;
1222
+ const c = await B().auth.verify.email.retry.post({
1223
+ email: t.value.email,
1224
+ purpose: i.purpose
1225
+ });
1226
+ d.value = !1, c.data && (t.value.emailVerifyId = c.data.emailVerifyId), K(s.value, c);
1227
+ }
1228
+ }
1229
+ async function n() {
1230
+ v.value.validate().then((w) => {
1231
+ w || u("submit", t.value);
1232
+ });
1233
+ }
1234
+ return (w, c) => (l(), k("div", Qt, [a(e(H), {
1235
+ ref_key: "formRef",
1236
+ ref: v,
1237
+ model: t.value,
1238
+ size: i.size,
1239
+ "auto-label-width": ""
1240
+ }, {
1241
+ default: p(() => [a(e(P), {
1242
+ field: "email",
1243
+ label: "邮箱",
1244
+ "hide-label": "",
1245
+ rules: [{
1246
+ required: !0,
1247
+ message: "请输入邮箱"
1248
+ }, {
1249
+ type: "email",
1250
+ message: "请输入有效的邮箱"
1251
+ }]
1252
+ }, {
1253
+ default: p(() => [a(e(C), {
1254
+ modelValue: t.value.email,
1255
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => t.value.email = m),
1256
+ placeholder: "请输入邮箱",
1257
+ autocomplete: "email username",
1258
+ type: "email"
1259
+ }, null, 8, ["modelValue"])]),
1260
+ _: 1
1261
+ }), a(e(P), {
1262
+ field: "userToken",
1263
+ label: "验证码",
1264
+ "hide-label": "",
1265
+ rules: [{
1266
+ required: !0,
1267
+ message: "请输入验证码"
1268
+ }]
1269
+ }, {
1270
+ default: p(() => [_("div", Xt, [a(e(C), {
1271
+ modelValue: t.value.userToken,
1272
+ "onUpdate:modelValue": c[1] || (c[1] = (m) => t.value.userToken = m),
1273
+ placeholder: "请输入验证码",
1274
+ autocomplete: "one-time-code"
1275
+ }, null, 8, ["modelValue"]), a(W, {
1276
+ ref_key: "SendVerifyCodeRef",
1277
+ ref: s,
1278
+ size: i.size,
1279
+ loading: d.value,
1280
+ style: {
1281
+ "margin-left": "10px"
1282
+ },
1283
+ onSend: f
1284
+ }, null, 8, ["size", "loading"])])]),
1285
+ _: 1
1286
+ }), a(e(P), {
1287
+ field: "password",
1288
+ label: "密码",
1289
+ "hide-label": "",
1290
+ rules: [{
1291
+ required: !0,
1292
+ message: "密码请输入"
1293
+ }, {
1294
+ minLength: 10,
1295
+ message: "密码不能少于10字符"
1296
+ }]
1297
+ }, {
1298
+ default: p(() => [a(e(C), {
1299
+ modelValue: t.value.password,
1300
+ "onUpdate:modelValue": c[2] || (c[2] = (m) => t.value.password = m),
1301
+ placeholder: "请输入密码",
1302
+ type: "password",
1303
+ autocomplete: "new-password"
1304
+ }, null, 8, ["modelValue"])]),
1305
+ _: 1
1306
+ }), a(e(P), {
1307
+ field: "confirmPassword",
1308
+ label: "确认密码",
1309
+ "hide-label": "",
1310
+ rules: [{
1311
+ required: !0,
1312
+ message: "请输入确认密码"
1313
+ }, {
1314
+ minLength: 10,
1315
+ message: "确认密码不能少于10字符"
1316
+ }, {
1317
+ validator: (m, y) => {
1318
+ m !== t.value.password ? y("两次密码输入不一致,请重新输入") : y();
1319
+ }
1320
+ }]
1321
+ }, {
1322
+ default: p(() => [a(e(C), {
1323
+ modelValue: t.value.confirmPassword,
1324
+ "onUpdate:modelValue": c[3] || (c[3] = (m) => t.value.confirmPassword = m),
1325
+ placeholder: "请输入确认密码密码",
1326
+ type: "password",
1327
+ autocomplete: "new-password"
1328
+ }, null, 8, ["modelValue"])]),
1329
+ _: 1
1330
+ }, 8, ["rules"]), a(e(P), {
1331
+ field: "inviteCode",
1332
+ label: "邀请码",
1333
+ "hide-label": "",
1334
+ rules: [{
1335
+ required: !1
1336
+ }]
1337
+ }, {
1338
+ default: p(() => [a(e(C), {
1339
+ modelValue: t.value.inviteCode,
1340
+ "onUpdate:modelValue": c[4] || (c[4] = (m) => t.value.inviteCode = m),
1341
+ placeholder: "邀请码(可选)",
1342
+ autocomplete: "off"
1343
+ }, null, 8, ["modelValue"])]),
1344
+ _: 1
1345
+ }), _("div", Yt, [a(e(L), {
1346
+ type: "primary",
1347
+ loading: i.loading,
1348
+ long: "",
1349
+ size: i.size,
1350
+ onClick: n
1351
+ }, {
1352
+ default: p(() => [...c[6] || (c[6] = [O(" 提交 ", -1)])]),
1353
+ _: 1
1354
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
1355
+ key: 0,
1356
+ field: "acceptedTerms",
1357
+ "hide-label": "",
1358
+ rules: e(g)
1359
+ }, {
1360
+ default: p(() => [a(ee, {
1361
+ "accepted-terms": t.value.acceptedTerms,
1362
+ "onUpdate:acceptedTerms": c[5] || (c[5] = (m) => t.value.acceptedTerms = m),
1363
+ "current-view": "signUp"
1364
+ }, null, 8, ["accepted-terms"])]),
1365
+ _: 1
1366
+ }, 8, ["rules"])) : I("", !0)])]),
1367
+ _: 1
1368
+ }, 8, ["model", "size"])]));
1369
+ }
1370
+ }), es = /* @__PURE__ */ U(Zt, [["__scopeId", "data-v-07ef9d49"]]), ts = {
1371
+ class: "SignUpPhone"
1372
+ }, ss = {
1373
+ class: "content"
1374
+ }, as = {
1375
+ class: "sendVerifyCodeItem"
1376
+ }, is = {
1377
+ class: "handle"
1378
+ }, os = /* @__PURE__ */ V({
1379
+ __name: "AuthkitSignUpPhone",
1380
+ props: {
1381
+ size: {
1382
+ type: String,
1383
+ required: !0
1384
+ },
1385
+ loading: {
1386
+ type: Boolean,
1387
+ required: !0,
1388
+ default: () => !1
1389
+ },
1390
+ /** 是否要求设置密码 */
1391
+ requirePassword: {
1392
+ type: Boolean,
1393
+ default: !1
1394
+ }
1395
+ },
1396
+ emits: ["switchSignIn", "submit"],
1397
+ setup(b, {
1398
+ emit: r
1399
+ }) {
1400
+ const u = r, {
1401
+ useTermsFormField: o
1402
+ } = M(), {
1403
+ showTermsField: h,
1404
+ termsRules: g
1405
+ } = o("signUp"), i = b, s = A(), d = A(!1), v = A(), t = A({
1406
+ phone: void 0,
1407
+ code: void 0,
1408
+ password: void 0,
1409
+ confirmPassword: void 0,
1410
+ inviteCode: void 0,
1411
+ acceptedTerms: !1
1412
+ });
1413
+ E(() => {
1414
+ const m = Se();
1415
+ m && (t.value.inviteCode = m);
1416
+ });
1417
+ const f = [{
1418
+ required: !0,
1419
+ message: "请输入确认密码"
1420
+ }, {
1421
+ validator: (m, y) => {
1422
+ t.value.password && m !== t.value.password ? y("两次密码输入不一致") : y();
1423
+ }
1424
+ }];
1425
+ function n() {
1426
+ u("switchSignIn");
1427
+ }
1428
+ async function w() {
1429
+ if (!await v.value.validateField(["phone"])) {
1430
+ d.value = !0;
1431
+ const y = await B().auth.verify.sms.send.post({
1432
+ phone: t.value.phone,
1433
+ purpose: "signUp"
1434
+ });
1435
+ d.value = !1, K(s.value, y);
1436
+ }
1437
+ }
1438
+ async function c() {
1439
+ v.value.validate().then((m) => {
1440
+ m || u("submit", {
1441
+ type: "phone",
1442
+ phone: t.value.phone,
1443
+ code: t.value.code,
1444
+ password: t.value.password,
1445
+ inviteCode: t.value.inviteCode
1446
+ });
1447
+ });
1448
+ }
1449
+ return (m, y) => (l(), k("div", ts, [_("div", ss, [a(e(H), {
1450
+ ref_key: "formRef",
1451
+ ref: v,
1452
+ model: t.value,
1453
+ size: i.size,
1454
+ "auto-label-width": ""
1455
+ }, {
1456
+ default: p(() => [a(e(P), {
1457
+ field: "phone",
1458
+ label: "手机号",
1459
+ "hide-label": "",
1460
+ rules: [{
1461
+ required: !0,
1462
+ message: "请输入手机号"
1463
+ }, {
1464
+ match: /^1[3-9]\d{9}$/,
1465
+ message: "请输入有效的手机号"
1466
+ }]
1467
+ }, {
1468
+ default: p(() => [a(e(C), {
1469
+ modelValue: t.value.phone,
1470
+ "onUpdate:modelValue": y[0] || (y[0] = (z) => t.value.phone = z),
1471
+ placeholder: "请输入手机号",
1472
+ autocomplete: "tel",
1473
+ type: "tel"
1474
+ }, null, 8, ["modelValue"])]),
1475
+ _: 1
1476
+ }), a(e(P), {
1477
+ field: "code",
1478
+ label: "验证码",
1479
+ "hide-label": "",
1480
+ rules: [{
1481
+ required: !0,
1482
+ message: "请输入验证码"
1483
+ }]
1484
+ }, {
1485
+ default: p(() => [_("div", as, [a(e(C), {
1486
+ modelValue: t.value.code,
1487
+ "onUpdate:modelValue": y[1] || (y[1] = (z) => t.value.code = z),
1488
+ placeholder: "请输入验证码",
1489
+ autocomplete: "one-time-code"
1490
+ }, null, 8, ["modelValue"]), a(W, {
1491
+ ref_key: "SendVerifyCodeRef",
1492
+ ref: s,
1493
+ size: i.size,
1494
+ loading: d.value,
1495
+ style: {
1496
+ "margin-left": "10px"
1497
+ },
1498
+ onSend: w
1499
+ }, null, 8, ["size", "loading"])])]),
1500
+ _: 1
1501
+ }), i.requirePassword ? (l(), S(e(P), {
1502
+ key: 0,
1503
+ field: "password",
1504
+ label: "密码",
1505
+ "hide-label": "",
1506
+ rules: [{
1507
+ required: i.requirePassword,
1508
+ message: "密码请输入"
1509
+ }, {
1510
+ minLength: 10,
1511
+ message: "密码不能少于10字符"
1512
+ }]
1513
+ }, {
1514
+ default: p(() => [a(e(C), {
1515
+ modelValue: t.value.password,
1516
+ "onUpdate:modelValue": y[2] || (y[2] = (z) => t.value.password = z),
1517
+ placeholder: "请输入密码(可选)",
1518
+ type: "password",
1519
+ autocomplete: "new-password"
1520
+ }, null, 8, ["modelValue"])]),
1521
+ _: 1
1522
+ }, 8, ["rules"])) : I("", !0), i.requirePassword && t.value.password ? (l(), S(e(P), {
1523
+ key: 1,
1524
+ field: "confirmPassword",
1525
+ label: "确认密码",
1526
+ "hide-label": "",
1527
+ rules: f
1528
+ }, {
1529
+ default: p(() => [a(e(C), {
1530
+ modelValue: t.value.confirmPassword,
1531
+ "onUpdate:modelValue": y[3] || (y[3] = (z) => t.value.confirmPassword = z),
1532
+ placeholder: "请输入确认密码",
1533
+ type: "password",
1534
+ autocomplete: "new-password"
1535
+ }, null, 8, ["modelValue"])]),
1536
+ _: 1
1537
+ })) : I("", !0), a(e(P), {
1538
+ field: "inviteCode",
1539
+ label: "邀请码",
1540
+ "hide-label": "",
1541
+ rules: [{
1542
+ required: !1
1543
+ }]
1544
+ }, {
1545
+ default: p(() => [a(e(C), {
1546
+ modelValue: t.value.inviteCode,
1547
+ "onUpdate:modelValue": y[4] || (y[4] = (z) => t.value.inviteCode = z),
1548
+ placeholder: "邀请码(可选)",
1549
+ autocomplete: "off"
1550
+ }, null, 8, ["modelValue"])]),
1551
+ _: 1
1552
+ }), _("div", is, [a(e(L), {
1553
+ type: "primary",
1554
+ loading: i.loading,
1555
+ long: "",
1556
+ size: i.size,
1557
+ onClick: c
1558
+ }, {
1559
+ default: p(() => [...y[6] || (y[6] = [O(" 注册 ", -1)])]),
1560
+ _: 1
1561
+ }, 8, ["loading", "size"]), e(h) ? (l(), S(e(P), {
1562
+ key: 0,
1563
+ field: "acceptedTerms",
1564
+ "hide-label": "",
1565
+ rules: e(g)
1566
+ }, {
1567
+ default: p(() => [a(ee, {
1568
+ "accepted-terms": t.value.acceptedTerms,
1569
+ "onUpdate:acceptedTerms": y[5] || (y[5] = (z) => t.value.acceptedTerms = z),
1570
+ "current-view": "signUp"
1571
+ }, null, 8, ["accepted-terms"])]),
1572
+ _: 1
1573
+ }, 8, ["rules"])) : I("", !0)])]),
1574
+ _: 1
1575
+ }, 8, ["model", "size"])]), a(me, {
1576
+ onSwitchSignIn: n
1577
+ })]));
1578
+ }
1579
+ }), ls = /* @__PURE__ */ U(os, [["__scopeId", "data-v-d0af58fd"]]), ns = {
1580
+ class: "SignUp"
1581
+ }, rs = {
1582
+ key: 0,
1583
+ class: "tabsContainer"
1584
+ }, us = {
1585
+ key: 1,
1586
+ class: "empty"
1587
+ }, ds = {
1588
+ key: 2,
1589
+ class: "empty"
1590
+ }, cs = {
1591
+ key: 2,
1592
+ class: "empty"
1593
+ }, ps = /* @__PURE__ */ V({
1594
+ __name: "AuthkitSignUp",
1595
+ props: {
1596
+ size: {
1597
+ type: String,
1598
+ required: !0
1599
+ },
1600
+ loading: {
1601
+ type: Boolean,
1602
+ required: !0,
1603
+ default: () => !0
1604
+ }
1605
+ },
1606
+ emits: ["switchSignIn", "submit"],
1607
+ setup(b, {
1608
+ emit: r
1609
+ }) {
1610
+ const u = r, o = b, {
1611
+ appsData: h
1612
+ } = j(), {
1613
+ registrationBlocked: g,
1614
+ signUpAuthEnabled: i
1615
+ } = M(), s = $(() => h.value.authMethods), d = $(() => {
1616
+ const n = [];
1617
+ return s.value.signUp.email && n.push({
1618
+ key: "email",
1619
+ title: "邮箱注册"
1620
+ }), s.value.signUp.phone && n.push({
1621
+ key: "phone",
1622
+ title: "手机号注册"
1623
+ }), n;
1624
+ }), v = A("email");
1625
+ ne(() => {
1626
+ var n;
1627
+ d.value.some((w) => w.key === v.value) || (v.value = ((n = d.value[0]) == null ? void 0 : n.key) || "email");
1628
+ });
1629
+ function t() {
1630
+ u("switchSignIn");
1631
+ }
1632
+ async function f(n) {
1633
+ u("submit", {
1634
+ type: v.value,
1635
+ ...n
1636
+ });
1637
+ }
1638
+ return (n, w) => (l(), k("div", ns, [d.value.length > 1 ? (l(), k("div", rs, [a(e(de), {
1639
+ "active-key": v.value,
1640
+ "onUpdate:activeKey": w[0] || (w[0] = (c) => v.value = c)
1641
+ }, {
1642
+ default: p(() => [(l(!0), k(D, null, re(d.value, (c) => (l(), S(e(ce), {
1643
+ key: c.key,
1644
+ title: c.title
1645
+ }, null, 8, ["title"]))), 128))]),
1646
+ _: 1
1647
+ }, 8, ["active-key"])])) : I("", !0), e(i) ? e(g) ? (l(), k("div", ds, " 管理员尚未配置用户协议或隐私政策,暂无法注册。 ")) : (l(), k(D, {
1648
+ key: 3
1649
+ }, [v.value === "email" && s.value.signUp.email ? (l(), S(es, {
1650
+ key: 0,
1651
+ size: o.size,
1652
+ loading: b.loading,
1653
+ onSubmit: f
1654
+ }, null, 8, ["size", "loading"])) : v.value === "phone" && s.value.signUp.phone ? (l(), S(ls, {
1655
+ key: 1,
1656
+ size: o.size,
1657
+ loading: b.loading,
1658
+ onSubmit: f,
1659
+ onSwitchSignIn: t
1660
+ }, null, 8, ["size", "loading"])) : (l(), k("div", cs, " 当前应用未开放用户注册 ")), v.value === "email" ? (l(), S(me, {
1661
+ key: 3,
1662
+ onSwitchSignIn: t
1663
+ })) : I("", !0)], 64)) : (l(), k("div", us, " 系统已停止用户注册 "))]));
1664
+ }
1665
+ }), ms = /* @__PURE__ */ U(ps, [["__scopeId", "data-v-b211d5ef"]]), fs = ["src"], vs = /* @__PURE__ */ V({
1666
+ __name: "AuthkitAuthTitle",
1667
+ props: {
1668
+ size: {
1669
+ type: [String, Number],
1670
+ required: !1,
1671
+ default: 30
1672
+ },
1673
+ fontSize: {
1674
+ type: Number,
1675
+ required: !1,
1676
+ default: 18
1677
+ },
1678
+ lineHeight: {
1679
+ type: Number,
1680
+ required: !1,
1681
+ default: 60
1682
+ }
1683
+ },
1684
+ setup(b) {
1685
+ const r = b, u = `${r.size}px`, o = `${r.fontSize}px`, h = `${r.lineHeight}px`, {
1686
+ currentView: g
1687
+ } = N(), {
1688
+ appsData: i
1689
+ } = j(), s = $(() => g.value === "signIn" ? `${i.value.name}登录` : g.value === "signUp" ? `${i.value.name}账号注册` : g.value === "resetPassword" ? `${i.value.name}密码重置` : "");
1690
+ return (d, v) => (l(), k("div", {
1691
+ class: "Title",
1692
+ style: G({
1693
+ fontSize: o,
1694
+ lineHeight: h
1695
+ })
1696
+ }, [e(i).applicationLogoUrl ? (l(), k("img", {
1697
+ key: 0,
1698
+ src: e(i).applicationLogoUrl,
1699
+ srcset: "",
1700
+ style: G({
1701
+ width: u
1702
+ })
1703
+ }, null, 12, fs)) : I("", !0), _("span", null, x(s.value), 1), Z(d.$slots, "default", {}, void 0, !0)], 4));
1704
+ }
1705
+ }), Pe = /* @__PURE__ */ U(vs, [["__scopeId", "data-v-8ebe7939"]]), gs = {
1706
+ class: "Auth"
1707
+ }, hs = {
1708
+ class: "body"
1709
+ }, ys = /* @__PURE__ */ V({
1710
+ __name: "AuthkitAuth",
1711
+ props: {
1712
+ size: {
1713
+ type: String,
1714
+ required: !0
1715
+ },
1716
+ showTitle: {
1717
+ type: Boolean,
1718
+ default: () => !0
1719
+ }
1720
+ },
1721
+ setup(b) {
1722
+ const r = b, {
1723
+ signInSubmit: u,
1724
+ passkeySignInSubmit: o,
1725
+ signUpSubmit: h,
1726
+ resetPasswordSubmit: g,
1727
+ currentView: i,
1728
+ authSignInLoading: s,
1729
+ authSignUpLoading: d,
1730
+ resetPasswordLoading: v,
1731
+ switchSignUp: t,
1732
+ switchResetPassword: f,
1733
+ switchSignIn: n
1734
+ } = N();
1735
+ return (w, c) => (l(), k("div", gs, [b.showTitle ? (l(), S(Pe, {
1736
+ key: 0,
1737
+ size: 32,
1738
+ "font-size": 20
1739
+ })) : I("", !0), _("div", hs, [e(i) === "signIn" ? (l(), S(Jt, {
1740
+ key: 0,
1741
+ size: r.size,
1742
+ loading: e(s),
1743
+ onSwitchSignUp: e(t),
1744
+ onSwitchResetPassword: e(f),
1745
+ onSubmit: c[0] || (c[0] = (m) => e(u)(m))
1746
+ }, {
1747
+ OAuth: p(() => [a(ot, {
1748
+ size: r.size,
1749
+ onPasskeySubmit: e(o)
1750
+ }, null, 8, ["size", "onPasskeySubmit"])]),
1751
+ _: 1
1752
+ }, 8, ["size", "loading", "onSwitchSignUp", "onSwitchResetPassword"])) : e(i) === "signUp" ? (l(), S(ms, {
1753
+ key: 1,
1754
+ size: r.size,
1755
+ loading: e(d),
1756
+ onSwitchSignIn: e(n),
1757
+ onSubmit: c[1] || (c[1] = (m) => e(h)(m))
1758
+ }, null, 8, ["size", "loading", "onSwitchSignIn"])) : e(i) === "resetPassword" ? (l(), S(_t, {
1759
+ key: 2,
1760
+ size: r.size,
1761
+ loading: e(v),
1762
+ onSwitchSignIn: e(n),
1763
+ onSubmit: c[2] || (c[2] = (m) => e(g)(m))
1764
+ }, null, 8, ["size", "loading", "onSwitchSignIn"])) : I("", !0)])]));
1765
+ }
1766
+ }), bs = /* @__PURE__ */ U(ys, [["__scopeId", "data-v-60874d88"]]), ws = /* @__PURE__ */ V({
1767
+ __name: "AuthkitAuthModal",
1768
+ props: {
1769
+ size: {
1770
+ default: "large"
1771
+ }
1772
+ },
1773
+ emits: ["close"],
1774
+ setup(b, {
1775
+ emit: r
1776
+ }) {
1777
+ const u = r, {
1778
+ onSignIn: o,
1779
+ switchSignIn: h
1780
+ } = N(), {
1781
+ close: g
1782
+ } = we();
1783
+ let i = null;
1784
+ E(() => {
1785
+ i = o(() => g());
1786
+ }), ue(() => {
1787
+ i == null || i(), i = null;
1788
+ });
1789
+ function s(v) {
1790
+ v || d();
1791
+ }
1792
+ function d() {
1793
+ h(), g(), u("close");
1794
+ }
1795
+ return (v, t) => (l(), S(e(Oe), {
1796
+ visible: !0,
1797
+ footer: !1,
1798
+ "mask-closable": !1,
1799
+ "title-align": "center",
1800
+ width: "auto",
1801
+ "modal-class": "SignInModalClass",
1802
+ "onUpdate:visible": s,
1803
+ onClose: d
1804
+ }, {
1805
+ title: p(() => [a(Pe)]),
1806
+ default: p(() => [a(bs, {
1807
+ "show-title": !1,
1808
+ size: b.size
1809
+ }, null, 8, ["size"])]),
1810
+ _: 1
1811
+ }));
1812
+ }
1813
+ }), _s = /* @__PURE__ */ U(ws, [["__scopeId", "data-v-19a4d5d0"]]);
1814
+ function Ve(b, r = {}) {
1815
+ const {
1816
+ bindIdentityRedirect: u = "",
1817
+ closePopupOnBindSuccess: o = !0,
1818
+ restoreRedirectAfterSignIn: h = !0,
1819
+ defaultRedirect: g = ""
1820
+ } = r, i = A(!1), {
1821
+ completeSignIn: s
1822
+ } = N();
1823
+ async function d() {
1824
+ if (typeof window > "u")
1825
+ return !1;
1826
+ const v = new URL(window.location.href);
1827
+ if (!ze(v))
1828
+ return !1;
1829
+ const t = v.searchParams.get("error");
1830
+ if (t)
1831
+ return window.history.replaceState({}, "", le(v)), X.error(t), !0;
1832
+ if (v.searchParams.get("bindSuccess") === "true") {
1833
+ const n = v.searchParams.get("provider");
1834
+ return window.history.replaceState({}, "", le(v)), X.success(n ? `${n} 绑定成功` : "绑定成功"), o && window.opener && setTimeout(() => window.close(), 800), !0;
1835
+ }
1836
+ const f = v.searchParams.get("token");
1837
+ if (!f)
1838
+ return !1;
1839
+ i.value = !0;
1840
+ try {
1841
+ const n = v.searchParams.get("userId"), w = v.searchParams.get("appId"), c = v.searchParams.get("needBindIdentity") === "true";
1842
+ if (window.history.replaceState({}, "", le(v)), s({
1843
+ jwtToken: f,
1844
+ userId: n,
1845
+ appId: w,
1846
+ needBindIdentity: c
1847
+ }), c && u)
1848
+ return await b.replace(u), !0;
1849
+ const y = Ge(h) || g;
1850
+ return y && await b.replace(y), !0;
1851
+ } finally {
1852
+ i.value = !1;
1853
+ }
1854
+ }
1855
+ return {
1856
+ processing: i,
1857
+ handleOAuthCallback: d
1858
+ };
1859
+ }
1860
+ const ks = {
1861
+ key: 0,
1862
+ class: "AuthkitOAuthCallbackOverlay",
1863
+ "aria-live": "polite",
1864
+ "aria-busy": "true"
1865
+ }, Ss = /* @__PURE__ */ V({
1866
+ __name: "AuthkitOAuthCallbackProvider",
1867
+ props: {
1868
+ bindIdentityRedirect: {
1869
+ default: ""
1870
+ },
1871
+ closePopupOnBindSuccess: {
1872
+ type: Boolean,
1873
+ default: !0
1874
+ },
1875
+ restoreRedirectAfterSignIn: {
1876
+ type: Boolean,
1877
+ default: !0
1878
+ }
1879
+ },
1880
+ setup(b) {
1881
+ const r = b, u = be(), {
1882
+ processing: o,
1883
+ handleOAuthCallback: h
1884
+ } = Ve(u, {
1885
+ bindIdentityRedirect: r.bindIdentityRedirect,
1886
+ closePopupOnBindSuccess: r.closePopupOnBindSuccess,
1887
+ restoreRedirectAfterSignIn: r.restoreRedirectAfterSignIn
1888
+ });
1889
+ return E(() => {
1890
+ h();
1891
+ }), (g, i) => (l(), S(Re, {
1892
+ to: "body"
1893
+ }, [e(o) ? (l(), k("div", ks, [...i[0] || (i[0] = [_("div", {
1894
+ class: "AuthkitOAuthCallbackOverlay__panel"
1895
+ }, [_("div", {
1896
+ class: "AuthkitOAuthCallbackOverlay__spinner"
1897
+ }), _("p", {
1898
+ class: "AuthkitOAuthCallbackOverlay__text"
1899
+ }, "正在登录...")], -1)])])) : I("", !0)]));
1900
+ }
1901
+ }), zs = /* @__PURE__ */ U(Ss, [["__scopeId", "data-v-7162b776"]]), va = /* @__PURE__ */ V({
1902
+ __name: "AuthkitProvider",
1903
+ props: {
1904
+ handleOAuthCallback: {
1905
+ type: Boolean,
1906
+ default: !0
1907
+ },
1908
+ restoreSession: {
1909
+ type: Boolean,
1910
+ default: !0
1911
+ },
1912
+ fetchAppInfo: {
1913
+ type: Boolean,
1914
+ default: !0
1915
+ },
1916
+ showAuthModal: {
1917
+ type: Boolean,
1918
+ default: !0
1919
+ },
1920
+ authModalSize: {
1921
+ default: "large"
1922
+ },
1923
+ bindIdentityRedirect: {
1924
+ default: ""
1925
+ },
1926
+ closePopupOnBindSuccess: {
1927
+ type: Boolean,
1928
+ default: !0
1929
+ },
1930
+ restoreRedirectAfterSignIn: {
1931
+ type: Boolean,
1932
+ default: !0
1933
+ }
1934
+ },
1935
+ emits: ["toPrivacyPolicy", "toUserServiceAgreement"],
1936
+ setup(b, {
1937
+ emit: r
1938
+ }) {
1939
+ const {
1940
+ config: u
1941
+ } = pe(), o = b, h = r, g = Te(), {
1942
+ openLegalDoc: i
1943
+ } = Ie({
1944
+ route: g
1945
+ }), {
1946
+ isOpen: s
1947
+ } = we(), {
1948
+ restoreSession: d,
1949
+ onSignIn: v,
1950
+ onSignOut: t
1951
+ } = N(), {
1952
+ fetchUserProfile: f,
1953
+ clearUserProfile: n
1954
+ } = Ae(), {
1955
+ appsAuthPageInfoApi: w
1956
+ } = j(), c = v(() => {
1957
+ f();
1958
+ }), m = t(() => {
1959
+ n();
1960
+ });
1961
+ function y() {
1962
+ if (u.legalDocsMode === "builtin") {
1963
+ i("privacyPolicy");
1964
+ return;
1965
+ }
1966
+ h("toPrivacyPolicy");
1967
+ }
1968
+ function z() {
1969
+ if (u.legalDocsMode === "builtin") {
1970
+ i("userServiceAgreement");
1971
+ return;
1972
+ }
1973
+ h("toUserServiceAgreement");
1974
+ }
1975
+ return E(async () => {
1976
+ kt({
1977
+ onPrivacyPolicy: y,
1978
+ onUserServiceAgreement: z
1979
+ }), o.fetchAppInfo && await w(), o.restoreSession && d() ? f() : n();
1980
+ }), ue(() => {
1981
+ c(), m();
1982
+ }), (q, R) => (l(), k(D, null, [Z(q.$slots, "default"), o.handleOAuthCallback ? (l(), S(zs, {
1983
+ key: 0,
1984
+ "bind-identity-redirect": o.bindIdentityRedirect,
1985
+ "close-popup-on-bind-success": o.closePopupOnBindSuccess,
1986
+ "restore-redirect-after-sign-in": o.restoreRedirectAfterSignIn
1987
+ }, null, 8, ["bind-identity-redirect", "close-popup-on-bind-success", "restore-redirect-after-sign-in"])) : I("", !0), o.showAuthModal && e(s) ? (l(), S(_s, {
1988
+ key: 1,
1989
+ size: o.authModalSize
1990
+ }, null, 8, ["size"])) : I("", !0)], 64));
1991
+ }
1992
+ }), Is = {
1993
+ class: "header"
1994
+ }, As = ["href"], Ps = {
1995
+ class: "container"
1996
+ }, Vs = /* @__PURE__ */ V({
1997
+ __name: "AuthkitAuthContainer",
1998
+ props: {
1999
+ applicationLogoUrl: {
2000
+ type: String,
2001
+ required: !0,
2002
+ default: () => ""
2003
+ },
2004
+ name: {
2005
+ type: String,
2006
+ required: !0,
2007
+ default: () => ""
2008
+ },
2009
+ description: {
2010
+ type: String,
2011
+ required: !0,
2012
+ default: () => ""
2013
+ },
2014
+ appHomePage: {
2015
+ type: String,
2016
+ required: !0,
2017
+ default: () => ""
2018
+ },
2019
+ backgroundImage: {
2020
+ type: String,
2021
+ required: !0,
2022
+ default: () => ""
2023
+ },
2024
+ backgroundColor: {
2025
+ type: String,
2026
+ required: !0,
2027
+ default: () => ""
2028
+ },
2029
+ linkColor: {
2030
+ type: String,
2031
+ default: "var(--huyooo-accent-primary)"
2032
+ },
2033
+ backgroundType: {
2034
+ type: String,
2035
+ default: "color"
2036
+ }
2037
+ },
2038
+ setup(b) {
2039
+ const r = b, u = $(() => r.backgroundType === "color" ? {
2040
+ backgroundColor: r.backgroundColor
2041
+ } : {
2042
+ backgroundImage: `url(${r.backgroundImage})`
2043
+ });
2044
+ return (o, h) => (l(), k("div", {
2045
+ class: "auth",
2046
+ style: G(u.value)
2047
+ }, [_("div", Is, [r.name ? (l(), k("a", {
2048
+ key: 0,
2049
+ href: r.appHomePage,
2050
+ target: "_self",
2051
+ class: "link",
2052
+ style: G({
2053
+ color: r.linkColor
2054
+ })
2055
+ }, " 返回主页 ", 12, As)) : I("", !0)]), _("div", Ps, [Z(o.$slots, "default", {}, void 0, !0)])], 4));
2056
+ }
2057
+ }), ga = /* @__PURE__ */ U(Vs, [["__scopeId", "data-v-0e13d3ff"]]), Cs = {
2058
+ class: "box"
2059
+ }, Us = {
2060
+ class: "title"
2061
+ }, $s = {
2062
+ class: "content"
2063
+ }, Rs = {
2064
+ class: "redirect"
2065
+ }, Ts = {
2066
+ style: {
2067
+ "font-weight": "bold",
2068
+ "font-size": "12px"
2069
+ }
2070
+ }, qs = /* @__PURE__ */ V({
2071
+ __name: "AuthkitAuthorize",
2072
+ props: {
2073
+ size: {
2074
+ type: String,
2075
+ required: !0
2076
+ },
2077
+ title: {
2078
+ type: String,
2079
+ required: !0,
2080
+ default: () => "授权登录"
2081
+ },
2082
+ logo: {
2083
+ type: String,
2084
+ required: !0,
2085
+ default: () => ""
2086
+ },
2087
+ clientId: {
2088
+ type: String,
2089
+ required: !0,
2090
+ default: () => ""
2091
+ },
2092
+ responseType: {
2093
+ type: String,
2094
+ required: !0,
2095
+ default: () => ""
2096
+ },
2097
+ scope: {
2098
+ type: String,
2099
+ required: !0,
2100
+ default: () => ""
2101
+ },
2102
+ state: {
2103
+ type: String,
2104
+ required: !0,
2105
+ default: () => ""
2106
+ },
2107
+ redirectUri: {
2108
+ type: String,
2109
+ required: !0,
2110
+ default: () => ""
2111
+ },
2112
+ userInfo: {
2113
+ type: Object,
2114
+ required: !0,
2115
+ default: () => ""
2116
+ }
2117
+ },
2118
+ setup(b) {
2119
+ const r = A(!1), u = b, o = A({
2120
+ name: "",
2121
+ homePageUrl: "",
2122
+ createAt: "",
2123
+ authorizationCallback: ""
2124
+ });
2125
+ async function h() {
2126
+ const {
2127
+ data: i,
2128
+ error: s
2129
+ } = await B().auth.apps.authPageInfo.post({});
2130
+ s || !i || (o.value = {
2131
+ name: i.name,
2132
+ homePageUrl: i.homePageUrl || "",
2133
+ createAt: "",
2134
+ authorizationCallback: i.authorizationCallback || ""
2135
+ });
2136
+ }
2137
+ h();
2138
+ async function g() {
2139
+ r.value = !0;
2140
+ const {
2141
+ data: i,
2142
+ error: s
2143
+ } = await B().auth.oauth2.authorize.post({
2144
+ client_id: u.clientId,
2145
+ response_type: u.responseType,
2146
+ scope: u.scope,
2147
+ state: u.state,
2148
+ redirect_uri: u.redirectUri
2149
+ });
2150
+ if (r.value = !1, s || !i)
2151
+ return;
2152
+ const d = i;
2153
+ window.location.href = d.authorizeUrl;
2154
+ }
2155
+ return (i, s) => (l(), k("div", Cs, [_("div", Us, x(`授权 ${o.value.name}`), 1), _("div", $s, [a(e(xe), null, {
2156
+ default: p(() => [a(e(ie), null, {
2157
+ default: p(() => {
2158
+ var d;
2159
+ return [a(e(oe), {
2160
+ title: o.value.name,
2161
+ description: `想要使用您的${(d = u.userInfo) == null ? void 0 : d.nickname}账户`
2162
+ }, {
2163
+ avatar: p(() => {
2164
+ var v;
2165
+ return [a(e(te), {
2166
+ shape: "square",
2167
+ "image-url": (v = u.userInfo) == null ? void 0 : v.avatar
2168
+ }, null, 8, ["image-url"])];
2169
+ }),
2170
+ _: 1
2171
+ }, 8, ["title", "description"])];
2172
+ }),
2173
+ _: 1
2174
+ }), a(e(ie), null, {
2175
+ default: p(() => [a(e(oe), {
2176
+ title: "公开信息",
2177
+ description: "头像、昵称"
2178
+ }, {
2179
+ avatar: p(() => [a(e(te), {
2180
+ shape: "square"
2181
+ }, {
2182
+ default: p(() => [...s[0] || (s[0] = [_("img", {
2183
+ alt: "avatar",
2184
+ src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
2185
+ }, null, -1)])]),
2186
+ _: 1
2187
+ })]),
2188
+ _: 1
2189
+ })]),
2190
+ _: 1
2191
+ }), a(e(ie), null, {
2192
+ default: p(() => [a(e(oe), {
2193
+ title: "个人用户数据",
2194
+ description: "电子邮件地址"
2195
+ }, {
2196
+ avatar: p(() => [a(e(te), {
2197
+ shape: "square"
2198
+ }, {
2199
+ default: p(() => [...s[1] || (s[1] = [_("img", {
2200
+ alt: "avatar",
2201
+ src: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
2202
+ }, null, -1)])]),
2203
+ _: 1
2204
+ })]),
2205
+ _: 1
2206
+ })]),
2207
+ _: 1
2208
+ })]),
2209
+ _: 1
2210
+ }), a(e(L), {
2211
+ type: "primary",
2212
+ size: u.size,
2213
+ loading: r.value,
2214
+ onClick: g
2215
+ }, {
2216
+ default: p(() => [...s[2] || (s[2] = [O(" 授权 ", -1)])]),
2217
+ _: 1
2218
+ }, 8, ["size", "loading"]), _("div", Rs, [s[3] || (s[3] = _("div", {
2219
+ class: "redirect-hint"
2220
+ }, "授权后将跳转至", -1)), _("div", Ts, x(o.value.authorizationCallback), 1)])])]));
2221
+ }
2222
+ }), ha = /* @__PURE__ */ U(qs, [["__scopeId", "data-v-6c1792d3"]]), Os = {
2223
+ class: "oauth-callback"
2224
+ }, xs = {
2225
+ key: 0,
2226
+ class: "callback-loading"
2227
+ }, Ls = {
2228
+ key: 1,
2229
+ class: "callback-error"
2230
+ }, Bs = {
2231
+ key: 2,
2232
+ class: "callback-success"
2233
+ }, Ms = /* @__PURE__ */ V({
2234
+ __name: "AuthkitOauthCallback",
2235
+ props: {
2236
+ defaultRedirect: {},
2237
+ loadingText: {},
2238
+ bindIdentityRedirect: {}
2239
+ },
2240
+ emits: ["success", "error", "needBindIdentity"],
2241
+ setup(b, {
2242
+ emit: r
2243
+ }) {
2244
+ const u = b, o = r, h = A("登录成功,正在跳转..."), g = A(""), {
2245
+ restoreSession: i
2246
+ } = N(), s = be(), {
2247
+ processing: d,
2248
+ handleOAuthCallback: v
2249
+ } = Ve(s, {
2250
+ bindIdentityRedirect: u.bindIdentityRedirect,
2251
+ defaultRedirect: u.defaultRedirect
2252
+ });
2253
+ async function t() {
2254
+ const n = new URL(window.location.href);
2255
+ if (!ze(n)) {
2256
+ if (i()) {
2257
+ await s.replace(u.defaultRedirect || "/");
2258
+ return;
2259
+ }
2260
+ g.value = "无效的访问";
2261
+ return;
2262
+ }
2263
+ const w = n.searchParams.get("error");
2264
+ if (w) {
2265
+ g.value = w, o("error", w), await v();
2266
+ return;
2267
+ }
2268
+ await v() || (g.value = "登录失败:未收到认证令牌", o("error", g.value));
2269
+ }
2270
+ function f() {
2271
+ s.replace(u.defaultRedirect || "/");
2272
+ }
2273
+ return E(() => {
2274
+ t();
2275
+ }), (n, w) => (l(), k("div", Os, [e(d) ? (l(), k("div", xs, [w[0] || (w[0] = _("div", {
2276
+ class: "spinner"
2277
+ }, null, -1)), _("p", null, x(u.loadingText ?? "正在登录..."), 1)])) : g.value ? (l(), k("div", Ls, [w[1] || (w[1] = _("div", {
2278
+ class: "error-icon"
2279
+ }, "✕", -1)), w[2] || (w[2] = _("h2", null, "登录失败", -1)), _("p", null, x(g.value), 1), _("button", {
2280
+ class: "retry-btn",
2281
+ type: "button",
2282
+ onClick: f
2283
+ }, "返回重试")])) : (l(), k("div", Bs, [w[3] || (w[3] = _("div", {
2284
+ class: "success-icon"
2285
+ }, "✓", -1)), _("p", null, x(h.value), 1)]))]));
2286
+ }
2287
+ }), ya = /* @__PURE__ */ U(Ms, [["__scopeId", "data-v-98babf68"]]), Fs = {
2288
+ class: "oauth-binding-account"
2289
+ }, Ds = {
2290
+ key: 1,
2291
+ class: "oauth-binding-account__icon"
2292
+ }, Es = {
2293
+ class: "oauth-binding-account__info"
2294
+ }, Hs = {
2295
+ class: "oauth-binding-account__name"
2296
+ }, Gs = /* @__PURE__ */ V({
2297
+ __name: "AuthkitGithubBinding",
2298
+ props: {
2299
+ size: {
2300
+ type: String,
2301
+ required: !0
2302
+ }
2303
+ },
2304
+ setup(b) {
2305
+ const {
2306
+ config: r
2307
+ } = pe(), {
2308
+ userProfile: u,
2309
+ fetchUserProfile: o
2310
+ } = Ae(), h = A("hidden"), g = A(!1);
2311
+ let i;
2312
+ const s = b, d = $(() => {
2313
+ var m, y, z;
2314
+ return ((y = (m = u.value) == null ? void 0 : m.github) == null ? void 0 : y.avatar_url) || ((z = u.value) == null ? void 0 : z.avatar) || "";
2315
+ }), {
2316
+ buildBindOauthRedirectUri: v
2317
+ } = ke();
2318
+ function t(m) {
2319
+ h.value = m;
2320
+ }
2321
+ async function f() {
2322
+ const m = r.appId;
2323
+ if (!m) {
2324
+ console.error("GitHub OAuth 失败: appId 未配置");
2325
+ return;
2326
+ }
2327
+ const {
2328
+ data: y,
2329
+ error: z
2330
+ } = await B().auth.oauth.github.login.get({
2331
+ appId: m,
2332
+ mode: "bind",
2333
+ redirectUri: v()
2334
+ });
2335
+ z || !y || (g.value = !0, window.open(y.redirectUri, "_blank"));
2336
+ }
2337
+ async function n() {
2338
+ const {
2339
+ error: m
2340
+ } = await B().auth.users.unbind.oauth.post({
2341
+ provider: "github"
2342
+ });
2343
+ m || (X.success("解绑成功"), h.value = "hidden", o());
2344
+ }
2345
+ function w() {
2346
+ h.value === "bind" && (h.value = "hidden", f()), h.value === "unbind" && n();
2347
+ }
2348
+ function c() {
2349
+ g.value && o();
2350
+ }
2351
+ return E(() => {
2352
+ u.value || o(), i = setInterval(c, 1e3);
2353
+ }), ue(() => {
2354
+ i && clearInterval(i);
2355
+ }), (m, y) => {
2356
+ var z, q, R;
2357
+ return l(), k(D, null, [!((z = e(u)) != null && z.github) && h.value === "hidden" ? (l(), S(e(fe), {
2358
+ key: 0,
2359
+ title: "绑定GitHub"
2360
+ }, {
2361
+ action: p(() => [a(e(L), {
2362
+ size: s.size,
2363
+ type: "primary",
2364
+ onClick: y[0] || (y[0] = (T) => t("bind"))
2365
+ }, {
2366
+ default: p(() => [...y[2] || (y[2] = [O(" 绑定GitHub ", -1)])]),
2367
+ _: 1
2368
+ }, 8, ["size"])]),
2369
+ default: p(() => [y[3] || (y[3] = O(" 您还未绑定GitHub账号,请点击绑定。 ", -1))]),
2370
+ _: 1
2371
+ })) : I("", !0), (q = e(u)) != null && q.github && h.value === "hidden" ? (l(), S(e(fe), {
2372
+ key: 1,
2373
+ title: "解绑GitHub"
2374
+ }, {
2375
+ action: p(() => [a(e(L), {
2376
+ size: s.size,
2377
+ type: "primary",
2378
+ onClick: y[1] || (y[1] = (T) => t("unbind"))
2379
+ }, {
2380
+ default: p(() => [...y[5] || (y[5] = [O(" 解绑GitHub ", -1)])]),
2381
+ _: 1
2382
+ }, 8, ["size"])]),
2383
+ default: p(() => {
2384
+ var T, F;
2385
+ return [_("div", Fs, [d.value ? (l(), S(e(te), {
2386
+ key: 0,
2387
+ class: "oauth-binding-account__avatar",
2388
+ "image-url": d.value,
2389
+ size: 42
2390
+ }, null, 8, ["image-url"])) : (l(), k("div", Ds, [a(_e, {
2391
+ icon: e(Q).github,
2392
+ size: e(Ne),
2393
+ alt: "GitHub"
2394
+ }, null, 8, ["icon", "size"])])), _("div", Es, [y[4] || (y[4] = _("div", {
2395
+ class: "oauth-binding-account__provider"
2396
+ }, "GitHub", -1)), _("div", Hs, x(((F = (T = e(u)) == null ? void 0 : T.github) == null ? void 0 : F.login) || "GitHub"), 1)])])];
2397
+ }),
2398
+ _: 1
2399
+ })) : I("", !0), h.value === "bind" || h.value === "unbind" ? (l(), S(je, {
2400
+ key: 2,
2401
+ size: s.size,
2402
+ email: (R = e(u)) == null ? void 0 : R.email,
2403
+ onNext: w
2404
+ }, null, 8, ["size", "email"])) : I("", !0)], 64);
2405
+ };
2406
+ }
2407
+ }), ba = /* @__PURE__ */ U(Gs, [["__scopeId", "data-v-1cfa8892"]]), Ns = /* @__PURE__ */ V({
2408
+ __name: "LegalDocViewer",
2409
+ props: {
2410
+ type: {},
2411
+ appId: {}
2412
+ },
2413
+ setup(b) {
2414
+ const r = b, u = $(() => We[r.type] ?? ""), o = A(!1), h = A(null);
2415
+ async function g() {
2416
+ if (!r.type || !r.appId) {
2417
+ h.value = null;
2418
+ return;
2419
+ }
2420
+ o.value = !0;
2421
+ const i = await Xe(r.appId);
2422
+ if (o.value = !1, !i) {
2423
+ h.value = null;
2424
+ return;
2425
+ }
2426
+ const s = i[r.type];
2427
+ h.value = Ke(s) ? s : null;
2428
+ }
2429
+ return ye(() => [r.type, r.appId], () => {
2430
+ g();
2431
+ }, {
2432
+ immediate: !0
2433
+ }), (i, s) => o.value ? (l(), S(e(Le), {
2434
+ key: 0,
2435
+ loading: o.value,
2436
+ class: "legal-doc-viewer-loading"
2437
+ }, null, 8, ["loading"])) : h.value ? (l(), S(e(Je), {
2438
+ key: 2,
2439
+ modelValue: h.value,
2440
+ "onUpdate:modelValue": s[1] || (s[1] = (d) => h.value = d),
2441
+ editable: !1
2442
+ }, {
2443
+ title: p(() => [a(e(Qe), {
2444
+ modelValue: u.value,
2445
+ "onUpdate:modelValue": s[0] || (s[0] = (d) => u.value = d),
2446
+ editable: !1,
2447
+ class: "legal-doc-viewer-title"
2448
+ }, null, 8, ["modelValue"])]),
2449
+ _: 1
2450
+ }, 8, ["modelValue"])) : (l(), S(e(Be), {
2451
+ key: 1,
2452
+ description: "暂无内容"
2453
+ }));
2454
+ }
2455
+ }), wa = /* @__PURE__ */ U(Ns, [["__scopeId", "data-v-fe9a3621"]]);
2456
+ export {
2457
+ bs as A,
2458
+ es as E,
2459
+ wa as L,
2460
+ J as O,
2461
+ Ut as P,
2462
+ _t as R,
2463
+ ee as S,
2464
+ va as _,
2465
+ ga as a,
2466
+ _s as b,
2467
+ Pe as c,
2468
+ ha as d,
2469
+ ba as e,
2470
+ zs as f,
2471
+ ya as g,
2472
+ ot as h,
2473
+ dt as i,
2474
+ ft as j,
2475
+ Jt as k,
2476
+ xt as l,
2477
+ ms as m,
2478
+ ls as n,
2479
+ me as o,
2480
+ Nt as p
2481
+ };