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