@huyooo/ui 1.0.3 → 1.0.4

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 (182) hide show
  1. package/dist/AuthkitAppSetting-BN8-xgNq.js +2674 -0
  2. package/dist/{Contact-M6iyuyNL.js → Contact-DBH8CyKp.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-r-t3H1X0.js} +87 -88
  7. package/dist/LandingPageSectionHeader-CVAqc7bx.js +137 -0
  8. package/dist/{LandingPageSectionTabs-Ce3_Rc2L.js → LandingPageSectionTabs-DhKpOj5F.js} +300 -309
  9. package/dist/LegalDocViewer-DlaLKGyX.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-DoWP5aX7.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/LandingPageContainer.vue.d.ts +2 -2
  56. package/dist/components/LandingPage/LandingPagePageContent.vue.d.ts +2 -2
  57. package/dist/components/LegalDoc/LegalDocViewer.vue.d.ts +7 -0
  58. package/dist/components/Menu.vue.d.ts +2 -1
  59. package/dist/components/MenuItem.vue.d.ts +3 -1
  60. package/dist/components/Message/MessageAppMessage.vue.d.ts +12 -2
  61. package/dist/components/Message/MessageDetails.vue.d.ts +9 -161
  62. package/dist/components/Message/MessageHandle.vue.d.ts +16 -4
  63. package/dist/components/Message/MessageList.vue.d.ts +4 -3
  64. package/dist/components/Message/MessageNotificationDetails.vue.d.ts +13 -0
  65. package/dist/components/Message/messageBody/DescriptionsMessageBody.vue.d.ts +3 -0
  66. package/dist/components/Message/messageBody/JsonMessageBodyFallback.vue.d.ts +3 -0
  67. package/dist/components/Message/messageBody/TextMessageBody.vue.d.ts +3 -0
  68. package/dist/components/Message/messageBody/descriptionRows.d.ts +14 -0
  69. package/dist/components/Message/messageBody/descriptionsMessageBody.d.ts +32 -0
  70. package/dist/components/Message/messageBody/descriptionsValueRender.d.ts +4 -0
  71. package/dist/components/Message/messageBody/messageBodyRegistry.d.ts +9 -0
  72. package/dist/components/Message/messageBody/registerBuiltinMessageBodies.d.ts +2 -0
  73. package/dist/components/Message/messageBody/types.d.ts +7 -0
  74. package/dist/components/Referrer/ReferrerRefereeCell.vue.d.ts +7 -0
  75. package/dist/components/Referrer/ReferrerReferees.vue.d.ts +1 -0
  76. package/dist/components/UserMenu/UserAccountMenu.vue.d.ts +1 -16
  77. package/dist/components/UserMenu/UserMenuItem.vue.d.ts +4 -0
  78. package/dist/components/UserMenu/UserMenuModals.vue.d.ts +18 -4
  79. package/dist/components/UserMenu/parts/UserAvatar.vue.d.ts +6 -0
  80. package/dist/components/UserMenu/parts/UserBasicInformation.vue.d.ts +7 -2
  81. package/dist/composables/Authkit/fetchAuthPageAboutUs.d.ts +3 -0
  82. package/dist/composables/Authkit/resolveRoutePermission.d.ts +2 -0
  83. package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +16 -0
  84. package/dist/composables/Authkit/useAuthkitAuth.d.ts +2 -0
  85. package/dist/composables/Authkit/useAuthkitPasskey.d.ts +10 -0
  86. package/dist/composables/Authkit/useLegalDocHostActions.d.ts +6 -0
  87. package/dist/composables/Authkit/useLegalDocs.d.ts +19 -0
  88. package/dist/composables/Authkit/useOauth.d.ts +17 -4
  89. package/dist/composables/Authkit/useRegistrationTerms.d.ts +24 -0
  90. package/dist/composables/Authkit/verifyCodeCooldown.d.ts +19 -0
  91. package/dist/composables/Billing/useBillingPlans.d.ts +0 -4
  92. package/dist/composables/Billing/useBillingStatusOptions.d.ts +2 -6
  93. package/dist/composables/Billing/useBillingSubscriptionSummary.d.ts +16 -0
  94. package/dist/composables/Billing/usePaidProductOptions.d.ts +5 -0
  95. package/dist/composables/Message/messageCenterBadgeCounts.d.ts +28 -0
  96. package/dist/composables/UserMenu/useUserMenuBadgeCounts.d.ts +9 -0
  97. package/dist/composables/useInfiniteList.d.ts +19 -0
  98. package/dist/composables/useMessageNotifications.d.ts +3 -6
  99. package/dist/composables.d.ts +4 -2
  100. package/dist/composables.js +50 -45
  101. package/dist/feedback.d.ts +1 -0
  102. package/dist/feedback.js +12 -11
  103. package/dist/fetchAuthPageAboutUs-dzTSwRsB.js +25 -0
  104. package/dist/{Clipboard-Bo7gdpR6.js → index-BkLvw1PU.js} +1 -1
  105. package/dist/landingPage.js +21 -21
  106. package/dist/legalDocs/buildBuiltinUrl.d.ts +3 -0
  107. package/dist/{utils/legalLinks.d.ts → legalDocs/constants.d.ts} +0 -10
  108. package/dist/legalDocs/index.d.ts +7 -0
  109. package/dist/legalDocs/isConfigured.d.ts +7 -0
  110. package/dist/legalDocs/open.d.ts +3 -0
  111. package/dist/legalDocs/resolveAppId.d.ts +8 -0
  112. package/dist/legalDocs/resolveTarget.d.ts +4 -0
  113. package/dist/legalDocs/types.d.ts +12 -0
  114. package/dist/main.js +320 -308
  115. package/dist/message.d.ts +3 -0
  116. package/dist/message.js +301 -21
  117. package/dist/pay.d.ts +1 -1
  118. package/dist/pay.js +14 -17
  119. package/dist/privateCom.js +1 -1
  120. package/dist/referrer.js +1 -1
  121. package/dist/style.css +1 -1
  122. package/dist/types/api/auth.generated.d.ts +1385 -328
  123. package/dist/types/api/billing.generated.d.ts +907 -76
  124. package/dist/types/api/ones.generated.d.ts +131 -2
  125. package/dist/types/api.d.ts +1 -0
  126. package/dist/types/app.d.ts +10 -0
  127. package/dist/types/user.d.ts +1 -0
  128. package/dist/upload.js +2 -2
  129. package/dist/{useAuthkitAppsAuthPageInfo-C2yKgl8t.js → useAuthkitAppsAuthPageInfo-CNudJd04.js} +18 -17
  130. package/dist/useAuthkitAuth-3m0yW6uP.js +267 -0
  131. package/dist/{useAuthkitCreateAndUpdate-oo9517Gj.js → useAuthkitCreateAndUpdate-BsINsI-E.js} +1 -1
  132. package/dist/{useAuthkitUsersProfile-BZDk21c8.js → useAuthkitUsersProfile-DJlMsftY.js} +3 -3
  133. package/dist/useBillingStatusOptions-CfHQOFNw.js +71 -0
  134. package/dist/{useEnsureAuthenticated-BuIbxqsO.js → useEnsureAuthenticated-DNkCCy_Y.js} +2 -2
  135. package/dist/useLegalDocs-DQP_Yq6B.js +106 -0
  136. package/dist/{useMessageNotifications-D85_-mDq.js → useMessageNotifications-CAphguOm.js} +21 -24
  137. package/dist/useRoutePermission-CEiya9AM.js +218 -0
  138. package/dist/useSEO-CDWxbk8B.js +221 -0
  139. package/dist/useSubscriptionCheckout-d_M_rKRa.js +368 -0
  140. package/dist/{useUploadCos-BRKRzSy3.js → useUploadCos-C8BqFPkx.js} +1 -1
  141. package/dist/user.js +1 -1
  142. package/dist/userMenuModal-D-nDaYqM.js +66 -0
  143. package/dist/utils/apiMiddlewares.d.ts +5 -5
  144. package/dist/utils/apiResponse.d.ts +11 -0
  145. package/dist/utils/authProviderIcon.d.ts +3 -0
  146. package/dist/utils/authkit.d.ts +20 -7
  147. package/dist/utils/formatPoints.d.ts +8 -0
  148. package/dist/utils/messageNotificationContent.d.ts +4 -0
  149. package/dist/utils/messageTextLink.d.ts +9 -0
  150. package/dist/utils/passkeySupport.d.ts +8 -0
  151. package/dist/utils/pointsFlowTypes.d.ts +10 -0
  152. package/dist/utils/pointsHistoryDisplay.d.ts +8 -0
  153. package/dist/utils/refundStatusDisplay.d.ts +1 -0
  154. package/dist/utils/subscriptionDisplay.d.ts +7 -0
  155. package/dist/utils/userDisplay.d.ts +41 -0
  156. package/package.json +11 -3
  157. package/dist/AuthkitAppSetting-C-0uuLSg.js +0 -1921
  158. package/dist/AuthkitGithubBinding-C5zEy9zN.js +0 -2207
  159. package/dist/CustomTable-nsxN4Ja4.js +0 -276
  160. package/dist/FeedbackModal.vue_vue_type_script_setup_true_lang-M1NQ-rx-.js +0 -1396
  161. package/dist/LandingPageFAQ-CZJXvor9.js +0 -80
  162. package/dist/LandingPageSectionHeader-D_74W4My.js +0 -69
  163. package/dist/Menu-Cy2ZPeaz.js +0 -170
  164. package/dist/MessageHandle-BG12aX0i.js +0 -924
  165. package/dist/MessageList-CrCF8mU6.js +0 -233
  166. package/dist/MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-gsjL6yAe.js +0 -142
  167. package/dist/PaySubscriptions-lWnEioX5.js +0 -1241
  168. package/dist/PricingPlans-DFcjOMWS.js +0 -404
  169. package/dist/ReferrerReferees-Cn7KaO8z.js +0 -106
  170. package/dist/UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-P0X1Exyu.js +0 -520
  171. package/dist/WidthContainer-CF3qOLWW.js +0 -688
  172. package/dist/components/Feedback/FeedbackDetails.vue.d.ts +0 -178
  173. package/dist/composables/Authkit/useLegalLinks.d.ts +0 -34
  174. package/dist/index-D3Kp6R4z.js +0 -4
  175. package/dist/useAuthkitAuth-DmS-H7M2.js +0 -175
  176. package/dist/useBillingStatusOptions-B7xLU3fs.js +0 -145
  177. package/dist/useLegalLinks-Cwr45PBT.js +0 -60
  178. package/dist/useRoutePermission-CaWtjLRA.js +0 -212
  179. package/dist/useSEO-BSMQdBR9.js +0 -158
  180. package/dist/useSubscriptionCheckout-BRk5h9aC.js +0 -365
  181. package/dist/useTableHandle-BdujaiNX.js +0 -69
  182. /package/dist/components/{Feedback/FeedbackVideoPreview.vue.d.ts → VideoPreview.vue.d.ts} +0 -0
