@huyooo/ui 0.13.4 → 0.13.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/{AuthkitAppSetting-EL2ZvAVT.js → AuthkitAppSetting-u2kUUH6q.js} +7 -7
  2. package/dist/{AuthkitGithubBinding-Ba9sbNEh.js → AuthkitGithubBinding-B-YSWc50.js} +6 -6
  3. package/dist/{Clipboard-CdJtMvg6.js → Clipboard-C8ncjaAJ.js} +1 -1
  4. package/dist/{Contact-Z2VFVeKK.js → Contact-CIMfdt_b.js} +2 -2
  5. package/dist/{FeedbackItem-B_MDdk4s.js → FeedbackItem-C9FQThXG.js} +3 -3
  6. package/dist/{FeedbackModal-qrcBDDQM.js → FeedbackModal-R3NKRxr7.js} +3 -3
  7. package/dist/{MessageHandle-Y96z-IXv.js → MessageHandle-D2dcvWVr.js} +2 -2
  8. package/dist/{MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-CfmjFcay.js → MessageNoticeNotificationsDetails.vue_vue_type_script_setup_true_lang-CSAIRPOj.js} +2 -2
  9. package/dist/{PaySubscriptions-C75OtmYw.js → PaySubscriptions-BaUlQE-p.js} +4 -4
  10. package/dist/{PricingPlans-DCYIVuuT.js → PricingPlans-B0nt843Q.js} +4 -4
  11. package/dist/{ReferrerReferees-8eSsuPfa.js → ReferrerReferees-B50_V69q.js} +4 -4
  12. package/dist/{Upload.vue_vue_type_script_setup_true_lang-BAibfVEN.js → Upload.vue_vue_type_script_setup_true_lang-dLSky4Yx.js} +1 -1
  13. package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BEVmBNlU.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BHXLN2Tu.js} +33 -34
  14. package/dist/{WidthContainer-Dqf_-qGk.js → WidthContainer-BQIboxrg.js} +21 -20
  15. package/dist/api/billingSubscriptionApi.d.ts +3 -0
  16. package/dist/{apiClients-D56ALwwO.js → apiClients-CkI47p36.js} +11 -7
  17. package/dist/authkit.js +9 -9
  18. package/dist/common.js +1 -1
  19. package/dist/composables/useMessageList.d.ts +2 -2
  20. package/dist/composables.js +13 -13
  21. package/dist/feedback.js +3 -3
  22. package/dist/main.js +31 -31
  23. package/dist/message.js +3 -3
  24. package/dist/pay.js +4 -4
  25. package/dist/privateCom.js +1 -1
  26. package/dist/referrer.js +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/types/api/ai.generated.d.ts +3051 -269
  29. package/dist/types/api/billing.generated.d.ts +1206 -275
  30. package/dist/upload.js +2 -2
  31. package/dist/{useAuthkitAppsAuthPageInfo-RMs8sOwk.js → useAuthkitAppsAuthPageInfo-CjPdpZ64.js} +1 -1
  32. package/dist/{useAuthkitAuth-B8aO6aMa.js → useAuthkitAuth-C--qS6UE.js} +1 -1
  33. package/dist/{useAuthkitCreateAndUpdate-DkiLs143.js → useAuthkitCreateAndUpdate-CsYn-oYu.js} +1 -1
  34. package/dist/{useAuthkitUsersProfile-CWAr0CNv.js → useAuthkitUsersProfile-CIFqG3gd.js} +2 -2
  35. package/dist/useBillingStatusOptions-D5Ehwtbj.js +145 -0
  36. package/dist/{useDownloads-DqF1USJ7.js → useDownloads-CxoyuqyY.js} +1 -1
  37. package/dist/{useEnsureAuthenticated-D99GiwEk.js → useEnsureAuthenticated-C4tsSfv6.js} +2 -2
  38. package/dist/{useLegalLinks-DRTOYp3n.js → useLegalLinks-DHqsVvIK.js} +2 -2
  39. package/dist/{useMessageNotifications-CUpk6zCE.js → useMessageNotifications-BMUx5xfX.js} +1 -1
  40. package/dist/{useSEO-CUKPmGRx.js → useSEO-DypqLVfr.js} +2 -2
  41. package/dist/{useSubscriptionCheckout-CAgy1CFj.js → useSubscriptionCheckout-CHAF20s-.js} +102 -108
  42. package/dist/{useTableHandle-CCKjahT0.js → useTableHandle-9alnSWt0.js} +1 -1
  43. package/dist/{useUploadCos-Bxctd4E6.js → useUploadCos-DGPnLOC9.js} +1 -1
  44. package/dist/user.js +1 -1
  45. package/package.json +3 -3
  46. package/dist/useBillingStatusOptions-CottFcAr.js +0 -127
