@qwik.dev/core 2.0.0-beta.19 → 2.0.0-beta.21
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/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +175 -94
- package/dist/core.min.mjs +2 -1
- package/dist/core.mjs +969 -935
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +620 -666
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +841 -842
- package/dist/qwikloader.debug.js +144 -144
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +55 -23
- package/dist/testing/index.d.ts +28 -20
- package/dist/testing/index.mjs +3547 -3572
- package/dist/testing/package.json +1 -1
- package/package.json +2 -2
- package/public.d.ts +2 -2
package/dist/optimizer.mjs
CHANGED
|
@@ -1,160 +1,160 @@
|
|
|
1
1
|
function jt(e = {}) {
|
|
2
|
-
function n(
|
|
3
|
-
if (typeof
|
|
4
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
5
|
-
}
|
|
6
|
-
function i(
|
|
7
|
-
let
|
|
8
|
-
for (let
|
|
9
|
-
if (
|
|
10
|
-
|
|
2
|
+
function n(h) {
|
|
3
|
+
if (typeof h != "string")
|
|
4
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(h));
|
|
5
|
+
}
|
|
6
|
+
function i(h, c) {
|
|
7
|
+
let m = "", k = 0, u = -1, b = 0, f;
|
|
8
|
+
for (let I = 0; I <= h.length; ++I) {
|
|
9
|
+
if (I < h.length)
|
|
10
|
+
f = h.charCodeAt(I);
|
|
11
11
|
else {
|
|
12
|
-
if (
|
|
12
|
+
if (f === 47)
|
|
13
13
|
break;
|
|
14
|
-
|
|
14
|
+
f = 47;
|
|
15
15
|
}
|
|
16
|
-
if (
|
|
17
|
-
if (!(u ===
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
|
|
16
|
+
if (f === 47) {
|
|
17
|
+
if (!(u === I - 1 || b === 1)) if (u !== I - 1 && b === 2) {
|
|
18
|
+
if (m.length < 2 || k !== 2 || m.charCodeAt(m.length - 1) !== 46 || m.charCodeAt(m.length - 2) !== 46) {
|
|
19
|
+
if (m.length > 2) {
|
|
20
|
+
const S = m.lastIndexOf("/");
|
|
21
|
+
if (S !== m.length - 1) {
|
|
22
|
+
S === -1 ? (m = "", k = 0) : (m = m.slice(0, S), k = m.length - 1 - m.lastIndexOf("/")), u = I, b = 0;
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
|
-
} else if (
|
|
26
|
-
|
|
25
|
+
} else if (m.length === 2 || m.length === 1) {
|
|
26
|
+
m = "", k = 0, u = I, b = 0;
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
c && (
|
|
30
|
+
c && (m.length > 0 ? m += "/.." : m = "..", k = 2);
|
|
31
31
|
} else
|
|
32
|
-
|
|
33
|
-
u =
|
|
34
|
-
} else
|
|
32
|
+
m.length > 0 ? m += "/" + h.slice(u + 1, I) : m = h.slice(u + 1, I), k = I - u - 1;
|
|
33
|
+
u = I, b = 0;
|
|
34
|
+
} else f === 46 && b !== -1 ? ++b : b = -1;
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return m;
|
|
37
37
|
}
|
|
38
|
-
function r(
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
function r(h, c) {
|
|
39
|
+
const m = c.dir || c.root, k = c.base || (c.name || "") + (c.ext || "");
|
|
40
|
+
return m ? m === c.root ? m + k : m + h + k : k;
|
|
41
41
|
}
|
|
42
42
|
const o = function(...c) {
|
|
43
|
-
let
|
|
43
|
+
let m = "", k = !1, u;
|
|
44
44
|
for (let b = c.length - 1; b >= -1 && !k; b--) {
|
|
45
|
-
let
|
|
46
|
-
b >= 0 ?
|
|
45
|
+
let f;
|
|
46
|
+
b >= 0 ? f = c[b] : (u === void 0 && (e && typeof e.cwd == "function" ? u = e.cwd() : typeof process < "u" && typeof process.cwd == "function" ? u = process.cwd() : u = "/"), f = u), n(f), f.length !== 0 && (m = f + "/" + m, k = f.charCodeAt(0) === 47);
|
|
47
47
|
}
|
|
48
|
-
return
|
|
49
|
-
},
|
|
48
|
+
return m = i(m, !k), k ? m.length > 0 ? "/" + m : "/" : m.length > 0 ? m : ".";
|
|
49
|
+
}, g = function(c) {
|
|
50
50
|
if (n(c), c.length === 0)
|
|
51
51
|
return ".";
|
|
52
|
-
const
|
|
53
|
-
return c = i(c, !
|
|
52
|
+
const m = c.charCodeAt(0) === 47, k = c.charCodeAt(c.length - 1) === 47;
|
|
53
|
+
return c = i(c, !m), c.length === 0 && !m && (c = "."), c.length > 0 && k && (c += "/"), m ? "/" + c : c;
|
|
54
54
|
}, d = function(c) {
|
|
55
55
|
return n(c), c.length > 0 && c.charCodeAt(0) === 47;
|
|
56
56
|
}, a = function(...c) {
|
|
57
57
|
if (c.length === 0)
|
|
58
58
|
return ".";
|
|
59
|
-
let
|
|
59
|
+
let m;
|
|
60
60
|
for (let k = 0; k < c.length; ++k) {
|
|
61
61
|
const u = c[k];
|
|
62
|
-
n(u), u.length > 0 && (
|
|
62
|
+
n(u), u.length > 0 && (m === void 0 ? m = u : m += "/" + u);
|
|
63
63
|
}
|
|
64
|
-
return
|
|
65
|
-
},
|
|
66
|
-
if (n(c), n(
|
|
64
|
+
return m === void 0 ? "." : g(m);
|
|
65
|
+
}, p = function(c, m) {
|
|
66
|
+
if (n(c), n(m), c === m || (c = o(c), m = o(m), c === m))
|
|
67
67
|
return "";
|
|
68
68
|
let k = 1;
|
|
69
69
|
for (; k < c.length && c.charCodeAt(k) === 47; ++k)
|
|
70
70
|
;
|
|
71
71
|
const u = c.length, b = u - k;
|
|
72
|
-
let
|
|
73
|
-
for (;
|
|
72
|
+
let f = 1;
|
|
73
|
+
for (; f < m.length && m.charCodeAt(f) === 47; ++f)
|
|
74
74
|
;
|
|
75
|
-
const
|
|
76
|
-
let
|
|
77
|
-
for (;
|
|
78
|
-
if (
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
if (
|
|
83
|
-
return
|
|
84
|
-
} else b >
|
|
75
|
+
const S = m.length - f, q = b < S ? b : S;
|
|
76
|
+
let D = -1, P = 0;
|
|
77
|
+
for (; P <= q; ++P) {
|
|
78
|
+
if (P === q) {
|
|
79
|
+
if (S > q) {
|
|
80
|
+
if (m.charCodeAt(f + P) === 47)
|
|
81
|
+
return m.slice(f + P + 1);
|
|
82
|
+
if (P === 0)
|
|
83
|
+
return m.slice(f + P);
|
|
84
|
+
} else b > q && (c.charCodeAt(k + P) === 47 ? D = P : P === 0 && (D = 0));
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
87
|
+
const A = c.charCodeAt(k + P), G = m.charCodeAt(f + P);
|
|
88
|
+
if (A !== G)
|
|
89
89
|
break;
|
|
90
|
-
|
|
90
|
+
A === 47 && (D = P);
|
|
91
91
|
}
|
|
92
|
-
let
|
|
93
|
-
for (
|
|
94
|
-
(
|
|
95
|
-
return
|
|
92
|
+
let $ = "";
|
|
93
|
+
for (P = k + D + 1; P <= u; ++P)
|
|
94
|
+
(P === u || c.charCodeAt(P) === 47) && ($.length === 0 ? $ += ".." : $ += "/..");
|
|
95
|
+
return $.length > 0 ? $ + m.slice(f + D) : (f += D, m.charCodeAt(f) === 47 && ++f, m.slice(f));
|
|
96
96
|
}, t = function(c) {
|
|
97
97
|
if (n(c), c.length === 0)
|
|
98
98
|
return ".";
|
|
99
|
-
let
|
|
100
|
-
const k =
|
|
99
|
+
let m = c.charCodeAt(0);
|
|
100
|
+
const k = m === 47;
|
|
101
101
|
let u = -1, b = !0;
|
|
102
|
-
for (let
|
|
103
|
-
if (
|
|
102
|
+
for (let f = c.length - 1; f >= 1; --f)
|
|
103
|
+
if (m = c.charCodeAt(f), m === 47) {
|
|
104
104
|
if (!b) {
|
|
105
|
-
u =
|
|
105
|
+
u = f;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
} else
|
|
109
109
|
b = !1;
|
|
110
110
|
return u === -1 ? k ? "/" : "." : k && u === 1 ? "//" : c.slice(0, u);
|
|
111
|
-
}, v = function(c,
|
|
112
|
-
if (
|
|
111
|
+
}, v = function(c, m) {
|
|
112
|
+
if (m !== void 0 && typeof m != "string")
|
|
113
113
|
throw new TypeError('"ext" argument must be a string');
|
|
114
114
|
n(c);
|
|
115
|
-
let k = 0, u = -1, b = !0,
|
|
116
|
-
if (
|
|
117
|
-
if (
|
|
115
|
+
let k = 0, u = -1, b = !0, f;
|
|
116
|
+
if (m !== void 0 && m.length > 0 && m.length <= c.length) {
|
|
117
|
+
if (m.length === c.length && m === c)
|
|
118
118
|
return "";
|
|
119
|
-
let
|
|
120
|
-
for (
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
119
|
+
let I = m.length - 1, S = -1;
|
|
120
|
+
for (f = c.length - 1; f >= 0; --f) {
|
|
121
|
+
const q = c.charCodeAt(f);
|
|
122
|
+
if (q === 47) {
|
|
123
123
|
if (!b) {
|
|
124
|
-
k =
|
|
124
|
+
k = f + 1;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
} else
|
|
128
|
-
|
|
128
|
+
S === -1 && (b = !1, S = f + 1), I >= 0 && (q === m.charCodeAt(I) ? --I === -1 && (u = f) : (I = -1, u = S));
|
|
129
129
|
}
|
|
130
|
-
return k === u ? u =
|
|
130
|
+
return k === u ? u = S : u === -1 && (u = c.length), c.slice(k, u);
|
|
131
131
|
} else {
|
|
132
|
-
for (
|
|
133
|
-
if (c.charCodeAt(
|
|
132
|
+
for (f = c.length - 1; f >= 0; --f)
|
|
133
|
+
if (c.charCodeAt(f) === 47) {
|
|
134
134
|
if (!b) {
|
|
135
|
-
k =
|
|
135
|
+
k = f + 1;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
|
-
} else u === -1 && (b = !1, u =
|
|
138
|
+
} else u === -1 && (b = !1, u = f + 1);
|
|
139
139
|
return u === -1 ? "" : c.slice(k, u);
|
|
140
140
|
}
|
|
141
141
|
}, w = function(c) {
|
|
142
142
|
n(c);
|
|
143
|
-
let
|
|
144
|
-
for (let
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
143
|
+
let m = -1, k = 0, u = -1, b = !0, f = 0;
|
|
144
|
+
for (let I = c.length - 1; I >= 0; --I) {
|
|
145
|
+
const S = c.charCodeAt(I);
|
|
146
|
+
if (S === 47) {
|
|
147
147
|
if (!b) {
|
|
148
|
-
k =
|
|
148
|
+
k = I + 1;
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
|
-
u === -1 && (b = !1, u =
|
|
153
|
+
u === -1 && (b = !1, u = I + 1), S === 46 ? m === -1 ? m = I : f !== 1 && (f = 1) : m !== -1 && (f = -1);
|
|
154
154
|
}
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
return m === -1 || u === -1 || // We saw a non-dot character immediately before the dot
|
|
156
|
+
f === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
157
|
+
f === 1 && m === u - 1 && m === k + 1 ? "" : c.slice(m, u);
|
|
158
158
|
}, x = function(c) {
|
|
159
159
|
if (c === null || typeof c != "object")
|
|
160
160
|
throw new TypeError(
|
|
@@ -163,7 +163,7 @@ function jt(e = {}) {
|
|
|
163
163
|
return r("/", c);
|
|
164
164
|
}, _ = function(c) {
|
|
165
165
|
n(c);
|
|
166
|
-
const
|
|
166
|
+
const m = {
|
|
167
167
|
root: "",
|
|
168
168
|
dir: "",
|
|
169
169
|
base: "",
|
|
@@ -171,48 +171,48 @@ function jt(e = {}) {
|
|
|
171
171
|
name: ""
|
|
172
172
|
};
|
|
173
173
|
if (c.length === 0)
|
|
174
|
-
return
|
|
174
|
+
return m;
|
|
175
175
|
let k = c.charCodeAt(0), u;
|
|
176
176
|
const b = k === 47;
|
|
177
|
-
b ? (
|
|
178
|
-
let
|
|
179
|
-
for (;
|
|
180
|
-
if (k = c.charCodeAt(
|
|
181
|
-
if (!
|
|
182
|
-
|
|
177
|
+
b ? (m.root = "/", u = 1) : u = 0;
|
|
178
|
+
let f = -1, I = 0, S = -1, q = !0, D = c.length - 1, P = 0;
|
|
179
|
+
for (; D >= u; --D) {
|
|
180
|
+
if (k = c.charCodeAt(D), k === 47) {
|
|
181
|
+
if (!q) {
|
|
182
|
+
I = D + 1;
|
|
183
183
|
break;
|
|
184
184
|
}
|
|
185
185
|
continue;
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
S === -1 && (q = !1, S = D + 1), k === 46 ? f === -1 ? f = D : P !== 1 && (P = 1) : f !== -1 && (P = -1);
|
|
188
188
|
}
|
|
189
|
-
return
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
return f === -1 || S === -1 || // We saw a non-dot character immediately before the dot
|
|
190
|
+
P === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
191
|
+
P === 1 && f === S - 1 && f === I + 1 ? S !== -1 && (I === 0 && b ? m.base = m.name = c.slice(1, S) : m.base = m.name = c.slice(I, S)) : (I === 0 && b ? (m.name = c.slice(1, f), m.base = c.slice(1, S)) : (m.name = c.slice(I, f), m.base = c.slice(I, S)), m.ext = c.slice(f, S)), I > 0 ? m.dir = c.slice(0, I - 1) : b && (m.dir = "/"), m;
|
|
192
192
|
}, s = "/", l = ":";
|
|
193
193
|
return {
|
|
194
|
-
relative:
|
|
194
|
+
relative: p,
|
|
195
195
|
resolve: o,
|
|
196
196
|
parse: _,
|
|
197
197
|
format: x,
|
|
198
198
|
join: a,
|
|
199
199
|
isAbsolute: d,
|
|
200
200
|
basename: v,
|
|
201
|
-
normalize:
|
|
201
|
+
normalize: g,
|
|
202
202
|
dirname: t,
|
|
203
203
|
extname: w,
|
|
204
204
|
delimiter: l,
|
|
205
205
|
sep: s,
|
|
206
206
|
win32: null,
|
|
207
207
|
posix: {
|
|
208
|
-
relative:
|
|
208
|
+
relative: p,
|
|
209
209
|
resolve: o,
|
|
210
210
|
parse: _,
|
|
211
211
|
format: x,
|
|
212
212
|
join: a,
|
|
213
213
|
isAbsolute: d,
|
|
214
214
|
basename: v,
|
|
215
|
-
normalize:
|
|
215
|
+
normalize: g,
|
|
216
216
|
dirname: t,
|
|
217
217
|
extname: w,
|
|
218
218
|
delimiter: l,
|
|
@@ -263,7 +263,7 @@ const Ut = {
|
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
async function Bt() {
|
|
266
|
-
const e =
|
|
266
|
+
const e = _t(), n = {
|
|
267
267
|
dynamicImport: (i) => {
|
|
268
268
|
throw new Error(
|
|
269
269
|
`Qwik Optimizer sys.dynamicImport() not implemented, trying to import: "${i}"`
|
|
@@ -287,7 +287,7 @@ async function Bt() {
|
|
|
287
287
|
return n;
|
|
288
288
|
}
|
|
289
289
|
async function At(e) {
|
|
290
|
-
const n =
|
|
290
|
+
const n = _t();
|
|
291
291
|
if (n === "node" || n === "bun") {
|
|
292
292
|
const i = Ut[process.platform];
|
|
293
293
|
if (i) {
|
|
@@ -298,23 +298,23 @@ async function At(e) {
|
|
|
298
298
|
return (await e.dynamicImport("node:module")).default.createRequire(import.meta.url)(
|
|
299
299
|
`../bindings/${o.platformArchABI}`
|
|
300
300
|
);
|
|
301
|
-
} catch (
|
|
301
|
+
} catch (g) {
|
|
302
302
|
console.warn(
|
|
303
303
|
`Unable to load native binding ${o.platformArchABI}. Falling back to wasm build.`,
|
|
304
|
-
|
|
304
|
+
g?.message
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
if (n === "node" || n === "bun") {
|
|
310
|
-
const i = await e.dynamicImport("node:url"), r = e.path.dirname(i.fileURLToPath(import.meta.url)), o = e.path.join(r, "..", "bindings", "qwik_wasm_bg.wasm"),
|
|
311
|
-
return await
|
|
310
|
+
const i = await e.dynamicImport("node:url"), r = e.path.dirname(i.fileURLToPath(import.meta.url)), o = e.path.join(r, "..", "bindings", "qwik_wasm_bg.wasm"), g = await e.dynamicImport("../bindings/qwik.wasm.mjs"), a = await (await e.dynamicImport("node:fs")).promises.readFile(o), p = await WebAssembly.compile(a);
|
|
311
|
+
return await g.default(p), g;
|
|
312
312
|
} else {
|
|
313
313
|
const i = await e.dynamicImport("../bindings/qwik.wasm.mjs");
|
|
314
314
|
return await i.default(), i;
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
const
|
|
317
|
+
const _t = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof process < "u" && typeof global < "u" && process.versions && process.versions.node ? "node" : typeof self < "u" && typeof location < "u" && typeof navigator < "u" && typeof fetch == "function" && typeof WorkerGlobalScope == "function" && typeof self.importScripts == "function" ? "webworker" : typeof window < "u" && typeof document < "u" && typeof location < "u" && typeof navigator < "u" && typeof Window == "function" && typeof fetch == "function" ? "browsermain" : "unknown", Ft = async (e = {}) => {
|
|
318
318
|
const n = e?.sys || await Bt(), i = e?.binding || await At(n);
|
|
319
319
|
return {
|
|
320
320
|
async transformModules(o) {
|
|
@@ -344,7 +344,7 @@ const Tt = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof
|
|
|
344
344
|
r != null && (n[i] = r);
|
|
345
345
|
}), n.entryStrategy = e.entryStrategy?.type ?? "smart", n.manualChunks = e.entryStrategy?.manual ?? void 0, n;
|
|
346
346
|
}, $r = {
|
|
347
|
-
qwik: "2.0.0-beta.
|
|
347
|
+
qwik: "2.0.0-beta.21-dev+c008e88"
|
|
348
348
|
}, zt = (e, n = 0) => {
|
|
349
349
|
for (let i = 0; i < e.length; i++) {
|
|
350
350
|
const r = e.charCodeAt(i);
|
|
@@ -355,13 +355,13 @@ const Tt = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof
|
|
|
355
355
|
function Wt(e) {
|
|
356
356
|
const n = e.symbols;
|
|
357
357
|
return Object.keys(n).sort((i, r) => {
|
|
358
|
-
const o = n[i],
|
|
359
|
-
if (o.ctxKind === "eventHandler" &&
|
|
358
|
+
const o = n[i], g = n[r];
|
|
359
|
+
if (o.ctxKind === "eventHandler" && g.ctxKind !== "eventHandler")
|
|
360
360
|
return -1;
|
|
361
|
-
if (o.ctxKind !== "eventHandler" &&
|
|
361
|
+
if (o.ctxKind !== "eventHandler" && g.ctxKind === "eventHandler")
|
|
362
362
|
return 1;
|
|
363
|
-
if (o.ctxKind === "eventHandler" &&
|
|
364
|
-
const d =
|
|
363
|
+
if (o.ctxKind === "eventHandler" && g.ctxKind === "eventHandler") {
|
|
364
|
+
const d = Ve.indexOf(o.ctxName.toLowerCase()), a = Ve.indexOf(g.ctxName.toLowerCase());
|
|
365
365
|
if (d > -1 && a > -1) {
|
|
366
366
|
if (d < a)
|
|
367
367
|
return -1;
|
|
@@ -373,8 +373,8 @@ function Wt(e) {
|
|
|
373
373
|
if (a > -1)
|
|
374
374
|
return 1;
|
|
375
375
|
}
|
|
376
|
-
} else if (o.ctxKind === "function" &&
|
|
377
|
-
const d =
|
|
376
|
+
} else if (o.ctxKind === "function" && g.ctxKind === "function") {
|
|
377
|
+
const d = Ze.indexOf(o.ctxName.toLowerCase()), a = Ze.indexOf(g.ctxName.toLowerCase());
|
|
378
378
|
if (d > -1 && a > -1) {
|
|
379
379
|
if (d < a)
|
|
380
380
|
return -1;
|
|
@@ -387,10 +387,10 @@ function Wt(e) {
|
|
|
387
387
|
return 1;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
return !o.parent &&
|
|
390
|
+
return !o.parent && g.parent ? -1 : o.parent && !g.parent ? 1 : o.hash < g.hash ? -1 : o.hash > g.hash ? 1 : 0;
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
|
-
const
|
|
393
|
+
const Ve = [
|
|
394
394
|
// Click Events
|
|
395
395
|
"click",
|
|
396
396
|
"dblclick",
|
|
@@ -446,32 +446,32 @@ const Ze = [
|
|
|
446
446
|
"reset",
|
|
447
447
|
// Scroll Events
|
|
448
448
|
"scroll"
|
|
449
|
-
].map((e) => `on${e.toLowerCase()}$`),
|
|
449
|
+
].map((e) => `on${e.toLowerCase()}$`), Ze = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
|
|
450
450
|
(e) => e.toLowerCase()
|
|
451
451
|
);
|
|
452
452
|
function Gt(e) {
|
|
453
|
-
return Object.keys(e.bundles).sort(
|
|
453
|
+
return Object.keys(e.bundles).sort(je);
|
|
454
454
|
}
|
|
455
455
|
function Kt(e) {
|
|
456
456
|
const n = Wt(e), i = {}, r = {};
|
|
457
457
|
for (const d of n)
|
|
458
458
|
i[d] = e.symbols[d], r[d] = e.mapping[d];
|
|
459
|
-
const o = Gt(e),
|
|
459
|
+
const o = Gt(e), g = {};
|
|
460
460
|
for (const d of o) {
|
|
461
|
-
|
|
461
|
+
g[d] = e.bundles[d];
|
|
462
462
|
const a = e.bundles[d];
|
|
463
|
-
Array.isArray(a.imports) && a.imports.sort(
|
|
464
|
-
const
|
|
463
|
+
Array.isArray(a.imports) && a.imports.sort(je), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(je);
|
|
464
|
+
const p = [];
|
|
465
465
|
for (const t of n)
|
|
466
|
-
d === r[t] &&
|
|
467
|
-
|
|
466
|
+
d === r[t] && p.push(t);
|
|
467
|
+
p.length > 0 && (p.sort(je), a.symbols = p);
|
|
468
468
|
}
|
|
469
|
-
return e.symbols = i, e.mapping = r, e.bundles =
|
|
469
|
+
return e.symbols = i, e.mapping = r, e.bundles = g, e;
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function je(e, n) {
|
|
472
472
|
return e = e.toLocaleLowerCase(), n = n.toLocaleLowerCase(), e < n ? -1 : e > n ? 1 : 0;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function et(e) {
|
|
475
475
|
if (e != null && e.mapping != null && typeof e.mapping == "object" && e.symbols != null && typeof e.symbols == "object" && e.bundles != null && typeof e.bundles == "object")
|
|
476
476
|
return e;
|
|
477
477
|
}
|
|
@@ -480,40 +480,40 @@ const Qt = (e, n) => {
|
|
|
480
480
|
if (e.symbols)
|
|
481
481
|
for (const r of e.symbols) {
|
|
482
482
|
let o = 1;
|
|
483
|
-
const
|
|
484
|
-
|
|
483
|
+
const g = n.symbols[r];
|
|
484
|
+
g && (g.ctxKind === "function" ? /(component|useStyles|useStylesScoped)/i.test(g.ctxName) ? o += 1 : /(useComputed|useTask|useVisibleTask|useOn)/i.test(g.ctxName) && (o += 2) : (o += 1, /(click|mouse|pointer|touch|key|scroll|gesture|wheel)/i.test(g.ctxName) && (o += 3))), i = Math.max(i, o);
|
|
485
485
|
}
|
|
486
486
|
return i;
|
|
487
487
|
};
|
|
488
488
|
function Jt(e) {
|
|
489
489
|
let n = 0;
|
|
490
|
-
const i = [], r = [], o = /* @__PURE__ */ new Map(),
|
|
490
|
+
const i = [], r = [], o = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Set();
|
|
491
491
|
function a(s) {
|
|
492
|
-
o.set(s, n),
|
|
492
|
+
o.set(s, n), g.set(s, n), n++, i.push(s), d.add(s);
|
|
493
493
|
const l = e[s].imports || [];
|
|
494
|
-
for (const
|
|
495
|
-
o.has(
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
494
|
+
for (const h of l)
|
|
495
|
+
o.has(h) ? d.has(h) && g.set(s, Math.min(g.get(s), o.get(h))) : (a(h), g.set(s, Math.min(g.get(s), g.get(h))));
|
|
496
|
+
if (g.get(s) === o.get(s)) {
|
|
497
|
+
const h = [];
|
|
498
498
|
let c;
|
|
499
499
|
do
|
|
500
|
-
c = i.pop(), d.delete(c),
|
|
500
|
+
c = i.pop(), d.delete(c), h.push(c);
|
|
501
501
|
while (c !== s);
|
|
502
|
-
r.push(
|
|
502
|
+
r.push(h);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
for (const s of Object.keys(e))
|
|
506
506
|
o.has(s) || a(s);
|
|
507
|
-
const
|
|
507
|
+
const p = /* @__PURE__ */ new Map();
|
|
508
508
|
r.forEach((s, l) => {
|
|
509
|
-
for (const
|
|
510
|
-
|
|
509
|
+
for (const h of s)
|
|
510
|
+
p.set(h, l);
|
|
511
511
|
});
|
|
512
512
|
const t = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
|
|
513
513
|
for (const s of Object.keys(e)) {
|
|
514
|
-
const l =
|
|
515
|
-
for (const
|
|
516
|
-
const c =
|
|
514
|
+
const l = p.get(s);
|
|
515
|
+
for (const h of e[s].imports || []) {
|
|
516
|
+
const c = p.get(h);
|
|
517
517
|
l !== c && t[l].add(c);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
@@ -530,25 +530,25 @@ function Jt(e) {
|
|
|
530
530
|
const _ = new Array(r.length).fill(0);
|
|
531
531
|
for (let s = 0; s < r.length; s++) {
|
|
532
532
|
let l = 0;
|
|
533
|
-
for (const
|
|
534
|
-
l += e[
|
|
533
|
+
for (const h of r[s])
|
|
534
|
+
l += e[h].size;
|
|
535
535
|
_[s] = l;
|
|
536
536
|
}
|
|
537
537
|
for (let s = w.length - 1; s >= 0; s--) {
|
|
538
538
|
const l = w[s];
|
|
539
|
-
let
|
|
539
|
+
let h = _[l];
|
|
540
540
|
for (const c of t[l])
|
|
541
|
-
|
|
542
|
-
_[l] =
|
|
541
|
+
h += _[c];
|
|
542
|
+
_[l] = h;
|
|
543
543
|
}
|
|
544
544
|
for (let s = 0; s < r.length; s++) {
|
|
545
545
|
const l = _[s];
|
|
546
|
-
for (const
|
|
547
|
-
e[
|
|
546
|
+
for (const h of r[s])
|
|
547
|
+
e[h].total = l;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
function Yt(e, n, i, r, o,
|
|
550
|
+
const tt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, nt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, rt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/, ot = /[/\\](core|qwik)[/\\]handlers\.(|c|m)js$/;
|
|
551
|
+
function Yt(e, n, i, r, o, g, d) {
|
|
552
552
|
var _;
|
|
553
553
|
const a = {
|
|
554
554
|
version: "1",
|
|
@@ -569,7 +569,7 @@ function Yt(e, n, i, r, o, m, d) {
|
|
|
569
569
|
assets: {},
|
|
570
570
|
symbols: {},
|
|
571
571
|
bundleGraph: void 0
|
|
572
|
-
},
|
|
572
|
+
}, p = (s) => {
|
|
573
573
|
const l = r[s];
|
|
574
574
|
if (!l) {
|
|
575
575
|
console.warn(`Client manifest generation: skipping external import "${s}"`);
|
|
@@ -579,7 +579,7 @@ function Yt(e, n, i, r, o, m, d) {
|
|
|
579
579
|
};
|
|
580
580
|
let t, v;
|
|
581
581
|
for (const s of Object.values(r)) {
|
|
582
|
-
const l =
|
|
582
|
+
const l = p(s.fileName);
|
|
583
583
|
s.name === "core" && (t = l), s.name === "preloader" && (v = l);
|
|
584
584
|
}
|
|
585
585
|
let w;
|
|
@@ -596,22 +596,22 @@ function Yt(e, n, i, r, o, m, d) {
|
|
|
596
596
|
size: s.code.length,
|
|
597
597
|
total: -1
|
|
598
598
|
};
|
|
599
|
-
for (const
|
|
600
|
-
x.has(
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
const k = s.dynamicImports.filter((
|
|
604
|
-
k.length > 0 && (c.dynamicImports = k), s.facadeModuleId && (
|
|
605
|
-
const b = (s.moduleIds || Object.keys(s.modules)).filter((
|
|
606
|
-
b.length > 0 && (c.origins = b, !a.preloader && b.some((
|
|
599
|
+
for (const f of s.exports)
|
|
600
|
+
x.has(f) && (!a.mapping[f] || s.exports.length !== 1) && (a.mapping[f] = l);
|
|
601
|
+
const m = s.imports.filter((f) => s.code.includes(e.basename(f))).map((f) => p(f)).filter((f) => f !== v && f !== t).filter(Boolean);
|
|
602
|
+
m.length > 0 && (c.imports = m);
|
|
603
|
+
const k = s.dynamicImports.filter((f) => s.code.includes(e.basename(f))).map((f) => p(f)).filter(Boolean);
|
|
604
|
+
k.length > 0 && (c.dynamicImports = k), s.facadeModuleId && (tt.test(s.facadeModuleId) ? a.preloader = l : nt.test(s.facadeModuleId) ? a.core = l : rt.test(s.facadeModuleId) ? a.qwikLoader = l : ot.test(s.facadeModuleId) && (w = l));
|
|
605
|
+
const b = (s.moduleIds || Object.keys(s.modules)).filter((f) => !f.startsWith("\0")).map((f) => e.relative(o.rootDir, f));
|
|
606
|
+
b.length > 0 && (c.origins = b, !a.preloader && b.some((f) => tt.test(f)) && (a.preloader = l), !a.core && b.some((f) => nt.test(f)) && (a.core = l), !a.qwikLoader && b.some((f) => rt.test(f)) && (a.qwikLoader = l), !w && b.some((f) => ot.test(f)) && (w = l)), a.bundles[l] = c;
|
|
607
607
|
}
|
|
608
608
|
for (const s of n) {
|
|
609
|
-
const l = s.name,
|
|
610
|
-
if (!
|
|
611
|
-
|
|
609
|
+
const l = s.name, h = a.mapping[l];
|
|
610
|
+
if (!h) {
|
|
611
|
+
g(`Note: qrl ${s.name} is not in the bundle, likely tree shaken`, a);
|
|
612
612
|
continue;
|
|
613
613
|
}
|
|
614
|
-
((_ = a.bundles[
|
|
614
|
+
((_ = a.bundles[h]).symbols || (_.symbols = [])).push(l), a.symbols[l] = {
|
|
615
615
|
displayName: s.displayName,
|
|
616
616
|
hash: s.hash,
|
|
617
617
|
ctxKind: s.ctxKind,
|
|
@@ -655,83 +655,83 @@ function en(e, n) {
|
|
|
655
655
|
if (!e.bundles)
|
|
656
656
|
return [];
|
|
657
657
|
const r = { ...e.bundles };
|
|
658
|
-
for (const [
|
|
659
|
-
if (
|
|
658
|
+
for (const [p, t] of Object.entries(e.mapping)) {
|
|
659
|
+
if (p.startsWith("_") && p.length < 10)
|
|
660
660
|
continue;
|
|
661
|
-
const v = Zt(
|
|
661
|
+
const v = Zt(p);
|
|
662
662
|
v && (r[v] = { dynamicImports: [t] });
|
|
663
663
|
}
|
|
664
664
|
if (n) {
|
|
665
|
-
const
|
|
665
|
+
const p = { ...e, bundles: r };
|
|
666
666
|
for (const t of n) {
|
|
667
|
-
const v = t(
|
|
667
|
+
const v = t(p);
|
|
668
668
|
v && Object.assign(r, v);
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
for (const
|
|
672
|
-
const t = r[
|
|
671
|
+
for (const p of Object.keys(r)) {
|
|
672
|
+
const t = r[p], v = t.imports?.filter((x) => r[x]) || [], w = t.dynamicImports?.filter(
|
|
673
673
|
// we only want to include dynamic imports that belong to the app
|
|
674
674
|
// e.g. not all languages supported by shiki
|
|
675
675
|
(x) => r[x] && // either there are qrls
|
|
676
676
|
(r[x].symbols || // or it's a dynamic import from the app source
|
|
677
677
|
r[x].origins?.some((_) => !_.includes("node_modules")))
|
|
678
678
|
) || [];
|
|
679
|
-
r[
|
|
679
|
+
r[p] = {
|
|
680
680
|
...t,
|
|
681
681
|
imports: v,
|
|
682
682
|
dynamicImports: w
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
const o = new Set(Object.keys(r));
|
|
686
|
-
for (const
|
|
687
|
-
for (const t of r[
|
|
686
|
+
for (const p of Object.keys(r)) {
|
|
687
|
+
for (const t of r[p].imports)
|
|
688
688
|
o.delete(t);
|
|
689
|
-
for (const t of r[
|
|
689
|
+
for (const t of r[p].dynamicImports)
|
|
690
690
|
o.delete(t);
|
|
691
691
|
}
|
|
692
|
-
for (const
|
|
693
|
-
const t = r[
|
|
694
|
-
!t.imports?.length && !t.dynamicImports?.length && delete r[
|
|
692
|
+
for (const p of o) {
|
|
693
|
+
const t = r[p];
|
|
694
|
+
!t.imports?.length && !t.dynamicImports?.length && delete r[p];
|
|
695
695
|
}
|
|
696
|
-
const
|
|
696
|
+
const g = Object.keys(r), d = /* @__PURE__ */ new Map(), a = (p, t, v = /* @__PURE__ */ new Set()) => {
|
|
697
697
|
const w = r[t];
|
|
698
698
|
for (const x of w.imports)
|
|
699
|
-
|
|
699
|
+
p.has(x) && p.delete(x), v.has(x) || (v.add(x), a(p, x, v));
|
|
700
700
|
};
|
|
701
|
-
for (const
|
|
702
|
-
const t = r[
|
|
701
|
+
for (const p of g) {
|
|
702
|
+
const t = r[p], v = new Set(t.imports);
|
|
703
703
|
for (const s of v)
|
|
704
704
|
a(v, s);
|
|
705
705
|
const w = new Set(t.dynamicImports), x = /* @__PURE__ */ new Map();
|
|
706
706
|
for (const s of w) {
|
|
707
707
|
a(w, s);
|
|
708
708
|
const l = r[s];
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
709
|
+
let h = 0.5;
|
|
710
|
+
if (h += (l.interactivity || 0) * 0.08, t.origins && l.origins) {
|
|
711
711
|
for (const c of t.origins)
|
|
712
|
-
if (l.origins.some((
|
|
713
|
-
|
|
712
|
+
if (l.origins.some((m) => m.startsWith(c))) {
|
|
713
|
+
h += 0.25;
|
|
714
714
|
break;
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
|
-
l.total > Vt && (
|
|
717
|
+
l.total > Vt && (h += h > 0.5 ? 0.02 : -0.02), l.total < 1e3 && (h += 0.15), x.set(s, Math.min(h, 0.99));
|
|
718
718
|
}
|
|
719
719
|
if (w.size > 0) {
|
|
720
720
|
const s = Array.from(w).sort(
|
|
721
|
-
(
|
|
721
|
+
(h, c) => x.get(c) - x.get(h)
|
|
722
722
|
);
|
|
723
723
|
let l = -1;
|
|
724
|
-
for (const
|
|
725
|
-
x.get(
|
|
724
|
+
for (const h of s)
|
|
725
|
+
x.get(h) !== l && (l = x.get(h), v.add(-Math.round(l * 10))), v.add(h);
|
|
726
726
|
}
|
|
727
727
|
const _ = i.length;
|
|
728
|
-
i.push(
|
|
728
|
+
i.push(p);
|
|
729
729
|
for (let s = 0; s < v.size; s++)
|
|
730
730
|
i.push(null);
|
|
731
|
-
d.set(
|
|
731
|
+
d.set(p, { index: _, deps: v });
|
|
732
732
|
}
|
|
733
|
-
for (const
|
|
734
|
-
const t = d.get(
|
|
733
|
+
for (const p of g) {
|
|
734
|
+
const t = d.get(p);
|
|
735
735
|
let { index: v, deps: w } = t;
|
|
736
736
|
v++;
|
|
737
737
|
for (const x of w) {
|
|
@@ -768,12 +768,12 @@ async function tn(e, n, i) {
|
|
|
768
768
|
o = new r.ESLint(a);
|
|
769
769
|
}
|
|
770
770
|
return {
|
|
771
|
-
async lint(a,
|
|
771
|
+
async lint(a, p, t) {
|
|
772
772
|
try {
|
|
773
773
|
const v = nn(t);
|
|
774
774
|
if (await o.isPathIgnored(v))
|
|
775
775
|
return null;
|
|
776
|
-
(await o.lintText(
|
|
776
|
+
(await o.lintText(p, {
|
|
777
777
|
filePath: v
|
|
778
778
|
})).forEach((x) => {
|
|
779
779
|
for (const _ of x.messages) {
|
|
@@ -808,8 +808,8 @@ async function on(e, n) {
|
|
|
808
808
|
const i = n;
|
|
809
809
|
let r = i.loc;
|
|
810
810
|
if (!i.frame && !i.plugin && (r || (r = sn(i)), r && (i.loc = r, r.file))) {
|
|
811
|
-
const o = await e.dynamicImport("node:fs"), { normalizePath:
|
|
812
|
-
i.id =
|
|
811
|
+
const o = await e.dynamicImport("node:fs"), { normalizePath: g } = await e.dynamicImport("vite");
|
|
812
|
+
i.id = g(i.loc.file);
|
|
813
813
|
try {
|
|
814
814
|
const d = o.readFileSync(i.loc.file, "utf-8");
|
|
815
815
|
i.frame = ln(d, i.loc);
|
|
@@ -826,19 +826,19 @@ const sn = (e) => {
|
|
|
826
826
|
for (let r = 1; r < i.length; r++) {
|
|
827
827
|
const o = i[r].replace("file:///", "/");
|
|
828
828
|
if (/^\s+at/.test(o)) {
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
return typeof t == "number" && typeof v == "number" ? (
|
|
833
|
-
file:
|
|
829
|
+
const g = o.indexOf("/"), d = o.lastIndexOf(")", g);
|
|
830
|
+
if (g > 0) {
|
|
831
|
+
const p = o.slice(g, d).split(":"), t = it(p[p.length - 1]), v = it(p[p.length - 2]);
|
|
832
|
+
return typeof t == "number" && typeof v == "number" ? (p.length -= 2, {
|
|
833
|
+
file: p.join(":"),
|
|
834
834
|
line: v,
|
|
835
835
|
column: t
|
|
836
|
-
}) : typeof t == "number" ? (
|
|
837
|
-
file:
|
|
836
|
+
}) : typeof t == "number" ? (p.length -= 1, {
|
|
837
|
+
file: p.join(":"),
|
|
838
838
|
line: t,
|
|
839
839
|
column: void 0
|
|
840
840
|
}) : {
|
|
841
|
-
file:
|
|
841
|
+
file: p.join(":"),
|
|
842
842
|
line: void 0,
|
|
843
843
|
column: void 0
|
|
844
844
|
};
|
|
@@ -846,57 +846,57 @@ const sn = (e) => {
|
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
},
|
|
849
|
+
}, Z = (e) => e.startsWith("\0"), it = (e) => {
|
|
850
850
|
try {
|
|
851
851
|
return parseInt(e, 10);
|
|
852
852
|
} catch {
|
|
853
853
|
return;
|
|
854
854
|
}
|
|
855
|
-
},
|
|
855
|
+
}, Tt = /\r?\n/, st = 2;
|
|
856
856
|
function an(e, n) {
|
|
857
857
|
if (typeof n == "number")
|
|
858
858
|
return n;
|
|
859
859
|
if (n.lo != null)
|
|
860
860
|
return n.lo;
|
|
861
|
-
const i = e.split(
|
|
862
|
-
let
|
|
861
|
+
const i = e.split(Tt), { line: r, column: o } = n;
|
|
862
|
+
let g = 0;
|
|
863
863
|
for (let d = 0; d < r - 1 && d < i.length; d++)
|
|
864
|
-
|
|
865
|
-
return
|
|
864
|
+
g += i[d].length + 1;
|
|
865
|
+
return g + o;
|
|
866
866
|
}
|
|
867
867
|
function ln(e, n = 0, i) {
|
|
868
868
|
n = an(e, n), i = i || n;
|
|
869
|
-
const r = e.split(
|
|
869
|
+
const r = e.split(Tt);
|
|
870
870
|
let o = 0;
|
|
871
|
-
const
|
|
871
|
+
const g = [];
|
|
872
872
|
for (let d = 0; d < r.length; d++)
|
|
873
873
|
if (o += r[d].length + 1, o >= n) {
|
|
874
|
-
for (let a = d -
|
|
874
|
+
for (let a = d - st; a <= d + st || i > o; a++) {
|
|
875
875
|
if (a < 0 || a >= r.length)
|
|
876
876
|
continue;
|
|
877
|
-
const
|
|
878
|
-
|
|
877
|
+
const p = a + 1;
|
|
878
|
+
g.push(`${p}${" ".repeat(Math.max(3 - String(p).length, 0))}| ${r[a]}`);
|
|
879
879
|
const t = r[a].length;
|
|
880
880
|
if (a === d) {
|
|
881
881
|
const v = Math.max(n - (o - t) + 1, 0), w = Math.max(1, i > o ? t - v : i - n);
|
|
882
|
-
|
|
882
|
+
g.push(" | " + " ".repeat(v) + "^".repeat(w));
|
|
883
883
|
} else if (a > d) {
|
|
884
884
|
if (i > o) {
|
|
885
885
|
const v = Math.max(Math.min(i - o, t), 1);
|
|
886
|
-
|
|
886
|
+
g.push(" | " + "^".repeat(v));
|
|
887
887
|
}
|
|
888
888
|
o += t + 1;
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
break;
|
|
892
892
|
}
|
|
893
|
-
return
|
|
893
|
+
return g.join(`
|
|
894
894
|
`);
|
|
895
895
|
}
|
|
896
896
|
function cn(e) {
|
|
897
897
|
return e === "win32";
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Le(e) {
|
|
900
900
|
const [n, i] = e.split("?"), r = i || "";
|
|
901
901
|
return {
|
|
902
902
|
originalId: e,
|
|
@@ -932,10 +932,10 @@ const dn = ["server"], un = [
|
|
|
932
932
|
"browser",
|
|
933
933
|
"event$"
|
|
934
934
|
];
|
|
935
|
-
var
|
|
936
|
-
function
|
|
937
|
-
const n = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(),
|
|
938
|
-
let d = null, a,
|
|
935
|
+
var Ct = /* @__PURE__ */ ((e) => (e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(Ct || {});
|
|
936
|
+
function Pt(e = {}) {
|
|
937
|
+
const n = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
938
|
+
let d = null, a, p = () => {
|
|
939
939
|
};
|
|
940
940
|
const t = {
|
|
941
941
|
csr: !1,
|
|
@@ -979,42 +979,42 @@ function Dt(e = {}) {
|
|
|
979
979
|
throw new Error("Qwik plugin has not been initialized");
|
|
980
980
|
return d;
|
|
981
981
|
}, s = () => _().sys, l = () => _().sys.path;
|
|
982
|
-
let
|
|
982
|
+
let h;
|
|
983
983
|
const c = (E) => {
|
|
984
|
-
|
|
985
|
-
},
|
|
986
|
-
const y = Object.assign({}, E),
|
|
987
|
-
t.debug = !!y.debug, y.assetsDir && (t.assetsDir = y.assetsDir), y.target === "ssr" || y.target === "client" || y.target === "lib" || y.target === "test" ? t.target = y.target : t.target || (t.target = "client"), t.target === "lib" ? t.buildMode = "development" : y.buildMode === "production" || y.buildMode === "development" ? t.buildMode = y.buildMode : t.buildMode || (t.buildMode = "development"), t.csr = !!y.csr, y.entryStrategy && typeof y.entryStrategy == "object" && (t.entryStrategy = { ...y.entryStrategy }), t.entryStrategy || (t.target === "ssr" || t.target === "test" ? t.entryStrategy = { type: "hoist" } : t.target === "lib" ? t.entryStrategy = { type: "inline" } : t.buildMode === "production" ? t.entryStrategy = { type: "smart" } : t.entryStrategy = { type: "segment" }), typeof y.rootDir == "string" && (t.rootDir = y.rootDir), typeof t.rootDir != "string" && (t.rootDir || (t.rootDir =
|
|
988
|
-
let
|
|
989
|
-
if (typeof y.srcDir == "string" ? (t.srcDir =
|
|
984
|
+
h = E;
|
|
985
|
+
}, m = async (E) => {
|
|
986
|
+
const y = Object.assign({}, E), T = _(), M = T.sys.path, N = (...U) => F(M.resolve(...U));
|
|
987
|
+
t.debug = !!y.debug, y.assetsDir && (t.assetsDir = y.assetsDir), y.target === "ssr" || y.target === "client" || y.target === "lib" || y.target === "test" ? t.target = y.target : t.target || (t.target = "client"), t.target === "lib" ? t.buildMode = "development" : y.buildMode === "production" || y.buildMode === "development" ? t.buildMode = y.buildMode : t.buildMode || (t.buildMode = "development"), t.csr = !!y.csr, y.entryStrategy && typeof y.entryStrategy == "object" && (t.entryStrategy = { ...y.entryStrategy }), t.entryStrategy || (t.target === "ssr" || t.target === "test" ? t.entryStrategy = { type: "hoist" } : t.target === "lib" ? t.entryStrategy = { type: "inline" } : t.buildMode === "production" ? t.entryStrategy = { type: "smart" } : t.entryStrategy = { type: "segment" }), typeof y.rootDir == "string" && (t.rootDir = y.rootDir), typeof t.rootDir != "string" && (t.rootDir || (t.rootDir = T.sys.cwd())), t.rootDir = N(T.sys.cwd(), t.rootDir);
|
|
988
|
+
let C = N(t.rootDir, yn);
|
|
989
|
+
if (typeof y.srcDir == "string" ? (t.srcDir = N(t.rootDir, y.srcDir), C = t.srcDir) : t.srcDir || (t.srcDir = C), t.srcDir = N(t.rootDir, t.srcDir), Array.isArray(y.tsconfigFileNames) && y.tsconfigFileNames.length > 0 && (t.tsconfigFileNames = y.tsconfigFileNames), !t.csr && !y.input && !t.input && (t.target === "ssr" ? t.input = [N(C, "entry.ssr")] : t.target === "client" ? t.input = [N(C, "root")] : t.input = void 0), y.outDir && (t.outDir = N(t.rootDir, y.outDir)), t.clientOutDir = N(t.rootDir, y.clientOutDir || at), t.ssrOutDir = N(t.rootDir, y.ssrOutDir || bn), t.target === "ssr" ? t.outDir || (t.outDir = t.ssrOutDir) : t.target === "lib" ? t.outDir || (t.outDir = N(t.rootDir, vn)) : t.outDir || (t.outDir = t.clientOutDir), typeof y.manifestOutput == "function" && (t.manifestOutput = y.manifestOutput), y.manifestInput && (t.manifestInput = et(y.manifestInput) || null), typeof y.transformedModuleOutput == "function" && (t.transformedModuleOutput = y.transformedModuleOutput), y.scope !== void 0)
|
|
990
990
|
t.scope = y.scope;
|
|
991
991
|
else if (!t.scope && w) {
|
|
992
|
-
let
|
|
992
|
+
let U = "";
|
|
993
993
|
try {
|
|
994
994
|
let B = t.rootDir;
|
|
995
|
-
for (;
|
|
996
|
-
const
|
|
997
|
-
if (
|
|
995
|
+
for (; U = M.resolve(B, "package.json"), !await w.promises.stat(U).catch(() => !1); ) {
|
|
996
|
+
const j = M.resolve(B, "..");
|
|
997
|
+
if (j === B)
|
|
998
998
|
break;
|
|
999
|
-
B =
|
|
999
|
+
B = j, U = "";
|
|
1000
1000
|
}
|
|
1001
|
-
if (
|
|
1002
|
-
const
|
|
1003
|
-
typeof
|
|
1001
|
+
if (U) {
|
|
1002
|
+
const j = await w.promises.readFile(U, "utf-8"), L = JSON.parse(j);
|
|
1003
|
+
typeof L.name == "string" && (t.scope = L.name);
|
|
1004
1004
|
}
|
|
1005
1005
|
} catch (B) {
|
|
1006
1006
|
console.warn(
|
|
1007
|
-
`could not read ${
|
|
1007
|
+
`could not read ${U || "package.json"} to determine package name, ignoring. (${B})`
|
|
1008
1008
|
);
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
1011
1011
|
if (typeof y.resolveQwikBuild == "boolean" && (t.resolveQwikBuild = y.resolveQwikBuild), typeof y.devTools == "object" && ("imageDevTools" in y.devTools && (t.devTools.imageDevTools = y.devTools.imageDevTools), "clickToSource" in y.devTools && (t.devTools.clickToSource = y.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? t.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof t.inlineStylesUpToBytes != "number" || t.inlineStylesUpToBytes < 0) && (t.inlineStylesUpToBytes = 0)), typeof y.lint == "boolean" && (t.lint = y.lint), "experimental" in y) {
|
|
1012
1012
|
t.experimental = void 0;
|
|
1013
|
-
for (const
|
|
1014
|
-
|
|
1013
|
+
for (const U of y.experimental ?? [])
|
|
1014
|
+
Ct[U] ? (t.experimental || (t.experimental = {}))[U] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${U}`);
|
|
1015
1015
|
}
|
|
1016
|
-
const
|
|
1017
|
-
return t.input || (t.input = y.input), t.input && typeof t.input == "string" && (t.input = [t.input]),
|
|
1016
|
+
const R = { ...t };
|
|
1017
|
+
return t.input || (t.input = y.input), t.input && typeof t.input == "string" && (t.input = [t.input]), R;
|
|
1018
1018
|
};
|
|
1019
1019
|
let k = !1;
|
|
1020
1020
|
const u = async (E) => {
|
|
@@ -1022,25 +1022,25 @@ function Dt(e = {}) {
|
|
|
1022
1022
|
k = !0;
|
|
1023
1023
|
const y = s();
|
|
1024
1024
|
if (y.env === "node") {
|
|
1025
|
-
const
|
|
1026
|
-
if (!
|
|
1025
|
+
const T = await y.dynamicImport("node:fs");
|
|
1026
|
+
if (!T.existsSync(t.rootDir))
|
|
1027
1027
|
throw new Error(`Qwik rootDir "${t.rootDir}" not found.`);
|
|
1028
|
-
if (typeof t.srcDir == "string" && !
|
|
1028
|
+
if (typeof t.srcDir == "string" && !T.existsSync(t.srcDir))
|
|
1029
1029
|
throw new Error(`Qwik srcDir "${t.srcDir}" not found.`);
|
|
1030
|
-
for (const [
|
|
1031
|
-
if (!await E(
|
|
1032
|
-
throw new Error(`Qwik input "${
|
|
1030
|
+
for (const [M, N] of Object.entries(t.input || {}))
|
|
1031
|
+
if (!await E(N))
|
|
1032
|
+
throw new Error(`Qwik input "${N}" not found.`);
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
};
|
|
1036
|
-
let b,
|
|
1037
|
-
const
|
|
1038
|
-
if (
|
|
1036
|
+
let b, f = !1;
|
|
1037
|
+
const I = async (E) => {
|
|
1038
|
+
if (O("buildStart()", t.buildMode, t.scope, t.target, t.rootDir, t.srcDir), b = _(), f = !h, b.sys.env === "node" && t.target === "ssr" && t.lint)
|
|
1039
1039
|
try {
|
|
1040
1040
|
a = await tn(b.sys, t.rootDir, t.tsconfigFileNames);
|
|
1041
1041
|
} catch {
|
|
1042
1042
|
}
|
|
1043
|
-
if (
|
|
1043
|
+
if (O("transformedOutputs.clear()"), r.clear(), o.clear(), t.target === "client") {
|
|
1044
1044
|
const y = await E.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
1045
1045
|
skipSelf: !0
|
|
1046
1046
|
});
|
|
@@ -1050,50 +1050,50 @@ function Dt(e = {}) {
|
|
|
1050
1050
|
preserveSignature: "allow-extension"
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
|
-
},
|
|
1054
|
-
let
|
|
1055
|
-
const
|
|
1056
|
-
if (
|
|
1053
|
+
}, S = (E) => h ? !!E?.ssr : t.target === "ssr" || t.target === "test";
|
|
1054
|
+
let q = 0, D = !1;
|
|
1055
|
+
const P = async (E, y, T, M) => {
|
|
1056
|
+
if (Z(y))
|
|
1057
1057
|
return;
|
|
1058
|
-
const
|
|
1059
|
-
if (
|
|
1060
|
-
if (!
|
|
1061
|
-
|
|
1062
|
-
const [, K,
|
|
1063
|
-
if (
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1066
|
-
const te = `${
|
|
1058
|
+
const N = h && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(y);
|
|
1059
|
+
if (N) {
|
|
1060
|
+
if (!D) {
|
|
1061
|
+
D = !0, setTimeout(() => D = !1, 500);
|
|
1062
|
+
const [, K, W] = N, ce = await E.resolve(K, T);
|
|
1063
|
+
if (ce) {
|
|
1064
|
+
const se = h.moduleGraph.getModuleById(ce.id)?.file;
|
|
1065
|
+
if (se) {
|
|
1066
|
+
const te = `${se}${W}`;
|
|
1067
1067
|
try {
|
|
1068
1068
|
console.warn(`Opening in editor: ${te}`);
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1071
|
-
} catch (
|
|
1072
|
-
console.error(`Failed to open editor: ${
|
|
1069
|
+
const J = (await import("launch-editor")).default;
|
|
1070
|
+
J(te);
|
|
1071
|
+
} catch (J) {
|
|
1072
|
+
console.error(`Failed to open editor: ${J.message}`);
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
1077
|
return { id: "\0editor" };
|
|
1078
1078
|
}
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
const K = l(),
|
|
1084
|
-
|
|
1079
|
+
const C = q++, R = S(M);
|
|
1080
|
+
O(`resolveId(${C})`, `begin ${y} | ${R ? "server" : "client"} | ${T}`);
|
|
1081
|
+
const U = T && Le(T);
|
|
1082
|
+
if (T = U && F(U.pathId), y.startsWith(".") && U) {
|
|
1083
|
+
const K = l(), W = K.dirname(U.pathId);
|
|
1084
|
+
W && (y = K.resolve(W, y));
|
|
1085
1085
|
}
|
|
1086
|
-
const B =
|
|
1087
|
-
let
|
|
1086
|
+
const B = Le(y), j = F(B.pathId);
|
|
1087
|
+
let L;
|
|
1088
1088
|
if (
|
|
1089
1089
|
/**
|
|
1090
1090
|
* Check if we know the QRL. During regular builds, we'll encounter and build parents before
|
|
1091
1091
|
* their QRLs, so this will always match.
|
|
1092
1092
|
*/
|
|
1093
|
-
|
|
1093
|
+
g.get(j)
|
|
1094
1094
|
)
|
|
1095
|
-
|
|
1096
|
-
id:
|
|
1095
|
+
O(`resolveId(${C}) Resolved already known ${j}`), L = {
|
|
1096
|
+
id: j + B.query,
|
|
1097
1097
|
moduleSideEffects: !1
|
|
1098
1098
|
};
|
|
1099
1099
|
else if (
|
|
@@ -1102,20 +1102,20 @@ function Dt(e = {}) {
|
|
|
1102
1102
|
* been transformed yet.
|
|
1103
1103
|
*/
|
|
1104
1104
|
// We test with endsWith because the dev server adds the base pathname
|
|
1105
|
-
|
|
1105
|
+
j.endsWith(ne)
|
|
1106
1106
|
)
|
|
1107
|
-
t.resolveQwikBuild && (
|
|
1107
|
+
t.resolveQwikBuild && (O(`resolveId(${C})`, "Resolved", ne), L = {
|
|
1108
1108
|
id: ne,
|
|
1109
1109
|
moduleSideEffects: !1
|
|
1110
1110
|
});
|
|
1111
|
-
else if (
|
|
1112
|
-
|
|
1111
|
+
else if (j.endsWith(re))
|
|
1112
|
+
O(`resolveId(${C})`, "Resolved", re), L = {
|
|
1113
1113
|
id: re,
|
|
1114
1114
|
moduleSideEffects: !1
|
|
1115
1115
|
};
|
|
1116
|
-
else if (!
|
|
1117
|
-
|
|
1118
|
-
const K = await E.resolve(
|
|
1116
|
+
else if (!h && !R && j.endsWith(He)) {
|
|
1117
|
+
O(`resolveId(${C})`, "Resolved", He);
|
|
1118
|
+
const K = await E.resolve(He, T, {
|
|
1119
1119
|
skipSelf: !0
|
|
1120
1120
|
});
|
|
1121
1121
|
if (K)
|
|
@@ -1124,113 +1124,113 @@ function Dt(e = {}) {
|
|
|
1124
1124
|
type: "chunk",
|
|
1125
1125
|
preserveSignature: "allow-extension"
|
|
1126
1126
|
}), K;
|
|
1127
|
-
} else if (
|
|
1128
|
-
|
|
1127
|
+
} else if (j.endsWith(pe))
|
|
1128
|
+
O(`resolveId(${C})`, "Resolved", pe), L = {
|
|
1129
1129
|
id: pe,
|
|
1130
1130
|
moduleSideEffects: !1
|
|
1131
1131
|
};
|
|
1132
1132
|
else {
|
|
1133
|
-
if (!
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1133
|
+
if (!R && f && y.endsWith("@qwik.dev/core")) {
|
|
1134
|
+
f = !1;
|
|
1135
|
+
const W = await E.resolve("@qwik.dev/core/handlers.mjs", T, {
|
|
1136
1136
|
skipSelf: !0
|
|
1137
1137
|
});
|
|
1138
|
-
if (!
|
|
1138
|
+
if (!W)
|
|
1139
1139
|
throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
|
|
1140
1140
|
E.emitFile({
|
|
1141
|
-
id:
|
|
1141
|
+
id: W.id,
|
|
1142
1142
|
type: "chunk",
|
|
1143
1143
|
preserveSignature: "allow-extension"
|
|
1144
1144
|
});
|
|
1145
1145
|
}
|
|
1146
1146
|
const K = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(y)?.groups;
|
|
1147
1147
|
if (K) {
|
|
1148
|
-
const { parent:
|
|
1148
|
+
const { parent: W, name: ce, query: se } = K, te = await E.resolve(W, T, { skipSelf: !0 });
|
|
1149
1149
|
if (te) {
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
id:
|
|
1150
|
+
const J = te.id.split("?")[0], qe = h && T?.endsWith(".html") ? `${J}_${ce}.js` : j;
|
|
1151
|
+
O(`resolveId(${C})`, `resolved to QRL ${ce} of ${J}`), g.set(qe, J), L = {
|
|
1152
|
+
id: qe + se,
|
|
1153
1153
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
1154
1154
|
moduleSideEffects: !1
|
|
1155
1155
|
};
|
|
1156
1156
|
} else
|
|
1157
|
-
console.error(`resolveId(${
|
|
1158
|
-
} else if (
|
|
1159
|
-
const
|
|
1160
|
-
if (
|
|
1161
|
-
return
|
|
1157
|
+
console.error(`resolveId(${C})`, `QRL parent ${W} does not exist!`);
|
|
1158
|
+
} else if (T) {
|
|
1159
|
+
const W = g.get(T);
|
|
1160
|
+
if (W)
|
|
1161
|
+
return O(`resolveId(${C}) end`, `resolving via ${W}`), E.resolve(y, W, { skipSelf: !0 });
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
|
-
return
|
|
1164
|
+
return O(`resolveId(${C}) end`, L?.id || L), L;
|
|
1165
1165
|
};
|
|
1166
|
-
let
|
|
1167
|
-
const
|
|
1166
|
+
let $ = 0;
|
|
1167
|
+
const A = async (E, y, T) => {
|
|
1168
1168
|
if (y === "\0editor")
|
|
1169
1169
|
return '"opening in editor"';
|
|
1170
|
-
if (
|
|
1170
|
+
if (Z(y) || y.startsWith("/@fs/"))
|
|
1171
1171
|
return;
|
|
1172
|
-
const
|
|
1172
|
+
const M = $++, N = S(T);
|
|
1173
1173
|
if (t.resolveQwikBuild && y === ne)
|
|
1174
|
-
return
|
|
1174
|
+
return O(`load(${M})`, ne, t.buildMode), {
|
|
1175
1175
|
moduleSideEffects: !1,
|
|
1176
|
-
code:
|
|
1176
|
+
code: ue(N, t.target)
|
|
1177
1177
|
};
|
|
1178
1178
|
if (y === re)
|
|
1179
|
-
return
|
|
1179
|
+
return O(`load(${M})`, re, t.buildMode), {
|
|
1180
1180
|
moduleSideEffects: !1,
|
|
1181
|
-
code: await
|
|
1181
|
+
code: await le(N)
|
|
1182
1182
|
};
|
|
1183
1183
|
if (y === pe)
|
|
1184
|
-
return
|
|
1184
|
+
return O(`load(${M})`, pe, t.buildMode), {
|
|
1185
1185
|
moduleSideEffects: !1,
|
|
1186
1186
|
code: "export * from '@qwik.dev/core';"
|
|
1187
1187
|
};
|
|
1188
|
-
const
|
|
1189
|
-
y =
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
const B =
|
|
1188
|
+
const C = Le(y);
|
|
1189
|
+
y = F(C.pathId);
|
|
1190
|
+
const R = N ? o : r;
|
|
1191
|
+
if (h && !R.has(y)) {
|
|
1192
|
+
const B = g.get(y);
|
|
1193
1193
|
if (B) {
|
|
1194
|
-
const
|
|
1195
|
-
if (
|
|
1196
|
-
if (
|
|
1197
|
-
return
|
|
1194
|
+
const j = h.moduleGraph.getModuleById(B);
|
|
1195
|
+
if (j) {
|
|
1196
|
+
if (O(`load(${M})`, "transforming QRL parent", B), await h.transformRequest(j.url), !R.has(y))
|
|
1197
|
+
return O(`load(${M})`, `QRL segment ${y} not found in ${B}`), null;
|
|
1198
1198
|
} else
|
|
1199
|
-
console.error(`load(${
|
|
1199
|
+
console.error(`load(${M})`, `module ${B} does not exist in the build graph!`);
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
|
|
1205
|
-
const { code: B, map:
|
|
1206
|
-
return { code: B, map:
|
|
1202
|
+
const U = R.get(y);
|
|
1203
|
+
if (U) {
|
|
1204
|
+
O(`load(${M})`, "Found", y);
|
|
1205
|
+
const { code: B, map: j, segment: L } = U[0];
|
|
1206
|
+
return { code: B, map: j, meta: { segment: L } };
|
|
1207
1207
|
}
|
|
1208
|
-
return
|
|
1208
|
+
return O(`load(${M})`, "Not a QRL or virtual module", y), null;
|
|
1209
1209
|
};
|
|
1210
|
-
let
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1210
|
+
let G = 0;
|
|
1211
|
+
const X = async function(E, y, T, M = {}) {
|
|
1212
|
+
if (Z(T))
|
|
1213
1213
|
return;
|
|
1214
|
-
const
|
|
1215
|
-
if (
|
|
1214
|
+
const N = G++, C = S(M), R = C ? o : r;
|
|
1215
|
+
if (R.has(T))
|
|
1216
1216
|
return;
|
|
1217
|
-
const
|
|
1218
|
-
if (
|
|
1219
|
-
const
|
|
1220
|
-
|
|
1221
|
-
`transform(${
|
|
1222
|
-
`Transforming ${
|
|
1217
|
+
const U = _(), B = l(), { pathId: j } = Le(T), L = B.parse(j), K = L.dir, W = L.base;
|
|
1218
|
+
if (L.ext.toLowerCase() in gn || Dt.test(j)) {
|
|
1219
|
+
const se = t.target === "client" || t.target === "ssr";
|
|
1220
|
+
O(
|
|
1221
|
+
`transform(${N})`,
|
|
1222
|
+
`Transforming ${T} (for: ${C ? "server" : "client"}${se ? ", strip" : ""})`
|
|
1223
1223
|
);
|
|
1224
1224
|
const te = t.target === "lib" ? "lib" : t.buildMode === "development" ? "dev" : "prod";
|
|
1225
|
-
te !== "lib" && (y = y.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (
|
|
1226
|
-
let
|
|
1227
|
-
t.srcDir && (
|
|
1228
|
-
const
|
|
1229
|
-
let
|
|
1230
|
-
|
|
1231
|
-
const
|
|
1232
|
-
input: [{ code: y, path:
|
|
1233
|
-
entryStrategy:
|
|
1225
|
+
te !== "lib" && (y = y.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (V, ae) => t.experimental?.[ae] ? "true" : "false"));
|
|
1226
|
+
let J = W;
|
|
1227
|
+
t.srcDir && (J = B.relative(t.srcDir, j)), J = F(J);
|
|
1228
|
+
const Me = t.srcDir ? t.srcDir : F(K), qe = t.entryStrategy;
|
|
1229
|
+
let Xe;
|
|
1230
|
+
h && (Xe = h.moduleGraph.getModuleById(j)?.url);
|
|
1231
|
+
const de = {
|
|
1232
|
+
input: [{ code: y, path: J, devPath: Xe }],
|
|
1233
|
+
entryStrategy: C ? { type: "hoist" } : qe,
|
|
1234
1234
|
minify: "simplify",
|
|
1235
1235
|
// Always enable sourcemaps in dev for click-to-source
|
|
1236
1236
|
sourceMaps: t.sourcemap || t.buildMode === "development",
|
|
@@ -1238,99 +1238,99 @@ function Dt(e = {}) {
|
|
|
1238
1238
|
transpileJsx: !0,
|
|
1239
1239
|
explicitExtensions: !0,
|
|
1240
1240
|
preserveFilenames: !0,
|
|
1241
|
-
srcDir:
|
|
1241
|
+
srcDir: Me,
|
|
1242
1242
|
rootDir: t.rootDir,
|
|
1243
1243
|
mode: te,
|
|
1244
1244
|
scope: t.scope || void 0,
|
|
1245
|
-
isServer:
|
|
1245
|
+
isServer: C
|
|
1246
1246
|
};
|
|
1247
|
-
|
|
1248
|
-
const Lt = Date.now(), fe = await
|
|
1249
|
-
|
|
1250
|
-
const
|
|
1251
|
-
|
|
1252
|
-
const
|
|
1253
|
-
for (const
|
|
1254
|
-
if (
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
id:
|
|
1247
|
+
se && (C ? (de.stripCtxName = pn, de.stripEventHandlers = !0, de.regCtxName = dn) : (de.stripCtxName = fn, de.stripExports = un));
|
|
1248
|
+
const Lt = Date.now(), fe = await U.transformModules(de);
|
|
1249
|
+
O(`transform(${N})`, `done in ${Date.now() - Lt}ms`);
|
|
1250
|
+
const Oe = fe.modules.find((V) => !mn(V));
|
|
1251
|
+
p(fe.diagnostics, U, Me), C ? fe.diagnostics.length === 0 && a && a.lint(E, y, T) : i.set(T, fe);
|
|
1252
|
+
const $e = /* @__PURE__ */ new Set();
|
|
1253
|
+
for (const V of fe.modules)
|
|
1254
|
+
if (V !== Oe) {
|
|
1255
|
+
const ae = F(B.join(Me, V.path));
|
|
1256
|
+
O(`transform(${N})`, `segment ${ae}`, V.segment.displayName), g.set(ae, T), R.set(ae, [V, T]), $e.add(ae), t.target === "client" && !h && E.emitFile({
|
|
1257
|
+
id: ae,
|
|
1258
1258
|
type: "chunk",
|
|
1259
1259
|
preserveSignature: "allow-extension"
|
|
1260
1260
|
});
|
|
1261
1261
|
}
|
|
1262
|
-
return await Promise.all([
|
|
1263
|
-
code:
|
|
1264
|
-
map:
|
|
1262
|
+
return await Promise.all([...$e.values()].map((V) => E.load({ id: V }))), E.addWatchFile(T), {
|
|
1263
|
+
code: Oe.code,
|
|
1264
|
+
map: Oe.map,
|
|
1265
1265
|
meta: {
|
|
1266
|
-
segment:
|
|
1267
|
-
qwikdeps: Array.from(
|
|
1266
|
+
segment: Oe.segment,
|
|
1267
|
+
qwikdeps: Array.from($e)
|
|
1268
1268
|
}
|
|
1269
1269
|
};
|
|
1270
1270
|
}
|
|
1271
|
-
return
|
|
1272
|
-
},
|
|
1273
|
-
const y = [],
|
|
1274
|
-
addInjection: (
|
|
1271
|
+
return O(`transform(${N})`, "Not transforming", T), null;
|
|
1272
|
+
}, Q = (E) => {
|
|
1273
|
+
const y = [], T = {
|
|
1274
|
+
addInjection: (M) => y.push(M)
|
|
1275
1275
|
};
|
|
1276
|
-
return
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
const B = Array.from(i.values()).flatMap((
|
|
1280
|
-
|
|
1276
|
+
return T.generateManifest = async (M) => {
|
|
1277
|
+
const C = _().sys.path, R = C.resolve(t.rootDir, t.outDir, "build"), U = (L) => C.relative(R, C.resolve(t.rootDir, t.outDir, L));
|
|
1278
|
+
T.canonPath = U;
|
|
1279
|
+
const B = Array.from(i.values()).flatMap((L) => L.modules).map((L) => L.segment).filter((L) => !!L), j = Yt(
|
|
1280
|
+
C,
|
|
1281
1281
|
B,
|
|
1282
1282
|
y,
|
|
1283
1283
|
E,
|
|
1284
1284
|
t,
|
|
1285
|
-
|
|
1286
|
-
|
|
1285
|
+
O,
|
|
1286
|
+
U
|
|
1287
1287
|
);
|
|
1288
|
-
|
|
1289
|
-
for (const
|
|
1290
|
-
|
|
1291
|
-
for (const
|
|
1292
|
-
|
|
1293
|
-
return
|
|
1294
|
-
},
|
|
1295
|
-
},
|
|
1288
|
+
M && Object.assign(j, M);
|
|
1289
|
+
for (const L of Object.values(j.symbols))
|
|
1290
|
+
L.origin && (L.origin = F(L.origin));
|
|
1291
|
+
for (const L of Object.values(j.bundles))
|
|
1292
|
+
L.origins && (L.origins = L.origins.sort());
|
|
1293
|
+
return j.manifestHash = zt(JSON.stringify(j)), j;
|
|
1294
|
+
}, T;
|
|
1295
|
+
}, ee = () => t, Y = () => Array.from(r.values()).map((E) => E[0]), O = (...E) => {
|
|
1296
1296
|
t.debug && console.debug(`[QWIK PLUGIN: ${n}]`, ...E);
|
|
1297
|
-
},
|
|
1297
|
+
}, ie = (...E) => {
|
|
1298
1298
|
console.log(`[QWIK PLUGIN: ${n}]`, ...E);
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
function
|
|
1303
|
-
const
|
|
1299
|
+
}, Re = (E) => {
|
|
1300
|
+
p = E;
|
|
1301
|
+
}, F = (E) => v(E);
|
|
1302
|
+
function ue(E, y) {
|
|
1303
|
+
const T = t.buildMode === "development";
|
|
1304
1304
|
return `// @qwik.dev/core/build
|
|
1305
1305
|
export const isServer = ${JSON.stringify(E)};
|
|
1306
1306
|
export const isBrowser = ${JSON.stringify(!E)};
|
|
1307
|
-
export const isDev = ${JSON.stringify(
|
|
1307
|
+
export const isDev = ${JSON.stringify(T)};
|
|
1308
1308
|
`;
|
|
1309
1309
|
}
|
|
1310
|
-
async function
|
|
1310
|
+
async function le(E) {
|
|
1311
1311
|
if (!t.manifestInput && t.target === "ssr" && t.buildMode === "production" && w) {
|
|
1312
|
-
const
|
|
1313
|
-
let
|
|
1314
|
-
await w.promises.stat(
|
|
1312
|
+
const M = l();
|
|
1313
|
+
let N = t.manifestInputPath || M.resolve(t.clientOutDir, We);
|
|
1314
|
+
await w.promises.stat(N).catch(() => !1) || (N = M.resolve(t.rootDir, at, We));
|
|
1315
1315
|
try {
|
|
1316
|
-
const
|
|
1317
|
-
t.manifestInput =
|
|
1318
|
-
} catch (
|
|
1316
|
+
const C = await w.promises.readFile(N, "utf-8");
|
|
1317
|
+
t.manifestInput = et(JSON.parse(C)) || null, console.info("Read client manifest from", N);
|
|
1318
|
+
} catch (C) {
|
|
1319
1319
|
console.warn(
|
|
1320
1320
|
`
|
|
1321
1321
|
==========
|
|
1322
|
-
Could not read Qwik client manifest ${
|
|
1322
|
+
Could not read Qwik client manifest ${N}.
|
|
1323
1323
|
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__\`.
|
|
1324
1324
|
Without the manifest, the SSR renderer will not be able to generate event handlers.
|
|
1325
|
-
(${
|
|
1325
|
+
(${C})
|
|
1326
1326
|
==========
|
|
1327
1327
|
`
|
|
1328
1328
|
);
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
1331
|
const y = E ? t.manifestInput : null;
|
|
1332
|
-
let
|
|
1333
|
-
return y?.manifestHash && (
|
|
1332
|
+
let T = null;
|
|
1333
|
+
return y?.manifestHash && (T = {
|
|
1334
1334
|
manifestHash: y.manifestHash,
|
|
1335
1335
|
core: y.core,
|
|
1336
1336
|
preloader: y.preloader,
|
|
@@ -1340,24 +1340,24 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1340
1340
|
mapping: y.mapping,
|
|
1341
1341
|
bundleGraph: y.bundleGraph
|
|
1342
1342
|
}), `// @qwik-client-manifest
|
|
1343
|
-
export const manifest = ${
|
|
1343
|
+
export const manifest = ${T ? JSON.stringify(T) : "globalThis.__QWIK_MANIFEST__"};
|
|
1344
1344
|
`;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function Ne(E) {
|
|
1347
1347
|
t.sourcemap = E;
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1350
|
-
|
|
1349
|
+
function Mt(E) {
|
|
1350
|
+
O("handleHotUpdate()", E.file);
|
|
1351
1351
|
for (const y of E.modules) {
|
|
1352
|
-
const { id:
|
|
1353
|
-
if (
|
|
1354
|
-
|
|
1355
|
-
for (const
|
|
1356
|
-
for (const [
|
|
1357
|
-
if (
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1352
|
+
const { id: T } = y;
|
|
1353
|
+
if (T) {
|
|
1354
|
+
O("handleHotUpdate()", `invalidate ${T}`), i.delete(T);
|
|
1355
|
+
for (const M of [r, o])
|
|
1356
|
+
for (const [N, [C, R]] of M)
|
|
1357
|
+
if (R === T) {
|
|
1358
|
+
O("handleHotUpdate()", `invalidate ${T} segment ${N}`), M.delete(N);
|
|
1359
|
+
const U = E.server.moduleGraph.getModuleById(N);
|
|
1360
|
+
U && E.server.moduleGraph.invalidateModule(U);
|
|
1361
1361
|
}
|
|
1362
1362
|
}
|
|
1363
1363
|
}
|
|
@@ -1378,65 +1378,65 @@ export const manifest = ${C ? JSON.stringify(C) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1378
1378
|
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(E))
|
|
1379
1379
|
return "qwik-loader";
|
|
1380
1380
|
}
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
const
|
|
1384
|
-
if (
|
|
1385
|
-
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(
|
|
1381
|
+
const T = y(E);
|
|
1382
|
+
if (T) {
|
|
1383
|
+
const M = T.meta.segment;
|
|
1384
|
+
if (M) {
|
|
1385
|
+
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(M.ctxName))
|
|
1386
1386
|
return null;
|
|
1387
|
-
const { hash:
|
|
1388
|
-
if (
|
|
1389
|
-
return
|
|
1387
|
+
const { hash: N } = M, C = t.entryStrategy.manual?.[N] || M.entry;
|
|
1388
|
+
if (C)
|
|
1389
|
+
return C;
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
return null;
|
|
1393
1393
|
};
|
|
1394
|
-
async function Ot(E, y,
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
...
|
|
1394
|
+
async function Ot(E, y, T, M) {
|
|
1395
|
+
const C = await Q(y).generateManifest(M);
|
|
1396
|
+
C.platform = {
|
|
1397
|
+
...M?.platform,
|
|
1398
1398
|
rollup: E.meta?.rollupVersion || "",
|
|
1399
1399
|
env: b.sys.env,
|
|
1400
1400
|
os: b.sys.os
|
|
1401
|
-
}, b.sys.env === "node" && (
|
|
1402
|
-
const
|
|
1401
|
+
}, b.sys.env === "node" && (C.platform.node = process.versions.node);
|
|
1402
|
+
const R = en(C, T), U = E.emitFile({
|
|
1403
1403
|
type: "asset",
|
|
1404
1404
|
name: "bundle-graph.json",
|
|
1405
|
-
source: JSON.stringify(
|
|
1406
|
-
}), B = E.getFileName(
|
|
1407
|
-
|
|
1405
|
+
source: JSON.stringify(R)
|
|
1406
|
+
}), B = E.getFileName(U);
|
|
1407
|
+
C.bundleGraphAsset = B, C.assets[B] = {
|
|
1408
1408
|
name: "bundle-graph.json",
|
|
1409
|
-
size:
|
|
1409
|
+
size: R.length
|
|
1410
1410
|
};
|
|
1411
|
-
const
|
|
1411
|
+
const j = JSON.stringify(C, null, " ");
|
|
1412
1412
|
E.emitFile({
|
|
1413
|
-
fileName:
|
|
1413
|
+
fileName: We,
|
|
1414
1414
|
type: "asset",
|
|
1415
|
-
source:
|
|
1416
|
-
}), typeof t.manifestOutput == "function" && await t.manifestOutput(
|
|
1415
|
+
source: j
|
|
1416
|
+
}), typeof t.manifestOutput == "function" && await t.manifestOutput(C), typeof t.transformedModuleOutput == "function" && await t.transformedModuleOutput(Y());
|
|
1417
1417
|
}
|
|
1418
1418
|
return {
|
|
1419
|
-
buildStart:
|
|
1420
|
-
createOutputAnalyzer:
|
|
1421
|
-
getQwikBuildModule:
|
|
1419
|
+
buildStart: I,
|
|
1420
|
+
createOutputAnalyzer: Q,
|
|
1421
|
+
getQwikBuildModule: ue,
|
|
1422
1422
|
getOptimizer: _,
|
|
1423
|
-
getOptions:
|
|
1423
|
+
getOptions: ee,
|
|
1424
1424
|
getPath: l,
|
|
1425
1425
|
getSys: s,
|
|
1426
|
-
getTransformedOutputs:
|
|
1426
|
+
getTransformedOutputs: Y,
|
|
1427
1427
|
init: x,
|
|
1428
|
-
load:
|
|
1429
|
-
debug:
|
|
1430
|
-
log:
|
|
1431
|
-
normalizeOptions:
|
|
1432
|
-
normalizePath:
|
|
1433
|
-
onDiagnostics:
|
|
1434
|
-
resolveId:
|
|
1435
|
-
transform:
|
|
1428
|
+
load: A,
|
|
1429
|
+
debug: O,
|
|
1430
|
+
log: ie,
|
|
1431
|
+
normalizeOptions: m,
|
|
1432
|
+
normalizePath: F,
|
|
1433
|
+
onDiagnostics: Re,
|
|
1434
|
+
resolveId: P,
|
|
1435
|
+
transform: X,
|
|
1436
1436
|
validateSource: u,
|
|
1437
|
-
setSourceMapSupport:
|
|
1437
|
+
setSourceMapSupport: Ne,
|
|
1438
1438
|
configureServer: c,
|
|
1439
|
-
handleHotUpdate:
|
|
1439
|
+
handleHotUpdate: Mt,
|
|
1440
1440
|
manualChunks: qt,
|
|
1441
1441
|
generateManifest: Ot
|
|
1442
1442
|
};
|
|
@@ -1449,16 +1449,16 @@ const gn = {
|
|
|
1449
1449
|
".jsx": !0,
|
|
1450
1450
|
".ts": !0,
|
|
1451
1451
|
".tsx": !0
|
|
1452
|
-
},
|
|
1452
|
+
}, Dt = /\.qwik\.[mc]?js$/, Ue = "@qwik.dev/core", Be = "@qwik.dev/core/internal", ne = "@qwik.dev/core/build", Qe = "@qwik.dev/core/jsx-runtime", Je = "@qwik.dev/core/jsx-dev-runtime", ze = "@qwik.dev/core/server", re = "@qwik-client-manifest", He = "@qwik.dev/core/preloader", pe = "@qwik-handlers", yn = "src", at = "dist", bn = "server", vn = "lib", We = "q-manifest.json";
|
|
1453
1453
|
async function wn(e, n, i) {
|
|
1454
1454
|
if (e.env === "browsermain" || e.env === "webworker")
|
|
1455
1455
|
return;
|
|
1456
1456
|
const r = await e.dynamicImport("node:fs");
|
|
1457
1457
|
let o = i;
|
|
1458
1458
|
for (; o; ) {
|
|
1459
|
-
const
|
|
1459
|
+
const g = e.path.join(o, "node_modules", n, "package.json");
|
|
1460
1460
|
try {
|
|
1461
|
-
return await r.promises.access(
|
|
1461
|
+
return await r.promises.access(g), r.promises.realpath(g);
|
|
1462
1462
|
} catch {
|
|
1463
1463
|
}
|
|
1464
1464
|
const d = e.path.dirname(o);
|
|
@@ -1468,7 +1468,7 @@ async function wn(e, n, i) {
|
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
function zr(e = {}) {
|
|
1471
|
-
const n =
|
|
1471
|
+
const n = Pt(e.optimizerOptions);
|
|
1472
1472
|
return {
|
|
1473
1473
|
name: "rollup-plugin-qwik",
|
|
1474
1474
|
api: {
|
|
@@ -1478,10 +1478,10 @@ function zr(e = {}) {
|
|
|
1478
1478
|
async options(r) {
|
|
1479
1479
|
await n.init();
|
|
1480
1480
|
const o = r.onwarn;
|
|
1481
|
-
r.onwarn = (a,
|
|
1482
|
-
a.plugin === "typescript" && a.message.includes("outputToFilesystem") || (o ? o(a,
|
|
1481
|
+
r.onwarn = (a, p) => {
|
|
1482
|
+
a.plugin === "typescript" && a.message.includes("outputToFilesystem") || (o ? o(a, p) : p(a));
|
|
1483
1483
|
};
|
|
1484
|
-
const
|
|
1484
|
+
const g = {
|
|
1485
1485
|
csr: e.csr,
|
|
1486
1486
|
target: e.target,
|
|
1487
1487
|
buildMode: e.buildMode,
|
|
@@ -1499,29 +1499,29 @@ function zr(e = {}) {
|
|
|
1499
1499
|
lint: e.lint,
|
|
1500
1500
|
experimental: e.experimental
|
|
1501
1501
|
};
|
|
1502
|
-
await n.normalizeOptions(
|
|
1502
|
+
await n.normalizeOptions(g);
|
|
1503
1503
|
const { input: d } = n.getOptions();
|
|
1504
1504
|
return r.input = d, r;
|
|
1505
1505
|
},
|
|
1506
1506
|
outputOptions(r) {
|
|
1507
|
-
return
|
|
1507
|
+
return Ye(n, r, !1);
|
|
1508
1508
|
},
|
|
1509
1509
|
async buildStart() {
|
|
1510
|
-
n.onDiagnostics((r, o,
|
|
1510
|
+
n.onDiagnostics((r, o, g) => {
|
|
1511
1511
|
r.forEach((d) => {
|
|
1512
|
-
const a = n.normalizePath(o.sys.path.join(
|
|
1513
|
-
d.category === "error" ? this.error(
|
|
1512
|
+
const a = n.normalizePath(o.sys.path.join(g, d.file));
|
|
1513
|
+
d.category === "error" ? this.error(Ae(a, d)) : this.warn(Ae(a, d));
|
|
1514
1514
|
});
|
|
1515
1515
|
}), await n.buildStart(this);
|
|
1516
1516
|
},
|
|
1517
1517
|
resolveId(r, o) {
|
|
1518
|
-
return
|
|
1518
|
+
return Z(r) ? null : n.resolveId(this, r, o);
|
|
1519
1519
|
},
|
|
1520
1520
|
load(r) {
|
|
1521
|
-
return
|
|
1521
|
+
return Z(r) ? null : n.load(this, r);
|
|
1522
1522
|
},
|
|
1523
1523
|
transform(r, o) {
|
|
1524
|
-
return
|
|
1524
|
+
return Z(o) ? null : n.transform(this, r, o);
|
|
1525
1525
|
},
|
|
1526
1526
|
async generateBundle(r, o) {
|
|
1527
1527
|
n.getOptions().target === "client" && await n.generateManifest(this, o);
|
|
@@ -1531,11 +1531,11 @@ function zr(e = {}) {
|
|
|
1531
1531
|
async function xn(e, n, i, r) {
|
|
1532
1532
|
return Array.isArray(n) ? (n.length || n.push({}), await Promise.all(
|
|
1533
1533
|
n.map(async (o) => ({
|
|
1534
|
-
...await
|
|
1534
|
+
...await Ye(e, o, i),
|
|
1535
1535
|
dir: r || o.dir
|
|
1536
1536
|
}))
|
|
1537
1537
|
)) : {
|
|
1538
|
-
...await
|
|
1538
|
+
...await Ye(e, n, i),
|
|
1539
1539
|
dir: r || n?.dir
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
@@ -1544,13 +1544,13 @@ const In = (e, n, i) => n.buildMode === "production" && !n.debug ? `${e}build/q-
|
|
|
1544
1544
|
return `${e}build/core.js`;
|
|
1545
1545
|
if (r.moduleIds?.some((d) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(d)))
|
|
1546
1546
|
return `${e}build/qwik-router.js`;
|
|
1547
|
-
const
|
|
1548
|
-
return `${e}build/${
|
|
1547
|
+
const g = i.sys.path.relative(i.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
1548
|
+
return `${e}build/${g}.js`;
|
|
1549
1549
|
};
|
|
1550
|
-
async function
|
|
1551
|
-
const r = { ...n }, o = e.getOptions(),
|
|
1550
|
+
async function Ye(e, n, i) {
|
|
1551
|
+
const r = { ...n }, o = e.getOptions(), g = e.getOptimizer(), d = e.manualChunks;
|
|
1552
1552
|
r.assetFileNames || (r.assetFileNames = `${i ? `${o.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
|
|
1553
|
-
const a = In(i ? `${o.assetsDir}` : "", o,
|
|
1553
|
+
const a = In(i ? `${o.assetsDir}` : "", o, g);
|
|
1554
1554
|
if (o.target === "client") {
|
|
1555
1555
|
r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
|
|
1556
1556
|
const t = r.manualChunks;
|
|
@@ -1560,10 +1560,10 @@ async function Xe(e, n, i) {
|
|
|
1560
1560
|
} else
|
|
1561
1561
|
r.chunkFileNames || (r.chunkFileNames = a);
|
|
1562
1562
|
r.dir || (r.dir = o.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1563
|
+
const p = await wn(g.sys, "rollup", g.sys.cwd());
|
|
1564
|
+
if (p)
|
|
1565
1565
|
try {
|
|
1566
|
-
const v = await (await
|
|
1566
|
+
const v = await (await g.sys.dynamicImport("node:fs")).promises.readFile(p, "utf-8"), w = JSON.parse(v), x = String(w?.version || ""), [_, s, l] = x.split(".").map((c) => parseInt(c, 10));
|
|
1567
1567
|
Number.isFinite(_) && (_ > 4 || _ === 4 && (s > 52 || s === 52 && (l || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
|
|
1568
1568
|
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${x}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
|
|
1569
1569
|
);
|
|
@@ -1571,7 +1571,7 @@ async function Xe(e, n, i) {
|
|
|
1571
1571
|
}
|
|
1572
1572
|
return r;
|
|
1573
1573
|
}
|
|
1574
|
-
function
|
|
1574
|
+
function Ae(e, n) {
|
|
1575
1575
|
const i = n.highlights?.[0];
|
|
1576
1576
|
return Object.assign(new Error(n.message), {
|
|
1577
1577
|
id: e,
|
|
@@ -1583,33 +1583,33 @@ function Re(e, n) {
|
|
|
1583
1583
|
stack: ""
|
|
1584
1584
|
});
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function z(e) {
|
|
1587
1587
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1588
1588
|
}
|
|
1589
|
-
var he = {},
|
|
1590
|
-
function
|
|
1591
|
-
return
|
|
1589
|
+
var he = {}, Ge = {}, lt;
|
|
1590
|
+
function H() {
|
|
1591
|
+
return lt || (lt = 1, (function(e) {
|
|
1592
1592
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.findBox = e.readUInt = e.readUInt32LE = e.readUInt32BE = e.readInt32LE = e.readUInt24LE = e.readUInt16LE = e.readUInt16BE = e.readInt16LE = e.toHexString = e.toUTF8String = void 0;
|
|
1593
|
-
const n = new TextDecoder(), i = (l,
|
|
1593
|
+
const n = new TextDecoder(), i = (l, h = 0, c = l.length) => n.decode(l.slice(h, c));
|
|
1594
1594
|
e.toUTF8String = i;
|
|
1595
|
-
const r = (l,
|
|
1595
|
+
const r = (l, h = 0, c = l.length) => l.slice(h, c).reduce((m, k) => m + ("0" + k.toString(16)).slice(-2), "");
|
|
1596
1596
|
e.toHexString = r;
|
|
1597
|
-
const o = (l,
|
|
1598
|
-
const c = l[
|
|
1597
|
+
const o = (l, h = 0) => {
|
|
1598
|
+
const c = l[h] + l[h + 1] * 256;
|
|
1599
1599
|
return c | (c & 2 ** 15) * 131070;
|
|
1600
1600
|
};
|
|
1601
1601
|
e.readInt16LE = o;
|
|
1602
|
-
const
|
|
1603
|
-
e.readUInt16BE =
|
|
1604
|
-
const d = (l,
|
|
1602
|
+
const g = (l, h = 0) => l[h] * 2 ** 8 + l[h + 1];
|
|
1603
|
+
e.readUInt16BE = g;
|
|
1604
|
+
const d = (l, h = 0) => l[h] + l[h + 1] * 2 ** 8;
|
|
1605
1605
|
e.readUInt16LE = d;
|
|
1606
|
-
const a = (l,
|
|
1606
|
+
const a = (l, h = 0) => l[h] + l[h + 1] * 2 ** 8 + l[h + 2] * 2 ** 16;
|
|
1607
1607
|
e.readUInt24LE = a;
|
|
1608
|
-
const
|
|
1609
|
-
e.readInt32LE =
|
|
1610
|
-
const t = (l,
|
|
1608
|
+
const p = (l, h = 0) => l[h] + l[h + 1] * 2 ** 8 + l[h + 2] * 2 ** 16 + (l[h + 3] << 24);
|
|
1609
|
+
e.readInt32LE = p;
|
|
1610
|
+
const t = (l, h = 0) => l[h] * 2 ** 24 + l[h + 1] * 2 ** 16 + l[h + 2] * 2 ** 8 + l[h + 3];
|
|
1611
1611
|
e.readUInt32BE = t;
|
|
1612
|
-
const v = (l,
|
|
1612
|
+
const v = (l, h = 0) => l[h] + l[h + 1] * 2 ** 8 + l[h + 2] * 2 ** 16 + l[h + 3] * 2 ** 24;
|
|
1613
1613
|
e.readUInt32LE = v;
|
|
1614
1614
|
const w = {
|
|
1615
1615
|
readUInt16BE: e.readUInt16BE,
|
|
@@ -1617,41 +1617,41 @@ function z() {
|
|
|
1617
1617
|
readUInt32BE: e.readUInt32BE,
|
|
1618
1618
|
readUInt32LE: e.readUInt32LE
|
|
1619
1619
|
};
|
|
1620
|
-
function x(l,
|
|
1620
|
+
function x(l, h, c, m) {
|
|
1621
1621
|
c = c || 0;
|
|
1622
|
-
const k =
|
|
1622
|
+
const k = m ? "BE" : "LE", u = "readUInt" + h + k;
|
|
1623
1623
|
return w[u](l, c);
|
|
1624
1624
|
}
|
|
1625
1625
|
e.readUInt = x;
|
|
1626
|
-
function _(l,
|
|
1627
|
-
if (l.length -
|
|
1626
|
+
function _(l, h) {
|
|
1627
|
+
if (l.length - h < 4)
|
|
1628
1628
|
return;
|
|
1629
|
-
const c = (0, e.readUInt32BE)(l,
|
|
1630
|
-
if (!(l.length -
|
|
1629
|
+
const c = (0, e.readUInt32BE)(l, h);
|
|
1630
|
+
if (!(l.length - h < c))
|
|
1631
1631
|
return {
|
|
1632
|
-
name: (0, e.toUTF8String)(l, 4 +
|
|
1633
|
-
offset:
|
|
1632
|
+
name: (0, e.toUTF8String)(l, 4 + h, 8 + h),
|
|
1633
|
+
offset: h,
|
|
1634
1634
|
size: c
|
|
1635
1635
|
};
|
|
1636
1636
|
}
|
|
1637
|
-
function s(l,
|
|
1637
|
+
function s(l, h, c) {
|
|
1638
1638
|
for (; c < l.length; ) {
|
|
1639
|
-
const
|
|
1640
|
-
if (!
|
|
1639
|
+
const m = _(l, c);
|
|
1640
|
+
if (!m)
|
|
1641
1641
|
break;
|
|
1642
|
-
if (
|
|
1643
|
-
return
|
|
1644
|
-
c +=
|
|
1642
|
+
if (m.name === h)
|
|
1643
|
+
return m;
|
|
1644
|
+
c += m.size > 0 ? m.size : 8;
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
e.findBox = s;
|
|
1648
|
-
})(
|
|
1648
|
+
})(Ge)), Ge;
|
|
1649
1649
|
}
|
|
1650
|
-
var
|
|
1650
|
+
var ct;
|
|
1651
1651
|
function Sn() {
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1654
|
-
const e =
|
|
1652
|
+
if (ct) return he;
|
|
1653
|
+
ct = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.BMP = void 0;
|
|
1654
|
+
const e = H();
|
|
1655
1655
|
return he.BMP = {
|
|
1656
1656
|
validate: (n) => (0, e.toUTF8String)(n, 0, 2) === "BM",
|
|
1657
1657
|
calculate: (n) => ({
|
|
@@ -1661,63 +1661,63 @@ function Sn() {
|
|
|
1661
1661
|
}, he;
|
|
1662
1662
|
}
|
|
1663
1663
|
var kn = Sn();
|
|
1664
|
-
const En = /* @__PURE__ */
|
|
1665
|
-
var me = {}, ge = {},
|
|
1666
|
-
function
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1669
|
-
const e =
|
|
1664
|
+
const En = /* @__PURE__ */ z(kn);
|
|
1665
|
+
var me = {}, ge = {}, dt;
|
|
1666
|
+
function Nt() {
|
|
1667
|
+
if (dt) return ge;
|
|
1668
|
+
dt = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.ICO = void 0;
|
|
1669
|
+
const e = H(), n = 1, i = 6, r = 16;
|
|
1670
1670
|
function o(d, a) {
|
|
1671
|
-
const
|
|
1672
|
-
return
|
|
1671
|
+
const p = d[a];
|
|
1672
|
+
return p === 0 ? 256 : p;
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1675
|
-
const
|
|
1674
|
+
function g(d, a) {
|
|
1675
|
+
const p = i + a * r;
|
|
1676
1676
|
return {
|
|
1677
|
-
height: o(d,
|
|
1678
|
-
width: o(d,
|
|
1677
|
+
height: o(d, p + 1),
|
|
1678
|
+
width: o(d, p)
|
|
1679
1679
|
};
|
|
1680
1680
|
}
|
|
1681
1681
|
return ge.ICO = {
|
|
1682
1682
|
validate(d) {
|
|
1683
|
-
const a = (0, e.readUInt16LE)(d, 0),
|
|
1684
|
-
return a !== 0 ||
|
|
1683
|
+
const a = (0, e.readUInt16LE)(d, 0), p = (0, e.readUInt16LE)(d, 4);
|
|
1684
|
+
return a !== 0 || p === 0 ? !1 : (0, e.readUInt16LE)(d, 2) === n;
|
|
1685
1685
|
},
|
|
1686
1686
|
calculate(d) {
|
|
1687
|
-
const a = (0, e.readUInt16LE)(d, 4),
|
|
1687
|
+
const a = (0, e.readUInt16LE)(d, 4), p = g(d, 0);
|
|
1688
1688
|
if (a === 1)
|
|
1689
|
-
return
|
|
1690
|
-
const t = [
|
|
1689
|
+
return p;
|
|
1690
|
+
const t = [p];
|
|
1691
1691
|
for (let v = 1; v < a; v += 1)
|
|
1692
|
-
t.push(
|
|
1692
|
+
t.push(g(d, v));
|
|
1693
1693
|
return {
|
|
1694
|
-
height:
|
|
1694
|
+
height: p.height,
|
|
1695
1695
|
images: t,
|
|
1696
|
-
width:
|
|
1696
|
+
width: p.width
|
|
1697
1697
|
};
|
|
1698
1698
|
}
|
|
1699
1699
|
}, ge;
|
|
1700
1700
|
}
|
|
1701
|
-
var
|
|
1701
|
+
var ut;
|
|
1702
1702
|
function _n() {
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1705
|
-
const e =
|
|
1703
|
+
if (ut) return me;
|
|
1704
|
+
ut = 1, Object.defineProperty(me, "__esModule", { value: !0 }), me.CUR = void 0;
|
|
1705
|
+
const e = Nt(), n = H(), i = 2;
|
|
1706
1706
|
return me.CUR = {
|
|
1707
1707
|
validate(r) {
|
|
1708
|
-
const o = (0, n.readUInt16LE)(r, 0),
|
|
1709
|
-
return o !== 0 ||
|
|
1708
|
+
const o = (0, n.readUInt16LE)(r, 0), g = (0, n.readUInt16LE)(r, 4);
|
|
1709
|
+
return o !== 0 || g === 0 ? !1 : (0, n.readUInt16LE)(r, 2) === i;
|
|
1710
1710
|
},
|
|
1711
1711
|
calculate: (r) => e.ICO.calculate(r)
|
|
1712
1712
|
}, me;
|
|
1713
1713
|
}
|
|
1714
1714
|
var Tn = _n();
|
|
1715
|
-
const Cn = /* @__PURE__ */
|
|
1716
|
-
var ye = {},
|
|
1715
|
+
const Cn = /* @__PURE__ */ z(Tn);
|
|
1716
|
+
var ye = {}, ft;
|
|
1717
1717
|
function Pn() {
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1720
|
-
const e =
|
|
1718
|
+
if (ft) return ye;
|
|
1719
|
+
ft = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.DDS = void 0;
|
|
1720
|
+
const e = H();
|
|
1721
1721
|
return ye.DDS = {
|
|
1722
1722
|
validate: (n) => (0, e.readUInt32LE)(n, 0) === 542327876,
|
|
1723
1723
|
calculate: (n) => ({
|
|
@@ -1727,12 +1727,12 @@ function Pn() {
|
|
|
1727
1727
|
}, ye;
|
|
1728
1728
|
}
|
|
1729
1729
|
var Dn = Pn();
|
|
1730
|
-
const Nn = /* @__PURE__ */
|
|
1731
|
-
var be = {},
|
|
1730
|
+
const Nn = /* @__PURE__ */ z(Dn);
|
|
1731
|
+
var be = {}, pt;
|
|
1732
1732
|
function Mn() {
|
|
1733
|
-
if (
|
|
1734
|
-
|
|
1735
|
-
const e =
|
|
1733
|
+
if (pt) return be;
|
|
1734
|
+
pt = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.GIF = void 0;
|
|
1735
|
+
const e = H(), n = /^GIF8[79]a/;
|
|
1736
1736
|
return be.GIF = {
|
|
1737
1737
|
validate: (i) => n.test((0, e.toUTF8String)(i, 0, 6)),
|
|
1738
1738
|
calculate: (i) => ({
|
|
@@ -1742,12 +1742,12 @@ function Mn() {
|
|
|
1742
1742
|
}, be;
|
|
1743
1743
|
}
|
|
1744
1744
|
var qn = Mn();
|
|
1745
|
-
const On = /* @__PURE__ */
|
|
1746
|
-
var ve = {},
|
|
1745
|
+
const On = /* @__PURE__ */ z(qn);
|
|
1746
|
+
var ve = {}, ht;
|
|
1747
1747
|
function Ln() {
|
|
1748
|
-
if (
|
|
1749
|
-
|
|
1750
|
-
const e =
|
|
1748
|
+
if (ht) return ve;
|
|
1749
|
+
ht = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.ICNS = void 0;
|
|
1750
|
+
const e = H(), n = 8, i = 4, r = 4, o = {
|
|
1751
1751
|
ICON: 32,
|
|
1752
1752
|
"ICN#": 32,
|
|
1753
1753
|
// m => 16 x 16
|
|
@@ -1789,22 +1789,22 @@ function Ln() {
|
|
|
1789
1789
|
// . => 1024 x 1024
|
|
1790
1790
|
ic10: 1024
|
|
1791
1791
|
};
|
|
1792
|
-
function
|
|
1793
|
-
const t =
|
|
1792
|
+
function g(a, p) {
|
|
1793
|
+
const t = p + r;
|
|
1794
1794
|
return [
|
|
1795
|
-
(0, e.toUTF8String)(a,
|
|
1795
|
+
(0, e.toUTF8String)(a, p, t),
|
|
1796
1796
|
(0, e.readUInt32BE)(a, t)
|
|
1797
1797
|
];
|
|
1798
1798
|
}
|
|
1799
1799
|
function d(a) {
|
|
1800
|
-
const
|
|
1801
|
-
return { width:
|
|
1800
|
+
const p = o[a];
|
|
1801
|
+
return { width: p, height: p, type: a };
|
|
1802
1802
|
}
|
|
1803
1803
|
return ve.ICNS = {
|
|
1804
1804
|
validate: (a) => (0, e.toUTF8String)(a, 0, 4) === "icns",
|
|
1805
1805
|
calculate(a) {
|
|
1806
|
-
const
|
|
1807
|
-
let v = n, w =
|
|
1806
|
+
const p = a.length, t = (0, e.readUInt32BE)(a, i);
|
|
1807
|
+
let v = n, w = g(a, v), x = d(w[0]);
|
|
1808
1808
|
if (v += w[1], v === t)
|
|
1809
1809
|
return x;
|
|
1810
1810
|
const _ = {
|
|
@@ -1812,21 +1812,21 @@ function Ln() {
|
|
|
1812
1812
|
images: [x],
|
|
1813
1813
|
width: x.width
|
|
1814
1814
|
};
|
|
1815
|
-
for (; v < t && v <
|
|
1816
|
-
w =
|
|
1815
|
+
for (; v < t && v < p; )
|
|
1816
|
+
w = g(a, v), x = d(w[0]), v += w[1], _.images.push(x);
|
|
1817
1817
|
return _;
|
|
1818
1818
|
}
|
|
1819
1819
|
}, ve;
|
|
1820
1820
|
}
|
|
1821
1821
|
var jn = Ln();
|
|
1822
|
-
const Un = /* @__PURE__ */
|
|
1823
|
-
var Bn =
|
|
1824
|
-
const An = /* @__PURE__ */
|
|
1825
|
-
var we = {},
|
|
1822
|
+
const Un = /* @__PURE__ */ z(jn);
|
|
1823
|
+
var Bn = Nt();
|
|
1824
|
+
const An = /* @__PURE__ */ z(Bn);
|
|
1825
|
+
var we = {}, mt;
|
|
1826
1826
|
function Fn() {
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1829
|
-
const e =
|
|
1827
|
+
if (mt) return we;
|
|
1828
|
+
mt = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.J2C = void 0;
|
|
1829
|
+
const e = H();
|
|
1830
1830
|
return we.J2C = {
|
|
1831
1831
|
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
1832
1832
|
validate: (n) => (0, e.readUInt32BE)(n, 0) === 4283432785,
|
|
@@ -1837,12 +1837,12 @@ function Fn() {
|
|
|
1837
1837
|
}, we;
|
|
1838
1838
|
}
|
|
1839
1839
|
var Rn = Fn();
|
|
1840
|
-
const $n = /* @__PURE__ */
|
|
1841
|
-
var xe = {},
|
|
1840
|
+
const $n = /* @__PURE__ */ z(Rn);
|
|
1841
|
+
var xe = {}, gt;
|
|
1842
1842
|
function zn() {
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1845
|
-
const e =
|
|
1843
|
+
if (gt) return xe;
|
|
1844
|
+
gt = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.JP2 = void 0;
|
|
1845
|
+
const e = H();
|
|
1846
1846
|
return xe.JP2 = {
|
|
1847
1847
|
validate(n) {
|
|
1848
1848
|
if ((0, e.toUTF8String)(n, 4, 8) !== "jP ")
|
|
@@ -1862,12 +1862,12 @@ function zn() {
|
|
|
1862
1862
|
}, xe;
|
|
1863
1863
|
}
|
|
1864
1864
|
var Hn = zn();
|
|
1865
|
-
const Wn = /* @__PURE__ */
|
|
1866
|
-
var Ie = {},
|
|
1865
|
+
const Wn = /* @__PURE__ */ z(Hn);
|
|
1866
|
+
var Ie = {}, yt;
|
|
1867
1867
|
function Gn() {
|
|
1868
|
-
if (
|
|
1869
|
-
|
|
1870
|
-
const e =
|
|
1868
|
+
if (yt) return Ie;
|
|
1869
|
+
yt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.JPG = void 0;
|
|
1870
|
+
const e = H(), n = "45786966", i = 2, r = 6, o = 2, g = "4d4d", d = "4949", a = 12, p = 2;
|
|
1871
1871
|
function t(s) {
|
|
1872
1872
|
return (0, e.toHexString)(s, 2, 6) === n;
|
|
1873
1873
|
}
|
|
@@ -1878,20 +1878,20 @@ function Gn() {
|
|
|
1878
1878
|
};
|
|
1879
1879
|
}
|
|
1880
1880
|
function w(s, l) {
|
|
1881
|
-
const c = r + 8,
|
|
1882
|
-
for (let k = 0; k <
|
|
1883
|
-
const u = c +
|
|
1881
|
+
const c = r + 8, m = (0, e.readUInt)(s, 16, c, l);
|
|
1882
|
+
for (let k = 0; k < m; k++) {
|
|
1883
|
+
const u = c + p + k * a, b = u + a;
|
|
1884
1884
|
if (u > s.length)
|
|
1885
1885
|
return;
|
|
1886
|
-
const
|
|
1887
|
-
if ((0, e.readUInt)(
|
|
1888
|
-
return (0, e.readUInt)(
|
|
1886
|
+
const f = s.slice(u, b);
|
|
1887
|
+
if ((0, e.readUInt)(f, 16, 0, l) === 274)
|
|
1888
|
+
return (0, e.readUInt)(f, 16, 2, l) !== 3 || (0, e.readUInt)(f, 32, 4, l) !== 1 ? void 0 : (0, e.readUInt)(f, 16, 8, l);
|
|
1889
1889
|
}
|
|
1890
1890
|
}
|
|
1891
1891
|
function x(s, l) {
|
|
1892
|
-
const
|
|
1893
|
-
if (
|
|
1894
|
-
return w(
|
|
1892
|
+
const h = s.slice(i, l), c = (0, e.toHexString)(h, r, r + o), m = c === g;
|
|
1893
|
+
if (m || c === d)
|
|
1894
|
+
return w(h, m);
|
|
1895
1895
|
}
|
|
1896
1896
|
function _(s, l) {
|
|
1897
1897
|
if (l > s.length)
|
|
@@ -1901,20 +1901,20 @@ function Gn() {
|
|
|
1901
1901
|
validate: (s) => (0, e.toHexString)(s, 0, 2) === "ffd8",
|
|
1902
1902
|
calculate(s) {
|
|
1903
1903
|
s = s.slice(4);
|
|
1904
|
-
let l,
|
|
1904
|
+
let l, h;
|
|
1905
1905
|
for (; s.length; ) {
|
|
1906
1906
|
const c = (0, e.readUInt16BE)(s, 0);
|
|
1907
1907
|
if (s[c] !== 255) {
|
|
1908
1908
|
s = s.slice(1);
|
|
1909
1909
|
continue;
|
|
1910
1910
|
}
|
|
1911
|
-
if (t(s) && (l = x(s, c)), _(s, c),
|
|
1912
|
-
const
|
|
1911
|
+
if (t(s) && (l = x(s, c)), _(s, c), h = s[c + 1], h === 192 || h === 193 || h === 194) {
|
|
1912
|
+
const m = v(s, c + 5);
|
|
1913
1913
|
return l ? {
|
|
1914
|
-
height:
|
|
1914
|
+
height: m.height,
|
|
1915
1915
|
orientation: l,
|
|
1916
|
-
width:
|
|
1917
|
-
} :
|
|
1916
|
+
width: m.width
|
|
1917
|
+
} : m;
|
|
1918
1918
|
}
|
|
1919
1919
|
s = s.slice(c + 2);
|
|
1920
1920
|
}
|
|
@@ -1923,12 +1923,12 @@ function Gn() {
|
|
|
1923
1923
|
}, Ie;
|
|
1924
1924
|
}
|
|
1925
1925
|
var Kn = Gn();
|
|
1926
|
-
const Qn = /* @__PURE__ */
|
|
1927
|
-
var Se = {},
|
|
1926
|
+
const Qn = /* @__PURE__ */ z(Kn);
|
|
1927
|
+
var Se = {}, bt;
|
|
1928
1928
|
function Jn() {
|
|
1929
|
-
if (
|
|
1930
|
-
|
|
1931
|
-
const e =
|
|
1929
|
+
if (bt) return Se;
|
|
1930
|
+
bt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.KTX = void 0;
|
|
1931
|
+
const e = H();
|
|
1932
1932
|
return Se.KTX = {
|
|
1933
1933
|
validate: (n) => {
|
|
1934
1934
|
const i = (0, e.toUTF8String)(n, 1, 7);
|
|
@@ -1945,19 +1945,19 @@ function Jn() {
|
|
|
1945
1945
|
}, Se;
|
|
1946
1946
|
}
|
|
1947
1947
|
var Yn = Jn();
|
|
1948
|
-
const Xn = /* @__PURE__ */
|
|
1949
|
-
var ke = {},
|
|
1948
|
+
const Xn = /* @__PURE__ */ z(Yn);
|
|
1949
|
+
var ke = {}, vt;
|
|
1950
1950
|
function Vn() {
|
|
1951
|
-
if (
|
|
1952
|
-
|
|
1953
|
-
const e =
|
|
1951
|
+
if (vt) return ke;
|
|
1952
|
+
vt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.PNG = void 0;
|
|
1953
|
+
const e = H(), n = `PNG\r
|
|
1954
1954
|
|
|
1955
1955
|
`, i = "IHDR", r = "CgBI";
|
|
1956
1956
|
return ke.PNG = {
|
|
1957
1957
|
validate(o) {
|
|
1958
1958
|
if (n === (0, e.toUTF8String)(o, 1, 8)) {
|
|
1959
|
-
let
|
|
1960
|
-
if (
|
|
1959
|
+
let g = (0, e.toUTF8String)(o, 12, 16);
|
|
1960
|
+
if (g === r && (g = (0, e.toUTF8String)(o, 28, 32)), g !== i)
|
|
1961
1961
|
throw new TypeError("Invalid PNG");
|
|
1962
1962
|
return !0;
|
|
1963
1963
|
}
|
|
@@ -1975,12 +1975,12 @@ function Vn() {
|
|
|
1975
1975
|
}, ke;
|
|
1976
1976
|
}
|
|
1977
1977
|
var Zn = Vn();
|
|
1978
|
-
const er = /* @__PURE__ */
|
|
1979
|
-
var Ee = {},
|
|
1978
|
+
const er = /* @__PURE__ */ z(Zn);
|
|
1979
|
+
var Ee = {}, wt;
|
|
1980
1980
|
function tr() {
|
|
1981
|
-
if (
|
|
1982
|
-
|
|
1983
|
-
const e =
|
|
1981
|
+
if (wt) return Ee;
|
|
1982
|
+
wt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.PNM = void 0;
|
|
1983
|
+
const e = H(), n = {
|
|
1984
1984
|
P1: "pbm/ascii",
|
|
1985
1985
|
P2: "pgm/ascii",
|
|
1986
1986
|
P3: "ppm/ascii",
|
|
@@ -1993,9 +1993,9 @@ function tr() {
|
|
|
1993
1993
|
default: (r) => {
|
|
1994
1994
|
let o = [];
|
|
1995
1995
|
for (; r.length > 0; ) {
|
|
1996
|
-
const
|
|
1997
|
-
if (
|
|
1998
|
-
o =
|
|
1996
|
+
const g = r.shift();
|
|
1997
|
+
if (g[0] !== "#") {
|
|
1998
|
+
o = g.split(" ");
|
|
1999
1999
|
break;
|
|
2000
2000
|
}
|
|
2001
2001
|
}
|
|
@@ -2009,10 +2009,10 @@ function tr() {
|
|
|
2009
2009
|
pam: (r) => {
|
|
2010
2010
|
const o = {};
|
|
2011
2011
|
for (; r.length > 0; ) {
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2012
|
+
const g = r.shift();
|
|
2013
|
+
if (g.length > 16 || g.charCodeAt(0) > 128)
|
|
2014
2014
|
continue;
|
|
2015
|
-
const [d, a] =
|
|
2015
|
+
const [d, a] = g.split(" ");
|
|
2016
2016
|
if (d && a && (o[d.toLowerCase()] = parseInt(a, 10)), o.height && o.width)
|
|
2017
2017
|
break;
|
|
2018
2018
|
}
|
|
@@ -2027,18 +2027,18 @@ function tr() {
|
|
|
2027
2027
|
return Ee.PNM = {
|
|
2028
2028
|
validate: (r) => (0, e.toUTF8String)(r, 0, 2) in n,
|
|
2029
2029
|
calculate(r) {
|
|
2030
|
-
const o = (0, e.toUTF8String)(r, 0, 2),
|
|
2031
|
-
return (i[
|
|
2030
|
+
const o = (0, e.toUTF8String)(r, 0, 2), g = n[o], d = (0, e.toUTF8String)(r, 3).split(/[\r\n]+/);
|
|
2031
|
+
return (i[g] || i.default)(d);
|
|
2032
2032
|
}
|
|
2033
2033
|
}, Ee;
|
|
2034
2034
|
}
|
|
2035
2035
|
var nr = tr();
|
|
2036
|
-
const rr = /* @__PURE__ */
|
|
2037
|
-
var _e = {},
|
|
2036
|
+
const rr = /* @__PURE__ */ z(nr);
|
|
2037
|
+
var _e = {}, xt;
|
|
2038
2038
|
function or() {
|
|
2039
|
-
if (
|
|
2040
|
-
|
|
2041
|
-
const e =
|
|
2039
|
+
if (xt) return _e;
|
|
2040
|
+
xt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.PSD = void 0;
|
|
2041
|
+
const e = H();
|
|
2042
2042
|
return _e.PSD = {
|
|
2043
2043
|
validate: (n) => (0, e.toUTF8String)(n, 0, 4) === "8BPS",
|
|
2044
2044
|
calculate: (n) => ({
|
|
@@ -2048,12 +2048,12 @@ function or() {
|
|
|
2048
2048
|
}, _e;
|
|
2049
2049
|
}
|
|
2050
2050
|
var ir = or();
|
|
2051
|
-
const sr = /* @__PURE__ */
|
|
2052
|
-
var Te = {},
|
|
2051
|
+
const sr = /* @__PURE__ */ z(ir);
|
|
2052
|
+
var Te = {}, It;
|
|
2053
2053
|
function ar() {
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2056
|
-
const e =
|
|
2054
|
+
if (It) return Te;
|
|
2055
|
+
It = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.SVG = void 0;
|
|
2056
|
+
const e = H(), n = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, i = {
|
|
2057
2057
|
height: /\sheight=(['"])([^%]+?)\1/,
|
|
2058
2058
|
root: n,
|
|
2059
2059
|
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
@@ -2068,9 +2068,9 @@ function ar() {
|
|
|
2068
2068
|
pc: 96 / 72 / 12,
|
|
2069
2069
|
pt: 96 / 72,
|
|
2070
2070
|
px: 1
|
|
2071
|
-
},
|
|
2071
|
+
}, g = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(o).join("|")})?$`);
|
|
2072
2072
|
function d(w) {
|
|
2073
|
-
const x =
|
|
2073
|
+
const x = g.exec(w);
|
|
2074
2074
|
if (x)
|
|
2075
2075
|
return Math.round(Number(x[1]) * (o[x[2]] || 1));
|
|
2076
2076
|
}
|
|
@@ -2081,7 +2081,7 @@ function ar() {
|
|
|
2081
2081
|
width: d(x[2])
|
|
2082
2082
|
};
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function p(w) {
|
|
2085
2085
|
const x = w.match(i.width), _ = w.match(i.height), s = w.match(i.viewbox);
|
|
2086
2086
|
return {
|
|
2087
2087
|
height: _ && d(_[2]),
|
|
@@ -2114,7 +2114,7 @@ function ar() {
|
|
|
2114
2114
|
calculate(w) {
|
|
2115
2115
|
const x = (0, e.toUTF8String)(w).match(i.root);
|
|
2116
2116
|
if (x) {
|
|
2117
|
-
const _ =
|
|
2117
|
+
const _ = p(x[0]);
|
|
2118
2118
|
if (_.width && _.height)
|
|
2119
2119
|
return t(_);
|
|
2120
2120
|
if (_.viewbox)
|
|
@@ -2125,12 +2125,12 @@ function ar() {
|
|
|
2125
2125
|
}, Te;
|
|
2126
2126
|
}
|
|
2127
2127
|
var lr = ar();
|
|
2128
|
-
const cr = /* @__PURE__ */
|
|
2129
|
-
var Ce = {},
|
|
2128
|
+
const cr = /* @__PURE__ */ z(lr);
|
|
2129
|
+
var Ce = {}, St;
|
|
2130
2130
|
function dr() {
|
|
2131
|
-
if (
|
|
2132
|
-
|
|
2133
|
-
const e =
|
|
2131
|
+
if (St) return Ce;
|
|
2132
|
+
St = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.TGA = void 0;
|
|
2133
|
+
const e = H();
|
|
2134
2134
|
return Ce.TGA = {
|
|
2135
2135
|
validate(n) {
|
|
2136
2136
|
return (0, e.readUInt16LE)(n, 0) === 0 && (0, e.readUInt16LE)(n, 4) === 0;
|
|
@@ -2144,12 +2144,12 @@ function dr() {
|
|
|
2144
2144
|
}, Ce;
|
|
2145
2145
|
}
|
|
2146
2146
|
var ur = dr();
|
|
2147
|
-
const fr = /* @__PURE__ */
|
|
2148
|
-
var Pe = {},
|
|
2147
|
+
const fr = /* @__PURE__ */ z(ur);
|
|
2148
|
+
var Pe = {}, kt;
|
|
2149
2149
|
function pr() {
|
|
2150
|
-
if (
|
|
2151
|
-
|
|
2152
|
-
const e =
|
|
2150
|
+
if (kt) return Pe;
|
|
2151
|
+
kt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.WEBP = void 0;
|
|
2152
|
+
const e = H();
|
|
2153
2153
|
function n(o) {
|
|
2154
2154
|
return {
|
|
2155
2155
|
height: 1 + (0, e.readUInt24LE)(o, 7),
|
|
@@ -2170,33 +2170,33 @@ function pr() {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
return Pe.WEBP = {
|
|
2172
2172
|
validate(o) {
|
|
2173
|
-
const
|
|
2174
|
-
return
|
|
2173
|
+
const g = (0, e.toUTF8String)(o, 0, 4) === "RIFF", d = (0, e.toUTF8String)(o, 8, 12) === "WEBP", a = (0, e.toUTF8String)(o, 12, 15) === "VP8";
|
|
2174
|
+
return g && d && a;
|
|
2175
2175
|
},
|
|
2176
2176
|
calculate(o) {
|
|
2177
|
-
const
|
|
2178
|
-
if (o = o.slice(20, 30),
|
|
2179
|
-
const a = o[0],
|
|
2180
|
-
if (
|
|
2177
|
+
const g = (0, e.toUTF8String)(o, 12, 16);
|
|
2178
|
+
if (o = o.slice(20, 30), g === "VP8X") {
|
|
2179
|
+
const a = o[0], p = (a & 192) === 0, t = (a & 1) === 0;
|
|
2180
|
+
if (p && t)
|
|
2181
2181
|
return n(o);
|
|
2182
2182
|
throw new TypeError("Invalid WebP");
|
|
2183
2183
|
}
|
|
2184
|
-
if (
|
|
2184
|
+
if (g === "VP8 " && o[0] !== 47)
|
|
2185
2185
|
return r(o);
|
|
2186
2186
|
const d = (0, e.toHexString)(o, 3, 6);
|
|
2187
|
-
if (
|
|
2187
|
+
if (g === "VP8L" && d !== "9d012a")
|
|
2188
2188
|
return i(o);
|
|
2189
2189
|
throw new TypeError("Invalid WebP");
|
|
2190
2190
|
}
|
|
2191
2191
|
}, Pe;
|
|
2192
2192
|
}
|
|
2193
2193
|
var hr = pr();
|
|
2194
|
-
const mr = /* @__PURE__ */
|
|
2195
|
-
var De = {},
|
|
2194
|
+
const mr = /* @__PURE__ */ z(hr);
|
|
2195
|
+
var De = {}, Et;
|
|
2196
2196
|
function gr() {
|
|
2197
|
-
if (
|
|
2198
|
-
|
|
2199
|
-
const e =
|
|
2197
|
+
if (Et) return De;
|
|
2198
|
+
Et = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.HEIF = void 0;
|
|
2199
|
+
const e = H(), n = {
|
|
2200
2200
|
avif: "avif",
|
|
2201
2201
|
mif1: "heif",
|
|
2202
2202
|
msf1: "heif",
|
|
@@ -2216,7 +2216,7 @@ function gr() {
|
|
|
2216
2216
|
return o ? (0, e.toUTF8String)(i, o.offset + 8, o.offset + 12) in n : !1;
|
|
2217
2217
|
},
|
|
2218
2218
|
calculate(i) {
|
|
2219
|
-
const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12),
|
|
2219
|
+
const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12), g = o && (0, e.findBox)(i, "ipco", o.offset + 8), d = g && (0, e.findBox)(i, "ispe", g.offset + 8);
|
|
2220
2220
|
if (d)
|
|
2221
2221
|
return {
|
|
2222
2222
|
height: (0, e.readUInt32BE)(i, d.offset + 16),
|
|
@@ -2228,7 +2228,7 @@ function gr() {
|
|
|
2228
2228
|
}, De;
|
|
2229
2229
|
}
|
|
2230
2230
|
var yr = gr();
|
|
2231
|
-
const br = /* @__PURE__ */
|
|
2231
|
+
const br = /* @__PURE__ */ z(yr), vr = {
|
|
2232
2232
|
56: "psd",
|
|
2233
2233
|
66: "bmp",
|
|
2234
2234
|
68: "dds",
|
|
@@ -2237,7 +2237,7 @@ const br = /* @__PURE__ */ $(yr), vr = {
|
|
|
2237
2237
|
105: "icns",
|
|
2238
2238
|
137: "png",
|
|
2239
2239
|
255: "jpg"
|
|
2240
|
-
},
|
|
2240
|
+
}, Fe = {
|
|
2241
2241
|
webp: mr.WEBP,
|
|
2242
2242
|
jpg: Qn.JPG,
|
|
2243
2243
|
png: er.PNG,
|
|
@@ -2255,15 +2255,15 @@ const br = /* @__PURE__ */ $(yr), vr = {
|
|
|
2255
2255
|
pnm: rr.PNM,
|
|
2256
2256
|
psd: sr.PSD,
|
|
2257
2257
|
tga: fr.TGA
|
|
2258
|
-
}, wr = Object.keys(
|
|
2258
|
+
}, wr = Object.keys(Fe);
|
|
2259
2259
|
function xr(e) {
|
|
2260
2260
|
const n = e[0], i = vr[n];
|
|
2261
|
-
return i &&
|
|
2261
|
+
return i && Fe[i].validate(e) ? i : wr.find((r) => Fe[r].validate(e));
|
|
2262
2262
|
}
|
|
2263
2263
|
function Ir(e) {
|
|
2264
2264
|
const n = xr(e);
|
|
2265
2265
|
if (typeof n < "u") {
|
|
2266
|
-
const i =
|
|
2266
|
+
const i = Fe[n].calculate(e);
|
|
2267
2267
|
if (i !== void 0)
|
|
2268
2268
|
return i.type = n, i;
|
|
2269
2269
|
}
|
|
@@ -2291,18 +2291,18 @@ async function Sr(e) {
|
|
|
2291
2291
|
return;
|
|
2292
2292
|
}
|
|
2293
2293
|
}
|
|
2294
|
-
const kr = (e, n, i) => async (r, o,
|
|
2294
|
+
const kr = (e, n, i) => async (r, o, g) => {
|
|
2295
2295
|
try {
|
|
2296
2296
|
const d = await e.dynamicImport("node:fs"), a = await e.dynamicImport("node:path");
|
|
2297
|
-
let
|
|
2297
|
+
let p;
|
|
2298
2298
|
try {
|
|
2299
|
-
|
|
2299
|
+
p = new URL(r.url, "http://localhost:3000/");
|
|
2300
2300
|
} catch {
|
|
2301
2301
|
o.statusCode = 404, o.end();
|
|
2302
2302
|
return;
|
|
2303
2303
|
}
|
|
2304
|
-
if (r.method === "GET" &&
|
|
2305
|
-
const t =
|
|
2304
|
+
if (r.method === "GET" && p.pathname === "/__image_info") {
|
|
2305
|
+
const t = p.searchParams.get("url");
|
|
2306
2306
|
if (o.setHeader("content-type", "application/json"), t) {
|
|
2307
2307
|
const v = await Sr(t);
|
|
2308
2308
|
o.setHeader("cache-control", "public, max-age=31536000, immutable"), v ? o.write(JSON.stringify(v)) : o.statusCode = 404;
|
|
@@ -2313,18 +2313,18 @@ const kr = (e, n, i) => async (r, o, m) => {
|
|
|
2313
2313
|
}
|
|
2314
2314
|
o.end();
|
|
2315
2315
|
return;
|
|
2316
|
-
} else if (r.method === "POST" &&
|
|
2317
|
-
const t =
|
|
2318
|
-
let
|
|
2319
|
-
const c = a.resolve(i, s.slice(0, s.length - 2).join(":")),
|
|
2316
|
+
} else if (r.method === "POST" && p.pathname === "/__image_fix") {
|
|
2317
|
+
const t = p.searchParams.get("loc"), v = p.searchParams.get("width"), w = p.searchParams.get("height"), x = p.searchParams.get("src"), _ = p.searchParams.get("currentHref"), s = t.split(":"), l = parseInt(s[s.length - 1], 10) - 1;
|
|
2318
|
+
let h = parseInt(s[s.length - 2], 10) - 1;
|
|
2319
|
+
const c = a.resolve(i, s.slice(0, s.length - 2).join(":")), m = a.extname(c).toLowerCase();
|
|
2320
2320
|
let u = d.readFileSync(c).toString("utf-8"), b = 0;
|
|
2321
2321
|
for (; b < u.length; b++)
|
|
2322
|
-
if (
|
|
2322
|
+
if (h === 0) {
|
|
2323
2323
|
b += l;
|
|
2324
2324
|
break;
|
|
2325
2325
|
} else if (u[b] === `
|
|
2326
2326
|
`) {
|
|
2327
|
-
|
|
2327
|
+
h--;
|
|
2328
2328
|
continue;
|
|
2329
2329
|
}
|
|
2330
2330
|
if (u.slice(b, b + 4) !== "<img") {
|
|
@@ -2333,49 +2333,49 @@ const kr = (e, n, i) => async (r, o, m) => {
|
|
|
2333
2333
|
), o.statusCode = 500;
|
|
2334
2334
|
return;
|
|
2335
2335
|
}
|
|
2336
|
-
const
|
|
2337
|
-
if (
|
|
2336
|
+
const f = u.indexOf(">", b) + 1;
|
|
2337
|
+
if (f < b) {
|
|
2338
2338
|
console.error(
|
|
2339
2339
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2340
2340
|
), o.statusCode = 500;
|
|
2341
2341
|
return;
|
|
2342
2342
|
}
|
|
2343
|
-
const
|
|
2344
|
-
let
|
|
2345
|
-
if (x && _ &&
|
|
2346
|
-
const
|
|
2347
|
-
if (
|
|
2348
|
-
const
|
|
2349
|
-
let
|
|
2350
|
-
if (d.existsSync(
|
|
2351
|
-
const
|
|
2352
|
-
await d.promises.mkdir(
|
|
2353
|
-
|
|
2354
|
-
a.join(i, "media",
|
|
2355
|
-
),
|
|
2356
|
-
} else if (d.existsSync(
|
|
2357
|
-
|
|
2343
|
+
const I = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(m);
|
|
2344
|
+
let S = u.slice(b, f);
|
|
2345
|
+
if (x && _ && I) {
|
|
2346
|
+
const q = new URL(x), D = new URL(_);
|
|
2347
|
+
if (q.origin === D.origin) {
|
|
2348
|
+
const P = a.join(n, "public", q.pathname), $ = a.join(n, q.pathname);
|
|
2349
|
+
let A;
|
|
2350
|
+
if (d.existsSync(P)) {
|
|
2351
|
+
const Y = a.join(i, "media", a.dirname(q.pathname));
|
|
2352
|
+
await d.promises.mkdir(Y, { recursive: !0 }), await d.promises.copyFile(
|
|
2353
|
+
P,
|
|
2354
|
+
a.join(i, "media", q.pathname)
|
|
2355
|
+
), A = "~/media" + q.pathname;
|
|
2356
|
+
} else if (d.existsSync($))
|
|
2357
|
+
A = q.pathname.replace("/src/", "~/");
|
|
2358
2358
|
else
|
|
2359
2359
|
return;
|
|
2360
|
-
const
|
|
2361
|
-
|
|
2362
|
-
let
|
|
2363
|
-
if (
|
|
2360
|
+
const G = Er(q.pathname), X = `${A}?jsx`;
|
|
2361
|
+
S = S.replace(/^<img/, `<${G}`), S = S.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), S = S.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), S = S.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
2362
|
+
let Q = 0;
|
|
2363
|
+
if (m === ".mdx" && u.startsWith("---") && (Q = u.indexOf("---", 4) + 3, Q === -1))
|
|
2364
2364
|
return;
|
|
2365
|
-
const
|
|
2366
|
-
import ${
|
|
2367
|
-
u = `${u.slice(0,
|
|
2368
|
-
|
|
2365
|
+
const ee = `
|
|
2366
|
+
import ${G} from '${X}';`;
|
|
2367
|
+
u = `${u.slice(0, Q)}${ee}${u.slice(
|
|
2368
|
+
Q,
|
|
2369
2369
|
b
|
|
2370
|
-
)}${
|
|
2370
|
+
)}${S}${u.slice(f)}`, d.writeFileSync(c, u);
|
|
2371
2371
|
return;
|
|
2372
2372
|
}
|
|
2373
2373
|
}
|
|
2374
|
-
|
|
2374
|
+
S = S.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${v}"`), S = S.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), S.includes("height=") || (S = S.replace(/<img/, `<img height="${w}"`)), S.includes("width=") || (S = S.replace(/<img/, `<img width="${v}"`)), u = u.slice(0, b) + S + u.slice(f), d.writeFileSync(c, u);
|
|
2375
2375
|
} else
|
|
2376
|
-
|
|
2376
|
+
g();
|
|
2377
2377
|
} catch (d) {
|
|
2378
|
-
d instanceof Error && await on(e, d),
|
|
2378
|
+
d instanceof Error && await on(e, d), g(d);
|
|
2379
2379
|
}
|
|
2380
2380
|
};
|
|
2381
2381
|
function Er(e) {
|
|
@@ -2551,30 +2551,30 @@ const Tr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
2551
2551
|
</dialog>
|
|
2552
2552
|
`, qr = `vite-error-overlay{--color-bright: rgba(255, 255, 255, .8);--color-yellow: rgba(255, 246, 85, .8);--qwik-dark-blue: #006ce9;--qwik-light-blue: #3ec2f7;--qwik-light-purple: #ac7ff4;--qwik-dark-purple: #713fc2;--yellow: #fff;--purple: var(--color-bright);--red: var(--qwik-light-blue);--vertical-box-spacing: 15px;--box-padding: 20px;--box-margin: 0 0 var(--vertical-box-spacing) 0;--box-background: rgba(0, 0, 0, .5);--box-border-radius: 8px}vite-error-overlay::part(backdrop){background:#020b1199}vite-error-overlay::part(window){background:transparent;border:none;box-shadow:none;box-sizing:border-box;margin:50px auto;max-width:1200px;padding:var(--box-padding);width:90%}vite-error-overlay::part(message){display:flex;flex-direction:column;font-size:1.6rem;line-height:1.7;margin-bottom:30px}vite-error-overlay::part(plugin){font-size:.8rem;font-weight:100}vite-error-overlay::part(file),vite-error-overlay::part(frame),vite-error-overlay::part(stack),vite-error-overlay::part(tip){background:var(--box-background);border-left:5px solid transparent;border-radius:var(--box-border-radius);margin:var(--box-margin);min-height:50px;padding:var(--box-padding);position:relative}vite-error-overlay::part(file){border-left-color:#19b6f6;color:var(--color-bright)}vite-error-overlay::part(frame){border-left-color:var(--color-yellow);color:var(--color-yellow)}vite-error-overlay::part(stack){border-left-color:#ff5722}vite-error-overlay::part(tip){border-top:none;border-left-color:#ac7ff4}vite-error-overlay::part(file):before,vite-error-overlay::part(frame):before,vite-error-overlay::part(stack):before{border-bottom:1px solid #222;color:var(--color-bright);display:block;margin-bottom:15px;padding-bottom:5px;padding-left:30px;font-size:.8rem}vite-error-overlay::part(file):before{content:"File"}vite-error-overlay::part(frame):before{content:"Frame"}vite-error-overlay::part(stack):before{content:"Stack Trace"}vite-error-overlay::part(file):after,vite-error-overlay::part(frame):after,vite-error-overlay::part(stack):after{content:"";display:block;height:20px;position:absolute;left:var(--box-padding);top:var(--box-padding);width:20px}vite-error-overlay::part(file):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}vite-error-overlay::part(frame):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E")}vite-error-overlay::part(stack):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E")}vite-error-overlay::part(tip):before{content:"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.";display:block;margin-bottom:1em}`, Or = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
|
|
2553
2553
|
async function Lr(e, n, i, r) {
|
|
2554
|
-
const o = await i.dynamicImport("node:fs"),
|
|
2555
|
-
(
|
|
2556
|
-
).find((
|
|
2554
|
+
const o = await i.dynamicImport("node:fs"), g = await i.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
|
|
2555
|
+
(p) => r.join(n, `entry.preview.${p}`)
|
|
2556
|
+
).find((p) => o.existsSync(p));
|
|
2557
2557
|
if (!a)
|
|
2558
|
-
return
|
|
2558
|
+
return Ke(
|
|
2559
2559
|
e,
|
|
2560
2560
|
`Unable to find output "${n}/entry.preview" module.
|
|
2561
2561
|
|
|
2562
2562
|
Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
|
|
2563
2563
|
);
|
|
2564
2564
|
try {
|
|
2565
|
-
const
|
|
2565
|
+
const p = g.pathToFileURL(a).href, t = await i.strictDynamicImport(p);
|
|
2566
2566
|
let v = null, w = null;
|
|
2567
2567
|
if (t.default && (typeof t.default == "function" ? v = t.default : typeof t.default == "object" && (v = t.default.router, w = t.default.notFound)), typeof v != "function")
|
|
2568
|
-
return
|
|
2568
|
+
return Ke(
|
|
2569
2569
|
e,
|
|
2570
2570
|
`Entry preview module "${a}" does not export a default middleware function`
|
|
2571
2571
|
);
|
|
2572
2572
|
e.use(v), typeof w == "function" && e.use(w);
|
|
2573
|
-
} catch (
|
|
2574
|
-
return
|
|
2573
|
+
} catch (p) {
|
|
2574
|
+
return Ke(e, String(p));
|
|
2575
2575
|
}
|
|
2576
2576
|
}
|
|
2577
|
-
function
|
|
2577
|
+
function Ke(e, n) {
|
|
2578
2578
|
console.log(`
|
|
2579
2579
|
❌ ${n}
|
|
2580
2580
|
`), e.use((i, r) => {
|
|
@@ -2616,19 +2616,19 @@ const jr = (e, n) => {
|
|
|
2616
2616
|
}
|
|
2617
2617
|
return i;
|
|
2618
2618
|
}, Ur = [
|
|
2619
|
-
|
|
2619
|
+
Ue,
|
|
2620
|
+
Qe,
|
|
2620
2621
|
Je,
|
|
2621
|
-
|
|
2622
|
-
Fe,
|
|
2622
|
+
Be,
|
|
2623
2623
|
"@builder.io/qwik",
|
|
2624
2624
|
"@builder.io/qwik/jsx-runtime",
|
|
2625
2625
|
"@builder.io/qwik/jsx-dev-runtime"
|
|
2626
2626
|
], Br = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Ar = [".woff", ".woff2", ".ttf"];
|
|
2627
2627
|
function Hr(e = {}) {
|
|
2628
|
-
let n = "serve", i = null, r = null, o = "/",
|
|
2628
|
+
let n = "serve", i = null, r = null, o = "/", g = null, d, a = null, p = null, t = null;
|
|
2629
2629
|
const v = e.client?.outDir;
|
|
2630
2630
|
let w = null;
|
|
2631
|
-
const x = e.fileFilter ? (u, b) =>
|
|
2631
|
+
const x = e.fileFilter ? (u, b) => Dt.test(u) || e.fileFilter(u, b) : () => !0, _ = e.disableFontPreload ?? !1, s = [], l = Pt(e.optimizerOptions), h = /* @__PURE__ */ new Set();
|
|
2632
2632
|
return [{
|
|
2633
2633
|
name: "vite-plugin-qwik",
|
|
2634
2634
|
enforce: "pre",
|
|
@@ -2638,23 +2638,22 @@ function Hr(e = {}) {
|
|
|
2638
2638
|
getManifest: () => i,
|
|
2639
2639
|
getRootDir: () => l.getOptions().rootDir,
|
|
2640
2640
|
getClientOutDir: () => r,
|
|
2641
|
-
getClientPublicOutDir: () =>
|
|
2641
|
+
getClientPublicOutDir: () => g,
|
|
2642
2642
|
getAssetsDir: () => d,
|
|
2643
|
-
registerBundleGraphAdder: (u) =>
|
|
2643
|
+
registerBundleGraphAdder: (u) => h.add(u),
|
|
2644
2644
|
_oldDevSsrServer: () => e.devSsrServer
|
|
2645
2645
|
},
|
|
2646
2646
|
async config(u, b) {
|
|
2647
2647
|
await l.init();
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
u.build?.ssr || b.mode === "ssr" ? S = "ssr" : b.mode === "lib" ? S = "lib" : b.mode === "test" ? S = "test" : S = "client", n = b.command;
|
|
2648
|
+
let f;
|
|
2649
|
+
u.build?.ssr || b.mode === "ssr" ? f = "ssr" : b.mode === "lib" ? f = "lib" : b.mode === "test" ? f = "test" : f = "client", n = b.command;
|
|
2651
2650
|
let I;
|
|
2652
|
-
b.mode === "production" ? I = "production" : b.mode === "development" ? I = "development" : n === "build" &&
|
|
2653
|
-
const
|
|
2654
|
-
let
|
|
2655
|
-
|
|
2656
|
-
const
|
|
2657
|
-
target:
|
|
2651
|
+
b.mode === "production" ? I = "production" : b.mode === "development" ? I = "development" : n === "build" && f === "client" ? I = "production" : I = "development", l.debug(`vite config(), command: ${n}, env.mode: ${b.mode}`), n === "serve" ? e.entryStrategy = { type: "segment" } : f === "ssr" ? e.entryStrategy = { type: "hoist" } : f === "lib" && (e.entryStrategy = { type: "inline" });
|
|
2652
|
+
const S = f === "ssr" ? typeof u.build?.ssr == "string" ? u.build.ssr : e.ssr?.input : void 0, q = f === "client" ? e.client?.input : void 0;
|
|
2653
|
+
let D = u.build?.rollupOptions?.input || q || S;
|
|
2654
|
+
D && typeof D == "string" && (D = [D]), d = u.build?.assetsDir;
|
|
2655
|
+
const P = f === "client" && !!d && d !== "_astro", $ = {
|
|
2656
|
+
target: f,
|
|
2658
2657
|
buildMode: I,
|
|
2659
2658
|
csr: e.csr,
|
|
2660
2659
|
debug: e.debug,
|
|
@@ -2669,25 +2668,25 @@ function Hr(e = {}) {
|
|
|
2669
2668
|
clientOutDir: v || // When ssr is true, this is probably an adapter build and not where the client build is
|
|
2670
2669
|
// However, if client.outDir was explicitly set, always use it
|
|
2671
2670
|
(u.build?.ssr && !v ? void 0 : u.build?.outDir),
|
|
2672
|
-
assetsDir:
|
|
2671
|
+
assetsDir: P ? d : void 0,
|
|
2673
2672
|
devTools: e.devTools,
|
|
2674
2673
|
sourcemap: !!u.build?.sourcemap,
|
|
2675
2674
|
lint: e.lint,
|
|
2676
2675
|
experimental: e.experimental,
|
|
2677
|
-
input:
|
|
2676
|
+
input: D,
|
|
2678
2677
|
manifestInput: e.ssr?.manifestInput,
|
|
2679
2678
|
manifestInputPath: e.ssr?.manifestInputPath,
|
|
2680
2679
|
manifestOutput: e.client?.manifestOutput
|
|
2681
|
-
}, A = await l.normalizeOptions(
|
|
2682
|
-
|
|
2683
|
-
const
|
|
2680
|
+
}, A = await l.normalizeOptions($);
|
|
2681
|
+
D || (D = A.input), w = $, i = A.manifestInput, a = A.srcDir, p = A.rootDir, e.csr || (r = A.clientOutDir, g = r, t = A.ssrOutDir);
|
|
2682
|
+
const G = I === "development", X = "globalThis.qDev", Q = "globalThis.qTest", ee = "globalThis.qInspector", Y = "globalThis.qSerialize", O = u?.define?.[X] ?? G, ie = u?.define?.[ee] ?? G, Re = u?.define?.[Y] ?? G, F = {
|
|
2684
2683
|
ssr: {
|
|
2685
|
-
noExternal: [
|
|
2684
|
+
noExternal: [Ue, Be, ze, ne]
|
|
2686
2685
|
},
|
|
2687
2686
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
2688
2687
|
resolve: {
|
|
2689
2688
|
dedupe: [...Ur],
|
|
2690
|
-
conditions: I === "production" &&
|
|
2689
|
+
conditions: I === "production" && f === "client" ? ["min"] : [],
|
|
2691
2690
|
alias: {
|
|
2692
2691
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
2693
2692
|
"@builder.io/qwik/build": "@qwik.dev/core/build",
|
|
@@ -2710,17 +2709,17 @@ function Hr(e = {}) {
|
|
|
2710
2709
|
exclude: [
|
|
2711
2710
|
// using optimized deps for qwik libraries will lead to duplicate imports
|
|
2712
2711
|
// this breaks Qwik because it relies a lot on module scoped symbols
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2712
|
+
Ue,
|
|
2713
|
+
Be,
|
|
2714
|
+
ze,
|
|
2715
|
+
Qe,
|
|
2716
2716
|
Je,
|
|
2717
|
-
Ye,
|
|
2718
2717
|
ne,
|
|
2719
2718
|
re,
|
|
2720
2719
|
"@builder.io/qwik"
|
|
2721
2720
|
],
|
|
2722
2721
|
// Enforce scanning our input even when overridden later
|
|
2723
|
-
entries:
|
|
2722
|
+
entries: D && (typeof D == "string" ? [D] : typeof D == "object" ? Object.values(D) : D)
|
|
2724
2723
|
},
|
|
2725
2724
|
build: {
|
|
2726
2725
|
modulePreload: !1,
|
|
@@ -2736,47 +2735,47 @@ function Hr(e = {}) {
|
|
|
2736
2735
|
*/
|
|
2737
2736
|
maxParallelFileOps: 1,
|
|
2738
2737
|
// This will amend the existing input
|
|
2739
|
-
input:
|
|
2738
|
+
input: D
|
|
2740
2739
|
// temporary fix for rolldown-vite types
|
|
2741
2740
|
}
|
|
2742
2741
|
},
|
|
2743
2742
|
define: {
|
|
2744
|
-
[
|
|
2745
|
-
[
|
|
2746
|
-
[
|
|
2747
|
-
[
|
|
2743
|
+
[X]: O,
|
|
2744
|
+
[ee]: ie,
|
|
2745
|
+
[Y]: Re,
|
|
2746
|
+
[Q]: JSON.stringify(process.env.NODE_ENV === "test")
|
|
2748
2747
|
}
|
|
2749
2748
|
};
|
|
2750
2749
|
if (!e.csr) {
|
|
2751
|
-
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2754
|
-
...
|
|
2750
|
+
F.build.cssCodeSplit = !1, A.outDir && (F.build.outDir = A.outDir);
|
|
2751
|
+
const ue = F.build.rollupOptions?.onwarn;
|
|
2752
|
+
F.build.rollupOptions = {
|
|
2753
|
+
...F.build.rollupOptions,
|
|
2755
2754
|
output: await xn(
|
|
2756
2755
|
l,
|
|
2757
2756
|
u.build?.rollupOptions?.output,
|
|
2758
|
-
|
|
2757
|
+
P,
|
|
2759
2758
|
A.outDir
|
|
2760
2759
|
),
|
|
2761
2760
|
preserveEntrySignatures: "exports-only",
|
|
2762
|
-
onwarn: (
|
|
2763
|
-
|
|
2761
|
+
onwarn: (le, Ne) => {
|
|
2762
|
+
le.plugin === "typescript" && le.message.includes("outputToFilesystem") || (ue ? ue(le, Ne) : Ne(le));
|
|
2764
2763
|
}
|
|
2765
|
-
}, A.target === "ssr" ? n === "build" && (
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2764
|
+
}, A.target === "ssr" ? n === "build" && (F.publicDir = !1, F.build.ssr = !0, u.build?.minify == null && I === "production" && (F.build.minify = !0)) : A.target === "client" || (A.target === "lib" ? (F.build.minify = !1, F.build.rollupOptions.external = [
|
|
2765
|
+
Ue,
|
|
2766
|
+
Be,
|
|
2767
|
+
ze,
|
|
2768
|
+
Qe,
|
|
2769
2769
|
Je,
|
|
2770
|
-
Ye,
|
|
2771
2770
|
ne,
|
|
2772
2771
|
re
|
|
2773
|
-
]) :
|
|
2774
|
-
[
|
|
2775
|
-
[
|
|
2776
|
-
[
|
|
2777
|
-
}), globalThis.qDev =
|
|
2772
|
+
]) : F.define = {
|
|
2773
|
+
[X]: !0,
|
|
2774
|
+
[Q]: !0,
|
|
2775
|
+
[ee]: !1
|
|
2776
|
+
}), globalThis.qDev = O, globalThis.qTest = !0, globalThis.qInspector = ie;
|
|
2778
2777
|
}
|
|
2779
|
-
return
|
|
2778
|
+
return F;
|
|
2780
2779
|
},
|
|
2781
2780
|
async configResolved(u) {
|
|
2782
2781
|
if (o = u.base, !(o.startsWith("/") && o.endsWith("/")))
|
|
@@ -2786,26 +2785,26 @@ function Hr(e = {}) {
|
|
|
2786
2785
|
async buildStart() {
|
|
2787
2786
|
s.length = 0;
|
|
2788
2787
|
const u = this.resolve.bind(this);
|
|
2789
|
-
await l.validateSource(u), l.onDiagnostics((b,
|
|
2790
|
-
b.forEach((
|
|
2791
|
-
const
|
|
2792
|
-
|
|
2788
|
+
await l.validateSource(u), l.onDiagnostics((b, f, I) => {
|
|
2789
|
+
b.forEach((S) => {
|
|
2790
|
+
const q = l.normalizePath(f.sys.path.join(I, S.file));
|
|
2791
|
+
S.category === "error" ? this.error(Ae(q, S)) : this.warn(Ae(q, S));
|
|
2793
2792
|
});
|
|
2794
2793
|
}), await l.buildStart(this);
|
|
2795
2794
|
},
|
|
2796
|
-
resolveId(u, b,
|
|
2797
|
-
const
|
|
2798
|
-
return
|
|
2795
|
+
resolveId(u, b, f) {
|
|
2796
|
+
const I = x(u, "resolveId");
|
|
2797
|
+
return Z(u) || !I ? null : l.resolveId(this, u, b, f);
|
|
2799
2798
|
},
|
|
2800
2799
|
load(u, b) {
|
|
2801
|
-
const
|
|
2802
|
-
return
|
|
2800
|
+
const f = x(u, "load");
|
|
2801
|
+
return Z(u) || !f ? null : (u = l.normalizePath(u), n === "serve" && u.endsWith(re) ? {
|
|
2803
2802
|
code: "export const manifest = undefined;"
|
|
2804
2803
|
} : l.load(this, u, b));
|
|
2805
2804
|
},
|
|
2806
|
-
transform(u, b,
|
|
2805
|
+
transform(u, b, f) {
|
|
2807
2806
|
if (b.includes(".vite/deps/") && u.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(u)) {
|
|
2808
|
-
const
|
|
2807
|
+
const q = p && b.startsWith(p) ? b.slice(p.length) : b;
|
|
2809
2808
|
throw new Error(
|
|
2810
2809
|
`
|
|
2811
2810
|
|
|
@@ -2814,15 +2813,15 @@ function Hr(e = {}) {
|
|
|
2814
2813
|
⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
|
|
2815
2814
|
|
|
2816
2815
|
👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
|
|
2817
|
-
👉 ${
|
|
2816
|
+
👉 ${q}
|
|
2818
2817
|
|
|
2819
2818
|
==============
|
|
2820
2819
|
|
|
2821
2820
|
`
|
|
2822
2821
|
);
|
|
2823
2822
|
}
|
|
2824
|
-
const
|
|
2825
|
-
return
|
|
2823
|
+
const I = x(b, "transform"), S = b.includes("?raw");
|
|
2824
|
+
return Z(b) || !I || S ? null : l.transform(this, u, b, f);
|
|
2826
2825
|
}
|
|
2827
2826
|
}, {
|
|
2828
2827
|
name: "vite-plugin-qwik-post",
|
|
@@ -2830,43 +2829,43 @@ function Hr(e = {}) {
|
|
|
2830
2829
|
generateBundle: {
|
|
2831
2830
|
order: "post",
|
|
2832
2831
|
async handler(u, b) {
|
|
2833
|
-
const
|
|
2834
|
-
if (
|
|
2835
|
-
for (const [
|
|
2836
|
-
if (
|
|
2837
|
-
const
|
|
2838
|
-
if (Br.some((
|
|
2839
|
-
typeof
|
|
2832
|
+
const f = l.getOptions();
|
|
2833
|
+
if (f.target === "client") {
|
|
2834
|
+
for (const [I, S] of Object.entries(b))
|
|
2835
|
+
if (S.type === "asset") {
|
|
2836
|
+
const q = o + I;
|
|
2837
|
+
if (Br.some((D) => I.endsWith(D)))
|
|
2838
|
+
typeof S.source == "string" && S.source.length < f.inlineStylesUpToBytes ? s.push({
|
|
2840
2839
|
tag: "style",
|
|
2841
2840
|
location: "head",
|
|
2842
2841
|
attributes: {
|
|
2843
|
-
"data-src":
|
|
2844
|
-
dangerouslySetInnerHTML:
|
|
2842
|
+
"data-src": q,
|
|
2843
|
+
dangerouslySetInnerHTML: S.source
|
|
2845
2844
|
}
|
|
2846
2845
|
}) : s.push({
|
|
2847
2846
|
tag: "link",
|
|
2848
2847
|
location: "head",
|
|
2849
2848
|
attributes: {
|
|
2850
2849
|
rel: "stylesheet",
|
|
2851
|
-
href:
|
|
2850
|
+
href: q
|
|
2852
2851
|
}
|
|
2853
2852
|
});
|
|
2854
2853
|
else {
|
|
2855
|
-
const
|
|
2856
|
-
|
|
2854
|
+
const D = Ar.find((P) => I.endsWith(P));
|
|
2855
|
+
D && !_ && s.unshift({
|
|
2857
2856
|
tag: "link",
|
|
2858
2857
|
location: "head",
|
|
2859
2858
|
attributes: {
|
|
2860
2859
|
rel: "preload",
|
|
2861
|
-
href:
|
|
2860
|
+
href: q,
|
|
2862
2861
|
as: "font",
|
|
2863
|
-
type: `font/${
|
|
2862
|
+
type: `font/${D.slice(1)}`,
|
|
2864
2863
|
crossorigin: ""
|
|
2865
2864
|
}
|
|
2866
2865
|
});
|
|
2867
2866
|
}
|
|
2868
2867
|
}
|
|
2869
|
-
await l.generateManifest(this, b,
|
|
2868
|
+
await l.generateManifest(this, b, h, {
|
|
2870
2869
|
injections: s,
|
|
2871
2870
|
platform: { vite: "" }
|
|
2872
2871
|
});
|
|
@@ -2874,28 +2873,28 @@ function Hr(e = {}) {
|
|
|
2874
2873
|
}
|
|
2875
2874
|
},
|
|
2876
2875
|
async writeBundle(u, b) {
|
|
2877
|
-
const
|
|
2878
|
-
if (
|
|
2879
|
-
const
|
|
2880
|
-
if (
|
|
2881
|
-
const
|
|
2876
|
+
const f = l.getOptions();
|
|
2877
|
+
if (f.target === "ssr") {
|
|
2878
|
+
const I = l.getSys();
|
|
2879
|
+
if (I.env === "node" || I.env === "bun") {
|
|
2880
|
+
const S = Object.keys(b), q = async (D) => {
|
|
2882
2881
|
try {
|
|
2883
|
-
const
|
|
2884
|
-
if ((
|
|
2885
|
-
const
|
|
2886
|
-
if (!
|
|
2887
|
-
const
|
|
2888
|
-
await
|
|
2889
|
-
|
|
2890
|
-
`export * from "./${
|
|
2882
|
+
const P = I.path.basename(D), $ = I.path.extname(P);
|
|
2883
|
+
if ((P.startsWith("entry.") || P.startsWith("entry_")) && !P.includes("preview") && ($ === ".mjs" || $ === ".cjs")) {
|
|
2884
|
+
const G = I.path.basename(P, $), X = `${G}.js`, Q = G + $;
|
|
2885
|
+
if (!S.some((Y) => I.path.basename(Y) === X)) {
|
|
2886
|
+
const Y = I.path.dirname(D), O = await I.dynamicImport("node:fs"), ie = I.path.join(f.outDir, Y);
|
|
2887
|
+
await O.promises.mkdir(ie, { recursive: !0 }), await O.promises.writeFile(
|
|
2888
|
+
I.path.join(ie, X),
|
|
2889
|
+
`export * from "./${Q}";`
|
|
2891
2890
|
);
|
|
2892
2891
|
}
|
|
2893
2892
|
}
|
|
2894
|
-
} catch (
|
|
2895
|
-
console.error("patchModuleFormat",
|
|
2893
|
+
} catch (P) {
|
|
2894
|
+
console.error("patchModuleFormat", P);
|
|
2896
2895
|
}
|
|
2897
2896
|
};
|
|
2898
|
-
await Promise.all(
|
|
2897
|
+
await Promise.all(S.map(q));
|
|
2899
2898
|
}
|
|
2900
2899
|
}
|
|
2901
2900
|
},
|
|
@@ -2904,12 +2903,12 @@ function Hr(e = {}) {
|
|
|
2904
2903
|
return jr(l.getOptions(), o);
|
|
2905
2904
|
},
|
|
2906
2905
|
configureServer(u) {
|
|
2907
|
-
l.configureServer(u), (e?.devTools?.imageDevTools ?? !0) && u.middlewares.use(kr(l.getSys(),
|
|
2906
|
+
l.configureServer(u), (e?.devTools?.imageDevTools ?? !0) && u.middlewares.use(kr(l.getSys(), p, a));
|
|
2908
2907
|
},
|
|
2909
2908
|
configurePreviewServer(u) {
|
|
2910
2909
|
return async () => {
|
|
2911
|
-
const b = l.getSys(),
|
|
2912
|
-
await Lr(u.middlewares, t, b,
|
|
2910
|
+
const b = l.getSys(), f = l.getPath();
|
|
2911
|
+
await Lr(u.middlewares, t, b, f);
|
|
2913
2912
|
};
|
|
2914
2913
|
},
|
|
2915
2914
|
handleHotUpdate(u) {
|
|
@@ -2919,19 +2918,19 @@ function Hr(e = {}) {
|
|
|
2919
2918
|
},
|
|
2920
2919
|
onLog(u, b) {
|
|
2921
2920
|
if (b.plugin == "vite-plugin-qwik") {
|
|
2922
|
-
const
|
|
2921
|
+
const f = Rr[u] || oe.White, I = (b.frame || "").split(`
|
|
2923
2922
|
`).map(
|
|
2924
|
-
(
|
|
2923
|
+
(S) => (S.match(/^\s*\^\s*$/) ? oe.BrightWhite : oe.BrightBlack) + S
|
|
2925
2924
|
);
|
|
2926
2925
|
return console[u](
|
|
2927
|
-
`${
|
|
2926
|
+
`${f}%s
|
|
2928
2927
|
${oe.BrightWhite}%s
|
|
2929
2928
|
%s${oe.RESET}`,
|
|
2930
2929
|
`[${b.plugin}](${u}): ${b.message}
|
|
2931
2930
|
`,
|
|
2932
2931
|
` ${b?.loc?.file}:${b?.loc?.line}:${b?.loc?.column}
|
|
2933
2932
|
`,
|
|
2934
|
-
` ${
|
|
2933
|
+
` ${I.join(`
|
|
2935
2934
|
`)}
|
|
2936
2935
|
`
|
|
2937
2936
|
), !1;
|
|
@@ -2948,22 +2947,22 @@ async function Fr() {
|
|
|
2948
2947
|
}
|
|
2949
2948
|
const i = /* @__PURE__ */ new Set();
|
|
2950
2949
|
let r;
|
|
2951
|
-
const o = "@qwik-dev/core",
|
|
2952
|
-
async function d(a,
|
|
2953
|
-
for (;
|
|
2954
|
-
const t = n.join(
|
|
2950
|
+
const o = "@qwik-dev/core", g = "@builder.io/qwik";
|
|
2951
|
+
async function d(a, p) {
|
|
2952
|
+
for (; p; ) {
|
|
2953
|
+
const t = n.join(p, "node_modules", a, "package.json");
|
|
2955
2954
|
try {
|
|
2956
2955
|
await e.access(t);
|
|
2957
2956
|
const w = await e.readFile(t, {
|
|
2958
2957
|
encoding: "utf-8"
|
|
2959
2958
|
}), x = JSON.parse(w);
|
|
2960
|
-
return !!(x.qwik || x.dependencies?.[o] || x.peerDependencies?.[o] || x.dependencies?.[
|
|
2959
|
+
return !!(x.qwik || x.dependencies?.[o] || x.peerDependencies?.[o] || x.dependencies?.[g] || x.peerDependencies?.[g]);
|
|
2961
2960
|
} catch {
|
|
2962
2961
|
}
|
|
2963
|
-
const v = n.dirname(
|
|
2964
|
-
if (v ===
|
|
2962
|
+
const v = n.dirname(p);
|
|
2963
|
+
if (v === p)
|
|
2965
2964
|
break;
|
|
2966
|
-
|
|
2965
|
+
p = v;
|
|
2967
2966
|
}
|
|
2968
2967
|
return !1;
|
|
2969
2968
|
}
|
|
@@ -2977,16 +2976,16 @@ async function Fr() {
|
|
|
2977
2976
|
config: {
|
|
2978
2977
|
order: "post",
|
|
2979
2978
|
async handler(a) {
|
|
2980
|
-
const
|
|
2979
|
+
const p = [], t = [a.ssr?.noExternal, a.environments?.ssr?.resolve?.noExternal].flat().filter((w) => typeof w == "string"), v = a.optimizeDeps?.exclude ?? [];
|
|
2981
2980
|
for (const w of t)
|
|
2982
|
-
v.includes(w) || await d(w, a.root || process.cwd()) &&
|
|
2983
|
-
return { optimizeDeps: { exclude:
|
|
2981
|
+
v.includes(w) || await d(w, a.root || process.cwd()) && p.push(w);
|
|
2982
|
+
return { optimizeDeps: { exclude: p } };
|
|
2984
2983
|
}
|
|
2985
2984
|
},
|
|
2986
2985
|
// We check all SSR build lookups for external Qwik deps
|
|
2987
2986
|
resolveId: {
|
|
2988
2987
|
order: "pre",
|
|
2989
|
-
async handler(a,
|
|
2988
|
+
async handler(a, p, t) {
|
|
2990
2989
|
if (!t.ssr || /^([./]|node:|[^a-z@])/i.test(a) || i.has(a))
|
|
2991
2990
|
return;
|
|
2992
2991
|
const v = (a.startsWith("@") ? a.split("/").slice(0, 2).join("/") : a.split("/")[0]).split("?")[0];
|
|
@@ -2995,11 +2994,11 @@ async function Fr() {
|
|
|
2995
2994
|
i.add(a), i.add(v);
|
|
2996
2995
|
let w;
|
|
2997
2996
|
try {
|
|
2998
|
-
w = await this.resolve(v,
|
|
2997
|
+
w = await this.resolve(v, p, { ...t, skipSelf: !0 });
|
|
2999
2998
|
} catch {
|
|
3000
2999
|
return;
|
|
3001
3000
|
}
|
|
3002
|
-
if (w?.external && await d(v,
|
|
3001
|
+
if (w?.external && await d(v, p ? n.dirname(p) : r))
|
|
3003
3002
|
throw new Error(
|
|
3004
3003
|
`
|
|
3005
3004
|
==============
|