@qwik.dev/core 2.0.0-beta.37 → 2.0.0-beta.39
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 +14 -5
- package/dist/core-internal.d.ts +397 -323
- package/dist/core.min.mjs +9 -8
- package/dist/core.mjs +1886 -1161
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4646 -4048
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +5 -3
- package/dist/optimizer.mjs +1676 -1722
- package/dist/preloader.mjs +1 -1
- package/dist/qwikloader.debug.js +1 -1
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +7 -0
- package/dist/server.mjs +75 -34
- package/dist/server.prod.mjs +392 -345
- package/dist/starters/adapters/bun/src/entry.bun.ts +35 -0
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +20 -0
- package/dist/starters/adapters/deno/src/entry.deno.ts +41 -0
- package/dist/starters/adapters/express/src/entry.express.tsx +20 -0
- package/dist/starters/adapters/fastify/package.json +2 -2
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +20 -0
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +10 -1
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +20 -0
- package/dist/starters/features/csr/package.json +1 -1
- package/dist/starters/features/drizzle/package.json +1 -1
- package/dist/starters/features/vitest/package.json +1 -1
- package/dist/testing/index.d.ts +40 -31
- package/dist/testing/index.mjs +1568 -942
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/dist/worker/worker.shared.js +1 -1
- package/handlers.mjs +3 -0
- package/package.json +7 -7
- package/public.d.ts +3 -0
package/dist/optimizer.mjs
CHANGED
|
@@ -1,10 +1,166 @@
|
|
|
1
|
-
const
|
|
1
|
+
const On = (t, e = 0) => {
|
|
2
2
|
for (let n = 0; n < t.length; n++) {
|
|
3
3
|
const r = t.charCodeAt(n);
|
|
4
4
|
e = (e << 5) - e + r, e |= 0;
|
|
5
5
|
}
|
|
6
6
|
return Number(Math.abs(e)).toString(36);
|
|
7
|
-
}
|
|
7
|
+
};
|
|
8
|
+
const Pn = 13020833333333334e-21, Rn = (t) => {
|
|
9
|
+
const e = t.lastIndexOf("_");
|
|
10
|
+
return e > -1 ? t.slice(e + 1) : t;
|
|
11
|
+
};
|
|
12
|
+
function Ln(t, e) {
|
|
13
|
+
const n = [];
|
|
14
|
+
if (!t.bundles)
|
|
15
|
+
return [];
|
|
16
|
+
const r = { ...t.bundles };
|
|
17
|
+
for (const [c, u] of Object.entries(t.mapping)) {
|
|
18
|
+
if (c.startsWith("_") && c.length < 10)
|
|
19
|
+
continue;
|
|
20
|
+
const o = Rn(c);
|
|
21
|
+
o && (r[o] = { dynamicImports: [u] });
|
|
22
|
+
}
|
|
23
|
+
if (e) {
|
|
24
|
+
const c = { ...t, bundles: r };
|
|
25
|
+
for (const u of e) {
|
|
26
|
+
const o = u(c);
|
|
27
|
+
o && Object.assign(r, o);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
for (const c of Object.keys(r)) {
|
|
31
|
+
const u = r[c], o = u.imports?.filter((b) => r[b]) || [], w = u.dynamicImports?.filter(
|
|
32
|
+
// we only want to include dynamic imports that belong to the app
|
|
33
|
+
// e.g. not all languages supported by shiki
|
|
34
|
+
(b) => r[b] && // either there are qrls
|
|
35
|
+
(r[b].symbols || // or it's a dynamic import from the app source
|
|
36
|
+
r[b].origins?.some((f) => !f.includes("node_modules")))
|
|
37
|
+
) || [];
|
|
38
|
+
r[c] = {
|
|
39
|
+
...u,
|
|
40
|
+
imports: o,
|
|
41
|
+
dynamicImports: w
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const i = new Set(Object.keys(r));
|
|
45
|
+
for (const c of Object.keys(r)) {
|
|
46
|
+
for (const u of r[c].imports)
|
|
47
|
+
i.delete(u);
|
|
48
|
+
for (const u of r[c].dynamicImports)
|
|
49
|
+
i.delete(u);
|
|
50
|
+
}
|
|
51
|
+
for (const c of i) {
|
|
52
|
+
const u = r[c];
|
|
53
|
+
!u.imports?.length && !u.dynamicImports?.length && delete r[c];
|
|
54
|
+
}
|
|
55
|
+
const s = Object.keys(r), l = /* @__PURE__ */ new Map(), a = Mn(r);
|
|
56
|
+
for (const c of s) {
|
|
57
|
+
const u = r[c], o = new Set(u.imports);
|
|
58
|
+
a(o, c);
|
|
59
|
+
const w = new Set(u.dynamicImports);
|
|
60
|
+
a(w, c);
|
|
61
|
+
const b = /* @__PURE__ */ new Map();
|
|
62
|
+
for (const v of w) {
|
|
63
|
+
const x = r[v];
|
|
64
|
+
let C = 0.5;
|
|
65
|
+
if (C += (x.interactivity || 0) * 0.08, u.origins && x.origins) {
|
|
66
|
+
for (const T of u.origins)
|
|
67
|
+
if (x.origins.some((W) => W.startsWith(T))) {
|
|
68
|
+
C += 0.25;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
x.total > Pn && (C += C > 0.5 ? 0.02 : -0.02), x.total < 1e3 && (C += 0.15), b.set(v, Math.min(C, 0.99));
|
|
73
|
+
}
|
|
74
|
+
if (w.size > 0) {
|
|
75
|
+
const v = Array.from(w).sort(
|
|
76
|
+
(C, T) => b.get(T) - b.get(C)
|
|
77
|
+
);
|
|
78
|
+
let x = -1;
|
|
79
|
+
for (const C of v)
|
|
80
|
+
b.get(C) !== x && (x = b.get(C), o.add(-Math.round(x * 10))), o.add(C);
|
|
81
|
+
}
|
|
82
|
+
const f = n.length;
|
|
83
|
+
n.push(c);
|
|
84
|
+
for (let v = 0; v < o.size; v++)
|
|
85
|
+
n.push(null);
|
|
86
|
+
l.set(c, { index: f, deps: o });
|
|
87
|
+
}
|
|
88
|
+
for (const c of s) {
|
|
89
|
+
const u = l.get(c);
|
|
90
|
+
let { index: o, deps: w } = u;
|
|
91
|
+
o++;
|
|
92
|
+
for (const b of w) {
|
|
93
|
+
if (typeof b == "number") {
|
|
94
|
+
n[o++] = b;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const v = l.get(b).index;
|
|
98
|
+
n[o++] = v;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return n;
|
|
102
|
+
}
|
|
103
|
+
function Mn(t) {
|
|
104
|
+
const { componentOf: e, successors: n } = rn(t), r = new Array(n.length), i = (s) => {
|
|
105
|
+
const l = r[s];
|
|
106
|
+
if (l)
|
|
107
|
+
return l;
|
|
108
|
+
const a = /* @__PURE__ */ new Set();
|
|
109
|
+
r[s] = a;
|
|
110
|
+
for (const c of n[s]) {
|
|
111
|
+
a.add(c);
|
|
112
|
+
for (const u of i(c))
|
|
113
|
+
a.add(u);
|
|
114
|
+
}
|
|
115
|
+
return a;
|
|
116
|
+
};
|
|
117
|
+
return (s, l) => {
|
|
118
|
+
const a = e.get(l), c = /* @__PURE__ */ new Set();
|
|
119
|
+
for (const u of s) {
|
|
120
|
+
const o = e.get(u);
|
|
121
|
+
o !== a && c.add(o);
|
|
122
|
+
}
|
|
123
|
+
for (const u of [...s]) {
|
|
124
|
+
const o = e.get(u);
|
|
125
|
+
if (o !== a) {
|
|
126
|
+
for (const w of c)
|
|
127
|
+
if (w !== o && i(w).has(o)) {
|
|
128
|
+
s.delete(u);
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function rn(t) {
|
|
136
|
+
const e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [], l = [];
|
|
137
|
+
let a = 0;
|
|
138
|
+
const c = (o) => {
|
|
139
|
+
n.set(o, a), r.set(o, a), a++, s.push(o), i.add(o);
|
|
140
|
+
for (const w of t[o].imports || [])
|
|
141
|
+
t[w] && (n.has(w) ? i.has(w) && r.set(o, Math.min(r.get(o), n.get(w))) : (c(w), r.set(o, Math.min(r.get(o), r.get(w)))));
|
|
142
|
+
if (r.get(o) === n.get(o)) {
|
|
143
|
+
const w = [];
|
|
144
|
+
let b;
|
|
145
|
+
do
|
|
146
|
+
b = s.pop(), i.delete(b), e.set(b, l.length), w.push(b);
|
|
147
|
+
while (b !== o);
|
|
148
|
+
l.push(w);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
for (const o of Object.keys(t))
|
|
152
|
+
n.has(o) || c(o);
|
|
153
|
+
const u = Array.from({ length: l.length }, () => /* @__PURE__ */ new Set());
|
|
154
|
+
for (const o of Object.keys(t)) {
|
|
155
|
+
const w = e.get(o);
|
|
156
|
+
for (const b of t[o].imports || []) {
|
|
157
|
+
const f = e.get(b);
|
|
158
|
+
f !== void 0 && f !== w && u[w].add(f);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return { componentOf: e, components: l, successors: u };
|
|
162
|
+
}
|
|
163
|
+
const jn = /* @__PURE__ */ new Set([
|
|
8
164
|
"_chk",
|
|
9
165
|
"_rsc",
|
|
10
166
|
"_res",
|
|
@@ -14,6 +170,9 @@ const En = (t, e = 0) => {
|
|
|
14
170
|
// Each
|
|
15
171
|
"_eaC",
|
|
16
172
|
"_eaT",
|
|
173
|
+
// Show
|
|
174
|
+
"_shC",
|
|
175
|
+
"_shT",
|
|
17
176
|
// Suspense
|
|
18
177
|
"_suC",
|
|
19
178
|
"_suT",
|
|
@@ -22,7 +181,7 @@ const En = (t, e = 0) => {
|
|
|
22
181
|
"_reC",
|
|
23
182
|
"_reT"
|
|
24
183
|
]);
|
|
25
|
-
function
|
|
184
|
+
function qn(t) {
|
|
26
185
|
const e = t.symbols;
|
|
27
186
|
return Object.keys(e).sort((n, r) => {
|
|
28
187
|
const i = e[n], s = e[r];
|
|
@@ -31,7 +190,7 @@ function In(t) {
|
|
|
31
190
|
if (i.ctxKind !== "eventHandler" && s.ctxKind === "eventHandler")
|
|
32
191
|
return 1;
|
|
33
192
|
if (i.ctxKind === "eventHandler" && s.ctxKind === "eventHandler") {
|
|
34
|
-
const l =
|
|
193
|
+
const l = St.indexOf(i.ctxName.toLowerCase()), a = St.indexOf(s.ctxName.toLowerCase());
|
|
35
194
|
if (l > -1 && a > -1) {
|
|
36
195
|
if (l < a)
|
|
37
196
|
return -1;
|
|
@@ -44,7 +203,7 @@ function In(t) {
|
|
|
44
203
|
return 1;
|
|
45
204
|
}
|
|
46
205
|
} else if (i.ctxKind === "function" && s.ctxKind === "function") {
|
|
47
|
-
const l =
|
|
206
|
+
const l = Et.indexOf(i.ctxName.toLowerCase()), a = Et.indexOf(s.ctxName.toLowerCase());
|
|
48
207
|
if (l > -1 && a > -1) {
|
|
49
208
|
if (l < a)
|
|
50
209
|
return -1;
|
|
@@ -60,7 +219,7 @@ function In(t) {
|
|
|
60
219
|
return !i.parent && s.parent ? -1 : i.parent && !s.parent ? 1 : i.hash < s.hash ? -1 : i.hash > s.hash ? 1 : 0;
|
|
61
220
|
});
|
|
62
221
|
}
|
|
63
|
-
const
|
|
222
|
+
const St = [
|
|
64
223
|
// Click Events
|
|
65
224
|
"click",
|
|
66
225
|
"dblclick",
|
|
@@ -116,36 +275,36 @@ const bt = [
|
|
|
116
275
|
"reset",
|
|
117
276
|
// Scroll Events
|
|
118
277
|
"scroll"
|
|
119
|
-
].map((t) => `on${t.toLowerCase()}$`),
|
|
278
|
+
].map((t) => `on${t.toLowerCase()}$`), Et = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
|
|
120
279
|
(t) => t.toLowerCase()
|
|
121
280
|
);
|
|
122
|
-
function
|
|
123
|
-
return Object.keys(t.bundles).sort(
|
|
281
|
+
function zn(t) {
|
|
282
|
+
return Object.keys(t.bundles).sort(ze);
|
|
124
283
|
}
|
|
125
|
-
function
|
|
126
|
-
const e =
|
|
284
|
+
function Fn(t) {
|
|
285
|
+
const e = qn(t), n = {}, r = {};
|
|
127
286
|
for (const l of e)
|
|
128
287
|
n[l] = t.symbols[l], r[l] = t.mapping[l];
|
|
129
|
-
const i =
|
|
288
|
+
const i = zn(t), s = {};
|
|
130
289
|
for (const l of i) {
|
|
131
290
|
s[l] = t.bundles[l];
|
|
132
291
|
const a = t.bundles[l];
|
|
133
|
-
Array.isArray(a.imports) && a.imports.sort(
|
|
292
|
+
Array.isArray(a.imports) && a.imports.sort(ze), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(ze);
|
|
134
293
|
const c = [];
|
|
135
294
|
for (const u of e)
|
|
136
295
|
l === r[u] && c.push(u);
|
|
137
|
-
c.length > 0 && (c.sort(
|
|
296
|
+
c.length > 0 && (c.sort(ze), a.symbols = c);
|
|
138
297
|
}
|
|
139
298
|
return t.symbols = n, t.mapping = r, t.bundles = s, t;
|
|
140
299
|
}
|
|
141
|
-
function
|
|
300
|
+
function ze(t, e) {
|
|
142
301
|
return t = t.toLocaleLowerCase(), e = e.toLocaleLowerCase(), t < e ? -1 : t > e ? 1 : 0;
|
|
143
302
|
}
|
|
144
|
-
function
|
|
303
|
+
function Ct(t) {
|
|
145
304
|
if (t != null && t.mapping != null && typeof t.mapping == "object" && t.symbols != null && typeof t.symbols == "object" && t.bundles != null && typeof t.bundles == "object")
|
|
146
305
|
return t;
|
|
147
306
|
}
|
|
148
|
-
const
|
|
307
|
+
const An = (t, e) => {
|
|
149
308
|
let n = 0;
|
|
150
309
|
if (t.symbols)
|
|
151
310
|
for (const r of t.symbols) {
|
|
@@ -155,70 +314,39 @@ const Tn = (t, e) => {
|
|
|
155
314
|
}
|
|
156
315
|
return n;
|
|
157
316
|
};
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
317
|
+
function Un(t) {
|
|
318
|
+
const { components: e, successors: n } = rn(t), r = /* @__PURE__ */ new Set(), i = [];
|
|
319
|
+
function s(a) {
|
|
320
|
+
r.add(a);
|
|
321
|
+
for (const c of n[a])
|
|
322
|
+
r.has(c) || s(c);
|
|
323
|
+
i.push(a);
|
|
324
|
+
}
|
|
325
|
+
for (let a = 0; a < e.length; a++)
|
|
326
|
+
r.has(a) || s(a);
|
|
327
|
+
i.reverse();
|
|
328
|
+
const l = new Array(e.length).fill(0);
|
|
329
|
+
for (let a = 0; a < e.length; a++) {
|
|
330
|
+
let c = 0;
|
|
331
|
+
for (const u of e[a])
|
|
332
|
+
c += t[u].size;
|
|
333
|
+
l[a] = c;
|
|
174
334
|
}
|
|
175
|
-
for (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const o = /* @__PURE__ */ new Set(), w = [];
|
|
191
|
-
function v(d) {
|
|
192
|
-
o.add(d);
|
|
193
|
-
for (const g of u[d])
|
|
194
|
-
o.has(g) || v(g);
|
|
195
|
-
w.push(d);
|
|
196
|
-
}
|
|
197
|
-
for (let d = 0; d < r.length; d++)
|
|
198
|
-
o.has(d) || v(d);
|
|
199
|
-
w.reverse();
|
|
200
|
-
const p = new Array(r.length).fill(0);
|
|
201
|
-
for (let d = 0; d < r.length; d++) {
|
|
202
|
-
let g = 0;
|
|
203
|
-
for (const f of r[d])
|
|
204
|
-
g += t[f].size;
|
|
205
|
-
p[d] = g;
|
|
206
|
-
}
|
|
207
|
-
for (let d = w.length - 1; d >= 0; d--) {
|
|
208
|
-
const g = w[d];
|
|
209
|
-
let f = p[g];
|
|
210
|
-
for (const m of u[g])
|
|
211
|
-
f += p[m];
|
|
212
|
-
p[g] = f;
|
|
213
|
-
}
|
|
214
|
-
for (let d = 0; d < r.length; d++) {
|
|
215
|
-
const g = p[d];
|
|
216
|
-
for (const f of r[d])
|
|
217
|
-
t[f].total = g;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
const Et = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, kt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, It = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
|
|
221
|
-
function Dn(t, e, n, r, i, s, l) {
|
|
335
|
+
for (let a = i.length - 1; a >= 0; a--) {
|
|
336
|
+
const c = i[a];
|
|
337
|
+
let u = l[c];
|
|
338
|
+
for (const o of n[c])
|
|
339
|
+
u += l[o];
|
|
340
|
+
l[c] = u;
|
|
341
|
+
}
|
|
342
|
+
for (let a = 0; a < e.length; a++) {
|
|
343
|
+
const c = l[a];
|
|
344
|
+
for (const u of e[a])
|
|
345
|
+
t[u].total = c;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const It = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, _t = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, Tt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
|
|
349
|
+
function Bn(t, e, n, r, i, s, l) {
|
|
222
350
|
const a = {
|
|
223
351
|
version: "1",
|
|
224
352
|
manifestHash: "",
|
|
@@ -238,182 +366,83 @@ function Dn(t, e, n, r, i, s, l) {
|
|
|
238
366
|
assets: {},
|
|
239
367
|
symbols: {},
|
|
240
368
|
bundleGraph: void 0
|
|
241
|
-
}, c = (
|
|
242
|
-
const
|
|
243
|
-
if (!
|
|
244
|
-
console.warn(`Client manifest generation: skipping external import "${
|
|
369
|
+
}, c = (f) => {
|
|
370
|
+
const v = r[f];
|
|
371
|
+
if (!v) {
|
|
372
|
+
console.warn(`Client manifest generation: skipping external import "${f}"`);
|
|
245
373
|
return;
|
|
246
374
|
}
|
|
247
|
-
return l(
|
|
375
|
+
return l(v.fileName);
|
|
248
376
|
};
|
|
249
377
|
let u, o, w;
|
|
250
|
-
for (const
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
const
|
|
255
|
-
for (const
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
name:
|
|
259
|
-
size:
|
|
378
|
+
for (const f of Object.values(r)) {
|
|
379
|
+
const v = c(f.fileName);
|
|
380
|
+
f.name === "core" && (u = v), f.name === "preloader" && (o = v), f.name === "handlers" && (w = v);
|
|
381
|
+
}
|
|
382
|
+
const b = new Set(e.map((f) => f.name));
|
|
383
|
+
for (const f of Object.values(r)) {
|
|
384
|
+
if (f.type === "asset") {
|
|
385
|
+
f.fileName.endsWith("js.map") || (a.assets[f.fileName] = {
|
|
386
|
+
name: f.names[0],
|
|
387
|
+
size: f.source.length
|
|
260
388
|
});
|
|
261
389
|
continue;
|
|
262
390
|
}
|
|
263
|
-
const
|
|
264
|
-
size:
|
|
391
|
+
const v = l(f.fileName), C = {
|
|
392
|
+
size: f.code.length,
|
|
265
393
|
total: -1
|
|
266
394
|
};
|
|
267
|
-
for (const
|
|
268
|
-
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
for (const
|
|
277
|
-
const
|
|
278
|
-
if (!
|
|
279
|
-
s(`Note: qrl ${
|
|
395
|
+
for (const g of f.exports)
|
|
396
|
+
b.has(g) && (!a.mapping[g] || f.exports.length !== 1) && (a.mapping[g] = v);
|
|
397
|
+
const T = f.imports.filter((g) => f.code.includes(t.basename(g))).map((g) => c(g)).filter((g) => g !== o && g !== u && g !== w).filter(Boolean);
|
|
398
|
+
T.length > 0 && (C.imports = T);
|
|
399
|
+
const W = f.dynamicImports.filter((g) => f.code.includes(t.basename(g))).map((g) => c(g)).filter(Boolean);
|
|
400
|
+
W.length > 0 && (C.dynamicImports = W), f.facadeModuleId && (It.test(f.facadeModuleId) ? a.preloader = v : _t.test(f.facadeModuleId) ? a.core = v : Tt.test(f.facadeModuleId) && (a.qwikLoader = v));
|
|
401
|
+
const h = (f.moduleIds || Object.keys(f.modules)).filter((g) => !g.startsWith("\0")).map((g) => t.relative(i.rootDir, g));
|
|
402
|
+
h.length > 0 && (C.origins = h, !a.preloader && h.some((g) => It.test(g)) && (a.preloader = v), !a.core && h.some((g) => _t.test(g)) && (a.core = v), !a.qwikLoader && h.some((g) => Tt.test(g)) && (a.qwikLoader = v)), a.bundles[v] = C;
|
|
403
|
+
}
|
|
404
|
+
for (const f of e) {
|
|
405
|
+
const v = f.name, x = a.mapping[v];
|
|
406
|
+
if (!x) {
|
|
407
|
+
s(`Note: qrl ${f.name} is not in the bundle, likely tree shaken`, a);
|
|
280
408
|
continue;
|
|
281
409
|
}
|
|
282
|
-
(a.bundles[
|
|
283
|
-
displayName:
|
|
284
|
-
hash:
|
|
285
|
-
ctxKind:
|
|
286
|
-
ctxName:
|
|
287
|
-
captures:
|
|
288
|
-
canonicalFilename:
|
|
289
|
-
parent:
|
|
290
|
-
origin:
|
|
291
|
-
loc:
|
|
292
|
-
paramNames:
|
|
293
|
-
captureNames:
|
|
410
|
+
(a.bundles[x].symbols ||= []).push(v), a.symbols[v] = {
|
|
411
|
+
displayName: f.displayName,
|
|
412
|
+
hash: f.hash,
|
|
413
|
+
ctxKind: f.ctxKind,
|
|
414
|
+
ctxName: f.ctxName,
|
|
415
|
+
captures: f.captures,
|
|
416
|
+
canonicalFilename: f.canonicalFilename,
|
|
417
|
+
parent: f.parent,
|
|
418
|
+
origin: f.origin,
|
|
419
|
+
loc: f.loc,
|
|
420
|
+
paramNames: f.paramNames,
|
|
421
|
+
captureNames: f.captureNames
|
|
294
422
|
};
|
|
295
423
|
}
|
|
296
424
|
if (w)
|
|
297
|
-
for (const
|
|
298
|
-
a.symbols[
|
|
425
|
+
for (const f of jn)
|
|
426
|
+
a.symbols[f] = {
|
|
299
427
|
origin: "Qwik core",
|
|
300
|
-
displayName:
|
|
428
|
+
displayName: f,
|
|
301
429
|
canonicalFilename: "",
|
|
302
|
-
hash:
|
|
430
|
+
hash: f,
|
|
303
431
|
ctxKind: "function",
|
|
304
|
-
ctxName:
|
|
432
|
+
ctxName: f,
|
|
305
433
|
captures: !1,
|
|
306
434
|
parent: null,
|
|
307
435
|
loc: [0, 0]
|
|
308
|
-
}, a.mapping[
|
|
436
|
+
}, a.mapping[f] = w;
|
|
309
437
|
else
|
|
310
438
|
console.error("Qwik core bundle not found, is Qwik actually used in this project?");
|
|
311
|
-
for (const
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
return Pn(a.bundles), Cn(a);
|
|
316
|
-
}
|
|
317
|
-
const Nn = 300, Rn = 0.5 / (Nn * 1024 / 8), Ln = (t) => {
|
|
318
|
-
const e = t.lastIndexOf("_");
|
|
319
|
-
return e > -1 ? t.slice(e + 1) : t;
|
|
320
|
-
};
|
|
321
|
-
function On(t, e) {
|
|
322
|
-
const n = [];
|
|
323
|
-
if (!t.bundles)
|
|
324
|
-
return [];
|
|
325
|
-
const r = { ...t.bundles };
|
|
326
|
-
for (const [c, u] of Object.entries(t.mapping)) {
|
|
327
|
-
if (c.startsWith("_") && c.length < 10)
|
|
328
|
-
continue;
|
|
329
|
-
const o = Ln(c);
|
|
330
|
-
o && (r[o] = { dynamicImports: [u] });
|
|
331
|
-
}
|
|
332
|
-
if (e) {
|
|
333
|
-
const c = { ...t, bundles: r };
|
|
334
|
-
for (const u of e) {
|
|
335
|
-
const o = u(c);
|
|
336
|
-
o && Object.assign(r, o);
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
for (const c of Object.keys(r)) {
|
|
340
|
-
const u = r[c], o = u.imports?.filter((v) => r[v]) || [], w = u.dynamicImports?.filter(
|
|
341
|
-
// we only want to include dynamic imports that belong to the app
|
|
342
|
-
// e.g. not all languages supported by shiki
|
|
343
|
-
(v) => r[v] && // either there are qrls
|
|
344
|
-
(r[v].symbols || // or it's a dynamic import from the app source
|
|
345
|
-
r[v].origins?.some((p) => !p.includes("node_modules")))
|
|
346
|
-
) || [];
|
|
347
|
-
r[c] = {
|
|
348
|
-
...u,
|
|
349
|
-
imports: o,
|
|
350
|
-
dynamicImports: w
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
const i = new Set(Object.keys(r));
|
|
354
|
-
for (const c of Object.keys(r)) {
|
|
355
|
-
for (const u of r[c].imports)
|
|
356
|
-
i.delete(u);
|
|
357
|
-
for (const u of r[c].dynamicImports)
|
|
358
|
-
i.delete(u);
|
|
359
|
-
}
|
|
360
|
-
for (const c of i) {
|
|
361
|
-
const u = r[c];
|
|
362
|
-
!u.imports?.length && !u.dynamicImports?.length && delete r[c];
|
|
439
|
+
for (const f of Object.values(a.bundles)) {
|
|
440
|
+
const v = An(f, a);
|
|
441
|
+
f.interactivity = v;
|
|
363
442
|
}
|
|
364
|
-
|
|
365
|
-
const w = r[u];
|
|
366
|
-
for (const v of w.imports)
|
|
367
|
-
c.has(v) && c.delete(v), o.has(v) || (o.add(v), a(c, v, o));
|
|
368
|
-
};
|
|
369
|
-
for (const c of s) {
|
|
370
|
-
const u = r[c], o = new Set(u.imports);
|
|
371
|
-
for (const d of o)
|
|
372
|
-
a(o, d);
|
|
373
|
-
const w = new Set(u.dynamicImports), v = /* @__PURE__ */ new Map();
|
|
374
|
-
for (const d of w) {
|
|
375
|
-
a(w, d);
|
|
376
|
-
const g = r[d];
|
|
377
|
-
let f = 0.5;
|
|
378
|
-
if (f += (g.interactivity || 0) * 0.08, u.origins && g.origins) {
|
|
379
|
-
for (const m of u.origins)
|
|
380
|
-
if (g.origins.some((R) => R.startsWith(m))) {
|
|
381
|
-
f += 0.25;
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
g.total > Rn && (f += f > 0.5 ? 0.02 : -0.02), g.total < 1e3 && (f += 0.15), v.set(d, Math.min(f, 0.99));
|
|
386
|
-
}
|
|
387
|
-
if (w.size > 0) {
|
|
388
|
-
const d = Array.from(w).sort(
|
|
389
|
-
(f, m) => v.get(m) - v.get(f)
|
|
390
|
-
);
|
|
391
|
-
let g = -1;
|
|
392
|
-
for (const f of d)
|
|
393
|
-
v.get(f) !== g && (g = v.get(f), o.add(-Math.round(g * 10))), o.add(f);
|
|
394
|
-
}
|
|
395
|
-
const p = n.length;
|
|
396
|
-
n.push(c);
|
|
397
|
-
for (let d = 0; d < o.size; d++)
|
|
398
|
-
n.push(null);
|
|
399
|
-
l.set(c, { index: p, deps: o });
|
|
400
|
-
}
|
|
401
|
-
for (const c of s) {
|
|
402
|
-
const u = l.get(c);
|
|
403
|
-
let { index: o, deps: w } = u;
|
|
404
|
-
o++;
|
|
405
|
-
for (const v of w) {
|
|
406
|
-
if (typeof v == "number") {
|
|
407
|
-
n[o++] = v;
|
|
408
|
-
continue;
|
|
409
|
-
}
|
|
410
|
-
const d = l.get(v).index;
|
|
411
|
-
n[o++] = d;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
return n;
|
|
443
|
+
return Un(a.bundles), Fn(a);
|
|
415
444
|
}
|
|
416
|
-
async function
|
|
445
|
+
async function Wn(t, e, n) {
|
|
417
446
|
const r = await t.dynamicImport("eslint");
|
|
418
447
|
let i = new r.ESLint({ cache: !0 });
|
|
419
448
|
if ((await i.calculateConfigForFile("no-real-file.tsx")).parser === null) {
|
|
@@ -424,7 +453,7 @@ async function Mn(t, e, n) {
|
|
|
424
453
|
parserOptions: {
|
|
425
454
|
tsconfigRootDir: e,
|
|
426
455
|
project: n,
|
|
427
|
-
ecmaVersion:
|
|
456
|
+
ecmaVersion: 2022,
|
|
428
457
|
sourceType: "module",
|
|
429
458
|
ecmaFeatures: {
|
|
430
459
|
jsx: !0
|
|
@@ -438,17 +467,17 @@ async function Mn(t, e, n) {
|
|
|
438
467
|
return {
|
|
439
468
|
async lint(a, c, u) {
|
|
440
469
|
try {
|
|
441
|
-
const o =
|
|
470
|
+
const o = Hn(u);
|
|
442
471
|
if (await i.isPathIgnored(o))
|
|
443
472
|
return null;
|
|
444
473
|
(await i.lintText(c, {
|
|
445
474
|
filePath: o
|
|
446
|
-
})).forEach((
|
|
447
|
-
for (const
|
|
448
|
-
if (
|
|
475
|
+
})).forEach((b) => {
|
|
476
|
+
for (const f of b.messages) {
|
|
477
|
+
if (f.ruleId != null && !f.ruleId.startsWith("qwik/"))
|
|
449
478
|
continue;
|
|
450
|
-
const
|
|
451
|
-
a.warn(
|
|
479
|
+
const v = Qn(b.filePath, f);
|
|
480
|
+
a.warn(v);
|
|
452
481
|
}
|
|
453
482
|
});
|
|
454
483
|
} catch (o) {
|
|
@@ -457,10 +486,10 @@ async function Mn(t, e, n) {
|
|
|
457
486
|
}
|
|
458
487
|
};
|
|
459
488
|
}
|
|
460
|
-
function
|
|
489
|
+
function Hn(t) {
|
|
461
490
|
return t.split("?", 2)[0];
|
|
462
491
|
}
|
|
463
|
-
function
|
|
492
|
+
function Qn(t, e) {
|
|
464
493
|
return Object.assign(new Error(e.message), {
|
|
465
494
|
id: t,
|
|
466
495
|
plugin: "vite-plugin-eslint",
|
|
@@ -472,19 +501,19 @@ function $n(t, e) {
|
|
|
472
501
|
stack: ""
|
|
473
502
|
});
|
|
474
503
|
}
|
|
475
|
-
const
|
|
476
|
-
const n =
|
|
504
|
+
const Gn = /\.server\.[cm]?[jt]sx?$/, Kn = /\.server\.[cm]?[jt]sx?_/, Vn = /(^|\/)server(\/|$)/, $t = (t) => t.includes(".server") || t.includes("/server") || t.includes("\\server") || t.includes("server/") || t.includes("server\\"), Be = (t) => t.replace(/\\/g, "/").replace(/^\/@fs\//, ""), Jn = (t, e) => {
|
|
505
|
+
const n = Be(t), r = e.rootDir ? Be(e.rootDir).replace(/\/+$/, "") : "";
|
|
477
506
|
return r && (n === r || n.startsWith(r + "/")) ? n : r && n.startsWith("/") && !n.startsWith("//") && !/^[a-zA-Z]:\//.test(n) ? `${r}${n}` : n;
|
|
478
|
-
},
|
|
479
|
-
const e =
|
|
480
|
-
return
|
|
481
|
-
},
|
|
507
|
+
}, Yn = (t) => {
|
|
508
|
+
const e = Be(t);
|
|
509
|
+
return Gn.test(e) || Kn.test(e);
|
|
510
|
+
}, Xn = (t, e) => {
|
|
482
511
|
const n = typeof e == "string" || e == null ? { srcDir: e } : e;
|
|
483
512
|
if (!n.srcDir)
|
|
484
513
|
return !1;
|
|
485
|
-
const r =
|
|
486
|
-
return r.startsWith(i + "/") ?
|
|
487
|
-
},
|
|
514
|
+
const r = Jn(t, n), i = Be(n.srcDir).replace(/\/+$/, "");
|
|
515
|
+
return r.startsWith(i + "/") ? Vn.test(r.slice(i.length + 1)) : !1;
|
|
516
|
+
}, Zn = (t, e) => Yn(t) || Xn(t, e), er = (t, e) => {
|
|
488
517
|
const n = e ? `
|
|
489
518
|
Importer: ${e}` : "";
|
|
490
519
|
return `Server-only module cannot be imported by client code.
|
|
@@ -492,22 +521,7 @@ Importer: ${e}` : "";
|
|
|
492
521
|
Server-only module: ${t}${n}
|
|
493
522
|
|
|
494
523
|
Files named \`.server.*\` or placed under \`src/**/server/**\` are excluded from client bundles. Move this import behind SSR-only route loaders, actions, endpoint handlers, or expose the operation through an intentional \`server$\` API.`;
|
|
495
|
-
}
|
|
496
|
-
async function Gn(t, e) {
|
|
497
|
-
const n = e;
|
|
498
|
-
let r = n.loc;
|
|
499
|
-
if (!n.frame && !n.plugin && (r || (r = Qn(n)), r && (n.loc = r, r.file))) {
|
|
500
|
-
const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
|
|
501
|
-
n.id = s(n.loc.file);
|
|
502
|
-
try {
|
|
503
|
-
const l = i.readFileSync(n.loc.file, "utf-8");
|
|
504
|
-
n.frame = Jn(l, n.loc);
|
|
505
|
-
} catch {
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
return e;
|
|
509
|
-
}
|
|
510
|
-
const Qn = (t) => {
|
|
524
|
+
}, tr = (t) => {
|
|
511
525
|
const e = t.stack;
|
|
512
526
|
if (typeof e == "string") {
|
|
513
527
|
const n = e.split(`
|
|
@@ -517,7 +531,7 @@ const Qn = (t) => {
|
|
|
517
531
|
if (/^\s+at/.test(i)) {
|
|
518
532
|
const s = i.indexOf("/"), l = i.lastIndexOf(")", s);
|
|
519
533
|
if (s > 0) {
|
|
520
|
-
const c = i.slice(s, l).split(":"), u =
|
|
534
|
+
const c = i.slice(s, l).split(":"), u = Dt(c[c.length - 1]), o = Dt(c[c.length - 2]);
|
|
521
535
|
return typeof u == "number" && typeof o == "number" ? (c.length -= 2, {
|
|
522
536
|
file: c.join(":"),
|
|
523
537
|
line: o,
|
|
@@ -535,32 +549,32 @@ const Qn = (t) => {
|
|
|
535
549
|
}
|
|
536
550
|
}
|
|
537
551
|
}
|
|
538
|
-
},
|
|
552
|
+
}, Z = (t) => t.startsWith("\0"), Dt = (t) => {
|
|
539
553
|
try {
|
|
540
554
|
return parseInt(t, 10);
|
|
541
555
|
} catch {
|
|
542
556
|
return;
|
|
543
557
|
}
|
|
544
|
-
},
|
|
545
|
-
function
|
|
558
|
+
}, on = /\r?\n/, Nt = 2;
|
|
559
|
+
function nr(t, e) {
|
|
546
560
|
if (typeof e == "number")
|
|
547
561
|
return e;
|
|
548
562
|
if (e.lo != null)
|
|
549
563
|
return e.lo;
|
|
550
|
-
const n = t.split(
|
|
564
|
+
const n = t.split(on), { line: r, column: i } = e;
|
|
551
565
|
let s = 0;
|
|
552
566
|
for (let l = 0; l < r - 1 && l < n.length; l++)
|
|
553
567
|
s += n[l].length + 1;
|
|
554
568
|
return s + i;
|
|
555
569
|
}
|
|
556
|
-
function
|
|
557
|
-
e =
|
|
558
|
-
const r = t.split(
|
|
570
|
+
function rr(t, e = 0, n) {
|
|
571
|
+
e = nr(t, e), n = n || e;
|
|
572
|
+
const r = t.split(on);
|
|
559
573
|
let i = 0;
|
|
560
574
|
const s = [];
|
|
561
575
|
for (let l = 0; l < r.length; l++)
|
|
562
576
|
if (i += r[l].length + 1, i >= e) {
|
|
563
|
-
for (let a = l -
|
|
577
|
+
for (let a = l - Nt; a <= l + Nt || n > i; a++) {
|
|
564
578
|
if (a < 0 || a >= r.length)
|
|
565
579
|
continue;
|
|
566
580
|
const c = a + 1;
|
|
@@ -582,10 +596,10 @@ function Jn(t, e = 0, n) {
|
|
|
582
596
|
return s.join(`
|
|
583
597
|
`);
|
|
584
598
|
}
|
|
585
|
-
function
|
|
599
|
+
function ir(t) {
|
|
586
600
|
return t === "win32";
|
|
587
601
|
}
|
|
588
|
-
function
|
|
602
|
+
function pe(t) {
|
|
589
603
|
const [e, n] = t.split("?"), r = n || "";
|
|
590
604
|
return {
|
|
591
605
|
originalId: t,
|
|
@@ -594,21 +608,21 @@ function Ee(t) {
|
|
|
594
608
|
params: new URLSearchParams(r)
|
|
595
609
|
};
|
|
596
610
|
}
|
|
597
|
-
var
|
|
598
|
-
for (let t = 0; t <
|
|
599
|
-
const e =
|
|
600
|
-
|
|
611
|
+
var or = 44, sr = 59, Ot = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", sn = new Uint8Array(64), ar = new Uint8Array(128);
|
|
612
|
+
for (let t = 0; t < Ot.length; t++) {
|
|
613
|
+
const e = Ot.charCodeAt(t);
|
|
614
|
+
sn[t] = e, ar[e] = t;
|
|
601
615
|
}
|
|
602
616
|
function ke(t, e, n) {
|
|
603
617
|
let r = e - n;
|
|
604
618
|
r = r < 0 ? -r << 1 | 1 : r << 1;
|
|
605
619
|
do {
|
|
606
620
|
let i = r & 31;
|
|
607
|
-
r >>>= 5, r > 0 && (i |= 32), t.write(
|
|
621
|
+
r >>>= 5, r > 0 && (i |= 32), t.write(sn[i]);
|
|
608
622
|
} while (r > 0);
|
|
609
623
|
return e;
|
|
610
624
|
}
|
|
611
|
-
var
|
|
625
|
+
var Pt = 1024 * 16, Rt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
|
|
612
626
|
decode(t) {
|
|
613
627
|
return Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString();
|
|
614
628
|
}
|
|
@@ -619,36 +633,36 @@ var Dt = 1024 * 16, Nt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDeco
|
|
|
619
633
|
e += String.fromCharCode(t[n]);
|
|
620
634
|
return e;
|
|
621
635
|
}
|
|
622
|
-
},
|
|
636
|
+
}, lr = class {
|
|
623
637
|
constructor() {
|
|
624
|
-
this.pos = 0, this.out = "", this.buffer = new Uint8Array(
|
|
638
|
+
this.pos = 0, this.out = "", this.buffer = new Uint8Array(Pt);
|
|
625
639
|
}
|
|
626
640
|
write(t) {
|
|
627
641
|
const { buffer: e } = this;
|
|
628
|
-
e[this.pos++] = t, this.pos ===
|
|
642
|
+
e[this.pos++] = t, this.pos === Pt && (this.out += Rt.decode(e), this.pos = 0);
|
|
629
643
|
}
|
|
630
644
|
flush() {
|
|
631
645
|
const { buffer: t, out: e, pos: n } = this;
|
|
632
|
-
return n > 0 ? e +
|
|
646
|
+
return n > 0 ? e + Rt.decode(t.subarray(0, n)) : e;
|
|
633
647
|
}
|
|
634
648
|
};
|
|
635
|
-
function
|
|
636
|
-
const e = new
|
|
649
|
+
function cr(t) {
|
|
650
|
+
const e = new lr();
|
|
637
651
|
let n = 0, r = 0, i = 0, s = 0;
|
|
638
652
|
for (let l = 0; l < t.length; l++) {
|
|
639
653
|
const a = t[l];
|
|
640
|
-
if (l > 0 && e.write(
|
|
654
|
+
if (l > 0 && e.write(sr), a.length === 0) continue;
|
|
641
655
|
let c = 0;
|
|
642
656
|
for (let u = 0; u < a.length; u++) {
|
|
643
657
|
const o = a[u];
|
|
644
|
-
u > 0 && e.write(
|
|
658
|
+
u > 0 && e.write(or), c = ke(e, o[0], c), o.length !== 1 && (n = ke(e, o[1], n), r = ke(e, o[2], r), i = ke(e, o[3], i), o.length !== 4 && (s = ke(e, o[4], s)));
|
|
645
659
|
}
|
|
646
660
|
}
|
|
647
661
|
return e.flush();
|
|
648
662
|
}
|
|
649
|
-
class
|
|
663
|
+
class We {
|
|
650
664
|
constructor(e) {
|
|
651
|
-
this.bits = e instanceof
|
|
665
|
+
this.bits = e instanceof We ? e.bits.slice() : [];
|
|
652
666
|
}
|
|
653
667
|
add(e) {
|
|
654
668
|
this.bits[e >> 5] |= 1 << (e & 31);
|
|
@@ -657,7 +671,7 @@ class et {
|
|
|
657
671
|
return !!(this.bits[e >> 5] & 1 << (e & 31));
|
|
658
672
|
}
|
|
659
673
|
}
|
|
660
|
-
class
|
|
674
|
+
class Ie {
|
|
661
675
|
constructor(e, n, r) {
|
|
662
676
|
this.start = e, this.end = n, this.original = r, this.intro = "", this.outro = "", this.content = r, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
|
|
663
677
|
}
|
|
@@ -668,7 +682,7 @@ class We {
|
|
|
668
682
|
this.intro = this.intro + e;
|
|
669
683
|
}
|
|
670
684
|
clone() {
|
|
671
|
-
const e = new
|
|
685
|
+
const e = new Ie(this.start, this.end, this.original);
|
|
672
686
|
return e.intro = this.intro, e.outro = this.outro, e.content = this.content, e.storeName = this.storeName, e.edited = this.edited, e;
|
|
673
687
|
}
|
|
674
688
|
contains(e) {
|
|
@@ -699,7 +713,7 @@ class We {
|
|
|
699
713
|
split(e) {
|
|
700
714
|
const n = e - this.start, r = this.original.slice(0, n), i = this.original.slice(n);
|
|
701
715
|
this.original = r;
|
|
702
|
-
const s = new
|
|
716
|
+
const s = new Ie(e, this.end, i);
|
|
703
717
|
return s.outro = this.outro, this.outro = "", this.end = e, this.edited ? (s.edit("", !1), this.content = "") : this.content = r, s.next = this.next, s.next && (s.next.previous = s), s.previous = this, this.next = s, s;
|
|
704
718
|
}
|
|
705
719
|
toString() {
|
|
@@ -724,24 +738,24 @@ class We {
|
|
|
724
738
|
} else if (this.edit("", void 0, !0), this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
|
|
725
739
|
}
|
|
726
740
|
}
|
|
727
|
-
function
|
|
741
|
+
function dr() {
|
|
728
742
|
return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (t) => globalThis.btoa(unescape(encodeURIComponent(t))) : typeof Buffer == "function" ? (t) => Buffer.from(t, "utf-8").toString("base64") : () => {
|
|
729
743
|
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
730
744
|
};
|
|
731
745
|
}
|
|
732
|
-
const
|
|
733
|
-
class
|
|
746
|
+
const ur = /* @__PURE__ */ dr();
|
|
747
|
+
class fr {
|
|
734
748
|
constructor(e) {
|
|
735
|
-
this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings =
|
|
749
|
+
this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = cr(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
|
|
736
750
|
}
|
|
737
751
|
toString() {
|
|
738
752
|
return JSON.stringify(this);
|
|
739
753
|
}
|
|
740
754
|
toUrl() {
|
|
741
|
-
return "data:application/json;charset=utf-8;base64," +
|
|
755
|
+
return "data:application/json;charset=utf-8;base64," + ur(this.toString());
|
|
742
756
|
}
|
|
743
757
|
}
|
|
744
|
-
function
|
|
758
|
+
function hr(t) {
|
|
745
759
|
const e = t.split(`
|
|
746
760
|
`), n = e.filter((s) => /^\t+/.test(s)), r = e.filter((s) => /^ {2,}/.test(s));
|
|
747
761
|
if (n.length === 0 && r.length === 0)
|
|
@@ -754,7 +768,7 @@ function or(t) {
|
|
|
754
768
|
}, 1 / 0);
|
|
755
769
|
return new Array(i + 1).join(" ");
|
|
756
770
|
}
|
|
757
|
-
function
|
|
771
|
+
function pr(t, e) {
|
|
758
772
|
const n = t.split(/[/\\]/), r = e.split(/[/\\]/);
|
|
759
773
|
for (n.pop(); n[0] === r[0]; )
|
|
760
774
|
n.shift(), r.shift();
|
|
@@ -764,11 +778,11 @@ function sr(t, e) {
|
|
|
764
778
|
}
|
|
765
779
|
return n.concat(r).join("/");
|
|
766
780
|
}
|
|
767
|
-
const
|
|
768
|
-
function
|
|
769
|
-
return
|
|
781
|
+
const gr = Object.prototype.toString;
|
|
782
|
+
function mr(t) {
|
|
783
|
+
return gr.call(t) === "[object Object]";
|
|
770
784
|
}
|
|
771
|
-
function
|
|
785
|
+
function Lt(t) {
|
|
772
786
|
const e = t.split(`
|
|
773
787
|
`), n = [];
|
|
774
788
|
for (let r = 0, i = 0; r < e.length; r++)
|
|
@@ -783,8 +797,8 @@ function Rt(t) {
|
|
|
783
797
|
return { line: a, column: c };
|
|
784
798
|
};
|
|
785
799
|
}
|
|
786
|
-
const
|
|
787
|
-
class
|
|
800
|
+
const wr = /\w/;
|
|
801
|
+
class vr {
|
|
788
802
|
constructor(e) {
|
|
789
803
|
this.hires = e, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
|
|
790
804
|
}
|
|
@@ -812,7 +826,7 @@ class dr {
|
|
|
812
826
|
else {
|
|
813
827
|
if (this.hires || a || s.has(l)) {
|
|
814
828
|
const u = [this.generatedCodeColumn, e, i.line, i.column];
|
|
815
|
-
this.hires === "boundary" ?
|
|
829
|
+
this.hires === "boundary" ? wr.test(r[l]) ? c || (this.rawSegments.push(u), c = !0) : (this.rawSegments.push(u), c = !1) : this.rawSegments.push(u);
|
|
816
830
|
}
|
|
817
831
|
i.column += 1, this.generatedCodeColumn += 1, a = !1;
|
|
818
832
|
}
|
|
@@ -832,15 +846,15 @@ class dr {
|
|
|
832
846
|
this.generatedCodeColumn += n[n.length - 1].length;
|
|
833
847
|
}
|
|
834
848
|
}
|
|
835
|
-
const
|
|
836
|
-
`,
|
|
849
|
+
const Se = `
|
|
850
|
+
`, ge = {
|
|
837
851
|
insertLeft: !1,
|
|
838
852
|
insertRight: !1,
|
|
839
853
|
storeName: !1
|
|
840
854
|
};
|
|
841
|
-
class
|
|
855
|
+
class gt {
|
|
842
856
|
constructor(e, n = {}) {
|
|
843
|
-
const r = new
|
|
857
|
+
const r = new Ie(0, e.length, e);
|
|
844
858
|
Object.defineProperties(this, {
|
|
845
859
|
original: { writable: !0, value: e },
|
|
846
860
|
outro: { writable: !0, value: "" },
|
|
@@ -852,7 +866,7 @@ class ft {
|
|
|
852
866
|
byEnd: { writable: !0, value: {} },
|
|
853
867
|
filename: { writable: !0, value: n.filename },
|
|
854
868
|
indentExclusionRanges: { writable: !0, value: n.indentExclusionRanges },
|
|
855
|
-
sourcemapLocations: { writable: !0, value: new
|
|
869
|
+
sourcemapLocations: { writable: !0, value: new We() },
|
|
856
870
|
storedNames: { writable: !0, value: {} },
|
|
857
871
|
indentStr: { writable: !0, value: void 0 },
|
|
858
872
|
ignoreList: { writable: !0, value: n.ignoreList },
|
|
@@ -879,18 +893,18 @@ class ft {
|
|
|
879
893
|
return r ? r.appendRight(n) : this.outro += n, this;
|
|
880
894
|
}
|
|
881
895
|
clone() {
|
|
882
|
-
const e = new
|
|
896
|
+
const e = new gt(this.original, { filename: this.filename, offset: this.offset });
|
|
883
897
|
let n = this.firstChunk, r = e.firstChunk = e.lastSearchedChunk = n.clone();
|
|
884
898
|
for (; n; ) {
|
|
885
899
|
e.byStart[r.start] = r, e.byEnd[r.end] = r;
|
|
886
900
|
const i = n.next, s = i && i.clone();
|
|
887
901
|
s && (r.next = s, s.previous = r, r = s), n = i;
|
|
888
902
|
}
|
|
889
|
-
return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new
|
|
903
|
+
return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new We(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
|
|
890
904
|
}
|
|
891
905
|
generateDecodedMap(e) {
|
|
892
906
|
e = e || {};
|
|
893
|
-
const n = 0, r = Object.keys(this.storedNames), i = new
|
|
907
|
+
const n = 0, r = Object.keys(this.storedNames), i = new vr(e.hires), s = Lt(this.original);
|
|
894
908
|
return this.intro && i.advance(this.intro), this.firstChunk.eachNext((l) => {
|
|
895
909
|
const a = s(l.start);
|
|
896
910
|
l.intro.length && i.advance(l.intro), l.edited ? i.addEdit(
|
|
@@ -902,7 +916,7 @@ class ft {
|
|
|
902
916
|
}), this.outro && i.advance(this.outro), {
|
|
903
917
|
file: e.file ? e.file.split(/[/\\]/).pop() : void 0,
|
|
904
918
|
sources: [
|
|
905
|
-
e.source ?
|
|
919
|
+
e.source ? pr(e.file || "", e.source) : e.file || ""
|
|
906
920
|
],
|
|
907
921
|
sourcesContent: e.includeContent ? [this.original] : void 0,
|
|
908
922
|
names: r,
|
|
@@ -911,10 +925,10 @@ class ft {
|
|
|
911
925
|
};
|
|
912
926
|
}
|
|
913
927
|
generateMap(e) {
|
|
914
|
-
return new
|
|
928
|
+
return new fr(this.generateDecodedMap(e));
|
|
915
929
|
}
|
|
916
930
|
_ensureindentStr() {
|
|
917
|
-
this.indentStr === void 0 && (this.indentStr =
|
|
931
|
+
this.indentStr === void 0 && (this.indentStr = hr(this.original));
|
|
918
932
|
}
|
|
919
933
|
_getRawIndentString() {
|
|
920
934
|
return this._ensureindentStr(), this.indentStr;
|
|
@@ -924,7 +938,7 @@ class ft {
|
|
|
924
938
|
}
|
|
925
939
|
indent(e, n) {
|
|
926
940
|
const r = /^[^\r\n]/gm;
|
|
927
|
-
if (
|
|
941
|
+
if (mr(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
|
|
928
942
|
n = n || {};
|
|
929
943
|
const i = {};
|
|
930
944
|
n.exclude && (typeof n.exclude[0] == "number" ? [n.exclude] : n.exclude).forEach((o) => {
|
|
@@ -959,14 +973,14 @@ class ft {
|
|
|
959
973
|
);
|
|
960
974
|
}
|
|
961
975
|
insertLeft(e, n) {
|
|
962
|
-
return
|
|
976
|
+
return ge.insertLeft || (console.warn(
|
|
963
977
|
"magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
|
|
964
|
-
),
|
|
978
|
+
), ge.insertLeft = !0), this.appendLeft(e, n);
|
|
965
979
|
}
|
|
966
980
|
insertRight(e, n) {
|
|
967
|
-
return
|
|
981
|
+
return ge.insertRight || (console.warn(
|
|
968
982
|
"magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
|
|
969
|
-
),
|
|
983
|
+
), ge.insertRight = !0), this.prependRight(e, n);
|
|
970
984
|
}
|
|
971
985
|
move(e, n, r) {
|
|
972
986
|
if (e = e + this.offset, n = n + this.offset, r = r + this.offset, r >= e && r <= n) throw new Error("Cannot move a selection inside itself");
|
|
@@ -990,9 +1004,9 @@ class ft {
|
|
|
990
1004
|
throw new Error(
|
|
991
1005
|
"Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
|
|
992
1006
|
);
|
|
993
|
-
this._split(e), this._split(n), i === !0 && (
|
|
1007
|
+
this._split(e), this._split(n), i === !0 && (ge.storeName || (console.warn(
|
|
994
1008
|
"The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
|
|
995
|
-
),
|
|
1009
|
+
), ge.storeName = !0), i = { storeName: !0 });
|
|
996
1010
|
const s = i !== void 0 ? i.storeName : !1, l = i !== void 0 ? i.overwrite : !1;
|
|
997
1011
|
if (s) {
|
|
998
1012
|
const u = this.original.slice(e, n);
|
|
@@ -1012,7 +1026,7 @@ class ft {
|
|
|
1012
1026
|
}
|
|
1013
1027
|
a.edit(r, s, !l);
|
|
1014
1028
|
} else {
|
|
1015
|
-
const u = new
|
|
1029
|
+
const u = new Ie(e, n, "").edit(r, s);
|
|
1016
1030
|
c.next = u, u.previous = c;
|
|
1017
1031
|
}
|
|
1018
1032
|
return this;
|
|
@@ -1072,24 +1086,24 @@ class ft {
|
|
|
1072
1086
|
return this.intro.length ? this.intro[this.intro.length - 1] : "";
|
|
1073
1087
|
}
|
|
1074
1088
|
lastLine() {
|
|
1075
|
-
let e = this.outro.lastIndexOf(
|
|
1089
|
+
let e = this.outro.lastIndexOf(Se);
|
|
1076
1090
|
if (e !== -1) return this.outro.substr(e + 1);
|
|
1077
1091
|
let n = this.outro, r = this.lastChunk;
|
|
1078
1092
|
do {
|
|
1079
1093
|
if (r.outro.length > 0) {
|
|
1080
|
-
if (e = r.outro.lastIndexOf(
|
|
1094
|
+
if (e = r.outro.lastIndexOf(Se), e !== -1) return r.outro.substr(e + 1) + n;
|
|
1081
1095
|
n = r.outro + n;
|
|
1082
1096
|
}
|
|
1083
1097
|
if (r.content.length > 0) {
|
|
1084
|
-
if (e = r.content.lastIndexOf(
|
|
1098
|
+
if (e = r.content.lastIndexOf(Se), e !== -1) return r.content.substr(e + 1) + n;
|
|
1085
1099
|
n = r.content + n;
|
|
1086
1100
|
}
|
|
1087
1101
|
if (r.intro.length > 0) {
|
|
1088
|
-
if (e = r.intro.lastIndexOf(
|
|
1102
|
+
if (e = r.intro.lastIndexOf(Se), e !== -1) return r.intro.substr(e + 1) + n;
|
|
1089
1103
|
n = r.intro + n;
|
|
1090
1104
|
}
|
|
1091
1105
|
} while (r = r.previous);
|
|
1092
|
-
return e = this.intro.lastIndexOf(
|
|
1106
|
+
return e = this.intro.lastIndexOf(Se), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
|
|
1093
1107
|
}
|
|
1094
1108
|
slice(e = 0, n = this.original.length - this.offset) {
|
|
1095
1109
|
if (e = e + this.offset, n = n + this.offset, this.original.length !== 0) {
|
|
@@ -1134,7 +1148,7 @@ class ft {
|
|
|
1134
1148
|
}
|
|
1135
1149
|
_splitChunk(e, n) {
|
|
1136
1150
|
if (e.edited && e.content.length) {
|
|
1137
|
-
const i =
|
|
1151
|
+
const i = Lt(this.original)(n);
|
|
1138
1152
|
throw new Error(
|
|
1139
1153
|
`Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`
|
|
1140
1154
|
);
|
|
@@ -1253,13 +1267,13 @@ class ft {
|
|
|
1253
1267
|
return this._replaceRegexp(e, n);
|
|
1254
1268
|
}
|
|
1255
1269
|
}
|
|
1256
|
-
const
|
|
1270
|
+
const br = "__QWIK_WORKER_QRL__", yr = `${br}:`, st = "__QWIK_WORKER_CORE__", xr = new RegExp(`${yr}([^"'\\\`\\s]+)`, "g"), at = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), an = (t) => {
|
|
1257
1271
|
const e = t.replace(/\/+$/, ""), n = e.lastIndexOf("/");
|
|
1258
1272
|
return n === -1 ? "." : n === 0 ? "/" : e.slice(0, n);
|
|
1259
|
-
},
|
|
1273
|
+
}, kr = (t, e) => {
|
|
1260
1274
|
const n = e.replace(/^\.\//, "");
|
|
1261
|
-
return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ?
|
|
1262
|
-
},
|
|
1275
|
+
return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? at(t, n) : new URL(n, `https://qwik.dev${at(t, "build/")}`).pathname;
|
|
1276
|
+
}, Sr = (t, e) => {
|
|
1263
1277
|
const n = /* @__PURE__ */ new Map();
|
|
1264
1278
|
for (const [r, i] of Object.entries(t.symbols)) {
|
|
1265
1279
|
const s = t.mapping[r];
|
|
@@ -1271,35 +1285,35 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
|
|
|
1271
1285
|
return (r) => n.get(
|
|
1272
1286
|
r.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, "")
|
|
1273
1287
|
);
|
|
1274
|
-
},
|
|
1288
|
+
}, ln = (t, e) => t.replace(xr, (n, r) => e(r) ?? n), Er = (t, e) => Sr(
|
|
1275
1289
|
t,
|
|
1276
|
-
(n) =>
|
|
1277
|
-
),
|
|
1278
|
-
const e = t.replace(/\\/g, "/"), n =
|
|
1290
|
+
(n) => kr(e, n)
|
|
1291
|
+
), Cr = (t) => {
|
|
1292
|
+
const e = t.replace(/\\/g, "/"), n = an(e);
|
|
1279
1293
|
return (r) => {
|
|
1280
|
-
const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a =
|
|
1294
|
+
const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a = at(n, `${l}.js`);
|
|
1281
1295
|
return s.startsWith("?") ? `${a}?worker_file&type=module&${s.slice(1)}` : s.startsWith("#") ? `${a}?worker_file&type=module${s}` : `${a}?worker_file&type=module`;
|
|
1282
1296
|
};
|
|
1283
|
-
},
|
|
1297
|
+
}, Ir = (t) => t.startsWith(".") ? t : `./${t}`, Mt = (t) => {
|
|
1284
1298
|
const e = [];
|
|
1285
1299
|
for (const n of t.replace(/\\/g, "/").split("/"))
|
|
1286
1300
|
!n || n === "." || (n === ".." && e.length > 0 && e[e.length - 1] !== ".." ? e.pop() : e.push(n));
|
|
1287
1301
|
return e;
|
|
1288
|
-
},
|
|
1289
|
-
const n = t === "." ? [] :
|
|
1302
|
+
}, _r = (t, e) => {
|
|
1303
|
+
const n = t === "." ? [] : Mt(t), r = Mt(e);
|
|
1290
1304
|
let i = 0;
|
|
1291
1305
|
for (; i < n.length && i < r.length && n[i] === r[i]; )
|
|
1292
1306
|
i++;
|
|
1293
1307
|
return [...n.slice(i).map(() => ".."), ...r.slice(i)].join("/");
|
|
1294
|
-
},
|
|
1295
|
-
const n =
|
|
1296
|
-
return
|
|
1297
|
-
},
|
|
1298
|
-
if (!t.includes(
|
|
1308
|
+
}, cn = (t) => (e) => {
|
|
1309
|
+
const n = _r(an(e), t);
|
|
1310
|
+
return Ir(n);
|
|
1311
|
+
}, jt = (t, e) => {
|
|
1312
|
+
if (!t.includes(st))
|
|
1299
1313
|
return t;
|
|
1300
1314
|
const n = e();
|
|
1301
|
-
return n ? t.replaceAll(
|
|
1302
|
-
},
|
|
1315
|
+
return n ? t.replaceAll(st, n) : t;
|
|
1316
|
+
}, Tr = ["server"], qt = [
|
|
1303
1317
|
"onGet",
|
|
1304
1318
|
"onPost",
|
|
1305
1319
|
"onPut",
|
|
@@ -1309,7 +1323,7 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
|
|
|
1309
1323
|
"onOptions",
|
|
1310
1324
|
"onPatch",
|
|
1311
1325
|
"onStaticGenerate"
|
|
1312
|
-
],
|
|
1326
|
+
], zt = [
|
|
1313
1327
|
"useServer",
|
|
1314
1328
|
"route",
|
|
1315
1329
|
"server",
|
|
@@ -1318,7 +1332,7 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
|
|
|
1318
1332
|
"zod$",
|
|
1319
1333
|
"validator$",
|
|
1320
1334
|
"globalAction$"
|
|
1321
|
-
],
|
|
1335
|
+
], $r = [
|
|
1322
1336
|
"useClient",
|
|
1323
1337
|
"useBrowser",
|
|
1324
1338
|
"useVisibleTask",
|
|
@@ -1326,8 +1340,8 @@ const ur = "__QWIK_WORKER_QRL__", hr = `${ur}:`, lt = "__QWIK_WORKER_CORE__", fr
|
|
|
1326
1340
|
"browser",
|
|
1327
1341
|
"event$"
|
|
1328
1342
|
];
|
|
1329
|
-
var
|
|
1330
|
-
function
|
|
1343
|
+
var dn = /* @__PURE__ */ ((t) => (t.each = "each", t.show = "show", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t.blockSSR = "blockSSR", t))(dn || {});
|
|
1344
|
+
function un(t = {}) {
|
|
1331
1345
|
const e = `${Math.round(Math.random() * 899) + 100}`, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
|
|
1332
1346
|
let a = null, c, u = () => {
|
|
1333
1347
|
};
|
|
@@ -1340,7 +1354,6 @@ function dn(t = {}) {
|
|
|
1340
1354
|
tsconfigFileNames: ["./tsconfig.json"],
|
|
1341
1355
|
input: void 0,
|
|
1342
1356
|
outDir: void 0,
|
|
1343
|
-
assetsDir: void 0,
|
|
1344
1357
|
resolveQwikBuild: !0,
|
|
1345
1358
|
entryStrategy: void 0,
|
|
1346
1359
|
srcDir: void 0,
|
|
@@ -1361,182 +1374,201 @@ function dn(t = {}) {
|
|
|
1361
1374
|
lint: !1,
|
|
1362
1375
|
experimental: void 0
|
|
1363
1376
|
};
|
|
1364
|
-
let w,
|
|
1365
|
-
const
|
|
1377
|
+
let w, b;
|
|
1378
|
+
const f = async () => {
|
|
1366
1379
|
if (!a) {
|
|
1367
|
-
const
|
|
1368
|
-
if (a = await
|
|
1380
|
+
const p = (t._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
|
|
1381
|
+
if (a = await p(t), w = Dr(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
|
|
1369
1382
|
try {
|
|
1370
|
-
|
|
1383
|
+
b === void 0 && (b = await a.sys.dynamicImport("node:fs"));
|
|
1371
1384
|
} catch {
|
|
1372
|
-
console.log("node:fs not available, disabling automatic manifest reading"),
|
|
1385
|
+
console.log("node:fs not available, disabling automatic manifest reading"), b = null;
|
|
1373
1386
|
}
|
|
1374
1387
|
}
|
|
1375
|
-
},
|
|
1388
|
+
}, v = () => {
|
|
1376
1389
|
if (!a)
|
|
1377
1390
|
throw new Error("Qwik plugin has not been initialized");
|
|
1378
1391
|
return a;
|
|
1379
|
-
},
|
|
1380
|
-
let
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
},
|
|
1384
|
-
const
|
|
1385
|
-
o.debug = !!
|
|
1392
|
+
}, x = () => v().sys, C = () => v().sys.path;
|
|
1393
|
+
let T;
|
|
1394
|
+
const W = (p) => {
|
|
1395
|
+
T = p;
|
|
1396
|
+
}, Te = async (p) => {
|
|
1397
|
+
const d = Object.assign({}, p), y = v(), E = y.sys.path, k = (...$) => H(E.resolve(...$));
|
|
1398
|
+
o.debug = !!d.debug, d.devTools && (o.devTools = {
|
|
1386
1399
|
...o.devTools,
|
|
1387
|
-
...
|
|
1388
|
-
}),
|
|
1389
|
-
let
|
|
1390
|
-
if (typeof
|
|
1391
|
-
o.scope =
|
|
1392
|
-
else if (!o.scope &&
|
|
1393
|
-
let
|
|
1400
|
+
...d.devTools
|
|
1401
|
+
}), d.target === "ssr" || d.target === "client" || d.target === "lib" || d.target === "test" ? o.target = d.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : d.buildMode === "production" || d.buildMode === "development" ? o.buildMode = d.buildMode : o.buildMode ||= "development", o.csr = !!d.csr, d.entryStrategy && typeof d.entryStrategy == "object" && (o.entryStrategy = { ...d.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof d.rootDir == "string" && (o.rootDir = d.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= y.sys.cwd()), o.rootDir = k(y.sys.cwd(), o.rootDir);
|
|
1402
|
+
let m = k(o.rootDir, Or);
|
|
1403
|
+
if (typeof d.srcDir == "string" ? (o.srcDir = k(o.rootDir, d.srcDir), m = o.srcDir) : o.srcDir ||= m, o.srcDir = k(o.rootDir, o.srcDir), Array.isArray(d.tsconfigFileNames) && d.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = d.tsconfigFileNames), !o.csr && !d.input && !o.input && (o.target === "ssr" ? o.input = [k(m, "entry.ssr")] : o.target === "client" ? o.input = [k(m, "root")] : o.input = void 0), d.outDir && (o.outDir = k(o.rootDir, d.outDir)), o.clientOutDir = k(o.rootDir, d.clientOutDir || Ut), o.ssrOutDir = k(o.rootDir, d.ssrOutDir || Pr), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= k(o.rootDir, Rr) : o.outDir ||= o.clientOutDir, typeof d.manifestOutput == "function" && (o.manifestOutput = d.manifestOutput), d.manifestInput && (o.manifestInput = Ct(d.manifestInput) || null), typeof d.transformedModuleOutput == "function" && (o.transformedModuleOutput = d.transformedModuleOutput), d.scope !== void 0)
|
|
1404
|
+
o.scope = d.scope;
|
|
1405
|
+
else if (!o.scope && b) {
|
|
1406
|
+
let $ = "";
|
|
1394
1407
|
try {
|
|
1395
|
-
let
|
|
1396
|
-
for (;
|
|
1397
|
-
const D =
|
|
1398
|
-
if (D ===
|
|
1408
|
+
let R = o.rootDir;
|
|
1409
|
+
for (; $ = E.resolve(R, "package.json"), !await b.promises.stat($).catch(() => !1); ) {
|
|
1410
|
+
const D = E.resolve(R, "..");
|
|
1411
|
+
if (D === R)
|
|
1399
1412
|
break;
|
|
1400
|
-
|
|
1413
|
+
R = D, $ = "";
|
|
1401
1414
|
}
|
|
1402
|
-
if (
|
|
1403
|
-
const D = await
|
|
1415
|
+
if ($) {
|
|
1416
|
+
const D = await b.promises.readFile($, "utf-8"), N = JSON.parse(D);
|
|
1404
1417
|
typeof N.name == "string" && (o.scope = N.name);
|
|
1405
1418
|
}
|
|
1406
|
-
} catch (
|
|
1419
|
+
} catch (R) {
|
|
1407
1420
|
console.warn(
|
|
1408
|
-
`could not read ${
|
|
1421
|
+
`could not read ${$ || "package.json"} to determine package name, ignoring. (${R})`
|
|
1409
1422
|
);
|
|
1410
1423
|
}
|
|
1411
1424
|
}
|
|
1412
|
-
if (typeof
|
|
1425
|
+
if (typeof d.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = d.resolveQwikBuild), typeof d.devTools == "object" && ("imageDevTools" in d.devTools && (o.devTools.imageDevTools = d.devTools.imageDevTools), "clickToSource" in d.devTools && (o.devTools.clickToSource = d.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof d.lint == "boolean" && (o.lint = d.lint), "experimental" in d) {
|
|
1413
1426
|
o.experimental = void 0;
|
|
1414
|
-
for (const
|
|
1415
|
-
|
|
1427
|
+
for (const $ of d.experimental ?? [])
|
|
1428
|
+
dn[$] ? (o.experimental ||= {})[$] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${$}`);
|
|
1416
1429
|
}
|
|
1417
|
-
const
|
|
1418
|
-
return o.input ||=
|
|
1430
|
+
const O = { ...o };
|
|
1431
|
+
return o.input ||= d.input, o.input && typeof o.input == "string" && (o.input = [o.input]), O;
|
|
1419
1432
|
};
|
|
1420
|
-
let
|
|
1421
|
-
const
|
|
1422
|
-
if (!
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1426
|
-
const
|
|
1427
|
-
if (!
|
|
1433
|
+
let h = !1;
|
|
1434
|
+
const g = async (p) => {
|
|
1435
|
+
if (!h) {
|
|
1436
|
+
h = !0;
|
|
1437
|
+
const d = x();
|
|
1438
|
+
if (d.env === "node") {
|
|
1439
|
+
const y = await d.dynamicImport("node:fs");
|
|
1440
|
+
if (!y.existsSync(o.rootDir))
|
|
1428
1441
|
throw new Error(`Qwik rootDir "${o.rootDir}" not found.`);
|
|
1429
|
-
if (typeof o.srcDir == "string" && !
|
|
1442
|
+
if (typeof o.srcDir == "string" && !y.existsSync(o.srcDir))
|
|
1430
1443
|
throw new Error(`Qwik srcDir "${o.srcDir}" not found.`);
|
|
1431
|
-
for (const [
|
|
1432
|
-
if (!await
|
|
1433
|
-
throw new Error(`Qwik input "${
|
|
1444
|
+
for (const [E, k] of Object.entries(o.input || {}))
|
|
1445
|
+
if (!await p(k))
|
|
1446
|
+
throw new Error(`Qwik input "${k}" not found.`);
|
|
1434
1447
|
}
|
|
1435
1448
|
}
|
|
1436
1449
|
};
|
|
1437
|
-
let
|
|
1438
|
-
const
|
|
1439
|
-
if (
|
|
1450
|
+
let I, M = !1;
|
|
1451
|
+
const S = async (p) => {
|
|
1452
|
+
if (P("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), I = v(), M = !T, I.sys.env === "node" && o.target === "ssr" && o.lint)
|
|
1440
1453
|
try {
|
|
1441
|
-
c = await
|
|
1454
|
+
c = await Wn(I.sys, o.rootDir, o.tsconfigFileNames);
|
|
1442
1455
|
} catch {
|
|
1443
1456
|
}
|
|
1444
|
-
if (
|
|
1445
|
-
const
|
|
1457
|
+
if (P("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !T) {
|
|
1458
|
+
const d = await p.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
1446
1459
|
skipSelf: !0
|
|
1447
1460
|
});
|
|
1448
|
-
|
|
1449
|
-
id:
|
|
1461
|
+
d && p.emitFile({
|
|
1462
|
+
id: d.id,
|
|
1450
1463
|
type: "chunk",
|
|
1451
1464
|
preserveSignature: "allow-extension"
|
|
1452
1465
|
});
|
|
1453
1466
|
}
|
|
1454
|
-
},
|
|
1455
|
-
if (
|
|
1456
|
-
throw new Error(
|
|
1457
|
-
}, A = (
|
|
1458
|
-
const
|
|
1459
|
-
return
|
|
1460
|
-
},
|
|
1461
|
-
const
|
|
1462
|
-
typeof
|
|
1463
|
-
},
|
|
1464
|
-
for (;
|
|
1465
|
-
const
|
|
1466
|
-
if (!(!
|
|
1467
|
-
|
|
1468
|
-
for (const
|
|
1469
|
-
if (
|
|
1467
|
+
}, _ = (p, d) => p.environment ? p.environment.config.consumer === "server" : T ? !!d?.ssr : o.target === "ssr" || o.target === "test", U = (p) => !p && (o.target === "client" || !!T && o.target === "ssr"), L = (p) => !!T && p && (o.target === "client" || o.target === "ssr"), j = (p, d, y = !1) => {
|
|
1468
|
+
if (U(y) && Zn(p, o))
|
|
1469
|
+
throw new Error(er(p, d));
|
|
1470
|
+
}, A = (p) => {
|
|
1471
|
+
const d = p.replace(/\\/g, "/");
|
|
1472
|
+
return d.includes(".server") || /(^|\/)server(\/|$)/.test(d);
|
|
1473
|
+
}, Q = (p, d) => {
|
|
1474
|
+
const y = /* @__PURE__ */ new Set(), E = (m) => {
|
|
1475
|
+
typeof m?.value == "string" && y.add(m.value);
|
|
1476
|
+
}, k = [p.parse(d)];
|
|
1477
|
+
for (; k.length > 0; ) {
|
|
1478
|
+
const m = k.pop();
|
|
1479
|
+
if (!(!m || typeof m != "object" || typeof m.type != "string")) {
|
|
1480
|
+
m.type === "ImportDeclaration" && m.importKind !== "type" || (m.type === "ExportNamedDeclaration" || m.type === "ExportAllDeclaration") && m.exportKind !== "type" || m.type === "ImportExpression" ? E(m.source) : m.type === "CallExpression" && m.callee?.type === "Import" && E(m.arguments?.[0]);
|
|
1481
|
+
for (const O of Object.keys(m)) {
|
|
1482
|
+
if (O === "parent")
|
|
1470
1483
|
continue;
|
|
1471
|
-
const
|
|
1472
|
-
if (Array.isArray(
|
|
1473
|
-
for (const
|
|
1474
|
-
|
|
1484
|
+
const $ = m[O];
|
|
1485
|
+
if (Array.isArray($))
|
|
1486
|
+
for (const R of $)
|
|
1487
|
+
k.push(R);
|
|
1475
1488
|
else
|
|
1476
|
-
|
|
1489
|
+
k.push($);
|
|
1477
1490
|
}
|
|
1478
1491
|
}
|
|
1479
1492
|
}
|
|
1480
|
-
return Array.from(
|
|
1481
|
-
},
|
|
1482
|
-
if (
|
|
1483
|
-
for (const
|
|
1484
|
-
if (!A(
|
|
1493
|
+
return Array.from(y);
|
|
1494
|
+
}, K = async (p, d, y, E = y) => {
|
|
1495
|
+
if ($t(d))
|
|
1496
|
+
for (const k of Q(p, d)) {
|
|
1497
|
+
if (!A(k))
|
|
1485
1498
|
continue;
|
|
1486
|
-
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1499
|
+
j(k, E);
|
|
1500
|
+
const m = await p.resolve(k, y, { skipSelf: !0 });
|
|
1501
|
+
m && j(H(pe(m.id).pathId), E);
|
|
1489
1502
|
}
|
|
1490
|
-
}, G = async (
|
|
1491
|
-
const
|
|
1492
|
-
for (const
|
|
1493
|
-
if (
|
|
1503
|
+
}, G = async (p, d, y, E, k = !1) => {
|
|
1504
|
+
const m = C();
|
|
1505
|
+
for (const O of d.modules) {
|
|
1506
|
+
if (k && !Ft(O))
|
|
1494
1507
|
continue;
|
|
1495
|
-
const
|
|
1496
|
-
await
|
|
1508
|
+
const $ = H(m.join(y, O.path));
|
|
1509
|
+
await K(p, O.code, $, E ?? $);
|
|
1497
1510
|
}
|
|
1511
|
+
}, ie = async (p, d, y) => {
|
|
1512
|
+
const E = await p.resolve(d, y, { skipSelf: !0 });
|
|
1513
|
+
if (!E || E.external || Z(E.id))
|
|
1514
|
+
return;
|
|
1515
|
+
const k = pe(E.id);
|
|
1516
|
+
if (k.query)
|
|
1517
|
+
return;
|
|
1518
|
+
const m = H(k.pathId);
|
|
1519
|
+
if (C().extname(m).toLowerCase() in At || lt.test(m))
|
|
1520
|
+
return m;
|
|
1521
|
+
}, B = async (p, d, y) => {
|
|
1522
|
+
if (d.length === 0)
|
|
1523
|
+
return [];
|
|
1524
|
+
const E = [];
|
|
1525
|
+
for (const k of d) {
|
|
1526
|
+
const m = await ie(p, k, y);
|
|
1527
|
+
m && E.push(m);
|
|
1528
|
+
}
|
|
1529
|
+
return E;
|
|
1498
1530
|
};
|
|
1499
|
-
let
|
|
1500
|
-
const
|
|
1501
|
-
if (
|
|
1531
|
+
let oe = 0, J = !1;
|
|
1532
|
+
const ae = async (p, d, y, E) => {
|
|
1533
|
+
if (Z(d))
|
|
1502
1534
|
return;
|
|
1503
|
-
const
|
|
1504
|
-
if (
|
|
1505
|
-
if (!
|
|
1506
|
-
|
|
1507
|
-
const [,
|
|
1508
|
-
if (
|
|
1509
|
-
const
|
|
1510
|
-
if (
|
|
1511
|
-
const
|
|
1535
|
+
const k = T && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(d);
|
|
1536
|
+
if (k) {
|
|
1537
|
+
if (!J) {
|
|
1538
|
+
J = !0, setTimeout(() => J = !1, 500);
|
|
1539
|
+
const [, F, q] = k, ee = await p.resolve(F, y);
|
|
1540
|
+
if (ee) {
|
|
1541
|
+
const le = p.environment.moduleGraph.getModuleById(ee.id)?.file;
|
|
1542
|
+
if (le) {
|
|
1543
|
+
const Y = `${le}${q}`;
|
|
1512
1544
|
try {
|
|
1513
|
-
console.warn(`Opening in editor: ${
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1516
|
-
} catch (
|
|
1517
|
-
console.error(`Failed to open editor: ${
|
|
1545
|
+
console.warn(`Opening in editor: ${Y}`);
|
|
1546
|
+
const ce = (await import("launch-editor")).default;
|
|
1547
|
+
ce(Y);
|
|
1548
|
+
} catch (ce) {
|
|
1549
|
+
console.error(`Failed to open editor: ${ce.message}`);
|
|
1518
1550
|
}
|
|
1519
1551
|
}
|
|
1520
1552
|
}
|
|
1521
1553
|
}
|
|
1522
1554
|
return { id: "\0editor" };
|
|
1523
1555
|
}
|
|
1524
|
-
const
|
|
1525
|
-
|
|
1526
|
-
const
|
|
1527
|
-
if (
|
|
1528
|
-
const
|
|
1529
|
-
|
|
1556
|
+
const m = oe++, O = _(p, E);
|
|
1557
|
+
P(`resolveId(${m})`, `begin ${d} | ${O ? "server" : "client"} | ${y}`);
|
|
1558
|
+
const $ = y && pe(y);
|
|
1559
|
+
if (y = $ && H($.pathId), d.startsWith(".") && $) {
|
|
1560
|
+
const F = C(), q = F.dirname($.pathId);
|
|
1561
|
+
q && (d = F.resolve(q, d));
|
|
1530
1562
|
}
|
|
1531
|
-
const
|
|
1563
|
+
const R = pe(d), D = H(R.pathId);
|
|
1532
1564
|
let N;
|
|
1533
|
-
if (
|
|
1565
|
+
if (T && E?.scan || j(D, y, O), /**
|
|
1534
1566
|
* Check if we know the QRL. During regular builds, we'll encounter and build parents before
|
|
1535
1567
|
* their QRLs, so this will always match.
|
|
1536
1568
|
*/
|
|
1537
1569
|
s.get(D))
|
|
1538
|
-
|
|
1539
|
-
id: D +
|
|
1570
|
+
P(`resolveId(${m}) Resolved already known ${D}`), N = {
|
|
1571
|
+
id: D + R.query,
|
|
1540
1572
|
moduleSideEffects: !1
|
|
1541
1573
|
};
|
|
1542
1574
|
else if (
|
|
@@ -1545,152 +1577,158 @@ function dn(t = {}) {
|
|
|
1545
1577
|
* been transformed yet.
|
|
1546
1578
|
*/
|
|
1547
1579
|
// We test with endsWith because the dev server adds the base pathname
|
|
1548
|
-
D.endsWith(
|
|
1580
|
+
D.endsWith(re)
|
|
1549
1581
|
)
|
|
1550
|
-
o.resolveQwikBuild && (
|
|
1551
|
-
id:
|
|
1582
|
+
o.resolveQwikBuild && (P(`resolveId(${m})`, "Resolved", re), N = {
|
|
1583
|
+
id: re,
|
|
1552
1584
|
moduleSideEffects: !1
|
|
1553
1585
|
});
|
|
1554
|
-
else if (D.endsWith(
|
|
1586
|
+
else if (D.endsWith(ne))
|
|
1555
1587
|
console.error(
|
|
1556
|
-
`${
|
|
1557
|
-
),
|
|
1558
|
-
id:
|
|
1588
|
+
`${y ? `${y}: ` : ""}importing ${ne} is deprecated. Use \`getClientManifest()\` instead.`
|
|
1589
|
+
), P(`resolveId(${m})`, "Resolved", ne), N = {
|
|
1590
|
+
id: ne,
|
|
1559
1591
|
moduleSideEffects: !1
|
|
1560
1592
|
};
|
|
1561
|
-
else if (!
|
|
1562
|
-
|
|
1563
|
-
const
|
|
1593
|
+
else if (!T && !O && D.endsWith(Ye)) {
|
|
1594
|
+
P(`resolveId(${m})`, "Resolved", Ye);
|
|
1595
|
+
const F = await p.resolve(Ye, y, {
|
|
1564
1596
|
skipSelf: !0
|
|
1565
1597
|
});
|
|
1566
|
-
if (
|
|
1567
|
-
return
|
|
1568
|
-
id:
|
|
1598
|
+
if (F)
|
|
1599
|
+
return p.emitFile({
|
|
1600
|
+
id: F.id,
|
|
1569
1601
|
type: "chunk",
|
|
1570
1602
|
preserveSignature: "allow-extension"
|
|
1571
|
-
}),
|
|
1572
|
-
} else if (D.endsWith(
|
|
1573
|
-
|
|
1574
|
-
id:
|
|
1603
|
+
}), F;
|
|
1604
|
+
} else if (D.endsWith(Ee))
|
|
1605
|
+
P(`resolveId(${m})`, "Resolved", Ee), N = {
|
|
1606
|
+
id: Ee,
|
|
1575
1607
|
moduleSideEffects: !1
|
|
1576
1608
|
};
|
|
1577
1609
|
else {
|
|
1578
|
-
if (
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1610
|
+
if (!O && M && d.endsWith("@qwik.dev/core")) {
|
|
1611
|
+
M = !1;
|
|
1612
|
+
const q = await p.resolve("@qwik.dev/core/handlers.mjs", y, {
|
|
1581
1613
|
skipSelf: !0
|
|
1582
1614
|
});
|
|
1583
|
-
if (!
|
|
1615
|
+
if (!q)
|
|
1584
1616
|
throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
|
|
1585
|
-
|
|
1586
|
-
id:
|
|
1617
|
+
p.emitFile({
|
|
1618
|
+
id: q.id,
|
|
1587
1619
|
type: "chunk",
|
|
1588
1620
|
preserveSignature: "allow-extension"
|
|
1589
1621
|
});
|
|
1590
1622
|
}
|
|
1591
|
-
const
|
|
1592
|
-
if (
|
|
1593
|
-
const { parent:
|
|
1594
|
-
if (
|
|
1595
|
-
const
|
|
1596
|
-
|
|
1597
|
-
id:
|
|
1623
|
+
const F = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(d)?.groups;
|
|
1624
|
+
if (F) {
|
|
1625
|
+
const { parent: q, name: ee, query: De } = F, le = await p.resolve(q, y, { skipSelf: !0 });
|
|
1626
|
+
if (le) {
|
|
1627
|
+
const Y = le.id.split("?")[0], be = T && y?.endsWith(".html") ? `${Y}_${ee}.js` : D;
|
|
1628
|
+
P(`resolveId(${m})`, `resolved to QRL ${ee} of ${Y}`), s.set(be, Y), N = {
|
|
1629
|
+
id: be + De,
|
|
1598
1630
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
1599
1631
|
moduleSideEffects: !1
|
|
1600
1632
|
};
|
|
1601
1633
|
} else
|
|
1602
|
-
console.error(`resolveId(${
|
|
1603
|
-
} else if (
|
|
1604
|
-
const
|
|
1605
|
-
if (
|
|
1606
|
-
return
|
|
1634
|
+
console.error(`resolveId(${m})`, `QRL parent ${q} does not exist!`);
|
|
1635
|
+
} else if (y) {
|
|
1636
|
+
const q = s.get(y);
|
|
1637
|
+
if (q)
|
|
1638
|
+
return P(`resolveId(${m}) end`, `resolving via ${q}`), p.resolve(d, q, { skipSelf: !0 });
|
|
1607
1639
|
}
|
|
1608
1640
|
}
|
|
1609
|
-
return
|
|
1641
|
+
return P(`resolveId(${m}) end`, N?.id || N), N;
|
|
1610
1642
|
};
|
|
1611
|
-
let
|
|
1612
|
-
const
|
|
1613
|
-
if (
|
|
1643
|
+
let bn = 0;
|
|
1644
|
+
const yn = async (p, d, y) => {
|
|
1645
|
+
if (d === "\0editor")
|
|
1614
1646
|
return '"opening in editor"';
|
|
1615
|
-
if (
|
|
1647
|
+
if (Z(d))
|
|
1616
1648
|
return;
|
|
1617
|
-
const
|
|
1618
|
-
if (
|
|
1649
|
+
const E = bn++, k = _(p, y), m = pe(d), O = H(m.pathId);
|
|
1650
|
+
if (j(O, void 0, k), d.startsWith("/@fs/"))
|
|
1619
1651
|
return;
|
|
1620
|
-
if (o.resolveQwikBuild &&
|
|
1621
|
-
return
|
|
1652
|
+
if (o.resolveQwikBuild && d === re)
|
|
1653
|
+
return P(`load(${E})`, re, o.buildMode), {
|
|
1622
1654
|
moduleSideEffects: !1,
|
|
1623
|
-
code:
|
|
1655
|
+
code: bt(k, o.target)
|
|
1624
1656
|
};
|
|
1625
|
-
if (
|
|
1626
|
-
return
|
|
1657
|
+
if (d === ne)
|
|
1658
|
+
return P(`load(${E})`, ne, o.buildMode), {
|
|
1627
1659
|
moduleSideEffects: !1,
|
|
1628
1660
|
code: `import { getClientManifest } from '@qwik.dev/core'; export const manifest = getClientManifest();
|
|
1629
1661
|
`
|
|
1630
1662
|
};
|
|
1631
|
-
if (
|
|
1632
|
-
return
|
|
1663
|
+
if (d === Ee)
|
|
1664
|
+
return P(`load(${E})`, Ee, o.buildMode), {
|
|
1633
1665
|
moduleSideEffects: !1,
|
|
1634
1666
|
code: "export * from '@qwik.dev/core';"
|
|
1635
1667
|
};
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1638
|
-
if (
|
|
1639
|
-
const D = s.get(
|
|
1668
|
+
d = O;
|
|
1669
|
+
const $ = k ? i : r;
|
|
1670
|
+
if (T && !$.has(d)) {
|
|
1671
|
+
const D = s.get(d);
|
|
1640
1672
|
if (D) {
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1673
|
+
P(`load(${E})`, "transforming QRL parent", D);
|
|
1674
|
+
const N = T.moduleGraph.getModuleById(D);
|
|
1675
|
+
if (N)
|
|
1676
|
+
await T.transformRequest(N.url);
|
|
1677
|
+
else
|
|
1678
|
+
try {
|
|
1679
|
+
await T.transformRequest(D);
|
|
1680
|
+
} catch (F) {
|
|
1681
|
+
console.error(`load(${E})`, `could not transform QRL parent ${D}:`, F);
|
|
1682
|
+
}
|
|
1683
|
+
if (!$.has(d))
|
|
1684
|
+
return P(`load(${E})`, `QRL segment ${d} not found in ${D}`), null;
|
|
1647
1685
|
}
|
|
1648
1686
|
}
|
|
1649
|
-
const
|
|
1650
|
-
if (
|
|
1651
|
-
|
|
1652
|
-
let { code: D } =
|
|
1653
|
-
const { map: N, segment:
|
|
1654
|
-
if (
|
|
1655
|
-
const
|
|
1687
|
+
const R = $.get(d);
|
|
1688
|
+
if (R) {
|
|
1689
|
+
P(`load(${E})`, "Found", d);
|
|
1690
|
+
let { code: D } = R[0];
|
|
1691
|
+
const { map: N, segment: F } = R[0], q = R[1];
|
|
1692
|
+
if (T?.hot && q && o.devTools.hmr && F?.ctxName !== "worker$") {
|
|
1693
|
+
const ee = q.startsWith(o.rootDir) ? q.slice(o.rootDir.length) : q;
|
|
1656
1694
|
D += `
|
|
1657
|
-
if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(
|
|
1695
|
+
if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(ee)}], t: document.__hmrT}}));});}`;
|
|
1658
1696
|
}
|
|
1659
|
-
return { code: D, map: N, meta: { segment:
|
|
1697
|
+
return { code: D, map: N, meta: { segment: F } };
|
|
1660
1698
|
}
|
|
1661
|
-
return
|
|
1699
|
+
return P(`load(${E})`, "Not a QRL or virtual module", d), null;
|
|
1662
1700
|
};
|
|
1663
|
-
let
|
|
1664
|
-
const
|
|
1665
|
-
if (
|
|
1701
|
+
let $e, xn = 0;
|
|
1702
|
+
const kn = async function(p, d, y, E = {}) {
|
|
1703
|
+
if (Z(y))
|
|
1666
1704
|
return;
|
|
1667
|
-
const
|
|
1668
|
-
if (
|
|
1705
|
+
const k = _(p, E), m = k ? i : r;
|
|
1706
|
+
if (m.has(y))
|
|
1669
1707
|
return;
|
|
1670
|
-
let
|
|
1671
|
-
const
|
|
1672
|
-
F
|
|
1673
|
-
const
|
|
1674
|
-
let
|
|
1675
|
-
const
|
|
1676
|
-
if (
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1679
|
-
`transform(${
|
|
1680
|
-
`Transforming ${
|
|
1708
|
+
let O = !1;
|
|
1709
|
+
const $ = xn++, R = v(), D = C(), { pathId: N } = pe(y), F = H(N);
|
|
1710
|
+
j(F, void 0, k);
|
|
1711
|
+
const q = D.parse(N), ee = q.dir, De = q.base, le = q.ext.toLowerCase();
|
|
1712
|
+
let Y, ce;
|
|
1713
|
+
const be = o.target === "lib" ? "lib" : o.buildMode === "development" ? T?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
|
|
1714
|
+
if (be !== "lib" && (d = d.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (X, he) => (O = !0, o.experimental?.[he] ? "true" : "false"))), le in At || lt.test(N)) {
|
|
1715
|
+
const X = o.target === "client" || o.target === "ssr";
|
|
1716
|
+
P(
|
|
1717
|
+
`transform(${$})`,
|
|
1718
|
+
`Transforming ${y} (for: ${k ? "server" : "client"}${X ? ", strip" : ""})`
|
|
1681
1719
|
);
|
|
1682
|
-
let
|
|
1683
|
-
o.srcDir && (
|
|
1684
|
-
const
|
|
1685
|
-
let
|
|
1686
|
-
const
|
|
1687
|
-
if (
|
|
1688
|
-
const z =
|
|
1689
|
-
V.startsWith(z) && (
|
|
1720
|
+
let he = De;
|
|
1721
|
+
o.srcDir && (he = D.relative(o.srcDir, N)), he = H(he);
|
|
1722
|
+
const ye = o.srcDir ? o.srcDir : H(ee), yt = o.entryStrategy;
|
|
1723
|
+
let te;
|
|
1724
|
+
const xt = p.environment?.moduleGraph ?? T?.moduleGraph;
|
|
1725
|
+
if (xt && (te = xt.getModuleById(N)?.url, !te && o.rootDir)) {
|
|
1726
|
+
const z = H(o.rootDir), V = H(N);
|
|
1727
|
+
V.startsWith(z) && (te = V.slice(z.length), te.startsWith("/") || (te = "/" + te));
|
|
1690
1728
|
}
|
|
1691
|
-
const
|
|
1692
|
-
input: [{ code:
|
|
1693
|
-
entryStrategy:
|
|
1729
|
+
const de = {
|
|
1730
|
+
input: [{ code: d, path: he, devPath: te }],
|
|
1731
|
+
entryStrategy: k ? { type: "hoist" } : yt,
|
|
1694
1732
|
minify: "simplify",
|
|
1695
1733
|
// Always enable sourcemaps in dev for click-to-source
|
|
1696
1734
|
sourceMaps: o.sourcemap || o.buildMode === "development",
|
|
@@ -1698,102 +1736,106 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
|
|
|
1698
1736
|
transpileJsx: !0,
|
|
1699
1737
|
explicitExtensions: !0,
|
|
1700
1738
|
preserveFilenames: !0,
|
|
1701
|
-
srcDir:
|
|
1739
|
+
srcDir: ye,
|
|
1702
1740
|
rootDir: o.rootDir,
|
|
1703
|
-
mode:
|
|
1741
|
+
mode: be,
|
|
1704
1742
|
scope: o.scope || void 0,
|
|
1705
|
-
isServer:
|
|
1743
|
+
isServer: k
|
|
1706
1744
|
};
|
|
1707
|
-
|
|
1708
|
-
const
|
|
1709
|
-
if (
|
|
1710
|
-
const z =
|
|
1711
|
-
for (const V of
|
|
1712
|
-
V.code =
|
|
1745
|
+
X && (k ? (de.stripCtxName = $r, de.stripEventHandlers = !0, de.regCtxName = Tr) : (de.stripCtxName = zt, de.stripExports = qt));
|
|
1746
|
+
const Nn = Date.now(), ue = await R.transformModules(de);
|
|
1747
|
+
if (P(`transform(${$})`, `done in ${Date.now() - Nn}ms`), te) {
|
|
1748
|
+
const z = Cr(te);
|
|
1749
|
+
for (const V of ue.modules)
|
|
1750
|
+
V.code = ln(
|
|
1713
1751
|
V.code,
|
|
1714
1752
|
z
|
|
1715
1753
|
);
|
|
1716
1754
|
}
|
|
1717
|
-
const
|
|
1718
|
-
if (
|
|
1719
|
-
await G(
|
|
1720
|
-
else if (
|
|
1755
|
+
const xe = ue.modules.find((z) => !Ft(z));
|
|
1756
|
+
if (U(k))
|
|
1757
|
+
await G(p, ue, ye, F);
|
|
1758
|
+
else if (L(k) && $t(d)) {
|
|
1721
1759
|
const z = {
|
|
1722
|
-
...
|
|
1723
|
-
entryStrategy:
|
|
1760
|
+
...de,
|
|
1761
|
+
entryStrategy: yt,
|
|
1724
1762
|
isServer: !1
|
|
1725
1763
|
};
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
await
|
|
1729
|
-
|
|
1730
|
-
|
|
1764
|
+
X && (z.stripCtxName = zt, z.stripExports = qt, z.stripEventHandlers = void 0, z.regCtxName = void 0), await G(
|
|
1765
|
+
p,
|
|
1766
|
+
await R.transformModules(z),
|
|
1767
|
+
ye,
|
|
1768
|
+
F,
|
|
1731
1769
|
!0
|
|
1732
1770
|
);
|
|
1733
1771
|
}
|
|
1734
|
-
u(
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1772
|
+
u(ue.diagnostics, R, ye);
|
|
1773
|
+
let kt = [];
|
|
1774
|
+
k && X && (kt = await B(p, xe.imports ?? [], y)), k ? ue.diagnostics.length === 0 && c && c.lint(p, d, y) : n.set(y, ue);
|
|
1775
|
+
const Je = /* @__PURE__ */ new Set();
|
|
1776
|
+
for (const z of ue.modules)
|
|
1777
|
+
if (z !== xe) {
|
|
1778
|
+
const V = H(D.join(ye, z.path));
|
|
1779
|
+
if (P(`transform(${$})`, `segment ${V}`, z.segment.displayName), s.set(V, y), m.set(V, [z, y]), Je.add(V), T) {
|
|
1780
|
+
const Ne = T.moduleGraph.getModuleById(V);
|
|
1781
|
+
Ne && T.moduleGraph.invalidateModule(Ne);
|
|
1742
1782
|
}
|
|
1743
|
-
if (o.target === "client" && !
|
|
1783
|
+
if (o.target === "client" && !T && p.emitFile({
|
|
1744
1784
|
id: V,
|
|
1745
1785
|
type: "chunk",
|
|
1746
1786
|
preserveSignature: "allow-extension"
|
|
1747
1787
|
}), z.segment && l.size > 0)
|
|
1748
|
-
for (const
|
|
1749
|
-
|
|
1788
|
+
for (const Ne of l)
|
|
1789
|
+
Ne(y, z.segment);
|
|
1750
1790
|
}
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1791
|
+
for (const z of kt)
|
|
1792
|
+
Je.add(z);
|
|
1793
|
+
p.addWatchFile(y), d = xe.code, Y = xe.map, ce = {
|
|
1794
|
+
segment: xe.segment,
|
|
1795
|
+
qwikdeps: Array.from(Je)
|
|
1796
|
+
}, O = !0;
|
|
1797
|
+
}
|
|
1798
|
+
if (d.includes(`globalThis.${Pe}`)) {
|
|
1799
|
+
$e === void 0 && ($e = await In(k));
|
|
1800
|
+
const X = new gt(d);
|
|
1801
|
+
X.replace(`!globalThis.${Pe}`, "false"), $e && X.replace(`globalThis.${Pe}`, $e), d = X.toString(), Y ||= X.generateMap({ source: y, includeContent: !1 }), O = !0, P(`transform(${$})`, `Replaced globalThis.${Pe} with manifest input`);
|
|
1802
|
+
}
|
|
1803
|
+
if (O)
|
|
1804
|
+
return Nr(y) && (Y = null), { code: d, map: Y, meta: ce };
|
|
1805
|
+
P(`transform(${$})`, "Not transforming", y);
|
|
1806
|
+
}, wt = (p) => {
|
|
1807
|
+
const d = [], y = {
|
|
1808
|
+
addInjection: (E) => d.push(E)
|
|
1767
1809
|
};
|
|
1768
|
-
return
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1810
|
+
return y.generateManifest = async (E) => {
|
|
1811
|
+
const m = v().sys.path, O = m.resolve(o.rootDir, o.outDir, "build"), $ = (N) => m.relative(O, m.resolve(o.rootDir, o.outDir, N));
|
|
1812
|
+
y.canonPath = $;
|
|
1813
|
+
const R = Array.from(n.values()).flatMap((N) => N.modules).map((N) => N.segment).filter((N) => !!N), D = Bn(
|
|
1814
|
+
m,
|
|
1815
|
+
R,
|
|
1816
|
+
d,
|
|
1817
|
+
p,
|
|
1776
1818
|
o,
|
|
1777
|
-
|
|
1778
|
-
|
|
1819
|
+
P,
|
|
1820
|
+
$
|
|
1779
1821
|
);
|
|
1780
|
-
|
|
1822
|
+
E && Object.assign(D, E);
|
|
1781
1823
|
for (const N of Object.values(D.symbols))
|
|
1782
|
-
N.origin && (N.origin =
|
|
1824
|
+
N.origin && (N.origin = H(N.origin));
|
|
1783
1825
|
for (const N of Object.values(D.bundles))
|
|
1784
1826
|
N.origins && (N.origins = N.origins.sort());
|
|
1785
|
-
return D.manifestHash =
|
|
1786
|
-
},
|
|
1787
|
-
},
|
|
1788
|
-
o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...
|
|
1789
|
-
},
|
|
1790
|
-
console.log(`[QWIK PLUGIN: ${e}]`, ...
|
|
1791
|
-
},
|
|
1792
|
-
u =
|
|
1793
|
-
},
|
|
1794
|
-
function
|
|
1795
|
-
const
|
|
1796
|
-
return
|
|
1827
|
+
return D.manifestHash = On(JSON.stringify(D)), D;
|
|
1828
|
+
}, y;
|
|
1829
|
+
}, Sn = () => o, vt = () => Array.from(r.values()).map((p) => p[0]), P = (...p) => {
|
|
1830
|
+
o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...p);
|
|
1831
|
+
}, En = (...p) => {
|
|
1832
|
+
console.log(`[QWIK PLUGIN: ${e}]`, ...p);
|
|
1833
|
+
}, Cn = (p) => {
|
|
1834
|
+
u = p;
|
|
1835
|
+
}, H = (p) => w(p);
|
|
1836
|
+
function bt(p, d) {
|
|
1837
|
+
const y = o.buildMode === "development";
|
|
1838
|
+
return y ? `// @qwik.dev/core/build
|
|
1797
1839
|
export const isBrowser = /*#__PURE__*/ (() =>
|
|
1798
1840
|
typeof window !== 'undefined' &&
|
|
1799
1841
|
typeof HTMLElement !== 'undefined' &&
|
|
@@ -1802,154 +1844,154 @@ export const isBrowser = /*#__PURE__*/ (() =>
|
|
|
1802
1844
|
export const isServer = !isBrowser;
|
|
1803
1845
|
export const isDev = true;
|
|
1804
1846
|
` : `// @qwik.dev/core/build
|
|
1805
|
-
export const isServer = ${JSON.stringify(
|
|
1806
|
-
export const isBrowser = ${JSON.stringify(!
|
|
1807
|
-
export const isDev = ${JSON.stringify(
|
|
1847
|
+
export const isServer = ${JSON.stringify(p)};
|
|
1848
|
+
export const isBrowser = ${JSON.stringify(!p)};
|
|
1849
|
+
export const isDev = ${JSON.stringify(y)};
|
|
1808
1850
|
`;
|
|
1809
1851
|
}
|
|
1810
|
-
async function
|
|
1811
|
-
if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" &&
|
|
1812
|
-
const
|
|
1813
|
-
let
|
|
1814
|
-
await
|
|
1852
|
+
async function In(p) {
|
|
1853
|
+
if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && b) {
|
|
1854
|
+
const E = C();
|
|
1855
|
+
let k = o.manifestInputPath || E.resolve(o.clientOutDir, Xe);
|
|
1856
|
+
await b.promises.stat(k).catch(() => !1) || (k = E.resolve(o.rootDir, Ut, Xe));
|
|
1815
1857
|
try {
|
|
1816
|
-
const
|
|
1817
|
-
o.manifestInput =
|
|
1818
|
-
} catch (
|
|
1858
|
+
const m = await b.promises.readFile(k, "utf-8");
|
|
1859
|
+
o.manifestInput = Ct(JSON.parse(m)) || null, console.info("Read client manifest from", k);
|
|
1860
|
+
} catch (m) {
|
|
1819
1861
|
console.warn(
|
|
1820
1862
|
`
|
|
1821
1863
|
==========
|
|
1822
|
-
Could not read Qwik client manifest ${
|
|
1864
|
+
Could not read Qwik client manifest ${k}.
|
|
1823
1865
|
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__\`.
|
|
1824
1866
|
Without the manifest, the SSR renderer will not be able to generate event handlers.
|
|
1825
|
-
(${
|
|
1867
|
+
(${m})
|
|
1826
1868
|
==========
|
|
1827
1869
|
`
|
|
1828
1870
|
);
|
|
1829
1871
|
}
|
|
1830
1872
|
}
|
|
1831
|
-
const
|
|
1832
|
-
let
|
|
1833
|
-
return
|
|
1834
|
-
manifestHash:
|
|
1835
|
-
core:
|
|
1836
|
-
preloader:
|
|
1837
|
-
qwikLoader:
|
|
1838
|
-
bundleGraphAsset:
|
|
1839
|
-
injections:
|
|
1840
|
-
mapping:
|
|
1841
|
-
bundleGraph:
|
|
1842
|
-
}),
|
|
1843
|
-
}
|
|
1844
|
-
function
|
|
1845
|
-
o.sourcemap =
|
|
1846
|
-
}
|
|
1847
|
-
function
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1850
|
-
const
|
|
1851
|
-
for (const
|
|
1852
|
-
const { id:
|
|
1853
|
-
if (
|
|
1854
|
-
|
|
1855
|
-
for (const [
|
|
1856
|
-
if (
|
|
1857
|
-
|
|
1858
|
-
const D =
|
|
1859
|
-
D &&
|
|
1873
|
+
const d = p ? o.manifestInput : null;
|
|
1874
|
+
let y = null;
|
|
1875
|
+
return d?.manifestHash && (y = {
|
|
1876
|
+
manifestHash: d.manifestHash,
|
|
1877
|
+
core: d.core,
|
|
1878
|
+
preloader: d.preloader,
|
|
1879
|
+
qwikLoader: d.qwikLoader,
|
|
1880
|
+
bundleGraphAsset: d.bundleGraphAsset,
|
|
1881
|
+
injections: d.injections,
|
|
1882
|
+
mapping: d.mapping,
|
|
1883
|
+
bundleGraph: d.bundleGraph
|
|
1884
|
+
}), y && JSON.stringify(y);
|
|
1885
|
+
}
|
|
1886
|
+
function _n(p) {
|
|
1887
|
+
o.sourcemap = p;
|
|
1888
|
+
}
|
|
1889
|
+
function Tn(p, d) {
|
|
1890
|
+
const y = p.name === "ssr";
|
|
1891
|
+
P("hotUpdate()", d.file, p.name);
|
|
1892
|
+
const E = y ? i : r;
|
|
1893
|
+
for (const k of d.modules) {
|
|
1894
|
+
const { id: m } = k;
|
|
1895
|
+
if (m) {
|
|
1896
|
+
P("hotUpdate()", `invalidate ${m}`), n.delete(m);
|
|
1897
|
+
for (const [O, [$, R]] of E)
|
|
1898
|
+
if (R === m) {
|
|
1899
|
+
P("hotUpdate()", `invalidate ${m} segment ${O}`), E.delete(O);
|
|
1900
|
+
const D = p.moduleGraph.getModuleById(O);
|
|
1901
|
+
D && p.moduleGraph.invalidateModule(D);
|
|
1860
1902
|
}
|
|
1861
1903
|
}
|
|
1862
1904
|
}
|
|
1863
1905
|
}
|
|
1864
|
-
const
|
|
1906
|
+
const $n = (p, { getModuleInfo: d }) => {
|
|
1865
1907
|
if (o.target === "client") {
|
|
1866
1908
|
if (
|
|
1867
1909
|
// The preloader has to stay in a separate chunk if it's a client build
|
|
1868
|
-
|
|
1910
|
+
p.endsWith("@qwik.dev/core/build") || /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(p)
|
|
1869
1911
|
)
|
|
1870
1912
|
return "qwik-preloader";
|
|
1871
1913
|
if (
|
|
1872
1914
|
// likewise, core and handlers have to be in the same chunk so there's no import waterfall
|
|
1873
|
-
/[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(
|
|
1915
|
+
/[/\\](core|qwik)[/\\](handlers|dist[/\\]core(\.prod|\.min)?)\.[cm]js$/.test(p)
|
|
1874
1916
|
)
|
|
1875
1917
|
return "qwik-core";
|
|
1876
|
-
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(
|
|
1918
|
+
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(p))
|
|
1877
1919
|
return "qwik-loader";
|
|
1878
1920
|
}
|
|
1879
|
-
const
|
|
1880
|
-
if (
|
|
1881
|
-
const
|
|
1882
|
-
if (
|
|
1883
|
-
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(
|
|
1921
|
+
const y = d(p);
|
|
1922
|
+
if (y) {
|
|
1923
|
+
const E = y.meta.segment;
|
|
1924
|
+
if (E) {
|
|
1925
|
+
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(E.ctxName))
|
|
1884
1926
|
return null;
|
|
1885
|
-
const { hash:
|
|
1886
|
-
if (
|
|
1887
|
-
return
|
|
1927
|
+
const { hash: k } = E, m = o.entryStrategy.manual?.[k] || E.entry;
|
|
1928
|
+
if (m)
|
|
1929
|
+
return m;
|
|
1888
1930
|
}
|
|
1889
1931
|
}
|
|
1890
1932
|
return null;
|
|
1891
1933
|
};
|
|
1892
|
-
async function
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1895
|
-
...
|
|
1896
|
-
rollup:
|
|
1897
|
-
env:
|
|
1898
|
-
os:
|
|
1899
|
-
},
|
|
1900
|
-
const
|
|
1934
|
+
async function Dn(p, d, y, E) {
|
|
1935
|
+
const m = await wt(d).generateManifest(E);
|
|
1936
|
+
m.platform = {
|
|
1937
|
+
...E?.platform,
|
|
1938
|
+
rollup: p.meta?.rollupVersion || "",
|
|
1939
|
+
env: I.sys.env,
|
|
1940
|
+
os: I.sys.os
|
|
1941
|
+
}, I.sys.env === "node" && (m.platform.node = process.versions.node);
|
|
1942
|
+
const O = Ln(m, y), $ = p.emitFile({
|
|
1901
1943
|
type: "asset",
|
|
1902
1944
|
name: "bundle-graph.json",
|
|
1903
|
-
source: JSON.stringify(
|
|
1904
|
-
}),
|
|
1905
|
-
|
|
1945
|
+
source: JSON.stringify(O)
|
|
1946
|
+
}), R = p.getFileName($);
|
|
1947
|
+
m.bundleGraphAsset = R, m.assets[R] = {
|
|
1906
1948
|
name: "bundle-graph.json",
|
|
1907
|
-
size:
|
|
1949
|
+
size: O.length
|
|
1908
1950
|
};
|
|
1909
|
-
const D = JSON.stringify(
|
|
1910
|
-
return
|
|
1911
|
-
fileName:
|
|
1951
|
+
const D = JSON.stringify(m, null, " ");
|
|
1952
|
+
return p.emitFile({
|
|
1953
|
+
fileName: Xe,
|
|
1912
1954
|
type: "asset",
|
|
1913
1955
|
source: D
|
|
1914
|
-
}), typeof o.manifestOutput == "function" && await o.manifestOutput(
|
|
1956
|
+
}), typeof o.manifestOutput == "function" && await o.manifestOutput(m), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(vt()), m;
|
|
1915
1957
|
}
|
|
1916
1958
|
return {
|
|
1917
|
-
buildStart:
|
|
1918
|
-
createOutputAnalyzer:
|
|
1919
|
-
getQwikBuildModule:
|
|
1920
|
-
getOptimizer:
|
|
1921
|
-
getOptions:
|
|
1922
|
-
getPath:
|
|
1923
|
-
getSys:
|
|
1924
|
-
getTransformedOutputs:
|
|
1925
|
-
init:
|
|
1926
|
-
load:
|
|
1927
|
-
debug:
|
|
1928
|
-
log:
|
|
1929
|
-
normalizeOptions:
|
|
1930
|
-
normalizePath:
|
|
1931
|
-
onDiagnostics:
|
|
1932
|
-
resolveId:
|
|
1959
|
+
buildStart: S,
|
|
1960
|
+
createOutputAnalyzer: wt,
|
|
1961
|
+
getQwikBuildModule: bt,
|
|
1962
|
+
getOptimizer: v,
|
|
1963
|
+
getOptions: Sn,
|
|
1964
|
+
getPath: C,
|
|
1965
|
+
getSys: x,
|
|
1966
|
+
getTransformedOutputs: vt,
|
|
1967
|
+
init: f,
|
|
1968
|
+
load: yn,
|
|
1969
|
+
debug: P,
|
|
1970
|
+
log: En,
|
|
1971
|
+
normalizeOptions: Te,
|
|
1972
|
+
normalizePath: H,
|
|
1973
|
+
onDiagnostics: Cn,
|
|
1974
|
+
resolveId: ae,
|
|
1933
1975
|
segmentCallbacks: l,
|
|
1934
|
-
transform:
|
|
1935
|
-
validateSource:
|
|
1936
|
-
setSourceMapSupport:
|
|
1937
|
-
configureServer:
|
|
1938
|
-
hotUpdate:
|
|
1939
|
-
manualChunks:
|
|
1940
|
-
generateManifest:
|
|
1976
|
+
transform: kn,
|
|
1977
|
+
validateSource: g,
|
|
1978
|
+
setSourceMapSupport: _n,
|
|
1979
|
+
configureServer: W,
|
|
1980
|
+
hotUpdate: Tn,
|
|
1981
|
+
manualChunks: $n,
|
|
1982
|
+
generateManifest: Dn
|
|
1941
1983
|
};
|
|
1942
1984
|
}
|
|
1943
|
-
const
|
|
1944
|
-
function
|
|
1985
|
+
const Dr = (t) => (e) => typeof e == "string" ? ir(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
|
|
1986
|
+
function Ft(t) {
|
|
1945
1987
|
return t.isEntry || t.segment;
|
|
1946
1988
|
}
|
|
1947
|
-
const
|
|
1989
|
+
const Nr = (t) => t.startsWith("virtual:"), At = {
|
|
1948
1990
|
".jsx": !0,
|
|
1949
1991
|
".ts": !0,
|
|
1950
1992
|
".tsx": !0
|
|
1951
|
-
},
|
|
1952
|
-
async function
|
|
1993
|
+
}, lt = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", ve = "@qwik.dev/core/internal", re = "@qwik.dev/core/build", ct = "@qwik.dev/core/jsx-runtime", dt = "@qwik.dev/core/jsx-dev-runtime", Oe = "@qwik.dev/core/server", ne = "@qwik-client-manifest", Ye = "@qwik.dev/core/preloader", Ee = "@qwik-handlers", Or = "src", Ut = "dist", Pr = "server", Rr = "lib", Xe = "q-manifest.json", Pe = "__QWIK_MANIFEST__";
|
|
1994
|
+
async function Lr(t, e, n) {
|
|
1953
1995
|
if (t.env === "browsermain" || t.env === "webworker")
|
|
1954
1996
|
return;
|
|
1955
1997
|
const r = await t.dynamicImport("node:fs");
|
|
@@ -1966,8 +2008,8 @@ async function Tr(t, e, n) {
|
|
|
1966
2008
|
i = l;
|
|
1967
2009
|
}
|
|
1968
2010
|
}
|
|
1969
|
-
function
|
|
1970
|
-
const e =
|
|
2011
|
+
function is(t = {}) {
|
|
2012
|
+
const e = un(t.optimizerOptions);
|
|
1971
2013
|
return {
|
|
1972
2014
|
name: "rollup-plugin-qwik",
|
|
1973
2015
|
api: {
|
|
@@ -2003,43 +2045,43 @@ function co(t = {}) {
|
|
|
2003
2045
|
return r.input = l, r;
|
|
2004
2046
|
},
|
|
2005
2047
|
outputOptions(r) {
|
|
2006
|
-
return
|
|
2048
|
+
return ut(
|
|
2049
|
+
e,
|
|
2050
|
+
r,
|
|
2051
|
+
e.getOptions().outDir
|
|
2052
|
+
);
|
|
2007
2053
|
},
|
|
2008
2054
|
async buildStart() {
|
|
2009
2055
|
e.onDiagnostics((r, i, s) => {
|
|
2010
2056
|
r.forEach((l) => {
|
|
2011
2057
|
const a = e.normalizePath(i.sys.path.join(s, l.file));
|
|
2012
|
-
l.category === "error" ? this.error(
|
|
2058
|
+
l.category === "error" ? this.error(He(a, l)) : this.warn(He(a, l));
|
|
2013
2059
|
});
|
|
2014
2060
|
}), await e.buildStart(this);
|
|
2015
2061
|
},
|
|
2016
2062
|
resolveId(r, i) {
|
|
2017
|
-
return
|
|
2063
|
+
return Z(r) ? null : e.resolveId(this, r, i);
|
|
2018
2064
|
},
|
|
2019
2065
|
load(r) {
|
|
2020
|
-
return
|
|
2066
|
+
return Z(r) ? null : e.load(this, r);
|
|
2021
2067
|
},
|
|
2022
2068
|
transform(r, i) {
|
|
2023
|
-
return
|
|
2069
|
+
return Z(i) ? null : e.transform(this, r, i);
|
|
2024
2070
|
},
|
|
2025
2071
|
async generateBundle(r, i) {
|
|
2026
2072
|
e.getOptions().target === "client" && await e.generateManifest(this, i);
|
|
2027
2073
|
}
|
|
2028
2074
|
};
|
|
2029
2075
|
}
|
|
2030
|
-
async function
|
|
2076
|
+
async function Mr(t, e) {
|
|
2031
2077
|
return Array.isArray(e) ? (e.length || e.push({}), await Promise.all(
|
|
2032
|
-
e.map(
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
)) : {
|
|
2037
|
-
...await ht(t, e, n),
|
|
2038
|
-
dir: r || e?.dir
|
|
2039
|
-
};
|
|
2078
|
+
e.map(
|
|
2079
|
+
(n) => ut(t, n)
|
|
2080
|
+
)
|
|
2081
|
+
)) : ut(t, e);
|
|
2040
2082
|
}
|
|
2041
|
-
const
|
|
2042
|
-
const r =
|
|
2083
|
+
const jr = (t) => "", qr = (t) => `${jr()}build/`, zr = (t, e, n) => {
|
|
2084
|
+
const r = qr();
|
|
2043
2085
|
return e.buildMode === "production" && !e.debug ? `${r}q-[hash].js` : (i) => {
|
|
2044
2086
|
if (i.moduleIds?.some((a) => /core\.(prod|min)\.mjs$/.test(a)))
|
|
2045
2087
|
return `${r}core.js`;
|
|
@@ -2049,10 +2091,10 @@ const Dr = (t) => t ? `${t.replace(/\/+$/, "")}/` : "", Nr = (t) => `${Dr(t)}bui
|
|
|
2049
2091
|
return `${r}${l}.js`;
|
|
2050
2092
|
};
|
|
2051
2093
|
};
|
|
2052
|
-
async function
|
|
2094
|
+
async function ut(t, e, n) {
|
|
2053
2095
|
const r = { ...e }, i = t.getOptions(), s = t.getOptimizer(), l = t.manualChunks;
|
|
2054
|
-
r.assetFileNames || (r.assetFileNames =
|
|
2055
|
-
const a =
|
|
2096
|
+
r.assetFileNames || (r.assetFileNames = "assets/[hash]-[name].[ext]");
|
|
2097
|
+
const a = zr("", i, s);
|
|
2056
2098
|
if (i.target === "client") {
|
|
2057
2099
|
r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
|
|
2058
2100
|
const u = r.manualChunks;
|
|
@@ -2061,19 +2103,19 @@ async function ht(t, e, n) {
|
|
|
2061
2103
|
r.manualChunks = u ? (o, w) => u(o, w) || l(o, w) : l;
|
|
2062
2104
|
} else
|
|
2063
2105
|
r.chunkFileNames || (r.chunkFileNames = a);
|
|
2064
|
-
r.dir
|
|
2065
|
-
const c = await
|
|
2106
|
+
!r.dir && n && (r.dir = n), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
2107
|
+
const c = await Lr(s.sys, "rollup", s.sys.cwd());
|
|
2066
2108
|
if (c)
|
|
2067
2109
|
try {
|
|
2068
|
-
const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o),
|
|
2069
|
-
Number.isFinite(
|
|
2070
|
-
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${
|
|
2110
|
+
const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o), b = String(w?.version || ""), [f, v, x] = b.split(".").map((T) => parseInt(T, 10));
|
|
2111
|
+
Number.isFinite(f) && (f > 4 || f === 4 && (v > 52 || v === 52 && (x || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
|
|
2112
|
+
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${b}). 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.`
|
|
2071
2113
|
);
|
|
2072
2114
|
} catch {
|
|
2073
2115
|
}
|
|
2074
2116
|
return r;
|
|
2075
2117
|
}
|
|
2076
|
-
function
|
|
2118
|
+
function He(t, e) {
|
|
2077
2119
|
const n = e.highlights?.[0];
|
|
2078
2120
|
return Object.assign(new Error(e.message), {
|
|
2079
2121
|
id: t,
|
|
@@ -2085,7 +2127,7 @@ function tt(t, e) {
|
|
|
2085
2127
|
stack: ""
|
|
2086
2128
|
});
|
|
2087
2129
|
}
|
|
2088
|
-
const Lr = `"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'"))`, Or = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', Mr = `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)})}`, jr = '[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}', $r = '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)}', Ur = `<style>
|
|
2130
|
+
const Fr = `"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'"))`, Ar = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', Ur = `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)})}`, Br = '[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}', Wr = '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)}', Hr = `<style>
|
|
2089
2131
|
:host {
|
|
2090
2132
|
position: absolute;
|
|
2091
2133
|
border: 1px solid red;
|
|
@@ -2249,13 +2291,13 @@ const Lr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
2249
2291
|
<p class="action-container"></p>
|
|
2250
2292
|
</div>
|
|
2251
2293
|
</dialog>
|
|
2252
|
-
`,
|
|
2253
|
-
async function
|
|
2294
|
+
`, Qr = `vite-error-overlay{--color-bright: rgba(255, 255, 255, .8);--color-yellow: rgba(255, 246, 85, .8);--qwik-dark-blue: #006ce9;--qwik-light-blue: #3ec2f7;--qwik-light-purple: #ac7ff4;--qwik-dark-purple: #713fc2;--yellow: #fff;--purple: var(--color-bright);--red: var(--qwik-light-blue);--vertical-box-spacing: 15px;--box-padding: 20px;--box-margin: 0 0 var(--vertical-box-spacing) 0;--box-background: rgba(0, 0, 0, .5);--box-border-radius: 8px}vite-error-overlay::part(backdrop){background:#020b1199}vite-error-overlay::part(window){background:transparent;border:none;box-shadow:none;box-sizing:border-box;margin:50px auto;max-width:1200px;padding:var(--box-padding);width:90%}vite-error-overlay::part(message){display:flex;flex-direction:column;font-size:1.6rem;line-height:1.7;margin-bottom:30px}vite-error-overlay::part(plugin){font-size:.8rem;font-weight:100}vite-error-overlay::part(file),vite-error-overlay::part(frame),vite-error-overlay::part(stack),vite-error-overlay::part(tip){background:var(--box-background);border-left:5px solid transparent;border-radius:var(--box-border-radius);margin:var(--box-margin);min-height:50px;padding:var(--box-padding);position:relative}vite-error-overlay::part(file){border-left-color:#19b6f6;color:var(--color-bright)}vite-error-overlay::part(frame){border-left-color:var(--color-yellow);color:var(--color-yellow)}vite-error-overlay::part(stack){border-left-color:#ff5722}vite-error-overlay::part(tip){border-top:none;border-left-color:#ac7ff4}vite-error-overlay::part(file):before,vite-error-overlay::part(frame):before,vite-error-overlay::part(stack):before{border-bottom:1px solid #222;color:var(--color-bright);display:block;margin-bottom:15px;padding-bottom:5px;padding-left:30px;font-size:.8rem}vite-error-overlay::part(file):before{content:"File"}vite-error-overlay::part(frame):before{content:"Frame"}vite-error-overlay::part(stack):before{content:"Stack Trace"}vite-error-overlay::part(file):after,vite-error-overlay::part(frame):after,vite-error-overlay::part(stack):after{content:"";display:block;height:20px;position:absolute;left:var(--box-padding);top:var(--box-padding);width:20px}vite-error-overlay::part(file):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EFile-Generic%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='File-Generic'%3E%3Crect id='Rectangle' fill-rule='nonzero' x='0' y='0' width='24' height='24'%3E%3C/rect%3E%3Cpath d='M4 5 C4 3.89543 4.89543 3 6 3 L15.1716 3 C15.702 3 16.2107 3.21071 16.5858 3.58579 L19.4142 6.41421 C19.7893 6.78929 20 7.29799 20 7.82843 L20 19 C20 20.1046 19.1046 21 18 21 L6 21 C4.89543 21 4 20.1046 4 19 L4 5 Z' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3Cpath d='M15 4 L15 6 C15 7.10457 15.8954 8 17 8 L19 8' id='Path' stroke='rgba(255,255,255,0.7)' stroke-width='1' stroke-linecap='round'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E")}vite-error-overlay::part(frame):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15.6602 2.84952H19.1516C20.2555 2.84952 21.1504 3.74444 21.1504 4.84839V8.3398' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M2.84949 8.33981L2.84949 4.8484C2.84949 3.74446 3.74441 2.84953 4.84836 2.84953L8.33977 2.84953' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M21.1505 15.6602L21.1505 19.1516C21.1505 20.2555 20.2556 21.1505 19.1516 21.1505L15.6602 21.1505' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3Cpath d='M8.33984 21.1505L4.84843 21.1505C3.74449 21.1505 2.84956 20.2555 2.84956 19.1516L2.84956 15.6602' stroke='rgba(255,255,255,0.7)' stroke-width='1.69904' stroke-linecap='round'/%3E%3C/svg%3E")}vite-error-overlay::part(stack):after{background-image:url("data:image/svg+xml,%3Csvg width='20px' height='20px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.78 20H9.78C7.98 20 4.58 19.09 4.58 15.64C4.58 12.19 7.98 11.28 9.78 11.28H14.22C14.37 11.28 17.92 11.23 17.92 8.42C17.92 5.61 14.37 5.56 14.22 5.56H9.22C9.02109 5.56 8.83032 5.48098 8.68967 5.34033C8.54902 5.19968 8.47 5.00891 8.47 4.81C8.47 4.61109 8.54902 4.42032 8.68967 4.27967C8.83032 4.13902 9.02109 4.06 9.22 4.06H14.22C16.02 4.06 19.42 4.97 19.42 8.42C19.42 11.87 16.02 12.78 14.22 12.78H9.78C9.63 12.78 6.08 12.83 6.08 15.64C6.08 18.45 9.63 18.5 9.78 18.5H14.78C14.9789 18.5 15.1697 18.579 15.3103 18.7197C15.451 18.8603 15.53 19.0511 15.53 19.25C15.53 19.4489 15.451 19.6397 15.3103 19.7803C15.1697 19.921 14.9789 20 14.78 20Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M6.44 8.31C5.74314 8.30407 5.06363 8.09202 4.48708 7.70056C3.91054 7.30909 3.46276 6.75573 3.20018 6.11021C2.93759 5.46469 2.87195 4.75589 3.01153 4.07312C3.1511 3.39036 3.48965 2.76418 3.9845 2.2735C4.47935 1.78281 5.10837 1.44958 5.79229 1.31579C6.47622 1.182 7.18444 1.25363 7.82771 1.52167C8.47099 1.78971 9.02054 2.24215 9.40711 2.82199C9.79368 3.40182 9.99998 4.08311 10 4.78C10 5.2461 9.90773 5.70759 9.72846 6.13783C9.54919 6.56808 9.28648 6.95856 8.95551 7.28675C8.62453 7.61494 8.23184 7.87433 7.80009 8.04995C7.36834 8.22558 6.90609 8.31396 6.44 8.31ZM6.44 2.75C6.04444 2.75 5.65776 2.86729 5.32886 3.08706C4.99996 3.30682 4.74362 3.61918 4.59224 3.98463C4.44087 4.35008 4.40126 4.75221 4.47843 5.14018C4.5556 5.52814 4.74609 5.8845 5.02579 6.16421C5.3055 6.44391 5.66186 6.6344 6.04982 6.71157C6.43779 6.78874 6.83992 6.74913 7.20537 6.59776C7.57082 6.44638 7.88318 6.19003 8.10294 5.86114C8.32271 5.53224 8.44 5.14556 8.44 4.75C8.44 4.48735 8.38827 4.22728 8.28776 3.98463C8.18725 3.74198 8.03993 3.5215 7.85422 3.33578C7.6685 3.15007 7.44802 3.00275 7.20537 2.90224C6.96272 2.80173 6.70265 2.75 6.44 2.75Z' fill='rgba(255,255,255,0.7)'/%3E%3Cpath d='M17.56 22.75C16.8614 22.752 16.1779 22.5466 15.5961 22.1599C15.0143 21.7733 14.5603 21.2227 14.2916 20.5778C14.0229 19.933 13.9515 19.2229 14.0866 18.5375C14.2217 17.8521 14.5571 17.2221 15.0504 16.7275C15.5437 16.2328 16.1726 15.8956 16.8577 15.7586C17.5427 15.6215 18.253 15.6909 18.8986 15.9577C19.5442 16.2246 20.0961 16.6771 20.4844 17.2578C20.8727 17.8385 21.08 18.5214 21.08 19.22C21.08 20.1545 20.7095 21.0508 20.0496 21.7125C19.3898 22.3743 18.4945 22.7473 17.56 22.75ZM17.56 17.19C17.1644 17.19 16.7778 17.3073 16.4489 17.5271C16.12 17.7468 15.8636 18.0592 15.7122 18.4246C15.5609 18.7901 15.5213 19.1922 15.5984 19.5802C15.6756 19.9681 15.8661 20.3245 16.1458 20.6042C16.4255 20.8839 16.7819 21.0744 17.1698 21.1516C17.5578 21.2287 17.9599 21.1891 18.3254 21.0377C18.6908 20.8864 19.0032 20.63 19.2229 20.3011C19.4427 19.9722 19.56 19.5856 19.56 19.19C19.56 18.6596 19.3493 18.1508 18.9742 17.7758C18.5991 17.4007 18.0904 17.19 17.56 17.19Z' fill='rgba(255,255,255,0.7)'/%3E%3C/svg%3E")}vite-error-overlay::part(tip):before{content:"Not sure how to solve this? Visit https://qwik.dev or connect with the community on Discord.";display:block;margin-bottom:1em}`, Gr = "#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}}";
|
|
2295
|
+
async function Kr(t, e, n, r) {
|
|
2254
2296
|
const i = await n.dynamicImport("node:fs"), s = await n.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
|
|
2255
2297
|
(c) => r.join(e, `entry.preview.${c}`)
|
|
2256
2298
|
).find((c) => i.existsSync(c));
|
|
2257
2299
|
if (!a)
|
|
2258
|
-
return
|
|
2300
|
+
return Ze(
|
|
2259
2301
|
t,
|
|
2260
2302
|
`Unable to find output "${e}/entry.preview" module.
|
|
2261
2303
|
|
|
@@ -2265,16 +2307,16 @@ Please ensure "src/entry.preview.tsx" has been built before the "preview" comman
|
|
|
2265
2307
|
const c = s.pathToFileURL(a).href, u = await n.strictDynamicImport(c);
|
|
2266
2308
|
let o = null;
|
|
2267
2309
|
if (u.default && (typeof u.default == "function" ? o = u.default : typeof u.default == "object" && (o = u.default.router)), typeof o != "function")
|
|
2268
|
-
return
|
|
2310
|
+
return Ze(
|
|
2269
2311
|
t,
|
|
2270
2312
|
`Entry preview module "${a}" does not export a default middleware function`
|
|
2271
2313
|
);
|
|
2272
2314
|
t.use(o);
|
|
2273
2315
|
} catch (c) {
|
|
2274
|
-
return
|
|
2316
|
+
return Ze(t, String(c));
|
|
2275
2317
|
}
|
|
2276
2318
|
}
|
|
2277
|
-
function
|
|
2319
|
+
function Ze(t, e) {
|
|
2278
2320
|
console.log(`
|
|
2279
2321
|
❌ ${e}
|
|
2280
2322
|
`), t.use((n, r) => {
|
|
@@ -2283,25 +2325,25 @@ function ot(t, e) {
|
|
|
2283
2325
|
}), r.end(e);
|
|
2284
2326
|
});
|
|
2285
2327
|
}
|
|
2286
|
-
const
|
|
2328
|
+
const Vr = (t, e) => {
|
|
2287
2329
|
const n = [
|
|
2288
|
-
{ tag: "style", children:
|
|
2289
|
-
{ tag: "style", children:
|
|
2290
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
2291
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
2330
|
+
{ tag: "style", children: Qr, injectTo: "body" },
|
|
2331
|
+
{ tag: "style", children: Gr, injectTo: "body" },
|
|
2332
|
+
{ tag: "script", attrs: { type: "module" }, children: Ur, injectTo: "body" },
|
|
2333
|
+
{ tag: "script", attrs: { type: "module" }, children: Fr, injectTo: "body" }
|
|
2292
2334
|
];
|
|
2293
2335
|
if ((t.devTools?.imageDevTools ?? !0) && n.push(
|
|
2294
2336
|
{
|
|
2295
2337
|
tag: "style",
|
|
2296
|
-
children:
|
|
2338
|
+
children: Br,
|
|
2297
2339
|
injectTo: "body"
|
|
2298
2340
|
},
|
|
2299
2341
|
{
|
|
2300
2342
|
tag: "script",
|
|
2301
2343
|
attrs: { type: "module" },
|
|
2302
|
-
children:
|
|
2344
|
+
children: Wr.replace(
|
|
2303
2345
|
"globalThis.__TEMPLATE__",
|
|
2304
|
-
JSON.stringify(
|
|
2346
|
+
JSON.stringify(Hr)
|
|
2305
2347
|
),
|
|
2306
2348
|
injectTo: "body"
|
|
2307
2349
|
}
|
|
@@ -2310,658 +2352,574 @@ const Ar = (t, e) => {
|
|
|
2310
2352
|
e.endsWith("/") && (e = e.slice(0, -1)), n.push({
|
|
2311
2353
|
tag: "script",
|
|
2312
2354
|
attrs: { type: "module" },
|
|
2313
|
-
children:
|
|
2355
|
+
children: Ar.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
|
|
2314
2356
|
injectTo: "body"
|
|
2315
2357
|
});
|
|
2316
2358
|
}
|
|
2317
2359
|
return n;
|
|
2318
2360
|
};
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2361
|
+
var Jr = new TextDecoder(), Yr = (t, e = 0, n = t.length) => Jr.decode(t.slice(e, n)), fn = (t, e) => new DataView(t.buffer, t.byteOffset + e), Xr = (t, e = 0) => fn(t, e).getInt32(0, !0), Zr = (t, e = 0) => fn(t, e).getUint32(0, !0), ei = {
|
|
2362
|
+
validate: (t) => Yr(t, 0, 2) === "BM",
|
|
2363
|
+
calculate: (t) => ({
|
|
2364
|
+
height: Math.abs(Xr(t, 22)),
|
|
2365
|
+
width: Zr(t, 18)
|
|
2366
|
+
})
|
|
2367
|
+
};
|
|
2368
|
+
new TextDecoder();
|
|
2369
|
+
var ti = (t, e) => new DataView(t.buffer, t.byteOffset + e), fe = (t, e = 0) => ti(t, e).getUint16(0, !0), ni = 1, ri = 6, ii = 16;
|
|
2370
|
+
function Bt(t, e) {
|
|
2371
|
+
const n = t[e];
|
|
2372
|
+
return n === 0 ? 256 : n;
|
|
2373
|
+
}
|
|
2374
|
+
function Wt(t, e) {
|
|
2375
|
+
const n = ri + e * ii;
|
|
2376
|
+
return {
|
|
2377
|
+
height: Bt(t, n + 1),
|
|
2378
|
+
width: Bt(t, n)
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
var oi = {
|
|
2382
|
+
validate(t) {
|
|
2383
|
+
const e = fe(t, 0), n = fe(t, 4);
|
|
2384
|
+
return e !== 0 || n === 0 ? !1 : fe(t, 2) === ni;
|
|
2385
|
+
},
|
|
2386
|
+
calculate(t) {
|
|
2387
|
+
const e = fe(t, 4), n = Wt(t, 0);
|
|
2388
|
+
if (e === 1) return n;
|
|
2389
|
+
const r = [];
|
|
2390
|
+
for (let i = 0; i < e; i += 1)
|
|
2391
|
+
r.push(Wt(t, i));
|
|
2392
|
+
return {
|
|
2393
|
+
width: n.width,
|
|
2394
|
+
height: n.height,
|
|
2395
|
+
images: r
|
|
2333
2396
|
};
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
const
|
|
2338
|
-
t
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
t
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2397
|
+
}
|
|
2398
|
+
}, si = 2, ai = {
|
|
2399
|
+
validate(t) {
|
|
2400
|
+
const e = fe(t, 0), n = fe(t, 4);
|
|
2401
|
+
return e !== 0 || n === 0 ? !1 : fe(t, 2) === si;
|
|
2402
|
+
},
|
|
2403
|
+
calculate: (t) => oi.calculate(t)
|
|
2404
|
+
};
|
|
2405
|
+
new TextDecoder();
|
|
2406
|
+
var li = (t, e) => new DataView(t.buffer, t.byteOffset + e), et = (t, e = 0) => li(t, e).getUint32(0, !0), ci = {
|
|
2407
|
+
validate: (t) => et(t, 0) === 542327876,
|
|
2408
|
+
calculate: (t) => ({
|
|
2409
|
+
height: et(t, 12),
|
|
2410
|
+
width: et(t, 16)
|
|
2411
|
+
})
|
|
2412
|
+
}, di = new TextDecoder(), ui = (t, e = 0, n = t.length) => di.decode(t.slice(e, n)), fi = (t, e) => new DataView(t.buffer, t.byteOffset + e), Ht = (t, e = 0) => fi(t, e).getUint16(0, !0), hi = /^GIF8[79]a/, pi = {
|
|
2413
|
+
validate: (t) => hi.test(ui(t, 0, 6)),
|
|
2414
|
+
calculate: (t) => ({
|
|
2415
|
+
height: Ht(t, 8),
|
|
2416
|
+
width: Ht(t, 6)
|
|
2417
|
+
})
|
|
2418
|
+
}, gi = new TextDecoder(), Fe = (t, e = 0, n = t.length) => gi.decode(t.slice(e, n)), mi = (t, e) => new DataView(t.buffer, t.byteOffset + e), Ae = (t, e = 0) => mi(t, e).getUint32(0, !1);
|
|
2419
|
+
function wi(t, e) {
|
|
2420
|
+
if (t.length - e < 4) return;
|
|
2421
|
+
const n = Ae(t, e);
|
|
2422
|
+
if (!(t.length - e < n))
|
|
2423
|
+
return {
|
|
2424
|
+
name: Fe(t, 4 + e, 8 + e),
|
|
2425
|
+
offset: e,
|
|
2426
|
+
size: n
|
|
2352
2427
|
};
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2428
|
+
}
|
|
2429
|
+
function me(t, e, n) {
|
|
2430
|
+
for (; n < t.length; ) {
|
|
2431
|
+
const r = wi(t, n);
|
|
2432
|
+
if (!r) break;
|
|
2433
|
+
if (r.name === e) return r;
|
|
2434
|
+
n += r.size > 0 ? r.size : 8;
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
var vi = {
|
|
2438
|
+
avif: "avif",
|
|
2439
|
+
mif1: "heif",
|
|
2440
|
+
msf1: "heif",
|
|
2441
|
+
// heif-sequence
|
|
2442
|
+
heic: "heic",
|
|
2443
|
+
heix: "heic",
|
|
2444
|
+
hevc: "heic",
|
|
2445
|
+
// heic-sequence
|
|
2446
|
+
hevx: "heic"
|
|
2447
|
+
// heic-sequence
|
|
2448
|
+
}, bi = {
|
|
2449
|
+
validate(t) {
|
|
2450
|
+
if (Fe(t, 4, 8) !== "ftyp") return !1;
|
|
2451
|
+
const n = me(t, "ftyp", 0);
|
|
2452
|
+
return n ? Fe(t, n.offset + 8, n.offset + 12) in vi : !1;
|
|
2453
|
+
},
|
|
2454
|
+
calculate(t) {
|
|
2455
|
+
const e = me(t, "meta", 0), n = e && me(t, "iprp", e.offset + 12), r = n && me(t, "ipco", n.offset + 8);
|
|
2456
|
+
if (!r)
|
|
2457
|
+
throw new TypeError("Invalid HEIF, no ipco box found");
|
|
2458
|
+
const i = Fe(t, 8, 12), s = [];
|
|
2459
|
+
let l = r.offset + 8;
|
|
2460
|
+
for (; l < r.offset + r.size; ) {
|
|
2461
|
+
const a = me(t, "ispe", l);
|
|
2462
|
+
if (!a) break;
|
|
2463
|
+
const c = Ae(t, a.offset + 12), u = Ae(t, a.offset + 16), o = me(t, "clap", l);
|
|
2464
|
+
let w = c, b = u;
|
|
2465
|
+
if (o && o.offset < r.offset + r.size) {
|
|
2466
|
+
const f = Ae(t, o.offset + 12);
|
|
2467
|
+
w = c - f;
|
|
2378
2468
|
}
|
|
2469
|
+
s.push({ height: b, width: w }), l = a.offset + a.size;
|
|
2379
2470
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
return Ce.BMP = {
|
|
2389
|
-
validate: (e) => (0, t.toUTF8String)(e, 0, 2) === "BM",
|
|
2390
|
-
calculate: (e) => ({
|
|
2391
|
-
height: Math.abs((0, t.readInt32LE)(e, 22)),
|
|
2392
|
-
width: (0, t.readUInt32LE)(e, 18)
|
|
2393
|
-
})
|
|
2394
|
-
}, Ce;
|
|
2395
|
-
}
|
|
2396
|
-
var Wr = zr();
|
|
2397
|
-
const Hr = /* @__PURE__ */ Q(Wr);
|
|
2398
|
-
var Te = {}, Pe = {}, Ft;
|
|
2399
|
-
function hn() {
|
|
2400
|
-
if (Ft) return Pe;
|
|
2401
|
-
Ft = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.ICO = void 0;
|
|
2402
|
-
const t = K(), e = 1, n = 6, r = 16;
|
|
2403
|
-
function i(l, a) {
|
|
2404
|
-
const c = l[a];
|
|
2405
|
-
return c === 0 ? 256 : c;
|
|
2471
|
+
if (s.length === 0)
|
|
2472
|
+
throw new TypeError("Invalid HEIF, no sizes found");
|
|
2473
|
+
return {
|
|
2474
|
+
width: s[0].width,
|
|
2475
|
+
height: s[0].height,
|
|
2476
|
+
type: i,
|
|
2477
|
+
...s.length > 1 ? { images: s } : {}
|
|
2478
|
+
};
|
|
2406
2479
|
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2480
|
+
}, yi = new TextDecoder(), hn = (t, e = 0, n = t.length) => yi.decode(t.slice(e, n)), xi = (t, e) => new DataView(t.buffer, t.byteOffset + e), pn = (t, e = 0) => xi(t, e).getUint32(0, !1), ki = 8, Si = 4, Ei = 4, Ci = {
|
|
2481
|
+
ICON: 32,
|
|
2482
|
+
"ICN#": 32,
|
|
2483
|
+
// m => 16 x 16
|
|
2484
|
+
"icm#": 16,
|
|
2485
|
+
icm4: 16,
|
|
2486
|
+
icm8: 16,
|
|
2487
|
+
// s => 16 x 16
|
|
2488
|
+
"ics#": 16,
|
|
2489
|
+
ics4: 16,
|
|
2490
|
+
ics8: 16,
|
|
2491
|
+
is32: 16,
|
|
2492
|
+
s8mk: 16,
|
|
2493
|
+
icp4: 16,
|
|
2494
|
+
// l => 32 x 32
|
|
2495
|
+
icl4: 32,
|
|
2496
|
+
icl8: 32,
|
|
2497
|
+
il32: 32,
|
|
2498
|
+
l8mk: 32,
|
|
2499
|
+
icp5: 32,
|
|
2500
|
+
ic11: 32,
|
|
2501
|
+
// h => 48 x 48
|
|
2502
|
+
ich4: 48,
|
|
2503
|
+
ich8: 48,
|
|
2504
|
+
ih32: 48,
|
|
2505
|
+
h8mk: 48,
|
|
2506
|
+
// . => 64 x 64
|
|
2507
|
+
icp6: 64,
|
|
2508
|
+
ic12: 32,
|
|
2509
|
+
// t => 128 x 128
|
|
2510
|
+
it32: 128,
|
|
2511
|
+
t8mk: 128,
|
|
2512
|
+
ic07: 128,
|
|
2513
|
+
// . => 256 x 256
|
|
2514
|
+
ic08: 256,
|
|
2515
|
+
ic13: 256,
|
|
2516
|
+
// . => 512 x 512
|
|
2517
|
+
ic09: 512,
|
|
2518
|
+
ic14: 512,
|
|
2519
|
+
// . => 1024 x 1024
|
|
2520
|
+
ic10: 1024
|
|
2521
|
+
};
|
|
2522
|
+
function Ii(t, e) {
|
|
2523
|
+
const n = e + Ei;
|
|
2524
|
+
return [
|
|
2525
|
+
hn(t, e, n),
|
|
2526
|
+
pn(t, n)
|
|
2527
|
+
];
|
|
2528
|
+
}
|
|
2529
|
+
function _i(t) {
|
|
2530
|
+
const e = Ci[t];
|
|
2531
|
+
return { width: e, height: e, type: t };
|
|
2532
|
+
}
|
|
2533
|
+
var Ti = {
|
|
2534
|
+
validate: (t) => hn(t, 0, 4) === "icns",
|
|
2535
|
+
calculate(t) {
|
|
2536
|
+
const e = t.length, n = pn(t, Si);
|
|
2537
|
+
let r = ki;
|
|
2538
|
+
const i = [];
|
|
2539
|
+
for (; r < n && r < e; ) {
|
|
2540
|
+
const s = Ii(t, r), l = _i(s[0]);
|
|
2541
|
+
i.push(l), r += s[1];
|
|
2542
|
+
}
|
|
2543
|
+
if (i.length === 0)
|
|
2544
|
+
throw new TypeError("Invalid ICNS, no sizes found");
|
|
2409
2545
|
return {
|
|
2410
|
-
|
|
2411
|
-
|
|
2546
|
+
width: i[0].width,
|
|
2547
|
+
height: i[0].height,
|
|
2548
|
+
...i.length > 1 ? { images: i } : {}
|
|
2412
2549
|
};
|
|
2413
2550
|
}
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
return {
|
|
2427
|
-
height: c.height,
|
|
2428
|
-
images: u,
|
|
2429
|
-
width: c.width
|
|
2430
|
-
};
|
|
2431
|
-
}
|
|
2432
|
-
}, Pe;
|
|
2433
|
-
}
|
|
2434
|
-
var At;
|
|
2435
|
-
function Gr() {
|
|
2436
|
-
if (At) return Te;
|
|
2437
|
-
At = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.CUR = void 0;
|
|
2438
|
-
const t = hn(), e = K(), n = 2;
|
|
2439
|
-
return Te.CUR = {
|
|
2440
|
-
validate(r) {
|
|
2441
|
-
const i = (0, e.readUInt16LE)(r, 0), s = (0, e.readUInt16LE)(r, 4);
|
|
2442
|
-
return i !== 0 || s === 0 ? !1 : (0, e.readUInt16LE)(r, 2) === n;
|
|
2443
|
-
},
|
|
2444
|
-
calculate: (r) => t.ICO.calculate(r)
|
|
2445
|
-
}, Te;
|
|
2446
|
-
}
|
|
2447
|
-
var Qr = Gr();
|
|
2448
|
-
const Kr = /* @__PURE__ */ Q(Qr);
|
|
2449
|
-
var De = {}, zt;
|
|
2450
|
-
function Jr() {
|
|
2451
|
-
if (zt) return De;
|
|
2452
|
-
zt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.DDS = void 0;
|
|
2453
|
-
const t = K();
|
|
2454
|
-
return De.DDS = {
|
|
2455
|
-
validate: (e) => (0, t.readUInt32LE)(e, 0) === 542327876,
|
|
2456
|
-
calculate: (e) => ({
|
|
2457
|
-
height: (0, t.readUInt32LE)(e, 12),
|
|
2458
|
-
width: (0, t.readUInt32LE)(e, 16)
|
|
2459
|
-
})
|
|
2460
|
-
}, De;
|
|
2461
|
-
}
|
|
2462
|
-
var Yr = Jr();
|
|
2463
|
-
const Xr = /* @__PURE__ */ Q(Yr);
|
|
2464
|
-
var Ne = {}, Wt;
|
|
2465
|
-
function Zr() {
|
|
2466
|
-
if (Wt) return Ne;
|
|
2467
|
-
Wt = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.GIF = void 0;
|
|
2468
|
-
const t = K(), e = /^GIF8[79]a/;
|
|
2469
|
-
return Ne.GIF = {
|
|
2470
|
-
validate: (n) => e.test((0, t.toUTF8String)(n, 0, 6)),
|
|
2471
|
-
calculate: (n) => ({
|
|
2472
|
-
height: (0, t.readUInt16LE)(n, 8),
|
|
2473
|
-
width: (0, t.readUInt16LE)(n, 6)
|
|
2474
|
-
})
|
|
2475
|
-
}, Ne;
|
|
2476
|
-
}
|
|
2477
|
-
var Vr = Zr();
|
|
2478
|
-
const ei = /* @__PURE__ */ Q(Vr);
|
|
2479
|
-
var Re = {}, Ht;
|
|
2480
|
-
function ti() {
|
|
2481
|
-
if (Ht) return Re;
|
|
2482
|
-
Ht = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.ICNS = void 0;
|
|
2483
|
-
const t = K(), e = 8, n = 4, r = 4, i = {
|
|
2484
|
-
ICON: 32,
|
|
2485
|
-
"ICN#": 32,
|
|
2486
|
-
// m => 16 x 16
|
|
2487
|
-
"icm#": 16,
|
|
2488
|
-
icm4: 16,
|
|
2489
|
-
icm8: 16,
|
|
2490
|
-
// s => 16 x 16
|
|
2491
|
-
"ics#": 16,
|
|
2492
|
-
ics4: 16,
|
|
2493
|
-
ics8: 16,
|
|
2494
|
-
is32: 16,
|
|
2495
|
-
s8mk: 16,
|
|
2496
|
-
icp4: 16,
|
|
2497
|
-
// l => 32 x 32
|
|
2498
|
-
icl4: 32,
|
|
2499
|
-
icl8: 32,
|
|
2500
|
-
il32: 32,
|
|
2501
|
-
l8mk: 32,
|
|
2502
|
-
icp5: 32,
|
|
2503
|
-
ic11: 32,
|
|
2504
|
-
// h => 48 x 48
|
|
2505
|
-
ich4: 48,
|
|
2506
|
-
ich8: 48,
|
|
2507
|
-
ih32: 48,
|
|
2508
|
-
h8mk: 48,
|
|
2509
|
-
// . => 64 x 64
|
|
2510
|
-
icp6: 64,
|
|
2511
|
-
ic12: 32,
|
|
2512
|
-
// t => 128 x 128
|
|
2513
|
-
it32: 128,
|
|
2514
|
-
t8mk: 128,
|
|
2515
|
-
ic07: 128,
|
|
2516
|
-
// . => 256 x 256
|
|
2517
|
-
ic08: 256,
|
|
2518
|
-
ic13: 256,
|
|
2519
|
-
// . => 512 x 512
|
|
2520
|
-
ic09: 512,
|
|
2521
|
-
ic14: 512,
|
|
2522
|
-
// . => 1024 x 1024
|
|
2523
|
-
ic10: 1024
|
|
2551
|
+
};
|
|
2552
|
+
new TextDecoder();
|
|
2553
|
+
var $i = (t, e) => new DataView(t.buffer, t.byteOffset + e), Re = (t, e = 0) => $i(t, e).getUint16(0, !0), Di = 1, Ni = 6, Oi = 16;
|
|
2554
|
+
function Qt(t, e) {
|
|
2555
|
+
const n = t[e];
|
|
2556
|
+
return n === 0 ? 256 : n;
|
|
2557
|
+
}
|
|
2558
|
+
function Gt(t, e) {
|
|
2559
|
+
const n = Ni + e * Oi;
|
|
2560
|
+
return {
|
|
2561
|
+
height: Qt(t, n + 1),
|
|
2562
|
+
width: Qt(t, n)
|
|
2524
2563
|
};
|
|
2525
|
-
function s(a, c) {
|
|
2526
|
-
const u = c + r;
|
|
2527
|
-
return [
|
|
2528
|
-
(0, t.toUTF8String)(a, c, u),
|
|
2529
|
-
(0, t.readUInt32BE)(a, u)
|
|
2530
|
-
];
|
|
2531
|
-
}
|
|
2532
|
-
function l(a) {
|
|
2533
|
-
const c = i[a];
|
|
2534
|
-
return { width: c, height: c, type: a };
|
|
2535
|
-
}
|
|
2536
|
-
return Re.ICNS = {
|
|
2537
|
-
validate: (a) => (0, t.toUTF8String)(a, 0, 4) === "icns",
|
|
2538
|
-
calculate(a) {
|
|
2539
|
-
const c = a.length, u = (0, t.readUInt32BE)(a, n);
|
|
2540
|
-
let o = e, w = s(a, o), v = l(w[0]);
|
|
2541
|
-
if (o += w[1], o === u)
|
|
2542
|
-
return v;
|
|
2543
|
-
const p = {
|
|
2544
|
-
height: v.height,
|
|
2545
|
-
images: [v],
|
|
2546
|
-
width: v.width
|
|
2547
|
-
};
|
|
2548
|
-
for (; o < u && o < c; )
|
|
2549
|
-
w = s(a, o), v = l(w[0]), o += w[1], p.images.push(v);
|
|
2550
|
-
return p;
|
|
2551
|
-
}
|
|
2552
|
-
}, Re;
|
|
2553
|
-
}
|
|
2554
|
-
var ni = ti();
|
|
2555
|
-
const ri = /* @__PURE__ */ Q(ni);
|
|
2556
|
-
var ii = hn();
|
|
2557
|
-
const oi = /* @__PURE__ */ Q(ii);
|
|
2558
|
-
var Le = {}, Gt;
|
|
2559
|
-
function si() {
|
|
2560
|
-
if (Gt) return Le;
|
|
2561
|
-
Gt = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.J2C = void 0;
|
|
2562
|
-
const t = K();
|
|
2563
|
-
return Le.J2C = {
|
|
2564
|
-
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
2565
|
-
validate: (e) => (0, t.readUInt32BE)(e, 0) === 4283432785,
|
|
2566
|
-
calculate: (e) => ({
|
|
2567
|
-
height: (0, t.readUInt32BE)(e, 12),
|
|
2568
|
-
width: (0, t.readUInt32BE)(e, 8)
|
|
2569
|
-
})
|
|
2570
|
-
}, Le;
|
|
2571
|
-
}
|
|
2572
|
-
var ai = si();
|
|
2573
|
-
const li = /* @__PURE__ */ Q(ai);
|
|
2574
|
-
var Oe = {}, Qt;
|
|
2575
|
-
function ci() {
|
|
2576
|
-
if (Qt) return Oe;
|
|
2577
|
-
Qt = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.JP2 = void 0;
|
|
2578
|
-
const t = K();
|
|
2579
|
-
return Oe.JP2 = {
|
|
2580
|
-
validate(e) {
|
|
2581
|
-
if ((0, t.toUTF8String)(e, 4, 8) !== "jP ")
|
|
2582
|
-
return !1;
|
|
2583
|
-
const r = (0, t.findBox)(e, "ftyp", 0);
|
|
2584
|
-
return r ? (0, t.toUTF8String)(e, r.offset + 8, r.offset + 12) === "jp2 " : !1;
|
|
2585
|
-
},
|
|
2586
|
-
calculate(e) {
|
|
2587
|
-
const n = (0, t.findBox)(e, "jp2h", 0), r = n && (0, t.findBox)(e, "ihdr", n.offset + 8);
|
|
2588
|
-
if (r)
|
|
2589
|
-
return {
|
|
2590
|
-
height: (0, t.readUInt32BE)(e, r.offset + 8),
|
|
2591
|
-
width: (0, t.readUInt32BE)(e, r.offset + 12)
|
|
2592
|
-
};
|
|
2593
|
-
throw new TypeError("Unsupported JPEG 2000 format");
|
|
2594
|
-
}
|
|
2595
|
-
}, Oe;
|
|
2596
2564
|
}
|
|
2597
|
-
var
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2565
|
+
var Pi = {
|
|
2566
|
+
validate(t) {
|
|
2567
|
+
const e = Re(t, 0), n = Re(t, 4);
|
|
2568
|
+
return e !== 0 || n === 0 ? !1 : Re(t, 2) === Di;
|
|
2569
|
+
},
|
|
2570
|
+
calculate(t) {
|
|
2571
|
+
const e = Re(t, 4), n = Gt(t, 0);
|
|
2572
|
+
if (e === 1) return n;
|
|
2573
|
+
const r = [];
|
|
2574
|
+
for (let i = 0; i < e; i += 1)
|
|
2575
|
+
r.push(Gt(t, i));
|
|
2608
2576
|
return {
|
|
2609
|
-
|
|
2610
|
-
|
|
2577
|
+
width: n.width,
|
|
2578
|
+
height: n.height,
|
|
2579
|
+
images: r
|
|
2611
2580
|
};
|
|
2612
2581
|
}
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
} : R;
|
|
2651
|
-
}
|
|
2652
|
-
d = d.slice(m + 2);
|
|
2653
|
-
}
|
|
2654
|
-
throw new TypeError("Invalid JPG, no size found");
|
|
2655
|
-
}
|
|
2656
|
-
}, Me;
|
|
2657
|
-
}
|
|
2658
|
-
var fi = hi();
|
|
2659
|
-
const pi = /* @__PURE__ */ Q(fi);
|
|
2660
|
-
var je = {}, Jt;
|
|
2661
|
-
function gi() {
|
|
2662
|
-
if (Jt) return je;
|
|
2663
|
-
Jt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.KTX = void 0;
|
|
2664
|
-
const t = K();
|
|
2665
|
-
return je.KTX = {
|
|
2666
|
-
validate: (e) => {
|
|
2667
|
-
const n = (0, t.toUTF8String)(e, 1, 7);
|
|
2668
|
-
return ["KTX 11", "KTX 20"].includes(n);
|
|
2669
|
-
},
|
|
2670
|
-
calculate: (e) => {
|
|
2671
|
-
const n = e[5] === 49 ? "ktx" : "ktx2", r = n === "ktx" ? 36 : 20;
|
|
2582
|
+
};
|
|
2583
|
+
new TextDecoder();
|
|
2584
|
+
var Ri = (t, e) => new DataView(t.buffer, t.byteOffset + e), tt = (t, e = 0) => Ri(t, e).getUint32(0, !1), Li = {
|
|
2585
|
+
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
2586
|
+
validate: (t) => tt(t, 0) === 4283432785,
|
|
2587
|
+
calculate: (t) => ({
|
|
2588
|
+
height: tt(t, 12),
|
|
2589
|
+
width: tt(t, 8)
|
|
2590
|
+
})
|
|
2591
|
+
}, Mi = new TextDecoder(), ft = (t, e = 0, n = t.length) => Mi.decode(t.slice(e, n)), ji = (t, e) => new DataView(t.buffer, t.byteOffset + e), ht = (t, e = 0) => ji(t, e).getUint32(0, !1);
|
|
2592
|
+
function qi(t, e) {
|
|
2593
|
+
if (t.length - e < 4) return;
|
|
2594
|
+
const n = ht(t, e);
|
|
2595
|
+
if (!(t.length - e < n))
|
|
2596
|
+
return {
|
|
2597
|
+
name: ft(t, 4 + e, 8 + e),
|
|
2598
|
+
offset: e,
|
|
2599
|
+
size: n
|
|
2600
|
+
};
|
|
2601
|
+
}
|
|
2602
|
+
function nt(t, e, n) {
|
|
2603
|
+
for (; n < t.length; ) {
|
|
2604
|
+
const r = qi(t, n);
|
|
2605
|
+
if (!r) break;
|
|
2606
|
+
if (r.name === e) return r;
|
|
2607
|
+
n += r.size > 0 ? r.size : 8;
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
var zi = {
|
|
2611
|
+
validate(t) {
|
|
2612
|
+
if (ft(t, 4, 8) !== "jP ") return !1;
|
|
2613
|
+
const n = nt(t, "ftyp", 0);
|
|
2614
|
+
return n ? ft(t, n.offset + 8, n.offset + 12) === "jp2 " : !1;
|
|
2615
|
+
},
|
|
2616
|
+
calculate(t) {
|
|
2617
|
+
const e = nt(t, "jp2h", 0), n = e && nt(t, "ihdr", e.offset + 8);
|
|
2618
|
+
if (n)
|
|
2672
2619
|
return {
|
|
2673
|
-
height: (
|
|
2674
|
-
width: (
|
|
2675
|
-
type: n
|
|
2620
|
+
height: ht(t, n.offset + 8),
|
|
2621
|
+
width: ht(t, n.offset + 12)
|
|
2676
2622
|
};
|
|
2677
|
-
|
|
2678
|
-
}
|
|
2623
|
+
throw new TypeError("Unsupported JPEG 2000 format");
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2626
|
+
new TextDecoder();
|
|
2627
|
+
var mt = (t, e = 0, n = t.length) => t.slice(e, n).reduce((r, i) => r + `0${i.toString(16)}`.slice(-2), ""), Ve = (t, e) => new DataView(t.buffer, t.byteOffset + e), Qe = (t, e = 0) => Ve(t, e).getUint16(0, !1), Fi = (t, e = 0) => Ve(t, e).getUint16(0, !0), Ai = (t, e = 0) => Ve(t, e).getUint32(0, !1), Ui = (t, e = 0) => Ve(t, e).getUint32(0, !0), Bi = {
|
|
2628
|
+
readUInt16BE: Qe,
|
|
2629
|
+
readUInt16LE: Fi,
|
|
2630
|
+
readUInt32BE: Ai,
|
|
2631
|
+
readUInt32LE: Ui
|
|
2632
|
+
};
|
|
2633
|
+
function Ce(t, e, n = 0, r = !1) {
|
|
2634
|
+
const s = `readUInt${e}${r ? "BE" : "LE"}`;
|
|
2635
|
+
return Bi[s](t, n);
|
|
2679
2636
|
}
|
|
2680
|
-
var
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
}
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
P7: "pam",
|
|
2724
|
-
PF: "pfm"
|
|
2725
|
-
}, n = {
|
|
2726
|
-
default: (r) => {
|
|
2727
|
-
let i = [];
|
|
2728
|
-
for (; r.length > 0; ) {
|
|
2729
|
-
const s = r.shift();
|
|
2730
|
-
if (s[0] !== "#") {
|
|
2731
|
-
i = s.split(" ");
|
|
2732
|
-
break;
|
|
2733
|
-
}
|
|
2637
|
+
var Wi = "45786966", Hi = 2, pt = 6, Qi = 2, Gi = "4d4d", Ki = "4949", Kt = 12, Vi = 2;
|
|
2638
|
+
function Ji(t) {
|
|
2639
|
+
return mt(t, 2, 6) === Wi;
|
|
2640
|
+
}
|
|
2641
|
+
function Yi(t, e) {
|
|
2642
|
+
return {
|
|
2643
|
+
height: Qe(t, e),
|
|
2644
|
+
width: Qe(t, e + 2)
|
|
2645
|
+
};
|
|
2646
|
+
}
|
|
2647
|
+
function Xi(t, e) {
|
|
2648
|
+
const r = pt + 8, i = Ce(t, 16, r, e);
|
|
2649
|
+
for (let s = 0; s < i; s++) {
|
|
2650
|
+
const l = r + Vi + s * Kt, a = l + Kt;
|
|
2651
|
+
if (l > t.length)
|
|
2652
|
+
return;
|
|
2653
|
+
const c = t.slice(l, a);
|
|
2654
|
+
if (Ce(c, 16, 0, e) === 274)
|
|
2655
|
+
return Ce(c, 16, 2, e) !== 3 || Ce(c, 32, 4, e) !== 1 ? void 0 : Ce(c, 16, 8, e);
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
function Zi(t, e) {
|
|
2659
|
+
const n = t.slice(Hi, e), r = mt(
|
|
2660
|
+
n,
|
|
2661
|
+
pt,
|
|
2662
|
+
pt + Qi
|
|
2663
|
+
), i = r === Gi;
|
|
2664
|
+
if (i || r === Ki)
|
|
2665
|
+
return Xi(n, i);
|
|
2666
|
+
}
|
|
2667
|
+
function eo(t, e) {
|
|
2668
|
+
if (e > t.length)
|
|
2669
|
+
throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
2670
|
+
}
|
|
2671
|
+
var to = {
|
|
2672
|
+
validate: (t) => mt(t, 0, 2) === "ffd8",
|
|
2673
|
+
calculate(t) {
|
|
2674
|
+
let e = t.slice(4), n, r;
|
|
2675
|
+
for (; e.length; ) {
|
|
2676
|
+
const i = Qe(e, 0);
|
|
2677
|
+
if (eo(e, i), e[i] !== 255) {
|
|
2678
|
+
e = e.slice(1);
|
|
2679
|
+
continue;
|
|
2734
2680
|
}
|
|
2735
|
-
if (i
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
pam: (r) => {
|
|
2743
|
-
const i = {};
|
|
2744
|
-
for (; r.length > 0; ) {
|
|
2745
|
-
const s = r.shift();
|
|
2746
|
-
if (s.length > 16 || s.charCodeAt(0) > 128)
|
|
2747
|
-
continue;
|
|
2748
|
-
const [l, a] = s.split(" ");
|
|
2749
|
-
if (l && a && (i[l.toLowerCase()] = parseInt(a, 10)), i.height && i.width)
|
|
2750
|
-
break;
|
|
2681
|
+
if (Ji(e) && (n = Zi(e, i)), r = e[i + 1], r === 192 || r === 193 || r === 194) {
|
|
2682
|
+
const s = Yi(e, i + 5);
|
|
2683
|
+
return n ? {
|
|
2684
|
+
height: s.height,
|
|
2685
|
+
orientation: n,
|
|
2686
|
+
width: s.width
|
|
2687
|
+
} : s;
|
|
2751
2688
|
}
|
|
2752
|
-
|
|
2753
|
-
return {
|
|
2754
|
-
height: i.height,
|
|
2755
|
-
width: i.width
|
|
2756
|
-
};
|
|
2757
|
-
throw new TypeError("Invalid PAM");
|
|
2689
|
+
e = e.slice(i + 2);
|
|
2758
2690
|
}
|
|
2759
|
-
|
|
2760
|
-
return Ue.PNM = {
|
|
2761
|
-
validate: (r) => (0, t.toUTF8String)(r, 0, 2) in e,
|
|
2762
|
-
calculate(r) {
|
|
2763
|
-
const i = (0, t.toUTF8String)(r, 0, 2), s = e[i], l = (0, t.toUTF8String)(r, 3).split(/[\r\n]+/);
|
|
2764
|
-
return (n[s] || n.default)(l);
|
|
2765
|
-
}
|
|
2766
|
-
}, Ue;
|
|
2767
|
-
}
|
|
2768
|
-
var Si = xi();
|
|
2769
|
-
const Ei = /* @__PURE__ */ Q(Si);
|
|
2770
|
-
var qe = {}, Zt;
|
|
2771
|
-
function ki() {
|
|
2772
|
-
if (Zt) return qe;
|
|
2773
|
-
Zt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.PSD = void 0;
|
|
2774
|
-
const t = K();
|
|
2775
|
-
return qe.PSD = {
|
|
2776
|
-
validate: (e) => (0, t.toUTF8String)(e, 0, 4) === "8BPS",
|
|
2777
|
-
calculate: (e) => ({
|
|
2778
|
-
height: (0, t.readUInt32BE)(e, 14),
|
|
2779
|
-
width: (0, t.readUInt32BE)(e, 18)
|
|
2780
|
-
})
|
|
2781
|
-
}, qe;
|
|
2782
|
-
}
|
|
2783
|
-
var Ii = ki();
|
|
2784
|
-
const _i = /* @__PURE__ */ Q(Ii);
|
|
2785
|
-
var Be = {}, Vt;
|
|
2786
|
-
function Ci() {
|
|
2787
|
-
if (Vt) return Be;
|
|
2788
|
-
Vt = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.SVG = void 0;
|
|
2789
|
-
const t = K(), e = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, n = {
|
|
2790
|
-
height: /\sheight=(['"])([^%]+?)\1/,
|
|
2791
|
-
root: e,
|
|
2792
|
-
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
2793
|
-
width: /\swidth=(['"])([^%]+?)\1/
|
|
2794
|
-
}, r = 2.54, i = {
|
|
2795
|
-
in: 96,
|
|
2796
|
-
cm: 96 / r,
|
|
2797
|
-
em: 16,
|
|
2798
|
-
ex: 8,
|
|
2799
|
-
m: 96 / r * 100,
|
|
2800
|
-
mm: 96 / r / 10,
|
|
2801
|
-
pc: 96 / 72 / 12,
|
|
2802
|
-
pt: 96 / 72,
|
|
2803
|
-
px: 1
|
|
2804
|
-
}, s = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(i).join("|")})?$`);
|
|
2805
|
-
function l(w) {
|
|
2806
|
-
const v = s.exec(w);
|
|
2807
|
-
if (v)
|
|
2808
|
-
return Math.round(Number(v[1]) * (i[v[2]] || 1));
|
|
2809
|
-
}
|
|
2810
|
-
function a(w) {
|
|
2811
|
-
const v = w.split(" ");
|
|
2812
|
-
return {
|
|
2813
|
-
height: l(v[3]),
|
|
2814
|
-
width: l(v[2])
|
|
2815
|
-
};
|
|
2691
|
+
throw new TypeError("Invalid JPG, no size found");
|
|
2816
2692
|
}
|
|
2817
|
-
|
|
2818
|
-
|
|
2693
|
+
}, no = new TextDecoder(), ro = (t, e = 0, n = t.length) => no.decode(t.slice(e, n)), io = (t, e) => new DataView(t.buffer, t.byteOffset + e), Vt = (t, e = 0) => io(t, e).getUint32(0, !0), oo = {
|
|
2694
|
+
validate: (t) => {
|
|
2695
|
+
const e = ro(t, 1, 7);
|
|
2696
|
+
return ["KTX 11", "KTX 20"].includes(e);
|
|
2697
|
+
},
|
|
2698
|
+
calculate: (t) => {
|
|
2699
|
+
const e = t[5] === 49 ? "ktx" : "ktx2", n = e === "ktx" ? 36 : 20;
|
|
2819
2700
|
return {
|
|
2820
|
-
height:
|
|
2821
|
-
|
|
2822
|
-
|
|
2701
|
+
height: Vt(t, n + 4),
|
|
2702
|
+
width: Vt(t, n),
|
|
2703
|
+
type: e
|
|
2823
2704
|
};
|
|
2824
2705
|
}
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2706
|
+
}, so = new TextDecoder(), Le = (t, e = 0, n = t.length) => so.decode(t.slice(e, n)), ao = (t, e) => new DataView(t.buffer, t.byteOffset + e), Me = (t, e = 0) => ao(t, e).getUint32(0, !1), lo = `PNG\r
|
|
2707
|
+
|
|
2708
|
+
`, co = "IHDR", Jt = "CgBI", uo = {
|
|
2709
|
+
validate(t) {
|
|
2710
|
+
if (lo === Le(t, 1, 8)) {
|
|
2711
|
+
let e = Le(t, 12, 16);
|
|
2712
|
+
if (e === Jt && (e = Le(t, 28, 32)), e !== co)
|
|
2713
|
+
throw new TypeError("Invalid PNG");
|
|
2714
|
+
return !0;
|
|
2715
|
+
}
|
|
2716
|
+
return !1;
|
|
2717
|
+
},
|
|
2718
|
+
calculate(t) {
|
|
2719
|
+
return Le(t, 12, 16) === Jt ? {
|
|
2720
|
+
height: Me(t, 36),
|
|
2721
|
+
width: Me(t, 32)
|
|
2839
2722
|
} : {
|
|
2840
|
-
height:
|
|
2841
|
-
width:
|
|
2723
|
+
height: Me(t, 20),
|
|
2724
|
+
width: Me(t, 16)
|
|
2842
2725
|
};
|
|
2843
2726
|
}
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2727
|
+
}, fo = new TextDecoder(), rt = (t, e = 0, n = t.length) => fo.decode(t.slice(e, n)), Yt = {
|
|
2728
|
+
P1: "pbm/ascii",
|
|
2729
|
+
P2: "pgm/ascii",
|
|
2730
|
+
P3: "ppm/ascii",
|
|
2731
|
+
P4: "pbm",
|
|
2732
|
+
P5: "pgm",
|
|
2733
|
+
P6: "ppm",
|
|
2734
|
+
P7: "pam",
|
|
2735
|
+
PF: "pfm"
|
|
2736
|
+
}, Xt = {
|
|
2737
|
+
default: (t) => {
|
|
2738
|
+
let e = [];
|
|
2739
|
+
for (; t.length > 0; ) {
|
|
2740
|
+
const n = t.shift();
|
|
2741
|
+
if (n[0] !== "#") {
|
|
2742
|
+
e = n.split(" ");
|
|
2743
|
+
break;
|
|
2855
2744
|
}
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
}, Be;
|
|
2859
|
-
}
|
|
2860
|
-
var Ti = Ci();
|
|
2861
|
-
const Pi = /* @__PURE__ */ Q(Ti);
|
|
2862
|
-
var Fe = {}, en;
|
|
2863
|
-
function Di() {
|
|
2864
|
-
if (en) return Fe;
|
|
2865
|
-
en = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.TGA = void 0;
|
|
2866
|
-
const t = K();
|
|
2867
|
-
return Fe.TGA = {
|
|
2868
|
-
validate(e) {
|
|
2869
|
-
return (0, t.readUInt16LE)(e, 0) === 0 && (0, t.readUInt16LE)(e, 4) === 0;
|
|
2870
|
-
},
|
|
2871
|
-
calculate(e) {
|
|
2745
|
+
}
|
|
2746
|
+
if (e.length === 2)
|
|
2872
2747
|
return {
|
|
2873
|
-
height:
|
|
2874
|
-
width:
|
|
2748
|
+
height: Number.parseInt(e[1], 10),
|
|
2749
|
+
width: Number.parseInt(e[0], 10)
|
|
2875
2750
|
};
|
|
2751
|
+
throw new TypeError("Invalid PNM");
|
|
2752
|
+
},
|
|
2753
|
+
pam: (t) => {
|
|
2754
|
+
const e = {};
|
|
2755
|
+
for (; t.length > 0; ) {
|
|
2756
|
+
const n = t.shift();
|
|
2757
|
+
if (n.length > 16 || n.charCodeAt(0) > 128)
|
|
2758
|
+
continue;
|
|
2759
|
+
const [r, i] = n.split(" ");
|
|
2760
|
+
if (r && i && (e[r.toLowerCase()] = Number.parseInt(i, 10)), e.height && e.width)
|
|
2761
|
+
break;
|
|
2876
2762
|
}
|
|
2877
|
-
|
|
2763
|
+
if (e.height && e.width)
|
|
2764
|
+
return {
|
|
2765
|
+
height: e.height,
|
|
2766
|
+
width: e.width
|
|
2767
|
+
};
|
|
2768
|
+
throw new TypeError("Invalid PAM");
|
|
2769
|
+
}
|
|
2770
|
+
}, ho = {
|
|
2771
|
+
validate: (t) => rt(t, 0, 2) in Yt,
|
|
2772
|
+
calculate(t) {
|
|
2773
|
+
const e = rt(t, 0, 2), n = Yt[e], r = rt(t, 3).split(/[\r\n]+/);
|
|
2774
|
+
return (Xt[n] || Xt.default)(r);
|
|
2775
|
+
}
|
|
2776
|
+
}, po = new TextDecoder(), go = (t, e = 0, n = t.length) => po.decode(t.slice(e, n)), mo = (t, e) => new DataView(t.buffer, t.byteOffset + e), Zt = (t, e = 0) => mo(t, e).getUint32(0, !1), wo = {
|
|
2777
|
+
validate: (t) => go(t, 0, 4) === "8BPS",
|
|
2778
|
+
calculate: (t) => ({
|
|
2779
|
+
height: Zt(t, 14),
|
|
2780
|
+
width: Zt(t, 18)
|
|
2781
|
+
})
|
|
2782
|
+
}, vo = new TextDecoder(), en = (t, e = 0, n = t.length) => vo.decode(t.slice(e, n)), gn = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, Ue = {
|
|
2783
|
+
height: /\sheight=(['"])([^%]+?)\1/,
|
|
2784
|
+
root: gn,
|
|
2785
|
+
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
2786
|
+
width: /\swidth=(['"])([^%]+?)\1/
|
|
2787
|
+
}, it = 2.54, mn = {
|
|
2788
|
+
in: 96,
|
|
2789
|
+
cm: 96 / it,
|
|
2790
|
+
em: 16,
|
|
2791
|
+
ex: 8,
|
|
2792
|
+
m: 96 / it * 100,
|
|
2793
|
+
mm: 96 / it / 10,
|
|
2794
|
+
pc: 96 / 72 / 12,
|
|
2795
|
+
pt: 96 / 72,
|
|
2796
|
+
px: 1
|
|
2797
|
+
}, bo = new RegExp(
|
|
2798
|
+
`^([0-9.]+(?:e\\d+)?)(${Object.keys(mn).join("|")})?$`
|
|
2799
|
+
);
|
|
2800
|
+
function Ge(t) {
|
|
2801
|
+
const e = bo.exec(t);
|
|
2802
|
+
if (e)
|
|
2803
|
+
return Math.round(Number(e[1]) * (mn[e[2]] || 1));
|
|
2878
2804
|
}
|
|
2879
|
-
|
|
2880
|
-
const
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2805
|
+
function yo(t) {
|
|
2806
|
+
const e = t.split(" ");
|
|
2807
|
+
return {
|
|
2808
|
+
height: Ge(e[3]),
|
|
2809
|
+
width: Ge(e[2])
|
|
2810
|
+
};
|
|
2811
|
+
}
|
|
2812
|
+
function xo(t) {
|
|
2813
|
+
const e = t.match(Ue.width), n = t.match(Ue.height), r = t.match(Ue.viewbox);
|
|
2814
|
+
return {
|
|
2815
|
+
height: n && Ge(n[2]),
|
|
2816
|
+
viewbox: r && yo(r[2]),
|
|
2817
|
+
width: e && Ge(e[2])
|
|
2818
|
+
};
|
|
2819
|
+
}
|
|
2820
|
+
function ko(t) {
|
|
2821
|
+
return {
|
|
2822
|
+
height: t.height,
|
|
2823
|
+
width: t.width
|
|
2824
|
+
};
|
|
2825
|
+
}
|
|
2826
|
+
function So(t, e) {
|
|
2827
|
+
const n = e.width / e.height;
|
|
2828
|
+
return t.width ? {
|
|
2829
|
+
height: Math.floor(t.width / n),
|
|
2830
|
+
width: t.width
|
|
2831
|
+
} : t.height ? {
|
|
2832
|
+
height: t.height,
|
|
2833
|
+
width: Math.floor(t.height * n)
|
|
2834
|
+
} : {
|
|
2835
|
+
height: e.height,
|
|
2836
|
+
width: e.width
|
|
2837
|
+
};
|
|
2838
|
+
}
|
|
2839
|
+
var Eo = {
|
|
2840
|
+
// Scan only the first kilo-byte to speed up the check on larger files
|
|
2841
|
+
validate: (t) => gn.test(en(t, 0, 1e3)),
|
|
2842
|
+
calculate(t) {
|
|
2843
|
+
const e = en(t).match(Ue.root);
|
|
2844
|
+
if (e) {
|
|
2845
|
+
const n = xo(e[0]);
|
|
2846
|
+
if (n.width && n.height)
|
|
2847
|
+
return ko(n);
|
|
2848
|
+
if (n.viewbox)
|
|
2849
|
+
return So(n, n.viewbox);
|
|
2850
|
+
}
|
|
2851
|
+
throw new TypeError("Invalid SVG");
|
|
2897
2852
|
}
|
|
2898
|
-
|
|
2853
|
+
};
|
|
2854
|
+
new TextDecoder();
|
|
2855
|
+
var Co = (t, e) => new DataView(t.buffer, t.byteOffset + e), je = (t, e = 0) => Co(t, e).getUint16(0, !0), Io = {
|
|
2856
|
+
validate(t) {
|
|
2857
|
+
return je(t, 0) === 0 && je(t, 4) === 0;
|
|
2858
|
+
},
|
|
2859
|
+
calculate(t) {
|
|
2899
2860
|
return {
|
|
2900
|
-
height: (
|
|
2901
|
-
width: (
|
|
2861
|
+
height: je(t, 14),
|
|
2862
|
+
width: je(t, 12)
|
|
2902
2863
|
};
|
|
2903
2864
|
}
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2865
|
+
}, _o = new TextDecoder(), qe = (t, e = 0, n = t.length) => _o.decode(t.slice(e, n)), To = (t, e = 0, n = t.length) => t.slice(e, n).reduce((r, i) => r + `0${i.toString(16)}`.slice(-2), ""), wn = (t, e) => new DataView(t.buffer, t.byteOffset + e), tn = (t, e = 0) => wn(t, e).getInt16(0, !0), nn = (t, e = 0) => {
|
|
2866
|
+
const n = wn(t, e);
|
|
2867
|
+
return n.getUint16(0, !0) + (n.getUint8(2) << 16);
|
|
2868
|
+
};
|
|
2869
|
+
function $o(t) {
|
|
2870
|
+
return {
|
|
2871
|
+
height: 1 + nn(t, 7),
|
|
2872
|
+
width: 1 + nn(t, 4)
|
|
2873
|
+
};
|
|
2874
|
+
}
|
|
2875
|
+
function Do(t) {
|
|
2876
|
+
return {
|
|
2877
|
+
height: 1 + ((t[4] & 15) << 10 | t[3] << 2 | (t[2] & 192) >> 6),
|
|
2878
|
+
width: 1 + ((t[2] & 63) << 8 | t[1])
|
|
2879
|
+
};
|
|
2880
|
+
}
|
|
2881
|
+
function No(t) {
|
|
2882
|
+
return {
|
|
2883
|
+
height: tn(t, 8) & 16383,
|
|
2884
|
+
width: tn(t, 6) & 16383
|
|
2885
|
+
};
|
|
2886
|
+
}
|
|
2887
|
+
var Oo = {
|
|
2888
|
+
validate(t) {
|
|
2889
|
+
const e = qe(t, 0, 4) === "RIFF", n = qe(t, 8, 12) === "WEBP", r = qe(t, 12, 15) === "VP8";
|
|
2890
|
+
return e && n && r;
|
|
2891
|
+
},
|
|
2892
|
+
calculate(t) {
|
|
2893
|
+
const e = qe(t, 12, 16), n = t.slice(20, 30);
|
|
2894
|
+
if (e === "VP8X") {
|
|
2895
|
+
const i = n[0], s = (i & 192) === 0, l = (i & 1) === 0;
|
|
2896
|
+
if (s && l)
|
|
2897
|
+
return $o(n);
|
|
2922
2898
|
throw new TypeError("Invalid WebP");
|
|
2923
2899
|
}
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
// heic-sequence
|
|
2943
|
-
};
|
|
2944
|
-
return ze.HEIF = {
|
|
2945
|
-
validate(n) {
|
|
2946
|
-
if ((0, t.toUTF8String)(n, 4, 8) !== "ftyp")
|
|
2947
|
-
return !1;
|
|
2948
|
-
const i = (0, t.findBox)(n, "ftyp", 0);
|
|
2949
|
-
return i ? (0, t.toUTF8String)(n, i.offset + 8, i.offset + 12) in e : !1;
|
|
2950
|
-
},
|
|
2951
|
-
calculate(n) {
|
|
2952
|
-
const r = (0, t.findBox)(n, "meta", 0), i = r && (0, t.findBox)(n, "iprp", r.offset + 12), s = i && (0, t.findBox)(n, "ipco", i.offset + 8), l = s && (0, t.findBox)(n, "ispe", s.offset + 8);
|
|
2953
|
-
if (l)
|
|
2954
|
-
return {
|
|
2955
|
-
height: (0, t.readUInt32BE)(n, l.offset + 16),
|
|
2956
|
-
width: (0, t.readUInt32BE)(n, l.offset + 12),
|
|
2957
|
-
type: (0, t.toUTF8String)(n, 8, 12)
|
|
2958
|
-
};
|
|
2959
|
-
throw new TypeError("Invalid HEIF, no size found");
|
|
2900
|
+
if (e === "VP8 " && n[0] !== 47)
|
|
2901
|
+
return No(n);
|
|
2902
|
+
const r = To(n, 3, 6);
|
|
2903
|
+
if (e === "VP8L" && r !== "9d012a")
|
|
2904
|
+
return Do(n);
|
|
2905
|
+
throw new TypeError("Invalid WebP");
|
|
2906
|
+
}
|
|
2907
|
+
};
|
|
2908
|
+
async function Po(t, e) {
|
|
2909
|
+
const n = e;
|
|
2910
|
+
let r = n.loc;
|
|
2911
|
+
if (!n.frame && !n.plugin && (r || (r = tr(n)), r && (n.loc = r, r.file))) {
|
|
2912
|
+
const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
|
|
2913
|
+
n.id = s(n.loc.file);
|
|
2914
|
+
try {
|
|
2915
|
+
const l = i.readFileSync(n.loc.file, "utf-8");
|
|
2916
|
+
n.frame = rr(l, n.loc);
|
|
2917
|
+
} catch {
|
|
2960
2918
|
}
|
|
2961
|
-
}
|
|
2919
|
+
}
|
|
2920
|
+
return e;
|
|
2962
2921
|
}
|
|
2963
|
-
|
|
2964
|
-
const Ui = /* @__PURE__ */ Q($i), qi = {
|
|
2922
|
+
const Ro = {
|
|
2965
2923
|
56: "psd",
|
|
2966
2924
|
66: "bmp",
|
|
2967
2925
|
68: "dds",
|
|
@@ -2970,38 +2928,38 @@ const Ui = /* @__PURE__ */ Q($i), qi = {
|
|
|
2970
2928
|
105: "icns",
|
|
2971
2929
|
137: "png",
|
|
2972
2930
|
255: "jpg"
|
|
2973
|
-
},
|
|
2974
|
-
webp:
|
|
2975
|
-
jpg:
|
|
2976
|
-
png:
|
|
2977
|
-
svg:
|
|
2978
|
-
gif:
|
|
2979
|
-
avif:
|
|
2980
|
-
bmp:
|
|
2981
|
-
cur:
|
|
2982
|
-
dds:
|
|
2983
|
-
icns:
|
|
2984
|
-
ico:
|
|
2985
|
-
j2c:
|
|
2986
|
-
jp2:
|
|
2987
|
-
ktx:
|
|
2988
|
-
pnm:
|
|
2989
|
-
psd:
|
|
2990
|
-
tga:
|
|
2991
|
-
},
|
|
2992
|
-
function
|
|
2993
|
-
const e = t[0], n =
|
|
2994
|
-
return n &&
|
|
2995
|
-
}
|
|
2996
|
-
function
|
|
2997
|
-
const e =
|
|
2931
|
+
}, Ke = {
|
|
2932
|
+
webp: Oo,
|
|
2933
|
+
jpg: to,
|
|
2934
|
+
png: uo,
|
|
2935
|
+
svg: Eo,
|
|
2936
|
+
gif: pi,
|
|
2937
|
+
avif: bi,
|
|
2938
|
+
bmp: ei,
|
|
2939
|
+
cur: ai,
|
|
2940
|
+
dds: ci,
|
|
2941
|
+
icns: Ti,
|
|
2942
|
+
ico: Pi,
|
|
2943
|
+
j2c: Li,
|
|
2944
|
+
jp2: zi,
|
|
2945
|
+
ktx: oo,
|
|
2946
|
+
pnm: ho,
|
|
2947
|
+
psd: wo,
|
|
2948
|
+
tga: Io
|
|
2949
|
+
}, Lo = Object.keys(Ke);
|
|
2950
|
+
function Mo(t) {
|
|
2951
|
+
const e = t[0], n = Ro[e];
|
|
2952
|
+
return n && Ke[n].validate(t) ? n : Lo.find((r) => Ke[r].validate(t));
|
|
2953
|
+
}
|
|
2954
|
+
function jo(t) {
|
|
2955
|
+
const e = Mo(t);
|
|
2998
2956
|
if (typeof e < "u") {
|
|
2999
|
-
const n =
|
|
2957
|
+
const n = Ke[e].calculate(t);
|
|
3000
2958
|
if (n !== void 0)
|
|
3001
2959
|
return n.type = e, n;
|
|
3002
2960
|
}
|
|
3003
2961
|
}
|
|
3004
|
-
async function
|
|
2962
|
+
async function qo(t) {
|
|
3005
2963
|
if (/^(https?|file|capacitor):/.test(t))
|
|
3006
2964
|
try {
|
|
3007
2965
|
const e = await fetch(t, {
|
|
@@ -3011,7 +2969,7 @@ async function zi(t) {
|
|
|
3011
2969
|
console.error("can not fetch", t);
|
|
3012
2970
|
return;
|
|
3013
2971
|
}
|
|
3014
|
-
const n = await e.arrayBuffer(), r =
|
|
2972
|
+
const n = await e.arrayBuffer(), r = jo(Buffer.from(n));
|
|
3015
2973
|
if (r)
|
|
3016
2974
|
return {
|
|
3017
2975
|
width: r.width,
|
|
@@ -3024,7 +2982,7 @@ async function zi(t) {
|
|
|
3024
2982
|
return;
|
|
3025
2983
|
}
|
|
3026
2984
|
}
|
|
3027
|
-
const
|
|
2985
|
+
const zo = (t, e, n) => async (r, i, s) => {
|
|
3028
2986
|
try {
|
|
3029
2987
|
const l = await t.dynamicImport("node:fs"), a = await t.dynamicImport("node:path");
|
|
3030
2988
|
let c;
|
|
@@ -3037,7 +2995,7 @@ const Wi = (t, e, n) => async (r, i, s) => {
|
|
|
3037
2995
|
if (r.method === "GET" && c.pathname === "/__image_info") {
|
|
3038
2996
|
const u = c.searchParams.get("url");
|
|
3039
2997
|
if (i.setHeader("content-type", "application/json"), u) {
|
|
3040
|
-
const o = await
|
|
2998
|
+
const o = await qo(u);
|
|
3041
2999
|
i.setHeader("cache-control", "public, max-age=31536000, immutable"), o ? i.write(JSON.stringify(o)) : i.statusCode = 404;
|
|
3042
3000
|
} else {
|
|
3043
3001
|
i.statusCode = 500;
|
|
@@ -3047,127 +3005,127 @@ const Wi = (t, e, n) => async (r, i, s) => {
|
|
|
3047
3005
|
i.end();
|
|
3048
3006
|
return;
|
|
3049
3007
|
} else if (r.method === "POST" && c.pathname === "/__image_fix") {
|
|
3050
|
-
const u = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"),
|
|
3051
|
-
let
|
|
3052
|
-
const
|
|
3053
|
-
let
|
|
3054
|
-
for (;
|
|
3055
|
-
if (
|
|
3056
|
-
|
|
3008
|
+
const u = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"), b = c.searchParams.get("src"), f = c.searchParams.get("currentHref"), v = u.split(":"), x = parseInt(v[v.length - 1], 10) - 1;
|
|
3009
|
+
let C = parseInt(v[v.length - 2], 10) - 1;
|
|
3010
|
+
const T = a.resolve(n, v.slice(0, v.length - 2).join(":")), W = a.extname(T).toLowerCase();
|
|
3011
|
+
let h = l.readFileSync(T).toString("utf-8"), g = 0;
|
|
3012
|
+
for (; g < h.length; g++)
|
|
3013
|
+
if (C === 0) {
|
|
3014
|
+
g += x;
|
|
3057
3015
|
break;
|
|
3058
|
-
} else if (
|
|
3016
|
+
} else if (h[g] === `
|
|
3059
3017
|
`) {
|
|
3060
|
-
|
|
3018
|
+
C--;
|
|
3061
3019
|
continue;
|
|
3062
3020
|
}
|
|
3063
|
-
if (
|
|
3021
|
+
if (h.slice(g, g + 4) !== "<img") {
|
|
3064
3022
|
console.error(
|
|
3065
3023
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
3066
3024
|
), i.statusCode = 500;
|
|
3067
3025
|
return;
|
|
3068
3026
|
}
|
|
3069
|
-
const
|
|
3070
|
-
if (
|
|
3027
|
+
const I = h.indexOf(">", g) + 1;
|
|
3028
|
+
if (I < g) {
|
|
3071
3029
|
console.error(
|
|
3072
3030
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
3073
3031
|
), i.statusCode = 500;
|
|
3074
3032
|
return;
|
|
3075
3033
|
}
|
|
3076
|
-
const
|
|
3077
|
-
let
|
|
3078
|
-
if (
|
|
3079
|
-
const
|
|
3080
|
-
if (
|
|
3081
|
-
const
|
|
3034
|
+
const M = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(W);
|
|
3035
|
+
let S = h.slice(g, I);
|
|
3036
|
+
if (b && f && M) {
|
|
3037
|
+
const _ = new URL(b), U = new URL(f);
|
|
3038
|
+
if (_.origin === U.origin) {
|
|
3039
|
+
const L = a.join(e, "public", _.pathname), j = a.join(e, _.pathname);
|
|
3082
3040
|
let A;
|
|
3083
|
-
if (l.existsSync(
|
|
3084
|
-
const
|
|
3085
|
-
await l.promises.mkdir(
|
|
3086
|
-
|
|
3087
|
-
a.join(n, "media",
|
|
3088
|
-
), A = "~/media" +
|
|
3089
|
-
} else if (l.existsSync(
|
|
3090
|
-
A =
|
|
3041
|
+
if (l.existsSync(L)) {
|
|
3042
|
+
const B = a.join(n, "media", a.dirname(_.pathname));
|
|
3043
|
+
await l.promises.mkdir(B, { recursive: !0 }), await l.promises.copyFile(
|
|
3044
|
+
L,
|
|
3045
|
+
a.join(n, "media", _.pathname)
|
|
3046
|
+
), A = "~/media" + _.pathname;
|
|
3047
|
+
} else if (l.existsSync(j))
|
|
3048
|
+
A = _.pathname.replace("/src/", "~/");
|
|
3091
3049
|
else
|
|
3092
3050
|
return;
|
|
3093
|
-
const
|
|
3094
|
-
|
|
3051
|
+
const Q = Fo(_.pathname), K = `${A}?jsx`;
|
|
3052
|
+
S = S.replace(/^<img/, `<${Q}`), S = S.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), S = S.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), S = S.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
3095
3053
|
let G = 0;
|
|
3096
|
-
if (
|
|
3054
|
+
if (W === ".mdx" && h.startsWith("---") && (G = h.indexOf("---", 4) + 3, G === -1))
|
|
3097
3055
|
return;
|
|
3098
|
-
const
|
|
3099
|
-
import ${
|
|
3100
|
-
|
|
3056
|
+
const ie = `
|
|
3057
|
+
import ${Q} from '${K}';`;
|
|
3058
|
+
h = `${h.slice(0, G)}${ie}${h.slice(
|
|
3101
3059
|
G,
|
|
3102
|
-
|
|
3103
|
-
)}${
|
|
3060
|
+
g
|
|
3061
|
+
)}${S}${h.slice(I)}`, l.writeFileSync(T, h);
|
|
3104
3062
|
return;
|
|
3105
3063
|
}
|
|
3106
3064
|
}
|
|
3107
|
-
|
|
3065
|
+
S = S.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${o}"`), S = S.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), S.includes("height=") || (S = S.replace(/<img/, `<img height="${w}"`)), S.includes("width=") || (S = S.replace(/<img/, `<img width="${o}"`)), h = h.slice(0, g) + S + h.slice(I), l.writeFileSync(T, h);
|
|
3108
3066
|
} else
|
|
3109
3067
|
s();
|
|
3110
3068
|
} catch (l) {
|
|
3111
|
-
l instanceof Error && await
|
|
3069
|
+
l instanceof Error && await Po(t, l), s(l);
|
|
3112
3070
|
}
|
|
3113
3071
|
};
|
|
3114
|
-
function
|
|
3072
|
+
function Fo(t) {
|
|
3115
3073
|
const e = t.lastIndexOf("."), n = t.lastIndexOf("/");
|
|
3116
|
-
return t = t.substring(n + 1, e), `Img${
|
|
3074
|
+
return t = t.substring(n + 1, e), `Img${Ao(t)}`;
|
|
3117
3075
|
}
|
|
3118
|
-
function
|
|
3076
|
+
function Ao(t) {
|
|
3119
3077
|
return `${t}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (e, n, r) => `${n.toUpperCase() + r}`).replace(new RegExp(/\w/), (e) => e.toUpperCase());
|
|
3120
3078
|
}
|
|
3121
|
-
const
|
|
3079
|
+
const _e = "@qwik-worker-core", Uo = `
|
|
3122
3080
|
export { setPlatform } from '@qwik.dev/core';
|
|
3123
3081
|
export { _deserialize } from '@qwik.dev/core/internal';
|
|
3124
|
-
`,
|
|
3082
|
+
`, Bo = (t) => t.endsWith(_e), Wo = () => ({
|
|
3125
3083
|
moduleSideEffects: !1,
|
|
3126
|
-
code:
|
|
3127
|
-
}),
|
|
3084
|
+
code: Uo
|
|
3085
|
+
}), Ho = (t) => {
|
|
3128
3086
|
t.emitFile({
|
|
3129
|
-
id:
|
|
3087
|
+
id: _e,
|
|
3130
3088
|
name: "qwik-worker-core",
|
|
3131
3089
|
type: "chunk",
|
|
3132
3090
|
preserveSignature: "allow-extension"
|
|
3133
3091
|
});
|
|
3134
|
-
},
|
|
3092
|
+
}, Qo = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
|
|
3135
3093
|
...t,
|
|
3136
3094
|
format: "es",
|
|
3137
|
-
plugins:
|
|
3138
|
-
},
|
|
3095
|
+
plugins: Jo(t?.plugins)
|
|
3096
|
+
}, Go = (t) => {
|
|
3139
3097
|
const e = Object.values(t).find(
|
|
3140
|
-
(r) => r.type === "chunk" && r.facadeModuleId ===
|
|
3141
|
-
), n = e ?
|
|
3142
|
-
|
|
3098
|
+
(r) => r.type === "chunk" && r.facadeModuleId === _e
|
|
3099
|
+
), n = e ? cn(e.fileName) : void 0;
|
|
3100
|
+
vn(
|
|
3143
3101
|
t,
|
|
3144
3102
|
(r) => n?.(r)
|
|
3145
3103
|
);
|
|
3146
|
-
},
|
|
3147
|
-
const n =
|
|
3148
|
-
|
|
3104
|
+
}, Ko = (t, e) => {
|
|
3105
|
+
const n = Yo(e), r = n ? cn(n) : void 0;
|
|
3106
|
+
vn(
|
|
3149
3107
|
t,
|
|
3150
3108
|
(i) => r?.(i)
|
|
3151
3109
|
);
|
|
3152
|
-
},
|
|
3110
|
+
}, Vo = () => ({
|
|
3153
3111
|
name: "vite-plugin-qwik-worker-core-external",
|
|
3154
3112
|
enforce: "pre",
|
|
3155
3113
|
resolveId(t) {
|
|
3156
|
-
return t === we || t ===
|
|
3157
|
-
id:
|
|
3114
|
+
return t === we || t === ve ? {
|
|
3115
|
+
id: st,
|
|
3158
3116
|
external: !0
|
|
3159
3117
|
} : null;
|
|
3160
3118
|
}
|
|
3161
|
-
}),
|
|
3119
|
+
}), Jo = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], Vo()], vn = (t, e) => {
|
|
3162
3120
|
for (const n of Object.values(t))
|
|
3163
|
-
n.type === "chunk" ? n.code =
|
|
3121
|
+
n.type === "chunk" ? n.code = jt(
|
|
3164
3122
|
n.code,
|
|
3165
3123
|
() => e(n.fileName)
|
|
3166
|
-
) : n.type === "asset" && typeof n.source == "string" && (n.source =
|
|
3124
|
+
) : n.type === "asset" && typeof n.source == "string" && (n.source = jt(
|
|
3167
3125
|
n.source,
|
|
3168
3126
|
() => e(n.fileName)
|
|
3169
3127
|
));
|
|
3170
|
-
},
|
|
3128
|
+
}, Yo = (t) => {
|
|
3171
3129
|
if (!t)
|
|
3172
3130
|
return;
|
|
3173
3131
|
const e = Object.keys(t.bundles).find(
|
|
@@ -3175,15 +3133,15 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3175
3133
|
);
|
|
3176
3134
|
if (e)
|
|
3177
3135
|
return e === "build" || e.startsWith("build/") || /[/\\]build[/\\]/.test(e) ? e : `build/${e}`;
|
|
3178
|
-
},
|
|
3136
|
+
}, Xo = [
|
|
3179
3137
|
we,
|
|
3138
|
+
ct,
|
|
3180
3139
|
dt,
|
|
3181
|
-
|
|
3182
|
-
ye,
|
|
3140
|
+
ve,
|
|
3183
3141
|
"@builder.io/qwik",
|
|
3184
3142
|
"@builder.io/qwik/jsx-runtime",
|
|
3185
3143
|
"@builder.io/qwik/jsx-dev-runtime"
|
|
3186
|
-
],
|
|
3144
|
+
], Zo = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], es = [".woff", ".woff2", ".ttf"], ot = "@qwik-hmr-bridge", ts = `
|
|
3187
3145
|
// HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
|
|
3188
3146
|
if (import.meta.hot) {
|
|
3189
3147
|
let timeout;
|
|
@@ -3208,70 +3166,68 @@ export { _deserialize } from '@qwik.dev/core/internal';
|
|
|
3208
3166
|
});
|
|
3209
3167
|
}
|
|
3210
3168
|
`;
|
|
3211
|
-
function
|
|
3212
|
-
let e = "serve", n = null, r =
|
|
3213
|
-
const
|
|
3214
|
-
let
|
|
3215
|
-
const
|
|
3169
|
+
function os(t = {}) {
|
|
3170
|
+
let e = "serve", n = null, r = "/", i = null, s = null, l = null, a = null, c = "development", u;
|
|
3171
|
+
const o = t.client?.outDir;
|
|
3172
|
+
let w = null;
|
|
3173
|
+
const b = t.fileFilter ? (h, g) => lt.test(h) || t.fileFilter(h, g) : () => !0, f = t.disableFontPreload ?? !1, v = [], x = un(t.optimizerOptions), C = /* @__PURE__ */ new Set();
|
|
3216
3174
|
return [{
|
|
3217
3175
|
name: "vite-plugin-qwik",
|
|
3218
3176
|
enforce: "pre",
|
|
3219
3177
|
api: {
|
|
3220
|
-
getOptimizer: () =>
|
|
3221
|
-
getOptions: () =>
|
|
3222
|
-
getManifest: () =>
|
|
3223
|
-
getRootDir: () =>
|
|
3224
|
-
getClientOutDir: () =>
|
|
3225
|
-
getClientPublicOutDir: () =>
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
m.segmentCallbacks.add(b);
|
|
3178
|
+
getOptimizer: () => x.getOptimizer(),
|
|
3179
|
+
getOptions: () => x.getOptions(),
|
|
3180
|
+
getManifest: () => x.getOptions().manifestInput,
|
|
3181
|
+
getRootDir: () => x.getOptions().rootDir,
|
|
3182
|
+
getClientOutDir: () => n,
|
|
3183
|
+
getClientPublicOutDir: () => i,
|
|
3184
|
+
registerBundleGraphAdder: (h) => C.add(h),
|
|
3185
|
+
onSegment: (h) => {
|
|
3186
|
+
x.segmentCallbacks.add(h);
|
|
3230
3187
|
},
|
|
3231
3188
|
_oldDevSsrServer: () => t.devSsrServer
|
|
3232
3189
|
},
|
|
3233
|
-
async config(
|
|
3234
|
-
await
|
|
3235
|
-
let
|
|
3236
|
-
|
|
3237
|
-
const
|
|
3238
|
-
let
|
|
3239
|
-
|
|
3240
|
-
const
|
|
3241
|
-
target:
|
|
3242
|
-
buildMode:
|
|
3190
|
+
async config(h, g) {
|
|
3191
|
+
await x.init();
|
|
3192
|
+
let I;
|
|
3193
|
+
g.mode === "lib" ? I = "lib" : h.build?.ssr || g.mode === "ssr" ? I = "ssr" : g.mode === "test" || g.mode === "benchmark" ? I = "test" : I = "client", e = g.command, g.mode === "production" ? c = "production" : g.mode === "development" ? c = "development" : e === "build" && I === "client" ? c = "production" : c = "development", x.debug(`vite config(), command: ${e}, env.mode: ${g.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : I === "ssr" ? t.entryStrategy = { type: "hoist" } : I === "lib" && (t.entryStrategy = { type: "inline" });
|
|
3194
|
+
const M = I === "ssr" ? typeof h.build?.ssr == "string" ? h.build.ssr : t.ssr?.input : void 0, S = I === "client" ? t.client?.input : void 0;
|
|
3195
|
+
let _ = h.build?.rollupOptions?.input || S || M;
|
|
3196
|
+
_ && typeof _ == "string" && (_ = [_]);
|
|
3197
|
+
const U = {
|
|
3198
|
+
target: I,
|
|
3199
|
+
buildMode: c,
|
|
3243
3200
|
csr: t.csr,
|
|
3244
3201
|
debug: t.debug,
|
|
3245
3202
|
entryStrategy: t.entryStrategy,
|
|
3246
3203
|
srcDir: t.srcDir,
|
|
3247
|
-
rootDir:
|
|
3204
|
+
rootDir: h.root,
|
|
3248
3205
|
tsconfigFileNames: t.tsconfigFileNames,
|
|
3249
3206
|
resolveQwikBuild: !0,
|
|
3250
3207
|
transformedModuleOutput: t.transformedModuleOutput,
|
|
3251
|
-
outDir:
|
|
3252
|
-
ssrOutDir: t.ssr?.outDir ||
|
|
3253
|
-
clientOutDir:
|
|
3208
|
+
outDir: h.build?.outDir,
|
|
3209
|
+
ssrOutDir: t.ssr?.outDir || h.build?.outDir,
|
|
3210
|
+
clientOutDir: o || // When ssr is true, this is probably an adapter build and not where the client build is
|
|
3254
3211
|
// However, if client.outDir was explicitly set, always use it
|
|
3255
|
-
(
|
|
3256
|
-
assetsDir: F ? l : void 0,
|
|
3212
|
+
(h.build?.ssr && !o ? void 0 : h.build?.outDir),
|
|
3257
3213
|
devTools: t.devTools,
|
|
3258
|
-
sourcemap: !!
|
|
3214
|
+
sourcemap: !!h.build?.sourcemap,
|
|
3259
3215
|
lint: t.lint,
|
|
3260
3216
|
experimental: t.experimental,
|
|
3261
|
-
input:
|
|
3217
|
+
input: _,
|
|
3262
3218
|
manifestInput: t.ssr?.manifestInput,
|
|
3263
3219
|
manifestInputPath: t.ssr?.manifestInputPath,
|
|
3264
3220
|
manifestOutput: t.client?.manifestOutput
|
|
3265
|
-
},
|
|
3266
|
-
|
|
3267
|
-
const
|
|
3221
|
+
}, L = await x.normalizeOptions(U);
|
|
3222
|
+
_ ||= L.input, w = U, s = L.srcDir, l = L.rootDir, t.csr || (n = L.clientOutDir, i = n, a = L.ssrOutDir);
|
|
3223
|
+
const j = c === "development", A = "globalThis.qDev", Q = "globalThis.qTest", K = "globalThis.qInspector", G = h?.define?.[A] ?? j, ie = h?.define?.[K] ?? j, B = {
|
|
3268
3224
|
// Duplicated in configEnvironment to support legacy vite build --ssr compatibility
|
|
3269
3225
|
ssr: {
|
|
3270
|
-
noExternal: [we,
|
|
3226
|
+
noExternal: [we, ve, Oe, re]
|
|
3271
3227
|
},
|
|
3272
3228
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
3273
3229
|
resolve: {
|
|
3274
|
-
dedupe: [...
|
|
3230
|
+
dedupe: [...Xo],
|
|
3275
3231
|
alias: {
|
|
3276
3232
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
3277
3233
|
"@builder.io/qwik/build": "@qwik.dev/core/build",
|
|
@@ -3291,16 +3247,16 @@ function uo(t = {}) {
|
|
|
3291
3247
|
// using optimized deps for qwik libraries will lead to duplicate imports
|
|
3292
3248
|
// this breaks Qwik because it relies a lot on module scoped symbols
|
|
3293
3249
|
we,
|
|
3294
|
-
|
|
3295
|
-
|
|
3250
|
+
ve,
|
|
3251
|
+
Oe,
|
|
3252
|
+
ct,
|
|
3296
3253
|
dt,
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
ae,
|
|
3254
|
+
re,
|
|
3255
|
+
ne,
|
|
3300
3256
|
"@builder.io/qwik"
|
|
3301
3257
|
],
|
|
3302
3258
|
// Enforce scanning our input even when overridden later
|
|
3303
|
-
entries:
|
|
3259
|
+
entries: _ && (typeof _ == "string" ? [_] : typeof _ == "object" ? Object.values(_) : _)
|
|
3304
3260
|
},
|
|
3305
3261
|
build: {
|
|
3306
3262
|
modulePreload: !1,
|
|
@@ -3310,101 +3266,99 @@ function uo(t = {}) {
|
|
|
3310
3266
|
rollupOptions: {
|
|
3311
3267
|
external: ["node:async_hooks"],
|
|
3312
3268
|
// This will amend the existing input
|
|
3313
|
-
input:
|
|
3269
|
+
input: _
|
|
3314
3270
|
// temporary fix for rolldown-vite types
|
|
3315
3271
|
}
|
|
3316
3272
|
},
|
|
3317
|
-
worker:
|
|
3273
|
+
worker: Qo(h.worker, I, e),
|
|
3318
3274
|
define: {
|
|
3319
|
-
[
|
|
3320
|
-
[
|
|
3321
|
-
[
|
|
3275
|
+
[A]: G,
|
|
3276
|
+
[K]: ie,
|
|
3277
|
+
[Q]: JSON.stringify(process.env.NODE_ENV === "test")
|
|
3322
3278
|
}
|
|
3323
3279
|
};
|
|
3324
3280
|
if (!t.csr) {
|
|
3325
|
-
|
|
3326
|
-
const
|
|
3327
|
-
|
|
3328
|
-
...
|
|
3329
|
-
output: await
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
F,
|
|
3333
|
-
j.outDir
|
|
3281
|
+
B.build.cssCodeSplit = !1, L.outDir && (B.build.outDir = L.outDir);
|
|
3282
|
+
const oe = B.build.rollupOptions?.onwarn;
|
|
3283
|
+
B.build.rollupOptions = {
|
|
3284
|
+
...B.build.rollupOptions,
|
|
3285
|
+
output: await Mr(
|
|
3286
|
+
x,
|
|
3287
|
+
h.build?.rollupOptions?.output
|
|
3334
3288
|
),
|
|
3335
3289
|
preserveEntrySignatures: "exports-only",
|
|
3336
|
-
onwarn: (
|
|
3337
|
-
|
|
3290
|
+
onwarn: (J, ae) => {
|
|
3291
|
+
J.plugin === "typescript" && J.message.includes("outputToFilesystem") || (oe ? oe(J, ae) : ae(J));
|
|
3338
3292
|
}
|
|
3339
|
-
},
|
|
3293
|
+
}, L.target === "ssr" ? e === "build" && (B.publicDir = !1, B.build.ssr = !0, h.build?.minify == null && c === "production" && (B.build.minify = !0)) : L.target === "client" || (L.target === "lib" ? (B.build.minify = !1, B.build.rollupOptions.external = [
|
|
3340
3294
|
we,
|
|
3341
|
-
|
|
3342
|
-
|
|
3295
|
+
ve,
|
|
3296
|
+
Oe,
|
|
3297
|
+
ct,
|
|
3343
3298
|
dt,
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
[
|
|
3349
|
-
[
|
|
3350
|
-
|
|
3351
|
-
}), globalThis.qDev = ge, globalThis.qTest = !0, globalThis.qInspector = be;
|
|
3299
|
+
re,
|
|
3300
|
+
ne
|
|
3301
|
+
]) : B.define = {
|
|
3302
|
+
[A]: !0,
|
|
3303
|
+
[Q]: !0,
|
|
3304
|
+
[K]: !1
|
|
3305
|
+
}), globalThis.qDev = G, globalThis.qTest = !0, globalThis.qInspector = ie;
|
|
3352
3306
|
}
|
|
3353
|
-
return
|
|
3307
|
+
return B;
|
|
3354
3308
|
},
|
|
3355
|
-
configEnvironment(
|
|
3356
|
-
return
|
|
3309
|
+
configEnvironment(h, g, I) {
|
|
3310
|
+
return h === "ssr" || h === "ssg" ? {
|
|
3357
3311
|
resolve: {
|
|
3358
|
-
noExternal: [we,
|
|
3312
|
+
noExternal: [we, ve, Oe, re]
|
|
3359
3313
|
}
|
|
3360
|
-
} :
|
|
3314
|
+
} : c === "production" ? {
|
|
3361
3315
|
resolve: {
|
|
3362
3316
|
conditions: ["min"]
|
|
3363
3317
|
}
|
|
3364
3318
|
} : {};
|
|
3365
3319
|
},
|
|
3366
|
-
async configResolved(
|
|
3367
|
-
if (
|
|
3320
|
+
async configResolved(h) {
|
|
3321
|
+
if (r = h.base, !(r.startsWith("/") && r.endsWith("/")))
|
|
3368
3322
|
throw new Error("vite's config.base must begin and end with /");
|
|
3369
|
-
if (
|
|
3370
|
-
const
|
|
3371
|
-
for (const
|
|
3372
|
-
const
|
|
3373
|
-
|
|
3323
|
+
if (h.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && x.setSourceMapSupport(!0), w ? x.normalizeOptions(w) : x.normalizeOptions(t), e === "build" && !t.csr && x.getOptions().target === "client") {
|
|
3324
|
+
const I = ["vite:build-import-analysis"], M = h.plugins;
|
|
3325
|
+
for (const S of I) {
|
|
3326
|
+
const _ = M.findIndex((U) => U?.name === S);
|
|
3327
|
+
_ >= 0 && M.splice(_, 1);
|
|
3374
3328
|
}
|
|
3375
3329
|
}
|
|
3376
3330
|
},
|
|
3377
3331
|
async buildStart() {
|
|
3378
|
-
|
|
3379
|
-
const
|
|
3380
|
-
await
|
|
3381
|
-
|
|
3382
|
-
const
|
|
3383
|
-
|
|
3332
|
+
v.length = 0;
|
|
3333
|
+
const h = this.resolve.bind(this);
|
|
3334
|
+
await x.validateSource(h), x.onDiagnostics((g, I, M) => {
|
|
3335
|
+
g.forEach((S) => {
|
|
3336
|
+
const _ = x.normalizePath(I.sys.path.join(M, S.file));
|
|
3337
|
+
S.category === "error" ? this.error(He(_, S)) : this.warn(He(_, S));
|
|
3384
3338
|
});
|
|
3385
|
-
}), await
|
|
3339
|
+
}), await x.buildStart(this), e === "build" && x.getOptions().target === "client" && Ho(this);
|
|
3386
3340
|
},
|
|
3387
|
-
resolveId(
|
|
3388
|
-
if (
|
|
3389
|
-
return
|
|
3390
|
-
if (
|
|
3391
|
-
return
|
|
3392
|
-
const
|
|
3393
|
-
return
|
|
3341
|
+
resolveId(h, g, I) {
|
|
3342
|
+
if (h.endsWith(ot))
|
|
3343
|
+
return ot;
|
|
3344
|
+
if (Bo(h))
|
|
3345
|
+
return _e;
|
|
3346
|
+
const M = b(h, "resolveId");
|
|
3347
|
+
return Z(h) || !M ? null : x.resolveId(this, h, g, I);
|
|
3394
3348
|
},
|
|
3395
|
-
load(
|
|
3396
|
-
if (
|
|
3397
|
-
return { code:
|
|
3398
|
-
if (
|
|
3399
|
-
return
|
|
3400
|
-
const
|
|
3401
|
-
return
|
|
3349
|
+
load(h, g) {
|
|
3350
|
+
if (h === ot)
|
|
3351
|
+
return { code: ts };
|
|
3352
|
+
if (h === _e)
|
|
3353
|
+
return Wo();
|
|
3354
|
+
const I = b(h, "load");
|
|
3355
|
+
return Z(h) || !I ? null : (h = x.normalizePath(h), e === "serve" && h.endsWith(ne) ? {
|
|
3402
3356
|
code: "export const manifest = undefined;"
|
|
3403
|
-
} :
|
|
3357
|
+
} : x.load(this, h, g));
|
|
3404
3358
|
},
|
|
3405
|
-
transform(
|
|
3406
|
-
if (
|
|
3407
|
-
const
|
|
3359
|
+
transform(h, g, I) {
|
|
3360
|
+
if (g.includes(".vite/deps/") && h.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(h)) {
|
|
3361
|
+
const _ = l && g.startsWith(l) ? g.slice(l.length) : g;
|
|
3408
3362
|
throw new Error(
|
|
3409
3363
|
`
|
|
3410
3364
|
|
|
@@ -3413,89 +3367,89 @@ function uo(t = {}) {
|
|
|
3413
3367
|
⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
|
|
3414
3368
|
|
|
3415
3369
|
👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
|
|
3416
|
-
👉 ${
|
|
3370
|
+
👉 ${_}
|
|
3417
3371
|
|
|
3418
3372
|
==============
|
|
3419
3373
|
|
|
3420
3374
|
`
|
|
3421
3375
|
);
|
|
3422
3376
|
}
|
|
3423
|
-
const
|
|
3424
|
-
return
|
|
3377
|
+
const M = b(g, "transform"), S = g.includes("?raw");
|
|
3378
|
+
return Z(g) || !M || S ? null : x.transform(this, h, g, I);
|
|
3425
3379
|
}
|
|
3426
3380
|
}, {
|
|
3427
3381
|
name: "vite-plugin-qwik-post",
|
|
3428
3382
|
enforce: "post",
|
|
3429
3383
|
generateBundle: {
|
|
3430
3384
|
order: "post",
|
|
3431
|
-
async handler(
|
|
3432
|
-
const
|
|
3433
|
-
if (
|
|
3434
|
-
const
|
|
3435
|
-
for (const [
|
|
3385
|
+
async handler(h, g) {
|
|
3386
|
+
const I = this.environment.config.consumer === "client", M = this.environment.config.consumer === "server";
|
|
3387
|
+
if (I) {
|
|
3388
|
+
const S = x.getOptions();
|
|
3389
|
+
for (const [L, j] of Object.entries(g))
|
|
3436
3390
|
if (j.type === "asset") {
|
|
3437
|
-
const
|
|
3438
|
-
if (
|
|
3439
|
-
typeof j.source == "string" && j.source.length <
|
|
3391
|
+
const A = r + L;
|
|
3392
|
+
if (Zo.some((Q) => L.endsWith(Q)))
|
|
3393
|
+
typeof j.source == "string" && j.source.length < S.inlineStylesUpToBytes ? v.push({
|
|
3440
3394
|
tag: "style",
|
|
3441
3395
|
location: "head",
|
|
3442
3396
|
attributes: {
|
|
3443
|
-
"data-src":
|
|
3397
|
+
"data-src": A,
|
|
3444
3398
|
dangerouslySetInnerHTML: j.source
|
|
3445
3399
|
}
|
|
3446
|
-
}) :
|
|
3400
|
+
}) : v.push({
|
|
3447
3401
|
tag: "link",
|
|
3448
3402
|
location: "head",
|
|
3449
3403
|
attributes: {
|
|
3450
3404
|
rel: "stylesheet",
|
|
3451
|
-
href:
|
|
3405
|
+
href: A
|
|
3452
3406
|
}
|
|
3453
3407
|
});
|
|
3454
3408
|
else {
|
|
3455
|
-
const
|
|
3456
|
-
|
|
3409
|
+
const Q = es.find((K) => L.endsWith(K));
|
|
3410
|
+
Q && !f && v.unshift({
|
|
3457
3411
|
tag: "link",
|
|
3458
3412
|
location: "head",
|
|
3459
3413
|
attributes: {
|
|
3460
3414
|
rel: "preload",
|
|
3461
|
-
href:
|
|
3415
|
+
href: A,
|
|
3462
3416
|
as: "font",
|
|
3463
|
-
type: `font/${
|
|
3417
|
+
type: `font/${Q.slice(1)}`,
|
|
3464
3418
|
crossorigin: ""
|
|
3465
3419
|
}
|
|
3466
3420
|
});
|
|
3467
3421
|
}
|
|
3468
3422
|
}
|
|
3469
|
-
const
|
|
3423
|
+
const _ = await x.generateManifest(
|
|
3470
3424
|
this,
|
|
3471
|
-
|
|
3472
|
-
|
|
3425
|
+
g,
|
|
3426
|
+
C,
|
|
3473
3427
|
{
|
|
3474
|
-
injections:
|
|
3428
|
+
injections: v,
|
|
3475
3429
|
platform: { vite: "" }
|
|
3476
3430
|
}
|
|
3477
|
-
),
|
|
3478
|
-
for (const
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
} else
|
|
3431
|
+
), U = Er(_, r);
|
|
3432
|
+
for (const L of Object.values(g))
|
|
3433
|
+
L.type === "chunk" && (L.code = ln(L.code, U));
|
|
3434
|
+
Go(g);
|
|
3435
|
+
} else M && Ko(g, x.getOptions().manifestInput);
|
|
3482
3436
|
}
|
|
3483
3437
|
},
|
|
3484
|
-
async writeBundle(
|
|
3485
|
-
const
|
|
3438
|
+
async writeBundle(h, g) {
|
|
3439
|
+
const I = x.getOptions();
|
|
3486
3440
|
if (this.environment.config.consumer === "server") {
|
|
3487
|
-
const
|
|
3488
|
-
if (
|
|
3489
|
-
const
|
|
3441
|
+
const S = x.getSys();
|
|
3442
|
+
if (S.env === "node" || S.env === "bun" || S.env === "deno") {
|
|
3443
|
+
const _ = Object.keys(g), U = async (L) => {
|
|
3490
3444
|
try {
|
|
3491
|
-
const j =
|
|
3492
|
-
if ((j.startsWith("entry.") || j.startsWith("entry_")) && !j.includes("preview") && (
|
|
3493
|
-
const
|
|
3494
|
-
if (!
|
|
3495
|
-
const
|
|
3496
|
-
await
|
|
3497
|
-
|
|
3498
|
-
`export * from "./${
|
|
3445
|
+
const j = S.path.basename(L), A = S.path.extname(j);
|
|
3446
|
+
if ((j.startsWith("entry.") || j.startsWith("entry_")) && !j.includes("preview") && (A === ".mjs" || A === ".cjs")) {
|
|
3447
|
+
const K = S.path.basename(j, A), G = `${K}.js`, ie = K + A;
|
|
3448
|
+
if (!_.some((oe) => S.path.basename(oe) === G)) {
|
|
3449
|
+
const oe = S.path.dirname(L), J = await S.dynamicImport("node:fs"), ae = S.path.join(h.dir || I.outDir, oe);
|
|
3450
|
+
await J.promises.mkdir(ae, { recursive: !0 }), await J.promises.writeFile(
|
|
3451
|
+
S.path.join(ae, G),
|
|
3452
|
+
`export * from "./${ie}";`
|
|
3499
3453
|
);
|
|
3500
3454
|
}
|
|
3501
3455
|
}
|
|
@@ -3503,68 +3457,68 @@ function uo(t = {}) {
|
|
|
3503
3457
|
console.error("patchModuleFormat", j);
|
|
3504
3458
|
}
|
|
3505
3459
|
};
|
|
3506
|
-
await Promise.all(
|
|
3460
|
+
await Promise.all(_.map(U));
|
|
3507
3461
|
}
|
|
3508
3462
|
}
|
|
3509
3463
|
},
|
|
3510
3464
|
transformIndexHtml() {
|
|
3511
3465
|
if (e === "serve")
|
|
3512
|
-
return
|
|
3466
|
+
return Vr(x.getOptions(), r);
|
|
3513
3467
|
},
|
|
3514
|
-
configureServer(
|
|
3515
|
-
|
|
3468
|
+
configureServer(h) {
|
|
3469
|
+
u = h, x.configureServer(h), (t?.devTools?.imageDevTools ?? !0) && h.middlewares.use(zo(x.getSys(), l, s));
|
|
3516
3470
|
},
|
|
3517
|
-
configurePreviewServer(
|
|
3471
|
+
configurePreviewServer(h) {
|
|
3518
3472
|
return async () => {
|
|
3519
|
-
const
|
|
3520
|
-
await
|
|
3473
|
+
const g = x.getSys(), I = x.getPath();
|
|
3474
|
+
await Kr(h.middlewares, a, g, I);
|
|
3521
3475
|
};
|
|
3522
3476
|
},
|
|
3523
|
-
hotUpdate(
|
|
3524
|
-
|
|
3525
|
-
const
|
|
3526
|
-
if (this.environment.name === "ssr" &&
|
|
3527
|
-
if (
|
|
3528
|
-
const
|
|
3529
|
-
for (const
|
|
3530
|
-
const
|
|
3531
|
-
if (
|
|
3532
|
-
|
|
3477
|
+
hotUpdate(h) {
|
|
3478
|
+
x.hotUpdate(this.environment, h);
|
|
3479
|
+
const g = t?.devTools?.hmr ?? !0;
|
|
3480
|
+
if (this.environment.name === "ssr" && h.modules.length)
|
|
3481
|
+
if (g) {
|
|
3482
|
+
const I = /* @__PURE__ */ new Set(), M = (S) => /\.([mc]?[jt]sx?|mdx?)$/.test(S.split("?")[0]);
|
|
3483
|
+
for (const S of h.modules) {
|
|
3484
|
+
const _ = S.url.split("?")[0];
|
|
3485
|
+
if (S.type === "js" && M(S.url))
|
|
3486
|
+
I.add(_);
|
|
3533
3487
|
else
|
|
3534
|
-
for (const
|
|
3535
|
-
|
|
3488
|
+
for (const U of S.importers)
|
|
3489
|
+
U.type === "js" && M(U.url) && I.add(U.url.split("?")[0]);
|
|
3536
3490
|
}
|
|
3537
|
-
|
|
3491
|
+
I.size > 0 && u && u.environments.client.hot.send({
|
|
3538
3492
|
type: "custom",
|
|
3539
3493
|
event: "qwik:hmr",
|
|
3540
|
-
data: { files: [...
|
|
3494
|
+
data: { files: [...I], t: h.timestamp }
|
|
3541
3495
|
});
|
|
3542
3496
|
} else
|
|
3543
|
-
|
|
3497
|
+
u?.environments.client.hot.send({ type: "full-reload" });
|
|
3544
3498
|
},
|
|
3545
|
-
onLog(
|
|
3546
|
-
if (
|
|
3547
|
-
const
|
|
3499
|
+
onLog(h, g) {
|
|
3500
|
+
if (g.plugin == "vite-plugin-qwik") {
|
|
3501
|
+
const I = rs[h] || se.White, M = (g.frame || "").split(`
|
|
3548
3502
|
`).map(
|
|
3549
|
-
(
|
|
3503
|
+
(S) => (S.match(/^\s*\^\s*$/) ? se.BrightWhite : se.BrightBlack) + S
|
|
3550
3504
|
);
|
|
3551
|
-
return console[
|
|
3552
|
-
`${
|
|
3553
|
-
${
|
|
3554
|
-
%s${
|
|
3555
|
-
`[${
|
|
3505
|
+
return console[h](
|
|
3506
|
+
`${I}%s
|
|
3507
|
+
${se.BrightWhite}%s
|
|
3508
|
+
%s${se.RESET}`,
|
|
3509
|
+
`[${g.plugin}](${h}): ${g.message}
|
|
3556
3510
|
`,
|
|
3557
|
-
` ${
|
|
3511
|
+
` ${g?.loc?.file}:${g?.loc?.line}:${g?.loc?.column}
|
|
3558
3512
|
`,
|
|
3559
|
-
` ${
|
|
3513
|
+
` ${M.join(`
|
|
3560
3514
|
`)}
|
|
3561
3515
|
`
|
|
3562
3516
|
), !1;
|
|
3563
3517
|
}
|
|
3564
3518
|
}
|
|
3565
|
-
},
|
|
3519
|
+
}, ns()];
|
|
3566
3520
|
}
|
|
3567
|
-
async function
|
|
3521
|
+
async function ns() {
|
|
3568
3522
|
let t, e, n = !1;
|
|
3569
3523
|
async function r() {
|
|
3570
3524
|
if (n)
|
|
@@ -3579,41 +3533,41 @@ async function ao() {
|
|
|
3579
3533
|
let l;
|
|
3580
3534
|
const a = "@qwik.dev/core", c = "@builder.io/qwik";
|
|
3581
3535
|
async function u(w) {
|
|
3582
|
-
const
|
|
3583
|
-
let
|
|
3584
|
-
for (;
|
|
3536
|
+
const b = /* @__PURE__ */ new Set();
|
|
3537
|
+
let f = w;
|
|
3538
|
+
for (; f; ) {
|
|
3585
3539
|
try {
|
|
3586
|
-
const
|
|
3587
|
-
for (const
|
|
3588
|
-
|
|
3589
|
-
for (const
|
|
3590
|
-
|
|
3591
|
-
for (const
|
|
3592
|
-
|
|
3540
|
+
const x = e.join(f, "package.json"), C = await t.readFile(x, { encoding: "utf-8" }), T = JSON.parse(C);
|
|
3541
|
+
for (const W of Object.keys(T.dependencies || {}))
|
|
3542
|
+
b.add(W);
|
|
3543
|
+
for (const W of Object.keys(T.devDependencies || {}))
|
|
3544
|
+
b.add(W);
|
|
3545
|
+
for (const W of Object.keys(T.optionalDependencies || {}))
|
|
3546
|
+
b.add(W);
|
|
3593
3547
|
} catch {
|
|
3594
3548
|
}
|
|
3595
|
-
const
|
|
3596
|
-
if (
|
|
3549
|
+
const v = e.dirname(f);
|
|
3550
|
+
if (v === f)
|
|
3597
3551
|
break;
|
|
3598
|
-
|
|
3552
|
+
f = v;
|
|
3599
3553
|
}
|
|
3600
|
-
return [...
|
|
3554
|
+
return [...b];
|
|
3601
3555
|
}
|
|
3602
|
-
async function o(w,
|
|
3603
|
-
for (;
|
|
3604
|
-
const
|
|
3556
|
+
async function o(w, b) {
|
|
3557
|
+
for (; b; ) {
|
|
3558
|
+
const f = e.join(b, "node_modules", w, "package.json");
|
|
3605
3559
|
try {
|
|
3606
|
-
await t.access(
|
|
3607
|
-
const
|
|
3560
|
+
await t.access(f);
|
|
3561
|
+
const x = await t.readFile(f, {
|
|
3608
3562
|
encoding: "utf-8"
|
|
3609
|
-
}),
|
|
3610
|
-
return !!(
|
|
3563
|
+
}), C = JSON.parse(x);
|
|
3564
|
+
return !!(C.qwik || C.dependencies?.[a] || C.peerDependencies?.[a] || C.devDependencies?.[a] || C.dependencies?.[c] || C.peerDependencies?.[c] || C.devDependencies?.[c]);
|
|
3611
3565
|
} catch {
|
|
3612
3566
|
}
|
|
3613
|
-
const
|
|
3614
|
-
if (
|
|
3567
|
+
const v = e.dirname(b);
|
|
3568
|
+
if (v === b)
|
|
3615
3569
|
break;
|
|
3616
|
-
|
|
3570
|
+
b = v;
|
|
3617
3571
|
}
|
|
3618
3572
|
return !1;
|
|
3619
3573
|
}
|
|
@@ -3629,73 +3583,73 @@ async function ao() {
|
|
|
3629
3583
|
async handler(w) {
|
|
3630
3584
|
if (!await r())
|
|
3631
3585
|
return;
|
|
3632
|
-
const
|
|
3586
|
+
const b = w.root || process.cwd(), f = w.optimizeDeps?.exclude ?? [], v = await u(b);
|
|
3633
3587
|
s.length = 0;
|
|
3634
|
-
for (const
|
|
3635
|
-
await o(
|
|
3636
|
-
const
|
|
3588
|
+
for (const C of v)
|
|
3589
|
+
await o(C, b) && s.push(C);
|
|
3590
|
+
const x = s.filter((C) => !f.includes(C));
|
|
3637
3591
|
return {
|
|
3638
|
-
optimizeDeps: { exclude:
|
|
3639
|
-
ssr: { noExternal:
|
|
3592
|
+
optimizeDeps: { exclude: x },
|
|
3593
|
+
ssr: { noExternal: x }
|
|
3640
3594
|
};
|
|
3641
3595
|
}
|
|
3642
3596
|
},
|
|
3643
3597
|
// qwik deps need to be marked as noExternal per-environment
|
|
3644
|
-
configEnvironment(w,
|
|
3598
|
+
configEnvironment(w, b) {
|
|
3645
3599
|
if (s.length === 0)
|
|
3646
3600
|
return;
|
|
3647
|
-
const
|
|
3648
|
-
if (
|
|
3601
|
+
const f = b.resolve?.noExternal;
|
|
3602
|
+
if (f === !0)
|
|
3649
3603
|
return;
|
|
3650
|
-
let
|
|
3651
|
-
return Array.isArray(
|
|
3652
|
-
resolve: { noExternal: [...
|
|
3604
|
+
let v;
|
|
3605
|
+
return Array.isArray(f) ? v = f : f ? v = [f] : v = [], {
|
|
3606
|
+
resolve: { noExternal: [...v, ...s] }
|
|
3653
3607
|
};
|
|
3654
3608
|
},
|
|
3655
3609
|
// We check all SSR build lookups for external Qwik deps
|
|
3656
3610
|
resolveId: {
|
|
3657
3611
|
order: "pre",
|
|
3658
|
-
async handler(w,
|
|
3612
|
+
async handler(w, b, f) {
|
|
3659
3613
|
if (!await r() || !(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(w) || i.has(w))
|
|
3660
3614
|
return;
|
|
3661
|
-
const
|
|
3662
|
-
if (i.has(
|
|
3615
|
+
const x = (w.startsWith("@") ? w.split("/").slice(0, 2).join("/") : w.split("/")[0]).split("?")[0];
|
|
3616
|
+
if (i.has(x))
|
|
3663
3617
|
return;
|
|
3664
|
-
i.add(w), i.add(
|
|
3665
|
-
let
|
|
3618
|
+
i.add(w), i.add(x);
|
|
3619
|
+
let C;
|
|
3666
3620
|
try {
|
|
3667
|
-
|
|
3621
|
+
C = await this.resolve(x, b, { ...f, skipSelf: !0 });
|
|
3668
3622
|
} catch {
|
|
3669
3623
|
return;
|
|
3670
3624
|
}
|
|
3671
|
-
if (
|
|
3625
|
+
if (C?.external && await o(x, b ? e.dirname(b) : l))
|
|
3672
3626
|
throw new Error(
|
|
3673
3627
|
`
|
|
3674
3628
|
==============
|
|
3675
|
-
${
|
|
3629
|
+
${x} 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.
|
|
3676
3630
|
Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
|
|
3677
3631
|
==============
|
|
3678
3632
|
`
|
|
3679
3633
|
);
|
|
3680
|
-
if (
|
|
3681
|
-
return
|
|
3634
|
+
if (x === w)
|
|
3635
|
+
return C;
|
|
3682
3636
|
}
|
|
3683
3637
|
}
|
|
3684
3638
|
};
|
|
3685
3639
|
}
|
|
3686
|
-
const
|
|
3640
|
+
const se = {
|
|
3687
3641
|
Yellow: "\x1B[33m",
|
|
3688
3642
|
Cyan: "\x1B[36m",
|
|
3689
3643
|
White: "\x1B[37m",
|
|
3690
3644
|
BrightBlack: "\x1B[90m",
|
|
3691
3645
|
BrightWhite: "\x1B[97m",
|
|
3692
3646
|
RESET: "\x1B[0m"
|
|
3693
|
-
},
|
|
3694
|
-
warn:
|
|
3695
|
-
info:
|
|
3696
|
-
debug:
|
|
3647
|
+
}, rs = {
|
|
3648
|
+
warn: se.Yellow,
|
|
3649
|
+
info: se.Cyan,
|
|
3650
|
+
debug: se.BrightBlack
|
|
3697
3651
|
};
|
|
3698
3652
|
export {
|
|
3699
|
-
|
|
3700
|
-
|
|
3653
|
+
is as qwikRollup,
|
|
3654
|
+
os as qwikVite
|
|
3701
3655
|
};
|