@huyooo/ui 0.5.51 → 0.5.52
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/WidthContainer-Bz4U5oVZ.js +585 -0
- package/dist/common.js +1 -1
- package/dist/composables/Authkit/useAuthMenu.d.ts +11 -0
- package/dist/composables.d.ts +1 -1
- package/dist/composables.js +19 -17
- package/dist/index.js +160 -158
- package/dist/style.css +1 -1
- package/dist/{useSEO-CEM3X8QG.js → useSEO-gIh42v6e.js} +233 -197
- package/package.json +1 -1
- package/dist/WidthContainer-XtTUnJB8.js +0 -608
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as I, computed as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { u as
|
|
4
|
-
import { a as
|
|
1
|
+
import { ref as I, computed as d, watch as V, toValue as G, isRef 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
|
+
import { useRouter as x, useRoute as R } from "vue-router";
|
|
3
|
+
import { u as U } from "./useAuthkitAppsAuthPageInfo-CoQi1eR1.js";
|
|
4
|
+
import { a as D } from "./useAuthkitUsersProfile-ChX1jsty.js";
|
|
5
5
|
const v = I({
|
|
6
6
|
key: "",
|
|
7
7
|
name: ""
|
|
8
8
|
});
|
|
9
|
-
function
|
|
9
|
+
function Se() {
|
|
10
10
|
function e(t, n) {
|
|
11
11
|
v.value.key = t, v.value.name = n;
|
|
12
12
|
}
|
|
@@ -15,7 +15,7 @@ function we() {
|
|
|
15
15
|
setActiveDoc: e
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ae(e, t = "default") {
|
|
19
19
|
const n = document;
|
|
20
20
|
if (n && typeof n.startViewTransition == "function") {
|
|
21
21
|
const r = document.body;
|
|
@@ -30,140 +30,174 @@ function Se(e, t = "default") {
|
|
|
30
30
|
} else
|
|
31
31
|
e();
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function K(e, t) {
|
|
34
34
|
return Array.isArray(e == null ? void 0 : e.menuTypes) ? e.menuTypes.includes(t) : !1;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Pe(e, t, n) {
|
|
37
37
|
for (let r = e.length - 1; r >= 0; r--) {
|
|
38
38
|
const o = e[r];
|
|
39
|
-
if (
|
|
39
|
+
if (K(o.meta, t))
|
|
40
40
|
return o.path;
|
|
41
41
|
}
|
|
42
42
|
return n;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
44
|
+
function A(e) {
|
|
45
|
+
return e.split("?")[0].split("#")[0];
|
|
46
|
+
}
|
|
47
|
+
function $e(e, t, n) {
|
|
48
|
+
const r = A(t), o = (n == null ? void 0 : n.returnParentOnChildMatch) ?? !1;
|
|
49
|
+
function s(c, a) {
|
|
50
|
+
for (const l of c) {
|
|
51
|
+
if (A(l.path) === a)
|
|
52
|
+
return l.path;
|
|
53
|
+
if (l.children && l.children.length > 0) {
|
|
54
|
+
const p = s(l.children, a);
|
|
55
|
+
if (p)
|
|
56
|
+
return o ? l.path : p;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const i = s(e, r);
|
|
62
|
+
if (i)
|
|
63
|
+
return i;
|
|
64
|
+
for (const c of e) {
|
|
65
|
+
const a = A(c.path);
|
|
66
|
+
if (r.startsWith(a + "/") || r === a) {
|
|
67
|
+
if (c.children && c.children.length > 0)
|
|
68
|
+
for (const l of c.children) {
|
|
69
|
+
const y = A(l.path);
|
|
70
|
+
if (r.startsWith(y + "/") || r === y)
|
|
71
|
+
return o ? c.path : l.path;
|
|
72
|
+
}
|
|
73
|
+
return c.path;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return n != null && n.fallback ? n.fallback(r) : r;
|
|
77
|
+
}
|
|
78
|
+
function Te(e) {
|
|
79
|
+
const t = x(), {
|
|
46
80
|
appsData: n
|
|
47
|
-
} =
|
|
81
|
+
} = U(), {
|
|
48
82
|
isLoggedIn: r,
|
|
49
83
|
userProfile: o
|
|
50
|
-
} =
|
|
51
|
-
var
|
|
52
|
-
return !r.value || !o.value ? [] : ((
|
|
84
|
+
} = D(), s = d(() => {
|
|
85
|
+
var p;
|
|
86
|
+
return !r.value || !o.value ? [] : ((p = o.value.permissions) == null ? void 0 : p.map((u) => u.permissionKey)) || [];
|
|
53
87
|
});
|
|
54
|
-
function i(
|
|
55
|
-
return (n.value.publicRoutes || []).some((
|
|
88
|
+
function i(p) {
|
|
89
|
+
return (n.value.publicRoutes || []).some((m) => m.permissionKey === p);
|
|
56
90
|
}
|
|
57
|
-
function c(
|
|
58
|
-
return r.value ? s.value.includes(
|
|
91
|
+
function c(p) {
|
|
92
|
+
return r.value ? s.value.includes(p) : !1;
|
|
59
93
|
}
|
|
60
|
-
function
|
|
61
|
-
var
|
|
94
|
+
function a(p) {
|
|
95
|
+
var u;
|
|
62
96
|
return {
|
|
63
|
-
path:
|
|
64
|
-
name:
|
|
65
|
-
meta:
|
|
66
|
-
children: (
|
|
97
|
+
path: p.path,
|
|
98
|
+
name: p.name,
|
|
99
|
+
meta: p.meta,
|
|
100
|
+
children: (u = p.children) == null ? void 0 : u.map((m) => a(m))
|
|
67
101
|
};
|
|
68
102
|
}
|
|
69
|
-
function p
|
|
70
|
-
const
|
|
71
|
-
for (const
|
|
72
|
-
if (
|
|
103
|
+
function l(p, u) {
|
|
104
|
+
const m = [];
|
|
105
|
+
for (const h of p) {
|
|
106
|
+
if (h.path === "/" || h.path === "/:catchAll(.*)")
|
|
73
107
|
continue;
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
const w =
|
|
108
|
+
const f = h.meta;
|
|
109
|
+
if (K(f, u)) {
|
|
110
|
+
const w = h.path;
|
|
77
111
|
if (i(w) || c(w)) {
|
|
78
112
|
const g = {
|
|
79
|
-
name: (
|
|
80
|
-
path:
|
|
81
|
-
icon: (
|
|
82
|
-
description: (
|
|
83
|
-
hidden:
|
|
113
|
+
name: (f == null ? void 0 : f.menuName) || (f == null ? void 0 : f.title) || (typeof h.name == "string" ? h.name : h.path),
|
|
114
|
+
path: h.path,
|
|
115
|
+
icon: (f == null ? void 0 : f.menuIcon) || (f == null ? void 0 : f.icon),
|
|
116
|
+
description: (f == null ? void 0 : f.menuDescription) || (f == null ? void 0 : f.description),
|
|
117
|
+
hidden: f == null ? void 0 : f.hidden
|
|
84
118
|
};
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
119
|
+
if (h.children && h.children.length > 0) {
|
|
120
|
+
const M = l(h.children, u);
|
|
121
|
+
M.length > 0 && (g.children = M);
|
|
88
122
|
}
|
|
89
|
-
|
|
123
|
+
m.push(g);
|
|
90
124
|
}
|
|
91
|
-
} else if (
|
|
92
|
-
const w =
|
|
93
|
-
|
|
125
|
+
} else if (h.children && h.children.length > 0) {
|
|
126
|
+
const w = l(h.children, u);
|
|
127
|
+
m.push(...w);
|
|
94
128
|
}
|
|
95
129
|
}
|
|
96
|
-
return
|
|
130
|
+
return m;
|
|
97
131
|
}
|
|
98
132
|
return {
|
|
99
|
-
menus:
|
|
133
|
+
menus: d(() => {
|
|
100
134
|
if (!e)
|
|
101
135
|
return [];
|
|
102
|
-
const
|
|
103
|
-
return console.log(
|
|
136
|
+
const p = t.getRoutes(), u = p.find((g) => g.path === "/"), m = u != null && u.children ? u.children.map((g) => a(g)) : [], h = new Set(m.map((g) => g.path)), w = p.filter((g) => g.path === "/" || g.path === "/:catchAll(.*)" || h.has(g.path) ? !1 : g.path.split("/").filter((W) => W).length === 1).map(a), T = [...m, ...w];
|
|
137
|
+
return console.log(l(T, e), "过滤菜单"), l(T, e);
|
|
104
138
|
}),
|
|
105
139
|
isRoutePublic: i,
|
|
106
|
-
hasPermission: (
|
|
140
|
+
hasPermission: (p) => i(p) ? !0 : c(p),
|
|
107
141
|
isLoggedIn: r
|
|
108
142
|
};
|
|
109
143
|
}
|
|
110
|
-
function
|
|
111
|
-
const e =
|
|
144
|
+
function Me() {
|
|
145
|
+
const e = x(), t = R(), {
|
|
112
146
|
appsAuthPageInfoApi: n,
|
|
113
147
|
appsData: r,
|
|
114
148
|
appsAuthPageInfoSuccess: o
|
|
115
|
-
} =
|
|
149
|
+
} = U(), {
|
|
116
150
|
userProfile: s,
|
|
117
151
|
isLoggedIn: i,
|
|
118
152
|
usersProfileSuccess: c
|
|
119
|
-
} =
|
|
120
|
-
function
|
|
121
|
-
return (r.value.publicRoutes || []).some((
|
|
153
|
+
} = D(), a = I(!1);
|
|
154
|
+
function l(u) {
|
|
155
|
+
return (r.value.publicRoutes || []).some((h) => h.permissionKey === u);
|
|
122
156
|
}
|
|
123
|
-
function
|
|
124
|
-
var
|
|
125
|
-
return !i.value || !s.value ? !1 : (((
|
|
157
|
+
function y(u) {
|
|
158
|
+
var h;
|
|
159
|
+
return !i.value || !s.value ? !1 : (((h = s.value.permissions) == null ? void 0 : h.map((f) => f.permissionKey)) || []).includes(u);
|
|
126
160
|
}
|
|
127
|
-
function
|
|
128
|
-
var
|
|
161
|
+
function p(u) {
|
|
162
|
+
var m, h;
|
|
129
163
|
if (!o.value) {
|
|
130
|
-
console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成",
|
|
164
|
+
console.log("权限检查跳过:appsAuthPageInfoSuccess 未加载完成", u);
|
|
131
165
|
return;
|
|
132
166
|
}
|
|
133
|
-
if (
|
|
134
|
-
console.log("权限检查通过:公开路由",
|
|
167
|
+
if (a.value = !0, l(u)) {
|
|
168
|
+
console.log("权限检查通过:公开路由", u), a.value = !1;
|
|
135
169
|
return;
|
|
136
170
|
}
|
|
137
171
|
if (!c.value) {
|
|
138
|
-
console.log("权限检查跳过:usersProfileSuccess 未加载完成,等待...",
|
|
172
|
+
console.log("权限检查跳过:usersProfileSuccess 未加载完成,等待...", u), a.value = !1;
|
|
139
173
|
return;
|
|
140
174
|
}
|
|
141
175
|
if (!i.value) {
|
|
142
|
-
console.log("权限检查失败:未登录,重定向到首页",
|
|
176
|
+
console.log("权限检查失败:未登录,重定向到首页", u), e.replace("/"), a.value = !1;
|
|
143
177
|
return;
|
|
144
178
|
}
|
|
145
|
-
|
|
146
|
-
permissions: (
|
|
147
|
-
}), e.replace("/")),
|
|
179
|
+
y(u) ? console.log("权限检查通过:有权限", u) : (console.log("权限检查失败:无权限,重定向到首页", u, {
|
|
180
|
+
permissions: (h = (m = s.value) == null ? void 0 : m.permissions) == null ? void 0 : h.map((f) => f.permissionKey)
|
|
181
|
+
}), e.replace("/")), a.value = !1;
|
|
148
182
|
}
|
|
149
|
-
return n(),
|
|
150
|
-
|
|
151
|
-
}),
|
|
152
|
-
|
|
183
|
+
return n(), V(() => t.path, (u) => {
|
|
184
|
+
p(u);
|
|
185
|
+
}), V([o, c], ([u]) => {
|
|
186
|
+
u && p(t.path);
|
|
153
187
|
}), {
|
|
154
|
-
isChecking:
|
|
155
|
-
isRoutePublic:
|
|
156
|
-
hasPermission:
|
|
188
|
+
isChecking: a,
|
|
189
|
+
isRoutePublic: l,
|
|
190
|
+
hasPermission: y
|
|
157
191
|
};
|
|
158
192
|
}
|
|
159
|
-
const
|
|
193
|
+
const te = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), ne = /* @__PURE__ */ new Set(["title", "titleTemplate", "script", "style", "noscript"]), ve = /* @__PURE__ */ new Set([
|
|
160
194
|
"base",
|
|
161
195
|
"meta",
|
|
162
196
|
"link",
|
|
163
197
|
"style",
|
|
164
198
|
"script",
|
|
165
199
|
"noscript"
|
|
166
|
-
]),
|
|
200
|
+
]), je = /* @__PURE__ */ new Set([
|
|
167
201
|
"title",
|
|
168
202
|
"base",
|
|
169
203
|
"htmlAttrs",
|
|
@@ -173,7 +207,7 @@ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te
|
|
|
173
207
|
"style",
|
|
174
208
|
"script",
|
|
175
209
|
"noscript"
|
|
176
|
-
]),
|
|
210
|
+
]), re = /* @__PURE__ */ new Set(["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"]), oe = /* @__PURE__ */ new Set(["key", "tagPosition", "tagPriority", "tagDuplicateStrategy", "innerHTML", "textContent", "processTemplateParams"]), Oe = /* @__PURE__ */ new Set(["templateParams", "htmlAttrs", "bodyAttrs"]), E = /* @__PURE__ */ new Set([
|
|
177
211
|
"theme-color",
|
|
178
212
|
"google-site-verification",
|
|
179
213
|
"og",
|
|
@@ -187,7 +221,7 @@ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te
|
|
|
187
221
|
OG: /* @__PURE__ */ new Set(["og", "book", "article", "profile", "fb"]),
|
|
188
222
|
MEDIA: /* @__PURE__ */ new Set(["ogImage", "ogVideo", "ogAudio", "twitterImage"]),
|
|
189
223
|
HTTP_EQUIV: /* @__PURE__ */ new Set(["contentType", "defaultStyle", "xUaCompatible"])
|
|
190
|
-
},
|
|
224
|
+
}, se = {
|
|
191
225
|
articleExpirationTime: "article:expiration_time",
|
|
192
226
|
articleModifiedTime: "article:modified_time",
|
|
193
227
|
articlePublishedTime: "article:published_time",
|
|
@@ -206,12 +240,12 @@ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te
|
|
|
206
240
|
msapplicationConfig: "msapplication-Config",
|
|
207
241
|
msapplicationTileColor: "msapplication-TileColor",
|
|
208
242
|
msapplicationTileImage: "msapplication-TileImage"
|
|
209
|
-
},
|
|
243
|
+
}, L = {
|
|
210
244
|
appleItunesApp: {
|
|
211
245
|
unpack: {
|
|
212
246
|
entrySeparator: ", ",
|
|
213
247
|
// @ts-expect-error untyped
|
|
214
|
-
resolve: ({ key: e, value: t }) => `${
|
|
248
|
+
resolve: ({ key: e, value: t }) => `${b(e)}=${t}`
|
|
215
249
|
}
|
|
216
250
|
},
|
|
217
251
|
refresh: {
|
|
@@ -226,7 +260,7 @@ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te
|
|
|
226
260
|
unpack: {
|
|
227
261
|
entrySeparator: ", ",
|
|
228
262
|
// @ts-expect-error untyped
|
|
229
|
-
resolve: ({ key: e, value: t }) => typeof t == "boolean" ?
|
|
263
|
+
resolve: ({ key: e, value: t }) => typeof t == "boolean" ? b(e) : `${b(e)}:${t}`
|
|
230
264
|
}
|
|
231
265
|
},
|
|
232
266
|
contentSecurityPolicy: {
|
|
@@ -234,66 +268,66 @@ const ee = /* @__PURE__ */ new Set(["link", "style", "script", "noscript"]), te
|
|
|
234
268
|
unpack: {
|
|
235
269
|
entrySeparator: "; ",
|
|
236
270
|
// @ts-expect-error untyped
|
|
237
|
-
resolve: ({ key: e, value: t }) => `${
|
|
271
|
+
resolve: ({ key: e, value: t }) => `${b(e)} ${t}`
|
|
238
272
|
}
|
|
239
273
|
},
|
|
240
274
|
charset: {}
|
|
241
275
|
};
|
|
242
|
-
function
|
|
276
|
+
function b(e) {
|
|
243
277
|
const t = e.replace(/([A-Z])/g, "-$1").toLowerCase(), n = t.indexOf("-");
|
|
244
278
|
return n === -1 ? t : S.META.has(t.slice(0, n)) || S.OG.has(t.slice(0, n)) ? e.replace(/([A-Z])/g, ":$1").toLowerCase() : t;
|
|
245
279
|
}
|
|
246
|
-
function
|
|
280
|
+
function k(e) {
|
|
247
281
|
return Object.fromEntries(Object.entries(e).filter(([t, n]) => String(n) !== "false" && t));
|
|
248
282
|
}
|
|
249
283
|
function j(e) {
|
|
250
|
-
return Array.isArray(e) ? e.map(j) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([t, n]) => [
|
|
284
|
+
return Array.isArray(e) ? e.map(j) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).map(([t, n]) => [b(t), j(n)]));
|
|
251
285
|
}
|
|
252
286
|
function H(e, t = {}) {
|
|
253
287
|
const { entrySeparator: n = "", keyValueSeparator: r = "", wrapValue: o, resolve: s } = t;
|
|
254
288
|
return Object.entries(e).map(([i, c]) => {
|
|
255
289
|
if (s) {
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
return
|
|
290
|
+
const l = s({ key: i, value: c });
|
|
291
|
+
if (l !== void 0)
|
|
292
|
+
return l;
|
|
259
293
|
}
|
|
260
|
-
const
|
|
261
|
-
return `${i}${r}${
|
|
294
|
+
const a = typeof c == "object" ? H(c, t) : typeof c == "number" ? c.toString() : typeof c == "string" && o ? `${o}${c.replace(new RegExp(o, "g"), `\\${o}`)}${o}` : c;
|
|
295
|
+
return `${i}${r}${a}`;
|
|
262
296
|
}).join(n);
|
|
263
297
|
}
|
|
264
|
-
function
|
|
265
|
-
const n =
|
|
298
|
+
function _(e, t) {
|
|
299
|
+
const n = k(t), r = b(e), o = q(r);
|
|
266
300
|
if (!E.has(r))
|
|
267
301
|
return [{ [o]: r, ...n }];
|
|
268
302
|
const s = Object.fromEntries(
|
|
269
303
|
Object.entries(n).map(([i, c]) => [`${e}${i === "url" ? "" : `${i[0].toUpperCase()}${i.slice(1)}`}`, c])
|
|
270
304
|
);
|
|
271
|
-
return
|
|
272
|
-
var
|
|
273
|
-
return (((
|
|
305
|
+
return P(s || {}).sort((i, c) => {
|
|
306
|
+
var a, l;
|
|
307
|
+
return (((a = i[o]) == null ? void 0 : a.length) || 0) - (((l = c[o]) == null ? void 0 : l.length) || 0);
|
|
274
308
|
});
|
|
275
309
|
}
|
|
276
|
-
function
|
|
310
|
+
function q(e) {
|
|
277
311
|
var r;
|
|
278
|
-
if (((r =
|
|
312
|
+
if (((r = L[e]) == null ? void 0 : r.metaKey) === "http-equiv" || S.HTTP_EQUIV.has(e))
|
|
279
313
|
return "http-equiv";
|
|
280
|
-
const t =
|
|
314
|
+
const t = b(e), n = t.indexOf(":");
|
|
281
315
|
return n === -1 ? "name" : S.OG.has(t.slice(0, n)) ? "property" : "name";
|
|
282
316
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
317
|
+
function ie(e) {
|
|
318
|
+
return se[e] || b(e);
|
|
285
319
|
}
|
|
286
|
-
function
|
|
320
|
+
function ce(e, t) {
|
|
287
321
|
var n;
|
|
288
322
|
return t === "refresh" ? `${e.seconds};url=${e.url}` : H(j(e), {
|
|
289
323
|
keyValueSeparator: "=",
|
|
290
324
|
entrySeparator: ", ",
|
|
291
325
|
resolve: ({ value: r, key: o }) => r === null ? "" : typeof r == "boolean" ? o : void 0,
|
|
292
326
|
// @ts-expect-error untyped
|
|
293
|
-
...(n =
|
|
327
|
+
...(n = L[t]) == null ? void 0 : n.unpack
|
|
294
328
|
});
|
|
295
329
|
}
|
|
296
|
-
function
|
|
330
|
+
function P(e) {
|
|
297
331
|
const t = [], n = {};
|
|
298
332
|
for (const [o, s] of Object.entries(e)) {
|
|
299
333
|
if (Array.isArray(s)) {
|
|
@@ -305,94 +339,94 @@ function A(e) {
|
|
|
305
339
|
}
|
|
306
340
|
for (const i of s)
|
|
307
341
|
if (typeof i == "object" && i !== null) {
|
|
308
|
-
const c = [],
|
|
309
|
-
for (const [
|
|
310
|
-
const
|
|
311
|
-
(
|
|
342
|
+
const c = [], a = [];
|
|
343
|
+
for (const [l, y] of Object.entries(i)) {
|
|
344
|
+
const p = `${o}${l === "url" ? "" : `:${l}`}`, u = P({ [p]: y });
|
|
345
|
+
(l === "url" ? c : a).push(...u);
|
|
312
346
|
}
|
|
313
|
-
t.push(...c, ...
|
|
347
|
+
t.push(...c, ...a);
|
|
314
348
|
} else
|
|
315
|
-
t.push(...typeof i == "string" ?
|
|
349
|
+
t.push(...typeof i == "string" ? P({ [o]: i }) : _(o, i));
|
|
316
350
|
continue;
|
|
317
351
|
}
|
|
318
352
|
if (typeof s == "object" && s)
|
|
319
353
|
if (S.MEDIA.has(o)) {
|
|
320
|
-
const i = o.startsWith("twitter") ? "twitter" : "og", c = o.replace(/^(og|twitter)/, "").toLowerCase(),
|
|
354
|
+
const i = o.startsWith("twitter") ? "twitter" : "og", c = o.replace(/^(og|twitter)/, "").toLowerCase(), a = i === "twitter" ? "name" : "property";
|
|
321
355
|
s.url && t.push({
|
|
322
|
-
[
|
|
356
|
+
[a]: `${i}:${c}`,
|
|
323
357
|
content: s.url
|
|
324
358
|
}), s.secureUrl && t.push({
|
|
325
|
-
[
|
|
359
|
+
[a]: `${i}:${c}:secure_url`,
|
|
326
360
|
content: s.secureUrl
|
|
327
361
|
});
|
|
328
|
-
for (const [
|
|
329
|
-
|
|
330
|
-
[
|
|
362
|
+
for (const [l, y] of Object.entries(s))
|
|
363
|
+
l !== "url" && l !== "secureUrl" && t.push({
|
|
364
|
+
[a]: `${i}:${c}:${l}`,
|
|
331
365
|
// @ts-expect-error untyped
|
|
332
|
-
content:
|
|
366
|
+
content: y
|
|
333
367
|
});
|
|
334
|
-
} else E.has(
|
|
368
|
+
} else E.has(b(o)) ? t.push(..._(o, s)) : n[o] = k(s);
|
|
335
369
|
else
|
|
336
370
|
n[o] = s;
|
|
337
371
|
}
|
|
338
372
|
const r = Object.entries(n).map(([o, s]) => {
|
|
339
373
|
if (o === "charset")
|
|
340
374
|
return { charset: s === null ? "_null" : s };
|
|
341
|
-
const i =
|
|
342
|
-
return i === "http-equiv" ? { "http-equiv": c, content:
|
|
375
|
+
const i = q(o), c = ie(o), a = s === null ? "_null" : typeof s == "object" ? ce(s, o) : typeof s == "number" ? s.toString() : s;
|
|
376
|
+
return i === "http-equiv" ? { "http-equiv": c, content: a } : { [i]: c, content: a };
|
|
343
377
|
});
|
|
344
378
|
return [...t, ...r].map(
|
|
345
379
|
(o) => "content" in o && o.content === "_null" ? { ...o, content: null } : o
|
|
346
380
|
);
|
|
347
381
|
}
|
|
348
|
-
const
|
|
382
|
+
const ae = {
|
|
349
383
|
key: "flatMeta",
|
|
350
384
|
hooks: {
|
|
351
385
|
"entries:normalize": (e) => {
|
|
352
386
|
const t = [];
|
|
353
|
-
e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push(
|
|
387
|
+
e.tags = e.tags.map((n) => n.tag !== "_flatMeta" ? n : (t.push(P(n.props).map((r) => ({
|
|
354
388
|
...n,
|
|
355
389
|
tag: "meta",
|
|
356
390
|
props: r
|
|
357
391
|
}))), !1)).filter(Boolean).concat(...t);
|
|
358
392
|
}
|
|
359
393
|
}
|
|
360
|
-
},
|
|
394
|
+
}, le = ["name", "property", "http-equiv"], ue = /* @__PURE__ */ new Set([
|
|
361
395
|
"viewport",
|
|
362
396
|
"description",
|
|
363
397
|
"keywords",
|
|
364
398
|
"robots"
|
|
365
399
|
]);
|
|
366
|
-
function
|
|
400
|
+
function Ie(e) {
|
|
367
401
|
const t = e.split(":");
|
|
368
402
|
return t.length ? E.has(t[1]) : !1;
|
|
369
403
|
}
|
|
370
|
-
function
|
|
404
|
+
function Ee(e) {
|
|
371
405
|
const { props: t, tag: n } = e;
|
|
372
|
-
if (
|
|
406
|
+
if (re.has(n))
|
|
373
407
|
return n;
|
|
374
408
|
if (n === "link" && t.rel === "canonical")
|
|
375
409
|
return "canonical";
|
|
376
410
|
if (t.charset)
|
|
377
411
|
return "charset";
|
|
378
412
|
if (e.tag === "meta") {
|
|
379
|
-
for (const r of
|
|
413
|
+
for (const r of le)
|
|
380
414
|
if (t[r] !== void 0) {
|
|
381
|
-
const o = t[r], s = o.includes(":"), i =
|
|
382
|
-
return `${n}:${o}${
|
|
415
|
+
const o = t[r], s = o.includes(":"), i = ue.has(o), a = !(s || i) && e.key ? `:key:${e.key}` : "";
|
|
416
|
+
return `${n}:${o}${a}`;
|
|
383
417
|
}
|
|
384
418
|
}
|
|
385
419
|
if (e.key)
|
|
386
420
|
return `${n}:key:${e.key}`;
|
|
387
421
|
if (t.id)
|
|
388
422
|
return `${n}:id:${t.id}`;
|
|
389
|
-
if (
|
|
423
|
+
if (ne.has(n)) {
|
|
390
424
|
const r = e.textContent || e.innerHTML;
|
|
391
425
|
if (r)
|
|
392
426
|
return `${n}:content:${r}`;
|
|
393
427
|
}
|
|
394
428
|
}
|
|
395
|
-
function
|
|
429
|
+
function Ce(e) {
|
|
396
430
|
const t = e._h || e._d;
|
|
397
431
|
if (t)
|
|
398
432
|
return t;
|
|
@@ -412,13 +446,13 @@ function $(e, t, n) {
|
|
|
412
446
|
}
|
|
413
447
|
return o;
|
|
414
448
|
}
|
|
415
|
-
function
|
|
449
|
+
function pe(e, t) {
|
|
416
450
|
const n = e === "style" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set();
|
|
417
451
|
function r(o) {
|
|
418
452
|
const s = o.trim();
|
|
419
453
|
if (s)
|
|
420
454
|
if (e === "style") {
|
|
421
|
-
const [i, ...c] = s.split(":").map((
|
|
455
|
+
const [i, ...c] = s.split(":").map((a) => a.trim());
|
|
422
456
|
i && c.length && n.set(i, c.join(":"));
|
|
423
457
|
} else
|
|
424
458
|
s.split(" ").filter(Boolean).forEach((i) => n.add(i));
|
|
@@ -427,17 +461,17 @@ function ue(e, t) {
|
|
|
427
461
|
s && s !== "false" && (e === "style" ? n.set(o.trim(), s) : r(o));
|
|
428
462
|
}), n;
|
|
429
463
|
}
|
|
430
|
-
function
|
|
464
|
+
function fe(e, t) {
|
|
431
465
|
return e.props = e.props || {}, t ? e.tag === "templateParams" ? (e.props = t, e) : (Object.entries(t).forEach(([n, r]) => {
|
|
432
466
|
if (r === null) {
|
|
433
467
|
e.props[n] = null;
|
|
434
468
|
return;
|
|
435
469
|
}
|
|
436
470
|
if (n === "class" || n === "style") {
|
|
437
|
-
e.props[n] =
|
|
471
|
+
e.props[n] = pe(n, r);
|
|
438
472
|
return;
|
|
439
473
|
}
|
|
440
|
-
if (
|
|
474
|
+
if (oe.has(n)) {
|
|
441
475
|
if (["textContent", "innerHTML"].includes(n) && typeof r == "object") {
|
|
442
476
|
let i = t.type;
|
|
443
477
|
if (t.type || (i = "application/json"), !(i != null && i.endsWith("json")) && i !== "speculationrules")
|
|
@@ -451,11 +485,11 @@ function pe(e, t) {
|
|
|
451
485
|
o === "true" || o === "" ? e.props[n] = s ? o : !0 : !r && s && o === "false" ? e.props[n] = "false" : r !== void 0 && (e.props[n] = r);
|
|
452
486
|
}), e) : e;
|
|
453
487
|
}
|
|
454
|
-
function
|
|
455
|
-
const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r =
|
|
456
|
-
return r.key &&
|
|
488
|
+
function he(e, t) {
|
|
489
|
+
const n = typeof t == "object" && typeof t != "function" ? t : { [e === "script" || e === "noscript" || e === "style" ? "innerHTML" : "textContent"]: t }, r = fe({ tag: e, props: {} }, n);
|
|
490
|
+
return r.key && te.has(r.tag) && (r.props["data-hid"] = r._h = r.key), r.tag === "script" && typeof r.innerHTML == "object" && (r.innerHTML = JSON.stringify(r.innerHTML), r.props.type = r.props.type || "application/json"), Array.isArray(r.props.content) ? r.props.content.map((o) => ({ ...r, props: { ...r.props, content: o } })) : r;
|
|
457
491
|
}
|
|
458
|
-
function
|
|
492
|
+
function Ve(e, t) {
|
|
459
493
|
if (!e)
|
|
460
494
|
return [];
|
|
461
495
|
typeof e == "function" && (e = e());
|
|
@@ -469,58 +503,58 @@ function Oe(e, t) {
|
|
|
469
503
|
return e = $(e, n), Object.entries(e || {}).forEach(([o, s]) => {
|
|
470
504
|
if (s !== void 0)
|
|
471
505
|
for (const i of Array.isArray(s) ? s : [s])
|
|
472
|
-
r.push(
|
|
506
|
+
r.push(he(o, i));
|
|
473
507
|
}), r.flat();
|
|
474
508
|
}
|
|
475
|
-
const me = (e, t) =>
|
|
509
|
+
const me = (e, t) => B(t) ? G(t) : t, z = "usehead";
|
|
476
510
|
// @__NO_SIDE_EFFECTS__
|
|
477
|
-
function
|
|
511
|
+
function _e(e) {
|
|
478
512
|
return {
|
|
479
513
|
install(n) {
|
|
480
|
-
n.config.globalProperties.$unhead = e, n.config.globalProperties.$head = e, n.provide(
|
|
514
|
+
n.config.globalProperties.$unhead = e, n.config.globalProperties.$head = e, n.provide(z, e);
|
|
481
515
|
}
|
|
482
516
|
}.install;
|
|
483
517
|
}
|
|
484
518
|
// @__NO_SIDE_EFFECTS__
|
|
485
|
-
function
|
|
486
|
-
if (
|
|
487
|
-
const e =
|
|
519
|
+
function N() {
|
|
520
|
+
if (F()) {
|
|
521
|
+
const e = J(z);
|
|
488
522
|
if (!e)
|
|
489
523
|
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
490
524
|
return e;
|
|
491
525
|
}
|
|
492
526
|
throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.");
|
|
493
527
|
}
|
|
494
|
-
function
|
|
495
|
-
const n = t.head || /* @__PURE__ */
|
|
528
|
+
function C(e, t = {}) {
|
|
529
|
+
const n = t.head || /* @__PURE__ */ N();
|
|
496
530
|
return n.ssr ? n.push(e || {}, t) : de(n, e, t);
|
|
497
531
|
}
|
|
498
532
|
function de(e, t, n = {}) {
|
|
499
533
|
const r = I(!1);
|
|
500
534
|
let o;
|
|
501
|
-
return
|
|
535
|
+
return Q(() => {
|
|
502
536
|
const i = r.value ? {} : $(t, me);
|
|
503
537
|
o ? o.patch(i) : o = e.push(i, n);
|
|
504
|
-
}),
|
|
538
|
+
}), Z() && (X(() => {
|
|
505
539
|
o.dispose();
|
|
506
|
-
}), X(() => {
|
|
507
|
-
r.value = !0;
|
|
508
540
|
}), Y(() => {
|
|
541
|
+
r.value = !0;
|
|
542
|
+
}), ee(() => {
|
|
509
543
|
r.value = !1;
|
|
510
544
|
})), o;
|
|
511
545
|
}
|
|
512
|
-
function
|
|
513
|
-
(t.head || /* @__PURE__ */
|
|
546
|
+
function O(e = {}, t = {}) {
|
|
547
|
+
(t.head || /* @__PURE__ */ N()).use(ae);
|
|
514
548
|
const { title: r, titleTemplate: o, ...s } = e;
|
|
515
|
-
return
|
|
549
|
+
return C({
|
|
516
550
|
title: r,
|
|
517
551
|
titleTemplate: o,
|
|
518
552
|
_flatMeta: s
|
|
519
553
|
}, t);
|
|
520
554
|
}
|
|
521
|
-
function
|
|
555
|
+
function xe() {
|
|
522
556
|
function e(n) {
|
|
523
|
-
|
|
557
|
+
O({
|
|
524
558
|
ogSiteName: n.siteName,
|
|
525
559
|
ogLocale: n.locale
|
|
526
560
|
});
|
|
@@ -532,26 +566,26 @@ function Ve() {
|
|
|
532
566
|
keywords: s,
|
|
533
567
|
image: i,
|
|
534
568
|
url: c,
|
|
535
|
-
type:
|
|
536
|
-
} = n,
|
|
537
|
-
|
|
569
|
+
type: a = "website"
|
|
570
|
+
} = n, l = o && o.length > 155 ? `${o.substring(0, 152)}...` : o;
|
|
571
|
+
C({
|
|
538
572
|
title: r,
|
|
539
573
|
link: c ? [{
|
|
540
574
|
rel: "canonical",
|
|
541
575
|
href: c
|
|
542
576
|
}] : []
|
|
543
|
-
}),
|
|
544
|
-
description:
|
|
577
|
+
}), O({
|
|
578
|
+
description: l || o,
|
|
545
579
|
keywords: s,
|
|
546
580
|
ogTitle: r,
|
|
547
|
-
ogDescription:
|
|
548
|
-
ogType:
|
|
581
|
+
ogDescription: l || o,
|
|
582
|
+
ogType: a === "product" ? void 0 : a,
|
|
549
583
|
// product 类型不被支持,跳过
|
|
550
584
|
ogUrl: c,
|
|
551
585
|
ogImage: i,
|
|
552
586
|
twitterCard: "summary_large_image",
|
|
553
587
|
twitterTitle: r,
|
|
554
|
-
twitterDescription:
|
|
588
|
+
twitterDescription: l || o,
|
|
555
589
|
twitterImage: i
|
|
556
590
|
});
|
|
557
591
|
}
|
|
@@ -560,61 +594,63 @@ function Ve() {
|
|
|
560
594
|
setPageSEO: t
|
|
561
595
|
};
|
|
562
596
|
}
|
|
563
|
-
function
|
|
564
|
-
const e =
|
|
565
|
-
|
|
566
|
-
title:
|
|
567
|
-
link:
|
|
597
|
+
function Re() {
|
|
598
|
+
const e = R(), t = () => e.meta;
|
|
599
|
+
C({
|
|
600
|
+
title: d(() => t().title || ""),
|
|
601
|
+
link: d(() => {
|
|
568
602
|
const n = t();
|
|
569
603
|
return n.url ? [{
|
|
570
604
|
rel: "canonical",
|
|
571
605
|
href: n.url
|
|
572
606
|
}] : [];
|
|
573
607
|
})
|
|
574
|
-
}),
|
|
575
|
-
description:
|
|
608
|
+
}), O({
|
|
609
|
+
description: d(() => {
|
|
576
610
|
const r = t().description;
|
|
577
611
|
if (r)
|
|
578
612
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
579
613
|
}),
|
|
580
|
-
keywords:
|
|
581
|
-
ogTitle:
|
|
582
|
-
ogDescription:
|
|
614
|
+
keywords: d(() => t().keywords),
|
|
615
|
+
ogTitle: d(() => t().title),
|
|
616
|
+
ogDescription: d(() => {
|
|
583
617
|
const r = t().description;
|
|
584
618
|
if (r)
|
|
585
619
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
586
620
|
}),
|
|
587
|
-
ogType:
|
|
621
|
+
ogType: d(() => {
|
|
588
622
|
const r = t().type || "website";
|
|
589
623
|
return r === "product" ? void 0 : r;
|
|
590
624
|
}),
|
|
591
|
-
ogUrl:
|
|
592
|
-
ogImage:
|
|
625
|
+
ogUrl: d(() => t().url),
|
|
626
|
+
ogImage: d(() => t().image),
|
|
593
627
|
twitterCard: "summary_large_image",
|
|
594
|
-
twitterTitle:
|
|
595
|
-
twitterDescription:
|
|
628
|
+
twitterTitle: d(() => t().title),
|
|
629
|
+
twitterDescription: d(() => {
|
|
596
630
|
const r = t().description;
|
|
597
631
|
if (r)
|
|
598
632
|
return r.length > 155 ? `${r.substring(0, 152)}...` : r;
|
|
599
633
|
}),
|
|
600
|
-
twitterImage:
|
|
634
|
+
twitterImage: d(() => t().image)
|
|
601
635
|
});
|
|
602
636
|
}
|
|
603
637
|
export {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
638
|
+
ve as H,
|
|
639
|
+
Oe as U,
|
|
640
|
+
je as V,
|
|
641
|
+
Te as a,
|
|
642
|
+
$e as b,
|
|
643
|
+
Me as c,
|
|
644
|
+
xe as d,
|
|
645
|
+
Re as e,
|
|
646
|
+
Pe as f,
|
|
647
|
+
A as g,
|
|
614
648
|
Ee as h,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
Se as
|
|
649
|
+
Ie as i,
|
|
650
|
+
Ce as j,
|
|
651
|
+
fe as k,
|
|
652
|
+
Ve as n,
|
|
653
|
+
Se as u,
|
|
654
|
+
_e as v,
|
|
655
|
+
Ae as w
|
|
620
656
|
};
|