@qwik.dev/core 2.0.0-beta.30 → 2.0.0-beta.31
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 +215 -170
- package/dist/core-internal.d.ts +51 -11
- package/dist/core.min.mjs +2 -2
- package/dist/core.mjs +9314 -8994
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +5672 -5412
- package/dist/insights/vite/index.mjs +36 -33
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +787 -763
- package/dist/preloader.mjs +210 -112
- package/dist/qwikloader.debug.js +26 -13
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +266 -92
- package/dist/server.prod.mjs +552 -364
- package/dist/testing/index.d.ts +4 -1
- package/dist/testing/index.mjs +530 -212
- package/dist/testing/package.json +1 -1
- package/package.json +3 -3
package/dist/optimizer.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ut = (e, n = 0) => {
|
|
2
2
|
for (let i = 0; i < e.length; i++) {
|
|
3
3
|
const r = e.charCodeAt(i);
|
|
4
4
|
n = (n << 5) - n + r, n |= 0;
|
|
5
5
|
}
|
|
6
6
|
return Number(Math.abs(n)).toString(36);
|
|
7
|
-
},
|
|
8
|
-
function
|
|
7
|
+
}, Rt = /* @__PURE__ */ new Set(["_chk", "_rsc", "_res", "_run", "_task", "_val", "_eaC", "_eaT"]);
|
|
8
|
+
function Bt(e) {
|
|
9
9
|
const n = e.symbols;
|
|
10
10
|
return Object.keys(n).sort((i, r) => {
|
|
11
11
|
const o = n[i], u = n[r];
|
|
@@ -14,36 +14,36 @@ function Rt(e) {
|
|
|
14
14
|
if (o.ctxKind !== "eventHandler" && u.ctxKind === "eventHandler")
|
|
15
15
|
return 1;
|
|
16
16
|
if (o.ctxKind === "eventHandler" && u.ctxKind === "eventHandler") {
|
|
17
|
-
const a =
|
|
18
|
-
if (a > -1 &&
|
|
19
|
-
if (a <
|
|
17
|
+
const a = Ze.indexOf(o.ctxName.toLowerCase()), c = Ze.indexOf(u.ctxName.toLowerCase());
|
|
18
|
+
if (a > -1 && c > -1) {
|
|
19
|
+
if (a < c)
|
|
20
20
|
return -1;
|
|
21
|
-
if (a >
|
|
21
|
+
if (a > c)
|
|
22
22
|
return 1;
|
|
23
23
|
} else {
|
|
24
24
|
if (a > -1)
|
|
25
25
|
return -1;
|
|
26
|
-
if (
|
|
26
|
+
if (c > -1)
|
|
27
27
|
return 1;
|
|
28
28
|
}
|
|
29
29
|
} else if (o.ctxKind === "function" && u.ctxKind === "function") {
|
|
30
|
-
const a =
|
|
31
|
-
if (a > -1 &&
|
|
32
|
-
if (a <
|
|
30
|
+
const a = et.indexOf(o.ctxName.toLowerCase()), c = et.indexOf(u.ctxName.toLowerCase());
|
|
31
|
+
if (a > -1 && c > -1) {
|
|
32
|
+
if (a < c)
|
|
33
33
|
return -1;
|
|
34
|
-
if (a >
|
|
34
|
+
if (a > c)
|
|
35
35
|
return 1;
|
|
36
36
|
} else {
|
|
37
37
|
if (a > -1)
|
|
38
38
|
return -1;
|
|
39
|
-
if (
|
|
39
|
+
if (c > -1)
|
|
40
40
|
return 1;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
return !o.parent && u.parent ? -1 : o.parent && !u.parent ? 1 : o.hash < u.hash ? -1 : o.hash > u.hash ? 1 : 0;
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const Ze = [
|
|
47
47
|
// Click Events
|
|
48
48
|
"click",
|
|
49
49
|
"dblclick",
|
|
@@ -99,36 +99,36 @@ const Ve = [
|
|
|
99
99
|
"reset",
|
|
100
100
|
// Scroll Events
|
|
101
101
|
"scroll"
|
|
102
|
-
].map((e) => `on${e.toLowerCase()}$`),
|
|
102
|
+
].map((e) => `on${e.toLowerCase()}$`), et = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
|
|
103
103
|
(e) => e.toLowerCase()
|
|
104
104
|
);
|
|
105
|
-
function Bt(e) {
|
|
106
|
-
return Object.keys(e.bundles).sort(Be);
|
|
107
|
-
}
|
|
108
105
|
function Ft(e) {
|
|
109
|
-
|
|
106
|
+
return Object.keys(e.bundles).sort($e);
|
|
107
|
+
}
|
|
108
|
+
function $t(e) {
|
|
109
|
+
const n = Bt(e), i = {}, r = {};
|
|
110
110
|
for (const a of n)
|
|
111
111
|
i[a] = e.symbols[a], r[a] = e.mapping[a];
|
|
112
|
-
const o =
|
|
112
|
+
const o = Ft(e), u = {};
|
|
113
113
|
for (const a of o) {
|
|
114
114
|
u[a] = e.bundles[a];
|
|
115
|
-
const
|
|
116
|
-
Array.isArray(
|
|
115
|
+
const c = e.bundles[a];
|
|
116
|
+
Array.isArray(c.imports) && c.imports.sort($e), Array.isArray(c.dynamicImports) && c.dynamicImports.sort($e);
|
|
117
117
|
const f = [];
|
|
118
118
|
for (const t of n)
|
|
119
119
|
a === r[t] && f.push(t);
|
|
120
|
-
f.length > 0 && (f.sort(
|
|
120
|
+
f.length > 0 && (f.sort($e), c.symbols = f);
|
|
121
121
|
}
|
|
122
122
|
return e.symbols = i, e.mapping = r, e.bundles = u, e;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function $e(e, n) {
|
|
125
125
|
return e = e.toLocaleLowerCase(), n = n.toLocaleLowerCase(), e < n ? -1 : e > n ? 1 : 0;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function tt(e) {
|
|
128
128
|
if (e != null && e.mapping != null && typeof e.mapping == "object" && e.symbols != null && typeof e.symbols == "object" && e.bundles != null && typeof e.bundles == "object")
|
|
129
129
|
return e;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const zt = (e, n) => {
|
|
132
132
|
let i = 0;
|
|
133
133
|
if (e.symbols)
|
|
134
134
|
for (const r of e.symbols) {
|
|
@@ -138,35 +138,35 @@ const $t = (e, n) => {
|
|
|
138
138
|
}
|
|
139
139
|
return i;
|
|
140
140
|
};
|
|
141
|
-
function
|
|
141
|
+
function At(e) {
|
|
142
142
|
let n = 0;
|
|
143
143
|
const i = [], r = [], o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
144
|
-
function
|
|
144
|
+
function c(s) {
|
|
145
145
|
o.set(s, n), u.set(s, n), n++, i.push(s), a.add(s);
|
|
146
146
|
const p = e[s].imports || [];
|
|
147
|
-
for (const
|
|
148
|
-
o.has(
|
|
147
|
+
for (const l of p)
|
|
148
|
+
o.has(l) ? a.has(l) && u.set(s, Math.min(u.get(s), o.get(l))) : (c(l), u.set(s, Math.min(u.get(s), u.get(l))));
|
|
149
149
|
if (u.get(s) === o.get(s)) {
|
|
150
|
-
const
|
|
150
|
+
const l = [];
|
|
151
151
|
let y;
|
|
152
152
|
do
|
|
153
|
-
y = i.pop(), a.delete(y),
|
|
153
|
+
y = i.pop(), a.delete(y), l.push(y);
|
|
154
154
|
while (y !== s);
|
|
155
|
-
r.push(
|
|
155
|
+
r.push(l);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
for (const s of Object.keys(e))
|
|
159
|
-
o.has(s) ||
|
|
159
|
+
o.has(s) || c(s);
|
|
160
160
|
const f = /* @__PURE__ */ new Map();
|
|
161
161
|
r.forEach((s, p) => {
|
|
162
|
-
for (const
|
|
163
|
-
f.set(
|
|
162
|
+
for (const l of s)
|
|
163
|
+
f.set(l, p);
|
|
164
164
|
});
|
|
165
165
|
const t = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
|
|
166
166
|
for (const s of Object.keys(e)) {
|
|
167
167
|
const p = f.get(s);
|
|
168
|
-
for (const
|
|
169
|
-
const y = f.get(
|
|
168
|
+
for (const l of e[s].imports || []) {
|
|
169
|
+
const y = f.get(l);
|
|
170
170
|
p !== y && t[p].add(y);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -183,26 +183,26 @@ function zt(e) {
|
|
|
183
183
|
const d = new Array(r.length).fill(0);
|
|
184
184
|
for (let s = 0; s < r.length; s++) {
|
|
185
185
|
let p = 0;
|
|
186
|
-
for (const
|
|
187
|
-
p += e[
|
|
186
|
+
for (const l of r[s])
|
|
187
|
+
p += e[l].size;
|
|
188
188
|
d[s] = p;
|
|
189
189
|
}
|
|
190
190
|
for (let s = m.length - 1; s >= 0; s--) {
|
|
191
191
|
const p = m[s];
|
|
192
|
-
let
|
|
192
|
+
let l = d[p];
|
|
193
193
|
for (const y of t[p])
|
|
194
|
-
|
|
195
|
-
d[p] =
|
|
194
|
+
l += d[y];
|
|
195
|
+
d[p] = l;
|
|
196
196
|
}
|
|
197
197
|
for (let s = 0; s < r.length; s++) {
|
|
198
198
|
const p = d[s];
|
|
199
|
-
for (const
|
|
200
|
-
e[
|
|
199
|
+
for (const l of r[s])
|
|
200
|
+
e[l].total = p;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
const
|
|
204
|
-
function
|
|
205
|
-
const
|
|
203
|
+
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$/;
|
|
204
|
+
function Ht(e, n, i, r, o, u, a) {
|
|
205
|
+
const c = {
|
|
206
206
|
version: "1",
|
|
207
207
|
manifestHash: "",
|
|
208
208
|
options: {
|
|
@@ -237,32 +237,32 @@ function At(e, n, i, r, o, u, a) {
|
|
|
237
237
|
const v = new Set(n.map((d) => d.name));
|
|
238
238
|
for (const d of Object.values(r)) {
|
|
239
239
|
if (d.type === "asset") {
|
|
240
|
-
d.fileName.endsWith("js.map") || (
|
|
240
|
+
d.fileName.endsWith("js.map") || (c.assets[d.fileName] = {
|
|
241
241
|
name: d.names[0],
|
|
242
242
|
size: d.source.length
|
|
243
243
|
});
|
|
244
244
|
continue;
|
|
245
245
|
}
|
|
246
|
-
const s = a(d.fileName),
|
|
246
|
+
const s = a(d.fileName), l = {
|
|
247
247
|
size: d.code.length,
|
|
248
248
|
total: -1
|
|
249
249
|
};
|
|
250
250
|
for (const k of d.exports)
|
|
251
|
-
v.has(k) && (!
|
|
251
|
+
v.has(k) && (!c.mapping[k] || d.exports.length !== 1) && (c.mapping[k] = s);
|
|
252
252
|
const y = d.imports.filter((k) => d.code.includes(e.basename(k))).map((k) => f(k)).filter((k) => k !== g && k !== t && k !== m).filter(Boolean);
|
|
253
|
-
y.length > 0 && (
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
253
|
+
y.length > 0 && (l.imports = y);
|
|
254
|
+
const O = d.dynamicImports.filter((k) => d.code.includes(e.basename(k))).map((k) => f(k)).filter(Boolean);
|
|
255
|
+
O.length > 0 && (l.dynamicImports = O), d.facadeModuleId && (nt.test(d.facadeModuleId) ? c.preloader = s : rt.test(d.facadeModuleId) ? c.core = s : ot.test(d.facadeModuleId) && (c.qwikLoader = s));
|
|
256
|
+
const j = (d.moduleIds || Object.keys(d.modules)).filter((k) => !k.startsWith("\0")).map((k) => e.relative(o.rootDir, k));
|
|
257
|
+
j.length > 0 && (l.origins = j, !c.preloader && j.some((k) => nt.test(k)) && (c.preloader = s), !c.core && j.some((k) => rt.test(k)) && (c.core = s), !c.qwikLoader && j.some((k) => ot.test(k)) && (c.qwikLoader = s)), c.bundles[s] = l;
|
|
258
258
|
}
|
|
259
259
|
for (const d of n) {
|
|
260
|
-
const s = d.name, p =
|
|
260
|
+
const s = d.name, p = c.mapping[s];
|
|
261
261
|
if (!p) {
|
|
262
|
-
u(`Note: qrl ${d.name} is not in the bundle, likely tree shaken`,
|
|
262
|
+
u(`Note: qrl ${d.name} is not in the bundle, likely tree shaken`, c);
|
|
263
263
|
continue;
|
|
264
264
|
}
|
|
265
|
-
(
|
|
265
|
+
(c.bundles[p].symbols ||= []).push(s), c.symbols[s] = {
|
|
266
266
|
displayName: d.displayName,
|
|
267
267
|
hash: d.hash,
|
|
268
268
|
ctxKind: d.ctxKind,
|
|
@@ -277,8 +277,8 @@ function At(e, n, i, r, o, u, a) {
|
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
279
|
if (m)
|
|
280
|
-
for (const d of
|
|
281
|
-
|
|
280
|
+
for (const d of Rt)
|
|
281
|
+
c.symbols[d] = {
|
|
282
282
|
origin: "Qwik core",
|
|
283
283
|
displayName: d,
|
|
284
284
|
canonicalFilename: "",
|
|
@@ -288,20 +288,20 @@ function At(e, n, i, r, o, u, a) {
|
|
|
288
288
|
captures: !1,
|
|
289
289
|
parent: null,
|
|
290
290
|
loc: [0, 0]
|
|
291
|
-
},
|
|
291
|
+
}, c.mapping[d] = m;
|
|
292
292
|
else
|
|
293
293
|
console.error("Qwik core bundle not found, is Qwik actually used in this project?");
|
|
294
|
-
for (const d of Object.values(
|
|
295
|
-
const s =
|
|
294
|
+
for (const d of Object.values(c.bundles)) {
|
|
295
|
+
const s = zt(d, c);
|
|
296
296
|
d.interactivity = s;
|
|
297
297
|
}
|
|
298
|
-
return
|
|
298
|
+
return At(c.bundles), $t(c);
|
|
299
299
|
}
|
|
300
|
-
const
|
|
300
|
+
const Gt = 300, Wt = 0.5 / (Gt * 1024 / 8), Kt = (e) => {
|
|
301
301
|
const n = e.lastIndexOf("_");
|
|
302
302
|
return n > -1 ? e.slice(n + 1) : e;
|
|
303
303
|
};
|
|
304
|
-
function
|
|
304
|
+
function Qt(e, n) {
|
|
305
305
|
const i = [];
|
|
306
306
|
if (!e.bundles)
|
|
307
307
|
return [];
|
|
@@ -309,7 +309,7 @@ function Kt(e, n) {
|
|
|
309
309
|
for (const [f, t] of Object.entries(e.mapping)) {
|
|
310
310
|
if (f.startsWith("_") && f.length < 10)
|
|
311
311
|
continue;
|
|
312
|
-
const g =
|
|
312
|
+
const g = Kt(f);
|
|
313
313
|
g && (r[g] = { dynamicImports: [t] });
|
|
314
314
|
}
|
|
315
315
|
if (n) {
|
|
@@ -344,36 +344,36 @@ function Kt(e, n) {
|
|
|
344
344
|
const t = r[f];
|
|
345
345
|
!t.imports?.length && !t.dynamicImports?.length && delete r[f];
|
|
346
346
|
}
|
|
347
|
-
const u = Object.keys(r), a = /* @__PURE__ */ new Map(),
|
|
347
|
+
const u = Object.keys(r), a = /* @__PURE__ */ new Map(), c = (f, t, g = /* @__PURE__ */ new Set()) => {
|
|
348
348
|
const m = r[t];
|
|
349
349
|
for (const v of m.imports)
|
|
350
|
-
f.has(v) && f.delete(v), g.has(v) || (g.add(v),
|
|
350
|
+
f.has(v) && f.delete(v), g.has(v) || (g.add(v), c(f, v, g));
|
|
351
351
|
};
|
|
352
352
|
for (const f of u) {
|
|
353
353
|
const t = r[f], g = new Set(t.imports);
|
|
354
354
|
for (const s of g)
|
|
355
|
-
|
|
355
|
+
c(g, s);
|
|
356
356
|
const m = new Set(t.dynamicImports), v = /* @__PURE__ */ new Map();
|
|
357
357
|
for (const s of m) {
|
|
358
|
-
|
|
358
|
+
c(m, s);
|
|
359
359
|
const p = r[s];
|
|
360
|
-
let
|
|
361
|
-
if (
|
|
360
|
+
let l = 0.5;
|
|
361
|
+
if (l += (p.interactivity || 0) * 0.08, t.origins && p.origins) {
|
|
362
362
|
for (const y of t.origins)
|
|
363
|
-
if (p.origins.some((
|
|
364
|
-
|
|
363
|
+
if (p.origins.some((O) => O.startsWith(y))) {
|
|
364
|
+
l += 0.25;
|
|
365
365
|
break;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
p.total > Wt && (
|
|
368
|
+
p.total > Wt && (l += l > 0.5 ? 0.02 : -0.02), p.total < 1e3 && (l += 0.15), v.set(s, Math.min(l, 0.99));
|
|
369
369
|
}
|
|
370
370
|
if (m.size > 0) {
|
|
371
371
|
const s = Array.from(m).sort(
|
|
372
|
-
(
|
|
372
|
+
(l, y) => v.get(y) - v.get(l)
|
|
373
373
|
);
|
|
374
374
|
let p = -1;
|
|
375
|
-
for (const
|
|
376
|
-
v.get(
|
|
375
|
+
for (const l of s)
|
|
376
|
+
v.get(l) !== p && (p = v.get(l), g.add(-Math.round(p * 10))), g.add(l);
|
|
377
377
|
}
|
|
378
378
|
const d = i.length;
|
|
379
379
|
i.push(f);
|
|
@@ -396,11 +396,11 @@ function Kt(e, n) {
|
|
|
396
396
|
}
|
|
397
397
|
return i;
|
|
398
398
|
}
|
|
399
|
-
async function
|
|
399
|
+
async function Jt(e, n, i) {
|
|
400
400
|
const r = await e.dynamicImport("eslint");
|
|
401
401
|
let o = new r.ESLint({ cache: !0 });
|
|
402
402
|
if ((await o.calculateConfigForFile("no-real-file.tsx")).parser === null) {
|
|
403
|
-
const
|
|
403
|
+
const c = {
|
|
404
404
|
cache: !0,
|
|
405
405
|
overrideConfig: {
|
|
406
406
|
languageOptions: {
|
|
@@ -416,12 +416,12 @@ async function Qt(e, n, i) {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
-
o = new r.ESLint(
|
|
419
|
+
o = new r.ESLint(c);
|
|
420
420
|
}
|
|
421
421
|
return {
|
|
422
|
-
async lint(
|
|
422
|
+
async lint(c, f, t) {
|
|
423
423
|
try {
|
|
424
|
-
const g =
|
|
424
|
+
const g = Yt(t);
|
|
425
425
|
if (await o.isPathIgnored(g))
|
|
426
426
|
return null;
|
|
427
427
|
(await o.lintText(f, {
|
|
@@ -430,8 +430,8 @@ async function Qt(e, n, i) {
|
|
|
430
430
|
for (const d of v.messages) {
|
|
431
431
|
if (d.ruleId != null && !d.ruleId.startsWith("qwik/"))
|
|
432
432
|
continue;
|
|
433
|
-
const s =
|
|
434
|
-
|
|
433
|
+
const s = Xt(v.filePath, d);
|
|
434
|
+
c.warn(s);
|
|
435
435
|
}
|
|
436
436
|
});
|
|
437
437
|
} catch (g) {
|
|
@@ -440,10 +440,10 @@ async function Qt(e, n, i) {
|
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function Yt(e) {
|
|
444
444
|
return e.split("?", 2)[0];
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Xt(e, n) {
|
|
447
447
|
return Object.assign(new Error(n.message), {
|
|
448
448
|
id: e,
|
|
449
449
|
plugin: "vite-plugin-eslint",
|
|
@@ -455,21 +455,21 @@ function Yt(e, n) {
|
|
|
455
455
|
stack: ""
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
|
-
async function
|
|
458
|
+
async function Vt(e, n) {
|
|
459
459
|
const i = n;
|
|
460
460
|
let r = i.loc;
|
|
461
|
-
if (!i.frame && !i.plugin && (r || (r =
|
|
461
|
+
if (!i.frame && !i.plugin && (r || (r = Zt(i)), r && (i.loc = r, r.file))) {
|
|
462
462
|
const o = await e.dynamicImport("node:fs"), { normalizePath: u } = await e.dynamicImport("vite");
|
|
463
463
|
i.id = u(i.loc.file);
|
|
464
464
|
try {
|
|
465
465
|
const a = o.readFileSync(i.loc.file, "utf-8");
|
|
466
|
-
i.frame =
|
|
466
|
+
i.frame = tn(a, i.loc);
|
|
467
467
|
} catch {
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
return n;
|
|
471
471
|
}
|
|
472
|
-
const
|
|
472
|
+
const Zt = (e) => {
|
|
473
473
|
const n = e.stack;
|
|
474
474
|
if (typeof n == "string") {
|
|
475
475
|
const i = n.split(`
|
|
@@ -479,7 +479,7 @@ const Vt = (e) => {
|
|
|
479
479
|
if (/^\s+at/.test(o)) {
|
|
480
480
|
const u = o.indexOf("/"), a = o.lastIndexOf(")", u);
|
|
481
481
|
if (u > 0) {
|
|
482
|
-
const f = o.slice(u, a).split(":"), t =
|
|
482
|
+
const f = o.slice(u, a).split(":"), t = it(f[f.length - 1]), g = it(f[f.length - 2]);
|
|
483
483
|
return typeof t == "number" && typeof g == "number" ? (f.length -= 2, {
|
|
484
484
|
file: f.join(":"),
|
|
485
485
|
line: g,
|
|
@@ -497,41 +497,41 @@ const Vt = (e) => {
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
}, oe = (e) => e.startsWith("\0"),
|
|
500
|
+
}, oe = (e) => e.startsWith("\0"), it = (e) => {
|
|
501
501
|
try {
|
|
502
502
|
return parseInt(e, 10);
|
|
503
503
|
} catch {
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
|
-
},
|
|
507
|
-
function
|
|
506
|
+
}, _t = /\r?\n/, st = 2;
|
|
507
|
+
function en(e, n) {
|
|
508
508
|
if (typeof n == "number")
|
|
509
509
|
return n;
|
|
510
510
|
if (n.lo != null)
|
|
511
511
|
return n.lo;
|
|
512
|
-
const i = e.split(
|
|
512
|
+
const i = e.split(_t), { line: r, column: o } = n;
|
|
513
513
|
let u = 0;
|
|
514
514
|
for (let a = 0; a < r - 1 && a < i.length; a++)
|
|
515
515
|
u += i[a].length + 1;
|
|
516
516
|
return u + o;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
n =
|
|
520
|
-
const r = e.split(
|
|
518
|
+
function tn(e, n = 0, i) {
|
|
519
|
+
n = en(e, n), i = i || n;
|
|
520
|
+
const r = e.split(_t);
|
|
521
521
|
let o = 0;
|
|
522
522
|
const u = [];
|
|
523
523
|
for (let a = 0; a < r.length; a++)
|
|
524
524
|
if (o += r[a].length + 1, o >= n) {
|
|
525
|
-
for (let
|
|
526
|
-
if (
|
|
525
|
+
for (let c = a - st; c <= a + st || i > o; c++) {
|
|
526
|
+
if (c < 0 || c >= r.length)
|
|
527
527
|
continue;
|
|
528
|
-
const f =
|
|
529
|
-
u.push(`${f}${" ".repeat(Math.max(3 - String(f).length, 0))}| ${r[
|
|
530
|
-
const t = r[
|
|
531
|
-
if (
|
|
528
|
+
const f = c + 1;
|
|
529
|
+
u.push(`${f}${" ".repeat(Math.max(3 - String(f).length, 0))}| ${r[c]}`);
|
|
530
|
+
const t = r[c].length;
|
|
531
|
+
if (c === a) {
|
|
532
532
|
const g = Math.max(n - (o - t) + 1, 0), m = Math.max(1, i > o ? t - g : i - n);
|
|
533
533
|
u.push(" | " + " ".repeat(g) + "^".repeat(m));
|
|
534
|
-
} else if (
|
|
534
|
+
} else if (c > a) {
|
|
535
535
|
if (i > o) {
|
|
536
536
|
const g = Math.max(Math.min(i - o, t), 1);
|
|
537
537
|
u.push(" | " + "^".repeat(g));
|
|
@@ -544,10 +544,10 @@ function en(e, n = 0, i) {
|
|
|
544
544
|
return u.join(`
|
|
545
545
|
`);
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function nn(e) {
|
|
548
548
|
return e === "win32";
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Be(e) {
|
|
551
551
|
const [n, i] = e.split("?"), r = i || "";
|
|
552
552
|
return {
|
|
553
553
|
originalId: e,
|
|
@@ -556,7 +556,7 @@ function Ue(e) {
|
|
|
556
556
|
params: new URLSearchParams(r)
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const rn = ["server"], on = [
|
|
560
560
|
"onGet",
|
|
561
561
|
"onPost",
|
|
562
562
|
"onPut",
|
|
@@ -566,7 +566,7 @@ const nn = ["server"], rn = [
|
|
|
566
566
|
"onOptions",
|
|
567
567
|
"onPatch",
|
|
568
568
|
"onStaticGenerate"
|
|
569
|
-
],
|
|
569
|
+
], sn = [
|
|
570
570
|
"useServer",
|
|
571
571
|
"route",
|
|
572
572
|
"server",
|
|
@@ -575,7 +575,7 @@ const nn = ["server"], rn = [
|
|
|
575
575
|
"zod$",
|
|
576
576
|
"validator$",
|
|
577
577
|
"globalAction$"
|
|
578
|
-
],
|
|
578
|
+
], an = [
|
|
579
579
|
"useClient",
|
|
580
580
|
"useBrowser",
|
|
581
581
|
"useVisibleTask",
|
|
@@ -583,10 +583,10 @@ const nn = ["server"], rn = [
|
|
|
583
583
|
"browser",
|
|
584
584
|
"event$"
|
|
585
585
|
];
|
|
586
|
-
var
|
|
587
|
-
function
|
|
586
|
+
var Tt = /* @__PURE__ */ ((e) => (e.each = "each", e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(Tt || {});
|
|
587
|
+
function Ct(e = {}) {
|
|
588
588
|
const n = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
589
|
-
let a = null,
|
|
589
|
+
let a = null, c, f = () => {
|
|
590
590
|
};
|
|
591
591
|
const t = {
|
|
592
592
|
csr: !1,
|
|
@@ -622,7 +622,7 @@ function Tt(e = {}) {
|
|
|
622
622
|
const v = async () => {
|
|
623
623
|
if (!a) {
|
|
624
624
|
const w = (e._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
|
|
625
|
-
if (a = await w(e), g =
|
|
625
|
+
if (a = await w(e), g = ln(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
|
|
626
626
|
try {
|
|
627
627
|
m === void 0 && (m = await a.sys.dynamicImport("node:fs"));
|
|
628
628
|
} catch {
|
|
@@ -634,31 +634,31 @@ function Tt(e = {}) {
|
|
|
634
634
|
throw new Error("Qwik plugin has not been initialized");
|
|
635
635
|
return a;
|
|
636
636
|
}, s = () => d().sys, p = () => d().sys.path;
|
|
637
|
-
let
|
|
637
|
+
let l;
|
|
638
638
|
const y = (w) => {
|
|
639
|
-
|
|
640
|
-
},
|
|
641
|
-
const h = Object.assign({}, w),
|
|
639
|
+
l = w;
|
|
640
|
+
}, O = async (w) => {
|
|
641
|
+
const h = Object.assign({}, w), E = d(), C = E.sys.path, T = (...q) => A(C.resolve(...q));
|
|
642
642
|
t.debug = !!h.debug, h.devTools && (t.devTools = {
|
|
643
643
|
...t.devTools,
|
|
644
644
|
...h.devTools
|
|
645
|
-
}), h.assetsDir && (t.assetsDir = h.assetsDir), h.target === "ssr" || h.target === "client" || h.target === "lib" || h.target === "test" ? t.target = h.target : t.target ||= "client", t.target === "lib" ? t.buildMode = "development" : h.buildMode === "production" || h.buildMode === "development" ? t.buildMode = h.buildMode : t.buildMode ||= "development", t.csr = !!h.csr, h.entryStrategy && typeof h.entryStrategy == "object" && (t.entryStrategy = { ...h.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 h.rootDir == "string" && (t.rootDir = h.rootDir), typeof t.rootDir != "string" && (t.rootDir ||=
|
|
646
|
-
let I =
|
|
647
|
-
if (typeof h.srcDir == "string" ? (t.srcDir =
|
|
645
|
+
}), h.assetsDir && (t.assetsDir = h.assetsDir), h.target === "ssr" || h.target === "client" || h.target === "lib" || h.target === "test" ? t.target = h.target : t.target ||= "client", t.target === "lib" ? t.buildMode = "development" : h.buildMode === "production" || h.buildMode === "development" ? t.buildMode = h.buildMode : t.buildMode ||= "development", t.csr = !!h.csr, h.entryStrategy && typeof h.entryStrategy == "object" && (t.entryStrategy = { ...h.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 h.rootDir == "string" && (t.rootDir = h.rootDir), typeof t.rootDir != "string" && (t.rootDir ||= E.sys.cwd()), t.rootDir = T(E.sys.cwd(), t.rootDir);
|
|
646
|
+
let I = T(t.rootDir, un);
|
|
647
|
+
if (typeof h.srcDir == "string" ? (t.srcDir = T(t.rootDir, h.srcDir), I = t.srcDir) : t.srcDir ||= I, t.srcDir = T(t.rootDir, t.srcDir), Array.isArray(h.tsconfigFileNames) && h.tsconfigFileNames.length > 0 && (t.tsconfigFileNames = h.tsconfigFileNames), !t.csr && !h.input && !t.input && (t.target === "ssr" ? t.input = [T(I, "entry.ssr")] : t.target === "client" ? t.input = [T(I, "root")] : t.input = void 0), h.outDir && (t.outDir = T(t.rootDir, h.outDir)), t.clientOutDir = T(t.rootDir, h.clientOutDir || at), t.ssrOutDir = T(t.rootDir, h.ssrOutDir || fn), t.target === "ssr" ? t.outDir ||= t.ssrOutDir : t.target === "lib" ? t.outDir ||= T(t.rootDir, pn) : t.outDir ||= t.clientOutDir, typeof h.manifestOutput == "function" && (t.manifestOutput = h.manifestOutput), h.manifestInput && (t.manifestInput = tt(h.manifestInput) || null), typeof h.transformedModuleOutput == "function" && (t.transformedModuleOutput = h.transformedModuleOutput), h.scope !== void 0)
|
|
648
648
|
t.scope = h.scope;
|
|
649
649
|
else if (!t.scope && m) {
|
|
650
650
|
let q = "";
|
|
651
651
|
try {
|
|
652
652
|
let L = t.rootDir;
|
|
653
|
-
for (; q =
|
|
654
|
-
const
|
|
655
|
-
if (
|
|
653
|
+
for (; q = C.resolve(L, "package.json"), !await m.promises.stat(q).catch(() => !1); ) {
|
|
654
|
+
const D = C.resolve(L, "..");
|
|
655
|
+
if (D === L)
|
|
656
656
|
break;
|
|
657
|
-
L =
|
|
657
|
+
L = D, q = "";
|
|
658
658
|
}
|
|
659
659
|
if (q) {
|
|
660
|
-
const
|
|
661
|
-
typeof
|
|
660
|
+
const D = await m.promises.readFile(q, "utf-8"), N = JSON.parse(D);
|
|
661
|
+
typeof N.name == "string" && (t.scope = N.name);
|
|
662
662
|
}
|
|
663
663
|
} catch (L) {
|
|
664
664
|
console.warn(
|
|
@@ -669,36 +669,36 @@ function Tt(e = {}) {
|
|
|
669
669
|
if (typeof h.resolveQwikBuild == "boolean" && (t.resolveQwikBuild = h.resolveQwikBuild), typeof h.devTools == "object" && ("imageDevTools" in h.devTools && (t.devTools.imageDevTools = h.devTools.imageDevTools), "clickToSource" in h.devTools && (t.devTools.clickToSource = h.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? t.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof t.inlineStylesUpToBytes != "number" || t.inlineStylesUpToBytes < 0) && (t.inlineStylesUpToBytes = 0)), typeof h.lint == "boolean" && (t.lint = h.lint), "experimental" in h) {
|
|
670
670
|
t.experimental = void 0;
|
|
671
671
|
for (const q of h.experimental ?? [])
|
|
672
|
-
|
|
672
|
+
Tt[q] ? (t.experimental ||= {})[q] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${q}`);
|
|
673
673
|
}
|
|
674
674
|
const B = { ...t };
|
|
675
675
|
return t.input ||= h.input, t.input && typeof t.input == "string" && (t.input = [t.input]), B;
|
|
676
676
|
};
|
|
677
|
-
let
|
|
678
|
-
const
|
|
679
|
-
if (!
|
|
680
|
-
|
|
677
|
+
let Q = !1;
|
|
678
|
+
const j = async (w) => {
|
|
679
|
+
if (!Q) {
|
|
680
|
+
Q = !0;
|
|
681
681
|
const h = s();
|
|
682
682
|
if (h.env === "node") {
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
683
|
+
const E = await h.dynamicImport("node:fs");
|
|
684
|
+
if (!E.existsSync(t.rootDir))
|
|
685
685
|
throw new Error(`Qwik rootDir "${t.rootDir}" not found.`);
|
|
686
|
-
if (typeof t.srcDir == "string" && !
|
|
686
|
+
if (typeof t.srcDir == "string" && !E.existsSync(t.srcDir))
|
|
687
687
|
throw new Error(`Qwik srcDir "${t.srcDir}" not found.`);
|
|
688
|
-
for (const [
|
|
689
|
-
if (!await w(
|
|
690
|
-
throw new Error(`Qwik input "${
|
|
688
|
+
for (const [C, T] of Object.entries(t.input || {}))
|
|
689
|
+
if (!await w(T))
|
|
690
|
+
throw new Error(`Qwik input "${T}" not found.`);
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
};
|
|
694
694
|
let k, b = !1;
|
|
695
|
-
const
|
|
696
|
-
if (
|
|
695
|
+
const S = async (w) => {
|
|
696
|
+
if (M("buildStart()", t.buildMode, t.scope, t.target, t.rootDir, t.srcDir), k = d(), b = !l, k.sys.env === "node" && t.target === "ssr" && t.lint)
|
|
697
697
|
try {
|
|
698
|
-
|
|
698
|
+
c = await Jt(k.sys, t.rootDir, t.tsconfigFileNames);
|
|
699
699
|
} catch {
|
|
700
700
|
}
|
|
701
|
-
if (
|
|
701
|
+
if (M("transformedOutputs.clear()"), r.clear(), o.clear(), t.target === "client" && !l) {
|
|
702
702
|
const h = await w.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
703
703
|
skipSelf: !0
|
|
704
704
|
});
|
|
@@ -708,18 +708,18 @@ function Tt(e = {}) {
|
|
|
708
708
|
preserveSignature: "allow-extension"
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
|
-
}, x = (w, h) => w.environment ? w.environment.config.consumer === "server" :
|
|
712
|
-
let U = 0,
|
|
713
|
-
const
|
|
711
|
+
}, x = (w, h) => w.environment ? w.environment.config.consumer === "server" : l ? !!h?.ssr : t.target === "ssr" || t.target === "test";
|
|
712
|
+
let U = 0, _ = !1;
|
|
713
|
+
const P = async (w, h, E, C) => {
|
|
714
714
|
if (oe(h))
|
|
715
715
|
return;
|
|
716
|
-
const
|
|
717
|
-
if (
|
|
718
|
-
if (!
|
|
719
|
-
|
|
720
|
-
const [, $, z] =
|
|
721
|
-
if (
|
|
722
|
-
const ie = w.environment.moduleGraph.getModuleById(
|
|
716
|
+
const T = l && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(h);
|
|
717
|
+
if (T) {
|
|
718
|
+
if (!_) {
|
|
719
|
+
_ = !0, setTimeout(() => _ = !1, 500);
|
|
720
|
+
const [, $, z] = T, le = await w.resolve($, E);
|
|
721
|
+
if (le) {
|
|
722
|
+
const ie = w.environment.moduleGraph.getModuleById(le.id)?.file;
|
|
723
723
|
if (ie) {
|
|
724
724
|
const ee = `${ie}${z}`;
|
|
725
725
|
try {
|
|
@@ -734,24 +734,24 @@ function Tt(e = {}) {
|
|
|
734
734
|
}
|
|
735
735
|
return { id: "\0editor" };
|
|
736
736
|
}
|
|
737
|
-
const I = U++, B = x(w,
|
|
738
|
-
|
|
739
|
-
const q =
|
|
740
|
-
if (
|
|
737
|
+
const I = U++, B = x(w, C);
|
|
738
|
+
M(`resolveId(${I})`, `begin ${h} | ${B ? "server" : "client"} | ${E}`);
|
|
739
|
+
const q = E && Be(E);
|
|
740
|
+
if (E = q && A(q.pathId), h.startsWith(".") && q) {
|
|
741
741
|
const $ = p(), z = $.dirname(q.pathId);
|
|
742
742
|
z && (h = $.resolve(z, h));
|
|
743
743
|
}
|
|
744
|
-
const L =
|
|
745
|
-
let
|
|
744
|
+
const L = Be(h), D = A(L.pathId);
|
|
745
|
+
let N;
|
|
746
746
|
if (
|
|
747
747
|
/**
|
|
748
748
|
* Check if we know the QRL. During regular builds, we'll encounter and build parents before
|
|
749
749
|
* their QRLs, so this will always match.
|
|
750
750
|
*/
|
|
751
|
-
u.get(
|
|
751
|
+
u.get(D)
|
|
752
752
|
)
|
|
753
|
-
|
|
754
|
-
id:
|
|
753
|
+
M(`resolveId(${I}) Resolved already known ${D}`), N = {
|
|
754
|
+
id: D + L.query,
|
|
755
755
|
moduleSideEffects: !1
|
|
756
756
|
};
|
|
757
757
|
else if (
|
|
@@ -760,20 +760,20 @@ function Tt(e = {}) {
|
|
|
760
760
|
* been transformed yet.
|
|
761
761
|
*/
|
|
762
762
|
// We test with endsWith because the dev server adds the base pathname
|
|
763
|
-
|
|
763
|
+
D.endsWith(re)
|
|
764
764
|
)
|
|
765
|
-
t.resolveQwikBuild && (
|
|
765
|
+
t.resolveQwikBuild && (M(`resolveId(${I})`, "Resolved", re), N = {
|
|
766
766
|
id: re,
|
|
767
767
|
moduleSideEffects: !1
|
|
768
768
|
});
|
|
769
|
-
else if (
|
|
770
|
-
|
|
769
|
+
else if (D.endsWith(se))
|
|
770
|
+
M(`resolveId(${I})`, "Resolved", se), N = {
|
|
771
771
|
id: se,
|
|
772
772
|
moduleSideEffects: !1
|
|
773
773
|
};
|
|
774
|
-
else if (!
|
|
775
|
-
|
|
776
|
-
const $ = await w.resolve(
|
|
774
|
+
else if (!l && !B && D.endsWith(He)) {
|
|
775
|
+
M(`resolveId(${I})`, "Resolved", He);
|
|
776
|
+
const $ = await w.resolve(He, E, {
|
|
777
777
|
skipSelf: !0
|
|
778
778
|
});
|
|
779
779
|
if ($)
|
|
@@ -782,15 +782,15 @@ function Tt(e = {}) {
|
|
|
782
782
|
type: "chunk",
|
|
783
783
|
preserveSignature: "allow-extension"
|
|
784
784
|
}), $;
|
|
785
|
-
} else if (
|
|
786
|
-
|
|
787
|
-
id:
|
|
785
|
+
} else if (D.endsWith(ve))
|
|
786
|
+
M(`resolveId(${I})`, "Resolved", ve), N = {
|
|
787
|
+
id: ve,
|
|
788
788
|
moduleSideEffects: !1
|
|
789
789
|
};
|
|
790
790
|
else {
|
|
791
791
|
if (!B && b && h.endsWith("@qwik.dev/core")) {
|
|
792
792
|
b = !1;
|
|
793
|
-
const z = await w.resolve("@qwik.dev/core/handlers.mjs",
|
|
793
|
+
const z = await w.resolve("@qwik.dev/core/handlers.mjs", E, {
|
|
794
794
|
skipSelf: !0
|
|
795
795
|
});
|
|
796
796
|
if (!z)
|
|
@@ -803,101 +803,100 @@ function Tt(e = {}) {
|
|
|
803
803
|
}
|
|
804
804
|
const $ = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(h)?.groups;
|
|
805
805
|
if ($) {
|
|
806
|
-
const { parent: z, name:
|
|
806
|
+
const { parent: z, name: le, query: he } = $, ie = await w.resolve(z, E, { skipSelf: !0 });
|
|
807
807
|
if (ie) {
|
|
808
|
-
const ee = ie.id.split("?")[0],
|
|
809
|
-
|
|
810
|
-
id:
|
|
808
|
+
const ee = ie.id.split("?")[0], ue = l && E?.endsWith(".html") ? `${ee}_${le}.js` : D;
|
|
809
|
+
M(`resolveId(${I})`, `resolved to QRL ${le} of ${ee}`), u.set(ue, ee), N = {
|
|
810
|
+
id: ue + he,
|
|
811
811
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
812
812
|
moduleSideEffects: !1
|
|
813
813
|
};
|
|
814
814
|
} else
|
|
815
815
|
console.error(`resolveId(${I})`, `QRL parent ${z} does not exist!`);
|
|
816
|
-
} else if (
|
|
817
|
-
const z = u.get(
|
|
816
|
+
} else if (E) {
|
|
817
|
+
const z = u.get(E);
|
|
818
818
|
if (z)
|
|
819
|
-
return
|
|
819
|
+
return M(`resolveId(${I}) end`, `resolving via ${z}`), w.resolve(h, z, { skipSelf: !0 });
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
return
|
|
822
|
+
return M(`resolveId(${I}) end`, N?.id || N), N;
|
|
823
823
|
};
|
|
824
|
-
let
|
|
825
|
-
const
|
|
824
|
+
let W = 0;
|
|
825
|
+
const K = async (w, h, E) => {
|
|
826
826
|
if (h === "\0editor")
|
|
827
827
|
return '"opening in editor"';
|
|
828
828
|
if (oe(h) || h.startsWith("/@fs/"))
|
|
829
829
|
return;
|
|
830
|
-
const
|
|
830
|
+
const C = W++, T = x(w, E);
|
|
831
831
|
if (t.resolveQwikBuild && h === re)
|
|
832
|
-
return
|
|
832
|
+
return M(`load(${C})`, re, t.buildMode), {
|
|
833
833
|
moduleSideEffects: !1,
|
|
834
|
-
code: Z(
|
|
834
|
+
code: Z(T, t.target)
|
|
835
835
|
};
|
|
836
836
|
if (h === se)
|
|
837
|
-
return
|
|
837
|
+
return M(`load(${C})`, se, t.buildMode), {
|
|
838
838
|
moduleSideEffects: !1,
|
|
839
|
-
code: await
|
|
839
|
+
code: await Ue(T)
|
|
840
840
|
};
|
|
841
|
-
if (h ===
|
|
842
|
-
return
|
|
841
|
+
if (h === ve)
|
|
842
|
+
return M(`load(${C})`, ve, t.buildMode), {
|
|
843
843
|
moduleSideEffects: !1,
|
|
844
844
|
code: "export * from '@qwik.dev/core';"
|
|
845
845
|
};
|
|
846
|
-
const I =
|
|
847
|
-
h =
|
|
848
|
-
const B =
|
|
849
|
-
if (
|
|
846
|
+
const I = Be(h);
|
|
847
|
+
h = A(I.pathId);
|
|
848
|
+
const B = T ? o : r;
|
|
849
|
+
if (l && !B.has(h)) {
|
|
850
850
|
const L = u.get(h);
|
|
851
851
|
if (L) {
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
if (
|
|
855
|
-
return
|
|
852
|
+
const D = l.moduleGraph.getModuleById(L);
|
|
853
|
+
if (D) {
|
|
854
|
+
if (M(`load(${C})`, "transforming QRL parent", L), await l.transformRequest(D.url), !B.has(h))
|
|
855
|
+
return M(`load(${C})`, `QRL segment ${h} not found in ${L}`), null;
|
|
856
856
|
} else
|
|
857
|
-
console.error(`load(${
|
|
857
|
+
console.error(`load(${C})`, `module ${L} does not exist in the build graph!`);
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
860
|
const q = B.get(h);
|
|
861
861
|
if (q) {
|
|
862
|
-
|
|
862
|
+
M(`load(${C})`, "Found", h);
|
|
863
863
|
let { code: L } = q[0];
|
|
864
|
-
const { map:
|
|
865
|
-
if (
|
|
866
|
-
const
|
|
864
|
+
const { map: D, segment: N } = q[0], $ = q[1];
|
|
865
|
+
if (l?.hot && $ && t.devTools.hmr) {
|
|
866
|
+
const z = $.startsWith(t.rootDir) ? $.slice(t.rootDir.length) : $;
|
|
867
867
|
L += `
|
|
868
|
-
if (import.meta.hot) {
|
|
869
|
-
import.meta.hot.accept(() => {
|
|
870
|
-
document.dispatchEvent(new CustomEvent(${JSON.stringify(ne)}));
|
|
871
|
-
});
|
|
872
|
-
}`;
|
|
868
|
+
if (import.meta.hot) {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(z)}], t: document.__hmrT}}));});}`;
|
|
873
869
|
}
|
|
874
|
-
return { code: L, map:
|
|
870
|
+
return { code: L, map: D, meta: { segment: N } };
|
|
875
871
|
}
|
|
876
|
-
return
|
|
872
|
+
return M(`load(${C})`, "Not a QRL or virtual module", h), null;
|
|
877
873
|
};
|
|
878
874
|
let R = 0;
|
|
879
|
-
const Y = async function(w, h,
|
|
880
|
-
if (oe(
|
|
875
|
+
const Y = async function(w, h, E, C = {}) {
|
|
876
|
+
if (oe(E))
|
|
881
877
|
return;
|
|
882
|
-
const
|
|
883
|
-
if (B.has(
|
|
878
|
+
const T = R++, I = x(w, C), B = I ? o : r;
|
|
879
|
+
if (B.has(E))
|
|
884
880
|
return;
|
|
885
|
-
const q = d(), L = p(), { pathId:
|
|
881
|
+
const q = d(), L = p(), { pathId: D } = Be(E), N = L.parse(D), $ = N.dir, z = N.base, le = N.ext.toLowerCase(), he = t.target === "lib" ? "lib" : t.buildMode === "development" ? l?.hot && t.devTools.hmr ? "hmr" : "dev" : "prod";
|
|
886
882
|
let ie = !1;
|
|
887
|
-
if (
|
|
883
|
+
if (he !== "lib" && (h = h.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (ee, V) => (ie = !0, t.experimental?.[V] ? "true" : "false"))), le in dn || Dt.test(D)) {
|
|
888
884
|
const ee = t.target === "client" || t.target === "ssr";
|
|
889
|
-
|
|
890
|
-
`transform(${
|
|
891
|
-
`Transforming ${
|
|
885
|
+
M(
|
|
886
|
+
`transform(${T})`,
|
|
887
|
+
`Transforming ${E} (for: ${I ? "server" : "client"}${ee ? ", strip" : ""})`
|
|
892
888
|
);
|
|
893
889
|
let V = z;
|
|
894
|
-
t.srcDir && (V = L.relative(t.srcDir,
|
|
895
|
-
const
|
|
896
|
-
let
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
890
|
+
t.srcDir && (V = L.relative(t.srcDir, D)), V = A(V);
|
|
891
|
+
const ue = t.srcDir ? t.srcDir : A($), qt = t.entryStrategy;
|
|
892
|
+
let ce;
|
|
893
|
+
if (l && (ce = (w.environment?.moduleGraph ?? l.moduleGraph).getModuleById(D)?.url, !ce && t.rootDir)) {
|
|
894
|
+
const ne = A(t.rootDir), ge = A(D);
|
|
895
|
+
ge.startsWith(ne) && (ce = ge.slice(ne.length), ce.startsWith("/") || (ce = "/" + ce));
|
|
896
|
+
}
|
|
897
|
+
const fe = {
|
|
898
|
+
input: [{ code: h, path: V, devPath: ce }],
|
|
899
|
+
entryStrategy: I ? { type: "hoist" } : qt,
|
|
901
900
|
minify: "simplify",
|
|
902
901
|
// Always enable sourcemaps in dev for click-to-source
|
|
903
902
|
sourceMaps: t.sourcemap || t.buildMode === "development",
|
|
@@ -905,88 +904,92 @@ if (import.meta.hot) {
|
|
|
905
904
|
transpileJsx: !0,
|
|
906
905
|
explicitExtensions: !0,
|
|
907
906
|
preserveFilenames: !0,
|
|
908
|
-
srcDir:
|
|
907
|
+
srcDir: ue,
|
|
909
908
|
rootDir: t.rootDir,
|
|
910
|
-
mode:
|
|
909
|
+
mode: he,
|
|
911
910
|
scope: t.scope || void 0,
|
|
912
911
|
isServer: I
|
|
913
912
|
};
|
|
914
|
-
ee && (I ? (
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
const
|
|
918
|
-
f(
|
|
919
|
-
const
|
|
920
|
-
for (const de of
|
|
921
|
-
if (de !==
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
|
|
913
|
+
ee && (I ? (fe.stripCtxName = an, fe.stripEventHandlers = !0, fe.regCtxName = rn) : (fe.stripCtxName = sn, fe.stripExports = on));
|
|
914
|
+
const Lt = Date.now(), me = await q.transformModules(fe);
|
|
915
|
+
M(`transform(${T})`, `done in ${Date.now() - Lt}ms`);
|
|
916
|
+
const Re = me.modules.find((de) => !cn(de));
|
|
917
|
+
f(me.diagnostics, q, ue), I ? me.diagnostics.length === 0 && c && c.lint(w, h, E) : i.set(E, me);
|
|
918
|
+
const Ve = /* @__PURE__ */ new Set();
|
|
919
|
+
for (const de of me.modules)
|
|
920
|
+
if (de !== Re) {
|
|
921
|
+
const ne = A(L.join(ue, de.path));
|
|
922
|
+
if (M(`transform(${T})`, `segment ${ne}`, de.segment.displayName), u.set(ne, E), B.set(ne, [de, E]), Ve.add(ne), l) {
|
|
923
|
+
const ge = l.moduleGraph.getModuleById(ne);
|
|
924
|
+
ge && l.moduleGraph.invalidateModule(ge);
|
|
925
|
+
}
|
|
926
|
+
t.target === "client" && !l && w.emitFile({
|
|
927
|
+
id: ne,
|
|
925
928
|
type: "chunk",
|
|
926
929
|
preserveSignature: "allow-extension"
|
|
927
930
|
});
|
|
928
931
|
}
|
|
929
|
-
return w.addWatchFile(
|
|
930
|
-
code:
|
|
931
|
-
map:
|
|
932
|
+
return w.addWatchFile(E), {
|
|
933
|
+
code: Re.code,
|
|
934
|
+
map: Re.map,
|
|
932
935
|
meta: {
|
|
933
|
-
segment:
|
|
934
|
-
qwikdeps: Array.from(
|
|
936
|
+
segment: Re.segment,
|
|
937
|
+
qwikdeps: Array.from(Ve)
|
|
935
938
|
}
|
|
936
939
|
};
|
|
937
940
|
}
|
|
938
|
-
return
|
|
941
|
+
return M(`transform(${T})`, "Not transforming", E), ie ? { code: h } : null;
|
|
939
942
|
}, J = (w) => {
|
|
940
|
-
const h = [],
|
|
941
|
-
addInjection: (
|
|
943
|
+
const h = [], E = {
|
|
944
|
+
addInjection: (C) => h.push(C)
|
|
942
945
|
};
|
|
943
|
-
return
|
|
944
|
-
const I = d().sys.path, B = I.resolve(t.rootDir, t.outDir, "build"), q = (
|
|
945
|
-
|
|
946
|
-
const L = Array.from(i.values()).flatMap((
|
|
946
|
+
return E.generateManifest = async (C) => {
|
|
947
|
+
const I = d().sys.path, B = I.resolve(t.rootDir, t.outDir, "build"), q = (N) => I.relative(B, I.resolve(t.rootDir, t.outDir, N));
|
|
948
|
+
E.canonPath = q;
|
|
949
|
+
const L = Array.from(i.values()).flatMap((N) => N.modules).map((N) => N.segment).filter((N) => !!N), D = Ht(
|
|
947
950
|
I,
|
|
948
951
|
L,
|
|
949
952
|
h,
|
|
950
953
|
w,
|
|
951
954
|
t,
|
|
952
|
-
|
|
955
|
+
M,
|
|
953
956
|
q
|
|
954
957
|
);
|
|
955
|
-
|
|
956
|
-
for (const
|
|
957
|
-
|
|
958
|
-
for (const
|
|
959
|
-
|
|
960
|
-
return
|
|
961
|
-
},
|
|
962
|
-
}, te = () => t, X = () => Array.from(r.values()).map((w) => w[0]),
|
|
958
|
+
C && Object.assign(D, C);
|
|
959
|
+
for (const N of Object.values(D.symbols))
|
|
960
|
+
N.origin && (N.origin = A(N.origin));
|
|
961
|
+
for (const N of Object.values(D.bundles))
|
|
962
|
+
N.origins && (N.origins = N.origins.sort());
|
|
963
|
+
return D.manifestHash = Ut(JSON.stringify(D)), D;
|
|
964
|
+
}, E;
|
|
965
|
+
}, te = () => t, X = () => Array.from(r.values()).map((w) => w[0]), M = (...w) => {
|
|
963
966
|
t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ...w);
|
|
964
|
-
},
|
|
967
|
+
}, pe = (...w) => {
|
|
965
968
|
console.log(`[QWIK PLUGIN: ${n}]`, ...w);
|
|
966
969
|
}, F = (w) => {
|
|
967
970
|
f = w;
|
|
968
|
-
},
|
|
971
|
+
}, A = (w) => g(w);
|
|
969
972
|
function Z(w, h) {
|
|
970
|
-
const
|
|
973
|
+
const E = t.buildMode === "development";
|
|
971
974
|
return `// @qwik.dev/core/build
|
|
972
975
|
export const isServer = ${JSON.stringify(w)};
|
|
973
976
|
export const isBrowser = ${JSON.stringify(!w)};
|
|
974
|
-
export const isDev = ${JSON.stringify(
|
|
977
|
+
export const isDev = ${JSON.stringify(E)};
|
|
975
978
|
`;
|
|
976
979
|
}
|
|
977
|
-
async function
|
|
980
|
+
async function Ue(w) {
|
|
978
981
|
if (!t.manifestInput && t.target === "ssr" && t.buildMode === "production" && m) {
|
|
979
|
-
const
|
|
980
|
-
let
|
|
981
|
-
await m.promises.stat(
|
|
982
|
+
const C = p();
|
|
983
|
+
let T = t.manifestInputPath || C.resolve(t.clientOutDir, Ge);
|
|
984
|
+
await m.promises.stat(T).catch(() => !1) || (T = C.resolve(t.rootDir, at, Ge));
|
|
982
985
|
try {
|
|
983
|
-
const I = await m.promises.readFile(
|
|
984
|
-
t.manifestInput =
|
|
986
|
+
const I = await m.promises.readFile(T, "utf-8");
|
|
987
|
+
t.manifestInput = tt(JSON.parse(I)) || null, console.info("Read client manifest from", T);
|
|
985
988
|
} catch (I) {
|
|
986
989
|
console.warn(
|
|
987
990
|
`
|
|
988
991
|
==========
|
|
989
|
-
Could not read Qwik client manifest ${
|
|
992
|
+
Could not read Qwik client manifest ${T}.
|
|
990
993
|
Make sure you provide it to the qwikVite plugin via the \`manifestInput\` \`manifestInputPath\` arguments, or to the SSR renderer via the \`manifest\` argument, or define it in \`globalThis.__QWIK_MANIFEST__\` before the server bundle is loaded, or embed it in the server bundle by replacing \`globalThis.__QWIK_MANIFEST__\`.
|
|
991
994
|
Without the manifest, the SSR renderer will not be able to generate event handlers.
|
|
992
995
|
(${I})
|
|
@@ -996,8 +999,8 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
996
999
|
}
|
|
997
1000
|
}
|
|
998
1001
|
const h = w ? t.manifestInput : null;
|
|
999
|
-
let
|
|
1000
|
-
return h?.manifestHash && (
|
|
1002
|
+
let E = null;
|
|
1003
|
+
return h?.manifestHash && (E = {
|
|
1001
1004
|
manifestHash: h.manifestHash,
|
|
1002
1005
|
core: h.core,
|
|
1003
1006
|
preloader: h.preloader,
|
|
@@ -1007,30 +1010,30 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1007
1010
|
mapping: h.mapping,
|
|
1008
1011
|
bundleGraph: h.bundleGraph
|
|
1009
1012
|
}), `// @qwik-client-manifest
|
|
1010
|
-
export const manifest = ${
|
|
1013
|
+
export const manifest = ${E ? JSON.stringify(E) : "globalThis.__QWIK_MANIFEST__"};
|
|
1011
1014
|
`;
|
|
1012
1015
|
}
|
|
1013
|
-
function
|
|
1016
|
+
function Nt(w) {
|
|
1014
1017
|
t.sourcemap = w;
|
|
1015
1018
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
for (const
|
|
1021
|
-
const { id: I } =
|
|
1019
|
+
function Mt(w, h) {
|
|
1020
|
+
const E = w.name === "ssr";
|
|
1021
|
+
M("hotUpdate()", h.file, w.name);
|
|
1022
|
+
const C = E ? o : r;
|
|
1023
|
+
for (const T of h.modules) {
|
|
1024
|
+
const { id: I } = T;
|
|
1022
1025
|
if (I) {
|
|
1023
|
-
|
|
1024
|
-
for (const [B, [q, L]] of
|
|
1026
|
+
M("hotUpdate()", `invalidate ${I}`), i.delete(I);
|
|
1027
|
+
for (const [B, [q, L]] of C)
|
|
1025
1028
|
if (L === I) {
|
|
1026
|
-
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1029
|
+
M("hotUpdate()", `invalidate ${I} segment ${B}`), C.delete(B);
|
|
1030
|
+
const D = w.moduleGraph.getModuleById(B);
|
|
1031
|
+
D && w.moduleGraph.invalidateModule(D);
|
|
1029
1032
|
}
|
|
1030
1033
|
}
|
|
1031
1034
|
}
|
|
1032
1035
|
}
|
|
1033
|
-
const
|
|
1036
|
+
const Ot = (w, { getModuleInfo: h }) => {
|
|
1034
1037
|
if (t.target === "client") {
|
|
1035
1038
|
if (
|
|
1036
1039
|
// The preloader has to stay in a separate chunk if it's a client build
|
|
@@ -1046,28 +1049,28 @@ export const manifest = ${S ? JSON.stringify(S) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1046
1049
|
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(w))
|
|
1047
1050
|
return "qwik-loader";
|
|
1048
1051
|
}
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1051
|
-
const
|
|
1052
|
-
if (
|
|
1053
|
-
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(
|
|
1052
|
+
const E = h(w);
|
|
1053
|
+
if (E) {
|
|
1054
|
+
const C = E.meta.segment;
|
|
1055
|
+
if (C) {
|
|
1056
|
+
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(C.ctxName))
|
|
1054
1057
|
return null;
|
|
1055
|
-
const { hash:
|
|
1058
|
+
const { hash: T } = C, I = t.entryStrategy.manual?.[T] || C.entry;
|
|
1056
1059
|
if (I)
|
|
1057
1060
|
return I;
|
|
1058
1061
|
}
|
|
1059
1062
|
}
|
|
1060
1063
|
return null;
|
|
1061
1064
|
};
|
|
1062
|
-
async function
|
|
1063
|
-
const I = await J(h).generateManifest(
|
|
1065
|
+
async function jt(w, h, E, C) {
|
|
1066
|
+
const I = await J(h).generateManifest(C);
|
|
1064
1067
|
I.platform = {
|
|
1065
|
-
...
|
|
1068
|
+
...C?.platform,
|
|
1066
1069
|
rollup: w.meta?.rollupVersion || "",
|
|
1067
1070
|
env: k.sys.env,
|
|
1068
1071
|
os: k.sys.os
|
|
1069
1072
|
}, k.sys.env === "node" && (I.platform.node = process.versions.node);
|
|
1070
|
-
const B =
|
|
1073
|
+
const B = Qt(I, E), q = w.emitFile({
|
|
1071
1074
|
type: "asset",
|
|
1072
1075
|
name: "bundle-graph.json",
|
|
1073
1076
|
source: JSON.stringify(B)
|
|
@@ -1076,15 +1079,15 @@ export const manifest = ${S ? JSON.stringify(S) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1076
1079
|
name: "bundle-graph.json",
|
|
1077
1080
|
size: B.length
|
|
1078
1081
|
};
|
|
1079
|
-
const
|
|
1082
|
+
const D = JSON.stringify(I, null, " ");
|
|
1080
1083
|
w.emitFile({
|
|
1081
|
-
fileName:
|
|
1084
|
+
fileName: Ge,
|
|
1082
1085
|
type: "asset",
|
|
1083
|
-
source:
|
|
1086
|
+
source: D
|
|
1084
1087
|
}), typeof t.manifestOutput == "function" && await t.manifestOutput(I), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(X());
|
|
1085
1088
|
}
|
|
1086
1089
|
return {
|
|
1087
|
-
buildStart:
|
|
1090
|
+
buildStart: S,
|
|
1088
1091
|
createOutputAnalyzer: J,
|
|
1089
1092
|
getQwikBuildModule: Z,
|
|
1090
1093
|
getOptimizer: d,
|
|
@@ -1093,32 +1096,32 @@ export const manifest = ${S ? JSON.stringify(S) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1093
1096
|
getSys: s,
|
|
1094
1097
|
getTransformedOutputs: X,
|
|
1095
1098
|
init: v,
|
|
1096
|
-
load:
|
|
1097
|
-
debug:
|
|
1098
|
-
log:
|
|
1099
|
-
normalizeOptions:
|
|
1100
|
-
normalizePath:
|
|
1099
|
+
load: K,
|
|
1100
|
+
debug: M,
|
|
1101
|
+
log: pe,
|
|
1102
|
+
normalizeOptions: O,
|
|
1103
|
+
normalizePath: A,
|
|
1101
1104
|
onDiagnostics: F,
|
|
1102
|
-
resolveId:
|
|
1105
|
+
resolveId: P,
|
|
1103
1106
|
transform: Y,
|
|
1104
|
-
validateSource:
|
|
1105
|
-
setSourceMapSupport:
|
|
1107
|
+
validateSource: j,
|
|
1108
|
+
setSourceMapSupport: Nt,
|
|
1106
1109
|
configureServer: y,
|
|
1107
|
-
hotUpdate:
|
|
1108
|
-
manualChunks:
|
|
1109
|
-
generateManifest:
|
|
1110
|
+
hotUpdate: Mt,
|
|
1111
|
+
manualChunks: Ot,
|
|
1112
|
+
generateManifest: jt
|
|
1110
1113
|
};
|
|
1111
1114
|
}
|
|
1112
|
-
const
|
|
1113
|
-
function
|
|
1115
|
+
const ln = (e) => (n) => typeof n == "string" ? nn(e.os) ? (n.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(n) || (n = n.replace(/\\/g, "/")), e.path.posix.normalize(n)) : e.path.normalize(n) : n;
|
|
1116
|
+
function cn(e) {
|
|
1114
1117
|
return e.isEntry || e.segment;
|
|
1115
1118
|
}
|
|
1116
|
-
const
|
|
1119
|
+
const dn = {
|
|
1117
1120
|
".jsx": !0,
|
|
1118
1121
|
".ts": !0,
|
|
1119
1122
|
".tsx": !0
|
|
1120
|
-
},
|
|
1121
|
-
async function
|
|
1123
|
+
}, Dt = /\.qwik\.[mc]?js$/, qe = "@qwik.dev/core", Le = "@qwik.dev/core/internal", re = "@qwik.dev/core/build", Je = "@qwik.dev/core/jsx-runtime", Ye = "@qwik.dev/core/jsx-dev-runtime", Fe = "@qwik.dev/core/server", se = "@qwik-client-manifest", He = "@qwik.dev/core/preloader", ve = "@qwik-handlers", un = "src", at = "dist", fn = "server", pn = "lib", Ge = "q-manifest.json";
|
|
1124
|
+
async function hn(e, n, i) {
|
|
1122
1125
|
if (e.env === "browsermain" || e.env === "webworker")
|
|
1123
1126
|
return;
|
|
1124
1127
|
const r = await e.dynamicImport("node:fs");
|
|
@@ -1135,8 +1138,8 @@ async function pn(e, n, i) {
|
|
|
1135
1138
|
o = a;
|
|
1136
1139
|
}
|
|
1137
1140
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const n =
|
|
1141
|
+
function Ur(e = {}) {
|
|
1142
|
+
const n = Ct(e.optimizerOptions);
|
|
1140
1143
|
return {
|
|
1141
1144
|
name: "rollup-plugin-qwik",
|
|
1142
1145
|
api: {
|
|
@@ -1146,8 +1149,8 @@ function Lr(e = {}) {
|
|
|
1146
1149
|
async options(r) {
|
|
1147
1150
|
await n.init();
|
|
1148
1151
|
const o = r.onwarn;
|
|
1149
|
-
r.onwarn = (
|
|
1150
|
-
|
|
1152
|
+
r.onwarn = (c, f) => {
|
|
1153
|
+
c.plugin === "typescript" && c.message.includes("outputToFilesystem") || (o ? o(c, f) : f(c));
|
|
1151
1154
|
};
|
|
1152
1155
|
const u = {
|
|
1153
1156
|
csr: e.csr,
|
|
@@ -1172,13 +1175,13 @@ function Lr(e = {}) {
|
|
|
1172
1175
|
return r.input = a, r;
|
|
1173
1176
|
},
|
|
1174
1177
|
outputOptions(r) {
|
|
1175
|
-
return
|
|
1178
|
+
return Xe(n, r, !1);
|
|
1176
1179
|
},
|
|
1177
1180
|
async buildStart() {
|
|
1178
1181
|
n.onDiagnostics((r, o, u) => {
|
|
1179
1182
|
r.forEach((a) => {
|
|
1180
|
-
const
|
|
1181
|
-
a.category === "error" ? this.error(
|
|
1183
|
+
const c = n.normalizePath(o.sys.path.join(u, a.file));
|
|
1184
|
+
a.category === "error" ? this.error(ze(c, a)) : this.warn(ze(c, a));
|
|
1182
1185
|
});
|
|
1183
1186
|
}), await n.buildStart(this);
|
|
1184
1187
|
},
|
|
@@ -1196,18 +1199,18 @@ function Lr(e = {}) {
|
|
|
1196
1199
|
}
|
|
1197
1200
|
};
|
|
1198
1201
|
}
|
|
1199
|
-
async function
|
|
1202
|
+
async function mn(e, n, i, r) {
|
|
1200
1203
|
return Array.isArray(n) ? (n.length || n.push({}), await Promise.all(
|
|
1201
1204
|
n.map(async (o) => ({
|
|
1202
|
-
...await
|
|
1205
|
+
...await Xe(e, o, i),
|
|
1203
1206
|
dir: r || o.dir
|
|
1204
1207
|
}))
|
|
1205
1208
|
)) : {
|
|
1206
|
-
...await
|
|
1209
|
+
...await Xe(e, n, i),
|
|
1207
1210
|
dir: r || n?.dir
|
|
1208
1211
|
};
|
|
1209
1212
|
}
|
|
1210
|
-
const
|
|
1213
|
+
const gn = (e, n, i) => n.buildMode === "production" && !n.debug ? `${e}build/q-[hash].js` : (r) => {
|
|
1211
1214
|
if (r.moduleIds?.some((a) => /core\.(prod|min)\.mjs$/.test(a)))
|
|
1212
1215
|
return `${e}build/core.js`;
|
|
1213
1216
|
if (r.moduleIds?.some((a) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(a)))
|
|
@@ -1215,20 +1218,20 @@ const mn = (e, n, i) => n.buildMode === "production" && !n.debug ? `${e}build/q-
|
|
|
1215
1218
|
const u = i.sys.path.relative(i.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
1216
1219
|
return `${e}build/${u}.js`;
|
|
1217
1220
|
};
|
|
1218
|
-
async function
|
|
1221
|
+
async function Xe(e, n, i) {
|
|
1219
1222
|
const r = { ...n }, o = e.getOptions(), u = e.getOptimizer(), a = e.manualChunks;
|
|
1220
1223
|
r.assetFileNames || (r.assetFileNames = `${i ? `${o.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
|
|
1221
|
-
const
|
|
1224
|
+
const c = gn(i ? `${o.assetsDir}` : "", o, u);
|
|
1222
1225
|
if (o.target === "client") {
|
|
1223
|
-
r.entryFileNames || (r.entryFileNames =
|
|
1226
|
+
r.entryFileNames || (r.entryFileNames = c), r.chunkFileNames || (r.chunkFileNames = c), r.format = "es";
|
|
1224
1227
|
const t = r.manualChunks;
|
|
1225
1228
|
if (t && typeof t != "function")
|
|
1226
1229
|
throw new Error("manualChunks must be a function");
|
|
1227
1230
|
r.manualChunks = t ? (g, m) => t(g, m) || a(g, m) : a;
|
|
1228
1231
|
} else
|
|
1229
|
-
r.chunkFileNames || (r.chunkFileNames =
|
|
1232
|
+
r.chunkFileNames || (r.chunkFileNames = c);
|
|
1230
1233
|
r.dir || (r.dir = o.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
1231
|
-
const f = await
|
|
1234
|
+
const f = await hn(u.sys, "rollup", u.sys.cwd());
|
|
1232
1235
|
if (f)
|
|
1233
1236
|
try {
|
|
1234
1237
|
const g = await (await u.sys.dynamicImport("node:fs")).promises.readFile(f, "utf-8"), m = JSON.parse(g), v = String(m?.version || ""), [d, s, p] = v.split(".").map((y) => parseInt(y, 10));
|
|
@@ -1239,7 +1242,7 @@ async function Je(e, n, i) {
|
|
|
1239
1242
|
}
|
|
1240
1243
|
return r;
|
|
1241
1244
|
}
|
|
1242
|
-
function
|
|
1245
|
+
function ze(e, n) {
|
|
1243
1246
|
const i = n.highlights?.[0];
|
|
1244
1247
|
return Object.assign(new Error(n.message), {
|
|
1245
1248
|
id: e,
|
|
@@ -1251,7 +1254,7 @@ function Fe(e, n) {
|
|
|
1251
1254
|
stack: ""
|
|
1252
1255
|
});
|
|
1253
1256
|
}
|
|
1254
|
-
const gn = `"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'"))`, vn = '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)}', yn = `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)})}`, bn = '[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}', wn = '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)}', xn = `<style>
|
|
1257
|
+
const vn = `"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'"))`, yn = '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}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{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)}', bn = `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)})}`, wn = '[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}', xn = '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)}', In = `<style>
|
|
1255
1258
|
:host {
|
|
1256
1259
|
position: absolute;
|
|
1257
1260
|
border: 1px solid red;
|
|
@@ -1415,32 +1418,32 @@ const gn = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
1415
1418
|
<p class="action-container"></p>
|
|
1416
1419
|
</div>
|
|
1417
1420
|
</dialog>
|
|
1418
|
-
`,
|
|
1419
|
-
async function
|
|
1420
|
-
const o = await i.dynamicImport("node:fs"), u = await i.dynamicImport("node:url"),
|
|
1421
|
+
`, Sn = `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}`, En = "#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;-webkit-backdrop-filter:blur(4px);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}}";
|
|
1422
|
+
async function kn(e, n, i, r) {
|
|
1423
|
+
const o = await i.dynamicImport("node:fs"), u = await i.dynamicImport("node:url"), c = ["mjs", "cjs", "js"].map(
|
|
1421
1424
|
(f) => r.join(n, `entry.preview.${f}`)
|
|
1422
1425
|
).find((f) => o.existsSync(f));
|
|
1423
|
-
if (!
|
|
1424
|
-
return
|
|
1426
|
+
if (!c)
|
|
1427
|
+
return We(
|
|
1425
1428
|
e,
|
|
1426
1429
|
`Unable to find output "${n}/entry.preview" module.
|
|
1427
1430
|
|
|
1428
1431
|
Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
|
|
1429
1432
|
);
|
|
1430
1433
|
try {
|
|
1431
|
-
const f = u.pathToFileURL(
|
|
1434
|
+
const f = u.pathToFileURL(c).href, t = await i.strictDynamicImport(f);
|
|
1432
1435
|
let g = null, m = null;
|
|
1433
1436
|
if (t.default && (typeof t.default == "function" ? g = t.default : typeof t.default == "object" && (g = t.default.router, m = t.default.notFound)), typeof g != "function")
|
|
1434
|
-
return
|
|
1437
|
+
return We(
|
|
1435
1438
|
e,
|
|
1436
|
-
`Entry preview module "${
|
|
1439
|
+
`Entry preview module "${c}" does not export a default middleware function`
|
|
1437
1440
|
);
|
|
1438
1441
|
e.use(g), typeof m == "function" && e.use(m);
|
|
1439
1442
|
} catch (f) {
|
|
1440
|
-
return
|
|
1443
|
+
return We(e, String(f));
|
|
1441
1444
|
}
|
|
1442
1445
|
}
|
|
1443
|
-
function
|
|
1446
|
+
function We(e, n) {
|
|
1444
1447
|
console.log(`
|
|
1445
1448
|
❌ ${n}
|
|
1446
1449
|
`), e.use((i, r) => {
|
|
@@ -1449,25 +1452,25 @@ function He(e, n) {
|
|
|
1449
1452
|
}), r.end(n);
|
|
1450
1453
|
});
|
|
1451
1454
|
}
|
|
1452
|
-
const
|
|
1455
|
+
const _n = (e, n) => {
|
|
1453
1456
|
const i = [
|
|
1454
|
-
{ tag: "style", children:
|
|
1457
|
+
{ tag: "style", children: Sn, injectTo: "body" },
|
|
1455
1458
|
{ tag: "style", children: En, injectTo: "body" },
|
|
1456
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
1457
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
1459
|
+
{ tag: "script", attrs: { type: "module" }, children: bn, injectTo: "body" },
|
|
1460
|
+
{ tag: "script", attrs: { type: "module" }, children: vn, injectTo: "body" }
|
|
1458
1461
|
];
|
|
1459
1462
|
if ((e.devTools?.imageDevTools ?? !0) && i.push(
|
|
1460
1463
|
{
|
|
1461
1464
|
tag: "style",
|
|
1462
|
-
children:
|
|
1465
|
+
children: wn,
|
|
1463
1466
|
injectTo: "body"
|
|
1464
1467
|
},
|
|
1465
1468
|
{
|
|
1466
1469
|
tag: "script",
|
|
1467
1470
|
attrs: { type: "module" },
|
|
1468
|
-
children:
|
|
1471
|
+
children: xn.replace(
|
|
1469
1472
|
"globalThis.__TEMPLATE__",
|
|
1470
|
-
JSON.stringify(
|
|
1473
|
+
JSON.stringify(In)
|
|
1471
1474
|
),
|
|
1472
1475
|
injectTo: "body"
|
|
1473
1476
|
}
|
|
@@ -1476,39 +1479,39 @@ const kn = (e, n) => {
|
|
|
1476
1479
|
n.endsWith("/") && (n = n.slice(0, -1)), i.push({
|
|
1477
1480
|
tag: "script",
|
|
1478
1481
|
attrs: { type: "module" },
|
|
1479
|
-
children:
|
|
1482
|
+
children: yn.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(n)),
|
|
1480
1483
|
injectTo: "body"
|
|
1481
1484
|
});
|
|
1482
1485
|
}
|
|
1483
1486
|
return i;
|
|
1484
1487
|
};
|
|
1485
|
-
function
|
|
1488
|
+
function H(e) {
|
|
1486
1489
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1487
1490
|
}
|
|
1488
|
-
var
|
|
1489
|
-
function
|
|
1490
|
-
return
|
|
1491
|
+
var ye = {}, Ke = {}, lt;
|
|
1492
|
+
function G() {
|
|
1493
|
+
return lt || (lt = 1, (function(e) {
|
|
1491
1494
|
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;
|
|
1492
|
-
const n = new TextDecoder(), i = (p,
|
|
1495
|
+
const n = new TextDecoder(), i = (p, l = 0, y = p.length) => n.decode(p.slice(l, y));
|
|
1493
1496
|
e.toUTF8String = i;
|
|
1494
|
-
const r = (p,
|
|
1497
|
+
const r = (p, l = 0, y = p.length) => p.slice(l, y).reduce((O, Q) => O + ("0" + Q.toString(16)).slice(-2), "");
|
|
1495
1498
|
e.toHexString = r;
|
|
1496
|
-
const o = (p,
|
|
1497
|
-
const y = p[
|
|
1499
|
+
const o = (p, l = 0) => {
|
|
1500
|
+
const y = p[l] + p[l + 1] * 256;
|
|
1498
1501
|
return y | (y & 2 ** 15) * 131070;
|
|
1499
1502
|
};
|
|
1500
1503
|
e.readInt16LE = o;
|
|
1501
|
-
const u = (p,
|
|
1504
|
+
const u = (p, l = 0) => p[l] * 2 ** 8 + p[l + 1];
|
|
1502
1505
|
e.readUInt16BE = u;
|
|
1503
|
-
const a = (p,
|
|
1506
|
+
const a = (p, l = 0) => p[l] + p[l + 1] * 2 ** 8;
|
|
1504
1507
|
e.readUInt16LE = a;
|
|
1505
|
-
const
|
|
1506
|
-
e.readUInt24LE =
|
|
1507
|
-
const f = (p,
|
|
1508
|
+
const c = (p, l = 0) => p[l] + p[l + 1] * 2 ** 8 + p[l + 2] * 2 ** 16;
|
|
1509
|
+
e.readUInt24LE = c;
|
|
1510
|
+
const f = (p, l = 0) => p[l] + p[l + 1] * 2 ** 8 + p[l + 2] * 2 ** 16 + (p[l + 3] << 24);
|
|
1508
1511
|
e.readInt32LE = f;
|
|
1509
|
-
const t = (p,
|
|
1512
|
+
const t = (p, l = 0) => p[l] * 2 ** 24 + p[l + 1] * 2 ** 16 + p[l + 2] * 2 ** 8 + p[l + 3];
|
|
1510
1513
|
e.readUInt32BE = t;
|
|
1511
|
-
const g = (p,
|
|
1514
|
+
const g = (p, l = 0) => p[l] + p[l + 1] * 2 ** 8 + p[l + 2] * 2 ** 16 + p[l + 3] * 2 ** 24;
|
|
1512
1515
|
e.readUInt32LE = g;
|
|
1513
1516
|
const m = {
|
|
1514
1517
|
readUInt16BE: e.readUInt16BE,
|
|
@@ -1516,78 +1519,78 @@ function H() {
|
|
|
1516
1519
|
readUInt32BE: e.readUInt32BE,
|
|
1517
1520
|
readUInt32LE: e.readUInt32LE
|
|
1518
1521
|
};
|
|
1519
|
-
function v(p,
|
|
1522
|
+
function v(p, l, y, O) {
|
|
1520
1523
|
y = y || 0;
|
|
1521
|
-
const
|
|
1522
|
-
return m[
|
|
1524
|
+
const Q = O ? "BE" : "LE", j = "readUInt" + l + Q;
|
|
1525
|
+
return m[j](p, y);
|
|
1523
1526
|
}
|
|
1524
1527
|
e.readUInt = v;
|
|
1525
|
-
function d(p,
|
|
1526
|
-
if (p.length -
|
|
1528
|
+
function d(p, l) {
|
|
1529
|
+
if (p.length - l < 4)
|
|
1527
1530
|
return;
|
|
1528
|
-
const y = (0, e.readUInt32BE)(p,
|
|
1529
|
-
if (!(p.length -
|
|
1531
|
+
const y = (0, e.readUInt32BE)(p, l);
|
|
1532
|
+
if (!(p.length - l < y))
|
|
1530
1533
|
return {
|
|
1531
|
-
name: (0, e.toUTF8String)(p, 4 +
|
|
1532
|
-
offset:
|
|
1534
|
+
name: (0, e.toUTF8String)(p, 4 + l, 8 + l),
|
|
1535
|
+
offset: l,
|
|
1533
1536
|
size: y
|
|
1534
1537
|
};
|
|
1535
1538
|
}
|
|
1536
|
-
function s(p,
|
|
1539
|
+
function s(p, l, y) {
|
|
1537
1540
|
for (; y < p.length; ) {
|
|
1538
|
-
const
|
|
1539
|
-
if (!
|
|
1541
|
+
const O = d(p, y);
|
|
1542
|
+
if (!O)
|
|
1540
1543
|
break;
|
|
1541
|
-
if (
|
|
1542
|
-
return
|
|
1543
|
-
y +=
|
|
1544
|
+
if (O.name === l)
|
|
1545
|
+
return O;
|
|
1546
|
+
y += O.size > 0 ? O.size : 8;
|
|
1544
1547
|
}
|
|
1545
1548
|
}
|
|
1546
1549
|
e.findBox = s;
|
|
1547
|
-
})(
|
|
1550
|
+
})(Ke)), Ke;
|
|
1548
1551
|
}
|
|
1549
|
-
var
|
|
1550
|
-
function
|
|
1551
|
-
if (
|
|
1552
|
-
|
|
1553
|
-
const e =
|
|
1554
|
-
return
|
|
1552
|
+
var ct;
|
|
1553
|
+
function Tn() {
|
|
1554
|
+
if (ct) return ye;
|
|
1555
|
+
ct = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.BMP = void 0;
|
|
1556
|
+
const e = G();
|
|
1557
|
+
return ye.BMP = {
|
|
1555
1558
|
validate: (n) => (0, e.toUTF8String)(n, 0, 2) === "BM",
|
|
1556
1559
|
calculate: (n) => ({
|
|
1557
1560
|
height: Math.abs((0, e.readInt32LE)(n, 22)),
|
|
1558
1561
|
width: (0, e.readUInt32LE)(n, 18)
|
|
1559
1562
|
})
|
|
1560
|
-
},
|
|
1563
|
+
}, ye;
|
|
1561
1564
|
}
|
|
1562
|
-
var
|
|
1563
|
-
const
|
|
1564
|
-
var
|
|
1565
|
+
var Cn = Tn();
|
|
1566
|
+
const Dn = /* @__PURE__ */ H(Cn);
|
|
1567
|
+
var be = {}, we = {}, dt;
|
|
1565
1568
|
function Pt() {
|
|
1566
|
-
if (
|
|
1567
|
-
|
|
1568
|
-
const e =
|
|
1569
|
-
function o(a,
|
|
1570
|
-
const f = a[
|
|
1569
|
+
if (dt) return we;
|
|
1570
|
+
dt = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.ICO = void 0;
|
|
1571
|
+
const e = G(), n = 1, i = 6, r = 16;
|
|
1572
|
+
function o(a, c) {
|
|
1573
|
+
const f = a[c];
|
|
1571
1574
|
return f === 0 ? 256 : f;
|
|
1572
1575
|
}
|
|
1573
|
-
function u(a,
|
|
1574
|
-
const f = i +
|
|
1576
|
+
function u(a, c) {
|
|
1577
|
+
const f = i + c * r;
|
|
1575
1578
|
return {
|
|
1576
1579
|
height: o(a, f + 1),
|
|
1577
1580
|
width: o(a, f)
|
|
1578
1581
|
};
|
|
1579
1582
|
}
|
|
1580
|
-
return
|
|
1583
|
+
return we.ICO = {
|
|
1581
1584
|
validate(a) {
|
|
1582
|
-
const
|
|
1583
|
-
return
|
|
1585
|
+
const c = (0, e.readUInt16LE)(a, 0), f = (0, e.readUInt16LE)(a, 4);
|
|
1586
|
+
return c !== 0 || f === 0 ? !1 : (0, e.readUInt16LE)(a, 2) === n;
|
|
1584
1587
|
},
|
|
1585
1588
|
calculate(a) {
|
|
1586
|
-
const
|
|
1587
|
-
if (
|
|
1589
|
+
const c = (0, e.readUInt16LE)(a, 4), f = u(a, 0);
|
|
1590
|
+
if (c === 1)
|
|
1588
1591
|
return f;
|
|
1589
1592
|
const t = [f];
|
|
1590
|
-
for (let g = 1; g <
|
|
1593
|
+
for (let g = 1; g < c; g += 1)
|
|
1591
1594
|
t.push(u(a, g));
|
|
1592
1595
|
return {
|
|
1593
1596
|
height: f.height,
|
|
@@ -1595,58 +1598,58 @@ function Pt() {
|
|
|
1595
1598
|
width: f.width
|
|
1596
1599
|
};
|
|
1597
1600
|
}
|
|
1598
|
-
},
|
|
1601
|
+
}, we;
|
|
1599
1602
|
}
|
|
1600
|
-
var
|
|
1603
|
+
var ut;
|
|
1601
1604
|
function Pn() {
|
|
1602
|
-
if (
|
|
1603
|
-
|
|
1604
|
-
const e = Pt(), n =
|
|
1605
|
-
return
|
|
1605
|
+
if (ut) return be;
|
|
1606
|
+
ut = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.CUR = void 0;
|
|
1607
|
+
const e = Pt(), n = G(), i = 2;
|
|
1608
|
+
return be.CUR = {
|
|
1606
1609
|
validate(r) {
|
|
1607
1610
|
const o = (0, n.readUInt16LE)(r, 0), u = (0, n.readUInt16LE)(r, 4);
|
|
1608
1611
|
return o !== 0 || u === 0 ? !1 : (0, n.readUInt16LE)(r, 2) === i;
|
|
1609
1612
|
},
|
|
1610
1613
|
calculate: (r) => e.ICO.calculate(r)
|
|
1611
|
-
},
|
|
1614
|
+
}, be;
|
|
1612
1615
|
}
|
|
1613
|
-
var
|
|
1614
|
-
const
|
|
1615
|
-
var
|
|
1616
|
-
function
|
|
1617
|
-
if (
|
|
1618
|
-
|
|
1619
|
-
const e =
|
|
1620
|
-
return
|
|
1616
|
+
var Nn = Pn();
|
|
1617
|
+
const Mn = /* @__PURE__ */ H(Nn);
|
|
1618
|
+
var xe = {}, ft;
|
|
1619
|
+
function On() {
|
|
1620
|
+
if (ft) return xe;
|
|
1621
|
+
ft = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.DDS = void 0;
|
|
1622
|
+
const e = G();
|
|
1623
|
+
return xe.DDS = {
|
|
1621
1624
|
validate: (n) => (0, e.readUInt32LE)(n, 0) === 542327876,
|
|
1622
1625
|
calculate: (n) => ({
|
|
1623
1626
|
height: (0, e.readUInt32LE)(n, 12),
|
|
1624
1627
|
width: (0, e.readUInt32LE)(n, 16)
|
|
1625
1628
|
})
|
|
1626
|
-
},
|
|
1629
|
+
}, xe;
|
|
1627
1630
|
}
|
|
1628
|
-
var
|
|
1629
|
-
const
|
|
1630
|
-
var
|
|
1631
|
-
function
|
|
1632
|
-
if (
|
|
1633
|
-
|
|
1634
|
-
const e =
|
|
1635
|
-
return
|
|
1631
|
+
var jn = On();
|
|
1632
|
+
const qn = /* @__PURE__ */ H(jn);
|
|
1633
|
+
var Ie = {}, pt;
|
|
1634
|
+
function Ln() {
|
|
1635
|
+
if (pt) return Ie;
|
|
1636
|
+
pt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.GIF = void 0;
|
|
1637
|
+
const e = G(), n = /^GIF8[79]a/;
|
|
1638
|
+
return Ie.GIF = {
|
|
1636
1639
|
validate: (i) => n.test((0, e.toUTF8String)(i, 0, 6)),
|
|
1637
1640
|
calculate: (i) => ({
|
|
1638
1641
|
height: (0, e.readUInt16LE)(i, 8),
|
|
1639
1642
|
width: (0, e.readUInt16LE)(i, 6)
|
|
1640
1643
|
})
|
|
1641
|
-
},
|
|
1644
|
+
}, Ie;
|
|
1642
1645
|
}
|
|
1643
|
-
var
|
|
1644
|
-
const
|
|
1645
|
-
var
|
|
1646
|
-
function
|
|
1647
|
-
if (
|
|
1648
|
-
|
|
1649
|
-
const e =
|
|
1646
|
+
var Un = Ln();
|
|
1647
|
+
const Rn = /* @__PURE__ */ H(Un);
|
|
1648
|
+
var Se = {}, ht;
|
|
1649
|
+
function Bn() {
|
|
1650
|
+
if (ht) return Se;
|
|
1651
|
+
ht = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.ICNS = void 0;
|
|
1652
|
+
const e = G(), n = 8, i = 4, r = 4, o = {
|
|
1650
1653
|
ICON: 32,
|
|
1651
1654
|
"ICN#": 32,
|
|
1652
1655
|
// m => 16 x 16
|
|
@@ -1688,22 +1691,22 @@ function Rn() {
|
|
|
1688
1691
|
// . => 1024 x 1024
|
|
1689
1692
|
ic10: 1024
|
|
1690
1693
|
};
|
|
1691
|
-
function u(
|
|
1694
|
+
function u(c, f) {
|
|
1692
1695
|
const t = f + r;
|
|
1693
1696
|
return [
|
|
1694
|
-
(0, e.toUTF8String)(
|
|
1695
|
-
(0, e.readUInt32BE)(
|
|
1697
|
+
(0, e.toUTF8String)(c, f, t),
|
|
1698
|
+
(0, e.readUInt32BE)(c, t)
|
|
1696
1699
|
];
|
|
1697
1700
|
}
|
|
1698
|
-
function a(
|
|
1699
|
-
const f = o[
|
|
1700
|
-
return { width: f, height: f, type:
|
|
1701
|
+
function a(c) {
|
|
1702
|
+
const f = o[c];
|
|
1703
|
+
return { width: f, height: f, type: c };
|
|
1701
1704
|
}
|
|
1702
|
-
return
|
|
1703
|
-
validate: (
|
|
1704
|
-
calculate(
|
|
1705
|
-
const f =
|
|
1706
|
-
let g = n, m = u(
|
|
1705
|
+
return Se.ICNS = {
|
|
1706
|
+
validate: (c) => (0, e.toUTF8String)(c, 0, 4) === "icns",
|
|
1707
|
+
calculate(c) {
|
|
1708
|
+
const f = c.length, t = (0, e.readUInt32BE)(c, i);
|
|
1709
|
+
let g = n, m = u(c, g), v = a(m[0]);
|
|
1707
1710
|
if (g += m[1], g === t)
|
|
1708
1711
|
return v;
|
|
1709
1712
|
const d = {
|
|
@@ -1712,37 +1715,37 @@ function Rn() {
|
|
|
1712
1715
|
width: v.width
|
|
1713
1716
|
};
|
|
1714
1717
|
for (; g < t && g < f; )
|
|
1715
|
-
m = u(
|
|
1718
|
+
m = u(c, g), v = a(m[0]), g += m[1], d.images.push(v);
|
|
1716
1719
|
return d;
|
|
1717
1720
|
}
|
|
1718
|
-
},
|
|
1721
|
+
}, Se;
|
|
1719
1722
|
}
|
|
1720
|
-
var
|
|
1721
|
-
const
|
|
1722
|
-
var
|
|
1723
|
-
const
|
|
1724
|
-
var
|
|
1725
|
-
function
|
|
1726
|
-
if (
|
|
1727
|
-
|
|
1728
|
-
const e =
|
|
1729
|
-
return
|
|
1723
|
+
var Fn = Bn();
|
|
1724
|
+
const $n = /* @__PURE__ */ H(Fn);
|
|
1725
|
+
var zn = Pt();
|
|
1726
|
+
const An = /* @__PURE__ */ H(zn);
|
|
1727
|
+
var Ee = {}, mt;
|
|
1728
|
+
function Hn() {
|
|
1729
|
+
if (mt) return Ee;
|
|
1730
|
+
mt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.J2C = void 0;
|
|
1731
|
+
const e = G();
|
|
1732
|
+
return Ee.J2C = {
|
|
1730
1733
|
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
1731
1734
|
validate: (n) => (0, e.readUInt32BE)(n, 0) === 4283432785,
|
|
1732
1735
|
calculate: (n) => ({
|
|
1733
1736
|
height: (0, e.readUInt32BE)(n, 12),
|
|
1734
1737
|
width: (0, e.readUInt32BE)(n, 8)
|
|
1735
1738
|
})
|
|
1736
|
-
},
|
|
1739
|
+
}, Ee;
|
|
1737
1740
|
}
|
|
1738
|
-
var
|
|
1739
|
-
const Wn = /* @__PURE__ */
|
|
1740
|
-
var
|
|
1741
|
-
function
|
|
1742
|
-
if (
|
|
1743
|
-
|
|
1744
|
-
const e =
|
|
1745
|
-
return
|
|
1741
|
+
var Gn = Hn();
|
|
1742
|
+
const Wn = /* @__PURE__ */ H(Gn);
|
|
1743
|
+
var ke = {}, gt;
|
|
1744
|
+
function Kn() {
|
|
1745
|
+
if (gt) return ke;
|
|
1746
|
+
gt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.JP2 = void 0;
|
|
1747
|
+
const e = G();
|
|
1748
|
+
return ke.JP2 = {
|
|
1746
1749
|
validate(n) {
|
|
1747
1750
|
if ((0, e.toUTF8String)(n, 4, 8) !== "jP ")
|
|
1748
1751
|
return !1;
|
|
@@ -1758,15 +1761,15 @@ function Gn() {
|
|
|
1758
1761
|
};
|
|
1759
1762
|
throw new TypeError("Unsupported JPEG 2000 format");
|
|
1760
1763
|
}
|
|
1761
|
-
},
|
|
1764
|
+
}, ke;
|
|
1762
1765
|
}
|
|
1763
|
-
var
|
|
1764
|
-
const
|
|
1765
|
-
var
|
|
1766
|
-
function
|
|
1767
|
-
if (
|
|
1768
|
-
|
|
1769
|
-
const e =
|
|
1766
|
+
var Qn = Kn();
|
|
1767
|
+
const Jn = /* @__PURE__ */ H(Qn);
|
|
1768
|
+
var _e = {}, vt;
|
|
1769
|
+
function Yn() {
|
|
1770
|
+
if (vt) return _e;
|
|
1771
|
+
vt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.JPG = void 0;
|
|
1772
|
+
const e = G(), n = "45786966", i = 2, r = 6, o = 2, u = "4d4d", a = "4949", c = 12, f = 2;
|
|
1770
1773
|
function t(s) {
|
|
1771
1774
|
return (0, e.toHexString)(s, 2, 6) === n;
|
|
1772
1775
|
}
|
|
@@ -1777,58 +1780,58 @@ function Jn() {
|
|
|
1777
1780
|
};
|
|
1778
1781
|
}
|
|
1779
1782
|
function m(s, p) {
|
|
1780
|
-
const y = r + 8,
|
|
1781
|
-
for (let
|
|
1782
|
-
const
|
|
1783
|
-
if (
|
|
1783
|
+
const y = r + 8, O = (0, e.readUInt)(s, 16, y, p);
|
|
1784
|
+
for (let Q = 0; Q < O; Q++) {
|
|
1785
|
+
const j = y + f + Q * c, k = j + c;
|
|
1786
|
+
if (j > s.length)
|
|
1784
1787
|
return;
|
|
1785
|
-
const b = s.slice(
|
|
1788
|
+
const b = s.slice(j, k);
|
|
1786
1789
|
if ((0, e.readUInt)(b, 16, 0, p) === 274)
|
|
1787
1790
|
return (0, e.readUInt)(b, 16, 2, p) !== 3 || (0, e.readUInt)(b, 32, 4, p) !== 1 ? void 0 : (0, e.readUInt)(b, 16, 8, p);
|
|
1788
1791
|
}
|
|
1789
1792
|
}
|
|
1790
1793
|
function v(s, p) {
|
|
1791
|
-
const
|
|
1792
|
-
if (
|
|
1793
|
-
return m(
|
|
1794
|
+
const l = s.slice(i, p), y = (0, e.toHexString)(l, r, r + o), O = y === u;
|
|
1795
|
+
if (O || y === a)
|
|
1796
|
+
return m(l, O);
|
|
1794
1797
|
}
|
|
1795
1798
|
function d(s, p) {
|
|
1796
1799
|
if (p > s.length)
|
|
1797
1800
|
throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
1798
1801
|
}
|
|
1799
|
-
return
|
|
1802
|
+
return _e.JPG = {
|
|
1800
1803
|
validate: (s) => (0, e.toHexString)(s, 0, 2) === "ffd8",
|
|
1801
1804
|
calculate(s) {
|
|
1802
1805
|
s = s.slice(4);
|
|
1803
|
-
let p,
|
|
1806
|
+
let p, l;
|
|
1804
1807
|
for (; s.length; ) {
|
|
1805
1808
|
const y = (0, e.readUInt16BE)(s, 0);
|
|
1806
1809
|
if (s[y] !== 255) {
|
|
1807
1810
|
s = s.slice(1);
|
|
1808
1811
|
continue;
|
|
1809
1812
|
}
|
|
1810
|
-
if (t(s) && (p = v(s, y)), d(s, y),
|
|
1811
|
-
const
|
|
1813
|
+
if (t(s) && (p = v(s, y)), d(s, y), l = s[y + 1], l === 192 || l === 193 || l === 194) {
|
|
1814
|
+
const O = g(s, y + 5);
|
|
1812
1815
|
return p ? {
|
|
1813
|
-
height:
|
|
1816
|
+
height: O.height,
|
|
1814
1817
|
orientation: p,
|
|
1815
|
-
width:
|
|
1816
|
-
} :
|
|
1818
|
+
width: O.width
|
|
1819
|
+
} : O;
|
|
1817
1820
|
}
|
|
1818
1821
|
s = s.slice(y + 2);
|
|
1819
1822
|
}
|
|
1820
1823
|
throw new TypeError("Invalid JPG, no size found");
|
|
1821
1824
|
}
|
|
1822
|
-
},
|
|
1825
|
+
}, _e;
|
|
1823
1826
|
}
|
|
1824
|
-
var
|
|
1825
|
-
const
|
|
1826
|
-
var
|
|
1827
|
-
function
|
|
1828
|
-
if (
|
|
1829
|
-
|
|
1830
|
-
const e =
|
|
1831
|
-
return
|
|
1827
|
+
var Xn = Yn();
|
|
1828
|
+
const Vn = /* @__PURE__ */ H(Xn);
|
|
1829
|
+
var Te = {}, yt;
|
|
1830
|
+
function Zn() {
|
|
1831
|
+
if (yt) return Te;
|
|
1832
|
+
yt = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.KTX = void 0;
|
|
1833
|
+
const e = G();
|
|
1834
|
+
return Te.KTX = {
|
|
1832
1835
|
validate: (n) => {
|
|
1833
1836
|
const i = (0, e.toUTF8String)(n, 1, 7);
|
|
1834
1837
|
return ["KTX 11", "KTX 20"].includes(i);
|
|
@@ -1841,18 +1844,18 @@ function Vn() {
|
|
|
1841
1844
|
type: i
|
|
1842
1845
|
};
|
|
1843
1846
|
}
|
|
1844
|
-
},
|
|
1847
|
+
}, Te;
|
|
1845
1848
|
}
|
|
1846
|
-
var
|
|
1847
|
-
const
|
|
1848
|
-
var
|
|
1849
|
-
function
|
|
1850
|
-
if (
|
|
1851
|
-
|
|
1852
|
-
const e =
|
|
1849
|
+
var er = Zn();
|
|
1850
|
+
const tr = /* @__PURE__ */ H(er);
|
|
1851
|
+
var Ce = {}, bt;
|
|
1852
|
+
function nr() {
|
|
1853
|
+
if (bt) return Ce;
|
|
1854
|
+
bt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.PNG = void 0;
|
|
1855
|
+
const e = G(), n = `PNG\r
|
|
1853
1856
|
|
|
1854
1857
|
`, i = "IHDR", r = "CgBI";
|
|
1855
|
-
return
|
|
1858
|
+
return Ce.PNG = {
|
|
1856
1859
|
validate(o) {
|
|
1857
1860
|
if (n === (0, e.toUTF8String)(o, 1, 8)) {
|
|
1858
1861
|
let u = (0, e.toUTF8String)(o, 12, 16);
|
|
@@ -1871,15 +1874,15 @@ function tr() {
|
|
|
1871
1874
|
width: (0, e.readUInt32BE)(o, 16)
|
|
1872
1875
|
};
|
|
1873
1876
|
}
|
|
1874
|
-
},
|
|
1877
|
+
}, Ce;
|
|
1875
1878
|
}
|
|
1876
|
-
var
|
|
1877
|
-
const
|
|
1878
|
-
var
|
|
1879
|
-
function
|
|
1880
|
-
if (
|
|
1881
|
-
|
|
1882
|
-
const e =
|
|
1879
|
+
var rr = nr();
|
|
1880
|
+
const or = /* @__PURE__ */ H(rr);
|
|
1881
|
+
var De = {}, wt;
|
|
1882
|
+
function ir() {
|
|
1883
|
+
if (wt) return De;
|
|
1884
|
+
wt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.PNM = void 0;
|
|
1885
|
+
const e = G(), n = {
|
|
1883
1886
|
P1: "pbm/ascii",
|
|
1884
1887
|
P2: "pgm/ascii",
|
|
1885
1888
|
P3: "ppm/ascii",
|
|
@@ -1911,8 +1914,8 @@ function or() {
|
|
|
1911
1914
|
const u = r.shift();
|
|
1912
1915
|
if (u.length > 16 || u.charCodeAt(0) > 128)
|
|
1913
1916
|
continue;
|
|
1914
|
-
const [a,
|
|
1915
|
-
if (a &&
|
|
1917
|
+
const [a, c] = u.split(" ");
|
|
1918
|
+
if (a && c && (o[a.toLowerCase()] = parseInt(c, 10)), o.height && o.width)
|
|
1916
1919
|
break;
|
|
1917
1920
|
}
|
|
1918
1921
|
if (o.height && o.width)
|
|
@@ -1923,36 +1926,36 @@ function or() {
|
|
|
1923
1926
|
throw new TypeError("Invalid PAM");
|
|
1924
1927
|
}
|
|
1925
1928
|
};
|
|
1926
|
-
return
|
|
1929
|
+
return De.PNM = {
|
|
1927
1930
|
validate: (r) => (0, e.toUTF8String)(r, 0, 2) in n,
|
|
1928
1931
|
calculate(r) {
|
|
1929
1932
|
const o = (0, e.toUTF8String)(r, 0, 2), u = n[o], a = (0, e.toUTF8String)(r, 3).split(/[\r\n]+/);
|
|
1930
1933
|
return (i[u] || i.default)(a);
|
|
1931
1934
|
}
|
|
1932
|
-
},
|
|
1935
|
+
}, De;
|
|
1933
1936
|
}
|
|
1934
|
-
var
|
|
1935
|
-
const
|
|
1936
|
-
var
|
|
1937
|
-
function
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
1940
|
-
const e =
|
|
1941
|
-
return
|
|
1937
|
+
var sr = ir();
|
|
1938
|
+
const ar = /* @__PURE__ */ H(sr);
|
|
1939
|
+
var Pe = {}, xt;
|
|
1940
|
+
function lr() {
|
|
1941
|
+
if (xt) return Pe;
|
|
1942
|
+
xt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.PSD = void 0;
|
|
1943
|
+
const e = G();
|
|
1944
|
+
return Pe.PSD = {
|
|
1942
1945
|
validate: (n) => (0, e.toUTF8String)(n, 0, 4) === "8BPS",
|
|
1943
1946
|
calculate: (n) => ({
|
|
1944
1947
|
height: (0, e.readUInt32BE)(n, 14),
|
|
1945
1948
|
width: (0, e.readUInt32BE)(n, 18)
|
|
1946
1949
|
})
|
|
1947
|
-
},
|
|
1950
|
+
}, Pe;
|
|
1948
1951
|
}
|
|
1949
|
-
var
|
|
1950
|
-
const
|
|
1951
|
-
var
|
|
1952
|
-
function
|
|
1953
|
-
if (
|
|
1954
|
-
|
|
1955
|
-
const e =
|
|
1952
|
+
var cr = lr();
|
|
1953
|
+
const dr = /* @__PURE__ */ H(cr);
|
|
1954
|
+
var Ne = {}, It;
|
|
1955
|
+
function ur() {
|
|
1956
|
+
if (It) return Ne;
|
|
1957
|
+
It = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.SVG = void 0;
|
|
1958
|
+
const e = G(), n = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, i = {
|
|
1956
1959
|
height: /\sheight=(['"])([^%]+?)\1/,
|
|
1957
1960
|
root: n,
|
|
1958
1961
|
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
@@ -1973,7 +1976,7 @@ function dr() {
|
|
|
1973
1976
|
if (v)
|
|
1974
1977
|
return Math.round(Number(v[1]) * (o[v[2]] || 1));
|
|
1975
1978
|
}
|
|
1976
|
-
function
|
|
1979
|
+
function c(m) {
|
|
1977
1980
|
const v = m.split(" ");
|
|
1978
1981
|
return {
|
|
1979
1982
|
height: a(v[3]),
|
|
@@ -1984,7 +1987,7 @@ function dr() {
|
|
|
1984
1987
|
const v = m.match(i.width), d = m.match(i.height), s = m.match(i.viewbox);
|
|
1985
1988
|
return {
|
|
1986
1989
|
height: d && a(d[2]),
|
|
1987
|
-
viewbox: s &&
|
|
1990
|
+
viewbox: s && c(s[2]),
|
|
1988
1991
|
width: v && a(v[2])
|
|
1989
1992
|
};
|
|
1990
1993
|
}
|
|
@@ -2007,7 +2010,7 @@ function dr() {
|
|
|
2007
2010
|
width: v.width
|
|
2008
2011
|
};
|
|
2009
2012
|
}
|
|
2010
|
-
return
|
|
2013
|
+
return Ne.SVG = {
|
|
2011
2014
|
// Scan only the first kilo-byte to speed up the check on larger files
|
|
2012
2015
|
validate: (m) => n.test((0, e.toUTF8String)(m, 0, 1e3)),
|
|
2013
2016
|
calculate(m) {
|
|
@@ -2021,16 +2024,16 @@ function dr() {
|
|
|
2021
2024
|
}
|
|
2022
2025
|
throw new TypeError("Invalid SVG");
|
|
2023
2026
|
}
|
|
2024
|
-
},
|
|
2027
|
+
}, Ne;
|
|
2025
2028
|
}
|
|
2026
|
-
var
|
|
2027
|
-
const
|
|
2028
|
-
var
|
|
2029
|
-
function
|
|
2030
|
-
if (
|
|
2031
|
-
|
|
2032
|
-
const e =
|
|
2033
|
-
return
|
|
2029
|
+
var fr = ur();
|
|
2030
|
+
const pr = /* @__PURE__ */ H(fr);
|
|
2031
|
+
var Me = {}, St;
|
|
2032
|
+
function hr() {
|
|
2033
|
+
if (St) return Me;
|
|
2034
|
+
St = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.TGA = void 0;
|
|
2035
|
+
const e = G();
|
|
2036
|
+
return Me.TGA = {
|
|
2034
2037
|
validate(n) {
|
|
2035
2038
|
return (0, e.readUInt16LE)(n, 0) === 0 && (0, e.readUInt16LE)(n, 4) === 0;
|
|
2036
2039
|
},
|
|
@@ -2040,15 +2043,15 @@ function pr() {
|
|
|
2040
2043
|
width: (0, e.readUInt16LE)(n, 12)
|
|
2041
2044
|
};
|
|
2042
2045
|
}
|
|
2043
|
-
},
|
|
2046
|
+
}, Me;
|
|
2044
2047
|
}
|
|
2045
|
-
var
|
|
2046
|
-
const
|
|
2047
|
-
var
|
|
2048
|
-
function
|
|
2049
|
-
if (Et) return
|
|
2050
|
-
Et = 1, Object.defineProperty(
|
|
2051
|
-
const e =
|
|
2048
|
+
var mr = hr();
|
|
2049
|
+
const gr = /* @__PURE__ */ H(mr);
|
|
2050
|
+
var Oe = {}, Et;
|
|
2051
|
+
function vr() {
|
|
2052
|
+
if (Et) return Oe;
|
|
2053
|
+
Et = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.WEBP = void 0;
|
|
2054
|
+
const e = G();
|
|
2052
2055
|
function n(o) {
|
|
2053
2056
|
return {
|
|
2054
2057
|
height: 1 + (0, e.readUInt24LE)(o, 7),
|
|
@@ -2067,15 +2070,15 @@ function gr() {
|
|
|
2067
2070
|
width: (0, e.readInt16LE)(o, 6) & 16383
|
|
2068
2071
|
};
|
|
2069
2072
|
}
|
|
2070
|
-
return
|
|
2073
|
+
return Oe.WEBP = {
|
|
2071
2074
|
validate(o) {
|
|
2072
|
-
const u = (0, e.toUTF8String)(o, 0, 4) === "RIFF", a = (0, e.toUTF8String)(o, 8, 12) === "WEBP",
|
|
2073
|
-
return u && a &&
|
|
2075
|
+
const u = (0, e.toUTF8String)(o, 0, 4) === "RIFF", a = (0, e.toUTF8String)(o, 8, 12) === "WEBP", c = (0, e.toUTF8String)(o, 12, 15) === "VP8";
|
|
2076
|
+
return u && a && c;
|
|
2074
2077
|
},
|
|
2075
2078
|
calculate(o) {
|
|
2076
2079
|
const u = (0, e.toUTF8String)(o, 12, 16);
|
|
2077
2080
|
if (o = o.slice(20, 30), u === "VP8X") {
|
|
2078
|
-
const
|
|
2081
|
+
const c = o[0], f = (c & 192) === 0, t = (c & 1) === 0;
|
|
2079
2082
|
if (f && t)
|
|
2080
2083
|
return n(o);
|
|
2081
2084
|
throw new TypeError("Invalid WebP");
|
|
@@ -2087,15 +2090,15 @@ function gr() {
|
|
|
2087
2090
|
return i(o);
|
|
2088
2091
|
throw new TypeError("Invalid WebP");
|
|
2089
2092
|
}
|
|
2090
|
-
},
|
|
2093
|
+
}, Oe;
|
|
2091
2094
|
}
|
|
2092
|
-
var
|
|
2093
|
-
const
|
|
2094
|
-
var
|
|
2095
|
-
function
|
|
2096
|
-
if (
|
|
2097
|
-
|
|
2098
|
-
const e =
|
|
2095
|
+
var yr = vr();
|
|
2096
|
+
const br = /* @__PURE__ */ H(yr);
|
|
2097
|
+
var je = {}, kt;
|
|
2098
|
+
function wr() {
|
|
2099
|
+
if (kt) return je;
|
|
2100
|
+
kt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.HEIF = void 0;
|
|
2101
|
+
const e = G(), n = {
|
|
2099
2102
|
avif: "avif",
|
|
2100
2103
|
mif1: "heif",
|
|
2101
2104
|
msf1: "heif",
|
|
@@ -2107,7 +2110,7 @@ function br() {
|
|
|
2107
2110
|
hevx: "heic"
|
|
2108
2111
|
// heic-sequence
|
|
2109
2112
|
};
|
|
2110
|
-
return
|
|
2113
|
+
return je.HEIF = {
|
|
2111
2114
|
validate(i) {
|
|
2112
2115
|
if ((0, e.toUTF8String)(i, 4, 8) !== "ftyp")
|
|
2113
2116
|
return !1;
|
|
@@ -2124,10 +2127,10 @@ function br() {
|
|
|
2124
2127
|
};
|
|
2125
2128
|
throw new TypeError("Invalid HEIF, no size found");
|
|
2126
2129
|
}
|
|
2127
|
-
},
|
|
2130
|
+
}, je;
|
|
2128
2131
|
}
|
|
2129
|
-
var
|
|
2130
|
-
const
|
|
2132
|
+
var xr = wr();
|
|
2133
|
+
const Ir = /* @__PURE__ */ H(xr), Sr = {
|
|
2131
2134
|
56: "psd",
|
|
2132
2135
|
66: "bmp",
|
|
2133
2136
|
68: "dds",
|
|
@@ -2136,38 +2139,38 @@ const xr = /* @__PURE__ */ A(wr), Ir = {
|
|
|
2136
2139
|
105: "icns",
|
|
2137
2140
|
137: "png",
|
|
2138
2141
|
255: "jpg"
|
|
2139
|
-
},
|
|
2140
|
-
webp:
|
|
2141
|
-
jpg:
|
|
2142
|
-
png:
|
|
2143
|
-
svg:
|
|
2144
|
-
gif:
|
|
2145
|
-
avif:
|
|
2146
|
-
bmp:
|
|
2147
|
-
cur:
|
|
2148
|
-
dds:
|
|
2149
|
-
icns:
|
|
2150
|
-
ico:
|
|
2142
|
+
}, Ae = {
|
|
2143
|
+
webp: br.WEBP,
|
|
2144
|
+
jpg: Vn.JPG,
|
|
2145
|
+
png: or.PNG,
|
|
2146
|
+
svg: pr.SVG,
|
|
2147
|
+
gif: Rn.GIF,
|
|
2148
|
+
avif: Ir.HEIF,
|
|
2149
|
+
bmp: Dn.BMP,
|
|
2150
|
+
cur: Mn.CUR,
|
|
2151
|
+
dds: qn.DDS,
|
|
2152
|
+
icns: $n.ICNS,
|
|
2153
|
+
ico: An.ICO,
|
|
2151
2154
|
j2c: Wn.J2C,
|
|
2152
|
-
jp2:
|
|
2153
|
-
ktx:
|
|
2154
|
-
pnm:
|
|
2155
|
-
psd:
|
|
2156
|
-
tga:
|
|
2157
|
-
}, Er = Object.keys(
|
|
2158
|
-
function Sr(e) {
|
|
2159
|
-
const n = e[0], i = Ir[n];
|
|
2160
|
-
return i && $e[i].validate(e) ? i : Er.find((r) => $e[r].validate(e));
|
|
2161
|
-
}
|
|
2155
|
+
jp2: Jn.JP2,
|
|
2156
|
+
ktx: tr.KTX,
|
|
2157
|
+
pnm: ar.PNM,
|
|
2158
|
+
psd: dr.PSD,
|
|
2159
|
+
tga: gr.TGA
|
|
2160
|
+
}, Er = Object.keys(Ae);
|
|
2162
2161
|
function kr(e) {
|
|
2163
|
-
const n = Sr
|
|
2162
|
+
const n = e[0], i = Sr[n];
|
|
2163
|
+
return i && Ae[i].validate(e) ? i : Er.find((r) => Ae[r].validate(e));
|
|
2164
|
+
}
|
|
2165
|
+
function _r(e) {
|
|
2166
|
+
const n = kr(e);
|
|
2164
2167
|
if (typeof n < "u") {
|
|
2165
|
-
const i =
|
|
2168
|
+
const i = Ae[n].calculate(e);
|
|
2166
2169
|
if (i !== void 0)
|
|
2167
2170
|
return i.type = n, i;
|
|
2168
2171
|
}
|
|
2169
2172
|
}
|
|
2170
|
-
async function
|
|
2173
|
+
async function Tr(e) {
|
|
2171
2174
|
if (/^(https?|file|capacitor):/.test(e))
|
|
2172
2175
|
try {
|
|
2173
2176
|
const n = await fetch(e, {
|
|
@@ -2177,7 +2180,7 @@ async function _r(e) {
|
|
|
2177
2180
|
console.error("can not fetch", e);
|
|
2178
2181
|
return;
|
|
2179
2182
|
}
|
|
2180
|
-
const i = await n.arrayBuffer(), r =
|
|
2183
|
+
const i = await n.arrayBuffer(), r = _r(Buffer.from(i));
|
|
2181
2184
|
if (r)
|
|
2182
2185
|
return {
|
|
2183
2186
|
width: r.width,
|
|
@@ -2190,9 +2193,9 @@ async function _r(e) {
|
|
|
2190
2193
|
return;
|
|
2191
2194
|
}
|
|
2192
2195
|
}
|
|
2193
|
-
const
|
|
2196
|
+
const Cr = (e, n, i) => async (r, o, u) => {
|
|
2194
2197
|
try {
|
|
2195
|
-
const a = await e.dynamicImport("node:fs"),
|
|
2198
|
+
const a = await e.dynamicImport("node:fs"), c = await e.dynamicImport("node:path");
|
|
2196
2199
|
let f;
|
|
2197
2200
|
try {
|
|
2198
2201
|
f = new URL(r.url, "http://localhost:3000/");
|
|
@@ -2203,7 +2206,7 @@ const Tr = (e, n, i) => async (r, o, u) => {
|
|
|
2203
2206
|
if (r.method === "GET" && f.pathname === "/__image_info") {
|
|
2204
2207
|
const t = f.searchParams.get("url");
|
|
2205
2208
|
if (o.setHeader("content-type", "application/json"), t) {
|
|
2206
|
-
const g = await
|
|
2209
|
+
const g = await Tr(t);
|
|
2207
2210
|
o.setHeader("cache-control", "public, max-age=31536000, immutable"), g ? o.write(JSON.stringify(g)) : o.statusCode = 404;
|
|
2208
2211
|
} else {
|
|
2209
2212
|
o.statusCode = 500;
|
|
@@ -2214,101 +2217,114 @@ const Tr = (e, n, i) => async (r, o, u) => {
|
|
|
2214
2217
|
return;
|
|
2215
2218
|
} else if (r.method === "POST" && f.pathname === "/__image_fix") {
|
|
2216
2219
|
const t = f.searchParams.get("loc"), g = f.searchParams.get("width"), m = f.searchParams.get("height"), v = f.searchParams.get("src"), d = f.searchParams.get("currentHref"), s = t.split(":"), p = parseInt(s[s.length - 1], 10) - 1;
|
|
2217
|
-
let
|
|
2218
|
-
const y =
|
|
2219
|
-
let
|
|
2220
|
-
for (; k <
|
|
2221
|
-
if (
|
|
2220
|
+
let l = parseInt(s[s.length - 2], 10) - 1;
|
|
2221
|
+
const y = c.resolve(i, s.slice(0, s.length - 2).join(":")), O = c.extname(y).toLowerCase();
|
|
2222
|
+
let j = a.readFileSync(y).toString("utf-8"), k = 0;
|
|
2223
|
+
for (; k < j.length; k++)
|
|
2224
|
+
if (l === 0) {
|
|
2222
2225
|
k += p;
|
|
2223
2226
|
break;
|
|
2224
|
-
} else if (
|
|
2227
|
+
} else if (j[k] === `
|
|
2225
2228
|
`) {
|
|
2226
|
-
|
|
2229
|
+
l--;
|
|
2227
2230
|
continue;
|
|
2228
2231
|
}
|
|
2229
|
-
if (
|
|
2232
|
+
if (j.slice(k, k + 4) !== "<img") {
|
|
2230
2233
|
console.error(
|
|
2231
2234
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2232
2235
|
), o.statusCode = 500;
|
|
2233
2236
|
return;
|
|
2234
2237
|
}
|
|
2235
|
-
const b =
|
|
2238
|
+
const b = j.indexOf(">", k) + 1;
|
|
2236
2239
|
if (b < k) {
|
|
2237
2240
|
console.error(
|
|
2238
2241
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2239
2242
|
), o.statusCode = 500;
|
|
2240
2243
|
return;
|
|
2241
2244
|
}
|
|
2242
|
-
const
|
|
2243
|
-
let x =
|
|
2244
|
-
if (v && d &&
|
|
2245
|
-
const U = new URL(v),
|
|
2246
|
-
if (U.origin ===
|
|
2247
|
-
const
|
|
2248
|
-
let
|
|
2249
|
-
if (a.existsSync(
|
|
2250
|
-
const X =
|
|
2245
|
+
const S = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(O);
|
|
2246
|
+
let x = j.slice(k, b);
|
|
2247
|
+
if (v && d && S) {
|
|
2248
|
+
const U = new URL(v), _ = new URL(d);
|
|
2249
|
+
if (U.origin === _.origin) {
|
|
2250
|
+
const P = c.join(n, "public", U.pathname), W = c.join(n, U.pathname);
|
|
2251
|
+
let K;
|
|
2252
|
+
if (a.existsSync(P)) {
|
|
2253
|
+
const X = c.join(i, "media", c.dirname(U.pathname));
|
|
2251
2254
|
await a.promises.mkdir(X, { recursive: !0 }), await a.promises.copyFile(
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
),
|
|
2255
|
-
} else if (a.existsSync(
|
|
2256
|
-
|
|
2255
|
+
P,
|
|
2256
|
+
c.join(i, "media", U.pathname)
|
|
2257
|
+
), K = "~/media" + U.pathname;
|
|
2258
|
+
} else if (a.existsSync(W))
|
|
2259
|
+
K = U.pathname.replace("/src/", "~/");
|
|
2257
2260
|
else
|
|
2258
2261
|
return;
|
|
2259
|
-
const R =
|
|
2262
|
+
const R = Dr(U.pathname), Y = `${K}?jsx`;
|
|
2260
2263
|
x = x.replace(/^<img/, `<${R}`), x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
2261
2264
|
let J = 0;
|
|
2262
|
-
if (
|
|
2265
|
+
if (O === ".mdx" && j.startsWith("---") && (J = j.indexOf("---", 4) + 3, J === -1))
|
|
2263
2266
|
return;
|
|
2264
2267
|
const te = `
|
|
2265
2268
|
import ${R} from '${Y}';`;
|
|
2266
|
-
|
|
2269
|
+
j = `${j.slice(0, J)}${te}${j.slice(
|
|
2267
2270
|
J,
|
|
2268
2271
|
k
|
|
2269
|
-
)}${x}${
|
|
2272
|
+
)}${x}${j.slice(b)}`, a.writeFileSync(y, j);
|
|
2270
2273
|
return;
|
|
2271
2274
|
}
|
|
2272
2275
|
}
|
|
2273
|
-
x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${g}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${m}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${m}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${g}"`)),
|
|
2276
|
+
x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${g}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${m}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${m}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${g}"`)), j = j.slice(0, k) + x + j.slice(b), a.writeFileSync(y, j);
|
|
2274
2277
|
} else
|
|
2275
2278
|
u();
|
|
2276
2279
|
} catch (a) {
|
|
2277
|
-
a instanceof Error && await
|
|
2280
|
+
a instanceof Error && await Vt(e, a), u(a);
|
|
2278
2281
|
}
|
|
2279
2282
|
};
|
|
2280
|
-
function
|
|
2283
|
+
function Dr(e) {
|
|
2281
2284
|
const n = e.lastIndexOf("."), i = e.lastIndexOf("/");
|
|
2282
2285
|
return e = e.substring(i + 1, n), `Img${Pr(e)}`;
|
|
2283
2286
|
}
|
|
2284
2287
|
function Pr(e) {
|
|
2285
2288
|
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());
|
|
2286
2289
|
}
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2290
|
+
const Nr = [
|
|
2291
|
+
qe,
|
|
2292
|
+
Je,
|
|
2293
|
+
Ye,
|
|
2294
|
+
Le,
|
|
2292
2295
|
"@builder.io/qwik",
|
|
2293
2296
|
"@builder.io/qwik/jsx-runtime",
|
|
2294
2297
|
"@builder.io/qwik/jsx-dev-runtime"
|
|
2295
|
-
],
|
|
2298
|
+
], Mr = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Or = [".woff", ".woff2", ".ttf"], Qe = "@qwik-hmr-bridge", jr = `
|
|
2296
2299
|
// HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
|
|
2297
2300
|
if (import.meta.hot) {
|
|
2301
|
+
let timeout;
|
|
2298
2302
|
import.meta.hot.on("qwik:hmr", (data) => {
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
);
|
|
2303
|
+
if (data.t === document.__hmrT) {
|
|
2304
|
+
console.log("Received duplicate HMR update, ignoring", data.files);
|
|
2305
|
+
return;
|
|
2303
2306
|
}
|
|
2307
|
+
clearTimeout(timeout);
|
|
2308
|
+
document.__hmrT = data.t;
|
|
2309
|
+
document.__hmrDone = 0;
|
|
2310
|
+
document.dispatchEvent(
|
|
2311
|
+
new CustomEvent("qHmr", { detail: data })
|
|
2312
|
+
);
|
|
2313
|
+
timeout = setTimeout(() => {
|
|
2314
|
+
console.log(document.__hmrDone, document.__hmrT);
|
|
2315
|
+
if (document.__hmrDone !== document.__hmrT) {
|
|
2316
|
+
console.log("HMR update did not match active code, reloading the page", location.href);
|
|
2317
|
+
location.reload();
|
|
2318
|
+
}
|
|
2319
|
+
}, 500);
|
|
2304
2320
|
});
|
|
2305
2321
|
}
|
|
2306
2322
|
`;
|
|
2307
|
-
function
|
|
2308
|
-
let n = "serve", i = null, r = null, o = "/", u = null, a,
|
|
2323
|
+
function Rr(e = {}) {
|
|
2324
|
+
let n = "serve", i = null, r = null, o = "/", u = null, a, c = null, f = null, t = null, g = "development", m;
|
|
2309
2325
|
const v = e.client?.outDir;
|
|
2310
2326
|
let d = null;
|
|
2311
|
-
const s = e.fileFilter ? (b,
|
|
2327
|
+
const s = e.fileFilter ? (b, S) => Dt.test(b) || e.fileFilter(b, S) : () => !0, p = e.disableFontPreload ?? !1, l = [], y = Ct(e.optimizerOptions), O = /* @__PURE__ */ new Set();
|
|
2312
2328
|
return [{
|
|
2313
2329
|
name: "vite-plugin-qwik",
|
|
2314
2330
|
enforce: "pre",
|
|
@@ -2320,17 +2336,17 @@ function Ur(e = {}) {
|
|
|
2320
2336
|
getClientOutDir: () => r,
|
|
2321
2337
|
getClientPublicOutDir: () => u,
|
|
2322
2338
|
getAssetsDir: () => a,
|
|
2323
|
-
registerBundleGraphAdder: (b) =>
|
|
2339
|
+
registerBundleGraphAdder: (b) => O.add(b),
|
|
2324
2340
|
_oldDevSsrServer: () => e.devSsrServer
|
|
2325
2341
|
},
|
|
2326
|
-
async config(b,
|
|
2342
|
+
async config(b, S) {
|
|
2327
2343
|
await y.init();
|
|
2328
2344
|
let x;
|
|
2329
|
-
|
|
2330
|
-
const U = x === "ssr" ? typeof b.build?.ssr == "string" ? b.build.ssr : e.ssr?.input : void 0,
|
|
2331
|
-
let
|
|
2332
|
-
|
|
2333
|
-
const
|
|
2345
|
+
S.mode === "lib" ? x = "lib" : b.build?.ssr || S.mode === "ssr" ? x = "ssr" : S.mode === "test" || S.mode === "benchmark" ? x = "test" : x = "client", n = S.command, S.mode === "production" ? g = "production" : S.mode === "development" ? g = "development" : n === "build" && x === "client" ? g = "production" : g = "development", y.debug(`vite config(), command: ${n}, env.mode: ${S.mode}`), n === "serve" ? e.entryStrategy = { type: "segment" } : x === "ssr" ? e.entryStrategy = { type: "hoist" } : x === "lib" && (e.entryStrategy = { type: "inline" });
|
|
2346
|
+
const U = x === "ssr" ? typeof b.build?.ssr == "string" ? b.build.ssr : e.ssr?.input : void 0, _ = x === "client" ? e.client?.input : void 0;
|
|
2347
|
+
let P = b.build?.rollupOptions?.input || _ || U;
|
|
2348
|
+
P && typeof P == "string" && (P = [P]), a = b.build?.assetsDir;
|
|
2349
|
+
const W = x === "client" && !!a && a !== "_astro", K = {
|
|
2334
2350
|
target: x,
|
|
2335
2351
|
buildMode: g,
|
|
2336
2352
|
csr: e.csr,
|
|
@@ -2346,25 +2362,25 @@ function Ur(e = {}) {
|
|
|
2346
2362
|
clientOutDir: v || // When ssr is true, this is probably an adapter build and not where the client build is
|
|
2347
2363
|
// However, if client.outDir was explicitly set, always use it
|
|
2348
2364
|
(b.build?.ssr && !v ? void 0 : b.build?.outDir),
|
|
2349
|
-
assetsDir:
|
|
2365
|
+
assetsDir: W ? a : void 0,
|
|
2350
2366
|
devTools: e.devTools,
|
|
2351
2367
|
sourcemap: !!b.build?.sourcemap,
|
|
2352
2368
|
lint: e.lint,
|
|
2353
2369
|
experimental: e.experimental,
|
|
2354
|
-
input:
|
|
2370
|
+
input: P,
|
|
2355
2371
|
manifestInput: e.ssr?.manifestInput,
|
|
2356
2372
|
manifestInputPath: e.ssr?.manifestInputPath,
|
|
2357
2373
|
manifestOutput: e.client?.manifestOutput
|
|
2358
|
-
}, R = await y.normalizeOptions(
|
|
2359
|
-
|
|
2360
|
-
const Y = g === "development", J = "globalThis.qDev", te = "globalThis.qTest", X = "globalThis.qInspector",
|
|
2374
|
+
}, R = await y.normalizeOptions(K);
|
|
2375
|
+
P ||= R.input, d = K, i = R.manifestInput, c = R.srcDir, f = R.rootDir, e.csr || (r = R.clientOutDir, u = r, t = R.ssrOutDir);
|
|
2376
|
+
const Y = g === "development", J = "globalThis.qDev", te = "globalThis.qTest", X = "globalThis.qInspector", M = b?.define?.[J] ?? Y, pe = b?.define?.[X] ?? Y, F = {
|
|
2361
2377
|
// Duplicated in configEnvironment to support legacy vite build --ssr compatibility
|
|
2362
2378
|
ssr: {
|
|
2363
|
-
noExternal: [
|
|
2379
|
+
noExternal: [qe, Le, Fe, re]
|
|
2364
2380
|
},
|
|
2365
2381
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
2366
2382
|
resolve: {
|
|
2367
|
-
dedupe: [...
|
|
2383
|
+
dedupe: [...Nr],
|
|
2368
2384
|
alias: {
|
|
2369
2385
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
2370
2386
|
"@builder.io/qwik/build": "@qwik.dev/core/build",
|
|
@@ -2383,17 +2399,17 @@ function Ur(e = {}) {
|
|
|
2383
2399
|
exclude: [
|
|
2384
2400
|
// using optimized deps for qwik libraries will lead to duplicate imports
|
|
2385
2401
|
// this breaks Qwik because it relies a lot on module scoped symbols
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2402
|
+
qe,
|
|
2403
|
+
Le,
|
|
2404
|
+
Fe,
|
|
2405
|
+
Je,
|
|
2406
|
+
Ye,
|
|
2391
2407
|
re,
|
|
2392
2408
|
se,
|
|
2393
2409
|
"@builder.io/qwik"
|
|
2394
2410
|
],
|
|
2395
2411
|
// Enforce scanning our input even when overridden later
|
|
2396
|
-
entries:
|
|
2412
|
+
entries: P && (typeof P == "string" ? [P] : typeof P == "object" ? Object.values(P) : P)
|
|
2397
2413
|
},
|
|
2398
2414
|
build: {
|
|
2399
2415
|
modulePreload: !1,
|
|
@@ -2403,51 +2419,51 @@ function Ur(e = {}) {
|
|
|
2403
2419
|
rollupOptions: {
|
|
2404
2420
|
external: ["node:async_hooks"],
|
|
2405
2421
|
// This will amend the existing input
|
|
2406
|
-
input:
|
|
2422
|
+
input: P
|
|
2407
2423
|
// temporary fix for rolldown-vite types
|
|
2408
2424
|
}
|
|
2409
2425
|
},
|
|
2410
2426
|
define: {
|
|
2411
|
-
[J]:
|
|
2412
|
-
[X]:
|
|
2427
|
+
[J]: M,
|
|
2428
|
+
[X]: pe,
|
|
2413
2429
|
[te]: JSON.stringify(process.env.NODE_ENV === "test")
|
|
2414
2430
|
}
|
|
2415
2431
|
};
|
|
2416
2432
|
if (!e.csr) {
|
|
2417
2433
|
F.build.cssCodeSplit = !1, R.outDir && (F.build.outDir = R.outDir);
|
|
2418
|
-
const
|
|
2434
|
+
const A = F.build.rollupOptions?.onwarn;
|
|
2419
2435
|
F.build.rollupOptions = {
|
|
2420
2436
|
...F.build.rollupOptions,
|
|
2421
|
-
output: await
|
|
2437
|
+
output: await mn(
|
|
2422
2438
|
y,
|
|
2423
2439
|
b.build?.rollupOptions?.output,
|
|
2424
|
-
|
|
2440
|
+
W,
|
|
2425
2441
|
R.outDir
|
|
2426
2442
|
),
|
|
2427
2443
|
preserveEntrySignatures: "exports-only",
|
|
2428
|
-
onwarn: (Z,
|
|
2429
|
-
Z.plugin === "typescript" && Z.message.includes("outputToFilesystem") || (
|
|
2444
|
+
onwarn: (Z, Ue) => {
|
|
2445
|
+
Z.plugin === "typescript" && Z.message.includes("outputToFilesystem") || (A ? A(Z, Ue) : Ue(Z));
|
|
2430
2446
|
}
|
|
2431
2447
|
}, R.target === "ssr" ? n === "build" && (F.publicDir = !1, F.build.ssr = !0, b.build?.minify == null && g === "production" && (F.build.minify = !0)) : R.target === "client" || (R.target === "lib" ? (F.build.minify = !1, F.build.rollupOptions.external = [
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2448
|
+
qe,
|
|
2449
|
+
Le,
|
|
2450
|
+
Fe,
|
|
2451
|
+
Je,
|
|
2452
|
+
Ye,
|
|
2437
2453
|
re,
|
|
2438
2454
|
se
|
|
2439
2455
|
]) : F.define = {
|
|
2440
2456
|
[J]: !0,
|
|
2441
2457
|
[te]: !0,
|
|
2442
2458
|
[X]: !1
|
|
2443
|
-
}), globalThis.qDev =
|
|
2459
|
+
}), globalThis.qDev = M, globalThis.qTest = !0, globalThis.qInspector = pe;
|
|
2444
2460
|
}
|
|
2445
2461
|
return F;
|
|
2446
2462
|
},
|
|
2447
|
-
configEnvironment(b,
|
|
2463
|
+
configEnvironment(b, S, x) {
|
|
2448
2464
|
return b === "ssr" ? {
|
|
2449
2465
|
resolve: {
|
|
2450
|
-
noExternal: [
|
|
2466
|
+
noExternal: [qe, Le, Fe, re]
|
|
2451
2467
|
}
|
|
2452
2468
|
} : g === "production" ? {
|
|
2453
2469
|
resolve: {
|
|
@@ -2461,32 +2477,32 @@ function Ur(e = {}) {
|
|
|
2461
2477
|
b.build.sourcemap && e.optimizerOptions?.sourcemap === void 0 && y.setSourceMapSupport(!0), d ? y.normalizeOptions(d) : y.normalizeOptions(e);
|
|
2462
2478
|
},
|
|
2463
2479
|
async buildStart() {
|
|
2464
|
-
|
|
2480
|
+
l.length = 0;
|
|
2465
2481
|
const b = this.resolve.bind(this);
|
|
2466
|
-
await y.validateSource(b), y.onDiagnostics((
|
|
2467
|
-
|
|
2468
|
-
const
|
|
2469
|
-
|
|
2482
|
+
await y.validateSource(b), y.onDiagnostics((S, x, U) => {
|
|
2483
|
+
S.forEach((_) => {
|
|
2484
|
+
const P = y.normalizePath(x.sys.path.join(U, _.file));
|
|
2485
|
+
_.category === "error" ? this.error(ze(P, _)) : this.warn(ze(P, _));
|
|
2470
2486
|
});
|
|
2471
2487
|
}), await y.buildStart(this);
|
|
2472
2488
|
},
|
|
2473
|
-
resolveId(b,
|
|
2474
|
-
if (b.endsWith(
|
|
2475
|
-
return
|
|
2489
|
+
resolveId(b, S, x) {
|
|
2490
|
+
if (b.endsWith(Qe))
|
|
2491
|
+
return Qe;
|
|
2476
2492
|
const U = s(b, "resolveId");
|
|
2477
|
-
return oe(b) || !U ? null : y.resolveId(this, b,
|
|
2493
|
+
return oe(b) || !U ? null : y.resolveId(this, b, S, x);
|
|
2478
2494
|
},
|
|
2479
|
-
load(b,
|
|
2480
|
-
if (b ===
|
|
2481
|
-
return { code:
|
|
2495
|
+
load(b, S) {
|
|
2496
|
+
if (b === Qe)
|
|
2497
|
+
return { code: jr };
|
|
2482
2498
|
const x = s(b, "load");
|
|
2483
2499
|
return oe(b) || !x ? null : (b = y.normalizePath(b), n === "serve" && b.endsWith(se) ? {
|
|
2484
2500
|
code: "export const manifest = undefined;"
|
|
2485
|
-
} : y.load(this, b,
|
|
2501
|
+
} : y.load(this, b, S));
|
|
2486
2502
|
},
|
|
2487
|
-
transform(b,
|
|
2488
|
-
if (
|
|
2489
|
-
const
|
|
2503
|
+
transform(b, S, x) {
|
|
2504
|
+
if (S.includes(".vite/deps/") && b.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(b)) {
|
|
2505
|
+
const P = f && S.startsWith(f) ? S.slice(f.length) : S;
|
|
2490
2506
|
throw new Error(
|
|
2491
2507
|
`
|
|
2492
2508
|
|
|
@@ -2495,80 +2511,80 @@ function Ur(e = {}) {
|
|
|
2495
2511
|
⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
|
|
2496
2512
|
|
|
2497
2513
|
👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
|
|
2498
|
-
👉 ${
|
|
2514
|
+
👉 ${P}
|
|
2499
2515
|
|
|
2500
2516
|
==============
|
|
2501
2517
|
|
|
2502
2518
|
`
|
|
2503
2519
|
);
|
|
2504
2520
|
}
|
|
2505
|
-
const U = s(
|
|
2506
|
-
return oe(
|
|
2521
|
+
const U = s(S, "transform"), _ = S.includes("?raw");
|
|
2522
|
+
return oe(S) || !U || _ ? null : y.transform(this, b, S, x);
|
|
2507
2523
|
}
|
|
2508
2524
|
}, {
|
|
2509
2525
|
name: "vite-plugin-qwik-post",
|
|
2510
2526
|
enforce: "post",
|
|
2511
2527
|
generateBundle: {
|
|
2512
2528
|
order: "post",
|
|
2513
|
-
async handler(b,
|
|
2529
|
+
async handler(b, S) {
|
|
2514
2530
|
if (this.environment.config.consumer === "client") {
|
|
2515
2531
|
const U = y.getOptions();
|
|
2516
|
-
for (const [
|
|
2517
|
-
if (
|
|
2518
|
-
const
|
|
2519
|
-
if (
|
|
2520
|
-
typeof
|
|
2532
|
+
for (const [_, P] of Object.entries(S))
|
|
2533
|
+
if (P.type === "asset") {
|
|
2534
|
+
const W = o + _;
|
|
2535
|
+
if (Mr.some((K) => _.endsWith(K)))
|
|
2536
|
+
typeof P.source == "string" && P.source.length < U.inlineStylesUpToBytes ? l.push({
|
|
2521
2537
|
tag: "style",
|
|
2522
2538
|
location: "head",
|
|
2523
2539
|
attributes: {
|
|
2524
|
-
"data-src":
|
|
2525
|
-
dangerouslySetInnerHTML:
|
|
2540
|
+
"data-src": W,
|
|
2541
|
+
dangerouslySetInnerHTML: P.source
|
|
2526
2542
|
}
|
|
2527
|
-
}) :
|
|
2543
|
+
}) : l.push({
|
|
2528
2544
|
tag: "link",
|
|
2529
2545
|
location: "head",
|
|
2530
2546
|
attributes: {
|
|
2531
2547
|
rel: "stylesheet",
|
|
2532
|
-
href:
|
|
2548
|
+
href: W
|
|
2533
2549
|
}
|
|
2534
2550
|
});
|
|
2535
2551
|
else {
|
|
2536
|
-
const
|
|
2537
|
-
|
|
2552
|
+
const K = Or.find((R) => _.endsWith(R));
|
|
2553
|
+
K && !p && l.unshift({
|
|
2538
2554
|
tag: "link",
|
|
2539
2555
|
location: "head",
|
|
2540
2556
|
attributes: {
|
|
2541
2557
|
rel: "preload",
|
|
2542
|
-
href:
|
|
2558
|
+
href: W,
|
|
2543
2559
|
as: "font",
|
|
2544
|
-
type: `font/${
|
|
2560
|
+
type: `font/${K.slice(1)}`,
|
|
2545
2561
|
crossorigin: ""
|
|
2546
2562
|
}
|
|
2547
2563
|
});
|
|
2548
2564
|
}
|
|
2549
2565
|
}
|
|
2550
|
-
await y.generateManifest(this,
|
|
2551
|
-
injections:
|
|
2566
|
+
await y.generateManifest(this, S, O, {
|
|
2567
|
+
injections: l,
|
|
2552
2568
|
platform: { vite: "" }
|
|
2553
2569
|
});
|
|
2554
2570
|
}
|
|
2555
2571
|
}
|
|
2556
2572
|
},
|
|
2557
|
-
async writeBundle(b,
|
|
2573
|
+
async writeBundle(b, S) {
|
|
2558
2574
|
const x = y.getOptions();
|
|
2559
2575
|
if (this.environment.config.consumer === "server") {
|
|
2560
|
-
const
|
|
2561
|
-
if (
|
|
2562
|
-
const
|
|
2576
|
+
const _ = y.getSys();
|
|
2577
|
+
if (_.env === "node" || _.env === "bun" || _.env === "deno") {
|
|
2578
|
+
const P = Object.keys(S), W = async (K) => {
|
|
2563
2579
|
try {
|
|
2564
|
-
const R =
|
|
2580
|
+
const R = _.path.basename(K), Y = _.path.extname(R);
|
|
2565
2581
|
if ((R.startsWith("entry.") || R.startsWith("entry_")) && !R.includes("preview") && (Y === ".mjs" || Y === ".cjs")) {
|
|
2566
|
-
const te =
|
|
2567
|
-
if (!
|
|
2568
|
-
const F =
|
|
2569
|
-
await
|
|
2570
|
-
|
|
2571
|
-
`export * from "./${
|
|
2582
|
+
const te = _.path.basename(R, Y), X = `${te}.js`, M = te + Y;
|
|
2583
|
+
if (!P.some((F) => _.path.basename(F) === X)) {
|
|
2584
|
+
const F = _.path.dirname(K), A = await _.dynamicImport("node:fs"), Z = _.path.join(x.outDir, F);
|
|
2585
|
+
await A.promises.mkdir(Z, { recursive: !0 }), await A.promises.writeFile(
|
|
2586
|
+
_.path.join(Z, X),
|
|
2587
|
+
`export * from "./${M}";`
|
|
2572
2588
|
);
|
|
2573
2589
|
}
|
|
2574
2590
|
}
|
|
@@ -2576,50 +2592,58 @@ function Ur(e = {}) {
|
|
|
2576
2592
|
console.error("patchModuleFormat", R);
|
|
2577
2593
|
}
|
|
2578
2594
|
};
|
|
2579
|
-
await Promise.all(
|
|
2595
|
+
await Promise.all(P.map(W));
|
|
2580
2596
|
}
|
|
2581
2597
|
}
|
|
2582
2598
|
},
|
|
2583
2599
|
transformIndexHtml() {
|
|
2584
2600
|
if (n === "serve")
|
|
2585
|
-
return
|
|
2601
|
+
return _n(y.getOptions(), o);
|
|
2586
2602
|
},
|
|
2587
2603
|
configureServer(b) {
|
|
2588
|
-
m = b, y.configureServer(b), (e?.devTools?.imageDevTools ?? !0) && b.middlewares.use(
|
|
2604
|
+
m = b, y.configureServer(b), (e?.devTools?.imageDevTools ?? !0) && b.middlewares.use(Cr(y.getSys(), f, c));
|
|
2589
2605
|
},
|
|
2590
2606
|
configurePreviewServer(b) {
|
|
2591
2607
|
return async () => {
|
|
2592
|
-
const
|
|
2593
|
-
await
|
|
2608
|
+
const S = y.getSys(), x = y.getPath();
|
|
2609
|
+
await kn(b.middlewares, t, S, x);
|
|
2594
2610
|
};
|
|
2595
2611
|
},
|
|
2596
2612
|
hotUpdate(b) {
|
|
2597
2613
|
y.hotUpdate(this.environment, b);
|
|
2598
|
-
const
|
|
2614
|
+
const S = e?.devTools?.hmr ?? !0;
|
|
2599
2615
|
if (this.environment.name === "ssr" && b.modules.length)
|
|
2600
|
-
if (
|
|
2601
|
-
const x =
|
|
2602
|
-
|
|
2616
|
+
if (S) {
|
|
2617
|
+
const x = /* @__PURE__ */ new Set(), U = (_) => /\.[mc]?[jt]sx?$/.test(_.split("?")[0]);
|
|
2618
|
+
for (const _ of b.modules) {
|
|
2619
|
+
const P = _.url.split("?")[0];
|
|
2620
|
+
if (_.type === "js" && U(_.url))
|
|
2621
|
+
x.add(P);
|
|
2622
|
+
else
|
|
2623
|
+
for (const W of _.importers)
|
|
2624
|
+
W.type === "js" && U(W.url) && x.add(W.url.split("?")[0]);
|
|
2625
|
+
}
|
|
2626
|
+
x.size > 0 && m && m.environments.client.hot.send({
|
|
2603
2627
|
type: "custom",
|
|
2604
2628
|
event: "qwik:hmr",
|
|
2605
|
-
data: { files: x }
|
|
2629
|
+
data: { files: [...x], t: b.timestamp }
|
|
2606
2630
|
});
|
|
2607
2631
|
} else
|
|
2608
2632
|
m?.environments.client.hot.send({ type: "full-reload" });
|
|
2609
2633
|
},
|
|
2610
|
-
onLog(b,
|
|
2611
|
-
if (
|
|
2612
|
-
const x =
|
|
2634
|
+
onLog(b, S) {
|
|
2635
|
+
if (S.plugin == "vite-plugin-qwik") {
|
|
2636
|
+
const x = Lr[b] || ae.White, U = (S.frame || "").split(`
|
|
2613
2637
|
`).map(
|
|
2614
|
-
(
|
|
2638
|
+
(_) => (_.match(/^\s*\^\s*$/) ? ae.BrightWhite : ae.BrightBlack) + _
|
|
2615
2639
|
);
|
|
2616
2640
|
return console[b](
|
|
2617
2641
|
`${x}%s
|
|
2618
2642
|
${ae.BrightWhite}%s
|
|
2619
2643
|
%s${ae.RESET}`,
|
|
2620
|
-
`[${
|
|
2644
|
+
`[${S.plugin}](${b}): ${S.message}
|
|
2621
2645
|
`,
|
|
2622
|
-
` ${
|
|
2646
|
+
` ${S?.loc?.file}:${S?.loc?.line}:${S?.loc?.column}
|
|
2623
2647
|
`,
|
|
2624
2648
|
` ${U.join(`
|
|
2625
2649
|
`)}
|
|
@@ -2627,9 +2651,9 @@ ${ae.BrightWhite}%s
|
|
|
2627
2651
|
), !1;
|
|
2628
2652
|
}
|
|
2629
2653
|
}
|
|
2630
|
-
},
|
|
2654
|
+
}, qr()];
|
|
2631
2655
|
}
|
|
2632
|
-
async function
|
|
2656
|
+
async function qr() {
|
|
2633
2657
|
let e, n, i = !1;
|
|
2634
2658
|
async function r() {
|
|
2635
2659
|
if (i)
|
|
@@ -2642,7 +2666,7 @@ async function jr() {
|
|
|
2642
2666
|
}
|
|
2643
2667
|
const o = /* @__PURE__ */ new Set(), u = [];
|
|
2644
2668
|
let a;
|
|
2645
|
-
const
|
|
2669
|
+
const c = "@qwik.dev/core", f = "@builder.io/qwik";
|
|
2646
2670
|
async function t(m) {
|
|
2647
2671
|
try {
|
|
2648
2672
|
const v = n.join(m, "package.json"), d = await e.readFile(v, { encoding: "utf-8" }), s = JSON.parse(d);
|
|
@@ -2662,8 +2686,8 @@ async function jr() {
|
|
|
2662
2686
|
await e.access(d);
|
|
2663
2687
|
const p = await e.readFile(d, {
|
|
2664
2688
|
encoding: "utf-8"
|
|
2665
|
-
}),
|
|
2666
|
-
return !!(
|
|
2689
|
+
}), l = JSON.parse(p);
|
|
2690
|
+
return !!(l.qwik || l.dependencies?.[c] || l.peerDependencies?.[c] || l.devDependencies?.[c] || l.dependencies?.[f] || l.peerDependencies?.[f] || l.devDependencies?.[f]);
|
|
2667
2691
|
} catch {
|
|
2668
2692
|
}
|
|
2669
2693
|
const s = n.dirname(v);
|
|
@@ -2687,9 +2711,9 @@ async function jr() {
|
|
|
2687
2711
|
return;
|
|
2688
2712
|
const v = m.root || process.cwd(), d = m.optimizeDeps?.exclude ?? [], s = await t(v);
|
|
2689
2713
|
u.length = 0;
|
|
2690
|
-
for (const
|
|
2691
|
-
await g(
|
|
2692
|
-
const p = u.filter((
|
|
2714
|
+
for (const l of s)
|
|
2715
|
+
await g(l, v) && u.push(l);
|
|
2716
|
+
const p = u.filter((l) => !d.includes(l));
|
|
2693
2717
|
return {
|
|
2694
2718
|
optimizeDeps: { exclude: p },
|
|
2695
2719
|
ssr: { noExternal: p }
|
|
@@ -2718,13 +2742,13 @@ async function jr() {
|
|
|
2718
2742
|
if (o.has(p))
|
|
2719
2743
|
return;
|
|
2720
2744
|
o.add(m), o.add(p);
|
|
2721
|
-
let
|
|
2745
|
+
let l;
|
|
2722
2746
|
try {
|
|
2723
|
-
|
|
2747
|
+
l = await this.resolve(p, v, { ...d, skipSelf: !0 });
|
|
2724
2748
|
} catch {
|
|
2725
2749
|
return;
|
|
2726
2750
|
}
|
|
2727
|
-
if (
|
|
2751
|
+
if (l?.external && await g(p, v ? n.dirname(v) : a))
|
|
2728
2752
|
throw new Error(
|
|
2729
2753
|
`
|
|
2730
2754
|
==============
|
|
@@ -2734,7 +2758,7 @@ Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]"
|
|
|
2734
2758
|
`
|
|
2735
2759
|
);
|
|
2736
2760
|
if (p === m)
|
|
2737
|
-
return
|
|
2761
|
+
return l;
|
|
2738
2762
|
}
|
|
2739
2763
|
}
|
|
2740
2764
|
};
|
|
@@ -2746,12 +2770,12 @@ const ae = {
|
|
|
2746
2770
|
BrightBlack: "\x1B[90m",
|
|
2747
2771
|
BrightWhite: "\x1B[97m",
|
|
2748
2772
|
RESET: "\x1B[0m"
|
|
2749
|
-
},
|
|
2773
|
+
}, Lr = {
|
|
2750
2774
|
warn: ae.Yellow,
|
|
2751
2775
|
info: ae.Cyan,
|
|
2752
2776
|
debug: ae.BrightBlack
|
|
2753
2777
|
};
|
|
2754
2778
|
export {
|
|
2755
|
-
|
|
2756
|
-
|
|
2779
|
+
Ur as qwikRollup,
|
|
2780
|
+
Rr as qwikVite
|
|
2757
2781
|
};
|