@huyooo/ui 2.2.4 → 3.0.0
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.
- package/dist/{AuthkitAppSetting-ZopA9Gjq.js → AuthkitAppSetting-DhLRYlL_.js} +97 -91
- package/dist/{Contact-BdBQ_FA4.js → Contact-CNLjyOCR.js} +3 -3
- package/dist/{FeedbackModal.vue_vue_type_script_setup_true_lang-C7vaGD4R.js → FeedbackModal.vue_vue_type_script_setup_true_lang-BXqxUXuu.js} +2 -2
- package/dist/{LegalDocViewer-wbdoeWU9.js → LegalDocViewer-DkVW9tCh.js} +622 -625
- package/dist/{PaySubscriptions-OZ6OFeQJ.js → PaySubscriptions-tJSQUmhE.js} +1 -1
- package/dist/{PricingPlans-Wf4QkUIz.js → PricingPlans-BhcDv8uk.js} +3 -3
- package/dist/{ReferrerReferees-DNE-htF1.js → ReferrerReferees-QTZnOCJB.js} +1 -1
- package/dist/{Upload.vue_vue_type_script_setup_true_lang-DtciAodp.js → Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js} +1 -1
- package/dist/{UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-ELHt9JGf.js → UserMenuInvitationsItem.vue_vue_type_script_setup_true_lang-BQgy_CeZ.js} +5 -5
- package/dist/WidthContainer-BEeYYOat.js +688 -0
- package/dist/authkit.js +8 -8
- package/dist/common/globalConfig.d.ts +5 -0
- package/dist/common.js +1 -1
- package/dist/components/SvgIcon.vue.d.ts +1 -1
- package/dist/composables/Authkit/oauthCallback.d.ts +1 -1
- package/dist/composables/Authkit/resolveRoutePermission.d.ts +10 -1
- package/dist/composables/Authkit/useAuthkitAppsAuthPageInfo.d.ts +2 -0
- package/dist/composables/Authkit/useAuthkitAuth.d.ts +14 -3
- package/dist/composables/Authkit/useRoutePermission.d.ts +12 -1
- package/dist/composables.d.ts +1 -0
- package/dist/composables.js +49 -44
- package/dist/feedback.js +1 -1
- package/dist/{fetchAuthPageAboutUs-D5w21LkF.js → fetchAuthPageAboutUs--dArFYk6.js} +2 -2
- package/dist/main.js +284 -279
- package/dist/pay.js +3 -3
- package/dist/privateCom.js +1 -1
- package/dist/referrer.js +1 -1
- package/dist/{runtime-B_xhJ3i8.js → runtime-CDEl4QQl.js} +129 -128
- package/dist/style.css +1 -1
- package/dist/types/api/auth.generated.d.ts +23 -0
- package/dist/types/app.d.ts +4 -0
- package/dist/upload.js +2 -2
- package/dist/{useAuthkitAppsAuthPageInfo-KHO1mJvF.js → useAuthkitAppsAuthPageInfo-mv7hOnhi.js} +1 -1
- package/dist/useAuthkitAuth-CO61XogP.js +295 -0
- package/dist/{useAuthkitUsersProfile-BvldvaRx.js → useAuthkitUsersProfile-CF7t2Y7T.js} +1 -1
- package/dist/{useEnsureAuthenticated-BdXJDqVv.js → useEnsureAuthenticated-Q7EHguY4.js} +1 -1
- package/dist/{useLegalDocs-BCWvu1ft.js → useLegalDocs-DUbab5R9.js} +2 -2
- package/dist/{usePageSEO-D7eyLr8d.js → usePageSEO-D8CocvOJ.js} +1 -1
- package/dist/useRoutePermission-Bvn-J8bp.js +249 -0
- package/dist/{useSubscriptionCheckout-BHI3y7Cx.js → useSubscriptionCheckout-Bic8vKgm.js} +1 -1
- package/dist/user.js +1 -1
- package/package.json +1 -1
- package/dist/WidthContainer-PjmYnZwk.js +0 -706
- package/dist/useAuthkitAuth-C0fVP17l.js +0 -273
- package/dist/useRoutePermission-BuKMkOTK.js +0 -247
|
@@ -1351,6 +1351,19 @@ export type Api = {
|
|
|
1351
1351
|
};
|
|
1352
1352
|
};
|
|
1353
1353
|
};
|
|
1354
|
+
oauth: {
|
|
1355
|
+
session: {
|
|
1356
|
+
exchange: {
|
|
1357
|
+
/** 用社交登录回调中的一次性 code 换取 access / refresh token */
|
|
1358
|
+
post: {
|
|
1359
|
+
body: {
|
|
1360
|
+
code: string;
|
|
1361
|
+
};
|
|
1362
|
+
return: any;
|
|
1363
|
+
};
|
|
1364
|
+
};
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1354
1367
|
refresh: {
|
|
1355
1368
|
/** 使用 refreshToken 刷新 JWT */
|
|
1356
1369
|
post: {
|
|
@@ -3488,6 +3501,16 @@ export interface ApiClient {
|
|
|
3488
3501
|
}, config?: RequestConfig) => RequestBuilder<any>;
|
|
3489
3502
|
};
|
|
3490
3503
|
};
|
|
3504
|
+
oauth: {
|
|
3505
|
+
session: {
|
|
3506
|
+
exchange: {
|
|
3507
|
+
/** 用社交登录回调中的一次性 code 换取 access / refresh token */
|
|
3508
|
+
post: (body: {
|
|
3509
|
+
code: string;
|
|
3510
|
+
}, config?: RequestConfig) => RequestBuilder<any>;
|
|
3511
|
+
};
|
|
3512
|
+
};
|
|
3513
|
+
};
|
|
3491
3514
|
refresh: {
|
|
3492
3515
|
/** 使用 refreshToken 刷新 JWT */
|
|
3493
3516
|
post: (body: {
|
package/dist/types/app.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
/** 公开路由匹配方式:prefix 级联子路径;exact 仅精确匹配 */
|
|
2
|
+
export type PublicRouteMatch = 'prefix' | 'exact';
|
|
1
3
|
export interface PublicRoute {
|
|
2
4
|
id: string;
|
|
3
5
|
name: string;
|
|
4
6
|
permissionKey: string;
|
|
5
7
|
description: string;
|
|
8
|
+
/** 缺省按 prefix(级联);exact 仅放行当前 path */
|
|
9
|
+
publicMatch?: PublicRouteMatch;
|
|
6
10
|
}
|
|
7
11
|
export interface OAuthConfig {
|
|
8
12
|
google: {
|
package/dist/upload.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as o } from "./Upload.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { b as s, d as p } from "./runtime-
|
|
1
|
+
import { _ as o } from "./Upload.vue_vue_type_script_setup_true_lang-CZjNlns_.js";
|
|
2
|
+
import { b as s, d as p } from "./runtime-CDEl4QQl.js";
|
|
3
3
|
export {
|
|
4
4
|
o as Upload,
|
|
5
5
|
s as createBrowserCosTransport,
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { ref as i, computed as h, nextTick as M, readonly as $ } from "vue";
|
|
2
|
+
import { o as D, g as c, r as G, s as R } from "./apiClients-8_c5cDW5.js";
|
|
3
|
+
import { u as K } from "./useAuthkitAppsAuthPageInfo-mv7hOnhi.js";
|
|
4
|
+
const p = i(!1), g = i(!1);
|
|
5
|
+
let I;
|
|
6
|
+
const N = "请先阅读并同意用户协议与隐私政策", Y = {
|
|
7
|
+
required: !1,
|
|
8
|
+
userServiceAgreement: !1,
|
|
9
|
+
privacyPolicy: !1
|
|
10
|
+
};
|
|
11
|
+
function y() {
|
|
12
|
+
I && clearTimeout(I), g.value = !1, M(() => {
|
|
13
|
+
g.value = !0, I = setTimeout(() => {
|
|
14
|
+
g.value = !1;
|
|
15
|
+
}, 450);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function z(e) {
|
|
19
|
+
return [{
|
|
20
|
+
validator: (t, r) => {
|
|
21
|
+
if (!e()) {
|
|
22
|
+
r();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (t === !0) {
|
|
26
|
+
r();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
y(), r(N);
|
|
30
|
+
}
|
|
31
|
+
}];
|
|
32
|
+
}
|
|
33
|
+
function H() {
|
|
34
|
+
const {
|
|
35
|
+
appsData: e
|
|
36
|
+
} = K(), t = h(() => e.value.registrationTerms ?? Y), r = h(() => {
|
|
37
|
+
var n;
|
|
38
|
+
return ((n = e.value.signUpAuth) == null ? void 0 : n.enabled) !== !1;
|
|
39
|
+
}), o = h(() => r.value && !t.value.required);
|
|
40
|
+
function l() {
|
|
41
|
+
return r.value && t.value.required;
|
|
42
|
+
}
|
|
43
|
+
function f() {
|
|
44
|
+
return l();
|
|
45
|
+
}
|
|
46
|
+
function T() {
|
|
47
|
+
p.value = !1;
|
|
48
|
+
}
|
|
49
|
+
function v() {
|
|
50
|
+
return !f() || p.value ? !0 : (y(), !1);
|
|
51
|
+
}
|
|
52
|
+
function S(n) {
|
|
53
|
+
p.value = n;
|
|
54
|
+
}
|
|
55
|
+
function k(n) {
|
|
56
|
+
const s = h(() => n === "signUp" ? l() : f()), d = h(() => z(() => s.value));
|
|
57
|
+
return {
|
|
58
|
+
showTermsField: s,
|
|
59
|
+
termsRules: d
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
acceptedTerms: p,
|
|
64
|
+
termsShaking: g,
|
|
65
|
+
registrationTerms: t,
|
|
66
|
+
signUpAuthEnabled: r,
|
|
67
|
+
registrationBlocked: o,
|
|
68
|
+
requiresAcceptanceForSignUp: l,
|
|
69
|
+
requiresAcceptanceForOAuth: f,
|
|
70
|
+
resetAcceptedTerms: T,
|
|
71
|
+
shakeTerms: y,
|
|
72
|
+
syncAcceptedTerms: S,
|
|
73
|
+
ensureTermsAcceptedForSignIn: v,
|
|
74
|
+
useTermsFormField: k
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const a = i("signIn"), j = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set(), u = i(null), V = "jwtToken";
|
|
78
|
+
function O() {
|
|
79
|
+
try {
|
|
80
|
+
const e = localStorage.getItem(V);
|
|
81
|
+
if (e)
|
|
82
|
+
return u.value = e, !0;
|
|
83
|
+
} catch (e) {
|
|
84
|
+
console.warn("Failed to access localStorage:", e);
|
|
85
|
+
}
|
|
86
|
+
return !1;
|
|
87
|
+
}
|
|
88
|
+
typeof window < "u" && O();
|
|
89
|
+
let m = null;
|
|
90
|
+
function J() {
|
|
91
|
+
return m !== null;
|
|
92
|
+
}
|
|
93
|
+
function Q(e) {
|
|
94
|
+
e.searchParams.delete("loginCode"), window.history.replaceState({}, "", `${e.pathname}${e.search}${e.hash}`);
|
|
95
|
+
}
|
|
96
|
+
async function W(e) {
|
|
97
|
+
const {
|
|
98
|
+
data: t,
|
|
99
|
+
error: r
|
|
100
|
+
} = await c().auth.auth.oauth.session.exchange.post({
|
|
101
|
+
code: e
|
|
102
|
+
});
|
|
103
|
+
if (r || !(t != null && t.jwtToken))
|
|
104
|
+
return console.warn("OAuth session exchange failed:", r), null;
|
|
105
|
+
const o = {
|
|
106
|
+
jwtToken: t.jwtToken,
|
|
107
|
+
refreshToken: t.refreshToken ?? null,
|
|
108
|
+
userId: t.userId ?? null,
|
|
109
|
+
appId: t.appId ?? null,
|
|
110
|
+
needBindIdentity: t.needBindIdentity === !0
|
|
111
|
+
};
|
|
112
|
+
return o.refreshToken ? R({
|
|
113
|
+
jwtToken: o.jwtToken,
|
|
114
|
+
refreshToken: o.refreshToken
|
|
115
|
+
}) : P(o.jwtToken), _(o), o;
|
|
116
|
+
}
|
|
117
|
+
async function q() {
|
|
118
|
+
return m || (m = (async () => {
|
|
119
|
+
try {
|
|
120
|
+
const e = new URL(window.location.href), t = e.searchParams.get("loginCode");
|
|
121
|
+
if (!t) return null;
|
|
122
|
+
const r = await W(t);
|
|
123
|
+
return Q(e), r;
|
|
124
|
+
} catch (e) {
|
|
125
|
+
return console.warn("Failed to handle OAuth callback:", e), null;
|
|
126
|
+
}
|
|
127
|
+
})(), m);
|
|
128
|
+
}
|
|
129
|
+
async function X() {
|
|
130
|
+
return await q() ? !0 : O();
|
|
131
|
+
}
|
|
132
|
+
function x() {
|
|
133
|
+
return u.value || O() ? u.value : null;
|
|
134
|
+
}
|
|
135
|
+
function P(e) {
|
|
136
|
+
u.value = e;
|
|
137
|
+
try {
|
|
138
|
+
localStorage.setItem(V, e);
|
|
139
|
+
} catch (t) {
|
|
140
|
+
console.warn("Failed to save token to localStorage:", t);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
function A(e) {
|
|
144
|
+
e.refreshToken ? R({
|
|
145
|
+
jwtToken: e.jwtToken,
|
|
146
|
+
refreshToken: e.refreshToken
|
|
147
|
+
}) : P(e.jwtToken), _(e);
|
|
148
|
+
}
|
|
149
|
+
function Z() {
|
|
150
|
+
u.value = null, re();
|
|
151
|
+
}
|
|
152
|
+
D(Z);
|
|
153
|
+
function U() {
|
|
154
|
+
G();
|
|
155
|
+
}
|
|
156
|
+
async function ee() {
|
|
157
|
+
if (!x())
|
|
158
|
+
return U(), !0;
|
|
159
|
+
const {
|
|
160
|
+
error: e
|
|
161
|
+
} = await c().auth.auth.signOut.post();
|
|
162
|
+
return U(), !e;
|
|
163
|
+
}
|
|
164
|
+
function w(e, t) {
|
|
165
|
+
return e.add(t), () => {
|
|
166
|
+
e.delete(t);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function _(e) {
|
|
170
|
+
j.forEach((t) => {
|
|
171
|
+
t(e);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
function ne() {
|
|
175
|
+
F.forEach((e) => void e());
|
|
176
|
+
}
|
|
177
|
+
function te() {
|
|
178
|
+
E.forEach((e) => void e());
|
|
179
|
+
}
|
|
180
|
+
function re() {
|
|
181
|
+
b.forEach((e) => void e());
|
|
182
|
+
}
|
|
183
|
+
function oe(e) {
|
|
184
|
+
return w(j, e);
|
|
185
|
+
}
|
|
186
|
+
function se(e) {
|
|
187
|
+
return w(F, e);
|
|
188
|
+
}
|
|
189
|
+
function ie(e) {
|
|
190
|
+
return w(E, e);
|
|
191
|
+
}
|
|
192
|
+
function ue(e) {
|
|
193
|
+
return w(b, e);
|
|
194
|
+
}
|
|
195
|
+
function fe() {
|
|
196
|
+
const e = i(!1), t = i(!1), r = i(!1);
|
|
197
|
+
async function o(n) {
|
|
198
|
+
e.value = !0;
|
|
199
|
+
const {
|
|
200
|
+
data: s,
|
|
201
|
+
error: d
|
|
202
|
+
} = await c().auth.auth.signIn.unified.post({
|
|
203
|
+
identifier: n.identifier || n.email || "",
|
|
204
|
+
password: n.password,
|
|
205
|
+
code: n.code,
|
|
206
|
+
emailVerifyId: n.emailVerifyId,
|
|
207
|
+
method: n.method || "password"
|
|
208
|
+
});
|
|
209
|
+
if (e.value = !1, d || !s)
|
|
210
|
+
return;
|
|
211
|
+
A(s);
|
|
212
|
+
}
|
|
213
|
+
function l(n) {
|
|
214
|
+
A(n);
|
|
215
|
+
}
|
|
216
|
+
async function f(n) {
|
|
217
|
+
const {
|
|
218
|
+
resetAcceptedTerms: s,
|
|
219
|
+
acceptedTerms: d,
|
|
220
|
+
requiresAcceptanceForSignUp: C
|
|
221
|
+
} = H();
|
|
222
|
+
t.value = !0;
|
|
223
|
+
const L = C() ? d.value : void 0, {
|
|
224
|
+
error: B
|
|
225
|
+
} = n.type === "phone" ? await c().auth.auth.signUp.phone.post({
|
|
226
|
+
phone: n.phone || "",
|
|
227
|
+
code: n.code || "",
|
|
228
|
+
password: n.password,
|
|
229
|
+
inviteCode: n.inviteCode,
|
|
230
|
+
acceptedTerms: L === !0
|
|
231
|
+
}) : await c().auth.auth.signUp.post({
|
|
232
|
+
email: n.email || "",
|
|
233
|
+
userToken: n.userToken || "",
|
|
234
|
+
emailVerifyId: n.emailVerifyId || "",
|
|
235
|
+
password: n.password || "",
|
|
236
|
+
inviteCode: n.inviteCode,
|
|
237
|
+
acceptedTerms: L === !0
|
|
238
|
+
});
|
|
239
|
+
t.value = !1, !B && (s(), a.value = "signIn", ne());
|
|
240
|
+
}
|
|
241
|
+
async function T(n) {
|
|
242
|
+
r.value = !0;
|
|
243
|
+
const {
|
|
244
|
+
error: s
|
|
245
|
+
} = await c().auth.auth.resetPassword.post({
|
|
246
|
+
method: n.method || "email",
|
|
247
|
+
email: n.email,
|
|
248
|
+
phone: n.phone,
|
|
249
|
+
userToken: n.userToken,
|
|
250
|
+
code: n.code,
|
|
251
|
+
emailVerifyId: n.emailVerifyId,
|
|
252
|
+
password: n.password
|
|
253
|
+
});
|
|
254
|
+
r.value = !1, !s && (a.value = "signIn", te());
|
|
255
|
+
}
|
|
256
|
+
function v() {
|
|
257
|
+
a.value = "signUp";
|
|
258
|
+
}
|
|
259
|
+
function S() {
|
|
260
|
+
a.value = "resetPassword";
|
|
261
|
+
}
|
|
262
|
+
function k() {
|
|
263
|
+
a.value = "signIn";
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
signInSubmit: o,
|
|
267
|
+
passkeySignInSubmit: l,
|
|
268
|
+
signUpSubmit: f,
|
|
269
|
+
resetPasswordSubmit: T,
|
|
270
|
+
currentView: a,
|
|
271
|
+
authSignInLoading: e,
|
|
272
|
+
authSignUpLoading: t,
|
|
273
|
+
resetPasswordLoading: r,
|
|
274
|
+
switchSignUp: v,
|
|
275
|
+
switchResetPassword: S,
|
|
276
|
+
switchSignIn: k,
|
|
277
|
+
onSignIn: oe,
|
|
278
|
+
onSignUp: se,
|
|
279
|
+
onResetPassword: ie,
|
|
280
|
+
onSignOut: ue,
|
|
281
|
+
jwtToken: $(u),
|
|
282
|
+
getToken: x,
|
|
283
|
+
setToken: P,
|
|
284
|
+
completeSignIn: A,
|
|
285
|
+
restoreSession: X,
|
|
286
|
+
consumeOAuthLoginCallback: q,
|
|
287
|
+
hasOAuthLoginConsumeStarted: J,
|
|
288
|
+
clearAuth: U,
|
|
289
|
+
signOut: ee
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
export {
|
|
293
|
+
H as a,
|
|
294
|
+
fe as u
|
|
295
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as a, computed as i } from "vue";
|
|
2
2
|
import { g as p } from "./apiClients-8_c5cDW5.js";
|
|
3
|
-
import { u as l } from "./useAuthkitAuth-
|
|
3
|
+
import { u as l } from "./useAuthkitAuth-CO61XogP.js";
|
|
4
4
|
const e = a(null), n = a(!1), u = a(!1), s = a(!1);
|
|
5
5
|
function v() {
|
|
6
6
|
s.value = !0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as f } from "vue";
|
|
2
|
-
import { u as d } from "./useAuthkitAppsAuthPageInfo-
|
|
3
|
-
import { g as L } from "./runtime-
|
|
2
|
+
import { u as d } from "./useAuthkitAppsAuthPageInfo-mv7hOnhi.js";
|
|
3
|
+
import { g as L } from "./runtime-CDEl4QQl.js";
|
|
4
4
|
const c = {
|
|
5
5
|
userServiceAgreement: "用户服务协议",
|
|
6
6
|
privacyPolicy: "隐私协议",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./apiClients-8_c5cDW5.js";
|
|
3
3
|
import { Message as y } from "@arco-design/web-vue";
|
|
4
4
|
import { ref as a, computed as s, toValue as A } from "vue";
|
|
5
|
-
import { u as N } from "./runtime-
|
|
5
|
+
import { u as N } from "./runtime-CDEl4QQl.js";
|
|
6
6
|
import { useHead as g, useSeoMeta as w } from "@unhead/vue";
|
|
7
7
|
import { useRoute as E } from "vue-router";
|
|
8
8
|
function M(t) {
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { computed as g, ref as T, watch as k } from "vue";
|
|
2
|
+
import { useRouter as R, useRoute as $ } from "vue-router";
|
|
3
|
+
import { u as w } from "./useAuthkitAppsAuthPageInfo-mv7hOnhi.js";
|
|
4
|
+
import { u as I } from "./useAuthkitUsersProfile-CF7t2Y7T.js";
|
|
5
|
+
import { g as C } from "./runtime-CDEl4QQl.js";
|
|
6
|
+
function j(e, r = "default") {
|
|
7
|
+
const t = document;
|
|
8
|
+
if (t && typeof t.startViewTransition == "function") {
|
|
9
|
+
const n = document.body;
|
|
10
|
+
n.classList.add(`vt-${r}`), t.startViewTransition(() => {
|
|
11
|
+
try {
|
|
12
|
+
e();
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
}).finished.finally(() => {
|
|
16
|
+
n.classList.remove(`vt-${r}`);
|
|
17
|
+
});
|
|
18
|
+
} else
|
|
19
|
+
e();
|
|
20
|
+
}
|
|
21
|
+
function E() {
|
|
22
|
+
const {
|
|
23
|
+
appsData: e,
|
|
24
|
+
appsAuthPageInfoSuccess: r
|
|
25
|
+
} = w(), t = R(), n = g(() => r.value), c = g(() => n.value && e.value.applicationLogoUrl || ""), a = g(() => n.value && e.value.name || "");
|
|
26
|
+
function m() {
|
|
27
|
+
j(() => {
|
|
28
|
+
t.push("/"), window.scrollTo({
|
|
29
|
+
top: 0,
|
|
30
|
+
behavior: "smooth"
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
brandReady: n,
|
|
36
|
+
brandLogoUrl: c,
|
|
37
|
+
brandName: a,
|
|
38
|
+
navigateToAppHome: m
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const A = T({
|
|
42
|
+
key: "",
|
|
43
|
+
name: ""
|
|
44
|
+
});
|
|
45
|
+
function F() {
|
|
46
|
+
function e(r, t) {
|
|
47
|
+
A.value.key = r, A.value.name = t;
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
activeDoc: A,
|
|
51
|
+
setActiveDoc: e
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function x(e) {
|
|
55
|
+
const r = /* @__PURE__ */ new Set();
|
|
56
|
+
r.add(e);
|
|
57
|
+
const t = e.split("/").filter(Boolean);
|
|
58
|
+
for (let n = t.length - 1; n > 0; n--)
|
|
59
|
+
r.add(`/${t.slice(0, n).join("/")}`);
|
|
60
|
+
return [...r];
|
|
61
|
+
}
|
|
62
|
+
function M(e, r) {
|
|
63
|
+
const t = new Set(r);
|
|
64
|
+
return t.has("*") ? !0 : x(e).some((n) => t.has(n));
|
|
65
|
+
}
|
|
66
|
+
function O(e) {
|
|
67
|
+
return e.filter((r) => U(r.publicMatch) === "exact").map((r) => r.permissionKey);
|
|
68
|
+
}
|
|
69
|
+
function U(e) {
|
|
70
|
+
return e === "exact" ? "exact" : "prefix";
|
|
71
|
+
}
|
|
72
|
+
function L(e, r) {
|
|
73
|
+
const t = r.map((a) => a.permissionKey);
|
|
74
|
+
if (t.includes("*"))
|
|
75
|
+
return !0;
|
|
76
|
+
const n = new Set(t), c = new Set(O(r));
|
|
77
|
+
return x(e).some((a) => !(!n.has(a) || c.has(a) && e !== a));
|
|
78
|
+
}
|
|
79
|
+
function W(e, r) {
|
|
80
|
+
const t = e.endsWith("/") ? e.slice(0, -1) : e;
|
|
81
|
+
return t === "" ? !1 : M(t, r) || r.some((n) => n === t ? !0 : n.startsWith(`${t}/`));
|
|
82
|
+
}
|
|
83
|
+
function D(e, r) {
|
|
84
|
+
return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(r) : !1;
|
|
85
|
+
}
|
|
86
|
+
function q(e, r, t) {
|
|
87
|
+
for (let n = e.length - 1; n >= 0; n--) {
|
|
88
|
+
const c = e[n];
|
|
89
|
+
if (D(c.meta, r))
|
|
90
|
+
return c.path;
|
|
91
|
+
}
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
function b(e) {
|
|
95
|
+
return e.split("?")[0].split("#")[0];
|
|
96
|
+
}
|
|
97
|
+
function G(e, r, t) {
|
|
98
|
+
const n = b(r), c = (t == null ? void 0 : t.returnParentOnChildMatch) ?? !1;
|
|
99
|
+
function a(f, p) {
|
|
100
|
+
for (const l of f) {
|
|
101
|
+
if (b(l.path) === p)
|
|
102
|
+
return l.path;
|
|
103
|
+
if (l.children && l.children.length > 0) {
|
|
104
|
+
const o = a(l.children, p);
|
|
105
|
+
if (o)
|
|
106
|
+
return c ? l.path : o;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
const m = a(e, n);
|
|
112
|
+
if (m)
|
|
113
|
+
return m;
|
|
114
|
+
for (const f of e) {
|
|
115
|
+
const p = b(f.path);
|
|
116
|
+
if (n.startsWith(p + "/") || n === p) {
|
|
117
|
+
if (f.children && f.children.length > 0)
|
|
118
|
+
for (const l of f.children) {
|
|
119
|
+
const v = b(l.path);
|
|
120
|
+
if (n.startsWith(v + "/") || n === v)
|
|
121
|
+
return c ? f.path : l.path;
|
|
122
|
+
}
|
|
123
|
+
return f.path;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return t != null && t.fallback ? t.fallback(n) : n;
|
|
127
|
+
}
|
|
128
|
+
function J(e) {
|
|
129
|
+
const r = R(), {
|
|
130
|
+
appsData: t
|
|
131
|
+
} = w(), {
|
|
132
|
+
isLoggedIn: n,
|
|
133
|
+
userProfile: c
|
|
134
|
+
} = I(), a = g(() => {
|
|
135
|
+
var o;
|
|
136
|
+
return !n.value || !c.value ? [] : ((o = c.value.permissions) == null ? void 0 : o.map((s) => s.permissionKey)) || [];
|
|
137
|
+
});
|
|
138
|
+
function m(o) {
|
|
139
|
+
return L(o, t.value.publicRoutes || []);
|
|
140
|
+
}
|
|
141
|
+
function f(o) {
|
|
142
|
+
return n.value ? M(o, a.value) : !1;
|
|
143
|
+
}
|
|
144
|
+
function p(o) {
|
|
145
|
+
var s;
|
|
146
|
+
return {
|
|
147
|
+
path: o.path,
|
|
148
|
+
name: o.name,
|
|
149
|
+
meta: o.meta,
|
|
150
|
+
children: (s = o.children) == null ? void 0 : s.map((d) => p(d))
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function l(o, s) {
|
|
154
|
+
const d = [];
|
|
155
|
+
for (const u of o) {
|
|
156
|
+
if (u.path === "/" || u.path === "/:catchAll(.*)")
|
|
157
|
+
continue;
|
|
158
|
+
const i = u.meta;
|
|
159
|
+
if (D(i, s)) {
|
|
160
|
+
const P = u.path;
|
|
161
|
+
if (m(P) || W(P, a.value)) {
|
|
162
|
+
const h = {
|
|
163
|
+
name: (i == null ? void 0 : i.menuName) || (i == null ? void 0 : i.title) || (typeof u.name == "string" ? u.name : u.path),
|
|
164
|
+
path: u.path,
|
|
165
|
+
icon: (i == null ? void 0 : i.menuIcon) || (i == null ? void 0 : i.icon),
|
|
166
|
+
description: (i == null ? void 0 : i.menuDescription) || (i == null ? void 0 : i.description),
|
|
167
|
+
hidden: i == null ? void 0 : i.hidden
|
|
168
|
+
};
|
|
169
|
+
if (u.children && u.children.length > 0) {
|
|
170
|
+
const y = l(u.children, s);
|
|
171
|
+
y.length > 0 && (h.children = y);
|
|
172
|
+
}
|
|
173
|
+
d.push(h);
|
|
174
|
+
}
|
|
175
|
+
} else if (u.children && u.children.length > 0) {
|
|
176
|
+
const P = l(u.children, s);
|
|
177
|
+
d.push(...P);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return d;
|
|
181
|
+
}
|
|
182
|
+
return {
|
|
183
|
+
menus: g(() => {
|
|
184
|
+
if (!e)
|
|
185
|
+
return [];
|
|
186
|
+
const o = r.getRoutes(), s = o.find((h) => h.path === "/"), d = s != null && s.children ? s.children.map((h) => p(h)) : [], u = new Set(d.map((h) => h.path)), P = o.filter((h) => h.path === "/" || h.path === "/:catchAll(.*)" || u.has(h.path) ? !1 : h.path.split("/").filter((K) => K).length === 1).map(p), S = [...d, ...P];
|
|
187
|
+
return l(S, e);
|
|
188
|
+
}),
|
|
189
|
+
isRoutePublic: m,
|
|
190
|
+
hasPermission: (o) => m(o) ? !0 : f(o),
|
|
191
|
+
isLoggedIn: n
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
function Q() {
|
|
195
|
+
const e = R(), r = $(), {
|
|
196
|
+
appsData: t,
|
|
197
|
+
appsAuthPageInfoSuccess: n
|
|
198
|
+
} = w(), {
|
|
199
|
+
userProfile: c,
|
|
200
|
+
isLoggedIn: a,
|
|
201
|
+
usersProfileReady: m
|
|
202
|
+
} = I();
|
|
203
|
+
function f() {
|
|
204
|
+
return t.value.publicRoutes || [];
|
|
205
|
+
}
|
|
206
|
+
function p(s) {
|
|
207
|
+
return L(s, f());
|
|
208
|
+
}
|
|
209
|
+
function l(s) {
|
|
210
|
+
var u;
|
|
211
|
+
if (!a.value || !c.value)
|
|
212
|
+
return !1;
|
|
213
|
+
const d = ((u = c.value.permissions) == null ? void 0 : u.map((i) => i.permissionKey)) || [];
|
|
214
|
+
return M(s, d);
|
|
215
|
+
}
|
|
216
|
+
function v() {
|
|
217
|
+
const s = C().config.accessDeniedUrl || "/";
|
|
218
|
+
e.replace(s);
|
|
219
|
+
}
|
|
220
|
+
function o(s) {
|
|
221
|
+
p(s) || !n.value || !m.value || (!a.value || !l(s)) && v();
|
|
222
|
+
}
|
|
223
|
+
return k([() => r.path, n, m, a, () => f().map((s) => `${s.permissionKey}:${s.publicMatch || "prefix"}`).join("|"), () => {
|
|
224
|
+
var s;
|
|
225
|
+
return (((s = c.value) == null ? void 0 : s.permissions) || []).map((d) => d.permissionKey).join("|");
|
|
226
|
+
}], () => {
|
|
227
|
+
o(r.path);
|
|
228
|
+
}, {
|
|
229
|
+
immediate: !0
|
|
230
|
+
}), {
|
|
231
|
+
isRoutePublic: p,
|
|
232
|
+
hasPermission: l
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export {
|
|
236
|
+
q as a,
|
|
237
|
+
M as b,
|
|
238
|
+
x as c,
|
|
239
|
+
E as d,
|
|
240
|
+
J as e,
|
|
241
|
+
G as f,
|
|
242
|
+
b as g,
|
|
243
|
+
W as h,
|
|
244
|
+
L as i,
|
|
245
|
+
Q as j,
|
|
246
|
+
O as r,
|
|
247
|
+
F as u,
|
|
248
|
+
j as w
|
|
249
|
+
};
|
|
@@ -3,7 +3,7 @@ import { d as V } from "./useBillingStatusOptions-C8fwW-AI.js";
|
|
|
3
3
|
import { g as $ } from "./apiClients-8_c5cDW5.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { Message as b } from "@arco-design/web-vue";
|
|
6
|
-
import { u as _ } from "./useEnsureAuthenticated-
|
|
6
|
+
import { u as _ } from "./useEnsureAuthenticated-Q7EHguY4.js";
|
|
7
7
|
function D(e) {
|
|
8
8
|
var u;
|
|
9
9
|
const i = (u = e == null ? void 0 : e.metadata) == null ? void 0 : u.originalPrice;
|
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-
|
|
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-BQgy_CeZ.js";
|
|
2
2
|
export {
|
|
3
3
|
a as UserAccountMenu,
|
|
4
4
|
n as UserAvatar,
|