@@ -0,0 +1,221 @@
1
+ /* empty css */
2
+ import { g as v } from "./apiClients-BcXOLuYu.js";
3
+ import { Message as y } from "@arco-design/web-vue";
4
+ import { ref as o, getCurrentInstance as L, computed as i } from "vue";
5
+ import { useHead as w, useSeoMeta as g } from "@unhead/vue";
6
+ import { useRoute as P } from "vue-router";
7
+ function M(s) {
8
+ const n = o(!1), t = o(), e = o(!1), r = o(""), d = o("");
9
+ function c(l) {
10
+ y.success(l), e.value = !1, n.value = !1, s("confirm");
11
+ }
12
+ function a() {
13
+ e.value = !1, s("cancel");
14
+ }
15
+ return {
16
+ loading: n,
17
+ formRef: t,
18
+ submitSuccess: c,
19
+ modelType: r,
20
+ changeType: d,
21
+ show: e,
22
+ handleCancel: a
23
+ };
24
+ }
25
+ function N(s) {
26
+ const n = o(s), t = o(!1), e = o(!1), r = o({
27
+ total: 0,
28
+ current: 1,
29
+ pageSize: 10,
30
+ showTotal: !0,
31
+ showPageSize: !0
32
+ }), d = o([]), c = o(), a = o(Symbol("key")), l = o(), m = o(Symbol("key")), f = o(), p = o(Symbol("key"));
33
+ function b(u) {
34
+ c.value.setData(u, !0, "edit");
35
+ }
36
+ function h(u) {
37
+ f.value.setData(u, !0, "view");
38
+ }
39
+ function S() {
40
+ c.value.setData(null, !0, "create");
41
+ }
42
+ const D = (u, I) => {
43
+ r.value.current = u, r.value.pageSize = I;
44
+ };
45
+ function T() {
46
+ a.value = Symbol("key");
47
+ }
48
+ function k() {
49
+ m.value = Symbol("key");
50
+ }
51
+ function C(u) {
52
+ l.value.setData(u, !0);
53
+ }
54
+ function O() {
55
+ p.value = Symbol("key");
56
+ }
57
+ function U(u) {
58
+ f.value.setData(u, !0);
59
+ }
60
+ function R(u) {
61
+ y.success(u), e.value = !1;
62
+ }
63
+ return {
64
+ CreateAndUpdateRef: c,
65
+ CreateAndUpdateKey: a,
66
+ OperationLogRef: l,
67
+ OperationLogKey: m,
68
+ DetailsRef: f,
69
+ DetailsKey: p,
70
+ pagination: r,
71
+ title: n,
72
+ edit: b,
73
+ create: S,
74
+ view: h,
75
+ dataSource: d,
76
+ setPage: D,
77
+ cancel: T,
78
+ OperationLogCancel: k,
79
+ openOperationLog: C,
80
+ DetailsCancel: O,
81
+ openDetails: U,
82
+ loading: t,
83
+ submitRemove: R,
84
+ removeLoading: e
85
+ };
86
+ }
87
+ function j() {
88
+ const s = o([]), n = o(!1), t = o(""), e = o("");
89
+ async function r() {
90
+ n.value = !0, t.value = "";
91
+ try {
92
+ const c = await (await fetch(`${v.onesPrefixUrl}/releases/latest`, {
93
+ method: "POST",
94
+ headers: {
95
+ "Content-Type": "application/json",
96
+ "app-id": v.appId
97
+ },
98
+ body: JSON.stringify({})
99
+ })).json();
100
+ e.value = c.version, s.value = c.downloads.map((a) => {
101
+ const l = {
102
+ id: a.id,
103
+ name: a.name,
104
+ description: a.description,
105
+ version: a.version,
106
+ updateDate: a.updateDate,
107
+ icon: "",
108
+ downloadUrl: a.downloadUrl,
109
+ platform: a.platform,
110
+ requirements: a.requirements
111
+ };
112
+ return a.arch && (l.arch = a.arch), a.badge && (l.badge = a.badge), l;
113
+ });
114
+ } catch {
115
+ t.value = "获取版本信息失败,请刷新重试";
116
+ } finally {
117
+ n.value = !1;
118
+ }
119
+ }
120
+ return {
121
+ downloads: s,
122
+ loading: n,
123
+ error: t,
124
+ version: e,
125
+ fetchDownloads: r
126
+ };
127
+ }
128
+ function q() {
129
+ function s(t) {
130
+ g({
131
+ ogSiteName: t.siteName,
132
+ ogLocale: t.locale
133
+ });
134
+ }
135
+ function n(t) {
136
+ const {
137
+ title: e,
138
+ description: r,
139
+ keywords: d,
140
+ image: c,
141
+ url: a,
142
+ type: l = "website"
143
+ } = t, m = r && r.length > 155 ? `${r.substring(0, 152)}...` : r;
144
+ w({
145
+ title: e,
146
+ link: a ? [{
147
+ rel: "canonical",
148
+ href: a
149
+ }] : []
150
+ }), g({
151
+ description: m || r,
152
+ keywords: d,
153
+ ogTitle: e,
154
+ ogDescription: m || r,
155
+ ogType: l === "product" ? void 0 : l,
156
+ // product 类型不被支持,跳过
157
+ ogUrl: a,
158
+ ogImage: c,
159
+ twitterCard: "summary_large_image",
160
+ twitterTitle: e,
161
+ twitterDescription: m || r,
162
+ twitterImage: c
163
+ });
164
+ }
165
+ return {
166
+ setGlobalSEO: s,
167
+ setPageSEO: n
168
+ };
169
+ }
170
+ function x() {
171
+ if (!L())
172
+ return;
173
+ const s = P();
174
+ if (!(s != null && s.meta))
175
+ return;
176
+ const n = () => s.meta;
177
+ w({
178
+ title: i(() => n().title || ""),
179
+ link: i(() => {
180
+ const t = n();
181
+ return t.url ? [{
182
+ rel: "canonical",
183
+ href: t.url
184
+ }] : [];
185
+ })
186
+ }), g({
187
+ description: i(() => {
188
+ const e = n().description;
189
+ if (e)
190
+ return e.length > 155 ? `${e.substring(0, 152)}...` : e;
191
+ }),
192
+ keywords: i(() => n().keywords),
193
+ ogTitle: i(() => n().title),
194
+ ogDescription: i(() => {
195
+ const e = n().description;
196
+ if (e)
197
+ return e.length > 155 ? `${e.substring(0, 152)}...` : e;
198
+ }),
199
+ ogType: i(() => {
200
+ const e = n().type || "website";
201
+ return e === "product" ? void 0 : e;
202
+ }),
203
+ ogUrl: i(() => n().url),
204
+ ogImage: i(() => n().image),
205
+ twitterCard: "summary_large_image",
206
+ twitterTitle: i(() => n().title),
207
+ twitterDescription: i(() => {
208
+ const e = n().description;
209
+ if (e)
210
+ return e.length > 155 ? `${e.substring(0, 152)}...` : e;
211
+ }),
212
+ twitterImage: i(() => n().image)
213
+ });
214
+ }
215
+ export {
216
+ j as a,
217
+ x as b,
218
+ q as c,
219
+ N as d,
220
+ M as u
221
+ };
@@ -0,0 +1,368 @@
1
+ /* empty css */
2
+ import { f as $ } from "./apiClients-BcXOLuYu.js";
3
+ import { Message as g } from "@arco-design/web-vue";
4
+ import { ref as y, computed as q } from "vue";
5
+ import { d as z } from "./useBillingStatusOptions-CfHQOFNw.js";
6
+ import { u as H } from "./useEnsureAuthenticated-DNkCCy_Y.js";
7
+ function D(e) {
8
+ var i;
9
+ const n = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
10
+ return typeof n == "number" ? n : void 0;
11
+ }
12
+ function F(e) {
13
+ const n = D(e);
14
+ return !e || n === void 0 || n <= e.unitAmount ? 0 : n - e.unitAmount;
15
+ }
16
+ function J(e) {
17
+ const n = F(e);
18
+ return n > 0 ? `优惠 ¥${h(n)}` : "";
19
+ }
20
+ function h(e) {
21
+ return e === void 0 ? 0 : Math.floor(e / 100);
22
+ }
23
+ function N(e, n = 1) {
24
+ const i = n > 1 ? `每 ${n} ` : "按";
25
+ switch (e) {
26
+ case "month":
27
+ return `${i}月订阅`;
28
+ case "year":
29
+ return `${i}年订阅`;
30
+ case "day":
31
+ return `${i}天订阅`;
32
+ case "week":
33
+ return `${i}周订阅`;
34
+ default:
35
+ return "";
36
+ }
37
+ }
38
+ function W(e) {
39
+ const n = e != null && e.intervalCount && e.intervalCount > 1 ? `${e.intervalCount} ` : "";
40
+ switch (e == null ? void 0 : e.interval) {
41
+ case "month":
42
+ return `/ ${n}月`;
43
+ case "year":
44
+ return `/ ${n}年`;
45
+ case "day":
46
+ return `/ ${n}天`;
47
+ case "week":
48
+ return `/ ${n}周`;
49
+ default:
50
+ return "";
51
+ }
52
+ }
53
+ function X(e) {
54
+ const n = (e == null ? void 0 : e.intervalCount) ?? 1;
55
+ switch (e == null ? void 0 : e.interval) {
56
+ case "month":
57
+ return `${n} 个月`;
58
+ case "year":
59
+ return `${n} 年`;
60
+ case "day":
61
+ return `${n} 天`;
62
+ case "week":
63
+ return `${n} 周`;
64
+ default:
65
+ return "";
66
+ }
67
+ }
68
+ function I(e) {
69
+ switch (e) {
70
+ case "day":
71
+ return "每天";
72
+ case "week":
73
+ return "每周";
74
+ case "month":
75
+ return "每月";
76
+ case "year":
77
+ return "每年";
78
+ case "lifetime":
79
+ return "不重置";
80
+ default:
81
+ return "";
82
+ }
83
+ }
84
+ function S(e) {
85
+ if (e.type === "quota" && e.value !== void 0) {
86
+ const n = I(e.quotaPeriod), i = n ? ` / ${n}` : "";
87
+ return `${e.name}: ${e.value === -1 ? "无限" : e.value}${i}`;
88
+ }
89
+ if (e.type === "unlimited") {
90
+ const n = I(e.quotaPeriod);
91
+ return n ? `${e.name}: 不限 / ${n}` : `${e.name}不限`;
92
+ }
93
+ return e.type === "boolean" && e.value === !1 ? `${e.name}(不支持)` : e.name;
94
+ }
95
+ function w(e) {
96
+ return e.type !== "recurring" || !e.interval ? null : {
97
+ key: `${e.interval}:${e.intervalCount ?? 1}`,
98
+ interval: e.interval,
99
+ intervalCount: e.intervalCount ?? 1
100
+ };
101
+ }
102
+ function Y(e, n) {
103
+ const i = {
104
+ day: 1,
105
+ week: 2,
106
+ month: 3,
107
+ year: 4
108
+ };
109
+ return i[e.interval] - i[n.interval] || e.intervalCount - n.intervalCount;
110
+ }
111
+ function Z(e, n) {
112
+ let i = 0;
113
+ for (const d of e)
114
+ for (const m of d.prices) {
115
+ const s = w(m);
116
+ (s == null ? void 0 : s.key) === n && (i = Math.max(i, F(m)));
117
+ }
118
+ return i > 0 ? `最高优惠 ¥${h(i)}` : void 0;
119
+ }
120
+ function ee(e) {
121
+ return e.includes(":") ? e : `${e}:1`;
122
+ }
123
+ function B() {
124
+ return !!localStorage.getItem("jwtToken");
125
+ }
126
+ function le(e = "month") {
127
+ const n = y([]), i = y(null), d = y(null), m = y(!1), s = y(!1), a = y(ee(e)), l = q(() => {
128
+ const t = /* @__PURE__ */ new Map();
129
+ for (const r of n.value)
130
+ for (const u of r.prices) {
131
+ const c = w(u);
132
+ c && t.set(c.key, c);
133
+ }
134
+ return [...t.values()].sort(Y).map((r) => ({
135
+ value: r.key,
136
+ label: N(r.interval, r.intervalCount),
137
+ badge: Z(n.value, r.key)
138
+ }));
139
+ }), P = q(() => {
140
+ const t = [];
141
+ for (const r of n.value) {
142
+ const u = r.prices.find((o) => {
143
+ const b = w(o);
144
+ return (b == null ? void 0 : b.key) === a.value;
145
+ }), c = r.prices.find((o) => o.type === "free"), f = u ?? (c && r.prices.every((o) => o.type === "free") ? c : void 0);
146
+ f && t.push({
147
+ ...r,
148
+ features: f.features ?? [],
149
+ selectedPrice: f
150
+ });
151
+ }
152
+ return t;
153
+ });
154
+ function x(t) {
155
+ a.value = t;
156
+ }
157
+ function p(t) {
158
+ const r = i.value, u = d.value;
159
+ return r != null && r.priceId && t.selectedPrice ? r.priceId === t.selectedPrice.id : r ? r.productId === t.id : u != null && u.priceId && t.selectedPrice ? u.priceId === t.selectedPrice.id : u ? u.productId === t.id : !1;
160
+ }
161
+ function A(t) {
162
+ var r;
163
+ return ((r = i.value) == null ? void 0 : r.productId) === t.id;
164
+ }
165
+ function v(t) {
166
+ var r;
167
+ return ((r = t.selectedPrice) == null ? void 0 : r.type) === "free";
168
+ }
169
+ function U() {
170
+ return !!i.value;
171
+ }
172
+ function M(t) {
173
+ return !!(!t.selectedPrice || p(t) || v(t) && U());
174
+ }
175
+ function C(t) {
176
+ var r;
177
+ return ((r = t.metadata) == null ? void 0 : r.recommended) === !0;
178
+ }
179
+ function G(t) {
180
+ var r;
181
+ return h((r = t.selectedPrice) == null ? void 0 : r.unitAmount);
182
+ }
183
+ function O(t) {
184
+ const r = D(t.selectedPrice);
185
+ return r === void 0 ? void 0 : h(r);
186
+ }
187
+ function T(t) {
188
+ return v(t) ? "" : W(t.selectedPrice);
189
+ }
190
+ function j(t) {
191
+ if (v(t)) {
192
+ const r = X(t.selectedPrice);
193
+ return r ? `${r}免费体验` : "免费体验";
194
+ }
195
+ return J(t.selectedPrice);
196
+ }
197
+ function E(t) {
198
+ const r = [];
199
+ return p(t) ? r.push({
200
+ label: "当前方案",
201
+ type: "current"
202
+ }) : v(t) ? r.push({
203
+ label: "免费体验",
204
+ type: "trial"
205
+ }) : C(t) && r.push({
206
+ label: "最受欢迎",
207
+ type: "recommended"
208
+ }), r;
209
+ }
210
+ function R(t) {
211
+ const r = i.value;
212
+ return p(t) ? "当前方案" : v(t) ? r ? "已订阅付费方案" : B() ? "免费开通" : "免费注册" : r ? A(t) ? "切换周期" : typeof r.unitAmount == "number" && t.selectedPrice.unitAmount > r.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
213
+ }
214
+ function K(t, r) {
215
+ const u = t.features.find((c) => c.type === "quota" && c.value !== void 0);
216
+ if (u) {
217
+ const c = I(u.quotaPeriod), f = u.value === -1 ? "不限量" : u.value;
218
+ return `${u.name} ${c ? `${f} / ${c}` : f},覆盖核心使用场景。`;
219
+ }
220
+ return v(t) ? "注册后自动开通免费权益,适合先体验核心能力。" : r === 1 ? "为正式团队准备的高配能力组合。" : "包含入门所需的核心能力。";
221
+ }
222
+ function Q(t) {
223
+ return t.filter((r) => r.highlight !== !1).map((r) => ({
224
+ title: S(r),
225
+ description: r.description || ""
226
+ }));
227
+ }
228
+ function V(t) {
229
+ const r = t.filter((o) => o.highlight !== !1), u = r.filter((o) => o.type === "quota" || o.type === "unlimited").map((o) => ({
230
+ title: S(o),
231
+ description: o.description || ""
232
+ })), c = r.filter((o) => o.type === "boolean" && o.value !== !1).map((o) => ({
233
+ title: o.name,
234
+ description: o.description || ""
235
+ })), f = [];
236
+ return c.length && f.push({
237
+ title: "功能特性",
238
+ items: c
239
+ }), u.length && f.push({
240
+ title: "用量配额",
241
+ items: u
242
+ }), f;
243
+ }
244
+ async function k() {
245
+ m.value = !0;
246
+ try {
247
+ const t = await z.productOptions();
248
+ n.value = Array.isArray(t) ? t : [], !l.value.some((u) => u.value === a.value) && l.value[0] && (a.value = l.value[0].value);
249
+ } catch (t) {
250
+ n.value = [], g.error(t instanceof Error ? t.message : "加载定价方案失败");
251
+ } finally {
252
+ m.value = !1;
253
+ }
254
+ }
255
+ async function L() {
256
+ if (!B()) {
257
+ i.value = null, d.value = null;
258
+ return;
259
+ }
260
+ s.value = !0;
261
+ try {
262
+ const {
263
+ data: t,
264
+ error: r
265
+ } = await $.subscriptions.summary.post();
266
+ if (r)
267
+ return;
268
+ i.value = (t == null ? void 0 : t.current) ?? null, d.value = (t == null ? void 0 : t.trial) ?? null;
269
+ } catch (t) {
270
+ g.error(t instanceof Error ? t.message : "加载当前订阅失败");
271
+ } finally {
272
+ s.value = !1;
273
+ }
274
+ }
275
+ async function _() {
276
+ await Promise.all([k(), L()]);
277
+ }
278
+ return {
279
+ products: n,
280
+ plans: P,
281
+ currentSubscription: i,
282
+ currentTrial: d,
283
+ listLoading: m,
284
+ currentLoading: s,
285
+ billingInterval: a,
286
+ billingIntervalTabs: l,
287
+ setBillingInterval: x,
288
+ isCurrentPlan: p,
289
+ isSameProduct: A,
290
+ isRecommendedPlan: C,
291
+ isFreePlan: v,
292
+ isPlanActionDisabled: M,
293
+ getDisplayPrice: G,
294
+ getDisplayOriginalPrice: O,
295
+ getDisplayCycle: T,
296
+ getPromotionLabel: j,
297
+ getBadgeLabels: E,
298
+ getButtonLabel: R,
299
+ getPlanSummary: K,
300
+ getFeatureItems: Q,
301
+ getFeatureGroups: V,
302
+ loadProducts: k,
303
+ loadCurrentSubscription: L,
304
+ refresh: _
305
+ };
306
+ }
307
+ function te(e) {
308
+ window.open(e, "_blank", "noopener,noreferrer");
309
+ }
310
+ function re(e) {
311
+ return e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "";
312
+ }
313
+ function ne(e) {
314
+ return e && typeof e == "object" && "alipayUrl" in e && typeof e.alipayUrl == "string" ? e.alipayUrl : "";
315
+ }
316
+ function fe(e) {
317
+ const n = y(null), {
318
+ ensureAuthenticated: i
319
+ } = H();
320
+ async function d(s) {
321
+ if (!s.selectedPrice) {
322
+ g.warning("当前方案暂无可购买价格");
323
+ return;
324
+ }
325
+ if (!i(() => d(s))) return;
326
+ const a = e.currentSubscription.value;
327
+ if ((a == null ? void 0 : a.priceId) === s.selectedPrice.id) {
328
+ g.info("当前已经是该方案");
329
+ return;
330
+ }
331
+ n.value = s.id;
332
+ try {
333
+ if (s.selectedPrice.type === "free")
334
+ return;
335
+ const l = a ? await $.subscriptions.change.post({
336
+ subscriptionId: a.id,
337
+ newPriceId: s.selectedPrice.id,
338
+ proration: !0
339
+ }) : await $.subscriptions.create.post({
340
+ priceId: s.selectedPrice.id
341
+ });
342
+ if (l.error)
343
+ return;
344
+ const P = ne(l.data);
345
+ if (P) {
346
+ te(P);
347
+ return;
348
+ }
349
+ g.success(re(l.data) || "订阅已更新"), await e.refreshCurrentSubscription();
350
+ } catch (l) {
351
+ console.error("订阅操作失败", l), g.error("订阅操作失败,请稍后重试");
352
+ } finally {
353
+ n.value = null;
354
+ }
355
+ }
356
+ function m(s) {
357
+ return n.value === s.id;
358
+ }
359
+ return {
360
+ checkoutPlanId: n,
361
+ checkout: d,
362
+ isCheckingOut: m
363
+ };
364
+ }
365
+ export {
366
+ fe as a,
367
+ le as u
368
+ };
@@ -1,5 +1,5 @@
1
1
  import { c as Ft, g as Ut } from "./_commonjsHelpers-DaMA6jEr.js";
