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