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