2
- import { o as mt } from "./apiClients-DrGX2iJy.js";
2
+ import { o as mt } from "./apiClients-BcXOLuYu.js";
3
3
  var Pt = { exports: {} };
4
4
  (function(je, ot) {
5
5
  (function(se, E) {
package/dist/user.js CHANGED
@@ -1,4 +1,4 @@
1
- import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-P0X1Exyu.js";
1
+ import { U as a, a as n, b as r, c as t, d as U, _ as u, e as i, f as M, g as o, h as m, i as I, j as c, k as d, l as b, m as f } from "./UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-zgjpFVln.js";
2
2
  export {
3
3
  a as UserAccountMenu,
4
4
  n as UserAvatar,
@@ -0,0 +1,66 @@
1
+ /* empty css */
2
+ import { defineComponent as f, ref as m, openBlock as i, createElementBlock as n, createVNode as d, unref as a, createCommentVNode as r } from "vue";
3
+ import { Spin as p, Empty as h } from "@arco-design/web-vue";
4
+ import { useIntersectionObserver as u } from "@vueuse/core";
5
+ import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ const x = {
7
+ key: 0,
8
+ class: "loading"
9
+ }, y = {
10
+ key: 1,
11
+ class: "none"
12
+ }, _ = /* @__PURE__ */ f({
13
+ __name: "InfiniteLoading",
14
+ props: {
15
+ loading: {
16
+ type: Boolean,
17
+ default: !1
18
+ },
19
+ finished: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ loadingText: {
24
+ type: String,
25
+ default: "数据加载中..."
26
+ },
27
+ finishedText: {
28
+ type: String,
29
+ default: "亲,没有更多了!"
30
+ },
31
+ showFinishedText: {
32
+ type: Boolean,
33
+ default: !0
34
+ },
35
+ threshold: {
36
+ type: Number,
37
+ default: 0
38
+ }
39
+ },
40
+ emits: ["infinite"],
41
+ setup(e, {
42
+ emit: l
43
+ }) {
44
+ const t = e, c = l, o = m(null);
45
+ return u(o, ([{
46
+ isIntersecting: s
47
+ }]) => {
48
+ s && // 当loading和finished的值都为false时,就通知父组件调用方法继续向后台请求数据
49
+ !t.loading && !t.finished && c("infinite");
50
+ }, {
51
+ threshold: t.threshold
52
+ }), (s, T) => (i(), n("div", {
53
+ ref_key: "container",
54
+ ref: o,
55
+ class: "infinite-loading"
56
+ }, [e.loading ? (i(), n("div", x, [d(a(p), {
57
+ tip: e.loadingText
58
+ }, null, 8, ["tip"])])) : r("", !0), e.finished && e.showFinishedText ? (i(), n("div", y, [d(a(h), {
59
+ description: e.finishedText
60
+ }, null, 8, ["description"])])) : r("", !0)], 512));
61
+ }
62
+ }), N = /* @__PURE__ */ g(_, [["__scopeId", "data-v-367cd24c"]]), S = "min(920px, calc(100vw - 32px))";
63
+ export {
64
+ N as I,
65
+ S as U
66
+ };
@@ -12,13 +12,13 @@ export declare const tokenMiddleware: import('@vafast/api-client').NamedMiddlewa
12
12
  */
13
13
  export declare const tokenRefreshMiddleware: import('@vafast/api-client').NamedMiddleware;
14
14
  /**
15
- * 错误提示中间件:显示错误消息
15
+ * 错误提示中间件:统一由全局 Message 展示服务端错误
16
16
  *
17
- * 双轨制(按 HTTP 状态 + 业务码,不靠 URL 白名单):
18
- * - 400 凭证错误(如 40001):登录密码/验证码错误,走下方 Message 提示。
19
- * - 401 + 40101:token 过期,交由 tokenRefreshMiddleware 刷新。
17
+ * - 401 + 40101:token 过期,交由 tokenRefreshMiddleware 刷新,不弹 Message。
20
18
  * - 401(code=401):会话无效,清理认证 + 打开登录框,不弹 Message。
21
- * - 其他错误:弹 Message 提示。
19
+ * - 其他 error:弹 Message 提示。
20
+ *
21
+ * 调用方收到 response.error 时勿再 Message.error,直接 return 即可。
22
22
  */
23
23
  export declare const errorMessageMiddleware: import('@vafast/api-client').NamedMiddleware;
24
24
  /** 为 API Client 挂载 token 刷新与 401 登录框兜底 */
@@ -0,0 +1,11 @@
1
+ export interface ApiResultLike<T = unknown> {
2
+ data?: T;
3
+ error?: {
4
+ message?: string;
5
+ } | null;
6
+ }
7
+ /**
8
+ * withAuthHandling 已对 response.error 弹全局 Toast。
9
+ * 仅在无 error 但 data 为空时返回 fallback,供调用方本地提示。
10
+ */
11
+ export declare function resolveApiEmptyMessage<T>(result: ApiResultLike<T>, fallback: string): string | null;
@@ -0,0 +1,3 @@
1
+ /** Iconify 图标名形如 prefix:name;Vite 导入的图片 URL 不含该格式 */
2
+ export declare function isIconifyIcon(icon: string): boolean;
3
+ export declare function isBrandProviderIcon(icon: string): boolean;