package/dist/upload.js CHANGED
@@ -1,5 +1,5 @@
1
- import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-BAibfVEN.js";
2
- import { u as s } from "./useUploadCos-Bxctd4E6.js";
1
+ import { _ as p } from "./Upload.vue_vue_type_script_setup_true_lang-dLSky4Yx.js";
2
+ import { u as s } from "./useUploadCos-DGPnLOC9.js";
3
3
  export {
4
4
  p as Upload,
5
5
  s as useUploadCos
@@ -1,5 +1,5 @@
1
1
  import { ref as n } from "vue";
2
- import { f as u } from "./apiClients-D56ALwwO.js";
2
+ import { e as u } from "./apiClients-CkI47p36.js";
3
3
  const a = n({
4
4
  id: "",
5
5
  appKey: "",
@@ -1,5 +1,5 @@
1
1
  import { ref as s, readonly as P } from "vue";
2
- import { f as c } from "./apiClients-D56ALwwO.js";
2
+ import { e as c } from "./apiClients-CkI47p36.js";
3
3
  const a = s("signIn"), m = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), v = /* @__PURE__ */ new Set(), t = s(null), p = "jwtToken";
4
4
  function k() {
5
5
  try {
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import "./apiClients-D56ALwwO.js";
2
+ import "./apiClients-CkI47p36.js";
3
3
  import { Message as u } from "@arco-design/web-vue";
4
4
  import { ref as e } from "vue";
5
5
  function h(s) {
@@ -1,6 +1,6 @@
1
1
  import { ref as l, computed as f } from "vue";
2
- import { f as c } from "./apiClients-D56ALwwO.js";
3
- import { u as i } from "./useAuthkitAuth-B8aO6aMa.js";
2
+ import { e as c } from "./apiClients-CkI47p36.js";
3
+ import { u as i } from "./useAuthkitAuth-C--qS6UE.js";
4
4
  const o = l(null), u = l(!1), t = l(!1), r = f(() => !!o.value);
5
5
  async function v() {
6
6
  const {
@@ -0,0 +1,145 @@
1
+ import { createClient as y } from "@vafast/api-client";
2
+ import { g as f, h as b, t as k, i as v, j as S, f as u } from "./apiClients-CkI47p36.js";
3
+ import { ref as g } from "vue";
4
+ async function O(t, o) {
5
+ const {
6
+ data: r,
7
+ error: e
8
+ } = await A.request("POST", t, o);
9
+ if (e)
10
+ throw new Error(e.message ?? "请求失败");
11
+ if (r == null)
12
+ throw new Error("请求失败");
13
+ return r;
14
+ }
15
+ const A = y({
16
+ baseURL: f.billingPrefixUrl,
17
+ timeout: 3e4
18
+ }).use(b).use(k).use(v).use(S), m = {
19
+ productOptions: () => O("/products/options")
20
+ }, w = [{
21
+ key: "pending",
22
+ label: "待支付",
23
+ color: "orange"
24
+ }, {
25
+ key: "paying",
26
+ label: "支付中",
27
+ color: "blue"
28
+ }, {
29
+ key: "paid",
30
+ label: "已支付",
31
+ color: "green"
32
+ }, {
33
+ key: "cancelled",
34
+ label: "已取消",
35
+ color: "gray"
36
+ }, {
37
+ key: "expired",
38
+ label: "已过期",
39
+ color: "red"
40
+ }, {
41
+ key: "refunded",
42
+ label: "已退款",
43
+ color: "purple"
44
+ }], L = [{
45
+ key: "pending",
46
+ label: "待审核",
47
+ color: "orange"
48
+ }, {
49
+ key: "approved",
50
+ label: "已通过",
51
+ color: "blue"
52
+ }, {
53
+ key: "rejected",
54
+ label: "已拒绝",
55
+ color: "gray"
56
+ }, {
57
+ key: "processing",
58
+ label: "退款中",
59
+ color: "blue"
60
+ }, {
61
+ key: "success",
62
+ label: "已退款",
63
+ color: "green"
64
+ }, {
65
+ key: "failed",
66
+ label: "退款失败",
67
+ color: "red"
68
+ }], C = [{
69
+ key: "draft",
70
+ label: "草稿",
71
+ color: "gray"
72
+ }, {
73
+ key: "open",
74
+ label: "待支付",
75
+ color: "orange"
76
+ }, {
77
+ key: "paid",
78
+ label: "已支付",
79
+ color: "green"
80
+ }, {
81
+ key: "void",
82
+ label: "已作废",
83
+ color: "gray"
84
+ }, {
85
+ key: "uncollectible",
86
+ label: "无法收款",
87
+ color: "red"
88
+ }];
89
+ function d(t, o, r, e) {
90
+ var a;
91
+ const s = ((a = o == null ? void 0 : o.toLowerCase) == null ? void 0 : a.call(o)) ?? o, l = t.find((i) => i.key === o || i.key === s);
92
+ return l != null && l[r] ? l[r] : e;
93
+ }
94
+ function p(t, o) {
95
+ const r = g(!1), e = g([]);
96
+ async function s() {
97
+ if (e.value.length > 0)
98
+ return e.value;
99
+ r.value = !0;
100
+ try {
101
+ const {
102
+ data: n,
103
+ error: c
104
+ } = await t();
105
+ return c || !(n != null && n.length) ? (c && console.error("获取状态选项失败:", c), e.value = o, e.value) : (e.value = n, e.value);
106
+ } finally {
107
+ r.value = !1;
108
+ }
109
+ }
110
+ function l() {
111
+ return e.value.length > 0 ? e.value : o;
112
+ }
113
+ function a(n) {
114
+ return d(l(), n, "label", n);
115
+ }
116
+ function i(n) {
117
+ return d(l(), n, "color", "gray");
118
+ }
119
+ return {
120
+ statusOptionsLoading: r,
121
+ statusOptionsList: e,
122
+ statusOptionsApi: s,
123
+ getStatusLabel: a,
124
+ getStatusColor: i
125
+ };
126
+ }
127
+ function _() {
128
+ return p(async () => u.pointsRecharge.statusOptions.post({}), w);
129
+ }
130
+ function E() {
131
+ return p(async () => u.refund.statusOptions.post({}), L);
132
+ }
133
+ function I() {
134
+ return p(async () => u.invoices.statusOptions.post({}), C);
135
+ }
136
+ export {
137
+ C as I,
138
+ w as P,
139
+ L as R,
140
+ _ as a,
141
+ E as b,
142
+ p as c,
143
+ m as d,
144
+ I as u
145
+ };
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import { g as f } from "./apiClients-D56ALwwO.js";
2
+ import { g as f } from "./apiClients-CkI47p36.js";
3
3
  import { Message as u } from "@arco-design/web-vue";
4
4
  import { ref as o } from "vue";
5
5
  function h(s) {
@@ -1,6 +1,6 @@
1
1
  import { computed as f } from "vue";
2
- import { u as r } from "./useAuthkitAuth-B8aO6aMa.js";
3
- import { u as d } from "./apiClients-D56ALwwO.js";
2
+ import { u as r } from "./useAuthkitAuth-C--qS6UE.js";
3
+ import { u as d } from "./apiClients-CkI47p36.js";
4
4
  const A = "jwtToken";
5
5
  let e = null, i = !1;
6
6
  async function h(n) {
@@ -1,6 +1,6 @@
1
1
  import { computed as c } from "vue";
2
- import { g as L } from "./apiClients-D56ALwwO.js";
3
- import { u as m } from "./useAuthkitAppsAuthPageInfo-RMs8sOwk.js";
2
+ import { g as L } from "./apiClients-CkI47p36.js";
3
+ import { u as m } from "./useAuthkitAppsAuthPageInfo-CjPdpZ64.js";
4
4
  const l = {
5
5
  userServiceAgreement: "用户服务协议",
6
6
  privacyPolicy: "隐私协议",
@@ -1,5 +1,5 @@
1
1
  import { ref as a, computed as L } from "vue";
2
- import { o as c } from "./apiClients-D56ALwwO.js";
2
+ import { o as c } from "./apiClients-CkI47p36.js";
3
3
  function S(f = "system") {
4
4
  const n = a(!0), d = a(""), i = a(!1), g = a(!1), o = a([]), t = a({
5
5
  total: 0,
@@ -1,7 +1,7 @@
1
1
  import { ref as I, computed as d, watch as _, isRef as G, toValue as B, hasInjectionContext as F, inject as J, watchEffect as Q, getCurrentInstance as Z, onBeforeUnmount as X, onDeactivated as Y, onActivated as ee } from "vue";
2
2
  import { useRouter as V, useRoute as K } from "vue-router";
3
- import { u as R } from "./useAuthkitAppsAuthPageInfo-RMs8sOwk.js";
4
- import { u as U } from "./useAuthkitUsersProfile-CWAr0CNv.js";
3
+ import { u as R } from "./useAuthkitAppsAuthPageInfo-CjPdpZ64.js";
4
+ import { u as U } from "./useAuthkitUsersProfile-CIFqG3gd.js";
5
5
  const v = I({
6
6
  key: "",
7
7
  name: ""
@@ -1,30 +1,31 @@
1
1
  import { ref as y, computed as q } from "vue";
2
- import { e as h } from "./apiClients-D56ALwwO.js";
2
+ import { d as J } from "./useBillingStatusOptions-D5Ehwtbj.js";
3
+ import { f as I } from "./apiClients-CkI47p36.js";
3
4
  /* empty css */
4
5
  import { Message as g } from "@arco-design/web-vue";
5
- import { u as J } from "./useEnsureAuthenticated-D99GiwEk.js";
6
+ import { u as N } from "./useEnsureAuthenticated-C4tsSfv6.js";
6
7
  function x(e) {
7
8
  var i;
8
- const n = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
9
- return typeof n == "number" ? n : void 0;
10
- }
11
- function N(e) {
12
- const n = x(e);
13
- return !e || n === void 0 || n <= e.unitAmount ? 0 : Math.round((1 - e.unitAmount / n) * 100);
9
+ const r = (i = e == null ? void 0 : e.metadata) == null ? void 0 : i.originalPrice;
10
+ return typeof r == "number" ? r : void 0;
14
11
  }
15
12
  function W(e) {
13
+ const r = x(e);
14
+ return !e || r === void 0 || r <= e.unitAmount ? 0 : Math.round((1 - e.unitAmount / r) * 100);
15
+ }
16
+ function X(e) {
16
17
  var l, f;
17
- const n = (l = e == null ? void 0 : e.metadata) == null ? void 0 : l.discountLabel;
18
- if (typeof n == "string" && n.trim())
19
- return n;
18
+ const r = (l = e == null ? void 0 : e.metadata) == null ? void 0 : l.discountLabel;
19
+ if (typeof r == "string" && r.trim())
20
+ return r;
20
21
  const i = (f = e == null ? void 0 : e.metadata) == null ? void 0 : f.savingMonths;
21
22
  return typeof i == "number" && i > 0 ? `买 ${12 - i} 个月送 ${i} 个月` : "";
22
23
  }
23
- function B(e) {
24
+ function S(e) {
24
25
  return e === void 0 ? 0 : Math.floor(e / 100);
25
26
  }
26
- function X(e, n = 1) {
27
- const i = n > 1 ? `每 ${n} ` : "按";
27
+ function Y(e, r = 1) {
28
+ const i = r > 1 ? `每 ${r} ` : "按";
28
29
  switch (e) {
29
30
  case "month":
30
31
  return `${i}月订阅`;
@@ -38,17 +39,17 @@ function X(e, n = 1) {
38
39
  return "";
39
40
  }
40
41
  }
41
- function Y(e) {
42
- const n = e != null && e.intervalCount && e.intervalCount > 1 ? `${e.intervalCount} ` : "";
42
+ function Z(e) {
43
+ const r = e != null && e.intervalCount && e.intervalCount > 1 ? `${e.intervalCount} ` : "";
43
44
  switch (e == null ? void 0 : e.interval) {
44
45
  case "month":
45
- return `/ ${n}月`;
46
+ return `/ ${r}月`;
46
47
  case "year":
47
- return `/ ${n}年`;
48
+ return `/ ${r}年`;
48
49
  case "day":
49
- return `/ ${n}天`;
50
+ return `/ ${r}天`;
50
51
  case "week":
51
- return `/ ${n}周`;
52
+ return `/ ${r}周`;
52
53
  default:
53
54
  return "";
54
55
  }
@@ -69,14 +70,14 @@ function w(e) {
69
70
  return "";
70
71
  }
71
72
  }
72
- function D(e) {
73
+ function B(e) {
73
74
  if (e.type === "quota" && e.value !== void 0) {
74
- const n = w(e.quotaPeriod), i = n ? ` / ${n}` : "";
75
+ const r = w(e.quotaPeriod), i = r ? ` / ${r}` : "";
75
76
  return `${e.name}: ${e.value === -1 ? "无限" : e.value}${i}`;
76
77
  }
77
78
  if (e.type === "unlimited") {
78
- const n = w(e.quotaPeriod);
79
- return n ? `${e.name}: 不限 / ${n}` : `${e.name}不限`;
79
+ const r = w(e.quotaPeriod);
80
+ return r ? `${e.name}: 不限 / ${r}` : `${e.name}不限`;
80
81
  }
81
82
  return e.type === "boolean" && e.value === !1 ? `${e.name}(不支持)` : e.name;
82
83
  }
@@ -87,54 +88,54 @@ function C(e) {
87
88
  intervalCount: e.intervalCount ?? 1
88
89
  };
89
90
  }
90
- function Z(e, n) {
91
+ function ee(e, r) {
91
92
  const i = {
92
93
  day: 1,
93
94
  week: 2,
94
95
  month: 3,
95
96
  year: 4
96
97
  };
97
- return i[e.interval] - i[n.interval] || e.intervalCount - n.intervalCount;
98
+ return i[e.interval] - i[r.interval] || e.intervalCount - r.intervalCount;
98
99
  }
99
- function ee(e, n) {
100
+ function te(e, r) {
100
101
  let i = 0;
101
102
  for (const l of e)
102
103
  for (const f of l.prices) {
103
104
  const s = C(f);
104
- (s == null ? void 0 : s.key) === n && (i = Math.max(i, N(f)));
105
+ (s == null ? void 0 : s.key) === r && (i = Math.max(i, W(f)));
105
106
  }
106
107
  return i > 0 ? `省 ${i}%` : void 0;
107
108
  }
108
- function te(e) {
109
+ function ne(e) {
109
110
  return e.includes(":") ? e : `${e}:1`;
110
111
  }
111
- function M() {
112
+ function D() {
112
113
  return !!localStorage.getItem("jwtToken");
113
114
  }
114
- function le(e = "month") {
115
- const n = y([]), i = y(null), l = y(null), f = y(!1), s = y(!1), d = y(te(e)), a = q(() => {
115
+ function de(e = "month") {
116
+ const r = y([]), i = y(null), l = y(null), f = y(!1), s = y(!1), d = y(ne(e)), a = q(() => {
116
117
  const t = /* @__PURE__ */ new Map();
117
- for (const r of n.value)
118
- for (const u of r.prices) {
118
+ for (const n of r.value)
119
+ for (const u of n.prices) {
119
120
  const c = C(u);
120
121
  c && t.set(c.key, c);
121
122
  }
122
- return [...t.values()].sort(Z).map((r) => ({
123
- value: r.key,
124
- label: X(r.interval, r.intervalCount),
125
- badge: ee(n.value, r.key)
123
+ return [...t.values()].sort(ee).map((n) => ({
124
+ value: n.key,
125
+ label: Y(n.interval, n.intervalCount),
126
+ badge: te(r.value, n.key)
126
127
  }));
127
128
  }), b = q(() => {
128
- var r;
129
+ var n;
129
130
  const t = [];
130
- for (const u of n.value) {
131
+ for (const u of r.value) {
131
132
  const c = u.prices.find((p) => {
132
- const I = C(p);
133
- return (I == null ? void 0 : I.key) === d.value;
133
+ const $ = C(p);
134
+ return ($ == null ? void 0 : $.key) === d.value;
134
135
  }), m = u.prices.find((p) => p.type === "free"), o = c ?? (m && u.prices.every((p) => p.type === "free") ? m : void 0);
135
136
  o && t.push({
136
137
  ...u,
137
- features: (r = o.features) != null && r.length ? o.features : u.features,
138
+ features: (n = o.features) != null && n.length ? o.features : u.features,
138
139
  selectedPrice: o
139
140
  });
140
141
  }
@@ -144,16 +145,16 @@ function le(e = "month") {
144
145
  d.value = t;
145
146
  }
146
147
  function P(t) {
147
- const r = i.value, u = l.value;
148
- 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;
148
+ const n = i.value, u = l.value;
149
+ return n != null && n.priceId && t.selectedPrice ? n.priceId === t.selectedPrice.id : n ? n.productId === t.id : u != null && u.priceId && t.selectedPrice ? u.priceId === t.selectedPrice.id : u ? u.productId === t.id : !1;
149
150
  }
150
151
  function k(t) {
151
- var r;
152
- return ((r = i.value) == null ? void 0 : r.productId) === t.id;
152
+ var n;
153
+ return ((n = i.value) == null ? void 0 : n.productId) === t.id;
153
154
  }
154
155
  function v(t) {
155
- var r;
156
- return ((r = t.selectedPrice) == null ? void 0 : r.type) === "free";
156
+ var n;
157
+ return ((n = t.selectedPrice) == null ? void 0 : n.type) === "free";
157
158
  }
158
159
  function U() {
159
160
  return !!i.value;
@@ -161,68 +162,68 @@ function le(e = "month") {
161
162
  function T(t) {
162
163
  return !!(!t.selectedPrice || P(t) || v(t) && U());
163
164
  }
164
- function $(t) {
165
- var r;
166
- return ((r = t.metadata) == null ? void 0 : r.recommended) === !0;
165
+ function h(t) {
166
+ var n;
167
+ return ((n = t.metadata) == null ? void 0 : n.recommended) === !0;
167
168
  }
168
169
  function j(t) {
169
- var r;
170
- return B((r = t.selectedPrice) == null ? void 0 : r.unitAmount);
170
+ var n;
171
+ return S((n = t.selectedPrice) == null ? void 0 : n.unitAmount);
171
172
  }
172
173
  function G(t) {
173
- const r = x(t.selectedPrice);
174
- return r === void 0 ? void 0 : B(r);
174
+ const n = x(t.selectedPrice);
175
+ return n === void 0 ? void 0 : S(n);
175
176
  }
176
177
  function O(t) {
177
- return v(t) ? "" : Y(t.selectedPrice);
178
+ return v(t) ? "" : Z(t.selectedPrice);
178
179
  }
179
180
  function R(t) {
180
- var r;
181
+ var n;
181
182
  if (v(t)) {
182
- const u = (r = t.selectedPrice) == null ? void 0 : r.trialPeriodDays;
183
+ const u = (n = t.selectedPrice) == null ? void 0 : n.trialPeriodDays;
183
184
  return u ? `${u} 天免费体验` : "免费体验";
184
185
  }
185
- return W(t.selectedPrice);
186
+ return X(t.selectedPrice);
186
187
  }
187
188
  function E(t) {
188
- return P(t) ? "当前方案" : $(t) ? "最受欢迎" : "";
189
+ return P(t) ? "当前方案" : h(t) ? "最受欢迎" : "";
189
190
  }
190
191
  function K(t) {
191
- const r = [];
192
- return P(t) ? r.push({
192
+ const n = [];
193
+ return P(t) ? n.push({
193
194
  label: "当前方案",
194
195
  type: "current"
195
- }) : v(t) ? r.push({
196
+ }) : v(t) ? n.push({
196
197
  label: "免费体验",
197
198
  type: "trial"
198
- }) : $(t) && r.push({
199
+ }) : h(t) && n.push({
199
200
  label: "最受欢迎",
200
201
  type: "recommended"
201
- }), r;
202
+ }), n;
202
203
  }
203
204
  function Q(t) {
204
- const r = i.value;
205
- return P(t) ? "当前方案" : v(t) ? r ? "已订阅付费方案" : M() ? "免费开通" : "免费注册" : r ? k(t) ? "切换周期" : typeof r.unitAmount == "number" && t.selectedPrice.unitAmount > r.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
205
+ const n = i.value;
206
+ return P(t) ? "当前方案" : v(t) ? n ? "已订阅付费方案" : D() ? "免费开通" : "免费注册" : n ? k(t) ? "切换周期" : typeof n.unitAmount == "number" && t.selectedPrice.unitAmount > n.unitAmount ? "升级方案" : "切换方案" : "立即订阅";
206
207
  }
207
- function V(t, r) {
208
+ function V(t, n) {
208
209
  const u = t.features.find((c) => c.type === "quota" && c.value !== void 0);
209
210
  if (u) {
210
211
  const c = w(u.quotaPeriod), m = u.value === -1 ? "不限量" : u.value;
211
212
  return `${u.name} ${c ? `${m} / ${c}` : m},覆盖核心使用场景。`;
212
213
  }
213
- return v(t) ? "注册后自动开通免费权益,适合先体验核心能力。" : r === 1 ? "为正式团队准备的高配能力组合。" : "包含入门所需的核心能力。";
214
+ return v(t) ? "注册后自动开通免费权益,适合先体验核心能力。" : n === 1 ? "为正式团队准备的高配能力组合。" : "包含入门所需的核心能力。";
214
215
  }
215
216
  function _(t) {
216
- return t.filter((r) => r.highlight !== !1).map((r) => ({
217
- title: D(r),
218
- description: r.description || ""
217
+ return t.filter((n) => n.highlight !== !1).map((n) => ({
218
+ title: B(n),
219
+ description: n.description || ""
219
220
  }));
220
221
  }
221
222
  function z(t) {
222
- const r = t.filter((o) => o.highlight !== !1), u = r.filter((o) => o.type === "quota" || o.type === "unlimited").map((o) => ({
223
- title: D(o),
223
+ const n = t.filter((o) => o.highlight !== !1), u = n.filter((o) => o.type === "quota" || o.type === "unlimited").map((o) => ({
224
+ title: B(o),
224
225
  description: o.description || ""
225
- })), c = r.filter((o) => o.type === "boolean" && o.value !== !1).map((o) => ({
226
+ })), c = n.filter((o) => o.type === "boolean" && o.value !== !1).map((o) => ({
226
227
  title: o.name,
227
228
  description: o.description || ""
228
229
  })), m = [];
@@ -237,21 +238,14 @@ function le(e = "month") {
237
238
  async function A() {
238
239
  f.value = !0;
239
240
  try {
240
- const {
241
- data: t,
242
- error: r
243
- } = await h.products.listActive.post();
244
- if (r) {
245
- console.error("加载产品列表失败", r);
246
- return;
247
- }
248
- n.value = Array.isArray(t) ? t : [], !a.value.some((c) => c.value === d.value) && a.value[0] && (d.value = a.value[0].value);
241
+ const t = await J.productOptions();
242
+ r.value = Array.isArray(t) ? t : [], !a.value.some((u) => u.value === d.value) && a.value[0] && (d.value = a.value[0].value);
249
243
  } finally {
250
244
  f.value = !1;
251
245
  }
252
246
  }
253
247
  async function L() {
254
- if (!M()) {
248
+ if (!D()) {
255
249
  i.value = null, l.value = null;
256
250
  return;
257
251
  }
@@ -259,10 +253,10 @@ function le(e = "month") {
259
253
  try {
260
254
  const {
261
255
  data: t,
262
- error: r
263
- } = await h.subscriptions.summary.post();
264
- if (r) {
265
- console.error("加载当前订阅失败", r);
256
+ error: n
257
+ } = await I.subscriptions.summary.post();
258
+ if (n) {
259
+ console.error("加载当前订阅失败", n);
266
260
  return;
267
261
  }
268
262
  i.value = (t == null ? void 0 : t.current) ?? null, l.value = (t == null ? void 0 : t.trial) ?? null;
@@ -274,7 +268,7 @@ function le(e = "month") {
274
268
  await Promise.all([A(), L()]);
275
269
  }
276
270
  return {
277
- products: n,
271
+ products: r,
278
272
  plans: b,
279
273
  currentSubscription: i,
280
274
  currentTrial: l,
@@ -285,7 +279,7 @@ function le(e = "month") {
285
279
  setBillingInterval: F,
286
280
  isCurrentPlan: P,
287
281
  isSameProduct: k,
288
- isRecommendedPlan: $,
282
+ isRecommendedPlan: h,
289
283
  isFreePlan: v,
290
284
  isPlanActionDisabled: T,
291
285
  getDisplayPrice: j,
@@ -306,19 +300,19 @@ function le(e = "month") {
306
300
  function re(e) {
307
301
  window.open(e, "_blank", "noopener,noreferrer");
308
302
  }
309
- function S(e) {
303
+ function M(e) {
310
304
  return e && typeof e == "object" && "message" in e && typeof e.message == "string" ? e.message : "";
311
305
  }
312
- function ne(e) {
306
+ function ie(e) {
313
307
  return e && typeof e == "object" && "alipayUrl" in e && typeof e.alipayUrl == "string" ? e.alipayUrl : "";
314
308
  }
315
- function ie(e) {
309
+ function ue(e) {
316
310
  return e && typeof e == "object" && "status" in e && e.status === "trialing";
317
311
  }
318
- function fe(e) {
319
- const n = y(null), {
312
+ function me(e) {
313
+ const r = y(null), {
320
314
  ensureAuthenticated: i
321
- } = J();
315
+ } = N();
322
316
  async function l(s) {
323
317
  if (!s.selectedPrice) {
324
318
  g.warning("当前方案暂无可购买价格");
@@ -330,43 +324,43 @@ function fe(e) {
330
324
  g.info("当前已经是该方案");
331
325
  return;
332
326
  }
333
- n.value = s.id;
327
+ r.value = s.id;
334
328
  try {
335
329
  if (s.selectedPrice.type === "free")
336
330
  return;
337
- const a = d ? await h.subscriptions.change.post({
331
+ const a = d ? await I.subscriptions.change.post({
338
332
  subscriptionId: d.id,
339
333
  newPriceId: s.selectedPrice.id,
340
334
  proration: !0
341
- }) : await h.subscriptions.create.post({
335
+ }) : await I.subscriptions.create.post({
342
336
  priceId: s.selectedPrice.id
343
337
  });
344
338
  if (a.error) {
345
339
  g.error(a.error.message || "订阅操作失败");
346
340
  return;
347
341
  }
348
- const b = ne(a.data);
342
+ const b = ie(a.data);
349
343
  if (b) {
350
344
  re(b);
351
345
  return;
352
346
  }
353
- ie(a.data) ? g.success(S(a.data) || "试用已开始") : g.success(S(a.data) || "订阅已更新"), await e.refreshCurrentSubscription();
347
+ ue(a.data) ? g.success(M(a.data) || "试用已开始") : g.success(M(a.data) || "订阅已更新"), await e.refreshCurrentSubscription();
354
348
  } catch (a) {
355
349
  console.error("订阅操作失败", a), g.error("订阅操作失败,请稍后重试");
356
350
  } finally {
357
- n.value = null;
351
+ r.value = null;
358
352
  }
359
353
  }
360
354
  function f(s) {
361
- return n.value === s.id;
355
+ return r.value === s.id;
362
356
  }
363
357
  return {
364
- checkoutPlanId: n,
358
+ checkoutPlanId: r,
365
359
  checkout: l,
366
360
  isCheckingOut: f
367
361
  };
368
362
  }
369
363
  export {
370
- fe as a,
371
- le as u
364
+ me as a,
365
+ de as u
372
366
  };
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import "./apiClients-D56ALwwO.js";
2
+ import "./apiClients-CkI47p36.js";
3
3
  import { Message as O } from "@arco-design/web-vue";
4
4
  import { ref as t } from "vue";
5
5
  function A(r) {
@@ -1,5 +1,5 @@
1
1
  import { c as Ft, g as Ut } from "./_commonjsHelpers-DaMA6jEr.js";
2
- import { o as mt } from "./apiClients-D56ALwwO.js";
2
+ import { o as mt } from "./apiClients-CkI47p36.js";
3
3
  var Pt = { exports: {} };
4
4
  (function(je, ot) {
5
5
  (function(se, E) {