@qwik.dev/core 2.0.0-beta.13 → 2.0.0-beta.15
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/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +5633 -0
- package/dist/core-internal.d.ts +123 -65
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +548 -246
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +349 -198
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +1290 -1294
- package/dist/qwikloader.debug.js +43 -10
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +5 -5
- package/dist/starters/adapters/aws-lambda/package.json +2 -1
- package/dist/starters/adapters/azure-swa/package.json +2 -1
- package/dist/starters/adapters/bun/package.json +2 -1
- package/dist/starters/adapters/cloud-run/package.json +2 -1
- package/dist/starters/adapters/cloudflare-pages/package.json +2 -1
- package/dist/starters/adapters/deno/package.json +2 -1
- package/dist/starters/adapters/express/package.json +2 -1
- package/dist/starters/adapters/fastify/package.json +2 -1
- package/dist/starters/adapters/firebase/package.json +2 -1
- package/dist/starters/adapters/netlify-edge/package.json +2 -1
- package/dist/starters/adapters/node-server/package.json +2 -1
- package/dist/starters/adapters/ssg/package.json +2 -1
- package/dist/starters/adapters/vercel-edge/package.json +2 -1
- package/dist/starters/features/csr/package.json +1 -1
- package/dist/starters/features/storybook/.storybook/tsconfig.json +0 -1
- package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
- package/dist/testing/index.d.ts +8 -9
- package/dist/testing/index.mjs +483 -222
- package/dist/testing/package.json +1 -1
- package/package.json +14 -48
- package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
- package/dist/backpatch/index.cjs +0 -6
- package/dist/build/index.cjs +0 -35
- package/dist/build/index.cjs.map +0 -7
- package/dist/build/index.dev.cjs +0 -37
- package/dist/build/index.dev.cjs.map +0 -7
- package/dist/build/index.prod.cjs +0 -37
- package/dist/build/index.prod.cjs.map +0 -7
- package/dist/cli.cjs +0 -12956
- package/dist/core.cjs +0 -13036
- package/dist/core.cjs.map +0 -1
- package/dist/core.prod.cjs +0 -6377
- package/dist/insights/index.qwik.cjs +0 -1
- package/dist/insights/vite/index.cjs +0 -1
- package/dist/loader/index.cjs +0 -4
- package/dist/optimizer.cjs +0 -217
- package/dist/preloader.cjs +0 -266
- package/dist/server.cjs +0 -3294
- package/dist/testing/index.cjs +0 -36225
package/dist/optimizer.mjs
CHANGED
|
@@ -1,176 +1,169 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* @qwik.dev/core/optimizer 2.0.0-beta.13-dev+cb19ff7
|
|
4
|
-
* Copyright QwikDev. All Rights Reserved.
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
7
|
-
*/
|
|
8
1
|
function jt(e = {}) {
|
|
9
|
-
function n(
|
|
10
|
-
if (typeof
|
|
11
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
15
|
-
for (let
|
|
16
|
-
if (
|
|
17
|
-
|
|
2
|
+
function n(f) {
|
|
3
|
+
if (typeof f != "string")
|
|
4
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(f));
|
|
5
|
+
}
|
|
6
|
+
function i(f, l) {
|
|
7
|
+
let p = "", E = 0, s = -1, v = 0, w;
|
|
8
|
+
for (let S = 0; S <= f.length; ++S) {
|
|
9
|
+
if (S < f.length)
|
|
10
|
+
w = f.charCodeAt(S);
|
|
18
11
|
else {
|
|
19
|
-
if (
|
|
12
|
+
if (w === 47)
|
|
20
13
|
break;
|
|
21
|
-
|
|
14
|
+
w = 47;
|
|
22
15
|
}
|
|
23
|
-
if (
|
|
24
|
-
if (!(
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
29
|
-
|
|
16
|
+
if (w === 47) {
|
|
17
|
+
if (!(s === S - 1 || v === 1)) if (s !== S - 1 && v === 2) {
|
|
18
|
+
if (p.length < 2 || E !== 2 || p.charCodeAt(p.length - 1) !== 46 || p.charCodeAt(p.length - 2) !== 46) {
|
|
19
|
+
if (p.length > 2) {
|
|
20
|
+
const I = p.lastIndexOf("/");
|
|
21
|
+
if (I !== p.length - 1) {
|
|
22
|
+
I === -1 ? (p = "", E = 0) : (p = p.slice(0, I), E = p.length - 1 - p.lastIndexOf("/")), s = S, v = 0;
|
|
30
23
|
continue;
|
|
31
24
|
}
|
|
32
|
-
} else if (
|
|
33
|
-
|
|
25
|
+
} else if (p.length === 2 || p.length === 1) {
|
|
26
|
+
p = "", E = 0, s = S, v = 0;
|
|
34
27
|
continue;
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
|
-
l && (
|
|
30
|
+
l && (p.length > 0 ? p += "/.." : p = "..", E = 2);
|
|
38
31
|
} else
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} else
|
|
32
|
+
p.length > 0 ? p += "/" + f.slice(s + 1, S) : p = f.slice(s + 1, S), E = S - s - 1;
|
|
33
|
+
s = S, v = 0;
|
|
34
|
+
} else w === 46 && v !== -1 ? ++v : v = -1;
|
|
42
35
|
}
|
|
43
|
-
return
|
|
36
|
+
return p;
|
|
44
37
|
}
|
|
45
|
-
function r(
|
|
46
|
-
const
|
|
47
|
-
return
|
|
38
|
+
function r(f, l) {
|
|
39
|
+
const p = l.dir || l.root, E = l.base || (l.name || "") + (l.ext || "");
|
|
40
|
+
return p ? p === l.root ? p + E : p + f + E : E;
|
|
48
41
|
}
|
|
49
42
|
const o = function(...l) {
|
|
50
|
-
let
|
|
51
|
-
for (let
|
|
52
|
-
let
|
|
53
|
-
|
|
43
|
+
let p = "", E = !1, s;
|
|
44
|
+
for (let v = l.length - 1; v >= -1 && !E; v--) {
|
|
45
|
+
let w;
|
|
46
|
+
v >= 0 ? w = l[v] : (s === void 0 && (e && typeof e.cwd == "function" ? s = e.cwd() : typeof process < "u" && typeof process.cwd == "function" ? s = process.cwd() : s = "/"), w = s), n(w), w.length !== 0 && (p = w + "/" + p, E = w.charCodeAt(0) === 47);
|
|
54
47
|
}
|
|
55
|
-
return
|
|
56
|
-
},
|
|
48
|
+
return p = i(p, !E), E ? p.length > 0 ? "/" + p : "/" : p.length > 0 ? p : ".";
|
|
49
|
+
}, h = function(l) {
|
|
57
50
|
if (n(l), l.length === 0)
|
|
58
51
|
return ".";
|
|
59
|
-
const
|
|
60
|
-
return l =
|
|
52
|
+
const p = l.charCodeAt(0) === 47, E = l.charCodeAt(l.length - 1) === 47;
|
|
53
|
+
return l = i(l, !p), l.length === 0 && !p && (l = "."), l.length > 0 && E && (l += "/"), p ? "/" + l : l;
|
|
61
54
|
}, c = function(l) {
|
|
62
55
|
return n(l), l.length > 0 && l.charCodeAt(0) === 47;
|
|
63
56
|
}, a = function(...l) {
|
|
64
57
|
if (l.length === 0)
|
|
65
58
|
return ".";
|
|
66
|
-
let
|
|
67
|
-
for (let
|
|
68
|
-
const
|
|
69
|
-
n(
|
|
70
|
-
}
|
|
71
|
-
return
|
|
72
|
-
},
|
|
73
|
-
if (n(l), n(
|
|
59
|
+
let p;
|
|
60
|
+
for (let E = 0; E < l.length; ++E) {
|
|
61
|
+
const s = l[E];
|
|
62
|
+
n(s), s.length > 0 && (p === void 0 ? p = s : p += "/" + s);
|
|
63
|
+
}
|
|
64
|
+
return p === void 0 ? "." : h(p);
|
|
65
|
+
}, u = function(l, p) {
|
|
66
|
+
if (n(l), n(p), l === p || (l = o(l), p = o(p), l === p))
|
|
74
67
|
return "";
|
|
75
|
-
let
|
|
76
|
-
for (;
|
|
68
|
+
let E = 1;
|
|
69
|
+
for (; E < l.length && l.charCodeAt(E) === 47; ++E)
|
|
77
70
|
;
|
|
78
|
-
const
|
|
79
|
-
let
|
|
80
|
-
for (;
|
|
71
|
+
const s = l.length, v = s - E;
|
|
72
|
+
let w = 1;
|
|
73
|
+
for (; w < p.length && p.charCodeAt(w) === 47; ++w)
|
|
81
74
|
;
|
|
82
|
-
const
|
|
83
|
-
let $ = -1,
|
|
84
|
-
for (;
|
|
85
|
-
if (
|
|
86
|
-
if (
|
|
87
|
-
if (
|
|
88
|
-
return
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
91
|
-
} else
|
|
75
|
+
const I = p.length - w, N = v < I ? v : I;
|
|
76
|
+
let $ = -1, T = 0;
|
|
77
|
+
for (; T <= N; ++T) {
|
|
78
|
+
if (T === N) {
|
|
79
|
+
if (I > N) {
|
|
80
|
+
if (p.charCodeAt(w + T) === 47)
|
|
81
|
+
return p.slice(w + T + 1);
|
|
82
|
+
if (T === 0)
|
|
83
|
+
return p.slice(w + T);
|
|
84
|
+
} else v > N && (l.charCodeAt(E + T) === 47 ? $ = T : T === 0 && ($ = 0));
|
|
92
85
|
break;
|
|
93
86
|
}
|
|
94
|
-
const
|
|
95
|
-
if (
|
|
87
|
+
const Q = l.charCodeAt(E + T), B = p.charCodeAt(w + T);
|
|
88
|
+
if (Q !== B)
|
|
96
89
|
break;
|
|
97
|
-
|
|
90
|
+
Q === 47 && ($ = T);
|
|
98
91
|
}
|
|
99
|
-
let
|
|
100
|
-
for (
|
|
101
|
-
(
|
|
102
|
-
return
|
|
92
|
+
let F = "";
|
|
93
|
+
for (T = E + $ + 1; T <= s; ++T)
|
|
94
|
+
(T === s || l.charCodeAt(T) === 47) && (F.length === 0 ? F += ".." : F += "/..");
|
|
95
|
+
return F.length > 0 ? F + p.slice(w + $) : (w += $, p.charCodeAt(w) === 47 && ++w, p.slice(w));
|
|
103
96
|
}, t = function(l) {
|
|
104
97
|
if (n(l), l.length === 0)
|
|
105
98
|
return ".";
|
|
106
|
-
let
|
|
107
|
-
const
|
|
108
|
-
let
|
|
109
|
-
for (let
|
|
110
|
-
if (
|
|
111
|
-
if (!
|
|
112
|
-
|
|
99
|
+
let p = l.charCodeAt(0);
|
|
100
|
+
const E = p === 47;
|
|
101
|
+
let s = -1, v = !0;
|
|
102
|
+
for (let w = l.length - 1; w >= 1; --w)
|
|
103
|
+
if (p = l.charCodeAt(w), p === 47) {
|
|
104
|
+
if (!v) {
|
|
105
|
+
s = w;
|
|
113
106
|
break;
|
|
114
107
|
}
|
|
115
108
|
} else
|
|
116
|
-
|
|
117
|
-
return
|
|
118
|
-
},
|
|
119
|
-
if (
|
|
109
|
+
v = !1;
|
|
110
|
+
return s === -1 ? E ? "/" : "." : E && s === 1 ? "//" : l.slice(0, s);
|
|
111
|
+
}, b = function(l, p) {
|
|
112
|
+
if (p !== void 0 && typeof p != "string")
|
|
120
113
|
throw new TypeError('"ext" argument must be a string');
|
|
121
114
|
n(l);
|
|
122
|
-
let
|
|
123
|
-
if (
|
|
124
|
-
if (
|
|
115
|
+
let E = 0, s = -1, v = !0, w;
|
|
116
|
+
if (p !== void 0 && p.length > 0 && p.length <= l.length) {
|
|
117
|
+
if (p.length === l.length && p === l)
|
|
125
118
|
return "";
|
|
126
|
-
let
|
|
127
|
-
for (
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
if (!
|
|
131
|
-
|
|
119
|
+
let S = p.length - 1, I = -1;
|
|
120
|
+
for (w = l.length - 1; w >= 0; --w) {
|
|
121
|
+
const N = l.charCodeAt(w);
|
|
122
|
+
if (N === 47) {
|
|
123
|
+
if (!v) {
|
|
124
|
+
E = w + 1;
|
|
132
125
|
break;
|
|
133
126
|
}
|
|
134
127
|
} else
|
|
135
|
-
|
|
128
|
+
I === -1 && (v = !1, I = w + 1), S >= 0 && (N === p.charCodeAt(S) ? --S === -1 && (s = w) : (S = -1, s = I));
|
|
136
129
|
}
|
|
137
|
-
return
|
|
130
|
+
return E === s ? s = I : s === -1 && (s = l.length), l.slice(E, s);
|
|
138
131
|
} else {
|
|
139
|
-
for (
|
|
140
|
-
if (l.charCodeAt(
|
|
141
|
-
if (!
|
|
142
|
-
|
|
132
|
+
for (w = l.length - 1; w >= 0; --w)
|
|
133
|
+
if (l.charCodeAt(w) === 47) {
|
|
134
|
+
if (!v) {
|
|
135
|
+
E = w + 1;
|
|
143
136
|
break;
|
|
144
137
|
}
|
|
145
|
-
} else
|
|
146
|
-
return
|
|
138
|
+
} else s === -1 && (v = !1, s = w + 1);
|
|
139
|
+
return s === -1 ? "" : l.slice(E, s);
|
|
147
140
|
}
|
|
148
|
-
},
|
|
141
|
+
}, x = function(l) {
|
|
149
142
|
n(l);
|
|
150
|
-
let
|
|
151
|
-
for (let
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
if (!
|
|
155
|
-
|
|
143
|
+
let p = -1, E = 0, s = -1, v = !0, w = 0;
|
|
144
|
+
for (let S = l.length - 1; S >= 0; --S) {
|
|
145
|
+
const I = l.charCodeAt(S);
|
|
146
|
+
if (I === 47) {
|
|
147
|
+
if (!v) {
|
|
148
|
+
E = S + 1;
|
|
156
149
|
break;
|
|
157
150
|
}
|
|
158
151
|
continue;
|
|
159
152
|
}
|
|
160
|
-
|
|
153
|
+
s === -1 && (v = !1, s = S + 1), I === 46 ? p === -1 ? p = S : w !== 1 && (w = 1) : p !== -1 && (w = -1);
|
|
161
154
|
}
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
155
|
+
return p === -1 || s === -1 || // We saw a non-dot character immediately before the dot
|
|
156
|
+
w === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
157
|
+
w === 1 && p === s - 1 && p === E + 1 ? "" : l.slice(p, s);
|
|
158
|
+
}, m = function(l) {
|
|
166
159
|
if (l === null || typeof l != "object")
|
|
167
160
|
throw new TypeError(
|
|
168
161
|
'The "pathObject" argument must be of type Object. Received type ' + typeof l
|
|
169
162
|
);
|
|
170
163
|
return r("/", l);
|
|
171
|
-
},
|
|
164
|
+
}, k = function(l) {
|
|
172
165
|
n(l);
|
|
173
|
-
const
|
|
166
|
+
const p = {
|
|
174
167
|
root: "",
|
|
175
168
|
dir: "",
|
|
176
169
|
base: "",
|
|
@@ -178,52 +171,52 @@ function jt(e = {}) {
|
|
|
178
171
|
name: ""
|
|
179
172
|
};
|
|
180
173
|
if (l.length === 0)
|
|
181
|
-
return
|
|
182
|
-
let
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
let
|
|
186
|
-
for (; $ >=
|
|
187
|
-
if (
|
|
188
|
-
if (!
|
|
189
|
-
|
|
174
|
+
return p;
|
|
175
|
+
let E = l.charCodeAt(0), s;
|
|
176
|
+
const v = E === 47;
|
|
177
|
+
v ? (p.root = "/", s = 1) : s = 0;
|
|
178
|
+
let w = -1, S = 0, I = -1, N = !0, $ = l.length - 1, T = 0;
|
|
179
|
+
for (; $ >= s; --$) {
|
|
180
|
+
if (E = l.charCodeAt($), E === 47) {
|
|
181
|
+
if (!N) {
|
|
182
|
+
S = $ + 1;
|
|
190
183
|
break;
|
|
191
184
|
}
|
|
192
185
|
continue;
|
|
193
186
|
}
|
|
194
|
-
|
|
187
|
+
I === -1 && (N = !1, I = $ + 1), E === 46 ? w === -1 ? w = $ : T !== 1 && (T = 1) : w !== -1 && (T = -1);
|
|
195
188
|
}
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
},
|
|
189
|
+
return w === -1 || I === -1 || // We saw a non-dot character immediately before the dot
|
|
190
|
+
T === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
191
|
+
T === 1 && w === I - 1 && w === S + 1 ? I !== -1 && (S === 0 && v ? p.base = p.name = l.slice(1, I) : p.base = p.name = l.slice(S, I)) : (S === 0 && v ? (p.name = l.slice(1, w), p.base = l.slice(1, I)) : (p.name = l.slice(S, w), p.base = l.slice(S, I)), p.ext = l.slice(w, I)), S > 0 ? p.dir = l.slice(0, S - 1) : v && (p.dir = "/"), p;
|
|
192
|
+
}, g = "/", d = ":";
|
|
200
193
|
return {
|
|
201
|
-
relative:
|
|
194
|
+
relative: u,
|
|
202
195
|
resolve: o,
|
|
203
|
-
parse:
|
|
204
|
-
format:
|
|
196
|
+
parse: k,
|
|
197
|
+
format: m,
|
|
205
198
|
join: a,
|
|
206
199
|
isAbsolute: c,
|
|
207
|
-
basename:
|
|
208
|
-
normalize:
|
|
200
|
+
basename: b,
|
|
201
|
+
normalize: h,
|
|
209
202
|
dirname: t,
|
|
210
|
-
extname:
|
|
211
|
-
delimiter:
|
|
212
|
-
sep:
|
|
203
|
+
extname: x,
|
|
204
|
+
delimiter: d,
|
|
205
|
+
sep: g,
|
|
213
206
|
win32: null,
|
|
214
207
|
posix: {
|
|
215
|
-
relative:
|
|
208
|
+
relative: u,
|
|
216
209
|
resolve: o,
|
|
217
|
-
parse:
|
|
218
|
-
format:
|
|
210
|
+
parse: k,
|
|
211
|
+
format: m,
|
|
219
212
|
join: a,
|
|
220
213
|
isAbsolute: c,
|
|
221
|
-
basename:
|
|
222
|
-
normalize:
|
|
214
|
+
basename: b,
|
|
215
|
+
normalize: h,
|
|
223
216
|
dirname: t,
|
|
224
|
-
extname:
|
|
225
|
-
delimiter:
|
|
226
|
-
sep:
|
|
217
|
+
extname: x,
|
|
218
|
+
delimiter: d,
|
|
219
|
+
sep: g,
|
|
227
220
|
win32: null,
|
|
228
221
|
posix: null
|
|
229
222
|
}
|
|
@@ -268,19 +261,17 @@ const $t = {
|
|
|
268
261
|
}
|
|
269
262
|
]
|
|
270
263
|
}
|
|
271
|
-
}, Fr = {
|
|
272
|
-
qwik: "2.0.0-beta.13-dev+cb19ff7"
|
|
273
264
|
};
|
|
274
265
|
async function Ut() {
|
|
275
|
-
const e =
|
|
276
|
-
dynamicImport: (
|
|
266
|
+
const e = Tt(), n = {
|
|
267
|
+
dynamicImport: (i) => {
|
|
277
268
|
throw new Error(
|
|
278
|
-
`Qwik Optimizer sys.dynamicImport() not implemented, trying to import: "${
|
|
269
|
+
`Qwik Optimizer sys.dynamicImport() not implemented, trying to import: "${i}"`
|
|
279
270
|
);
|
|
280
271
|
},
|
|
281
|
-
strictDynamicImport: (
|
|
272
|
+
strictDynamicImport: (i) => {
|
|
282
273
|
throw new Error(
|
|
283
|
-
`Qwik Optimizer sys.strictDynamicImport() not implemented, trying to import: "${
|
|
274
|
+
`Qwik Optimizer sys.strictDynamicImport() not implemented, trying to import: "${i}"`
|
|
284
275
|
);
|
|
285
276
|
},
|
|
286
277
|
path: null,
|
|
@@ -288,7 +279,7 @@ async function Ut() {
|
|
|
288
279
|
os: "unknown",
|
|
289
280
|
env: e
|
|
290
281
|
};
|
|
291
|
-
if (n.path = jt(n), n.strictDynamicImport = n.dynamicImport = (
|
|
282
|
+
if (n.path = jt(n), n.strictDynamicImport = n.dynamicImport = (i) => import(i), e !== "webworker" && e !== "browsermain")
|
|
292
283
|
try {
|
|
293
284
|
n.path = await n.dynamicImport("node:path"), n.cwd = () => process.cwd(), n.os = process.platform;
|
|
294
285
|
} catch {
|
|
@@ -296,42 +287,42 @@ async function Ut() {
|
|
|
296
287
|
return n;
|
|
297
288
|
}
|
|
298
289
|
async function Bt(e) {
|
|
299
|
-
const n =
|
|
290
|
+
const n = Tt();
|
|
300
291
|
if (n === "node" || n === "bun") {
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
303
|
-
const r =
|
|
292
|
+
const i = $t[process.platform];
|
|
293
|
+
if (i) {
|
|
294
|
+
const r = i[process.arch];
|
|
304
295
|
if (r)
|
|
305
296
|
for (const o of r)
|
|
306
297
|
try {
|
|
307
298
|
return (await e.dynamicImport("node:module")).default.createRequire(import.meta.url)(
|
|
308
299
|
`../bindings/${o.platformArchABI}`
|
|
309
300
|
);
|
|
310
|
-
} catch (
|
|
301
|
+
} catch (h) {
|
|
311
302
|
console.warn(
|
|
312
303
|
`Unable to load native binding ${o.platformArchABI}. Falling back to wasm build.`,
|
|
313
|
-
|
|
304
|
+
h?.message
|
|
314
305
|
);
|
|
315
306
|
}
|
|
316
307
|
}
|
|
317
308
|
}
|
|
318
309
|
if (n === "node" || n === "bun") {
|
|
319
|
-
const
|
|
320
|
-
return await
|
|
310
|
+
const i = await e.dynamicImport("node:url"), r = e.path.dirname(i.fileURLToPath(import.meta.url)), o = e.path.join(r, "..", "bindings", "qwik_wasm_bg.wasm"), h = await e.dynamicImport("../bindings/qwik.wasm.mjs"), a = await (await e.dynamicImport("node:fs")).promises.readFile(o), u = await WebAssembly.compile(a);
|
|
311
|
+
return await h.default(u), h;
|
|
321
312
|
} else {
|
|
322
|
-
const
|
|
323
|
-
return await
|
|
313
|
+
const i = await e.dynamicImport("../bindings/qwik.wasm.mjs");
|
|
314
|
+
return await i.default(), i;
|
|
324
315
|
}
|
|
325
316
|
}
|
|
326
|
-
const
|
|
327
|
-
const n = e?.sys || await Ut(),
|
|
317
|
+
const Tt = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof process < "u" && typeof global < "u" && process.versions && process.versions.node ? "node" : typeof self < "u" && typeof location < "u" && typeof navigator < "u" && typeof fetch == "function" && typeof WorkerGlobalScope == "function" && typeof self.importScripts == "function" ? "webworker" : typeof window < "u" && typeof document < "u" && typeof location < "u" && typeof navigator < "u" && typeof Window == "function" && typeof fetch == "function" ? "browsermain" : "unknown", At = async (e = {}) => {
|
|
318
|
+
const n = e?.sys || await Ut(), i = e?.binding || await Bt(n);
|
|
328
319
|
return {
|
|
329
320
|
async transformModules(o) {
|
|
330
|
-
return
|
|
321
|
+
return Ft(i, o);
|
|
331
322
|
},
|
|
332
323
|
sys: n
|
|
333
324
|
};
|
|
334
|
-
},
|
|
325
|
+
}, Ft = (e, n) => e.transform_modules(Rt(n)), Rt = (e) => {
|
|
335
326
|
const n = {
|
|
336
327
|
minify: "simplify",
|
|
337
328
|
sourceMaps: !1,
|
|
@@ -349,26 +340,28 @@ const Et = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof
|
|
|
349
340
|
stripCtxName: void 0,
|
|
350
341
|
isServer: void 0
|
|
351
342
|
};
|
|
352
|
-
return Object.entries(e).forEach(([
|
|
353
|
-
r != null && (n[
|
|
343
|
+
return Object.entries(e).forEach(([i, r]) => {
|
|
344
|
+
r != null && (n[i] = r);
|
|
354
345
|
}), n.entryStrategy = e.entryStrategy?.type ?? "smart", n.manualChunks = e.entryStrategy?.manual ?? void 0, n;
|
|
346
|
+
}, Rr = {
|
|
347
|
+
qwik: "2.0.0-beta.15-dev+920f1a4"
|
|
355
348
|
}, zt = (e, n = 0) => {
|
|
356
|
-
for (let
|
|
357
|
-
const r = e.charCodeAt(
|
|
349
|
+
for (let i = 0; i < e.length; i++) {
|
|
350
|
+
const r = e.charCodeAt(i);
|
|
358
351
|
n = (n << 5) - n + r, n |= 0;
|
|
359
352
|
}
|
|
360
353
|
return Number(Math.abs(n)).toString(36);
|
|
361
354
|
}, Ht = /* @__PURE__ */ new Set(["_chk", "_run", "_task", "_val"]);
|
|
362
355
|
function Wt(e) {
|
|
363
356
|
const n = e.symbols;
|
|
364
|
-
return Object.keys(n).sort((
|
|
365
|
-
const o = n[
|
|
366
|
-
if (o.ctxKind === "eventHandler" &&
|
|
357
|
+
return Object.keys(n).sort((i, r) => {
|
|
358
|
+
const o = n[i], h = n[r];
|
|
359
|
+
if (o.ctxKind === "eventHandler" && h.ctxKind !== "eventHandler")
|
|
367
360
|
return -1;
|
|
368
|
-
if (o.ctxKind !== "eventHandler" &&
|
|
361
|
+
if (o.ctxKind !== "eventHandler" && h.ctxKind === "eventHandler")
|
|
369
362
|
return 1;
|
|
370
|
-
if (o.ctxKind === "eventHandler" &&
|
|
371
|
-
const c =
|
|
363
|
+
if (o.ctxKind === "eventHandler" && h.ctxKind === "eventHandler") {
|
|
364
|
+
const c = Ze.indexOf(o.ctxName.toLowerCase()), a = Ze.indexOf(h.ctxName.toLowerCase());
|
|
372
365
|
if (c > -1 && a > -1) {
|
|
373
366
|
if (c < a)
|
|
374
367
|
return -1;
|
|
@@ -380,8 +373,8 @@ function Wt(e) {
|
|
|
380
373
|
if (a > -1)
|
|
381
374
|
return 1;
|
|
382
375
|
}
|
|
383
|
-
} else if (o.ctxKind === "function" &&
|
|
384
|
-
const c =
|
|
376
|
+
} else if (o.ctxKind === "function" && h.ctxKind === "function") {
|
|
377
|
+
const c = et.indexOf(o.ctxName.toLowerCase()), a = et.indexOf(h.ctxName.toLowerCase());
|
|
385
378
|
if (c > -1 && a > -1) {
|
|
386
379
|
if (c < a)
|
|
387
380
|
return -1;
|
|
@@ -394,10 +387,10 @@ function Wt(e) {
|
|
|
394
387
|
return 1;
|
|
395
388
|
}
|
|
396
389
|
}
|
|
397
|
-
return !o.parent &&
|
|
390
|
+
return !o.parent && h.parent ? -1 : o.parent && !h.parent ? 1 : o.hash < h.hash ? -1 : o.hash > h.hash ? 1 : 0;
|
|
398
391
|
});
|
|
399
392
|
}
|
|
400
|
-
const
|
|
393
|
+
const Ze = [
|
|
401
394
|
// Click Events
|
|
402
395
|
"click",
|
|
403
396
|
"dblclick",
|
|
@@ -453,110 +446,110 @@ const Xe = [
|
|
|
453
446
|
"reset",
|
|
454
447
|
// Scroll Events
|
|
455
448
|
"scroll"
|
|
456
|
-
].map((e) => `on${e.toLowerCase()}$`),
|
|
449
|
+
].map((e) => `on${e.toLowerCase()}$`), et = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
|
|
457
450
|
(e) => e.toLowerCase()
|
|
458
451
|
);
|
|
459
452
|
function Gt(e) {
|
|
460
|
-
return Object.keys(e.bundles).sort(
|
|
453
|
+
return Object.keys(e.bundles).sort(Ue);
|
|
461
454
|
}
|
|
462
455
|
function Kt(e) {
|
|
463
|
-
const n = Wt(e),
|
|
456
|
+
const n = Wt(e), i = {}, r = {};
|
|
464
457
|
for (const c of n)
|
|
465
|
-
|
|
466
|
-
const o = Gt(e),
|
|
458
|
+
i[c] = e.symbols[c], r[c] = e.mapping[c];
|
|
459
|
+
const o = Gt(e), h = {};
|
|
467
460
|
for (const c of o) {
|
|
468
|
-
|
|
461
|
+
h[c] = e.bundles[c];
|
|
469
462
|
const a = e.bundles[c];
|
|
470
|
-
Array.isArray(a.imports) && a.imports.sort(
|
|
471
|
-
const
|
|
463
|
+
Array.isArray(a.imports) && a.imports.sort(Ue), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(Ue);
|
|
464
|
+
const u = [];
|
|
472
465
|
for (const t of n)
|
|
473
|
-
c === r[t] &&
|
|
474
|
-
|
|
466
|
+
c === r[t] && u.push(t);
|
|
467
|
+
u.length > 0 && (u.sort(Ue), a.symbols = u);
|
|
475
468
|
}
|
|
476
|
-
return e.symbols =
|
|
469
|
+
return e.symbols = i, e.mapping = r, e.bundles = h, e;
|
|
477
470
|
}
|
|
478
|
-
function
|
|
471
|
+
function Ue(e, n) {
|
|
479
472
|
return e = e.toLocaleLowerCase(), n = n.toLocaleLowerCase(), e < n ? -1 : e > n ? 1 : 0;
|
|
480
473
|
}
|
|
481
|
-
function
|
|
474
|
+
function tt(e) {
|
|
482
475
|
if (e != null && e.mapping != null && typeof e.mapping == "object" && e.symbols != null && typeof e.symbols == "object" && e.bundles != null && typeof e.bundles == "object")
|
|
483
476
|
return e;
|
|
484
477
|
}
|
|
485
478
|
const Qt = (e, n) => {
|
|
486
|
-
let
|
|
479
|
+
let i = 0;
|
|
487
480
|
if (e.symbols)
|
|
488
481
|
for (const r of e.symbols) {
|
|
489
482
|
let o = 1;
|
|
490
|
-
const
|
|
491
|
-
|
|
483
|
+
const h = n.symbols[r];
|
|
484
|
+
h && (h.ctxKind === "function" ? /(component|useStyles|useStylesScoped)/i.test(h.ctxName) ? o += 1 : /(useComputed|useTask|useVisibleTask|useOn)/i.test(h.ctxName) && (o += 2) : (o += 1, /(click|mouse|pointer|touch|key|scroll|gesture|wheel)/i.test(h.ctxName) && (o += 3))), i = Math.max(i, o);
|
|
492
485
|
}
|
|
493
|
-
return
|
|
486
|
+
return i;
|
|
494
487
|
};
|
|
495
488
|
function Jt(e) {
|
|
496
489
|
let n = 0;
|
|
497
|
-
const
|
|
498
|
-
function a(
|
|
499
|
-
o.set(
|
|
500
|
-
const
|
|
501
|
-
for (const
|
|
502
|
-
o.has(
|
|
503
|
-
if (
|
|
504
|
-
const
|
|
490
|
+
const i = [], r = [], o = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
491
|
+
function a(g) {
|
|
492
|
+
o.set(g, n), h.set(g, n), n++, i.push(g), c.add(g);
|
|
493
|
+
const d = e[g].imports || [];
|
|
494
|
+
for (const f of d)
|
|
495
|
+
o.has(f) ? c.has(f) && h.set(g, Math.min(h.get(g), o.get(f))) : (a(f), h.set(g, Math.min(h.get(g), h.get(f))));
|
|
496
|
+
if (h.get(g) === o.get(g)) {
|
|
497
|
+
const f = [];
|
|
505
498
|
let l;
|
|
506
499
|
do
|
|
507
|
-
l =
|
|
508
|
-
while (l !==
|
|
509
|
-
r.push(
|
|
500
|
+
l = i.pop(), c.delete(l), f.push(l);
|
|
501
|
+
while (l !== g);
|
|
502
|
+
r.push(f);
|
|
510
503
|
}
|
|
511
504
|
}
|
|
512
|
-
for (const
|
|
513
|
-
o.has(
|
|
514
|
-
const
|
|
515
|
-
r.forEach((
|
|
516
|
-
for (const
|
|
517
|
-
|
|
505
|
+
for (const g of Object.keys(e))
|
|
506
|
+
o.has(g) || a(g);
|
|
507
|
+
const u = /* @__PURE__ */ new Map();
|
|
508
|
+
r.forEach((g, d) => {
|
|
509
|
+
for (const f of g)
|
|
510
|
+
u.set(f, d);
|
|
518
511
|
});
|
|
519
512
|
const t = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
|
|
520
|
-
for (const
|
|
521
|
-
const
|
|
522
|
-
for (const
|
|
523
|
-
const l =
|
|
524
|
-
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
const
|
|
528
|
-
function
|
|
529
|
-
|
|
530
|
-
for (const
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}
|
|
534
|
-
for (let
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
for (let
|
|
539
|
-
let
|
|
540
|
-
for (const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
for (let
|
|
545
|
-
const
|
|
546
|
-
let
|
|
547
|
-
for (const l of t[
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
for (let
|
|
552
|
-
const
|
|
553
|
-
for (const
|
|
554
|
-
e[
|
|
513
|
+
for (const g of Object.keys(e)) {
|
|
514
|
+
const d = u.get(g);
|
|
515
|
+
for (const f of e[g].imports || []) {
|
|
516
|
+
const l = u.get(f);
|
|
517
|
+
d !== l && t[d].add(l);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const b = /* @__PURE__ */ new Set(), x = [];
|
|
521
|
+
function m(g) {
|
|
522
|
+
b.add(g);
|
|
523
|
+
for (const d of t[g])
|
|
524
|
+
b.has(d) || m(d);
|
|
525
|
+
x.push(g);
|
|
526
|
+
}
|
|
527
|
+
for (let g = 0; g < r.length; g++)
|
|
528
|
+
b.has(g) || m(g);
|
|
529
|
+
x.reverse();
|
|
530
|
+
const k = new Array(r.length).fill(0);
|
|
531
|
+
for (let g = 0; g < r.length; g++) {
|
|
532
|
+
let d = 0;
|
|
533
|
+
for (const f of r[g])
|
|
534
|
+
d += e[f].size;
|
|
535
|
+
k[g] = d;
|
|
536
|
+
}
|
|
537
|
+
for (let g = x.length - 1; g >= 0; g--) {
|
|
538
|
+
const d = x[g];
|
|
539
|
+
let f = k[d];
|
|
540
|
+
for (const l of t[d])
|
|
541
|
+
f += k[l];
|
|
542
|
+
k[d] = f;
|
|
543
|
+
}
|
|
544
|
+
for (let g = 0; g < r.length; g++) {
|
|
545
|
+
const d = k[g];
|
|
546
|
+
for (const f of r[g])
|
|
547
|
+
e[f].total = d;
|
|
555
548
|
}
|
|
556
549
|
}
|
|
557
|
-
const
|
|
558
|
-
function Yt(e, n,
|
|
559
|
-
var
|
|
550
|
+
const nt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, rt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, ot = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/, it = /[/\\](core|qwik)[/\\]handlers\.(|c|m)js$/;
|
|
551
|
+
function Yt(e, n, i, r, o, h, c) {
|
|
552
|
+
var x;
|
|
560
553
|
const a = {
|
|
561
554
|
version: "1",
|
|
562
555
|
manifestHash: "",
|
|
@@ -570,81 +563,81 @@ function Yt(e, n, s, r, o, f, c) {
|
|
|
570
563
|
preloader: void 0,
|
|
571
564
|
qwikLoader: void 0,
|
|
572
565
|
bundleGraphAsset: void 0,
|
|
573
|
-
injections:
|
|
566
|
+
injections: i,
|
|
574
567
|
mapping: {},
|
|
575
568
|
bundles: {},
|
|
576
569
|
assets: {},
|
|
577
570
|
symbols: {},
|
|
578
571
|
bundleGraph: void 0
|
|
579
|
-
},
|
|
580
|
-
const
|
|
581
|
-
if (!
|
|
582
|
-
console.warn(`Client manifest generation: skipping external import "${
|
|
572
|
+
}, u = (m) => {
|
|
573
|
+
const k = r[m];
|
|
574
|
+
if (!k) {
|
|
575
|
+
console.warn(`Client manifest generation: skipping external import "${m}"`);
|
|
583
576
|
return;
|
|
584
577
|
}
|
|
585
|
-
return c(
|
|
578
|
+
return c(k.fileName);
|
|
586
579
|
};
|
|
587
580
|
let t;
|
|
588
|
-
const
|
|
589
|
-
for (const
|
|
590
|
-
if (
|
|
591
|
-
|
|
592
|
-
name:
|
|
593
|
-
size:
|
|
581
|
+
const b = new Set(n.map((m) => m.name));
|
|
582
|
+
for (const m of Object.values(r)) {
|
|
583
|
+
if (m.type === "asset") {
|
|
584
|
+
m.fileName.endsWith("js.map") || (a.assets[m.fileName] = {
|
|
585
|
+
name: m.names[0],
|
|
586
|
+
size: m.source.length
|
|
594
587
|
});
|
|
595
588
|
continue;
|
|
596
589
|
}
|
|
597
|
-
const
|
|
598
|
-
size:
|
|
590
|
+
const k = c(m.fileName), d = {
|
|
591
|
+
size: m.code.length,
|
|
599
592
|
total: -1
|
|
600
593
|
};
|
|
601
|
-
for (const
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
const l =
|
|
606
|
-
l.length > 0 && (
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
}
|
|
610
|
-
for (const
|
|
611
|
-
const
|
|
612
|
-
if (!
|
|
613
|
-
|
|
594
|
+
for (const s of m.exports)
|
|
595
|
+
b.has(s) && (!a.mapping[s] || m.exports.length !== 1) && (a.mapping[s] = k);
|
|
596
|
+
const f = m.imports.filter((s) => m.code.includes(e.basename(s))).map((s) => u(s)).filter(Boolean);
|
|
597
|
+
f.length > 0 && (d.imports = f);
|
|
598
|
+
const l = m.dynamicImports.filter((s) => m.code.includes(e.basename(s))).map((s) => u(s)).filter(Boolean);
|
|
599
|
+
l.length > 0 && (d.dynamicImports = l), m.facadeModuleId && (nt.test(m.facadeModuleId) ? a.preloader = k : rt.test(m.facadeModuleId) ? a.core = k : ot.test(m.facadeModuleId) ? a.qwikLoader = k : it.test(m.facadeModuleId) && (t = k));
|
|
600
|
+
const E = (m.moduleIds || Object.keys(m.modules)).filter((s) => !s.startsWith("\0")).map((s) => e.relative(o.rootDir, s));
|
|
601
|
+
E.length > 0 && (d.origins = E, !a.preloader && E.some((s) => nt.test(s)) && (a.preloader = k), !a.core && E.some((s) => rt.test(s)) && (a.core = k), !a.qwikLoader && E.some((s) => ot.test(s)) && (a.qwikLoader = k), !t && E.some((s) => it.test(s)) && (t = k)), a.bundles[k] = d;
|
|
602
|
+
}
|
|
603
|
+
for (const m of n) {
|
|
604
|
+
const k = m.name, g = a.mapping[k];
|
|
605
|
+
if (!g) {
|
|
606
|
+
h(`Note: qrl ${m.name} is not in the bundle, likely tree shaken`, a);
|
|
614
607
|
continue;
|
|
615
608
|
}
|
|
616
|
-
((
|
|
617
|
-
displayName:
|
|
618
|
-
hash:
|
|
619
|
-
ctxKind:
|
|
620
|
-
ctxName:
|
|
621
|
-
captures:
|
|
622
|
-
canonicalFilename:
|
|
623
|
-
parent:
|
|
624
|
-
origin:
|
|
625
|
-
loc:
|
|
626
|
-
paramNames:
|
|
627
|
-
captureNames:
|
|
609
|
+
((x = a.bundles[g]).symbols || (x.symbols = [])).push(k), a.symbols[k] = {
|
|
610
|
+
displayName: m.displayName,
|
|
611
|
+
hash: m.hash,
|
|
612
|
+
ctxKind: m.ctxKind,
|
|
613
|
+
ctxName: m.ctxName,
|
|
614
|
+
captures: m.captures,
|
|
615
|
+
canonicalFilename: m.canonicalFilename,
|
|
616
|
+
parent: m.parent,
|
|
617
|
+
origin: m.origin,
|
|
618
|
+
loc: m.loc,
|
|
619
|
+
paramNames: m.paramNames,
|
|
620
|
+
captureNames: m.captureNames
|
|
628
621
|
};
|
|
629
622
|
}
|
|
630
623
|
if (t)
|
|
631
|
-
for (const
|
|
632
|
-
a.symbols[
|
|
624
|
+
for (const m of Ht)
|
|
625
|
+
a.symbols[m] = {
|
|
633
626
|
origin: "Qwik core",
|
|
634
|
-
displayName:
|
|
627
|
+
displayName: m,
|
|
635
628
|
canonicalFilename: "",
|
|
636
|
-
hash:
|
|
629
|
+
hash: m,
|
|
637
630
|
ctxKind: "function",
|
|
638
|
-
ctxName:
|
|
631
|
+
ctxName: m,
|
|
639
632
|
captures: !1,
|
|
640
633
|
parent: null,
|
|
641
634
|
loc: [0, 0]
|
|
642
|
-
}, a.mapping[
|
|
635
|
+
}, a.mapping[m] = t;
|
|
643
636
|
else
|
|
644
637
|
console.error("Qwik core bundle not found, is Qwik actually used in this project?");
|
|
645
|
-
for (const
|
|
646
|
-
const
|
|
647
|
-
|
|
638
|
+
for (const m of Object.values(a.bundles)) {
|
|
639
|
+
const k = Qt(m, a);
|
|
640
|
+
m.interactivity = k;
|
|
648
641
|
}
|
|
649
642
|
return Jt(a.bundles), Kt(a);
|
|
650
643
|
}
|
|
@@ -653,101 +646,101 @@ const Xt = 300, Vt = 0.5 / (Xt * 1024 / 8), Zt = (e) => {
|
|
|
653
646
|
return n > -1 ? e.slice(n + 1) : e;
|
|
654
647
|
};
|
|
655
648
|
function en(e, n) {
|
|
656
|
-
const
|
|
649
|
+
const i = [];
|
|
657
650
|
if (!e.bundles)
|
|
658
651
|
return [];
|
|
659
652
|
const r = { ...e.bundles };
|
|
660
|
-
for (const [
|
|
661
|
-
if (
|
|
653
|
+
for (const [u, t] of Object.entries(e.mapping)) {
|
|
654
|
+
if (u.startsWith("_") && u.length < 10)
|
|
662
655
|
continue;
|
|
663
|
-
const
|
|
664
|
-
|
|
656
|
+
const b = Zt(u);
|
|
657
|
+
b && (r[b] = { dynamicImports: [t] });
|
|
665
658
|
}
|
|
666
659
|
if (n) {
|
|
667
|
-
const
|
|
660
|
+
const u = { ...e, bundles: r };
|
|
668
661
|
for (const t of n) {
|
|
669
|
-
const
|
|
670
|
-
|
|
662
|
+
const b = t(u);
|
|
663
|
+
b && Object.assign(r, b);
|
|
671
664
|
}
|
|
672
665
|
}
|
|
673
|
-
for (const
|
|
674
|
-
const t = r[
|
|
666
|
+
for (const u of Object.keys(r)) {
|
|
667
|
+
const t = r[u], b = t.imports?.filter((m) => r[m]) || [], x = t.dynamicImports?.filter(
|
|
675
668
|
// we only want to include dynamic imports that belong to the app
|
|
676
669
|
// e.g. not all languages supported by shiki
|
|
677
|
-
(
|
|
678
|
-
(r[
|
|
679
|
-
r[
|
|
670
|
+
(m) => r[m] && // either there are qrls
|
|
671
|
+
(r[m].symbols || // or it's a dynamic import from the app source
|
|
672
|
+
r[m].origins?.some((k) => !k.includes("node_modules")))
|
|
680
673
|
) || [];
|
|
681
|
-
r[
|
|
674
|
+
r[u] = {
|
|
682
675
|
...t,
|
|
683
|
-
imports:
|
|
684
|
-
dynamicImports:
|
|
676
|
+
imports: b,
|
|
677
|
+
dynamicImports: x
|
|
685
678
|
};
|
|
686
679
|
}
|
|
687
680
|
const o = new Set(Object.keys(r));
|
|
688
|
-
for (const
|
|
689
|
-
for (const t of r[
|
|
681
|
+
for (const u of Object.keys(r)) {
|
|
682
|
+
for (const t of r[u].imports)
|
|
690
683
|
o.delete(t);
|
|
691
|
-
for (const t of r[
|
|
684
|
+
for (const t of r[u].dynamicImports)
|
|
692
685
|
o.delete(t);
|
|
693
686
|
}
|
|
694
|
-
for (const
|
|
695
|
-
const t = r[
|
|
696
|
-
!t.imports?.length && !t.dynamicImports?.length && delete r[
|
|
687
|
+
for (const u of o) {
|
|
688
|
+
const t = r[u];
|
|
689
|
+
!t.imports?.length && !t.dynamicImports?.length && delete r[u];
|
|
697
690
|
}
|
|
698
|
-
const
|
|
699
|
-
const
|
|
700
|
-
for (const
|
|
701
|
-
|
|
691
|
+
const h = Object.keys(r), c = /* @__PURE__ */ new Map(), a = (u, t, b = /* @__PURE__ */ new Set()) => {
|
|
692
|
+
const x = r[t];
|
|
693
|
+
for (const m of x.imports)
|
|
694
|
+
u.has(m) && u.delete(m), b.has(m) || (b.add(m), a(u, m, b));
|
|
702
695
|
};
|
|
703
|
-
for (const
|
|
704
|
-
const t = r[
|
|
705
|
-
for (const
|
|
706
|
-
a(
|
|
707
|
-
const
|
|
708
|
-
for (const
|
|
709
|
-
a(
|
|
710
|
-
const
|
|
711
|
-
let
|
|
712
|
-
if (
|
|
696
|
+
for (const u of h) {
|
|
697
|
+
const t = r[u], b = new Set(t.imports);
|
|
698
|
+
for (const g of b)
|
|
699
|
+
a(b, g);
|
|
700
|
+
const x = new Set(t.dynamicImports), m = /* @__PURE__ */ new Map();
|
|
701
|
+
for (const g of x) {
|
|
702
|
+
a(x, g);
|
|
703
|
+
const d = r[g];
|
|
704
|
+
let f = 0.5;
|
|
705
|
+
if (f += (d.interactivity || 0) * 0.08, t.origins && d.origins) {
|
|
713
706
|
for (const l of t.origins)
|
|
714
|
-
if (
|
|
715
|
-
|
|
707
|
+
if (d.origins.some((p) => p.startsWith(l))) {
|
|
708
|
+
f += 0.25;
|
|
716
709
|
break;
|
|
717
710
|
}
|
|
718
711
|
}
|
|
719
|
-
|
|
712
|
+
d.total > Vt && (f += f > 0.5 ? 0.02 : -0.02), d.total < 1e3 && (f += 0.15), m.set(g, Math.min(f, 0.99));
|
|
720
713
|
}
|
|
721
|
-
if (
|
|
722
|
-
const
|
|
723
|
-
(
|
|
714
|
+
if (x.size > 0) {
|
|
715
|
+
const g = Array.from(x).sort(
|
|
716
|
+
(f, l) => m.get(l) - m.get(f)
|
|
724
717
|
);
|
|
725
|
-
let
|
|
726
|
-
for (const
|
|
727
|
-
|
|
728
|
-
}
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
for (let
|
|
732
|
-
|
|
733
|
-
c.set(
|
|
734
|
-
}
|
|
735
|
-
for (const
|
|
736
|
-
const t = c.get(
|
|
737
|
-
let { index:
|
|
738
|
-
|
|
739
|
-
for (const
|
|
740
|
-
if (typeof
|
|
741
|
-
|
|
718
|
+
let d = -1;
|
|
719
|
+
for (const f of g)
|
|
720
|
+
m.get(f) !== d && (d = m.get(f), b.add(-Math.round(d * 10))), b.add(f);
|
|
721
|
+
}
|
|
722
|
+
const k = i.length;
|
|
723
|
+
i.push(u);
|
|
724
|
+
for (let g = 0; g < b.size; g++)
|
|
725
|
+
i.push(null);
|
|
726
|
+
c.set(u, { index: k, deps: b });
|
|
727
|
+
}
|
|
728
|
+
for (const u of h) {
|
|
729
|
+
const t = c.get(u);
|
|
730
|
+
let { index: b, deps: x } = t;
|
|
731
|
+
b++;
|
|
732
|
+
for (const m of x) {
|
|
733
|
+
if (typeof m == "number") {
|
|
734
|
+
i[b++] = m;
|
|
742
735
|
continue;
|
|
743
736
|
}
|
|
744
|
-
const
|
|
745
|
-
|
|
737
|
+
const g = c.get(m).index;
|
|
738
|
+
i[b++] = g;
|
|
746
739
|
}
|
|
747
740
|
}
|
|
748
|
-
return
|
|
741
|
+
return i;
|
|
749
742
|
}
|
|
750
|
-
async function tn(e, n,
|
|
743
|
+
async function tn(e, n, i) {
|
|
751
744
|
const r = await e.dynamicImport("eslint");
|
|
752
745
|
let o = new r.ESLint({ cache: !0 });
|
|
753
746
|
if ((await o.calculateConfigForFile("no-real-file.tsx")).parser === null) {
|
|
@@ -757,7 +750,7 @@ async function tn(e, n, s) {
|
|
|
757
750
|
languageOptions: {
|
|
758
751
|
parserOptions: {
|
|
759
752
|
tsconfigRootDir: n,
|
|
760
|
-
project:
|
|
753
|
+
project: i,
|
|
761
754
|
ecmaVersion: 2021,
|
|
762
755
|
sourceType: "module",
|
|
763
756
|
ecmaFeatures: {
|
|
@@ -770,23 +763,23 @@ async function tn(e, n, s) {
|
|
|
770
763
|
o = new r.ESLint(a);
|
|
771
764
|
}
|
|
772
765
|
return {
|
|
773
|
-
async lint(a,
|
|
766
|
+
async lint(a, u, t) {
|
|
774
767
|
try {
|
|
775
|
-
const
|
|
776
|
-
if (await o.isPathIgnored(
|
|
768
|
+
const b = nn(t);
|
|
769
|
+
if (await o.isPathIgnored(b))
|
|
777
770
|
return null;
|
|
778
|
-
(await o.lintText(
|
|
779
|
-
filePath:
|
|
780
|
-
})).forEach((
|
|
781
|
-
for (const
|
|
782
|
-
if (
|
|
771
|
+
(await o.lintText(u, {
|
|
772
|
+
filePath: b
|
|
773
|
+
})).forEach((m) => {
|
|
774
|
+
for (const k of m.messages) {
|
|
775
|
+
if (k.ruleId != null && !k.ruleId.startsWith("qwik/"))
|
|
783
776
|
continue;
|
|
784
|
-
const
|
|
785
|
-
a.warn(
|
|
777
|
+
const g = rn(m.filePath, k);
|
|
778
|
+
a.warn(g);
|
|
786
779
|
}
|
|
787
780
|
});
|
|
788
|
-
} catch (
|
|
789
|
-
console.warn(
|
|
781
|
+
} catch (b) {
|
|
782
|
+
console.warn(b);
|
|
790
783
|
}
|
|
791
784
|
}
|
|
792
785
|
};
|
|
@@ -807,14 +800,14 @@ function rn(e, n) {
|
|
|
807
800
|
});
|
|
808
801
|
}
|
|
809
802
|
async function on(e, n) {
|
|
810
|
-
const
|
|
811
|
-
let r =
|
|
812
|
-
if (!
|
|
813
|
-
const o = await e.dynamicImport("node:fs"), { normalizePath:
|
|
814
|
-
|
|
803
|
+
const i = n;
|
|
804
|
+
let r = i.loc;
|
|
805
|
+
if (!i.frame && !i.plugin && (r || (r = sn(i)), r && (i.loc = r, r.file))) {
|
|
806
|
+
const o = await e.dynamicImport("node:fs"), { normalizePath: h } = await e.dynamicImport("vite");
|
|
807
|
+
i.id = h(i.loc.file);
|
|
815
808
|
try {
|
|
816
|
-
const c = o.readFileSync(
|
|
817
|
-
|
|
809
|
+
const c = o.readFileSync(i.loc.file, "utf-8");
|
|
810
|
+
i.frame = ln(c, i.loc);
|
|
818
811
|
} catch {
|
|
819
812
|
}
|
|
820
813
|
}
|
|
@@ -823,24 +816,24 @@ async function on(e, n) {
|
|
|
823
816
|
const sn = (e) => {
|
|
824
817
|
const n = e.stack;
|
|
825
818
|
if (typeof n == "string") {
|
|
826
|
-
const
|
|
819
|
+
const i = n.split(`
|
|
827
820
|
`).filter((r) => !r.includes("/node_modules/") && !r.includes("(node:"));
|
|
828
|
-
for (let r = 1; r <
|
|
829
|
-
const o =
|
|
821
|
+
for (let r = 1; r < i.length; r++) {
|
|
822
|
+
const o = i[r].replace("file:///", "/");
|
|
830
823
|
if (/^\s+at/.test(o)) {
|
|
831
|
-
const
|
|
832
|
-
if (
|
|
833
|
-
const
|
|
834
|
-
return typeof t == "number" && typeof
|
|
835
|
-
file:
|
|
836
|
-
line:
|
|
824
|
+
const h = o.indexOf("/"), c = o.lastIndexOf(")", h);
|
|
825
|
+
if (h > 0) {
|
|
826
|
+
const u = o.slice(h, c).split(":"), t = st(u[u.length - 1]), b = st(u[u.length - 2]);
|
|
827
|
+
return typeof t == "number" && typeof b == "number" ? (u.length -= 2, {
|
|
828
|
+
file: u.join(":"),
|
|
829
|
+
line: b,
|
|
837
830
|
column: t
|
|
838
|
-
}) : typeof t == "number" ? (
|
|
839
|
-
file:
|
|
831
|
+
}) : typeof t == "number" ? (u.length -= 1, {
|
|
832
|
+
file: u.join(":"),
|
|
840
833
|
line: t,
|
|
841
834
|
column: void 0
|
|
842
835
|
}) : {
|
|
843
|
-
file:
|
|
836
|
+
file: u.join(":"),
|
|
844
837
|
line: void 0,
|
|
845
838
|
column: void 0
|
|
846
839
|
};
|
|
@@ -848,62 +841,62 @@ const sn = (e) => {
|
|
|
848
841
|
}
|
|
849
842
|
}
|
|
850
843
|
}
|
|
851
|
-
}, ee = (e) => e.startsWith("\0"),
|
|
844
|
+
}, ee = (e) => e.startsWith("\0"), st = (e) => {
|
|
852
845
|
try {
|
|
853
846
|
return parseInt(e, 10);
|
|
854
847
|
} catch {
|
|
855
848
|
return;
|
|
856
849
|
}
|
|
857
|
-
},
|
|
850
|
+
}, Ct = /\r?\n/, at = 2;
|
|
858
851
|
function an(e, n) {
|
|
859
852
|
if (typeof n == "number")
|
|
860
853
|
return n;
|
|
861
854
|
if (n.lo != null)
|
|
862
855
|
return n.lo;
|
|
863
|
-
const
|
|
864
|
-
let
|
|
865
|
-
for (let c = 0; c < r - 1 && c <
|
|
866
|
-
|
|
867
|
-
return
|
|
856
|
+
const i = e.split(Ct), { line: r, column: o } = n;
|
|
857
|
+
let h = 0;
|
|
858
|
+
for (let c = 0; c < r - 1 && c < i.length; c++)
|
|
859
|
+
h += i[c].length + 1;
|
|
860
|
+
return h + o;
|
|
868
861
|
}
|
|
869
|
-
function ln(e, n = 0,
|
|
870
|
-
n = an(e, n),
|
|
871
|
-
const r = e.split(
|
|
862
|
+
function ln(e, n = 0, i) {
|
|
863
|
+
n = an(e, n), i = i || n;
|
|
864
|
+
const r = e.split(Ct);
|
|
872
865
|
let o = 0;
|
|
873
|
-
const
|
|
866
|
+
const h = [];
|
|
874
867
|
for (let c = 0; c < r.length; c++)
|
|
875
868
|
if (o += r[c].length + 1, o >= n) {
|
|
876
|
-
for (let a = c -
|
|
869
|
+
for (let a = c - at; a <= c + at || i > o; a++) {
|
|
877
870
|
if (a < 0 || a >= r.length)
|
|
878
871
|
continue;
|
|
879
|
-
const
|
|
880
|
-
|
|
872
|
+
const u = a + 1;
|
|
873
|
+
h.push(`${u}${" ".repeat(Math.max(3 - String(u).length, 0))}| ${r[a]}`);
|
|
881
874
|
const t = r[a].length;
|
|
882
875
|
if (a === c) {
|
|
883
|
-
const
|
|
884
|
-
|
|
876
|
+
const b = Math.max(n - (o - t) + 1, 0), x = Math.max(1, i > o ? t - b : i - n);
|
|
877
|
+
h.push(" | " + " ".repeat(b) + "^".repeat(x));
|
|
885
878
|
} else if (a > c) {
|
|
886
|
-
if (
|
|
887
|
-
const
|
|
888
|
-
|
|
879
|
+
if (i > o) {
|
|
880
|
+
const b = Math.max(Math.min(i - o, t), 1);
|
|
881
|
+
h.push(" | " + "^".repeat(b));
|
|
889
882
|
}
|
|
890
883
|
o += t + 1;
|
|
891
884
|
}
|
|
892
885
|
}
|
|
893
886
|
break;
|
|
894
887
|
}
|
|
895
|
-
return
|
|
888
|
+
return h.join(`
|
|
896
889
|
`);
|
|
897
890
|
}
|
|
898
891
|
function cn(e) {
|
|
899
892
|
return e === "win32";
|
|
900
893
|
}
|
|
901
|
-
function
|
|
902
|
-
const [n,
|
|
894
|
+
function $e(e) {
|
|
895
|
+
const [n, i] = e.split("?"), r = i || "";
|
|
903
896
|
return {
|
|
904
897
|
originalId: e,
|
|
905
898
|
pathId: n,
|
|
906
|
-
query: r ? `?${
|
|
899
|
+
query: r ? `?${i}` : "",
|
|
907
900
|
params: new URLSearchParams(r)
|
|
908
901
|
};
|
|
909
902
|
}
|
|
@@ -934,10 +927,10 @@ const dn = ["server"], un = [
|
|
|
934
927
|
"browser",
|
|
935
928
|
"event$"
|
|
936
929
|
];
|
|
937
|
-
var
|
|
938
|
-
function
|
|
939
|
-
const n = `${Math.round(Math.random() * 899) + 100}`,
|
|
940
|
-
let c = null, a,
|
|
930
|
+
var Pt = /* @__PURE__ */ ((e) => (e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(Pt || {});
|
|
931
|
+
function Dt(e = {}) {
|
|
932
|
+
const n = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
|
|
933
|
+
let c = null, a, u = () => {
|
|
941
934
|
};
|
|
942
935
|
const t = {
|
|
943
936
|
csr: !1,
|
|
@@ -968,104 +961,104 @@ function Ct(e = {}) {
|
|
|
968
961
|
lint: !1,
|
|
969
962
|
experimental: void 0
|
|
970
963
|
};
|
|
971
|
-
let
|
|
972
|
-
const
|
|
973
|
-
if (!c && (c = await
|
|
964
|
+
let b, x;
|
|
965
|
+
const m = async () => {
|
|
966
|
+
if (!c && (c = await At(e), b = hn(c.sys), c.sys.env !== "browsermain" && c.sys.env !== "webworker"))
|
|
974
967
|
try {
|
|
975
|
-
|
|
968
|
+
x === void 0 && (x = await c.sys.dynamicImport("node:fs"));
|
|
976
969
|
} catch {
|
|
977
|
-
console.log("node:fs not available, disabling automatic manifest reading"),
|
|
970
|
+
console.log("node:fs not available, disabling automatic manifest reading"), x = null;
|
|
978
971
|
}
|
|
979
|
-
},
|
|
972
|
+
}, k = () => {
|
|
980
973
|
if (!c)
|
|
981
974
|
throw new Error("Qwik plugin has not been initialized");
|
|
982
975
|
return c;
|
|
983
|
-
},
|
|
984
|
-
let
|
|
985
|
-
const l = (
|
|
986
|
-
|
|
987
|
-
},
|
|
988
|
-
const
|
|
989
|
-
t.debug = !!
|
|
976
|
+
}, g = () => k().sys, d = () => k().sys.path;
|
|
977
|
+
let f;
|
|
978
|
+
const l = (_) => {
|
|
979
|
+
f = _;
|
|
980
|
+
}, p = async (_) => {
|
|
981
|
+
const y = Object.assign({}, _), C = k(), M = C.sys.path, D = (...j) => X(M.resolve(...j));
|
|
982
|
+
t.debug = !!y.debug, y.assetsDir && (t.assetsDir = y.assetsDir), y.target === "ssr" || y.target === "client" || y.target === "lib" || y.target === "test" ? t.target = y.target : t.target || (t.target = "client"), t.target === "lib" ? t.buildMode = "development" : y.buildMode === "production" || y.buildMode === "development" ? t.buildMode = y.buildMode : t.buildMode || (t.buildMode = "development"), t.csr = !!y.csr, y.entryStrategy && typeof y.entryStrategy == "object" && (t.entryStrategy = { ...y.entryStrategy }), t.entryStrategy || (t.target === "ssr" || t.target === "test" ? t.entryStrategy = { type: "hoist" } : t.target === "lib" ? t.entryStrategy = { type: "inline" } : t.buildMode === "production" ? t.entryStrategy = { type: "smart" } : t.entryStrategy = { type: "segment" }), typeof y.rootDir == "string" && (t.rootDir = y.rootDir), typeof t.rootDir != "string" && (t.rootDir || (t.rootDir = C.sys.cwd())), t.rootDir = D(C.sys.cwd(), t.rootDir);
|
|
990
983
|
let P = D(t.rootDir, yn);
|
|
991
|
-
if (typeof
|
|
992
|
-
t.scope =
|
|
993
|
-
else if (!t.scope &&
|
|
994
|
-
let
|
|
984
|
+
if (typeof y.srcDir == "string" ? (t.srcDir = D(t.rootDir, y.srcDir), P = t.srcDir) : t.srcDir || (t.srcDir = P), t.srcDir = D(t.rootDir, t.srcDir), Array.isArray(y.tsconfigFileNames) && y.tsconfigFileNames.length > 0 && (t.tsconfigFileNames = y.tsconfigFileNames), !t.csr && !y.input && !t.input && (t.target === "ssr" ? t.input = [D(P, "entry.ssr")] : t.target === "client" ? t.input = [D(P, "root")] : t.input = void 0), y.outDir && (t.outDir = D(t.rootDir, y.outDir)), t.clientOutDir = D(t.rootDir, y.clientOutDir || lt), t.ssrOutDir = D(t.rootDir, y.ssrOutDir || bn), t.target === "ssr" ? t.outDir || (t.outDir = t.ssrOutDir) : t.target === "lib" ? t.outDir || (t.outDir = D(t.rootDir, vn)) : t.outDir || (t.outDir = t.clientOutDir), typeof y.manifestOutput == "function" && (t.manifestOutput = y.manifestOutput), y.manifestInput && (t.manifestInput = tt(y.manifestInput) || null), typeof y.transformedModuleOutput == "function" && (t.transformedModuleOutput = y.transformedModuleOutput), y.scope !== void 0)
|
|
985
|
+
t.scope = y.scope;
|
|
986
|
+
else if (!t.scope && x) {
|
|
987
|
+
let j = "";
|
|
995
988
|
try {
|
|
996
|
-
let
|
|
997
|
-
for (;
|
|
998
|
-
const
|
|
999
|
-
if (
|
|
989
|
+
let U = t.rootDir;
|
|
990
|
+
for (; j = M.resolve(U, "package.json"), !await x.promises.stat(j).catch(() => !1); ) {
|
|
991
|
+
const L = M.resolve(U, "..");
|
|
992
|
+
if (L === U)
|
|
1000
993
|
break;
|
|
1001
|
-
|
|
994
|
+
U = L, j = "";
|
|
1002
995
|
}
|
|
1003
|
-
if (
|
|
1004
|
-
const
|
|
1005
|
-
typeof
|
|
996
|
+
if (j) {
|
|
997
|
+
const L = await x.promises.readFile(j, "utf-8"), O = JSON.parse(L);
|
|
998
|
+
typeof O.name == "string" && (t.scope = O.name);
|
|
1006
999
|
}
|
|
1007
|
-
} catch (
|
|
1000
|
+
} catch (U) {
|
|
1008
1001
|
console.warn(
|
|
1009
|
-
`could not read ${
|
|
1002
|
+
`could not read ${j || "package.json"} to determine package name, ignoring. (${U})`
|
|
1010
1003
|
);
|
|
1011
1004
|
}
|
|
1012
1005
|
}
|
|
1013
|
-
if (typeof
|
|
1006
|
+
if (typeof y.resolveQwikBuild == "boolean" && (t.resolveQwikBuild = y.resolveQwikBuild), typeof y.devTools == "object" && ("imageDevTools" in y.devTools && (t.devTools.imageDevTools = y.devTools.imageDevTools), "clickToSource" in y.devTools && (t.devTools.clickToSource = y.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? t.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof t.inlineStylesUpToBytes != "number" || t.inlineStylesUpToBytes < 0) && (t.inlineStylesUpToBytes = 0)), typeof y.lint == "boolean" && (t.lint = y.lint), "experimental" in y) {
|
|
1014
1007
|
t.experimental = void 0;
|
|
1015
|
-
for (const
|
|
1016
|
-
|
|
1008
|
+
for (const j of y.experimental ?? [])
|
|
1009
|
+
Pt[j] ? (t.experimental || (t.experimental = {}))[j] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${j}`);
|
|
1017
1010
|
}
|
|
1018
|
-
const
|
|
1019
|
-
return t.input || (t.input =
|
|
1011
|
+
const A = { ...t };
|
|
1012
|
+
return t.input || (t.input = y.input), t.input && typeof t.input == "string" && (t.input = [t.input]), A;
|
|
1020
1013
|
};
|
|
1021
|
-
let
|
|
1022
|
-
const
|
|
1023
|
-
if (!
|
|
1024
|
-
|
|
1025
|
-
const
|
|
1026
|
-
if (
|
|
1027
|
-
const
|
|
1028
|
-
if (!
|
|
1014
|
+
let E = !1;
|
|
1015
|
+
const s = async (_) => {
|
|
1016
|
+
if (!E) {
|
|
1017
|
+
E = !0;
|
|
1018
|
+
const y = g();
|
|
1019
|
+
if (y.env === "node") {
|
|
1020
|
+
const C = await y.dynamicImport("node:fs");
|
|
1021
|
+
if (!C.existsSync(t.rootDir))
|
|
1029
1022
|
throw new Error(`Qwik rootDir "${t.rootDir}" not found.`);
|
|
1030
|
-
if (typeof t.srcDir == "string" && !
|
|
1023
|
+
if (typeof t.srcDir == "string" && !C.existsSync(t.srcDir))
|
|
1031
1024
|
throw new Error(`Qwik srcDir "${t.srcDir}" not found.`);
|
|
1032
|
-
for (const [
|
|
1033
|
-
if (!await
|
|
1025
|
+
for (const [M, D] of Object.entries(t.input || {}))
|
|
1026
|
+
if (!await _(D))
|
|
1034
1027
|
throw new Error(`Qwik input "${D}" not found.`);
|
|
1035
1028
|
}
|
|
1036
1029
|
}
|
|
1037
1030
|
};
|
|
1038
|
-
let
|
|
1039
|
-
const
|
|
1040
|
-
if (
|
|
1031
|
+
let v, w = !1;
|
|
1032
|
+
const S = async (_) => {
|
|
1033
|
+
if (q("buildStart()", t.buildMode, t.scope, t.target, t.rootDir, t.srcDir), v = k(), w = !f, v.sys.env === "node" && t.target === "ssr" && t.lint)
|
|
1041
1034
|
try {
|
|
1042
|
-
a = await tn(
|
|
1035
|
+
a = await tn(v.sys, t.rootDir, t.tsconfigFileNames);
|
|
1043
1036
|
} catch {
|
|
1044
1037
|
}
|
|
1045
|
-
if (
|
|
1046
|
-
const
|
|
1038
|
+
if (q("transformedOutputs.clear()"), r.clear(), o.clear(), t.target === "client") {
|
|
1039
|
+
const y = await _.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
1047
1040
|
skipSelf: !0
|
|
1048
1041
|
});
|
|
1049
|
-
|
|
1050
|
-
id:
|
|
1042
|
+
y && _.emitFile({
|
|
1043
|
+
id: y.id,
|
|
1051
1044
|
type: "chunk",
|
|
1052
1045
|
preserveSignature: "allow-extension"
|
|
1053
1046
|
});
|
|
1054
1047
|
}
|
|
1055
|
-
},
|
|
1056
|
-
let
|
|
1057
|
-
const
|
|
1058
|
-
if (ee(
|
|
1048
|
+
}, I = (_) => f ? !!_?.ssr : t.target === "ssr" || t.target === "test";
|
|
1049
|
+
let N = 0, $ = !1;
|
|
1050
|
+
const T = async (_, y, C, M) => {
|
|
1051
|
+
if (ee(y))
|
|
1059
1052
|
return;
|
|
1060
|
-
const D =
|
|
1053
|
+
const D = f && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(y);
|
|
1061
1054
|
if (D) {
|
|
1062
1055
|
if (!$) {
|
|
1063
1056
|
$ = !0, setTimeout(() => $ = !1, 500);
|
|
1064
|
-
const [, K,
|
|
1065
|
-
if (
|
|
1066
|
-
const ae =
|
|
1057
|
+
const [, K, H] = D, de = await _.resolve(K, C);
|
|
1058
|
+
if (de) {
|
|
1059
|
+
const ae = f.moduleGraph.getModuleById(de.id)?.file;
|
|
1067
1060
|
if (ae) {
|
|
1068
|
-
const te = `${ae}${
|
|
1061
|
+
const te = `${ae}${H}`;
|
|
1069
1062
|
try {
|
|
1070
1063
|
console.warn(`Opening in editor: ${te}`);
|
|
1071
1064
|
const Y = (await import("launch-editor")).default;
|
|
@@ -1078,24 +1071,24 @@ function Ct(e = {}) {
|
|
|
1078
1071
|
}
|
|
1079
1072
|
return { id: "\0editor" };
|
|
1080
1073
|
}
|
|
1081
|
-
const P =
|
|
1082
|
-
|
|
1083
|
-
const
|
|
1084
|
-
if (
|
|
1085
|
-
const K =
|
|
1086
|
-
|
|
1074
|
+
const P = N++, A = I(M);
|
|
1075
|
+
q(`resolveId(${P})`, `begin ${y} | ${A ? "server" : "client"} | ${C}`);
|
|
1076
|
+
const j = C && $e(C);
|
|
1077
|
+
if (C = j && X(j.pathId), y.startsWith(".") && j) {
|
|
1078
|
+
const K = d(), H = K.dirname(j.pathId);
|
|
1079
|
+
H && (y = K.resolve(H, y));
|
|
1087
1080
|
}
|
|
1088
|
-
const
|
|
1089
|
-
let
|
|
1081
|
+
const U = $e(y), L = X(U.pathId);
|
|
1082
|
+
let O;
|
|
1090
1083
|
if (
|
|
1091
1084
|
/**
|
|
1092
1085
|
* Check if we know the QRL. During regular builds, we'll encounter and build parents before
|
|
1093
1086
|
* their QRLs, so this will always match.
|
|
1094
1087
|
*/
|
|
1095
|
-
|
|
1088
|
+
h.get(L)
|
|
1096
1089
|
)
|
|
1097
|
-
|
|
1098
|
-
id:
|
|
1090
|
+
q(`resolveId(${P}) Resolved already known ${L}`), O = {
|
|
1091
|
+
id: L + U.query,
|
|
1099
1092
|
moduleSideEffects: !1
|
|
1100
1093
|
};
|
|
1101
1094
|
else if (
|
|
@@ -1104,135 +1097,135 @@ function Ct(e = {}) {
|
|
|
1104
1097
|
* been transformed yet.
|
|
1105
1098
|
*/
|
|
1106
1099
|
// We test with endsWith because the dev server adds the base pathname
|
|
1107
|
-
|
|
1100
|
+
L.endsWith(ne)
|
|
1108
1101
|
)
|
|
1109
|
-
t.resolveQwikBuild && (
|
|
1102
|
+
t.resolveQwikBuild && (q(`resolveId(${P})`, "Resolved", ne), O = {
|
|
1110
1103
|
id: ne,
|
|
1111
1104
|
moduleSideEffects: !1
|
|
1112
1105
|
});
|
|
1113
|
-
else if (
|
|
1114
|
-
|
|
1106
|
+
else if (L.endsWith(re))
|
|
1107
|
+
q(`resolveId(${P})`, "Resolved", re), O = {
|
|
1115
1108
|
id: re,
|
|
1116
1109
|
moduleSideEffects: !1
|
|
1117
1110
|
};
|
|
1118
|
-
else if (!
|
|
1119
|
-
|
|
1120
|
-
const K = await
|
|
1111
|
+
else if (!f && !A && L.endsWith(We)) {
|
|
1112
|
+
q(`resolveId(${P})`, "Resolved", We);
|
|
1113
|
+
const K = await _.resolve(We, C, {
|
|
1121
1114
|
skipSelf: !0
|
|
1122
1115
|
});
|
|
1123
1116
|
if (K)
|
|
1124
|
-
return
|
|
1117
|
+
return _.emitFile({
|
|
1125
1118
|
id: K.id,
|
|
1126
1119
|
type: "chunk",
|
|
1127
1120
|
preserveSignature: "allow-extension"
|
|
1128
1121
|
}), K;
|
|
1129
|
-
} else if (
|
|
1130
|
-
|
|
1131
|
-
id:
|
|
1122
|
+
} else if (L.endsWith(pe))
|
|
1123
|
+
q(`resolveId(${P})`, "Resolved", pe), O = {
|
|
1124
|
+
id: pe,
|
|
1132
1125
|
moduleSideEffects: !1
|
|
1133
1126
|
};
|
|
1134
1127
|
else {
|
|
1135
|
-
if (!
|
|
1136
|
-
|
|
1137
|
-
const
|
|
1128
|
+
if (!A && w && y.endsWith("@qwik.dev/core")) {
|
|
1129
|
+
w = !1;
|
|
1130
|
+
const H = await _.resolve("@qwik.dev/core/handlers.mjs", C, {
|
|
1138
1131
|
skipSelf: !0
|
|
1139
1132
|
});
|
|
1140
|
-
if (!
|
|
1133
|
+
if (!H)
|
|
1141
1134
|
throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
|
|
1142
|
-
|
|
1143
|
-
id:
|
|
1135
|
+
_.emitFile({
|
|
1136
|
+
id: H.id,
|
|
1144
1137
|
type: "chunk",
|
|
1145
1138
|
preserveSignature: "allow-extension"
|
|
1146
1139
|
});
|
|
1147
1140
|
}
|
|
1148
|
-
const K = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(
|
|
1141
|
+
const K = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(y)?.groups;
|
|
1149
1142
|
if (K) {
|
|
1150
|
-
const { parent:
|
|
1143
|
+
const { parent: H, name: de, query: ae } = K, te = await _.resolve(H, C, { skipSelf: !0 });
|
|
1151
1144
|
if (te) {
|
|
1152
|
-
const Y = te.id.split("?")[0],
|
|
1153
|
-
|
|
1154
|
-
id:
|
|
1145
|
+
const Y = te.id.split("?")[0], Oe = f && C?.endsWith(".html") ? `${Y}_${de}.js` : L;
|
|
1146
|
+
q(`resolveId(${P})`, `resolved to QRL ${de} of ${Y}`), h.set(Oe, Y), O = {
|
|
1147
|
+
id: Oe + ae,
|
|
1155
1148
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
1156
1149
|
moduleSideEffects: !1
|
|
1157
1150
|
};
|
|
1158
1151
|
} else
|
|
1159
|
-
console.error(`resolveId(${P})`, `QRL parent ${
|
|
1160
|
-
} else if (
|
|
1161
|
-
const
|
|
1162
|
-
if (
|
|
1163
|
-
return
|
|
1152
|
+
console.error(`resolveId(${P})`, `QRL parent ${H} does not exist!`);
|
|
1153
|
+
} else if (C) {
|
|
1154
|
+
const H = h.get(C);
|
|
1155
|
+
if (H)
|
|
1156
|
+
return q(`resolveId(${P}) end`, `resolving via ${H}`), _.resolve(y, H, { skipSelf: !0 });
|
|
1164
1157
|
}
|
|
1165
1158
|
}
|
|
1166
|
-
return
|
|
1159
|
+
return q(`resolveId(${P}) end`, O?.id || O), O;
|
|
1167
1160
|
};
|
|
1168
|
-
let
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1161
|
+
let F = 0;
|
|
1162
|
+
const Q = async (_, y, C) => {
|
|
1163
|
+
if (y === "\0editor")
|
|
1171
1164
|
return '"opening in editor"';
|
|
1172
|
-
if (ee(
|
|
1165
|
+
if (ee(y) || y.startsWith("/@fs/"))
|
|
1173
1166
|
return;
|
|
1174
|
-
const
|
|
1175
|
-
if (t.resolveQwikBuild &&
|
|
1176
|
-
return
|
|
1167
|
+
const M = F++, D = I(C);
|
|
1168
|
+
if (t.resolveQwikBuild && y === ne)
|
|
1169
|
+
return q(`load(${M})`, ne, t.buildMode), {
|
|
1177
1170
|
moduleSideEffects: !1,
|
|
1178
|
-
code:
|
|
1171
|
+
code: W(D, t.target)
|
|
1179
1172
|
};
|
|
1180
|
-
if (
|
|
1181
|
-
return
|
|
1173
|
+
if (y === re)
|
|
1174
|
+
return q(`load(${M})`, re, t.buildMode), {
|
|
1182
1175
|
moduleSideEffects: !1,
|
|
1183
|
-
code: await
|
|
1176
|
+
code: await Me(D)
|
|
1184
1177
|
};
|
|
1185
|
-
if (
|
|
1186
|
-
return
|
|
1178
|
+
if (y === pe)
|
|
1179
|
+
return q(`load(${M})`, pe, t.buildMode), {
|
|
1187
1180
|
moduleSideEffects: !1,
|
|
1188
1181
|
code: "export * from '@qwik.dev/core';"
|
|
1189
1182
|
};
|
|
1190
|
-
const P =
|
|
1191
|
-
|
|
1192
|
-
const
|
|
1193
|
-
if (
|
|
1194
|
-
const
|
|
1195
|
-
if (
|
|
1196
|
-
const
|
|
1197
|
-
if (
|
|
1198
|
-
if (
|
|
1199
|
-
return
|
|
1183
|
+
const P = $e(y);
|
|
1184
|
+
y = X(P.pathId);
|
|
1185
|
+
const A = D ? o : r;
|
|
1186
|
+
if (f && !A.has(y)) {
|
|
1187
|
+
const U = h.get(y);
|
|
1188
|
+
if (U) {
|
|
1189
|
+
const L = f.moduleGraph.getModuleById(U);
|
|
1190
|
+
if (L) {
|
|
1191
|
+
if (q(`load(${M})`, "transforming QRL parent", U), await f.transformRequest(L.url), !A.has(y))
|
|
1192
|
+
return q(`load(${M})`, `QRL segment ${y} not found in ${U}`), null;
|
|
1200
1193
|
} else
|
|
1201
|
-
console.error(`load(${
|
|
1194
|
+
console.error(`load(${M})`, `${L} does not exist!`);
|
|
1202
1195
|
}
|
|
1203
1196
|
}
|
|
1204
|
-
const
|
|
1205
|
-
if (
|
|
1206
|
-
|
|
1207
|
-
const { code:
|
|
1208
|
-
return { code:
|
|
1197
|
+
const j = A.get(y);
|
|
1198
|
+
if (j) {
|
|
1199
|
+
q(`load(${M})`, "Found", y);
|
|
1200
|
+
const { code: U, map: L, segment: O } = j[0];
|
|
1201
|
+
return { code: U, map: L, meta: { segment: O } };
|
|
1209
1202
|
}
|
|
1210
|
-
return
|
|
1203
|
+
return q(`load(${M})`, "Not a QRL or virtual module", y), null;
|
|
1211
1204
|
};
|
|
1212
|
-
let
|
|
1213
|
-
const
|
|
1214
|
-
if (ee(
|
|
1205
|
+
let B = 0;
|
|
1206
|
+
const V = async function(_, y, C, M = {}) {
|
|
1207
|
+
if (ee(C))
|
|
1215
1208
|
return;
|
|
1216
|
-
const D =
|
|
1217
|
-
if (
|
|
1209
|
+
const D = B++, P = I(M), A = P ? o : r;
|
|
1210
|
+
if (A.has(C))
|
|
1218
1211
|
return;
|
|
1219
|
-
const
|
|
1220
|
-
if (
|
|
1212
|
+
const j = k(), U = d(), { pathId: L } = $e(C), O = U.parse(L), K = O.dir, H = O.base;
|
|
1213
|
+
if (O.ext.toLowerCase() in gn || Nt.test(L)) {
|
|
1221
1214
|
const ae = t.target === "client" || t.target === "ssr";
|
|
1222
|
-
|
|
1215
|
+
q(
|
|
1223
1216
|
`transform(${D})`,
|
|
1224
|
-
`Transforming ${
|
|
1217
|
+
`Transforming ${C} (for: ${P ? "server" : "client"}${ae ? ", strip" : ""})`
|
|
1225
1218
|
);
|
|
1226
1219
|
const te = t.target === "lib" ? "lib" : t.buildMode === "development" ? "dev" : "prod";
|
|
1227
|
-
te !== "lib" && (
|
|
1228
|
-
let Y =
|
|
1229
|
-
t.srcDir && (Y =
|
|
1230
|
-
const
|
|
1231
|
-
let
|
|
1232
|
-
|
|
1233
|
-
const
|
|
1234
|
-
input: [{ code:
|
|
1235
|
-
entryStrategy: P ? { type: "hoist" } :
|
|
1220
|
+
te !== "lib" && (y = y.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (Z, le) => t.experimental?.[le] ? "true" : "false"));
|
|
1221
|
+
let Y = H;
|
|
1222
|
+
t.srcDir && (Y = U.relative(t.srcDir, L)), Y = X(Y);
|
|
1223
|
+
const Le = t.srcDir ? t.srcDir : X(K), Oe = t.entryStrategy;
|
|
1224
|
+
let Ve;
|
|
1225
|
+
f && (Ve = f.moduleGraph.getModuleById(L)?.url);
|
|
1226
|
+
const ue = {
|
|
1227
|
+
input: [{ code: y, path: Y, devPath: Ve }],
|
|
1228
|
+
entryStrategy: P ? { type: "hoist" } : Oe,
|
|
1236
1229
|
minify: "simplify",
|
|
1237
1230
|
// Always enable sourcemaps in dev for click-to-source
|
|
1238
1231
|
sourceMaps: t.sourcemap || t.buildMode === "development",
|
|
@@ -1240,83 +1233,83 @@ function Ct(e = {}) {
|
|
|
1240
1233
|
transpileJsx: !0,
|
|
1241
1234
|
explicitExtensions: !0,
|
|
1242
1235
|
preserveFilenames: !0,
|
|
1243
|
-
srcDir:
|
|
1236
|
+
srcDir: Le,
|
|
1244
1237
|
rootDir: t.rootDir,
|
|
1245
1238
|
mode: te,
|
|
1246
1239
|
scope: t.scope || void 0,
|
|
1247
1240
|
isServer: P
|
|
1248
1241
|
};
|
|
1249
|
-
ae && (P ? (
|
|
1250
|
-
const Ot = Date.now(),
|
|
1251
|
-
|
|
1252
|
-
const
|
|
1253
|
-
|
|
1254
|
-
const
|
|
1255
|
-
for (const Z of
|
|
1256
|
-
if (Z !==
|
|
1257
|
-
const le =
|
|
1258
|
-
|
|
1242
|
+
ae && (P ? (ue.stripCtxName = pn, ue.stripEventHandlers = !0, ue.regCtxName = dn) : (ue.stripCtxName = fn, ue.stripExports = un));
|
|
1243
|
+
const Ot = Date.now(), fe = await j.transformModules(ue);
|
|
1244
|
+
q(`transform(${D})`, `done in ${Date.now() - Ot}ms`);
|
|
1245
|
+
const je = fe.modules.find((Z) => !mn(Z));
|
|
1246
|
+
u(fe.diagnostics, j, Le), P ? fe.diagnostics.length === 0 && a && a.lint(_, y, C) : i.set(C, fe);
|
|
1247
|
+
const ze = /* @__PURE__ */ new Set();
|
|
1248
|
+
for (const Z of fe.modules)
|
|
1249
|
+
if (Z !== je) {
|
|
1250
|
+
const le = X(U.join(Le, Z.path));
|
|
1251
|
+
q(`transform(${D})`, `segment ${le}`, Z.segment.displayName), h.set(le, C), A.set(le, [Z, C]), ze.add(le), t.target === "client" && !f && _.emitFile({
|
|
1259
1252
|
id: le,
|
|
1260
1253
|
type: "chunk",
|
|
1261
1254
|
preserveSignature: "allow-extension"
|
|
1262
1255
|
});
|
|
1263
1256
|
}
|
|
1264
|
-
return await Promise.all([...
|
|
1265
|
-
code:
|
|
1266
|
-
map:
|
|
1257
|
+
return await Promise.all([...ze.values()].map((Z) => _.load({ id: Z }))), _.addWatchFile(C), {
|
|
1258
|
+
code: je.code,
|
|
1259
|
+
map: je.map,
|
|
1267
1260
|
meta: {
|
|
1268
|
-
segment:
|
|
1269
|
-
qwikdeps: Array.from(
|
|
1261
|
+
segment: je.segment,
|
|
1262
|
+
qwikdeps: Array.from(ze)
|
|
1270
1263
|
}
|
|
1271
1264
|
};
|
|
1272
1265
|
}
|
|
1273
|
-
return
|
|
1274
|
-
},
|
|
1275
|
-
const
|
|
1276
|
-
addInjection: (
|
|
1266
|
+
return q(`transform(${D})`, "Not transforming", C), null;
|
|
1267
|
+
}, G = (_) => {
|
|
1268
|
+
const y = [], C = {
|
|
1269
|
+
addInjection: (M) => y.push(M)
|
|
1277
1270
|
};
|
|
1278
|
-
return
|
|
1279
|
-
const P =
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1271
|
+
return C.generateManifest = async (M) => {
|
|
1272
|
+
const P = k().sys.path, A = P.resolve(t.rootDir, t.outDir, "build"), j = (O) => P.relative(A, P.resolve(t.rootDir, t.outDir, O));
|
|
1273
|
+
C.canonPath = j;
|
|
1274
|
+
const U = Array.from(i.values()).flatMap((O) => O.modules).map((O) => O.segment).filter((O) => !!O), L = Yt(
|
|
1282
1275
|
P,
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1276
|
+
U,
|
|
1277
|
+
y,
|
|
1278
|
+
_,
|
|
1286
1279
|
t,
|
|
1287
|
-
|
|
1288
|
-
|
|
1280
|
+
q,
|
|
1281
|
+
j
|
|
1289
1282
|
);
|
|
1290
|
-
|
|
1291
|
-
for (const
|
|
1292
|
-
|
|
1293
|
-
for (const
|
|
1294
|
-
|
|
1295
|
-
return
|
|
1296
|
-
},
|
|
1297
|
-
},
|
|
1298
|
-
t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ...
|
|
1299
|
-
},
|
|
1300
|
-
console.log(`[QWIK PLUGIN: ${n}]`, ...
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1303
|
-
},
|
|
1304
|
-
function
|
|
1305
|
-
const
|
|
1283
|
+
M && Object.assign(L, M);
|
|
1284
|
+
for (const O of Object.values(L.symbols))
|
|
1285
|
+
O.origin && (O.origin = X(O.origin));
|
|
1286
|
+
for (const O of Object.values(L.bundles))
|
|
1287
|
+
O.origins && (O.origins = O.origins.sort());
|
|
1288
|
+
return L.manifestHash = zt(JSON.stringify(L)), L;
|
|
1289
|
+
}, C;
|
|
1290
|
+
}, ie = () => t, J = () => Array.from(r.values()).map((_) => _[0]), q = (..._) => {
|
|
1291
|
+
t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ..._);
|
|
1292
|
+
}, se = (..._) => {
|
|
1293
|
+
console.log(`[QWIK PLUGIN: ${n}]`, ..._);
|
|
1294
|
+
}, Ne = (_) => {
|
|
1295
|
+
u = _;
|
|
1296
|
+
}, X = (_) => b(_);
|
|
1297
|
+
function W(_, y) {
|
|
1298
|
+
const C = t.buildMode === "development";
|
|
1306
1299
|
return `// @qwik.dev/core/build
|
|
1307
|
-
export const isServer = ${JSON.stringify(
|
|
1308
|
-
export const isBrowser = ${JSON.stringify(!
|
|
1309
|
-
export const isDev = ${JSON.stringify(
|
|
1300
|
+
export const isServer = ${JSON.stringify(_)};
|
|
1301
|
+
export const isBrowser = ${JSON.stringify(!_)};
|
|
1302
|
+
export const isDev = ${JSON.stringify(C)};
|
|
1310
1303
|
`;
|
|
1311
1304
|
}
|
|
1312
|
-
async function
|
|
1313
|
-
if (!t.manifestInput && t.target === "ssr" && t.buildMode === "production" &&
|
|
1314
|
-
const
|
|
1315
|
-
let D = t.manifestInputPath ||
|
|
1316
|
-
await
|
|
1305
|
+
async function Me(_) {
|
|
1306
|
+
if (!t.manifestInput && t.target === "ssr" && t.buildMode === "production" && x) {
|
|
1307
|
+
const M = d();
|
|
1308
|
+
let D = t.manifestInputPath || M.resolve(t.clientOutDir, Ge);
|
|
1309
|
+
await x.promises.stat(D).catch(() => !1) || (D = M.resolve(t.rootDir, lt, Ge));
|
|
1317
1310
|
try {
|
|
1318
|
-
const P = await
|
|
1319
|
-
t.manifestInput =
|
|
1311
|
+
const P = await x.promises.readFile(D, "utf-8");
|
|
1312
|
+
t.manifestInput = tt(JSON.parse(P)) || null, console.info("Read client manifest from", D);
|
|
1320
1313
|
} catch (P) {
|
|
1321
1314
|
console.warn(
|
|
1322
1315
|
`
|
|
@@ -1330,113 +1323,113 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1330
1323
|
);
|
|
1331
1324
|
}
|
|
1332
1325
|
}
|
|
1333
|
-
const
|
|
1334
|
-
let
|
|
1335
|
-
return
|
|
1336
|
-
manifestHash:
|
|
1337
|
-
core:
|
|
1338
|
-
preloader:
|
|
1339
|
-
qwikLoader:
|
|
1340
|
-
bundleGraphAsset:
|
|
1341
|
-
injections:
|
|
1342
|
-
mapping:
|
|
1343
|
-
bundleGraph:
|
|
1326
|
+
const y = _ ? t.manifestInput : null;
|
|
1327
|
+
let C = null;
|
|
1328
|
+
return y?.manifestHash && (C = {
|
|
1329
|
+
manifestHash: y.manifestHash,
|
|
1330
|
+
core: y.core,
|
|
1331
|
+
preloader: y.preloader,
|
|
1332
|
+
qwikLoader: y.qwikLoader,
|
|
1333
|
+
bundleGraphAsset: y.bundleGraphAsset,
|
|
1334
|
+
injections: y.injections,
|
|
1335
|
+
mapping: y.mapping,
|
|
1336
|
+
bundleGraph: y.bundleGraph
|
|
1344
1337
|
}), `// @qwik-client-manifest
|
|
1345
|
-
export const manifest = ${
|
|
1338
|
+
export const manifest = ${C ? JSON.stringify(C) : "globalThis.__QWIK_MANIFEST__"};
|
|
1346
1339
|
`;
|
|
1347
1340
|
}
|
|
1348
|
-
function
|
|
1349
|
-
t.sourcemap =
|
|
1350
|
-
}
|
|
1351
|
-
function
|
|
1352
|
-
|
|
1353
|
-
for (const
|
|
1354
|
-
const { id:
|
|
1355
|
-
if (
|
|
1356
|
-
|
|
1357
|
-
for (const
|
|
1358
|
-
for (const [D, [P,
|
|
1359
|
-
if (
|
|
1360
|
-
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1341
|
+
function ce(_) {
|
|
1342
|
+
t.sourcemap = _;
|
|
1343
|
+
}
|
|
1344
|
+
function qe(_) {
|
|
1345
|
+
q("handleHotUpdate()", _.file);
|
|
1346
|
+
for (const y of _.modules) {
|
|
1347
|
+
const { id: C } = y;
|
|
1348
|
+
if (C) {
|
|
1349
|
+
q("handleHotUpdate()", `invalidate ${C}`), i.delete(C);
|
|
1350
|
+
for (const M of [r, o])
|
|
1351
|
+
for (const [D, [P, A]] of M)
|
|
1352
|
+
if (A === C) {
|
|
1353
|
+
q("handleHotUpdate()", `invalidate ${C} segment ${D}`), M.delete(D);
|
|
1354
|
+
const j = _.server.moduleGraph.getModuleById(D);
|
|
1355
|
+
j && _.server.moduleGraph.invalidateModule(j);
|
|
1363
1356
|
}
|
|
1364
1357
|
}
|
|
1365
1358
|
}
|
|
1366
1359
|
}
|
|
1367
|
-
const qt = (
|
|
1360
|
+
const qt = (_, { getModuleInfo: y }) => {
|
|
1368
1361
|
if (t.target === "client") {
|
|
1369
1362
|
if (
|
|
1370
1363
|
// The preloader has to stay in a separate chunk if it's a client build
|
|
1371
1364
|
// the vite preload helper must be included or to prevent breaking circular dependencies
|
|
1372
|
-
|
|
1365
|
+
_.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(_) || _ === "\0vite/preload-helper.js"
|
|
1373
1366
|
)
|
|
1374
1367
|
return "qwik-preloader";
|
|
1375
1368
|
if (
|
|
1376
1369
|
// likewise, core and handlers have to be in the same chunk so there's no import waterfall
|
|
1377
|
-
/[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(
|
|
1370
|
+
/[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(_)
|
|
1378
1371
|
)
|
|
1379
1372
|
return "qwik-core";
|
|
1380
|
-
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(
|
|
1373
|
+
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(_))
|
|
1381
1374
|
return "qwik-loader";
|
|
1382
1375
|
}
|
|
1383
|
-
const
|
|
1384
|
-
if (
|
|
1385
|
-
const
|
|
1386
|
-
if (
|
|
1387
|
-
const { hash: D } =
|
|
1376
|
+
const C = y(_);
|
|
1377
|
+
if (C) {
|
|
1378
|
+
const M = C.meta.segment;
|
|
1379
|
+
if (M) {
|
|
1380
|
+
const { hash: D } = M, P = t.entryStrategy.manual?.[D] || M.entry;
|
|
1388
1381
|
if (P)
|
|
1389
1382
|
return P;
|
|
1390
1383
|
}
|
|
1391
1384
|
}
|
|
1392
1385
|
return null;
|
|
1393
1386
|
};
|
|
1394
|
-
async function Lt(
|
|
1395
|
-
const P = await
|
|
1387
|
+
async function Lt(_, y, C, M) {
|
|
1388
|
+
const P = await G(y).generateManifest(M);
|
|
1396
1389
|
P.platform = {
|
|
1397
|
-
...
|
|
1398
|
-
rollup:
|
|
1399
|
-
env:
|
|
1400
|
-
os:
|
|
1401
|
-
},
|
|
1402
|
-
const
|
|
1390
|
+
...M?.platform,
|
|
1391
|
+
rollup: _.meta?.rollupVersion || "",
|
|
1392
|
+
env: v.sys.env,
|
|
1393
|
+
os: v.sys.os
|
|
1394
|
+
}, v.sys.env === "node" && (P.platform.node = process.versions.node);
|
|
1395
|
+
const A = en(P, C), j = _.emitFile({
|
|
1403
1396
|
type: "asset",
|
|
1404
1397
|
name: "bundle-graph.json",
|
|
1405
|
-
source: JSON.stringify(
|
|
1406
|
-
}),
|
|
1407
|
-
P.bundleGraphAsset =
|
|
1398
|
+
source: JSON.stringify(A)
|
|
1399
|
+
}), U = _.getFileName(j);
|
|
1400
|
+
P.bundleGraphAsset = U, P.assets[U] = {
|
|
1408
1401
|
name: "bundle-graph.json",
|
|
1409
|
-
size:
|
|
1402
|
+
size: A.length
|
|
1410
1403
|
};
|
|
1411
|
-
const
|
|
1412
|
-
|
|
1413
|
-
fileName:
|
|
1404
|
+
const L = JSON.stringify(P, null, " ");
|
|
1405
|
+
_.emitFile({
|
|
1406
|
+
fileName: Ge,
|
|
1414
1407
|
type: "asset",
|
|
1415
|
-
source:
|
|
1416
|
-
}), typeof t.manifestOutput == "function" && await t.manifestOutput(P), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(
|
|
1408
|
+
source: L
|
|
1409
|
+
}), typeof t.manifestOutput == "function" && await t.manifestOutput(P), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(J());
|
|
1417
1410
|
}
|
|
1418
1411
|
return {
|
|
1419
|
-
buildStart:
|
|
1420
|
-
createOutputAnalyzer:
|
|
1421
|
-
getQwikBuildModule:
|
|
1422
|
-
getOptimizer:
|
|
1423
|
-
getOptions:
|
|
1424
|
-
getPath:
|
|
1425
|
-
getSys:
|
|
1426
|
-
getTransformedOutputs:
|
|
1427
|
-
init:
|
|
1428
|
-
load:
|
|
1429
|
-
debug:
|
|
1430
|
-
log:
|
|
1431
|
-
normalizeOptions:
|
|
1432
|
-
normalizePath:
|
|
1433
|
-
onDiagnostics:
|
|
1434
|
-
resolveId:
|
|
1435
|
-
transform:
|
|
1436
|
-
validateSource:
|
|
1437
|
-
setSourceMapSupport:
|
|
1412
|
+
buildStart: S,
|
|
1413
|
+
createOutputAnalyzer: G,
|
|
1414
|
+
getQwikBuildModule: W,
|
|
1415
|
+
getOptimizer: k,
|
|
1416
|
+
getOptions: ie,
|
|
1417
|
+
getPath: d,
|
|
1418
|
+
getSys: g,
|
|
1419
|
+
getTransformedOutputs: J,
|
|
1420
|
+
init: m,
|
|
1421
|
+
load: Q,
|
|
1422
|
+
debug: q,
|
|
1423
|
+
log: se,
|
|
1424
|
+
normalizeOptions: p,
|
|
1425
|
+
normalizePath: X,
|
|
1426
|
+
onDiagnostics: Ne,
|
|
1427
|
+
resolveId: T,
|
|
1428
|
+
transform: V,
|
|
1429
|
+
validateSource: s,
|
|
1430
|
+
setSourceMapSupport: ce,
|
|
1438
1431
|
configureServer: l,
|
|
1439
|
-
handleHotUpdate:
|
|
1432
|
+
handleHotUpdate: qe,
|
|
1440
1433
|
manualChunks: qt,
|
|
1441
1434
|
generateManifest: Lt
|
|
1442
1435
|
};
|
|
@@ -1449,16 +1442,16 @@ const gn = {
|
|
|
1449
1442
|
".jsx": !0,
|
|
1450
1443
|
".ts": !0,
|
|
1451
1444
|
".tsx": !0
|
|
1452
|
-
},
|
|
1453
|
-
async function wn(e, n,
|
|
1445
|
+
}, Nt = /\.qwik\.[mc]?js$/, Be = "@qwik.dev/core", Ae = "@qwik.dev/core/internal", ne = "@qwik.dev/core/build", Je = "@qwik.dev/core/jsx-runtime", Ye = "@qwik.dev/core/jsx-dev-runtime", He = "@qwik.dev/core/server", re = "@qwik-client-manifest", We = "@qwik.dev/core/preloader", pe = "@qwik-handlers", yn = "src", lt = "dist", bn = "server", vn = "lib", Ge = "q-manifest.json";
|
|
1446
|
+
async function wn(e, n, i) {
|
|
1454
1447
|
if (e.env === "browsermain" || e.env === "webworker")
|
|
1455
1448
|
return;
|
|
1456
1449
|
const r = await e.dynamicImport("node:fs");
|
|
1457
|
-
let o =
|
|
1450
|
+
let o = i;
|
|
1458
1451
|
for (; o; ) {
|
|
1459
|
-
const
|
|
1452
|
+
const h = e.path.join(o, "node_modules", n, "package.json");
|
|
1460
1453
|
try {
|
|
1461
|
-
return await r.promises.access(
|
|
1454
|
+
return await r.promises.access(h), r.promises.realpath(h);
|
|
1462
1455
|
} catch {
|
|
1463
1456
|
}
|
|
1464
1457
|
const c = e.path.dirname(o);
|
|
@@ -1468,7 +1461,7 @@ async function wn(e, n, s) {
|
|
|
1468
1461
|
}
|
|
1469
1462
|
}
|
|
1470
1463
|
function zr(e = {}) {
|
|
1471
|
-
const n =
|
|
1464
|
+
const n = Dt(e.optimizerOptions);
|
|
1472
1465
|
return {
|
|
1473
1466
|
name: "rollup-plugin-qwik",
|
|
1474
1467
|
api: {
|
|
@@ -1478,10 +1471,10 @@ function zr(e = {}) {
|
|
|
1478
1471
|
async options(r) {
|
|
1479
1472
|
await n.init();
|
|
1480
1473
|
const o = r.onwarn;
|
|
1481
|
-
r.onwarn = (a,
|
|
1482
|
-
a.plugin === "typescript" && a.message.includes("outputToFilesystem") || (o ? o(a,
|
|
1474
|
+
r.onwarn = (a, u) => {
|
|
1475
|
+
a.plugin === "typescript" && a.message.includes("outputToFilesystem") || (o ? o(a, u) : u(a));
|
|
1483
1476
|
};
|
|
1484
|
-
const
|
|
1477
|
+
const h = {
|
|
1485
1478
|
csr: e.csr,
|
|
1486
1479
|
target: e.target,
|
|
1487
1480
|
buildMode: e.buildMode,
|
|
@@ -1499,18 +1492,18 @@ function zr(e = {}) {
|
|
|
1499
1492
|
lint: e.lint,
|
|
1500
1493
|
experimental: e.experimental
|
|
1501
1494
|
};
|
|
1502
|
-
await n.normalizeOptions(
|
|
1495
|
+
await n.normalizeOptions(h);
|
|
1503
1496
|
const { input: c } = n.getOptions();
|
|
1504
1497
|
return r.input = c, r;
|
|
1505
1498
|
},
|
|
1506
1499
|
outputOptions(r) {
|
|
1507
|
-
return
|
|
1500
|
+
return Xe(n, r, !1);
|
|
1508
1501
|
},
|
|
1509
1502
|
async buildStart() {
|
|
1510
|
-
n.onDiagnostics((r, o,
|
|
1503
|
+
n.onDiagnostics((r, o, h) => {
|
|
1511
1504
|
r.forEach((c) => {
|
|
1512
|
-
const a = n.normalizePath(o.sys.path.join(
|
|
1513
|
-
c.category === "error" ? this.error(
|
|
1505
|
+
const a = n.normalizePath(o.sys.path.join(h, c.file));
|
|
1506
|
+
c.category === "error" ? this.error(Fe(a, c)) : this.warn(Fe(a, c));
|
|
1514
1507
|
});
|
|
1515
1508
|
}), await n.buildStart(this);
|
|
1516
1509
|
},
|
|
@@ -1528,226 +1521,226 @@ function zr(e = {}) {
|
|
|
1528
1521
|
}
|
|
1529
1522
|
};
|
|
1530
1523
|
}
|
|
1531
|
-
async function xn(e, n,
|
|
1524
|
+
async function xn(e, n, i, r) {
|
|
1532
1525
|
return Array.isArray(n) ? (n.length || n.push({}), await Promise.all(
|
|
1533
1526
|
n.map(async (o) => ({
|
|
1534
|
-
...await
|
|
1527
|
+
...await Xe(e, o, i),
|
|
1535
1528
|
dir: r || o.dir
|
|
1536
1529
|
}))
|
|
1537
1530
|
)) : {
|
|
1538
|
-
...await
|
|
1531
|
+
...await Xe(e, n, i),
|
|
1539
1532
|
dir: r || n?.dir
|
|
1540
1533
|
};
|
|
1541
1534
|
}
|
|
1542
|
-
const In = (e, n,
|
|
1535
|
+
const In = (e, n, i) => n.buildMode === "production" && !n.debug ? `${e}build/q-[hash].js` : (r) => {
|
|
1543
1536
|
if (r.moduleIds?.some((c) => /core\.(prod|min)\.mjs$/.test(c)))
|
|
1544
1537
|
return `${e}build/core.js`;
|
|
1545
1538
|
if (r.moduleIds?.some((c) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(c)))
|
|
1546
1539
|
return `${e}build/qwik-router.js`;
|
|
1547
|
-
const
|
|
1548
|
-
return `${e}build/${
|
|
1540
|
+
const h = i.sys.path.relative(i.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
1541
|
+
return `${e}build/${h}.js`;
|
|
1549
1542
|
};
|
|
1550
|
-
async function
|
|
1551
|
-
const r = { ...n }, o = e.getOptions(),
|
|
1552
|
-
r.assetFileNames || (r.assetFileNames = `${
|
|
1553
|
-
const a = In(
|
|
1543
|
+
async function Xe(e, n, i) {
|
|
1544
|
+
const r = { ...n }, o = e.getOptions(), h = e.getOptimizer(), c = e.manualChunks;
|
|
1545
|
+
r.assetFileNames || (r.assetFileNames = `${i ? `${o.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
|
|
1546
|
+
const a = In(i ? `${o.assetsDir}` : "", o, h);
|
|
1554
1547
|
if (o.target === "client") {
|
|
1555
1548
|
r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
|
|
1556
1549
|
const t = r.manualChunks;
|
|
1557
1550
|
if (t && typeof t != "function")
|
|
1558
1551
|
throw new Error("manualChunks must be a function");
|
|
1559
|
-
r.manualChunks = t ? (
|
|
1552
|
+
r.manualChunks = t ? (b, x) => t(b, x) || c(b, x) : c;
|
|
1560
1553
|
} else
|
|
1561
1554
|
r.chunkFileNames || (r.chunkFileNames = a);
|
|
1562
1555
|
r.dir || (r.dir = o.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1556
|
+
const u = await wn(h.sys, "rollup", h.sys.cwd());
|
|
1557
|
+
if (u)
|
|
1565
1558
|
try {
|
|
1566
|
-
const
|
|
1567
|
-
Number.isFinite(
|
|
1568
|
-
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${
|
|
1559
|
+
const b = await (await h.sys.dynamicImport("node:fs")).promises.readFile(u, "utf-8"), x = JSON.parse(b), m = String(x?.version || ""), [k, g, d] = m.split(".").map((l) => parseInt(l, 10));
|
|
1560
|
+
Number.isFinite(k) && (k > 4 || k === 4 && (g > 52 || g === 52 && (d || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
|
|
1561
|
+
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${m}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
|
|
1569
1562
|
);
|
|
1570
1563
|
} catch {
|
|
1571
1564
|
}
|
|
1572
1565
|
return r;
|
|
1573
1566
|
}
|
|
1574
|
-
function
|
|
1575
|
-
const
|
|
1567
|
+
function Fe(e, n) {
|
|
1568
|
+
const i = n.highlights?.[0];
|
|
1576
1569
|
return Object.assign(new Error(n.message), {
|
|
1577
1570
|
id: e,
|
|
1578
1571
|
plugin: "qwik",
|
|
1579
|
-
loc:
|
|
1580
|
-
column:
|
|
1581
|
-
line:
|
|
1572
|
+
loc: i && {
|
|
1573
|
+
column: i.startCol,
|
|
1574
|
+
line: i.startLine
|
|
1582
1575
|
},
|
|
1583
1576
|
stack: ""
|
|
1584
1577
|
});
|
|
1585
1578
|
}
|
|
1586
|
-
function
|
|
1579
|
+
function R(e) {
|
|
1587
1580
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1588
1581
|
}
|
|
1589
|
-
var
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1582
|
+
var he = {}, Ke = {}, ct;
|
|
1583
|
+
function z() {
|
|
1584
|
+
return ct || (ct = 1, (function(e) {
|
|
1592
1585
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.findBox = e.readUInt = e.readUInt32LE = e.readUInt32BE = e.readInt32LE = e.readUInt24LE = e.readUInt16LE = e.readUInt16BE = e.readInt16LE = e.toHexString = e.toUTF8String = void 0;
|
|
1593
|
-
const n = new TextDecoder(),
|
|
1594
|
-
e.toUTF8String =
|
|
1595
|
-
const r = (
|
|
1586
|
+
const n = new TextDecoder(), i = (d, f = 0, l = d.length) => n.decode(d.slice(f, l));
|
|
1587
|
+
e.toUTF8String = i;
|
|
1588
|
+
const r = (d, f = 0, l = d.length) => d.slice(f, l).reduce((p, E) => p + ("0" + E.toString(16)).slice(-2), "");
|
|
1596
1589
|
e.toHexString = r;
|
|
1597
|
-
const o = (
|
|
1598
|
-
const l =
|
|
1590
|
+
const o = (d, f = 0) => {
|
|
1591
|
+
const l = d[f] + d[f + 1] * 256;
|
|
1599
1592
|
return l | (l & 2 ** 15) * 131070;
|
|
1600
1593
|
};
|
|
1601
1594
|
e.readInt16LE = o;
|
|
1602
|
-
const
|
|
1603
|
-
e.readUInt16BE =
|
|
1604
|
-
const c = (
|
|
1595
|
+
const h = (d, f = 0) => d[f] * 2 ** 8 + d[f + 1];
|
|
1596
|
+
e.readUInt16BE = h;
|
|
1597
|
+
const c = (d, f = 0) => d[f] + d[f + 1] * 2 ** 8;
|
|
1605
1598
|
e.readUInt16LE = c;
|
|
1606
|
-
const a = (
|
|
1599
|
+
const a = (d, f = 0) => d[f] + d[f + 1] * 2 ** 8 + d[f + 2] * 2 ** 16;
|
|
1607
1600
|
e.readUInt24LE = a;
|
|
1608
|
-
const
|
|
1609
|
-
e.readInt32LE =
|
|
1610
|
-
const t = (
|
|
1601
|
+
const u = (d, f = 0) => d[f] + d[f + 1] * 2 ** 8 + d[f + 2] * 2 ** 16 + (d[f + 3] << 24);
|
|
1602
|
+
e.readInt32LE = u;
|
|
1603
|
+
const t = (d, f = 0) => d[f] * 2 ** 24 + d[f + 1] * 2 ** 16 + d[f + 2] * 2 ** 8 + d[f + 3];
|
|
1611
1604
|
e.readUInt32BE = t;
|
|
1612
|
-
const
|
|
1613
|
-
e.readUInt32LE =
|
|
1614
|
-
const
|
|
1605
|
+
const b = (d, f = 0) => d[f] + d[f + 1] * 2 ** 8 + d[f + 2] * 2 ** 16 + d[f + 3] * 2 ** 24;
|
|
1606
|
+
e.readUInt32LE = b;
|
|
1607
|
+
const x = {
|
|
1615
1608
|
readUInt16BE: e.readUInt16BE,
|
|
1616
1609
|
readUInt16LE: e.readUInt16LE,
|
|
1617
1610
|
readUInt32BE: e.readUInt32BE,
|
|
1618
1611
|
readUInt32LE: e.readUInt32LE
|
|
1619
1612
|
};
|
|
1620
|
-
function
|
|
1613
|
+
function m(d, f, l, p) {
|
|
1621
1614
|
l = l || 0;
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1615
|
+
const E = p ? "BE" : "LE", s = "readUInt" + f + E;
|
|
1616
|
+
return x[s](d, l);
|
|
1624
1617
|
}
|
|
1625
|
-
e.readUInt =
|
|
1626
|
-
function
|
|
1627
|
-
if (
|
|
1618
|
+
e.readUInt = m;
|
|
1619
|
+
function k(d, f) {
|
|
1620
|
+
if (d.length - f < 4)
|
|
1628
1621
|
return;
|
|
1629
|
-
const l = (0, e.readUInt32BE)(
|
|
1630
|
-
if (!(
|
|
1622
|
+
const l = (0, e.readUInt32BE)(d, f);
|
|
1623
|
+
if (!(d.length - f < l))
|
|
1631
1624
|
return {
|
|
1632
|
-
name: (0, e.toUTF8String)(
|
|
1633
|
-
offset:
|
|
1625
|
+
name: (0, e.toUTF8String)(d, 4 + f, 8 + f),
|
|
1626
|
+
offset: f,
|
|
1634
1627
|
size: l
|
|
1635
1628
|
};
|
|
1636
1629
|
}
|
|
1637
|
-
function
|
|
1638
|
-
for (; l <
|
|
1639
|
-
const
|
|
1640
|
-
if (!
|
|
1630
|
+
function g(d, f, l) {
|
|
1631
|
+
for (; l < d.length; ) {
|
|
1632
|
+
const p = k(d, l);
|
|
1633
|
+
if (!p)
|
|
1641
1634
|
break;
|
|
1642
|
-
if (
|
|
1643
|
-
return
|
|
1644
|
-
l +=
|
|
1635
|
+
if (p.name === f)
|
|
1636
|
+
return p;
|
|
1637
|
+
l += p.size > 0 ? p.size : 8;
|
|
1645
1638
|
}
|
|
1646
1639
|
}
|
|
1647
|
-
e.findBox =
|
|
1648
|
-
})(
|
|
1640
|
+
e.findBox = g;
|
|
1641
|
+
})(Ke)), Ke;
|
|
1649
1642
|
}
|
|
1650
|
-
var
|
|
1643
|
+
var dt;
|
|
1651
1644
|
function Sn() {
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1654
|
-
const e =
|
|
1655
|
-
return
|
|
1645
|
+
if (dt) return he;
|
|
1646
|
+
dt = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.BMP = void 0;
|
|
1647
|
+
const e = z();
|
|
1648
|
+
return he.BMP = {
|
|
1656
1649
|
validate: (n) => (0, e.toUTF8String)(n, 0, 2) === "BM",
|
|
1657
1650
|
calculate: (n) => ({
|
|
1658
1651
|
height: Math.abs((0, e.readInt32LE)(n, 22)),
|
|
1659
1652
|
width: (0, e.readUInt32LE)(n, 18)
|
|
1660
1653
|
})
|
|
1661
|
-
},
|
|
1654
|
+
}, he;
|
|
1662
1655
|
}
|
|
1663
1656
|
var kn = Sn();
|
|
1664
|
-
const En = /* @__PURE__ */
|
|
1665
|
-
var
|
|
1666
|
-
function
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1669
|
-
const e =
|
|
1657
|
+
const En = /* @__PURE__ */ R(kn);
|
|
1658
|
+
var me = {}, ge = {}, ut;
|
|
1659
|
+
function Mt() {
|
|
1660
|
+
if (ut) return ge;
|
|
1661
|
+
ut = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.ICO = void 0;
|
|
1662
|
+
const e = z(), n = 1, i = 6, r = 16;
|
|
1670
1663
|
function o(c, a) {
|
|
1671
|
-
const
|
|
1672
|
-
return
|
|
1664
|
+
const u = c[a];
|
|
1665
|
+
return u === 0 ? 256 : u;
|
|
1673
1666
|
}
|
|
1674
|
-
function
|
|
1675
|
-
const
|
|
1667
|
+
function h(c, a) {
|
|
1668
|
+
const u = i + a * r;
|
|
1676
1669
|
return {
|
|
1677
|
-
height: o(c,
|
|
1678
|
-
width: o(c,
|
|
1670
|
+
height: o(c, u + 1),
|
|
1671
|
+
width: o(c, u)
|
|
1679
1672
|
};
|
|
1680
1673
|
}
|
|
1681
|
-
return
|
|
1674
|
+
return ge.ICO = {
|
|
1682
1675
|
validate(c) {
|
|
1683
|
-
const a = (0, e.readUInt16LE)(c, 0),
|
|
1684
|
-
return a !== 0 ||
|
|
1676
|
+
const a = (0, e.readUInt16LE)(c, 0), u = (0, e.readUInt16LE)(c, 4);
|
|
1677
|
+
return a !== 0 || u === 0 ? !1 : (0, e.readUInt16LE)(c, 2) === n;
|
|
1685
1678
|
},
|
|
1686
1679
|
calculate(c) {
|
|
1687
|
-
const a = (0, e.readUInt16LE)(c, 4),
|
|
1680
|
+
const a = (0, e.readUInt16LE)(c, 4), u = h(c, 0);
|
|
1688
1681
|
if (a === 1)
|
|
1689
|
-
return
|
|
1690
|
-
const t = [
|
|
1691
|
-
for (let
|
|
1692
|
-
t.push(
|
|
1682
|
+
return u;
|
|
1683
|
+
const t = [u];
|
|
1684
|
+
for (let b = 1; b < a; b += 1)
|
|
1685
|
+
t.push(h(c, b));
|
|
1693
1686
|
return {
|
|
1694
|
-
height:
|
|
1687
|
+
height: u.height,
|
|
1695
1688
|
images: t,
|
|
1696
|
-
width:
|
|
1689
|
+
width: u.width
|
|
1697
1690
|
};
|
|
1698
1691
|
}
|
|
1699
|
-
},
|
|
1692
|
+
}, ge;
|
|
1700
1693
|
}
|
|
1701
|
-
var
|
|
1694
|
+
var ft;
|
|
1702
1695
|
function _n() {
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1705
|
-
const e =
|
|
1706
|
-
return
|
|
1696
|
+
if (ft) return me;
|
|
1697
|
+
ft = 1, Object.defineProperty(me, "__esModule", { value: !0 }), me.CUR = void 0;
|
|
1698
|
+
const e = Mt(), n = z(), i = 2;
|
|
1699
|
+
return me.CUR = {
|
|
1707
1700
|
validate(r) {
|
|
1708
|
-
const o = (0, n.readUInt16LE)(r, 0),
|
|
1709
|
-
return o !== 0 ||
|
|
1701
|
+
const o = (0, n.readUInt16LE)(r, 0), h = (0, n.readUInt16LE)(r, 4);
|
|
1702
|
+
return o !== 0 || h === 0 ? !1 : (0, n.readUInt16LE)(r, 2) === i;
|
|
1710
1703
|
},
|
|
1711
1704
|
calculate: (r) => e.ICO.calculate(r)
|
|
1712
|
-
},
|
|
1705
|
+
}, me;
|
|
1713
1706
|
}
|
|
1714
1707
|
var Tn = _n();
|
|
1715
|
-
const Cn = /* @__PURE__ */
|
|
1716
|
-
var
|
|
1708
|
+
const Cn = /* @__PURE__ */ R(Tn);
|
|
1709
|
+
var ye = {}, pt;
|
|
1717
1710
|
function Pn() {
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1720
|
-
const e =
|
|
1721
|
-
return
|
|
1711
|
+
if (pt) return ye;
|
|
1712
|
+
pt = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.DDS = void 0;
|
|
1713
|
+
const e = z();
|
|
1714
|
+
return ye.DDS = {
|
|
1722
1715
|
validate: (n) => (0, e.readUInt32LE)(n, 0) === 542327876,
|
|
1723
1716
|
calculate: (n) => ({
|
|
1724
1717
|
height: (0, e.readUInt32LE)(n, 12),
|
|
1725
1718
|
width: (0, e.readUInt32LE)(n, 16)
|
|
1726
1719
|
})
|
|
1727
|
-
},
|
|
1720
|
+
}, ye;
|
|
1728
1721
|
}
|
|
1729
1722
|
var Dn = Pn();
|
|
1730
|
-
const Nn = /* @__PURE__ */
|
|
1731
|
-
var
|
|
1723
|
+
const Nn = /* @__PURE__ */ R(Dn);
|
|
1724
|
+
var be = {}, ht;
|
|
1732
1725
|
function Mn() {
|
|
1733
|
-
if (
|
|
1734
|
-
|
|
1735
|
-
const e =
|
|
1736
|
-
return
|
|
1737
|
-
validate: (
|
|
1738
|
-
calculate: (
|
|
1739
|
-
height: (0, e.readUInt16LE)(
|
|
1740
|
-
width: (0, e.readUInt16LE)(
|
|
1726
|
+
if (ht) return be;
|
|
1727
|
+
ht = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.GIF = void 0;
|
|
1728
|
+
const e = z(), n = /^GIF8[79]a/;
|
|
1729
|
+
return be.GIF = {
|
|
1730
|
+
validate: (i) => n.test((0, e.toUTF8String)(i, 0, 6)),
|
|
1731
|
+
calculate: (i) => ({
|
|
1732
|
+
height: (0, e.readUInt16LE)(i, 8),
|
|
1733
|
+
width: (0, e.readUInt16LE)(i, 6)
|
|
1741
1734
|
})
|
|
1742
|
-
},
|
|
1735
|
+
}, be;
|
|
1743
1736
|
}
|
|
1744
1737
|
var qn = Mn();
|
|
1745
|
-
const Ln = /* @__PURE__ */
|
|
1746
|
-
var
|
|
1738
|
+
const Ln = /* @__PURE__ */ R(qn);
|
|
1739
|
+
var ve = {}, mt;
|
|
1747
1740
|
function On() {
|
|
1748
|
-
if (
|
|
1749
|
-
|
|
1750
|
-
const e =
|
|
1741
|
+
if (mt) return ve;
|
|
1742
|
+
mt = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.ICNS = void 0;
|
|
1743
|
+
const e = z(), n = 8, i = 4, r = 4, o = {
|
|
1751
1744
|
ICON: 32,
|
|
1752
1745
|
"ICN#": 32,
|
|
1753
1746
|
// m => 16 x 16
|
|
@@ -1789,61 +1782,61 @@ function On() {
|
|
|
1789
1782
|
// . => 1024 x 1024
|
|
1790
1783
|
ic10: 1024
|
|
1791
1784
|
};
|
|
1792
|
-
function
|
|
1793
|
-
const t =
|
|
1785
|
+
function h(a, u) {
|
|
1786
|
+
const t = u + r;
|
|
1794
1787
|
return [
|
|
1795
|
-
(0, e.toUTF8String)(a,
|
|
1788
|
+
(0, e.toUTF8String)(a, u, t),
|
|
1796
1789
|
(0, e.readUInt32BE)(a, t)
|
|
1797
1790
|
];
|
|
1798
1791
|
}
|
|
1799
1792
|
function c(a) {
|
|
1800
|
-
const
|
|
1801
|
-
return { width:
|
|
1793
|
+
const u = o[a];
|
|
1794
|
+
return { width: u, height: u, type: a };
|
|
1802
1795
|
}
|
|
1803
|
-
return
|
|
1796
|
+
return ve.ICNS = {
|
|
1804
1797
|
validate: (a) => (0, e.toUTF8String)(a, 0, 4) === "icns",
|
|
1805
1798
|
calculate(a) {
|
|
1806
|
-
const
|
|
1807
|
-
let
|
|
1808
|
-
if (
|
|
1809
|
-
return
|
|
1810
|
-
const
|
|
1811
|
-
height:
|
|
1812
|
-
images: [
|
|
1813
|
-
width:
|
|
1799
|
+
const u = a.length, t = (0, e.readUInt32BE)(a, i);
|
|
1800
|
+
let b = n, x = h(a, b), m = c(x[0]);
|
|
1801
|
+
if (b += x[1], b === t)
|
|
1802
|
+
return m;
|
|
1803
|
+
const k = {
|
|
1804
|
+
height: m.height,
|
|
1805
|
+
images: [m],
|
|
1806
|
+
width: m.width
|
|
1814
1807
|
};
|
|
1815
|
-
for (;
|
|
1816
|
-
|
|
1817
|
-
return
|
|
1808
|
+
for (; b < t && b < u; )
|
|
1809
|
+
x = h(a, b), m = c(x[0]), b += x[1], k.images.push(m);
|
|
1810
|
+
return k;
|
|
1818
1811
|
}
|
|
1819
|
-
},
|
|
1812
|
+
}, ve;
|
|
1820
1813
|
}
|
|
1821
1814
|
var jn = On();
|
|
1822
|
-
const $n = /* @__PURE__ */
|
|
1823
|
-
var Un =
|
|
1824
|
-
const Bn = /* @__PURE__ */
|
|
1825
|
-
var
|
|
1826
|
-
function
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1829
|
-
const e =
|
|
1830
|
-
return
|
|
1815
|
+
const $n = /* @__PURE__ */ R(jn);
|
|
1816
|
+
var Un = Mt();
|
|
1817
|
+
const Bn = /* @__PURE__ */ R(Un);
|
|
1818
|
+
var we = {}, gt;
|
|
1819
|
+
function An() {
|
|
1820
|
+
if (gt) return we;
|
|
1821
|
+
gt = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.J2C = void 0;
|
|
1822
|
+
const e = z();
|
|
1823
|
+
return we.J2C = {
|
|
1831
1824
|
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
1832
1825
|
validate: (n) => (0, e.readUInt32BE)(n, 0) === 4283432785,
|
|
1833
1826
|
calculate: (n) => ({
|
|
1834
1827
|
height: (0, e.readUInt32BE)(n, 12),
|
|
1835
1828
|
width: (0, e.readUInt32BE)(n, 8)
|
|
1836
1829
|
})
|
|
1837
|
-
},
|
|
1830
|
+
}, we;
|
|
1838
1831
|
}
|
|
1839
|
-
var
|
|
1840
|
-
const
|
|
1841
|
-
var
|
|
1832
|
+
var Fn = An();
|
|
1833
|
+
const Rn = /* @__PURE__ */ R(Fn);
|
|
1834
|
+
var xe = {}, yt;
|
|
1842
1835
|
function zn() {
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1845
|
-
const e =
|
|
1846
|
-
return
|
|
1836
|
+
if (yt) return xe;
|
|
1837
|
+
yt = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.JP2 = void 0;
|
|
1838
|
+
const e = z();
|
|
1839
|
+
return xe.JP2 = {
|
|
1847
1840
|
validate(n) {
|
|
1848
1841
|
if ((0, e.toUTF8String)(n, 4, 8) !== "jP ")
|
|
1849
1842
|
return !1;
|
|
@@ -1851,7 +1844,7 @@ function zn() {
|
|
|
1851
1844
|
return r ? (0, e.toUTF8String)(n, r.offset + 8, r.offset + 12) === "jp2 " : !1;
|
|
1852
1845
|
},
|
|
1853
1846
|
calculate(n) {
|
|
1854
|
-
const
|
|
1847
|
+
const i = (0, e.findBox)(n, "jp2h", 0), r = i && (0, e.findBox)(n, "ihdr", i.offset + 8);
|
|
1855
1848
|
if (r)
|
|
1856
1849
|
return {
|
|
1857
1850
|
height: (0, e.readUInt32BE)(n, r.offset + 8),
|
|
@@ -1859,105 +1852,105 @@ function zn() {
|
|
|
1859
1852
|
};
|
|
1860
1853
|
throw new TypeError("Unsupported JPEG 2000 format");
|
|
1861
1854
|
}
|
|
1862
|
-
},
|
|
1855
|
+
}, xe;
|
|
1863
1856
|
}
|
|
1864
1857
|
var Hn = zn();
|
|
1865
|
-
const Wn = /* @__PURE__ */
|
|
1866
|
-
var
|
|
1858
|
+
const Wn = /* @__PURE__ */ R(Hn);
|
|
1859
|
+
var Ie = {}, bt;
|
|
1867
1860
|
function Gn() {
|
|
1868
|
-
if (
|
|
1869
|
-
|
|
1870
|
-
const e =
|
|
1871
|
-
function t(
|
|
1872
|
-
return (0, e.toHexString)(
|
|
1861
|
+
if (bt) return Ie;
|
|
1862
|
+
bt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.JPG = void 0;
|
|
1863
|
+
const e = z(), n = "45786966", i = 2, r = 6, o = 2, h = "4d4d", c = "4949", a = 12, u = 2;
|
|
1864
|
+
function t(g) {
|
|
1865
|
+
return (0, e.toHexString)(g, 2, 6) === n;
|
|
1873
1866
|
}
|
|
1874
|
-
function
|
|
1867
|
+
function b(g, d) {
|
|
1875
1868
|
return {
|
|
1876
|
-
height: (0, e.readUInt16BE)(
|
|
1877
|
-
width: (0, e.readUInt16BE)(
|
|
1869
|
+
height: (0, e.readUInt16BE)(g, d),
|
|
1870
|
+
width: (0, e.readUInt16BE)(g, d + 2)
|
|
1878
1871
|
};
|
|
1879
1872
|
}
|
|
1880
|
-
function
|
|
1881
|
-
const l = r + 8,
|
|
1882
|
-
for (let
|
|
1883
|
-
const
|
|
1884
|
-
if (
|
|
1873
|
+
function x(g, d) {
|
|
1874
|
+
const l = r + 8, p = (0, e.readUInt)(g, 16, l, d);
|
|
1875
|
+
for (let E = 0; E < p; E++) {
|
|
1876
|
+
const s = l + u + E * a, v = s + a;
|
|
1877
|
+
if (s > g.length)
|
|
1885
1878
|
return;
|
|
1886
|
-
const
|
|
1887
|
-
if ((0, e.readUInt)(
|
|
1888
|
-
return (0, e.readUInt)(
|
|
1879
|
+
const w = g.slice(s, v);
|
|
1880
|
+
if ((0, e.readUInt)(w, 16, 0, d) === 274)
|
|
1881
|
+
return (0, e.readUInt)(w, 16, 2, d) !== 3 || (0, e.readUInt)(w, 32, 4, d) !== 1 ? void 0 : (0, e.readUInt)(w, 16, 8, d);
|
|
1889
1882
|
}
|
|
1890
1883
|
}
|
|
1891
|
-
function
|
|
1892
|
-
const
|
|
1893
|
-
if (
|
|
1894
|
-
return
|
|
1884
|
+
function m(g, d) {
|
|
1885
|
+
const f = g.slice(i, d), l = (0, e.toHexString)(f, r, r + o), p = l === h;
|
|
1886
|
+
if (p || l === c)
|
|
1887
|
+
return x(f, p);
|
|
1895
1888
|
}
|
|
1896
|
-
function
|
|
1897
|
-
if (
|
|
1889
|
+
function k(g, d) {
|
|
1890
|
+
if (d > g.length)
|
|
1898
1891
|
throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
1899
1892
|
}
|
|
1900
|
-
return
|
|
1901
|
-
validate: (
|
|
1902
|
-
calculate(
|
|
1903
|
-
|
|
1904
|
-
let
|
|
1905
|
-
for (;
|
|
1906
|
-
const l = (0, e.readUInt16BE)(
|
|
1907
|
-
if (
|
|
1908
|
-
|
|
1893
|
+
return Ie.JPG = {
|
|
1894
|
+
validate: (g) => (0, e.toHexString)(g, 0, 2) === "ffd8",
|
|
1895
|
+
calculate(g) {
|
|
1896
|
+
g = g.slice(4);
|
|
1897
|
+
let d, f;
|
|
1898
|
+
for (; g.length; ) {
|
|
1899
|
+
const l = (0, e.readUInt16BE)(g, 0);
|
|
1900
|
+
if (g[l] !== 255) {
|
|
1901
|
+
g = g.slice(1);
|
|
1909
1902
|
continue;
|
|
1910
1903
|
}
|
|
1911
|
-
if (t(
|
|
1912
|
-
const
|
|
1913
|
-
return
|
|
1914
|
-
height:
|
|
1915
|
-
orientation:
|
|
1916
|
-
width:
|
|
1917
|
-
} :
|
|
1904
|
+
if (t(g) && (d = m(g, l)), k(g, l), f = g[l + 1], f === 192 || f === 193 || f === 194) {
|
|
1905
|
+
const p = b(g, l + 5);
|
|
1906
|
+
return d ? {
|
|
1907
|
+
height: p.height,
|
|
1908
|
+
orientation: d,
|
|
1909
|
+
width: p.width
|
|
1910
|
+
} : p;
|
|
1918
1911
|
}
|
|
1919
|
-
|
|
1912
|
+
g = g.slice(l + 2);
|
|
1920
1913
|
}
|
|
1921
1914
|
throw new TypeError("Invalid JPG, no size found");
|
|
1922
1915
|
}
|
|
1923
|
-
},
|
|
1916
|
+
}, Ie;
|
|
1924
1917
|
}
|
|
1925
1918
|
var Kn = Gn();
|
|
1926
|
-
const Qn = /* @__PURE__ */
|
|
1927
|
-
var
|
|
1919
|
+
const Qn = /* @__PURE__ */ R(Kn);
|
|
1920
|
+
var Se = {}, vt;
|
|
1928
1921
|
function Jn() {
|
|
1929
|
-
if (
|
|
1930
|
-
|
|
1931
|
-
const e =
|
|
1932
|
-
return
|
|
1922
|
+
if (vt) return Se;
|
|
1923
|
+
vt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.KTX = void 0;
|
|
1924
|
+
const e = z();
|
|
1925
|
+
return Se.KTX = {
|
|
1933
1926
|
validate: (n) => {
|
|
1934
|
-
const
|
|
1935
|
-
return ["KTX 11", "KTX 20"].includes(
|
|
1927
|
+
const i = (0, e.toUTF8String)(n, 1, 7);
|
|
1928
|
+
return ["KTX 11", "KTX 20"].includes(i);
|
|
1936
1929
|
},
|
|
1937
1930
|
calculate: (n) => {
|
|
1938
|
-
const
|
|
1931
|
+
const i = n[5] === 49 ? "ktx" : "ktx2", r = i === "ktx" ? 36 : 20;
|
|
1939
1932
|
return {
|
|
1940
1933
|
height: (0, e.readUInt32LE)(n, r + 4),
|
|
1941
1934
|
width: (0, e.readUInt32LE)(n, r),
|
|
1942
|
-
type:
|
|
1935
|
+
type: i
|
|
1943
1936
|
};
|
|
1944
1937
|
}
|
|
1945
|
-
},
|
|
1938
|
+
}, Se;
|
|
1946
1939
|
}
|
|
1947
1940
|
var Yn = Jn();
|
|
1948
|
-
const Xn = /* @__PURE__ */
|
|
1949
|
-
var
|
|
1941
|
+
const Xn = /* @__PURE__ */ R(Yn);
|
|
1942
|
+
var ke = {}, wt;
|
|
1950
1943
|
function Vn() {
|
|
1951
|
-
if (
|
|
1952
|
-
|
|
1953
|
-
const e =
|
|
1944
|
+
if (wt) return ke;
|
|
1945
|
+
wt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.PNG = void 0;
|
|
1946
|
+
const e = z(), n = `PNG\r
|
|
1954
1947
|
|
|
1955
|
-
`,
|
|
1956
|
-
return
|
|
1948
|
+
`, i = "IHDR", r = "CgBI";
|
|
1949
|
+
return ke.PNG = {
|
|
1957
1950
|
validate(o) {
|
|
1958
1951
|
if (n === (0, e.toUTF8String)(o, 1, 8)) {
|
|
1959
|
-
let
|
|
1960
|
-
if (
|
|
1952
|
+
let h = (0, e.toUTF8String)(o, 12, 16);
|
|
1953
|
+
if (h === r && (h = (0, e.toUTF8String)(o, 28, 32)), h !== i)
|
|
1961
1954
|
throw new TypeError("Invalid PNG");
|
|
1962
1955
|
return !0;
|
|
1963
1956
|
}
|
|
@@ -1972,15 +1965,15 @@ function Vn() {
|
|
|
1972
1965
|
width: (0, e.readUInt32BE)(o, 16)
|
|
1973
1966
|
};
|
|
1974
1967
|
}
|
|
1975
|
-
},
|
|
1968
|
+
}, ke;
|
|
1976
1969
|
}
|
|
1977
1970
|
var Zn = Vn();
|
|
1978
|
-
const er = /* @__PURE__ */
|
|
1979
|
-
var
|
|
1971
|
+
const er = /* @__PURE__ */ R(Zn);
|
|
1972
|
+
var Ee = {}, xt;
|
|
1980
1973
|
function tr() {
|
|
1981
|
-
if (
|
|
1982
|
-
|
|
1983
|
-
const e =
|
|
1974
|
+
if (xt) return Ee;
|
|
1975
|
+
xt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.PNM = void 0;
|
|
1976
|
+
const e = z(), n = {
|
|
1984
1977
|
P1: "pbm/ascii",
|
|
1985
1978
|
P2: "pgm/ascii",
|
|
1986
1979
|
P3: "ppm/ascii",
|
|
@@ -1989,13 +1982,13 @@ function tr() {
|
|
|
1989
1982
|
P6: "ppm",
|
|
1990
1983
|
P7: "pam",
|
|
1991
1984
|
PF: "pfm"
|
|
1992
|
-
},
|
|
1985
|
+
}, i = {
|
|
1993
1986
|
default: (r) => {
|
|
1994
1987
|
let o = [];
|
|
1995
1988
|
for (; r.length > 0; ) {
|
|
1996
|
-
const
|
|
1997
|
-
if (
|
|
1998
|
-
o =
|
|
1989
|
+
const h = r.shift();
|
|
1990
|
+
if (h[0] !== "#") {
|
|
1991
|
+
o = h.split(" ");
|
|
1999
1992
|
break;
|
|
2000
1993
|
}
|
|
2001
1994
|
}
|
|
@@ -2009,10 +2002,10 @@ function tr() {
|
|
|
2009
2002
|
pam: (r) => {
|
|
2010
2003
|
const o = {};
|
|
2011
2004
|
for (; r.length > 0; ) {
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2005
|
+
const h = r.shift();
|
|
2006
|
+
if (h.length > 16 || h.charCodeAt(0) > 128)
|
|
2014
2007
|
continue;
|
|
2015
|
-
const [c, a] =
|
|
2008
|
+
const [c, a] = h.split(" ");
|
|
2016
2009
|
if (c && a && (o[c.toLowerCase()] = parseInt(a, 10)), o.height && o.width)
|
|
2017
2010
|
break;
|
|
2018
2011
|
}
|
|
@@ -2024,36 +2017,36 @@ function tr() {
|
|
|
2024
2017
|
throw new TypeError("Invalid PAM");
|
|
2025
2018
|
}
|
|
2026
2019
|
};
|
|
2027
|
-
return
|
|
2020
|
+
return Ee.PNM = {
|
|
2028
2021
|
validate: (r) => (0, e.toUTF8String)(r, 0, 2) in n,
|
|
2029
2022
|
calculate(r) {
|
|
2030
|
-
const o = (0, e.toUTF8String)(r, 0, 2),
|
|
2031
|
-
return (
|
|
2023
|
+
const o = (0, e.toUTF8String)(r, 0, 2), h = n[o], c = (0, e.toUTF8String)(r, 3).split(/[\r\n]+/);
|
|
2024
|
+
return (i[h] || i.default)(c);
|
|
2032
2025
|
}
|
|
2033
|
-
},
|
|
2026
|
+
}, Ee;
|
|
2034
2027
|
}
|
|
2035
2028
|
var nr = tr();
|
|
2036
|
-
const rr = /* @__PURE__ */
|
|
2037
|
-
var
|
|
2029
|
+
const rr = /* @__PURE__ */ R(nr);
|
|
2030
|
+
var _e = {}, It;
|
|
2038
2031
|
function or() {
|
|
2039
|
-
if (
|
|
2040
|
-
|
|
2041
|
-
const e =
|
|
2042
|
-
return
|
|
2032
|
+
if (It) return _e;
|
|
2033
|
+
It = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.PSD = void 0;
|
|
2034
|
+
const e = z();
|
|
2035
|
+
return _e.PSD = {
|
|
2043
2036
|
validate: (n) => (0, e.toUTF8String)(n, 0, 4) === "8BPS",
|
|
2044
2037
|
calculate: (n) => ({
|
|
2045
2038
|
height: (0, e.readUInt32BE)(n, 14),
|
|
2046
2039
|
width: (0, e.readUInt32BE)(n, 18)
|
|
2047
2040
|
})
|
|
2048
|
-
},
|
|
2041
|
+
}, _e;
|
|
2049
2042
|
}
|
|
2050
2043
|
var ir = or();
|
|
2051
|
-
const sr = /* @__PURE__ */
|
|
2052
|
-
var
|
|
2044
|
+
const sr = /* @__PURE__ */ R(ir);
|
|
2045
|
+
var Te = {}, St;
|
|
2053
2046
|
function ar() {
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2056
|
-
const e =
|
|
2047
|
+
if (St) return Te;
|
|
2048
|
+
St = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.SVG = void 0;
|
|
2049
|
+
const e = z(), n = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, i = {
|
|
2057
2050
|
height: /\sheight=(['"])([^%]+?)\1/,
|
|
2058
2051
|
root: n,
|
|
2059
2052
|
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
@@ -2068,70 +2061,70 @@ function ar() {
|
|
|
2068
2061
|
pc: 96 / 72 / 12,
|
|
2069
2062
|
pt: 96 / 72,
|
|
2070
2063
|
px: 1
|
|
2071
|
-
},
|
|
2072
|
-
function c(
|
|
2073
|
-
const
|
|
2074
|
-
if (
|
|
2075
|
-
return Math.round(Number(
|
|
2076
|
-
}
|
|
2077
|
-
function a(
|
|
2078
|
-
const
|
|
2064
|
+
}, h = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(o).join("|")})?$`);
|
|
2065
|
+
function c(x) {
|
|
2066
|
+
const m = h.exec(x);
|
|
2067
|
+
if (m)
|
|
2068
|
+
return Math.round(Number(m[1]) * (o[m[2]] || 1));
|
|
2069
|
+
}
|
|
2070
|
+
function a(x) {
|
|
2071
|
+
const m = x.split(" ");
|
|
2079
2072
|
return {
|
|
2080
|
-
height: c(
|
|
2081
|
-
width: c(
|
|
2073
|
+
height: c(m[3]),
|
|
2074
|
+
width: c(m[2])
|
|
2082
2075
|
};
|
|
2083
2076
|
}
|
|
2084
|
-
function
|
|
2085
|
-
const
|
|
2077
|
+
function u(x) {
|
|
2078
|
+
const m = x.match(i.width), k = x.match(i.height), g = x.match(i.viewbox);
|
|
2086
2079
|
return {
|
|
2087
|
-
height:
|
|
2088
|
-
viewbox:
|
|
2089
|
-
width:
|
|
2080
|
+
height: k && c(k[2]),
|
|
2081
|
+
viewbox: g && a(g[2]),
|
|
2082
|
+
width: m && c(m[2])
|
|
2090
2083
|
};
|
|
2091
2084
|
}
|
|
2092
|
-
function t(
|
|
2085
|
+
function t(x) {
|
|
2093
2086
|
return {
|
|
2094
|
-
height:
|
|
2095
|
-
width:
|
|
2087
|
+
height: x.height,
|
|
2088
|
+
width: x.width
|
|
2096
2089
|
};
|
|
2097
2090
|
}
|
|
2098
|
-
function x
|
|
2099
|
-
const
|
|
2100
|
-
return
|
|
2101
|
-
height: Math.floor(
|
|
2102
|
-
width:
|
|
2103
|
-
} :
|
|
2104
|
-
height:
|
|
2105
|
-
width: Math.floor(
|
|
2091
|
+
function b(x, m) {
|
|
2092
|
+
const k = m.width / m.height;
|
|
2093
|
+
return x.width ? {
|
|
2094
|
+
height: Math.floor(x.width / k),
|
|
2095
|
+
width: x.width
|
|
2096
|
+
} : x.height ? {
|
|
2097
|
+
height: x.height,
|
|
2098
|
+
width: Math.floor(x.height * k)
|
|
2106
2099
|
} : {
|
|
2107
|
-
height:
|
|
2108
|
-
width:
|
|
2100
|
+
height: m.height,
|
|
2101
|
+
width: m.width
|
|
2109
2102
|
};
|
|
2110
2103
|
}
|
|
2111
|
-
return
|
|
2104
|
+
return Te.SVG = {
|
|
2112
2105
|
// Scan only the first kilo-byte to speed up the check on larger files
|
|
2113
|
-
validate: (
|
|
2114
|
-
calculate(
|
|
2115
|
-
const
|
|
2116
|
-
if (
|
|
2117
|
-
const
|
|
2118
|
-
if (
|
|
2119
|
-
return t(
|
|
2120
|
-
if (
|
|
2121
|
-
return
|
|
2106
|
+
validate: (x) => n.test((0, e.toUTF8String)(x, 0, 1e3)),
|
|
2107
|
+
calculate(x) {
|
|
2108
|
+
const m = (0, e.toUTF8String)(x).match(i.root);
|
|
2109
|
+
if (m) {
|
|
2110
|
+
const k = u(m[0]);
|
|
2111
|
+
if (k.width && k.height)
|
|
2112
|
+
return t(k);
|
|
2113
|
+
if (k.viewbox)
|
|
2114
|
+
return b(k, k.viewbox);
|
|
2122
2115
|
}
|
|
2123
2116
|
throw new TypeError("Invalid SVG");
|
|
2124
2117
|
}
|
|
2125
|
-
},
|
|
2118
|
+
}, Te;
|
|
2126
2119
|
}
|
|
2127
2120
|
var lr = ar();
|
|
2128
|
-
const cr = /* @__PURE__ */
|
|
2129
|
-
var
|
|
2121
|
+
const cr = /* @__PURE__ */ R(lr);
|
|
2122
|
+
var Ce = {}, kt;
|
|
2130
2123
|
function dr() {
|
|
2131
|
-
if (
|
|
2132
|
-
|
|
2133
|
-
const e =
|
|
2134
|
-
return
|
|
2124
|
+
if (kt) return Ce;
|
|
2125
|
+
kt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.TGA = void 0;
|
|
2126
|
+
const e = z();
|
|
2127
|
+
return Ce.TGA = {
|
|
2135
2128
|
validate(n) {
|
|
2136
2129
|
return (0, e.readUInt16LE)(n, 0) === 0 && (0, e.readUInt16LE)(n, 4) === 0;
|
|
2137
2130
|
},
|
|
@@ -2141,22 +2134,22 @@ function dr() {
|
|
|
2141
2134
|
width: (0, e.readUInt16LE)(n, 12)
|
|
2142
2135
|
};
|
|
2143
2136
|
}
|
|
2144
|
-
},
|
|
2137
|
+
}, Ce;
|
|
2145
2138
|
}
|
|
2146
2139
|
var ur = dr();
|
|
2147
|
-
const fr = /* @__PURE__ */
|
|
2148
|
-
var
|
|
2140
|
+
const fr = /* @__PURE__ */ R(ur);
|
|
2141
|
+
var Pe = {}, Et;
|
|
2149
2142
|
function pr() {
|
|
2150
|
-
if (
|
|
2151
|
-
|
|
2152
|
-
const e =
|
|
2143
|
+
if (Et) return Pe;
|
|
2144
|
+
Et = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.WEBP = void 0;
|
|
2145
|
+
const e = z();
|
|
2153
2146
|
function n(o) {
|
|
2154
2147
|
return {
|
|
2155
2148
|
height: 1 + (0, e.readUInt24LE)(o, 7),
|
|
2156
2149
|
width: 1 + (0, e.readUInt24LE)(o, 4)
|
|
2157
2150
|
};
|
|
2158
2151
|
}
|
|
2159
|
-
function
|
|
2152
|
+
function i(o) {
|
|
2160
2153
|
return {
|
|
2161
2154
|
height: 1 + ((o[4] & 15) << 10 | o[3] << 2 | (o[2] & 192) >> 6),
|
|
2162
2155
|
width: 1 + ((o[2] & 63) << 8 | o[1])
|
|
@@ -2168,35 +2161,35 @@ function pr() {
|
|
|
2168
2161
|
width: (0, e.readInt16LE)(o, 6) & 16383
|
|
2169
2162
|
};
|
|
2170
2163
|
}
|
|
2171
|
-
return
|
|
2164
|
+
return Pe.WEBP = {
|
|
2172
2165
|
validate(o) {
|
|
2173
|
-
const
|
|
2174
|
-
return
|
|
2166
|
+
const h = (0, e.toUTF8String)(o, 0, 4) === "RIFF", c = (0, e.toUTF8String)(o, 8, 12) === "WEBP", a = (0, e.toUTF8String)(o, 12, 15) === "VP8";
|
|
2167
|
+
return h && c && a;
|
|
2175
2168
|
},
|
|
2176
2169
|
calculate(o) {
|
|
2177
|
-
const
|
|
2178
|
-
if (o = o.slice(20, 30),
|
|
2179
|
-
const a = o[0],
|
|
2180
|
-
if (
|
|
2170
|
+
const h = (0, e.toUTF8String)(o, 12, 16);
|
|
2171
|
+
if (o = o.slice(20, 30), h === "VP8X") {
|
|
2172
|
+
const a = o[0], u = (a & 192) === 0, t = (a & 1) === 0;
|
|
2173
|
+
if (u && t)
|
|
2181
2174
|
return n(o);
|
|
2182
2175
|
throw new TypeError("Invalid WebP");
|
|
2183
2176
|
}
|
|
2184
|
-
if (
|
|
2177
|
+
if (h === "VP8 " && o[0] !== 47)
|
|
2185
2178
|
return r(o);
|
|
2186
2179
|
const c = (0, e.toHexString)(o, 3, 6);
|
|
2187
|
-
if (
|
|
2188
|
-
return
|
|
2180
|
+
if (h === "VP8L" && c !== "9d012a")
|
|
2181
|
+
return i(o);
|
|
2189
2182
|
throw new TypeError("Invalid WebP");
|
|
2190
2183
|
}
|
|
2191
|
-
},
|
|
2184
|
+
}, Pe;
|
|
2192
2185
|
}
|
|
2193
2186
|
var hr = pr();
|
|
2194
|
-
const mr = /* @__PURE__ */
|
|
2195
|
-
var
|
|
2187
|
+
const mr = /* @__PURE__ */ R(hr);
|
|
2188
|
+
var De = {}, _t;
|
|
2196
2189
|
function gr() {
|
|
2197
|
-
if (
|
|
2198
|
-
|
|
2199
|
-
const e =
|
|
2190
|
+
if (_t) return De;
|
|
2191
|
+
_t = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.HEIF = void 0;
|
|
2192
|
+
const e = z(), n = {
|
|
2200
2193
|
avif: "avif",
|
|
2201
2194
|
mif1: "heif",
|
|
2202
2195
|
msf1: "heif",
|
|
@@ -2208,27 +2201,27 @@ function gr() {
|
|
|
2208
2201
|
hevx: "heic"
|
|
2209
2202
|
// heic-sequence
|
|
2210
2203
|
};
|
|
2211
|
-
return
|
|
2212
|
-
validate(
|
|
2213
|
-
if ((0, e.toUTF8String)(
|
|
2204
|
+
return De.HEIF = {
|
|
2205
|
+
validate(i) {
|
|
2206
|
+
if ((0, e.toUTF8String)(i, 4, 8) !== "ftyp")
|
|
2214
2207
|
return !1;
|
|
2215
|
-
const o = (0, e.findBox)(
|
|
2216
|
-
return o ? (0, e.toUTF8String)(
|
|
2208
|
+
const o = (0, e.findBox)(i, "ftyp", 0);
|
|
2209
|
+
return o ? (0, e.toUTF8String)(i, o.offset + 8, o.offset + 12) in n : !1;
|
|
2217
2210
|
},
|
|
2218
|
-
calculate(
|
|
2219
|
-
const r = (0, e.findBox)(
|
|
2211
|
+
calculate(i) {
|
|
2212
|
+
const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12), h = o && (0, e.findBox)(i, "ipco", o.offset + 8), c = h && (0, e.findBox)(i, "ispe", h.offset + 8);
|
|
2220
2213
|
if (c)
|
|
2221
2214
|
return {
|
|
2222
|
-
height: (0, e.readUInt32BE)(
|
|
2223
|
-
width: (0, e.readUInt32BE)(
|
|
2224
|
-
type: (0, e.toUTF8String)(
|
|
2215
|
+
height: (0, e.readUInt32BE)(i, c.offset + 16),
|
|
2216
|
+
width: (0, e.readUInt32BE)(i, c.offset + 12),
|
|
2217
|
+
type: (0, e.toUTF8String)(i, 8, 12)
|
|
2225
2218
|
};
|
|
2226
2219
|
throw new TypeError("Invalid HEIF, no size found");
|
|
2227
2220
|
}
|
|
2228
|
-
},
|
|
2221
|
+
}, De;
|
|
2229
2222
|
}
|
|
2230
2223
|
var yr = gr();
|
|
2231
|
-
const br = /* @__PURE__ */
|
|
2224
|
+
const br = /* @__PURE__ */ R(yr), vr = {
|
|
2232
2225
|
56: "psd",
|
|
2233
2226
|
66: "bmp",
|
|
2234
2227
|
68: "dds",
|
|
@@ -2237,7 +2230,7 @@ const br = /* @__PURE__ */ A(yr), vr = {
|
|
|
2237
2230
|
105: "icns",
|
|
2238
2231
|
137: "png",
|
|
2239
2232
|
255: "jpg"
|
|
2240
|
-
},
|
|
2233
|
+
}, Re = {
|
|
2241
2234
|
webp: mr.WEBP,
|
|
2242
2235
|
jpg: Qn.JPG,
|
|
2243
2236
|
png: er.PNG,
|
|
@@ -2249,23 +2242,23 @@ const br = /* @__PURE__ */ A(yr), vr = {
|
|
|
2249
2242
|
dds: Nn.DDS,
|
|
2250
2243
|
icns: $n.ICNS,
|
|
2251
2244
|
ico: Bn.ICO,
|
|
2252
|
-
j2c:
|
|
2245
|
+
j2c: Rn.J2C,
|
|
2253
2246
|
jp2: Wn.JP2,
|
|
2254
2247
|
ktx: Xn.KTX,
|
|
2255
2248
|
pnm: rr.PNM,
|
|
2256
2249
|
psd: sr.PSD,
|
|
2257
2250
|
tga: fr.TGA
|
|
2258
|
-
}, wr = Object.keys(
|
|
2251
|
+
}, wr = Object.keys(Re);
|
|
2259
2252
|
function xr(e) {
|
|
2260
|
-
const n = e[0],
|
|
2261
|
-
return
|
|
2253
|
+
const n = e[0], i = vr[n];
|
|
2254
|
+
return i && Re[i].validate(e) ? i : wr.find((r) => Re[r].validate(e));
|
|
2262
2255
|
}
|
|
2263
2256
|
function Ir(e) {
|
|
2264
2257
|
const n = xr(e);
|
|
2265
2258
|
if (typeof n < "u") {
|
|
2266
|
-
const
|
|
2267
|
-
if (
|
|
2268
|
-
return
|
|
2259
|
+
const i = Re[n].calculate(e);
|
|
2260
|
+
if (i !== void 0)
|
|
2261
|
+
return i.type = n, i;
|
|
2269
2262
|
}
|
|
2270
2263
|
}
|
|
2271
2264
|
async function Sr(e) {
|
|
@@ -2278,114 +2271,114 @@ async function Sr(e) {
|
|
|
2278
2271
|
console.error("can not fetch", e);
|
|
2279
2272
|
return;
|
|
2280
2273
|
}
|
|
2281
|
-
const
|
|
2274
|
+
const i = await n.arrayBuffer(), r = Ir(Buffer.from(i));
|
|
2282
2275
|
if (r)
|
|
2283
2276
|
return {
|
|
2284
2277
|
width: r.width,
|
|
2285
2278
|
height: r.height,
|
|
2286
2279
|
type: r.type,
|
|
2287
|
-
size:
|
|
2280
|
+
size: i.byteLength
|
|
2288
2281
|
};
|
|
2289
2282
|
} catch (n) {
|
|
2290
2283
|
console.error(n);
|
|
2291
2284
|
return;
|
|
2292
2285
|
}
|
|
2293
2286
|
}
|
|
2294
|
-
const kr = (e, n,
|
|
2287
|
+
const kr = (e, n, i) => async (r, o, h) => {
|
|
2295
2288
|
try {
|
|
2296
2289
|
const c = await e.dynamicImport("node:fs"), a = await e.dynamicImport("node:path");
|
|
2297
|
-
let
|
|
2290
|
+
let u;
|
|
2298
2291
|
try {
|
|
2299
|
-
|
|
2292
|
+
u = new URL(r.url, "http://localhost:3000/");
|
|
2300
2293
|
} catch {
|
|
2301
2294
|
o.statusCode = 404, o.end();
|
|
2302
2295
|
return;
|
|
2303
2296
|
}
|
|
2304
|
-
if (r.method === "GET" &&
|
|
2305
|
-
const t =
|
|
2297
|
+
if (r.method === "GET" && u.pathname === "/__image_info") {
|
|
2298
|
+
const t = u.searchParams.get("url");
|
|
2306
2299
|
if (o.setHeader("content-type", "application/json"), t) {
|
|
2307
|
-
const
|
|
2308
|
-
o.setHeader("cache-control", "public, max-age=31536000, immutable"),
|
|
2300
|
+
const b = await Sr(t);
|
|
2301
|
+
o.setHeader("cache-control", "public, max-age=31536000, immutable"), b ? o.write(JSON.stringify(b)) : o.statusCode = 404;
|
|
2309
2302
|
} else {
|
|
2310
2303
|
o.statusCode = 500;
|
|
2311
|
-
const
|
|
2312
|
-
o.write(JSON.stringify(
|
|
2304
|
+
const b = { message: "error" };
|
|
2305
|
+
o.write(JSON.stringify(b));
|
|
2313
2306
|
}
|
|
2314
2307
|
o.end();
|
|
2315
2308
|
return;
|
|
2316
|
-
} else if (r.method === "POST" &&
|
|
2317
|
-
const t =
|
|
2318
|
-
let
|
|
2319
|
-
const l = a.resolve(
|
|
2320
|
-
let
|
|
2321
|
-
for (;
|
|
2322
|
-
if (
|
|
2323
|
-
|
|
2309
|
+
} else if (r.method === "POST" && u.pathname === "/__image_fix") {
|
|
2310
|
+
const t = u.searchParams.get("loc"), b = u.searchParams.get("width"), x = u.searchParams.get("height"), m = u.searchParams.get("src"), k = u.searchParams.get("currentHref"), g = t.split(":"), d = parseInt(g[g.length - 1], 10) - 1;
|
|
2311
|
+
let f = parseInt(g[g.length - 2], 10) - 1;
|
|
2312
|
+
const l = a.resolve(i, g.slice(0, g.length - 2).join(":")), p = a.extname(l).toLowerCase();
|
|
2313
|
+
let s = c.readFileSync(l).toString("utf-8"), v = 0;
|
|
2314
|
+
for (; v < s.length; v++)
|
|
2315
|
+
if (f === 0) {
|
|
2316
|
+
v += d;
|
|
2324
2317
|
break;
|
|
2325
|
-
} else if (
|
|
2318
|
+
} else if (s[v] === `
|
|
2326
2319
|
`) {
|
|
2327
|
-
|
|
2320
|
+
f--;
|
|
2328
2321
|
continue;
|
|
2329
2322
|
}
|
|
2330
|
-
if (
|
|
2323
|
+
if (s.slice(v, v + 4) !== "<img") {
|
|
2331
2324
|
console.error(
|
|
2332
2325
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2333
2326
|
), o.statusCode = 500;
|
|
2334
2327
|
return;
|
|
2335
2328
|
}
|
|
2336
|
-
const
|
|
2337
|
-
if (
|
|
2329
|
+
const w = s.indexOf(">", v) + 1;
|
|
2330
|
+
if (w < v) {
|
|
2338
2331
|
console.error(
|
|
2339
2332
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2340
2333
|
), o.statusCode = 500;
|
|
2341
2334
|
return;
|
|
2342
2335
|
}
|
|
2343
|
-
const
|
|
2344
|
-
let
|
|
2345
|
-
if (
|
|
2346
|
-
const
|
|
2347
|
-
if (
|
|
2348
|
-
const
|
|
2349
|
-
let
|
|
2350
|
-
if (c.existsSync(
|
|
2351
|
-
const
|
|
2352
|
-
await c.promises.mkdir(
|
|
2353
|
-
|
|
2354
|
-
a.join(
|
|
2355
|
-
),
|
|
2356
|
-
} else if (c.existsSync(
|
|
2357
|
-
|
|
2336
|
+
const S = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(p);
|
|
2337
|
+
let I = s.slice(v, w);
|
|
2338
|
+
if (m && k && S) {
|
|
2339
|
+
const N = new URL(m), $ = new URL(k);
|
|
2340
|
+
if (N.origin === $.origin) {
|
|
2341
|
+
const T = a.join(n, "public", N.pathname), F = a.join(n, N.pathname);
|
|
2342
|
+
let Q;
|
|
2343
|
+
if (c.existsSync(T)) {
|
|
2344
|
+
const J = a.join(i, "media", a.dirname(N.pathname));
|
|
2345
|
+
await c.promises.mkdir(J, { recursive: !0 }), await c.promises.copyFile(
|
|
2346
|
+
T,
|
|
2347
|
+
a.join(i, "media", N.pathname)
|
|
2348
|
+
), Q = "~/media" + N.pathname;
|
|
2349
|
+
} else if (c.existsSync(F))
|
|
2350
|
+
Q = N.pathname.replace("/src/", "~/");
|
|
2358
2351
|
else
|
|
2359
2352
|
return;
|
|
2360
|
-
const
|
|
2361
|
-
|
|
2362
|
-
let
|
|
2363
|
-
if (
|
|
2353
|
+
const B = Er(N.pathname), V = `${Q}?jsx`;
|
|
2354
|
+
I = I.replace(/^<img/, `<${B}`), I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
2355
|
+
let G = 0;
|
|
2356
|
+
if (p === ".mdx" && s.startsWith("---") && (G = s.indexOf("---", 4) + 3, G === -1))
|
|
2364
2357
|
return;
|
|
2365
|
-
const
|
|
2366
|
-
import ${
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
)}${
|
|
2358
|
+
const ie = `
|
|
2359
|
+
import ${B} from '${V}';`;
|
|
2360
|
+
s = `${s.slice(0, G)}${ie}${s.slice(
|
|
2361
|
+
G,
|
|
2362
|
+
v
|
|
2363
|
+
)}${I}${s.slice(w)}`, c.writeFileSync(l, s);
|
|
2371
2364
|
return;
|
|
2372
2365
|
}
|
|
2373
2366
|
}
|
|
2374
|
-
|
|
2367
|
+
I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${b}"`), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${x}"`), I.includes("height=") || (I = I.replace(/<img/, `<img height="${x}"`)), I.includes("width=") || (I = I.replace(/<img/, `<img width="${b}"`)), s = s.slice(0, v) + I + s.slice(w), c.writeFileSync(l, s);
|
|
2375
2368
|
} else
|
|
2376
|
-
|
|
2369
|
+
h();
|
|
2377
2370
|
} catch (c) {
|
|
2378
|
-
c instanceof Error && await on(e, c),
|
|
2371
|
+
c instanceof Error && await on(e, c), h(c);
|
|
2379
2372
|
}
|
|
2380
2373
|
};
|
|
2381
2374
|
function Er(e) {
|
|
2382
|
-
const n = e.lastIndexOf("."),
|
|
2383
|
-
return e = e.substring(
|
|
2375
|
+
const n = e.lastIndexOf("."), i = e.lastIndexOf("/");
|
|
2376
|
+
return e = e.substring(i + 1, n), `Img${_r(e)}`;
|
|
2384
2377
|
}
|
|
2385
2378
|
function _r(e) {
|
|
2386
|
-
return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (n,
|
|
2379
|
+
return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (n, i, r) => `${i.toUpperCase() + r}`).replace(new RegExp(/\w/), (n) => n.toUpperCase());
|
|
2387
2380
|
}
|
|
2388
|
-
const Tr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, Cr = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__;globalThis.__SRC_DIR__;let o=document.querySelector("#qwik-inspector-info-popup");o||(o=document.createElement("div"),o.id="qwik-inspector-info-popup",o["aria-hidden"]="true",document.body.appendChild(o)),o.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const n=document.body,r=document.createElement("div");function i(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function s(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&d()){const t=e.getBoundingClientRect();r.style.setProperty("height",t.height+"px"),r.style.setProperty("width",t.width+"px"),r.style.setProperty("top",t.top+"px"),r.style.setProperty("left",t.left+"px"),r.style.setProperty("visibility","visible"),n.style.setProperty("cursor","pointer")}else r.style.setProperty("height","0px"),r.style.setProperty("width","0px"),r.style.setProperty("visibility","hidden"),n.style.removeProperty("cursor")}function d(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}r.id="qwik-inspector-overlay",r.setAttribute("aria-hidden","true"),n.appendChild(r),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),s()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),s()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),s()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=i(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,s()},{capture:!0}),document.addEventListener("click",t=>{if(d()){window.__qwik_inspector_state.pressedKeys.clear();const o=i(t.target);if(o){t.preventDefault(),t.stopPropagation();const r=o.getAttribute(e);if("false"!==r){n.style.setProperty("cursor","progress");const e=r.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,o]=e;fetch(`${t}?editor${o}`).then(()=>{n.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(d()){window.__qwik_inspector_state.pressedKeys.clear();i(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",s),document.addEventListener("scroll",s)};document.addEventListener("DOMContentLoaded",e)}', Pr = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, Dr = '[data-qwik-cls]{outline:2px solid red}[data-qwik-cls]:after{position:absolute;font-size:12px;content:"CLS " attr(data-qwik-cls);font-family:monospace;font-weight:700;background:red;color:#fff;margin:-2px;padding:1px;line-height:1;pointer-events:none}#qwik-image-warning-container{position:absolute!important;top:0!important;left:0!important;width:0!important;overflow:visible!important;height:0!important;pointer-events:none!important;contain:size layout style content;z-index:1}', Nr = 'if("undefined"!=typeof document){const e=()=>{class e extends HTMLElement{#e=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.createElement("template").innerHTML=globalThis.__TEMPLATE__);const e=this.shadowRoot.querySelector("dialog");this.shadowRoot.addEventListener("click",async t=>{const o=t.target;"BUTTON"===o.nodeName&&("action-btn"===o.id?this.#e&&(this.#e(),e.close()):"icon"===o.id?e.open?e.close():(e.className=function(e){const{x:t}=e.getBoundingClientRect();let o="right";return t>window.innerWidth-260&&(o="left"),`bottom ${o}`}(o),e.show()):"loc"===o.id&&o.dataset.url&&globalThis.qwikOpenInEditor(o.dataset.url))})}set loc(e){const t=this.shadowRoot.querySelector("#loc");t.textContent=e,globalThis.qwikOpenInEditor&&(t.dataset.url=e)}set header(e){this.shadowRoot.querySelector("#title").textContent=e}set message(e){this.shadowRoot.querySelector("#message").innerHTML=e}set actionFn(e){this.#e=e}set actionName(e){e&&(this.shadowRoot.querySelector(".action-container").innerHTML=`<button id="action-btn" type="button">${e}</button>`)}}customElements.define("image-warning",e);const t=new Map;let o=document.querySelector("#qwik-image-warning-container");o||(o=document.createElement("div"),o.id="qwik-image-warning-container",document.body.appendChild(o));let n=!1;const i=new Map;function r(e){let t=i.get(e);return void 0===t&&(t=async function(e){if(!/^(https?|file|capacitor):/.test(e))return;const t=new URL("/__image_info",location.href);return t.searchParams.set("url",e),fetch(t).then(e=>e.json()).catch(()=>null)}(e),i.set(e,t)),t}function a(e){return e.endsWith("px")}async function s(e){const i=t.get(e);e.isConnected?e.complete&&async function(e){const i=window.scrollX,s=window.scrollY,c=e.getBoundingClientRect(),d=e.currentSrc,l=await r(d);let h=t.get(e);const u=window.innerWidth>500;if(l&&u){let r=!1;const d=e.getAttribute("data-qwik-inspector"),u=c.width*c.height;if(!e.hasAttribute("width")||!e.hasAttribute("height")){n=!0;const t=getComputedStyle(e),o="auto"!==t.getPropertyValue("aspect-ratio").toString(),i=a(t.getPropertyValue("width").toString()),s=a(t.getPropertyValue("height").toString()),c="absolute"===t.getPropertyValue("position").toString();r=u>1e3&&!c&&!o&&(!i||!s)}const g=u<.5*(l.width&&l.height)&&"svg"!==l.type;if(n=!1,r||g){if(h||(h=document.createElement("image-warning"),o.appendChild(h),t.set(e,h)),h.style.top=c.top+s+"px",h.style.left=c.left+i+"px",h.style.width=c.width+"px",h.style.height=c.height+"px",h.info=l,h.loc=d,r){const t=`width="${l.width}" height="${l.height}"`;h.header="Perf: layout shift",h.message=`Image\'s size is unknown until it\'s loaded, <a href="https://web.dev/cls/" target="_blank" rel="noopener noreferrer">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre><img <span>${t}</span></pre>`;const o=1===document.querySelectorAll(\'[data-qwik-inspector="\'+d+\'"]\').length;d&&(o?(h.actionName="Auto fix",h.actionFn=async()=>{const t=new URL("/__image_fix",location.href);t.searchParams.set("loc",d),t.searchParams.set("width",l.width),t.searchParams.set("height",l.height),e.srcset||(t.searchParams.set("src",e.currentSrc),t.searchParams.set("currentHref",location.href)),await fetch(t,{method:"POST"})}):(h.actionName="Open in editor",h.actionFn=async()=>{await navigator.clipboard.writeText(t),globalThis.qwikOpenInEditor(d)}))}else g&&(h.header="Perf: properly size image",h.message=`The image is too big, <a href="https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/" target="_blank" rel="noopener noreferrer">hurting performance</a>, it should be resized to the size it\'s displayed at. The image dimensions are ${l.width} x ${l.height} but it\'s displayed at ${c.width}x${c.height}.</p>`);return}}h&&(h.remove(),t.delete(e))}(e):i&&(i.remove(),t.delete(e))}const c=new ResizeObserver(e=>{if(!n)for(const t of e)s(t.target)}),d=new MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)"IMG"===e.nodeName?c.observe(e):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{c.observe(e)});for(const e of t.removedNodes)"IMG"===e.nodeName?(s(e),c.unobserve(e)):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{s(e),c.unobserve(e)})}});let l,h=0;const u=()=>{setTimeout(()=>{l&&(l.disconnect(),h>.005&&console.error("Detected Layout Shift during page load",h)),d.observe(document.body,{childList:!0,subtree:!0}),document.body.querySelectorAll("img").forEach(e=>{c.observe(e)})},100)};"complete"===document.readyState?u():window.addEventListener("load",u);const g=1===performance?.navigation.type||performance.getEntriesByType("navigation").map(e=>e.type).includes("reload");"undefined"==typeof PerformanceObserver||g||(l=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if(!e.hadRecentInput){if(e.value>.006)for(const t of e.sources)t.node&&1===t.node.nodeType&&"IMAGE-WARNING"!==t.node.nodeName&&t.node.setAttribute("data-qwik-cls",Number(e.value).toFixed(3));h+=e.value}})}),l.observe({type:"layout-shift",buffered:!0}))};document.addEventListener("load",e)}', Mr = `<style>
|
|
2381
|
+
const Tr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikViteLog=!0,console.debug("%c⭐️ Qwik Dev SSR Mode","background: #0c75d2; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;","App is running in SSR development mode!\\n - Additional JS is loaded by Vite for debugging and live reloading\\n - Rendering performance might not be optimal\\n - Delayed interactivity because prefetching is disabled\\n - Vite dev bundles do not represent production output\\n\\nProduction build can be tested running 'npm run preview'"))`, Cr = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`).then(()=>{r.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', Pr = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, Dr = '[data-qwik-cls]{outline:2px solid red}[data-qwik-cls]:after{position:absolute;font-size:12px;content:"CLS " attr(data-qwik-cls);font-family:monospace;font-weight:700;background:red;color:#fff;margin:-2px;padding:1px;line-height:1;pointer-events:none}#qwik-image-warning-container{position:absolute!important;top:0!important;left:0!important;width:0!important;overflow:visible!important;height:0!important;pointer-events:none!important;contain:size layout style content;z-index:1}', Nr = 'if("undefined"!=typeof document){const e=()=>{class e extends HTMLElement{#e=null;constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(document.createElement("template").innerHTML=globalThis.__TEMPLATE__);const e=this.shadowRoot.querySelector("dialog");this.shadowRoot.addEventListener("click",async t=>{const o=t.target;"BUTTON"===o.nodeName&&("action-btn"===o.id?this.#e&&(this.#e(),e.close()):"icon"===o.id?e.open?e.close():(e.className=function(e){const{x:t}=e.getBoundingClientRect();let o="right";return t>window.innerWidth-260&&(o="left"),`bottom ${o}`}(o),e.show()):"loc"===o.id&&o.dataset.url&&globalThis.qwikOpenInEditor(o.dataset.url))})}set loc(e){const t=this.shadowRoot.querySelector("#loc");t.textContent=e,globalThis.qwikOpenInEditor&&(t.dataset.url=e)}set header(e){this.shadowRoot.querySelector("#title").textContent=e}set message(e){this.shadowRoot.querySelector("#message").innerHTML=e}set actionFn(e){this.#e=e}set actionName(e){e&&(this.shadowRoot.querySelector(".action-container").innerHTML=`<button id="action-btn" type="button">${e}</button>`)}}customElements.define("image-warning",e);const t=new Map;let o=document.querySelector("#qwik-image-warning-container");o||(o=document.createElement("div"),o.id="qwik-image-warning-container",document.body.appendChild(o));let n=!1;const i=new Map;function r(e){let t=i.get(e);return void 0===t&&(t=async function(e){if(!/^(https?|file|capacitor):/.test(e))return;const t=new URL("/__image_info",location.href);return t.searchParams.set("url",e),fetch(t).then(e=>e.json()).catch(()=>null)}(e),i.set(e,t)),t}function a(e){return e.endsWith("px")}async function s(e){const i=t.get(e);e.isConnected?e.complete&&async function(e){const i=window.scrollX,s=window.scrollY,c=e.getBoundingClientRect(),d=e.currentSrc,l=await r(d);let h=t.get(e);const u=window.innerWidth>500;if(l&&u){let r=!1;const d=e.getAttribute("data-qwik-inspector"),u=c.width*c.height;if(!e.hasAttribute("width")||!e.hasAttribute("height")){n=!0;const t=getComputedStyle(e),o="auto"!==t.getPropertyValue("aspect-ratio").toString(),i=a(t.getPropertyValue("width").toString()),s=a(t.getPropertyValue("height").toString()),c="absolute"===t.getPropertyValue("position").toString();r=u>1e3&&!c&&!o&&(!i||!s)}const g=u<.5*(l.width&&l.height)&&"svg"!==l.type;if(n=!1,r||g){if(h||(h=document.createElement("image-warning"),o.appendChild(h),t.set(e,h)),h.style.top=c.top+s+"px",h.style.left=c.left+i+"px",h.style.width=c.width+"px",h.style.height=c.height+"px",h.info=l,h.loc=d,r){const t=`width="${l.width}" height="${l.height}"`;h.header="Perf: layout shift",h.message=`Image\'s size is unknown until it\'s loaded, <a href="https://web.dev/cls/" target="_blank" rel="noopener noreferrer">causing layout shift</a>.</p><p>To solve this problem set the width/height in the img tag:</p><pre><img <span>${t}</span></pre>`;const o=1===document.querySelectorAll(\'[data-qwik-inspector="\'+d+\'"]\').length;d&&(o?(h.actionName="Auto fix",h.actionFn=async()=>{const t=new URL("/__image_fix",location.href);t.searchParams.set("loc",d),t.searchParams.set("width",l.width),t.searchParams.set("height",l.height),e.srcset||(t.searchParams.set("src",e.currentSrc),t.searchParams.set("currentHref",location.href)),await fetch(t,{method:"POST"})}):(h.actionName="Open in editor",h.actionFn=async()=>{await navigator.clipboard.writeText(t),globalThis.qwikOpenInEditor(d)}))}else g&&(h.header="Perf: properly size image",h.message=`The image is too big, <a href="https://developer.chrome.com/en/docs/lighthouse/performance/uses-responsive-images/" target="_blank" rel="noopener noreferrer">hurting performance</a>, it should be resized to the size it\'s displayed at. The image dimensions are ${l.width} x ${l.height} but it\'s displayed at ${c.width}x${c.height}.</p>`);return}}h&&(h.remove(),t.delete(e))}(e):i&&(i.remove(),t.delete(e))}const c=new ResizeObserver(e=>{if(!n)for(const t of e)s(t.target)}),d=new MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)"IMG"===e.nodeName?c.observe(e):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{c.observe(e)});for(const e of t.removedNodes)"IMG"===e.nodeName?(s(e),c.unobserve(e)):1===e.nodeType&&e.querySelectorAll("img").forEach(e=>{s(e),c.unobserve(e)})}});let l,h=0;const u=()=>{setTimeout(()=>{l&&(l.disconnect(),h>.005&&console.error("Detected Layout Shift during page load",h)),d.observe(document.body,{childList:!0,subtree:!0}),document.body.querySelectorAll("img").forEach(e=>{c.observe(e)})},100)};"complete"===document.readyState?u():window.addEventListener("load",u);const g=1===performance?.navigation.type||performance.getEntriesByType("navigation").map(e=>e.type).includes("reload");"undefined"==typeof PerformanceObserver||g||(l=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{if(!e.hadRecentInput){if(e.value>.006)for(const t of e.sources)t.node&&1===t.node.nodeType&&"IMAGE-WARNING"!==t.node.nodeName&&t.node.setAttribute("data-qwik-cls",Number(e.value).toFixed(3));h+=e.value}})}),l.observe({type:"layout-shift",buffered:!0}))};document.addEventListener("load",e)}', Mr = `<style>
|
|
2389
2382
|
:host {
|
|
2390
2383
|
position: absolute;
|
|
2391
2384
|
border: 1px solid red;
|
|
@@ -2550,47 +2543,47 @@ const Tr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
2550
2543
|
</div>
|
|
2551
2544
|
</dialog>
|
|
2552
2545
|
`, qr = `vite-error-overlay{--color-bright: rgba(255, 255, 255, .8);--color-yellow: rgba(255, 246, 85, .8);--qwik-dark-blue: #006ce9;--qwik-light-blue: #3ec2f7;--qwik-light-purple: #ac7ff4;--qwik-dark-purple: #713fc2;--yellow: #fff;--purple: var(--color-bright);--red: var(--qwik-light-blue);--vertical-box-spacing: 15px;--box-padding: 20px;--box-margin: 0 0 var(--vertical-box-spacing) 0;--box-background: rgba(0, 0, 0, .5);--box-border-radius: 8px}vite-error-overlay::part(backdrop){background:#020b1199}vite-error-overlay::part(window){background:transparent;border:none;box-shadow:none;box-sizing:border-box;margin:50px auto;max-width:1200px;padding:var(--box-padding);width:90%}vite-error-overlay::part(message){display:flex;flex-direction:column;font-size:1.6rem;line-height:1.7;margin-bottom:30px}vite-error-overlay::part(plugin){font-size:.8rem;font-weight:100}vite-error-overlay::part(file),vite-error-overlay::part(frame),vite-error-overlay::part(stack),vite-error-overlay::part(tip){background:var(--box-background);border-left:5px solid transparent;border-radius:var(--box-border-radius);margin:var(--box-margin);min-height:50px;padding:var(--box-padding);position:relative}vite-error-overlay::part(file){border-left-color:#19b6f6;color:var(--color-bright)}vite-error-overlay::part(frame){border-left-color:var(--color-yellow);color:var(--color-yellow)}vite-error-overlay::part(stack){border-left-color:#ff5722}vite-error-overlay::part(tip){border-top:none;border-left-color:#ac7ff4}vite-error-overlay::part(file):before,vite-error-overlay::part(frame):before,vite-error-overlay::part(stack):before{border-bottom:1px solid #222;color:var(--color-bright);display:block;margin-bottom:15px;padding-bottom:5px;padding-left:30px;font-size:.8rem}vite-error-overlay::part(file):before{content:"File"}vite-error-overlay::part(frame):before{content:"Frame"}vite-error-overlay::part(stack):before{content:"Stack Trace"}vite-error-overlay::part(file):after,vite-error-overlay::part(frame):after,vite-error-overlay::part(stack):after{content:"";display:block;height:20px;position:absolute;left:var(--box-padding);top:var(--box-padding);width:20px}vite-error-overlay::part(file):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}vite-error-overlay::part(frame):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E")}vite-error-overlay::part(stack):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E")}vite-error-overlay::part(tip):before{content:"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.";display:block;margin-bottom:1em}`, Lr = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
|
|
2553
|
-
async function Or(e, n,
|
|
2554
|
-
const o = await
|
|
2555
|
-
(
|
|
2556
|
-
).find((
|
|
2546
|
+
async function Or(e, n, i, r) {
|
|
2547
|
+
const o = await i.dynamicImport("node:fs"), h = await i.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
|
|
2548
|
+
(u) => r.join(n, `entry.preview.${u}`)
|
|
2549
|
+
).find((u) => o.existsSync(u));
|
|
2557
2550
|
if (!a)
|
|
2558
|
-
return
|
|
2551
|
+
return Qe(
|
|
2559
2552
|
e,
|
|
2560
2553
|
`Unable to find output "${n}/entry.preview" module.
|
|
2561
2554
|
|
|
2562
2555
|
Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
|
|
2563
2556
|
);
|
|
2564
2557
|
try {
|
|
2565
|
-
const
|
|
2566
|
-
let
|
|
2567
|
-
if (t.default && (typeof t.default == "function" ?
|
|
2568
|
-
return
|
|
2558
|
+
const u = h.pathToFileURL(a).href, t = await i.strictDynamicImport(u);
|
|
2559
|
+
let b = null, x = null;
|
|
2560
|
+
if (t.default && (typeof t.default == "function" ? b = t.default : typeof t.default == "object" && (b = t.default.router, x = t.default.notFound)), typeof b != "function")
|
|
2561
|
+
return Qe(
|
|
2569
2562
|
e,
|
|
2570
2563
|
`Entry preview module "${a}" does not export a default middleware function`
|
|
2571
2564
|
);
|
|
2572
|
-
e.use(
|
|
2573
|
-
} catch (
|
|
2574
|
-
return
|
|
2565
|
+
e.use(b), typeof x == "function" && e.use(x);
|
|
2566
|
+
} catch (u) {
|
|
2567
|
+
return Qe(e, String(u));
|
|
2575
2568
|
}
|
|
2576
2569
|
}
|
|
2577
|
-
function
|
|
2570
|
+
function Qe(e, n) {
|
|
2578
2571
|
console.log(`
|
|
2579
2572
|
❌ ${n}
|
|
2580
|
-
`), e.use((
|
|
2573
|
+
`), e.use((i, r) => {
|
|
2581
2574
|
r.writeHead(400, {
|
|
2582
2575
|
"Content-Type": "text/plain"
|
|
2583
2576
|
}), r.end(n);
|
|
2584
2577
|
});
|
|
2585
2578
|
}
|
|
2586
2579
|
const jr = (e, n) => {
|
|
2587
|
-
const
|
|
2580
|
+
const i = [
|
|
2588
2581
|
{ tag: "style", children: qr, injectTo: "body" },
|
|
2589
2582
|
{ tag: "style", children: Lr, injectTo: "body" },
|
|
2590
2583
|
{ tag: "script", attrs: { type: "module" }, children: Pr, injectTo: "body" },
|
|
2591
2584
|
{ tag: "script", attrs: { type: "module" }, children: Tr, injectTo: "body" }
|
|
2592
2585
|
];
|
|
2593
|
-
if ((e.devTools?.imageDevTools ?? !0) &&
|
|
2586
|
+
if ((e.devTools?.imageDevTools ?? !0) && i.push(
|
|
2594
2587
|
{
|
|
2595
2588
|
tag: "style",
|
|
2596
2589
|
children: Dr,
|
|
@@ -2606,85 +2599,88 @@ const jr = (e, n) => {
|
|
|
2606
2599
|
injectTo: "body"
|
|
2607
2600
|
}
|
|
2608
2601
|
), e.devTools?.clickToSource ?? !0) {
|
|
2609
|
-
const r = e.devTools.clickToSource ?? []
|
|
2610
|
-
|
|
2602
|
+
const r = e.devTools.clickToSource ?? [];
|
|
2603
|
+
n.endsWith("/") && (n = n.slice(0, -1)), i.push({
|
|
2611
2604
|
tag: "script",
|
|
2612
2605
|
attrs: { type: "module" },
|
|
2613
|
-
children: Cr.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.
|
|
2606
|
+
children: Cr.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(n)),
|
|
2614
2607
|
injectTo: "body"
|
|
2615
2608
|
});
|
|
2616
2609
|
}
|
|
2617
|
-
return
|
|
2610
|
+
return i;
|
|
2618
2611
|
}, $r = [
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2612
|
+
Be,
|
|
2613
|
+
Je,
|
|
2614
|
+
Ye,
|
|
2615
|
+
Ae,
|
|
2623
2616
|
"@builder.io/qwik",
|
|
2624
2617
|
"@builder.io/qwik/jsx-runtime",
|
|
2625
2618
|
"@builder.io/qwik/jsx-dev-runtime"
|
|
2626
2619
|
], Ur = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Br = [".woff", ".woff2", ".ttf"];
|
|
2627
2620
|
function Hr(e = {}) {
|
|
2628
|
-
let n = "serve",
|
|
2629
|
-
const
|
|
2621
|
+
let n = "serve", i = null, r = null, o = "/", h = null, c, a = null, u = null, t = null;
|
|
2622
|
+
const b = e.client?.outDir;
|
|
2623
|
+
let x = null;
|
|
2624
|
+
const m = e.fileFilter ? (s, v) => Nt.test(s) || e.fileFilter(s, v) : () => !0, k = e.disableFontPreload ?? !1, g = [], d = Dt(e.optimizerOptions), f = /* @__PURE__ */ new Set();
|
|
2630
2625
|
return [{
|
|
2631
2626
|
name: "vite-plugin-qwik",
|
|
2632
2627
|
enforce: "pre",
|
|
2633
2628
|
api: {
|
|
2634
|
-
getOptimizer: () =>
|
|
2635
|
-
getOptions: () =>
|
|
2636
|
-
getManifest: () =>
|
|
2637
|
-
getRootDir: () =>
|
|
2629
|
+
getOptimizer: () => d.getOptimizer(),
|
|
2630
|
+
getOptions: () => d.getOptions(),
|
|
2631
|
+
getManifest: () => i,
|
|
2632
|
+
getRootDir: () => d.getOptions().rootDir,
|
|
2638
2633
|
getClientOutDir: () => r,
|
|
2639
|
-
getClientPublicOutDir: () =>
|
|
2634
|
+
getClientPublicOutDir: () => h,
|
|
2640
2635
|
getAssetsDir: () => c,
|
|
2641
|
-
registerBundleGraphAdder: (
|
|
2636
|
+
registerBundleGraphAdder: (s) => f.add(s),
|
|
2642
2637
|
_oldDevSsrServer: () => e.devSsrServer
|
|
2643
2638
|
},
|
|
2644
|
-
async config(
|
|
2645
|
-
await
|
|
2646
|
-
const
|
|
2639
|
+
async config(s, v) {
|
|
2640
|
+
await d.init();
|
|
2641
|
+
const w = d.getPath();
|
|
2647
2642
|
let S;
|
|
2648
|
-
|
|
2649
|
-
let
|
|
2650
|
-
|
|
2651
|
-
const
|
|
2652
|
-
let
|
|
2653
|
-
|
|
2654
|
-
const
|
|
2643
|
+
s.build?.ssr || v.mode === "ssr" ? S = "ssr" : v.mode === "lib" ? S = "lib" : v.mode === "test" ? S = "test" : S = "client", n = v.command;
|
|
2644
|
+
let I;
|
|
2645
|
+
v.mode === "production" ? I = "production" : v.mode === "development" ? I = "development" : n === "build" && S === "client" ? I = "production" : I = "development", d.debug(`vite config(), command: ${n}, env.mode: ${v.mode}`), n === "serve" ? e.entryStrategy = { type: "segment" } : S === "ssr" ? e.entryStrategy = { type: "hoist" } : S === "lib" && (e.entryStrategy = { type: "inline" });
|
|
2646
|
+
const N = S === "ssr" ? typeof s.build?.ssr == "string" ? s.build.ssr : e.ssr?.input : void 0, $ = S === "client" ? e.client?.input : void 0;
|
|
2647
|
+
let T = s.build?.rollupOptions?.input || $ || N;
|
|
2648
|
+
T && typeof T == "string" && (T = [T]), c = s.build?.assetsDir;
|
|
2649
|
+
const F = S === "client" && !!c && c !== "_astro", Q = {
|
|
2655
2650
|
target: S,
|
|
2656
|
-
buildMode:
|
|
2651
|
+
buildMode: I,
|
|
2657
2652
|
csr: e.csr,
|
|
2658
2653
|
debug: e.debug,
|
|
2659
2654
|
entryStrategy: e.entryStrategy,
|
|
2660
2655
|
srcDir: e.srcDir,
|
|
2661
|
-
rootDir:
|
|
2656
|
+
rootDir: s.root,
|
|
2662
2657
|
tsconfigFileNames: e.tsconfigFileNames,
|
|
2663
2658
|
resolveQwikBuild: !0,
|
|
2664
2659
|
transformedModuleOutput: e.transformedModuleOutput,
|
|
2665
|
-
outDir:
|
|
2666
|
-
ssrOutDir: e.ssr?.outDir ||
|
|
2667
|
-
clientOutDir:
|
|
2668
|
-
|
|
2669
|
-
|
|
2660
|
+
outDir: s.build?.outDir,
|
|
2661
|
+
ssrOutDir: e.ssr?.outDir || s.build?.outDir,
|
|
2662
|
+
clientOutDir: b || // When ssr is true, this is probably an adapter build and not where the client build is
|
|
2663
|
+
// However, if client.outDir was explicitly set, always use it
|
|
2664
|
+
(s.build?.ssr && !b ? void 0 : s.build?.outDir),
|
|
2665
|
+
assetsDir: F ? c : void 0,
|
|
2670
2666
|
devTools: e.devTools,
|
|
2671
|
-
sourcemap: !!
|
|
2667
|
+
sourcemap: !!s.build?.sourcemap,
|
|
2672
2668
|
lint: e.lint,
|
|
2673
2669
|
experimental: e.experimental,
|
|
2674
|
-
input:
|
|
2670
|
+
input: T,
|
|
2675
2671
|
manifestInput: e.ssr?.manifestInput,
|
|
2676
2672
|
manifestInputPath: e.ssr?.manifestInputPath,
|
|
2677
2673
|
manifestOutput: e.client?.manifestOutput
|
|
2678
|
-
},
|
|
2679
|
-
|
|
2680
|
-
const
|
|
2674
|
+
}, B = await d.normalizeOptions(Q);
|
|
2675
|
+
T || (T = B.input), x = Q, i = B.manifestInput, a = B.srcDir, u = B.rootDir, e.csr || (r = B.clientOutDir, h = s.base ? w.join(r, s.base) : r, t = B.ssrOutDir);
|
|
2676
|
+
const V = I === "development", G = "globalThis.qDev", ie = "globalThis.qTest", J = "globalThis.qInspector", q = "globalThis.qSerialize", se = s?.define?.[G] ?? V, Ne = s?.define?.[J] ?? V, X = s?.define?.[q] ?? V, W = {
|
|
2681
2677
|
ssr: {
|
|
2682
|
-
noExternal: [
|
|
2678
|
+
noExternal: [Be, Ae, He, ne]
|
|
2683
2679
|
},
|
|
2684
2680
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
2685
2681
|
resolve: {
|
|
2686
2682
|
dedupe: [...$r],
|
|
2687
|
-
conditions:
|
|
2683
|
+
conditions: I === "production" && S === "client" ? ["min"] : [],
|
|
2688
2684
|
alias: {
|
|
2689
2685
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
2690
2686
|
"@builder.io/qwik/build": "@qwik.dev/core/build",
|
|
@@ -2707,17 +2703,17 @@ function Hr(e = {}) {
|
|
|
2707
2703
|
exclude: [
|
|
2708
2704
|
// using optimized deps for qwik libraries will lead to duplicate imports
|
|
2709
2705
|
// this breaks Qwik because it relies a lot on module scoped symbols
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2706
|
+
Be,
|
|
2707
|
+
Ae,
|
|
2708
|
+
He,
|
|
2709
|
+
Je,
|
|
2710
|
+
Ye,
|
|
2715
2711
|
ne,
|
|
2716
2712
|
re,
|
|
2717
2713
|
"@builder.io/qwik"
|
|
2718
2714
|
],
|
|
2719
2715
|
// Enforce scanning our input even when overridden later
|
|
2720
|
-
entries:
|
|
2716
|
+
entries: T && (typeof T == "string" ? [T] : typeof T == "object" ? Object.values(T) : T)
|
|
2721
2717
|
},
|
|
2722
2718
|
build: {
|
|
2723
2719
|
modulePreload: !1,
|
|
@@ -2733,76 +2729,76 @@ function Hr(e = {}) {
|
|
|
2733
2729
|
*/
|
|
2734
2730
|
maxParallelFileOps: 1,
|
|
2735
2731
|
// This will amend the existing input
|
|
2736
|
-
input:
|
|
2732
|
+
input: T
|
|
2737
2733
|
// temporary fix for rolldown-vite types
|
|
2738
2734
|
}
|
|
2739
2735
|
},
|
|
2740
2736
|
define: {
|
|
2741
|
-
[
|
|
2742
|
-
[
|
|
2743
|
-
[
|
|
2737
|
+
[G]: se,
|
|
2738
|
+
[J]: Ne,
|
|
2739
|
+
[q]: X,
|
|
2744
2740
|
[ie]: JSON.stringify(process.env.NODE_ENV === "test")
|
|
2745
2741
|
}
|
|
2746
2742
|
};
|
|
2747
2743
|
if (!e.csr) {
|
|
2748
|
-
|
|
2749
|
-
const
|
|
2750
|
-
|
|
2751
|
-
...
|
|
2744
|
+
W.build.cssCodeSplit = !1, B.outDir && (W.build.outDir = B.outDir);
|
|
2745
|
+
const Me = W.build.rollupOptions?.onwarn;
|
|
2746
|
+
W.build.rollupOptions = {
|
|
2747
|
+
...W.build.rollupOptions,
|
|
2752
2748
|
output: await xn(
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2749
|
+
d,
|
|
2750
|
+
s.build?.rollupOptions?.output,
|
|
2751
|
+
F,
|
|
2752
|
+
B.outDir
|
|
2757
2753
|
),
|
|
2758
2754
|
preserveEntrySignatures: "exports-only",
|
|
2759
|
-
onwarn: (
|
|
2760
|
-
|
|
2755
|
+
onwarn: (ce, qe) => {
|
|
2756
|
+
ce.plugin === "typescript" && ce.message.includes("outputToFilesystem") || (Me ? Me(ce, qe) : qe(ce));
|
|
2761
2757
|
}
|
|
2762
|
-
},
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2758
|
+
}, B.target === "ssr" ? n === "build" && (W.publicDir = !1, W.build.ssr = !0, s.build?.minify == null && I === "production" && (W.build.minify = !0)) : B.target === "client" || (B.target === "lib" ? (W.build.minify = !1, W.build.rollupOptions.external = [
|
|
2759
|
+
Be,
|
|
2760
|
+
Ae,
|
|
2761
|
+
He,
|
|
2762
|
+
Je,
|
|
2763
|
+
Ye,
|
|
2768
2764
|
ne,
|
|
2769
2765
|
re
|
|
2770
|
-
]) :
|
|
2771
|
-
[
|
|
2766
|
+
]) : W.define = {
|
|
2767
|
+
[G]: !0,
|
|
2772
2768
|
[ie]: !0,
|
|
2773
|
-
[
|
|
2774
|
-
}), globalThis.qDev =
|
|
2769
|
+
[J]: !1
|
|
2770
|
+
}), globalThis.qDev = se, globalThis.qTest = !0, globalThis.qInspector = Ne;
|
|
2775
2771
|
}
|
|
2776
|
-
return
|
|
2772
|
+
return W;
|
|
2777
2773
|
},
|
|
2778
|
-
async configResolved(
|
|
2779
|
-
if (o =
|
|
2774
|
+
async configResolved(s) {
|
|
2775
|
+
if (o = s.base, !(o.startsWith("/") && o.endsWith("/")))
|
|
2780
2776
|
throw new Error("vite's config.base must begin and end with /");
|
|
2781
|
-
!!
|
|
2777
|
+
!!s.build.sourcemap && e.optimizerOptions?.sourcemap === void 0 && d.setSourceMapSupport(!0), x ? d.normalizeOptions(x) : d.normalizeOptions(e);
|
|
2782
2778
|
},
|
|
2783
2779
|
async buildStart() {
|
|
2784
|
-
|
|
2785
|
-
const
|
|
2786
|
-
await
|
|
2787
|
-
|
|
2788
|
-
const
|
|
2789
|
-
|
|
2780
|
+
g.length = 0;
|
|
2781
|
+
const s = this.resolve.bind(this);
|
|
2782
|
+
await d.validateSource(s), d.onDiagnostics((v, w, S) => {
|
|
2783
|
+
v.forEach((I) => {
|
|
2784
|
+
const N = d.normalizePath(w.sys.path.join(S, I.file));
|
|
2785
|
+
I.category === "error" ? this.error(Fe(N, I)) : this.warn(Fe(N, I));
|
|
2790
2786
|
});
|
|
2791
|
-
}), await
|
|
2787
|
+
}), await d.buildStart(this);
|
|
2792
2788
|
},
|
|
2793
|
-
resolveId(
|
|
2794
|
-
const S =
|
|
2795
|
-
return ee(
|
|
2789
|
+
resolveId(s, v, w) {
|
|
2790
|
+
const S = m(s, "resolveId");
|
|
2791
|
+
return ee(s) || !S ? null : d.resolveId(this, s, v, w);
|
|
2796
2792
|
},
|
|
2797
|
-
load(
|
|
2798
|
-
const
|
|
2799
|
-
return ee(
|
|
2793
|
+
load(s, v) {
|
|
2794
|
+
const w = m(s, "load");
|
|
2795
|
+
return ee(s) || !w ? null : (s = d.normalizePath(s), n === "serve" && s.endsWith(re) ? {
|
|
2800
2796
|
code: "export const manifest = undefined;"
|
|
2801
|
-
} :
|
|
2797
|
+
} : d.load(this, s, v));
|
|
2802
2798
|
},
|
|
2803
|
-
transform(
|
|
2804
|
-
if (
|
|
2805
|
-
const
|
|
2799
|
+
transform(s, v, w) {
|
|
2800
|
+
if (v.includes(".vite/deps/") && s.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(s)) {
|
|
2801
|
+
const N = u && v.startsWith(u) ? v.slice(u.length) : v;
|
|
2806
2802
|
throw new Error(
|
|
2807
2803
|
`
|
|
2808
2804
|
|
|
@@ -2811,122 +2807,122 @@ function Hr(e = {}) {
|
|
|
2811
2807
|
⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
|
|
2812
2808
|
|
|
2813
2809
|
👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
|
|
2814
|
-
👉 ${
|
|
2810
|
+
👉 ${N}
|
|
2815
2811
|
|
|
2816
2812
|
==============
|
|
2817
2813
|
|
|
2818
2814
|
`
|
|
2819
2815
|
);
|
|
2820
2816
|
}
|
|
2821
|
-
const S =
|
|
2822
|
-
return ee(
|
|
2817
|
+
const S = m(v, "transform"), I = v.includes("?raw");
|
|
2818
|
+
return ee(v) || !S || I ? null : d.transform(this, s, v, w);
|
|
2823
2819
|
}
|
|
2824
2820
|
}, {
|
|
2825
2821
|
name: "vite-plugin-qwik-post",
|
|
2826
2822
|
enforce: "post",
|
|
2827
2823
|
generateBundle: {
|
|
2828
2824
|
order: "post",
|
|
2829
|
-
async handler(
|
|
2830
|
-
const
|
|
2831
|
-
if (
|
|
2832
|
-
for (const [S,
|
|
2833
|
-
if (
|
|
2834
|
-
const
|
|
2835
|
-
if (Ur.some((
|
|
2836
|
-
typeof
|
|
2825
|
+
async handler(s, v) {
|
|
2826
|
+
const w = d.getOptions();
|
|
2827
|
+
if (w.target === "client") {
|
|
2828
|
+
for (const [S, I] of Object.entries(v))
|
|
2829
|
+
if (I.type === "asset") {
|
|
2830
|
+
const N = o + S;
|
|
2831
|
+
if (Ur.some(($) => S.endsWith($)))
|
|
2832
|
+
typeof I.source == "string" && I.source.length < w.inlineStylesUpToBytes ? g.push({
|
|
2837
2833
|
tag: "style",
|
|
2838
2834
|
location: "head",
|
|
2839
2835
|
attributes: {
|
|
2840
|
-
"data-src":
|
|
2841
|
-
dangerouslySetInnerHTML:
|
|
2836
|
+
"data-src": N,
|
|
2837
|
+
dangerouslySetInnerHTML: I.source
|
|
2842
2838
|
}
|
|
2843
|
-
}) :
|
|
2839
|
+
}) : g.push({
|
|
2844
2840
|
tag: "link",
|
|
2845
2841
|
location: "head",
|
|
2846
2842
|
attributes: {
|
|
2847
2843
|
rel: "stylesheet",
|
|
2848
|
-
href:
|
|
2844
|
+
href: N
|
|
2849
2845
|
}
|
|
2850
2846
|
});
|
|
2851
2847
|
else {
|
|
2852
|
-
const
|
|
2853
|
-
|
|
2848
|
+
const $ = Br.find((T) => S.endsWith(T));
|
|
2849
|
+
$ && !k && g.unshift({
|
|
2854
2850
|
tag: "link",
|
|
2855
2851
|
location: "head",
|
|
2856
2852
|
attributes: {
|
|
2857
2853
|
rel: "preload",
|
|
2858
|
-
href:
|
|
2854
|
+
href: N,
|
|
2859
2855
|
as: "font",
|
|
2860
|
-
type: `font/${
|
|
2856
|
+
type: `font/${$.slice(1)}`,
|
|
2861
2857
|
crossorigin: ""
|
|
2862
2858
|
}
|
|
2863
2859
|
});
|
|
2864
2860
|
}
|
|
2865
2861
|
}
|
|
2866
|
-
await
|
|
2867
|
-
injections:
|
|
2862
|
+
await d.generateManifest(this, v, f, {
|
|
2863
|
+
injections: g,
|
|
2868
2864
|
platform: { vite: "" }
|
|
2869
2865
|
});
|
|
2870
2866
|
}
|
|
2871
2867
|
}
|
|
2872
2868
|
},
|
|
2873
|
-
async writeBundle(
|
|
2874
|
-
const
|
|
2875
|
-
if (
|
|
2876
|
-
const S =
|
|
2869
|
+
async writeBundle(s, v) {
|
|
2870
|
+
const w = d.getOptions();
|
|
2871
|
+
if (w.target === "ssr") {
|
|
2872
|
+
const S = d.getSys();
|
|
2877
2873
|
if (S.env === "node" || S.env === "bun") {
|
|
2878
|
-
const
|
|
2874
|
+
const I = Object.keys(v), N = async ($) => {
|
|
2879
2875
|
try {
|
|
2880
|
-
const
|
|
2881
|
-
if ((
|
|
2882
|
-
const
|
|
2883
|
-
if (!
|
|
2884
|
-
const
|
|
2885
|
-
await
|
|
2886
|
-
S.path.join(
|
|
2887
|
-
`export * from "./${
|
|
2876
|
+
const T = S.path.basename($), F = S.path.extname(T);
|
|
2877
|
+
if ((T.startsWith("entry.") || T.startsWith("entry_")) && !T.includes("preview") && (F === ".mjs" || F === ".cjs")) {
|
|
2878
|
+
const B = S.path.basename(T, F), V = `${B}.js`, G = B + F;
|
|
2879
|
+
if (!I.some((J) => S.path.basename(J) === V)) {
|
|
2880
|
+
const J = S.path.dirname($), q = await S.dynamicImport("node:fs"), se = S.path.join(w.outDir, J);
|
|
2881
|
+
await q.promises.mkdir(se, { recursive: !0 }), await q.promises.writeFile(
|
|
2882
|
+
S.path.join(se, V),
|
|
2883
|
+
`export * from "./${G}";`
|
|
2888
2884
|
);
|
|
2889
2885
|
}
|
|
2890
2886
|
}
|
|
2891
|
-
} catch (
|
|
2892
|
-
console.error("patchModuleFormat",
|
|
2887
|
+
} catch (T) {
|
|
2888
|
+
console.error("patchModuleFormat", T);
|
|
2893
2889
|
}
|
|
2894
2890
|
};
|
|
2895
|
-
await Promise.all(
|
|
2891
|
+
await Promise.all(I.map(N));
|
|
2896
2892
|
}
|
|
2897
2893
|
}
|
|
2898
2894
|
},
|
|
2899
2895
|
transformIndexHtml() {
|
|
2900
2896
|
if (n === "serve")
|
|
2901
|
-
return jr(
|
|
2897
|
+
return jr(d.getOptions(), o);
|
|
2902
2898
|
},
|
|
2903
|
-
configureServer(
|
|
2904
|
-
|
|
2899
|
+
configureServer(s) {
|
|
2900
|
+
d.configureServer(s), (e?.devTools?.imageDevTools ?? !0) && s.middlewares.use(kr(d.getSys(), u, a));
|
|
2905
2901
|
},
|
|
2906
|
-
configurePreviewServer(
|
|
2902
|
+
configurePreviewServer(s) {
|
|
2907
2903
|
return async () => {
|
|
2908
|
-
const
|
|
2909
|
-
await Or(
|
|
2904
|
+
const v = d.getSys(), w = d.getPath();
|
|
2905
|
+
await Or(s.middlewares, t, v, w);
|
|
2910
2906
|
};
|
|
2911
2907
|
},
|
|
2912
|
-
handleHotUpdate(
|
|
2913
|
-
|
|
2908
|
+
handleHotUpdate(s) {
|
|
2909
|
+
d.handleHotUpdate(s), s.modules.length && s.server.hot.send({
|
|
2914
2910
|
type: "full-reload"
|
|
2915
2911
|
});
|
|
2916
2912
|
},
|
|
2917
|
-
onLog(
|
|
2918
|
-
if (
|
|
2919
|
-
const
|
|
2913
|
+
onLog(s, v) {
|
|
2914
|
+
if (v.plugin == "vite-plugin-qwik") {
|
|
2915
|
+
const w = Fr[s] || oe.White, S = (v.frame || "").split(`
|
|
2920
2916
|
`).map(
|
|
2921
|
-
(
|
|
2917
|
+
(I) => (I.match(/^\s*\^\s*$/) ? oe.BrightWhite : oe.BrightBlack) + I
|
|
2922
2918
|
);
|
|
2923
|
-
return console[
|
|
2924
|
-
`${
|
|
2919
|
+
return console[s](
|
|
2920
|
+
`${w}%s
|
|
2925
2921
|
${oe.BrightWhite}%s
|
|
2926
2922
|
%s${oe.RESET}`,
|
|
2927
|
-
`[${
|
|
2923
|
+
`[${v.plugin}](${s}): ${v.message}
|
|
2928
2924
|
`,
|
|
2929
|
-
` ${
|
|
2925
|
+
` ${v?.loc?.file}:${v?.loc?.line}:${v?.loc?.column}
|
|
2930
2926
|
`,
|
|
2931
2927
|
` ${S.join(`
|
|
2932
2928
|
`)}
|
|
@@ -2934,33 +2930,33 @@ ${oe.BrightWhite}%s
|
|
|
2934
2930
|
), !1;
|
|
2935
2931
|
}
|
|
2936
2932
|
}
|
|
2937
|
-
},
|
|
2933
|
+
}, Ar()];
|
|
2938
2934
|
}
|
|
2939
|
-
async function
|
|
2935
|
+
async function Ar() {
|
|
2940
2936
|
let e, n;
|
|
2941
2937
|
try {
|
|
2942
2938
|
e = await import("node:fs").then((a) => a.promises), n = await import("node:path");
|
|
2943
2939
|
} catch {
|
|
2944
2940
|
return;
|
|
2945
2941
|
}
|
|
2946
|
-
const
|
|
2942
|
+
const i = /* @__PURE__ */ new Set();
|
|
2947
2943
|
let r;
|
|
2948
|
-
const o = "@qwik-dev/core",
|
|
2949
|
-
async function c(a,
|
|
2950
|
-
for (;
|
|
2951
|
-
const t = n.join(
|
|
2944
|
+
const o = "@qwik-dev/core", h = "@builder.io/qwik";
|
|
2945
|
+
async function c(a, u) {
|
|
2946
|
+
for (; u; ) {
|
|
2947
|
+
const t = n.join(u, "node_modules", a, "package.json");
|
|
2952
2948
|
try {
|
|
2953
2949
|
await e.access(t);
|
|
2954
|
-
const
|
|
2950
|
+
const x = await e.readFile(t, {
|
|
2955
2951
|
encoding: "utf-8"
|
|
2956
|
-
}),
|
|
2957
|
-
return !!(
|
|
2952
|
+
}), m = JSON.parse(x);
|
|
2953
|
+
return !!(m.qwik || m.dependencies?.[o] || m.peerDependencies?.[o] || m.dependencies?.[h] || m.peerDependencies?.[h]);
|
|
2958
2954
|
} catch {
|
|
2959
2955
|
}
|
|
2960
|
-
const
|
|
2961
|
-
if (
|
|
2956
|
+
const b = n.dirname(u);
|
|
2957
|
+
if (b === u)
|
|
2962
2958
|
break;
|
|
2963
|
-
|
|
2959
|
+
u = b;
|
|
2964
2960
|
}
|
|
2965
2961
|
return !1;
|
|
2966
2962
|
}
|
|
@@ -2974,39 +2970,39 @@ async function Rr() {
|
|
|
2974
2970
|
config: {
|
|
2975
2971
|
order: "post",
|
|
2976
2972
|
async handler(a) {
|
|
2977
|
-
const
|
|
2978
|
-
for (const
|
|
2979
|
-
|
|
2980
|
-
return { optimizeDeps: { exclude:
|
|
2973
|
+
const u = [], t = [a.ssr?.noExternal, a.environments?.ssr?.resolve?.noExternal].flat().filter((x) => typeof x == "string"), b = a.optimizeDeps?.exclude ?? [];
|
|
2974
|
+
for (const x of t)
|
|
2975
|
+
b.includes(x) || await c(x, a.root || process.cwd()) && u.push(x);
|
|
2976
|
+
return { optimizeDeps: { exclude: u } };
|
|
2981
2977
|
}
|
|
2982
2978
|
},
|
|
2983
2979
|
// We check all SSR build lookups for external Qwik deps
|
|
2984
2980
|
resolveId: {
|
|
2985
2981
|
order: "pre",
|
|
2986
|
-
async handler(a,
|
|
2987
|
-
if (!t.ssr || /^([./]|node:|[^a-z@])/i.test(a) ||
|
|
2982
|
+
async handler(a, u, t) {
|
|
2983
|
+
if (!t.ssr || /^([./]|node:|[^a-z@])/i.test(a) || i.has(a))
|
|
2988
2984
|
return;
|
|
2989
|
-
const
|
|
2990
|
-
if (
|
|
2985
|
+
const b = (a.startsWith("@") ? a.split("/").slice(0, 2).join("/") : a.split("/")[0]).split("?")[0];
|
|
2986
|
+
if (i.has(b))
|
|
2991
2987
|
return;
|
|
2992
|
-
|
|
2993
|
-
let
|
|
2988
|
+
i.add(a), i.add(b);
|
|
2989
|
+
let x;
|
|
2994
2990
|
try {
|
|
2995
|
-
|
|
2991
|
+
x = await this.resolve(b, u, { ...t, skipSelf: !0 });
|
|
2996
2992
|
} catch {
|
|
2997
2993
|
return;
|
|
2998
2994
|
}
|
|
2999
|
-
if (
|
|
2995
|
+
if (x?.external && await c(b, u ? n.dirname(u) : r))
|
|
3000
2996
|
throw new Error(
|
|
3001
2997
|
`
|
|
3002
2998
|
==============
|
|
3003
|
-
${
|
|
2999
|
+
${b} is being treated as an external dependency, but it should be included in the server bundle, because it uses Qwik and it needs to be processed by the optimizer.
|
|
3004
3000
|
Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
|
|
3005
3001
|
==============
|
|
3006
3002
|
`
|
|
3007
3003
|
);
|
|
3008
|
-
if (
|
|
3009
|
-
return
|
|
3004
|
+
if (b === a)
|
|
3005
|
+
return x;
|
|
3010
3006
|
}
|
|
3011
3007
|
}
|
|
3012
3008
|
};
|
|
@@ -3018,15 +3014,15 @@ const oe = {
|
|
|
3018
3014
|
BrightBlack: "\x1B[90m",
|
|
3019
3015
|
BrightWhite: "\x1B[97m",
|
|
3020
3016
|
RESET: "\x1B[0m"
|
|
3021
|
-
},
|
|
3017
|
+
}, Fr = {
|
|
3022
3018
|
warn: oe.Yellow,
|
|
3023
3019
|
info: oe.Cyan,
|
|
3024
3020
|
debug: oe.BrightBlack
|
|
3025
3021
|
}, Wr = void 0;
|
|
3026
3022
|
export {
|
|
3027
|
-
|
|
3023
|
+
At as createOptimizer,
|
|
3028
3024
|
zr as qwikRollup,
|
|
3029
3025
|
Hr as qwikVite,
|
|
3030
3026
|
Wr as symbolMapper,
|
|
3031
|
-
|
|
3027
|
+
Rr as versions
|
|
3032
3028
|
};
|