@qwik.dev/core 2.0.0-beta.21 → 2.0.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +7714 -431
- package/dist/core-internal.d.ts +341 -194
- package/dist/core.min.mjs +1 -2
- package/dist/core.mjs +2222 -1966
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4731 -3518
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.mjs +1306 -1308
- package/dist/qwikloader.debug.js +0 -2
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +11 -7
- package/dist/server.mjs +452 -390
- package/dist/testing/index.d.ts +32 -59
- package/dist/testing/index.mjs +1894 -1695
- package/dist/testing/package.json +1 -1
- package/handlers.mjs +1 -1
- package/package.json +2 -2
package/dist/optimizer.mjs
CHANGED
|
@@ -1,228 +1,228 @@
|
|
|
1
|
-
function
|
|
2
|
-
function
|
|
3
|
-
if (typeof
|
|
4
|
-
throw new TypeError("Path must be a string. Received " + JSON.stringify(
|
|
5
|
-
}
|
|
6
|
-
function i(
|
|
7
|
-
let
|
|
8
|
-
for (let
|
|
9
|
-
if (
|
|
10
|
-
|
|
1
|
+
function Lt(e = {}) {
|
|
2
|
+
function t(p) {
|
|
3
|
+
if (typeof p != "string")
|
|
4
|
+
throw new TypeError("Path must be a string. Received " + JSON.stringify(p));
|
|
5
|
+
}
|
|
6
|
+
function i(p, a) {
|
|
7
|
+
let h = "", _ = 0, c = -1, g = 0, b;
|
|
8
|
+
for (let S = 0; S <= p.length; ++S) {
|
|
9
|
+
if (S < p.length)
|
|
10
|
+
b = p.charCodeAt(S);
|
|
11
11
|
else {
|
|
12
|
-
if (
|
|
12
|
+
if (b === 47)
|
|
13
13
|
break;
|
|
14
|
-
|
|
14
|
+
b = 47;
|
|
15
15
|
}
|
|
16
|
-
if (
|
|
17
|
-
if (!(
|
|
18
|
-
if (
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
|
|
16
|
+
if (b === 47) {
|
|
17
|
+
if (!(c === S - 1 || g === 1)) if (c !== S - 1 && g === 2) {
|
|
18
|
+
if (h.length < 2 || _ !== 2 || h.charCodeAt(h.length - 1) !== 46 || h.charCodeAt(h.length - 2) !== 46) {
|
|
19
|
+
if (h.length > 2) {
|
|
20
|
+
const k = h.lastIndexOf("/");
|
|
21
|
+
if (k !== h.length - 1) {
|
|
22
|
+
k === -1 ? (h = "", _ = 0) : (h = h.slice(0, k), _ = h.length - 1 - h.lastIndexOf("/")), c = S, g = 0;
|
|
23
23
|
continue;
|
|
24
24
|
}
|
|
25
|
-
} else if (
|
|
26
|
-
|
|
25
|
+
} else if (h.length === 2 || h.length === 1) {
|
|
26
|
+
h = "", _ = 0, c = S, g = 0;
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
a && (h.length > 0 ? h += "/.." : h = "..", _ = 2);
|
|
31
31
|
} else
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} else
|
|
32
|
+
h.length > 0 ? h += "/" + p.slice(c + 1, S) : h = p.slice(c + 1, S), _ = S - c - 1;
|
|
33
|
+
c = S, g = 0;
|
|
34
|
+
} else b === 46 && g !== -1 ? ++g : g = -1;
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return h;
|
|
37
37
|
}
|
|
38
|
-
function r(
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
function r(p, a) {
|
|
39
|
+
const h = a.dir || a.root, _ = a.base || (a.name || "") + (a.ext || "");
|
|
40
|
+
return h ? h === a.root ? h + _ : h + p + _ : _;
|
|
41
41
|
}
|
|
42
|
-
const o = function(...
|
|
43
|
-
let
|
|
44
|
-
for (let
|
|
45
|
-
let
|
|
46
|
-
|
|
42
|
+
const o = function(...a) {
|
|
43
|
+
let h = "", _ = !1, c;
|
|
44
|
+
for (let g = a.length - 1; g >= -1 && !_; g--) {
|
|
45
|
+
let b;
|
|
46
|
+
g >= 0 ? b = a[g] : (c === void 0 && (e && typeof e.cwd == "function" ? c = e.cwd() : typeof process < "u" && typeof process.cwd == "function" ? c = process.cwd() : c = "/"), b = c), t(b), b.length !== 0 && (h = b + "/" + h, _ = b.charCodeAt(0) === 47);
|
|
47
47
|
}
|
|
48
|
-
return
|
|
49
|
-
},
|
|
50
|
-
if (
|
|
48
|
+
return h = i(h, !_), _ ? h.length > 0 ? "/" + h : "/" : h.length > 0 ? h : ".";
|
|
49
|
+
}, m = function(a) {
|
|
50
|
+
if (t(a), a.length === 0)
|
|
51
51
|
return ".";
|
|
52
|
-
const
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
52
|
+
const h = a.charCodeAt(0) === 47, _ = a.charCodeAt(a.length - 1) === 47;
|
|
53
|
+
return a = i(a, !h), a.length === 0 && !h && (a = "."), a.length > 0 && _ && (a += "/"), h ? "/" + a : a;
|
|
54
|
+
}, l = function(a) {
|
|
55
|
+
return t(a), a.length > 0 && a.charCodeAt(0) === 47;
|
|
56
|
+
}, s = function(...a) {
|
|
57
|
+
if (a.length === 0)
|
|
58
58
|
return ".";
|
|
59
|
-
let
|
|
60
|
-
for (let
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
return
|
|
65
|
-
},
|
|
66
|
-
if (
|
|
59
|
+
let h;
|
|
60
|
+
for (let _ = 0; _ < a.length; ++_) {
|
|
61
|
+
const c = a[_];
|
|
62
|
+
t(c), c.length > 0 && (h === void 0 ? h = c : h += "/" + c);
|
|
63
|
+
}
|
|
64
|
+
return h === void 0 ? "." : m(h);
|
|
65
|
+
}, f = function(a, h) {
|
|
66
|
+
if (t(a), t(h), a === h || (a = o(a), h = o(h), a === h))
|
|
67
67
|
return "";
|
|
68
|
-
let
|
|
69
|
-
for (;
|
|
68
|
+
let _ = 1;
|
|
69
|
+
for (; _ < a.length && a.charCodeAt(_) === 47; ++_)
|
|
70
70
|
;
|
|
71
|
-
const
|
|
72
|
-
let
|
|
73
|
-
for (;
|
|
71
|
+
const c = a.length, g = c - _;
|
|
72
|
+
let b = 1;
|
|
73
|
+
for (; b < h.length && h.charCodeAt(b) === 47; ++b)
|
|
74
74
|
;
|
|
75
|
-
const
|
|
75
|
+
const k = h.length - b, q = g < k ? g : k;
|
|
76
76
|
let D = -1, P = 0;
|
|
77
77
|
for (; P <= q; ++P) {
|
|
78
78
|
if (P === q) {
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
79
|
+
if (k > q) {
|
|
80
|
+
if (h.charCodeAt(b + P) === 47)
|
|
81
|
+
return h.slice(b + P + 1);
|
|
82
82
|
if (P === 0)
|
|
83
|
-
return
|
|
84
|
-
} else
|
|
83
|
+
return h.slice(b + P);
|
|
84
|
+
} else g > q && (a.charCodeAt(_ + P) === 47 ? D = P : P === 0 && (D = 0));
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
|
-
const A =
|
|
87
|
+
const A = a.charCodeAt(_ + P), G = h.charCodeAt(b + P);
|
|
88
88
|
if (A !== G)
|
|
89
89
|
break;
|
|
90
90
|
A === 47 && (D = P);
|
|
91
91
|
}
|
|
92
92
|
let $ = "";
|
|
93
|
-
for (P =
|
|
94
|
-
(P ===
|
|
95
|
-
return $.length > 0 ? $ +
|
|
96
|
-
},
|
|
97
|
-
if (
|
|
93
|
+
for (P = _ + D + 1; P <= c; ++P)
|
|
94
|
+
(P === c || a.charCodeAt(P) === 47) && ($.length === 0 ? $ += ".." : $ += "/..");
|
|
95
|
+
return $.length > 0 ? $ + h.slice(b + D) : (b += D, h.charCodeAt(b) === 47 && ++b, h.slice(b));
|
|
96
|
+
}, n = function(a) {
|
|
97
|
+
if (t(a), a.length === 0)
|
|
98
98
|
return ".";
|
|
99
|
-
let
|
|
100
|
-
const
|
|
101
|
-
let
|
|
102
|
-
for (let
|
|
103
|
-
if (
|
|
104
|
-
if (!
|
|
105
|
-
|
|
99
|
+
let h = a.charCodeAt(0);
|
|
100
|
+
const _ = h === 47;
|
|
101
|
+
let c = -1, g = !0;
|
|
102
|
+
for (let b = a.length - 1; b >= 1; --b)
|
|
103
|
+
if (h = a.charCodeAt(b), h === 47) {
|
|
104
|
+
if (!g) {
|
|
105
|
+
c = b;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
} else
|
|
109
|
-
|
|
110
|
-
return
|
|
111
|
-
},
|
|
112
|
-
if (
|
|
109
|
+
g = !1;
|
|
110
|
+
return c === -1 ? _ ? "/" : "." : _ && c === 1 ? "//" : a.slice(0, c);
|
|
111
|
+
}, w = function(a, h) {
|
|
112
|
+
if (h !== void 0 && typeof h != "string")
|
|
113
113
|
throw new TypeError('"ext" argument must be a string');
|
|
114
|
-
|
|
115
|
-
let
|
|
116
|
-
if (
|
|
117
|
-
if (
|
|
114
|
+
t(a);
|
|
115
|
+
let _ = 0, c = -1, g = !0, b;
|
|
116
|
+
if (h !== void 0 && h.length > 0 && h.length <= a.length) {
|
|
117
|
+
if (h.length === a.length && h === a)
|
|
118
118
|
return "";
|
|
119
|
-
let
|
|
120
|
-
for (
|
|
121
|
-
const q =
|
|
119
|
+
let S = h.length - 1, k = -1;
|
|
120
|
+
for (b = a.length - 1; b >= 0; --b) {
|
|
121
|
+
const q = a.charCodeAt(b);
|
|
122
122
|
if (q === 47) {
|
|
123
|
-
if (!
|
|
124
|
-
|
|
123
|
+
if (!g) {
|
|
124
|
+
_ = b + 1;
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
} else
|
|
128
|
-
|
|
128
|
+
k === -1 && (g = !1, k = b + 1), S >= 0 && (q === h.charCodeAt(S) ? --S === -1 && (c = b) : (S = -1, c = k));
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return _ === c ? c = k : c === -1 && (c = a.length), a.slice(_, c);
|
|
131
131
|
} else {
|
|
132
|
-
for (
|
|
133
|
-
if (
|
|
134
|
-
if (!
|
|
135
|
-
|
|
132
|
+
for (b = a.length - 1; b >= 0; --b)
|
|
133
|
+
if (a.charCodeAt(b) === 47) {
|
|
134
|
+
if (!g) {
|
|
135
|
+
_ = b + 1;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
|
-
} else
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
let
|
|
144
|
-
for (let
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
147
|
-
if (!
|
|
148
|
-
|
|
138
|
+
} else c === -1 && (g = !1, c = b + 1);
|
|
139
|
+
return c === -1 ? "" : a.slice(_, c);
|
|
140
|
+
}
|
|
141
|
+
}, x = function(a) {
|
|
142
|
+
t(a);
|
|
143
|
+
let h = -1, _ = 0, c = -1, g = !0, b = 0;
|
|
144
|
+
for (let S = a.length - 1; S >= 0; --S) {
|
|
145
|
+
const k = a.charCodeAt(S);
|
|
146
|
+
if (k === 47) {
|
|
147
|
+
if (!g) {
|
|
148
|
+
_ = S + 1;
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
continue;
|
|
152
152
|
}
|
|
153
|
-
|
|
153
|
+
c === -1 && (g = !1, c = S + 1), k === 46 ? h === -1 ? h = S : b !== 1 && (b = 1) : h !== -1 && (b = -1);
|
|
154
154
|
}
|
|
155
|
-
return
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
if (
|
|
155
|
+
return h === -1 || c === -1 || // We saw a non-dot character immediately before the dot
|
|
156
|
+
b === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
157
|
+
b === 1 && h === c - 1 && h === _ + 1 ? "" : a.slice(h, c);
|
|
158
|
+
}, I = function(a) {
|
|
159
|
+
if (a === null || typeof a != "object")
|
|
160
160
|
throw new TypeError(
|
|
161
|
-
'The "pathObject" argument must be of type Object. Received type ' + typeof
|
|
161
|
+
'The "pathObject" argument must be of type Object. Received type ' + typeof a
|
|
162
162
|
);
|
|
163
|
-
return r("/",
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
const
|
|
163
|
+
return r("/", a);
|
|
164
|
+
}, y = function(a) {
|
|
165
|
+
t(a);
|
|
166
|
+
const h = {
|
|
167
167
|
root: "",
|
|
168
168
|
dir: "",
|
|
169
169
|
base: "",
|
|
170
170
|
ext: "",
|
|
171
171
|
name: ""
|
|
172
172
|
};
|
|
173
|
-
if (
|
|
174
|
-
return
|
|
175
|
-
let
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
let
|
|
179
|
-
for (; D >=
|
|
180
|
-
if (
|
|
173
|
+
if (a.length === 0)
|
|
174
|
+
return h;
|
|
175
|
+
let _ = a.charCodeAt(0), c;
|
|
176
|
+
const g = _ === 47;
|
|
177
|
+
g ? (h.root = "/", c = 1) : c = 0;
|
|
178
|
+
let b = -1, S = 0, k = -1, q = !0, D = a.length - 1, P = 0;
|
|
179
|
+
for (; D >= c; --D) {
|
|
180
|
+
if (_ = a.charCodeAt(D), _ === 47) {
|
|
181
181
|
if (!q) {
|
|
182
|
-
|
|
182
|
+
S = D + 1;
|
|
183
183
|
break;
|
|
184
184
|
}
|
|
185
185
|
continue;
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
k === -1 && (q = !1, k = D + 1), _ === 46 ? b === -1 ? b = D : P !== 1 && (P = 1) : b !== -1 && (P = -1);
|
|
188
188
|
}
|
|
189
|
-
return
|
|
189
|
+
return b === -1 || k === -1 || // We saw a non-dot character immediately before the dot
|
|
190
190
|
P === 0 || // The (right-most) trimmed path component is exactly '..'
|
|
191
|
-
P === 1 &&
|
|
192
|
-
},
|
|
191
|
+
P === 1 && b === k - 1 && b === S + 1 ? k !== -1 && (S === 0 && g ? h.base = h.name = a.slice(1, k) : h.base = h.name = a.slice(S, k)) : (S === 0 && g ? (h.name = a.slice(1, b), h.base = a.slice(1, k)) : (h.name = a.slice(S, b), h.base = a.slice(S, k)), h.ext = a.slice(b, k)), S > 0 ? h.dir = a.slice(0, S - 1) : g && (h.dir = "/"), h;
|
|
192
|
+
}, d = "/", u = ":";
|
|
193
193
|
return {
|
|
194
|
-
relative:
|
|
194
|
+
relative: f,
|
|
195
195
|
resolve: o,
|
|
196
|
-
parse:
|
|
197
|
-
format:
|
|
198
|
-
join:
|
|
199
|
-
isAbsolute:
|
|
200
|
-
basename:
|
|
201
|
-
normalize:
|
|
202
|
-
dirname:
|
|
203
|
-
extname:
|
|
204
|
-
delimiter:
|
|
205
|
-
sep:
|
|
196
|
+
parse: y,
|
|
197
|
+
format: I,
|
|
198
|
+
join: s,
|
|
199
|
+
isAbsolute: l,
|
|
200
|
+
basename: w,
|
|
201
|
+
normalize: m,
|
|
202
|
+
dirname: n,
|
|
203
|
+
extname: x,
|
|
204
|
+
delimiter: u,
|
|
205
|
+
sep: d,
|
|
206
206
|
win32: null,
|
|
207
207
|
posix: {
|
|
208
|
-
relative:
|
|
208
|
+
relative: f,
|
|
209
209
|
resolve: o,
|
|
210
|
-
parse:
|
|
211
|
-
format:
|
|
212
|
-
join:
|
|
213
|
-
isAbsolute:
|
|
214
|
-
basename:
|
|
215
|
-
normalize:
|
|
216
|
-
dirname:
|
|
217
|
-
extname:
|
|
218
|
-
delimiter:
|
|
219
|
-
sep:
|
|
210
|
+
parse: y,
|
|
211
|
+
format: I,
|
|
212
|
+
join: s,
|
|
213
|
+
isAbsolute: l,
|
|
214
|
+
basename: w,
|
|
215
|
+
normalize: m,
|
|
216
|
+
dirname: n,
|
|
217
|
+
extname: x,
|
|
218
|
+
delimiter: u,
|
|
219
|
+
sep: d,
|
|
220
220
|
win32: null,
|
|
221
221
|
posix: null
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
const
|
|
225
|
+
const jt = {
|
|
226
226
|
darwin: {
|
|
227
227
|
arm64: [
|
|
228
228
|
{
|
|
@@ -262,8 +262,8 @@ const Ut = {
|
|
|
262
262
|
]
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
async function
|
|
266
|
-
const e =
|
|
265
|
+
async function Ut() {
|
|
266
|
+
const e = Et(), t = {
|
|
267
267
|
dynamicImport: (i) => {
|
|
268
268
|
throw new Error(
|
|
269
269
|
`Qwik Optimizer sys.dynamicImport() not implemented, trying to import: "${i}"`
|
|
@@ -279,17 +279,17 @@ async function Bt() {
|
|
|
279
279
|
os: "unknown",
|
|
280
280
|
env: e
|
|
281
281
|
};
|
|
282
|
-
if (
|
|
282
|
+
if (t.path = Lt(t), t.strictDynamicImport = t.dynamicImport = (i) => import(i), e !== "webworker" && e !== "browsermain")
|
|
283
283
|
try {
|
|
284
|
-
|
|
284
|
+
t.path = await t.dynamicImport("node:path"), t.cwd = () => process.cwd(), t.os = process.platform;
|
|
285
285
|
} catch {
|
|
286
286
|
}
|
|
287
|
-
return
|
|
287
|
+
return t;
|
|
288
288
|
}
|
|
289
|
-
async function
|
|
290
|
-
const
|
|
291
|
-
if (
|
|
292
|
-
const i =
|
|
289
|
+
async function Bt(e) {
|
|
290
|
+
const t = Et();
|
|
291
|
+
if (t === "node" || t === "bun") {
|
|
292
|
+
const i = jt[process.platform];
|
|
293
293
|
if (i) {
|
|
294
294
|
const r = i[process.arch];
|
|
295
295
|
if (r)
|
|
@@ -298,32 +298,32 @@ async function At(e) {
|
|
|
298
298
|
return (await e.dynamicImport("node:module")).default.createRequire(import.meta.url)(
|
|
299
299
|
`../bindings/${o.platformArchABI}`
|
|
300
300
|
);
|
|
301
|
-
} catch (
|
|
301
|
+
} catch (m) {
|
|
302
302
|
console.warn(
|
|
303
303
|
`Unable to load native binding ${o.platformArchABI}. Falling back to wasm build.`,
|
|
304
|
-
|
|
304
|
+
m?.message
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
if (
|
|
310
|
-
const i = await e.dynamicImport("node:url"), r = e.path.dirname(i.fileURLToPath(import.meta.url)), o = e.path.join(r, "..", "bindings", "qwik_wasm_bg.wasm"),
|
|
311
|
-
return await
|
|
309
|
+
if (t === "node" || t === "bun") {
|
|
310
|
+
const i = await e.dynamicImport("node:url"), r = e.path.dirname(i.fileURLToPath(import.meta.url)), o = e.path.join(r, "..", "bindings", "qwik_wasm_bg.wasm"), m = await e.dynamicImport("../bindings/qwik.wasm.mjs"), s = await (await e.dynamicImport("node:fs")).promises.readFile(o), f = await WebAssembly.compile(s);
|
|
311
|
+
return await m.default(f), m;
|
|
312
312
|
} else {
|
|
313
313
|
const i = await e.dynamicImport("../bindings/qwik.wasm.mjs");
|
|
314
314
|
return await i.default(), i;
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
const
|
|
318
|
-
const
|
|
317
|
+
const Et = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof process < "u" && typeof global < "u" && process.versions && process.versions.node ? "node" : typeof self < "u" && typeof location < "u" && typeof navigator < "u" && typeof fetch == "function" && typeof WorkerGlobalScope == "function" && typeof self.importScripts == "function" ? "webworker" : typeof window < "u" && typeof document < "u" && typeof location < "u" && typeof navigator < "u" && typeof Window == "function" && typeof fetch == "function" ? "browsermain" : "unknown", At = async (e = {}) => {
|
|
318
|
+
const t = e?.sys || await Ut(), i = e?.binding || await Bt(t);
|
|
319
319
|
return {
|
|
320
320
|
async transformModules(o) {
|
|
321
|
-
return
|
|
321
|
+
return Ft(i, o);
|
|
322
322
|
},
|
|
323
|
-
sys:
|
|
323
|
+
sys: t
|
|
324
324
|
};
|
|
325
|
-
},
|
|
326
|
-
const
|
|
325
|
+
}, Ft = (e, t) => e.transform_modules(Rt(t)), Rt = (e) => {
|
|
326
|
+
const t = {
|
|
327
327
|
minify: "simplify",
|
|
328
328
|
sourceMaps: !1,
|
|
329
329
|
transpileTs: !1,
|
|
@@ -341,53 +341,53 @@ const _t = () => typeof Deno < "u" ? "deno" : typeof Bun < "u" ? "bun" : typeof
|
|
|
341
341
|
isServer: void 0
|
|
342
342
|
};
|
|
343
343
|
return Object.entries(e).forEach(([i, r]) => {
|
|
344
|
-
r != null && (
|
|
345
|
-
}),
|
|
346
|
-
},
|
|
347
|
-
qwik: "2.0.0-beta.
|
|
348
|
-
},
|
|
344
|
+
r != null && (t[i] = r);
|
|
345
|
+
}), t.entryStrategy = e.entryStrategy?.type ?? "smart", t.manualChunks = e.entryStrategy?.manual ?? void 0, t;
|
|
346
|
+
}, Rr = {
|
|
347
|
+
qwik: "2.0.0-beta.24-dev+314726b"
|
|
348
|
+
}, $t = (e, t = 0) => {
|
|
349
349
|
for (let i = 0; i < e.length; i++) {
|
|
350
350
|
const r = e.charCodeAt(i);
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
return Number(Math.abs(
|
|
354
|
-
},
|
|
355
|
-
function
|
|
356
|
-
const
|
|
357
|
-
return Object.keys(
|
|
358
|
-
const o =
|
|
359
|
-
if (o.ctxKind === "eventHandler" &&
|
|
351
|
+
t = (t << 5) - t + r, t |= 0;
|
|
352
|
+
}
|
|
353
|
+
return Number(Math.abs(t)).toString(36);
|
|
354
|
+
}, zt = /* @__PURE__ */ new Set(["_chk", "_rsc", "_res", "_run", "_task", "_val"]);
|
|
355
|
+
function Ht(e) {
|
|
356
|
+
const t = e.symbols;
|
|
357
|
+
return Object.keys(t).sort((i, r) => {
|
|
358
|
+
const o = t[i], m = t[r];
|
|
359
|
+
if (o.ctxKind === "eventHandler" && m.ctxKind !== "eventHandler")
|
|
360
360
|
return -1;
|
|
361
|
-
if (o.ctxKind !== "eventHandler" &&
|
|
361
|
+
if (o.ctxKind !== "eventHandler" && m.ctxKind === "eventHandler")
|
|
362
362
|
return 1;
|
|
363
|
-
if (o.ctxKind === "eventHandler" &&
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
if (
|
|
363
|
+
if (o.ctxKind === "eventHandler" && m.ctxKind === "eventHandler") {
|
|
364
|
+
const l = Ve.indexOf(o.ctxName.toLowerCase()), s = Ve.indexOf(m.ctxName.toLowerCase());
|
|
365
|
+
if (l > -1 && s > -1) {
|
|
366
|
+
if (l < s)
|
|
367
367
|
return -1;
|
|
368
|
-
if (
|
|
368
|
+
if (l > s)
|
|
369
369
|
return 1;
|
|
370
370
|
} else {
|
|
371
|
-
if (
|
|
371
|
+
if (l > -1)
|
|
372
372
|
return -1;
|
|
373
|
-
if (
|
|
373
|
+
if (s > -1)
|
|
374
374
|
return 1;
|
|
375
375
|
}
|
|
376
|
-
} else if (o.ctxKind === "function" &&
|
|
377
|
-
const
|
|
378
|
-
if (
|
|
379
|
-
if (
|
|
376
|
+
} else if (o.ctxKind === "function" && m.ctxKind === "function") {
|
|
377
|
+
const l = Ze.indexOf(o.ctxName.toLowerCase()), s = Ze.indexOf(m.ctxName.toLowerCase());
|
|
378
|
+
if (l > -1 && s > -1) {
|
|
379
|
+
if (l < s)
|
|
380
380
|
return -1;
|
|
381
|
-
if (
|
|
381
|
+
if (l > s)
|
|
382
382
|
return 1;
|
|
383
383
|
} else {
|
|
384
|
-
if (
|
|
384
|
+
if (l > -1)
|
|
385
385
|
return -1;
|
|
386
|
-
if (
|
|
386
|
+
if (s > -1)
|
|
387
387
|
return 1;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
return !o.parent &&
|
|
390
|
+
return !o.parent && m.parent ? -1 : o.parent && !m.parent ? 1 : o.hash < m.hash ? -1 : o.hash > m.hash ? 1 : 0;
|
|
391
391
|
});
|
|
392
392
|
}
|
|
393
393
|
const Ve = [
|
|
@@ -449,108 +449,107 @@ const Ve = [
|
|
|
449
449
|
].map((e) => `on${e.toLowerCase()}$`), Ze = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
|
|
450
450
|
(e) => e.toLowerCase()
|
|
451
451
|
);
|
|
452
|
-
function
|
|
452
|
+
function Wt(e) {
|
|
453
453
|
return Object.keys(e.bundles).sort(je);
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
const
|
|
457
|
-
for (const
|
|
458
|
-
i[
|
|
459
|
-
const o =
|
|
460
|
-
for (const
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
Array.isArray(
|
|
464
|
-
const
|
|
465
|
-
for (const
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
return e.symbols = i, e.mapping = r, e.bundles =
|
|
455
|
+
function Gt(e) {
|
|
456
|
+
const t = Ht(e), i = {}, r = {};
|
|
457
|
+
for (const l of t)
|
|
458
|
+
i[l] = e.symbols[l], r[l] = e.mapping[l];
|
|
459
|
+
const o = Wt(e), m = {};
|
|
460
|
+
for (const l of o) {
|
|
461
|
+
m[l] = e.bundles[l];
|
|
462
|
+
const s = e.bundles[l];
|
|
463
|
+
Array.isArray(s.imports) && s.imports.sort(je), Array.isArray(s.dynamicImports) && s.dynamicImports.sort(je);
|
|
464
|
+
const f = [];
|
|
465
|
+
for (const n of t)
|
|
466
|
+
l === r[n] && f.push(n);
|
|
467
|
+
f.length > 0 && (f.sort(je), s.symbols = f);
|
|
468
|
+
}
|
|
469
|
+
return e.symbols = i, e.mapping = r, e.bundles = m, e;
|
|
470
470
|
}
|
|
471
|
-
function je(e,
|
|
472
|
-
return e = e.toLocaleLowerCase(),
|
|
471
|
+
function je(e, t) {
|
|
472
|
+
return e = e.toLocaleLowerCase(), t = t.toLocaleLowerCase(), e < t ? -1 : e > t ? 1 : 0;
|
|
473
473
|
}
|
|
474
474
|
function et(e) {
|
|
475
475
|
if (e != null && e.mapping != null && typeof e.mapping == "object" && e.symbols != null && typeof e.symbols == "object" && e.bundles != null && typeof e.bundles == "object")
|
|
476
476
|
return e;
|
|
477
477
|
}
|
|
478
|
-
const
|
|
478
|
+
const Kt = (e, t) => {
|
|
479
479
|
let i = 0;
|
|
480
480
|
if (e.symbols)
|
|
481
481
|
for (const r of e.symbols) {
|
|
482
482
|
let o = 1;
|
|
483
|
-
const
|
|
484
|
-
|
|
483
|
+
const m = t.symbols[r];
|
|
484
|
+
m && (m.ctxKind === "function" ? /(component|useStyles|useStylesScoped)/i.test(m.ctxName) ? o += 1 : /(useComputed|useTask|useVisibleTask|useOn)/i.test(m.ctxName) && (o += 2) : (o += 1, /(click|mouse|pointer|touch|key|scroll|gesture|wheel)/i.test(m.ctxName) && (o += 3))), i = Math.max(i, o);
|
|
485
485
|
}
|
|
486
486
|
return i;
|
|
487
487
|
};
|
|
488
|
-
function
|
|
489
|
-
let
|
|
490
|
-
const i = [], r = [], o = /* @__PURE__ */ new Map(),
|
|
491
|
-
function
|
|
492
|
-
o.set(
|
|
493
|
-
const
|
|
494
|
-
for (const
|
|
495
|
-
o.has(
|
|
496
|
-
if (
|
|
497
|
-
const
|
|
498
|
-
let
|
|
488
|
+
function Qt(e) {
|
|
489
|
+
let t = 0;
|
|
490
|
+
const i = [], r = [], o = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
|
|
491
|
+
function s(d) {
|
|
492
|
+
o.set(d, t), m.set(d, t), t++, i.push(d), l.add(d);
|
|
493
|
+
const u = e[d].imports || [];
|
|
494
|
+
for (const p of u)
|
|
495
|
+
o.has(p) ? l.has(p) && m.set(d, Math.min(m.get(d), o.get(p))) : (s(p), m.set(d, Math.min(m.get(d), m.get(p))));
|
|
496
|
+
if (m.get(d) === o.get(d)) {
|
|
497
|
+
const p = [];
|
|
498
|
+
let a;
|
|
499
499
|
do
|
|
500
|
-
|
|
501
|
-
while (
|
|
502
|
-
r.push(
|
|
500
|
+
a = i.pop(), l.delete(a), p.push(a);
|
|
501
|
+
while (a !== d);
|
|
502
|
+
r.push(p);
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
for (const
|
|
506
|
-
o.has(
|
|
507
|
-
const
|
|
508
|
-
r.forEach((
|
|
509
|
-
for (const
|
|
510
|
-
|
|
505
|
+
for (const d of Object.keys(e))
|
|
506
|
+
o.has(d) || s(d);
|
|
507
|
+
const f = /* @__PURE__ */ new Map();
|
|
508
|
+
r.forEach((d, u) => {
|
|
509
|
+
for (const p of d)
|
|
510
|
+
f.set(p, u);
|
|
511
511
|
});
|
|
512
|
-
const
|
|
513
|
-
for (const
|
|
514
|
-
const
|
|
515
|
-
for (const
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
const
|
|
521
|
-
function
|
|
522
|
-
|
|
523
|
-
for (const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
for (let
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
const
|
|
531
|
-
for (let
|
|
532
|
-
let
|
|
533
|
-
for (const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
for (let
|
|
538
|
-
const
|
|
539
|
-
let
|
|
540
|
-
for (const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
for (let
|
|
545
|
-
const
|
|
546
|
-
for (const
|
|
547
|
-
e[
|
|
512
|
+
const n = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
|
|
513
|
+
for (const d of Object.keys(e)) {
|
|
514
|
+
const u = f.get(d);
|
|
515
|
+
for (const p of e[d].imports || []) {
|
|
516
|
+
const a = f.get(p);
|
|
517
|
+
u !== a && n[u].add(a);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
const w = /* @__PURE__ */ new Set(), x = [];
|
|
521
|
+
function I(d) {
|
|
522
|
+
w.add(d);
|
|
523
|
+
for (const u of n[d])
|
|
524
|
+
w.has(u) || I(u);
|
|
525
|
+
x.push(d);
|
|
526
|
+
}
|
|
527
|
+
for (let d = 0; d < r.length; d++)
|
|
528
|
+
w.has(d) || I(d);
|
|
529
|
+
x.reverse();
|
|
530
|
+
const y = new Array(r.length).fill(0);
|
|
531
|
+
for (let d = 0; d < r.length; d++) {
|
|
532
|
+
let u = 0;
|
|
533
|
+
for (const p of r[d])
|
|
534
|
+
u += e[p].size;
|
|
535
|
+
y[d] = u;
|
|
536
|
+
}
|
|
537
|
+
for (let d = x.length - 1; d >= 0; d--) {
|
|
538
|
+
const u = x[d];
|
|
539
|
+
let p = y[u];
|
|
540
|
+
for (const a of n[u])
|
|
541
|
+
p += y[a];
|
|
542
|
+
y[u] = p;
|
|
543
|
+
}
|
|
544
|
+
for (let d = 0; d < r.length; d++) {
|
|
545
|
+
const u = y[d];
|
|
546
|
+
for (const p of r[d])
|
|
547
|
+
e[p].total = u;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
const tt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, nt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, rt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js
|
|
551
|
-
function
|
|
552
|
-
|
|
553
|
-
const a = {
|
|
550
|
+
const tt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, nt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, rt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
|
|
551
|
+
function Jt(e, t, i, r, o, m, l) {
|
|
552
|
+
const s = {
|
|
554
553
|
version: "1",
|
|
555
554
|
manifestHash: "",
|
|
556
555
|
options: {
|
|
@@ -569,192 +568,191 @@ function Yt(e, n, i, r, o, g, d) {
|
|
|
569
568
|
assets: {},
|
|
570
569
|
symbols: {},
|
|
571
570
|
bundleGraph: void 0
|
|
572
|
-
},
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
console.warn(`Client manifest generation: skipping external import "${
|
|
571
|
+
}, f = (y) => {
|
|
572
|
+
const d = r[y];
|
|
573
|
+
if (!d) {
|
|
574
|
+
console.warn(`Client manifest generation: skipping external import "${y}"`);
|
|
576
575
|
return;
|
|
577
576
|
}
|
|
578
|
-
return d
|
|
577
|
+
return l(d.fileName);
|
|
579
578
|
};
|
|
580
|
-
let
|
|
581
|
-
for (const
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
size: s.source.length
|
|
579
|
+
let n, w, x;
|
|
580
|
+
for (const y of Object.values(r)) {
|
|
581
|
+
const d = f(y.fileName);
|
|
582
|
+
y.name === "core" && (n = d), y.name === "preloader" && (w = d), y.name === "handlers" && (x = d);
|
|
583
|
+
}
|
|
584
|
+
const I = new Set(t.map((y) => y.name));
|
|
585
|
+
for (const y of Object.values(r)) {
|
|
586
|
+
if (y.type === "asset") {
|
|
587
|
+
y.fileName.endsWith("js.map") || (s.assets[y.fileName] = {
|
|
588
|
+
name: y.names[0],
|
|
589
|
+
size: y.source.length
|
|
592
590
|
});
|
|
593
591
|
continue;
|
|
594
592
|
}
|
|
595
|
-
const
|
|
596
|
-
size:
|
|
593
|
+
const d = l(y.fileName), p = {
|
|
594
|
+
size: y.code.length,
|
|
597
595
|
total: -1
|
|
598
596
|
};
|
|
599
|
-
for (const
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
for (const
|
|
609
|
-
const
|
|
610
|
-
if (!
|
|
611
|
-
|
|
597
|
+
for (const g of y.exports)
|
|
598
|
+
I.has(g) && (!s.mapping[g] || y.exports.length !== 1) && (s.mapping[g] = d);
|
|
599
|
+
const a = y.imports.filter((g) => y.code.includes(e.basename(g))).map((g) => f(g)).filter((g) => g !== w && g !== n && g !== x).filter(Boolean);
|
|
600
|
+
a.length > 0 && (p.imports = a);
|
|
601
|
+
const h = y.dynamicImports.filter((g) => y.code.includes(e.basename(g))).map((g) => f(g)).filter(Boolean);
|
|
602
|
+
h.length > 0 && (p.dynamicImports = h), y.facadeModuleId && (tt.test(y.facadeModuleId) ? s.preloader = d : nt.test(y.facadeModuleId) ? s.core = d : rt.test(y.facadeModuleId) && (s.qwikLoader = d));
|
|
603
|
+
const c = (y.moduleIds || Object.keys(y.modules)).filter((g) => !g.startsWith("\0")).map((g) => e.relative(o.rootDir, g));
|
|
604
|
+
c.length > 0 && (p.origins = c, !s.preloader && c.some((g) => tt.test(g)) && (s.preloader = d), !s.core && c.some((g) => nt.test(g)) && (s.core = d), !s.qwikLoader && c.some((g) => rt.test(g)) && (s.qwikLoader = d)), s.bundles[d] = p;
|
|
605
|
+
}
|
|
606
|
+
for (const y of t) {
|
|
607
|
+
const d = y.name, u = s.mapping[d];
|
|
608
|
+
if (!u) {
|
|
609
|
+
m(`Note: qrl ${y.name} is not in the bundle, likely tree shaken`, s);
|
|
612
610
|
continue;
|
|
613
611
|
}
|
|
614
|
-
(
|
|
615
|
-
displayName:
|
|
616
|
-
hash:
|
|
617
|
-
ctxKind:
|
|
618
|
-
ctxName:
|
|
619
|
-
captures:
|
|
620
|
-
canonicalFilename:
|
|
621
|
-
parent:
|
|
622
|
-
origin:
|
|
623
|
-
loc:
|
|
624
|
-
paramNames:
|
|
625
|
-
captureNames:
|
|
612
|
+
(s.bundles[u].symbols ||= []).push(d), s.symbols[d] = {
|
|
613
|
+
displayName: y.displayName,
|
|
614
|
+
hash: y.hash,
|
|
615
|
+
ctxKind: y.ctxKind,
|
|
616
|
+
ctxName: y.ctxName,
|
|
617
|
+
captures: y.captures,
|
|
618
|
+
canonicalFilename: y.canonicalFilename,
|
|
619
|
+
parent: y.parent,
|
|
620
|
+
origin: y.origin,
|
|
621
|
+
loc: y.loc,
|
|
622
|
+
paramNames: y.paramNames,
|
|
623
|
+
captureNames: y.captureNames
|
|
626
624
|
};
|
|
627
625
|
}
|
|
628
|
-
if (
|
|
629
|
-
for (const
|
|
630
|
-
|
|
626
|
+
if (x)
|
|
627
|
+
for (const y of zt)
|
|
628
|
+
s.symbols[y] = {
|
|
631
629
|
origin: "Qwik core",
|
|
632
|
-
displayName:
|
|
630
|
+
displayName: y,
|
|
633
631
|
canonicalFilename: "",
|
|
634
|
-
hash:
|
|
632
|
+
hash: y,
|
|
635
633
|
ctxKind: "function",
|
|
636
|
-
ctxName:
|
|
634
|
+
ctxName: y,
|
|
637
635
|
captures: !1,
|
|
638
636
|
parent: null,
|
|
639
637
|
loc: [0, 0]
|
|
640
|
-
},
|
|
638
|
+
}, s.mapping[y] = x;
|
|
641
639
|
else
|
|
642
640
|
console.error("Qwik core bundle not found, is Qwik actually used in this project?");
|
|
643
|
-
for (const
|
|
644
|
-
const
|
|
645
|
-
|
|
641
|
+
for (const y of Object.values(s.bundles)) {
|
|
642
|
+
const d = Kt(y, s);
|
|
643
|
+
y.interactivity = d;
|
|
646
644
|
}
|
|
647
|
-
return
|
|
645
|
+
return Qt(s.bundles), Gt(s);
|
|
648
646
|
}
|
|
649
|
-
const
|
|
650
|
-
const
|
|
651
|
-
return
|
|
647
|
+
const Yt = 300, Xt = 0.5 / (Yt * 1024 / 8), Vt = (e) => {
|
|
648
|
+
const t = e.lastIndexOf("_");
|
|
649
|
+
return t > -1 ? e.slice(t + 1) : e;
|
|
652
650
|
};
|
|
653
|
-
function
|
|
651
|
+
function Zt(e, t) {
|
|
654
652
|
const i = [];
|
|
655
653
|
if (!e.bundles)
|
|
656
654
|
return [];
|
|
657
655
|
const r = { ...e.bundles };
|
|
658
|
-
for (const [
|
|
659
|
-
if (
|
|
656
|
+
for (const [f, n] of Object.entries(e.mapping)) {
|
|
657
|
+
if (f.startsWith("_") && f.length < 10)
|
|
660
658
|
continue;
|
|
661
|
-
const
|
|
662
|
-
|
|
659
|
+
const w = Vt(f);
|
|
660
|
+
w && (r[w] = { dynamicImports: [n] });
|
|
663
661
|
}
|
|
664
|
-
if (
|
|
665
|
-
const
|
|
666
|
-
for (const
|
|
667
|
-
const
|
|
668
|
-
|
|
662
|
+
if (t) {
|
|
663
|
+
const f = { ...e, bundles: r };
|
|
664
|
+
for (const n of t) {
|
|
665
|
+
const w = n(f);
|
|
666
|
+
w && Object.assign(r, w);
|
|
669
667
|
}
|
|
670
668
|
}
|
|
671
|
-
for (const
|
|
672
|
-
const
|
|
669
|
+
for (const f of Object.keys(r)) {
|
|
670
|
+
const n = r[f], w = n.imports?.filter((I) => r[I]) || [], x = n.dynamicImports?.filter(
|
|
673
671
|
// we only want to include dynamic imports that belong to the app
|
|
674
672
|
// e.g. not all languages supported by shiki
|
|
675
|
-
(
|
|
676
|
-
(r[
|
|
677
|
-
r[
|
|
673
|
+
(I) => r[I] && // either there are qrls
|
|
674
|
+
(r[I].symbols || // or it's a dynamic import from the app source
|
|
675
|
+
r[I].origins?.some((y) => !y.includes("node_modules")))
|
|
678
676
|
) || [];
|
|
679
|
-
r[
|
|
680
|
-
...
|
|
681
|
-
imports:
|
|
682
|
-
dynamicImports:
|
|
677
|
+
r[f] = {
|
|
678
|
+
...n,
|
|
679
|
+
imports: w,
|
|
680
|
+
dynamicImports: x
|
|
683
681
|
};
|
|
684
682
|
}
|
|
685
683
|
const o = new Set(Object.keys(r));
|
|
686
|
-
for (const
|
|
687
|
-
for (const
|
|
688
|
-
o.delete(
|
|
689
|
-
for (const
|
|
690
|
-
o.delete(
|
|
691
|
-
}
|
|
692
|
-
for (const
|
|
693
|
-
const
|
|
694
|
-
!
|
|
695
|
-
}
|
|
696
|
-
const
|
|
697
|
-
const
|
|
698
|
-
for (const
|
|
699
|
-
|
|
684
|
+
for (const f of Object.keys(r)) {
|
|
685
|
+
for (const n of r[f].imports)
|
|
686
|
+
o.delete(n);
|
|
687
|
+
for (const n of r[f].dynamicImports)
|
|
688
|
+
o.delete(n);
|
|
689
|
+
}
|
|
690
|
+
for (const f of o) {
|
|
691
|
+
const n = r[f];
|
|
692
|
+
!n.imports?.length && !n.dynamicImports?.length && delete r[f];
|
|
693
|
+
}
|
|
694
|
+
const m = Object.keys(r), l = /* @__PURE__ */ new Map(), s = (f, n, w = /* @__PURE__ */ new Set()) => {
|
|
695
|
+
const x = r[n];
|
|
696
|
+
for (const I of x.imports)
|
|
697
|
+
f.has(I) && f.delete(I), w.has(I) || (w.add(I), s(f, I, w));
|
|
700
698
|
};
|
|
701
|
-
for (const
|
|
702
|
-
const
|
|
703
|
-
for (const
|
|
704
|
-
|
|
705
|
-
const
|
|
706
|
-
for (const
|
|
707
|
-
|
|
708
|
-
const
|
|
709
|
-
let
|
|
710
|
-
if (
|
|
711
|
-
for (const
|
|
712
|
-
if (
|
|
713
|
-
|
|
699
|
+
for (const f of m) {
|
|
700
|
+
const n = r[f], w = new Set(n.imports);
|
|
701
|
+
for (const d of w)
|
|
702
|
+
s(w, d);
|
|
703
|
+
const x = new Set(n.dynamicImports), I = /* @__PURE__ */ new Map();
|
|
704
|
+
for (const d of x) {
|
|
705
|
+
s(x, d);
|
|
706
|
+
const u = r[d];
|
|
707
|
+
let p = 0.5;
|
|
708
|
+
if (p += (u.interactivity || 0) * 0.08, n.origins && u.origins) {
|
|
709
|
+
for (const a of n.origins)
|
|
710
|
+
if (u.origins.some((h) => h.startsWith(a))) {
|
|
711
|
+
p += 0.25;
|
|
714
712
|
break;
|
|
715
713
|
}
|
|
716
714
|
}
|
|
717
|
-
|
|
715
|
+
u.total > Xt && (p += p > 0.5 ? 0.02 : -0.02), u.total < 1e3 && (p += 0.15), I.set(d, Math.min(p, 0.99));
|
|
718
716
|
}
|
|
719
|
-
if (
|
|
720
|
-
const
|
|
721
|
-
(
|
|
717
|
+
if (x.size > 0) {
|
|
718
|
+
const d = Array.from(x).sort(
|
|
719
|
+
(p, a) => I.get(a) - I.get(p)
|
|
722
720
|
);
|
|
723
|
-
let
|
|
724
|
-
for (const
|
|
725
|
-
|
|
721
|
+
let u = -1;
|
|
722
|
+
for (const p of d)
|
|
723
|
+
I.get(p) !== u && (u = I.get(p), w.add(-Math.round(u * 10))), w.add(p);
|
|
726
724
|
}
|
|
727
|
-
const
|
|
728
|
-
i.push(
|
|
729
|
-
for (let
|
|
725
|
+
const y = i.length;
|
|
726
|
+
i.push(f);
|
|
727
|
+
for (let d = 0; d < w.size; d++)
|
|
730
728
|
i.push(null);
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
for (const
|
|
734
|
-
const
|
|
735
|
-
let { index:
|
|
736
|
-
|
|
737
|
-
for (const
|
|
738
|
-
if (typeof
|
|
739
|
-
i[
|
|
729
|
+
l.set(f, { index: y, deps: w });
|
|
730
|
+
}
|
|
731
|
+
for (const f of m) {
|
|
732
|
+
const n = l.get(f);
|
|
733
|
+
let { index: w, deps: x } = n;
|
|
734
|
+
w++;
|
|
735
|
+
for (const I of x) {
|
|
736
|
+
if (typeof I == "number") {
|
|
737
|
+
i[w++] = I;
|
|
740
738
|
continue;
|
|
741
739
|
}
|
|
742
|
-
const
|
|
743
|
-
i[
|
|
740
|
+
const d = l.get(I).index;
|
|
741
|
+
i[w++] = d;
|
|
744
742
|
}
|
|
745
743
|
}
|
|
746
744
|
return i;
|
|
747
745
|
}
|
|
748
|
-
async function
|
|
746
|
+
async function en(e, t, i) {
|
|
749
747
|
const r = await e.dynamicImport("eslint");
|
|
750
748
|
let o = new r.ESLint({ cache: !0 });
|
|
751
749
|
if ((await o.calculateConfigForFile("no-real-file.tsx")).parser === null) {
|
|
752
|
-
const
|
|
750
|
+
const s = {
|
|
753
751
|
cache: !0,
|
|
754
752
|
overrideConfig: {
|
|
755
753
|
languageOptions: {
|
|
756
754
|
parserOptions: {
|
|
757
|
-
tsconfigRootDir:
|
|
755
|
+
tsconfigRootDir: t,
|
|
758
756
|
project: i,
|
|
759
757
|
ecmaVersion: 2021,
|
|
760
758
|
sourceType: "module",
|
|
@@ -765,80 +763,80 @@ async function tn(e, n, i) {
|
|
|
765
763
|
}
|
|
766
764
|
}
|
|
767
765
|
};
|
|
768
|
-
o = new r.ESLint(
|
|
766
|
+
o = new r.ESLint(s);
|
|
769
767
|
}
|
|
770
768
|
return {
|
|
771
|
-
async lint(
|
|
769
|
+
async lint(s, f, n) {
|
|
772
770
|
try {
|
|
773
|
-
const
|
|
774
|
-
if (await o.isPathIgnored(
|
|
771
|
+
const w = tn(n);
|
|
772
|
+
if (await o.isPathIgnored(w))
|
|
775
773
|
return null;
|
|
776
|
-
(await o.lintText(
|
|
777
|
-
filePath:
|
|
778
|
-
})).forEach((
|
|
779
|
-
for (const
|
|
780
|
-
if (
|
|
774
|
+
(await o.lintText(f, {
|
|
775
|
+
filePath: w
|
|
776
|
+
})).forEach((I) => {
|
|
777
|
+
for (const y of I.messages) {
|
|
778
|
+
if (y.ruleId != null && !y.ruleId.startsWith("qwik/"))
|
|
781
779
|
continue;
|
|
782
|
-
const
|
|
783
|
-
|
|
780
|
+
const d = nn(I.filePath, y);
|
|
781
|
+
s.warn(d);
|
|
784
782
|
}
|
|
785
783
|
});
|
|
786
|
-
} catch (
|
|
787
|
-
console.warn(
|
|
784
|
+
} catch (w) {
|
|
785
|
+
console.warn(w);
|
|
788
786
|
}
|
|
789
787
|
}
|
|
790
788
|
};
|
|
791
789
|
}
|
|
792
|
-
function
|
|
790
|
+
function tn(e) {
|
|
793
791
|
return e.split("?", 2)[0];
|
|
794
792
|
}
|
|
795
|
-
function
|
|
796
|
-
return Object.assign(new Error(
|
|
793
|
+
function nn(e, t) {
|
|
794
|
+
return Object.assign(new Error(t.message), {
|
|
797
795
|
id: e,
|
|
798
796
|
plugin: "vite-plugin-eslint",
|
|
799
797
|
loc: {
|
|
800
798
|
file: e,
|
|
801
|
-
column:
|
|
802
|
-
line:
|
|
799
|
+
column: t.column,
|
|
800
|
+
line: t.line
|
|
803
801
|
},
|
|
804
802
|
stack: ""
|
|
805
803
|
});
|
|
806
804
|
}
|
|
807
|
-
async function
|
|
808
|
-
const i =
|
|
805
|
+
async function rn(e, t) {
|
|
806
|
+
const i = t;
|
|
809
807
|
let r = i.loc;
|
|
810
|
-
if (!i.frame && !i.plugin && (r || (r =
|
|
811
|
-
const o = await e.dynamicImport("node:fs"), { normalizePath:
|
|
812
|
-
i.id =
|
|
808
|
+
if (!i.frame && !i.plugin && (r || (r = on(i)), r && (i.loc = r, r.file))) {
|
|
809
|
+
const o = await e.dynamicImport("node:fs"), { normalizePath: m } = await e.dynamicImport("vite");
|
|
810
|
+
i.id = m(i.loc.file);
|
|
813
811
|
try {
|
|
814
|
-
const
|
|
815
|
-
i.frame =
|
|
812
|
+
const l = o.readFileSync(i.loc.file, "utf-8");
|
|
813
|
+
i.frame = an(l, i.loc);
|
|
816
814
|
} catch {
|
|
817
815
|
}
|
|
818
816
|
}
|
|
819
|
-
return
|
|
817
|
+
return t;
|
|
820
818
|
}
|
|
821
|
-
const
|
|
822
|
-
const
|
|
823
|
-
if (typeof
|
|
824
|
-
const i =
|
|
819
|
+
const on = (e) => {
|
|
820
|
+
const t = e.stack;
|
|
821
|
+
if (typeof t == "string") {
|
|
822
|
+
const i = t.split(`
|
|
825
823
|
`).filter((r) => !r.includes("/node_modules/") && !r.includes("(node:"));
|
|
826
824
|
for (let r = 1; r < i.length; r++) {
|
|
827
825
|
const o = i[r].replace("file:///", "/");
|
|
828
826
|
if (/^\s+at/.test(o)) {
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
return typeof
|
|
833
|
-
file:
|
|
834
|
-
line:
|
|
835
|
-
column:
|
|
836
|
-
}) : typeof
|
|
837
|
-
file:
|
|
838
|
-
line:
|
|
827
|
+
const m = o.indexOf("/"), l = o.lastIndexOf(")", m);
|
|
828
|
+
if (m > 0) {
|
|
829
|
+
const f = o.slice(m, l).split(":"), n = ot(f[f.length - 1]), w = ot(f[f.length - 2]);
|
|
830
|
+
return typeof n == "number" && typeof w == "number" ? (f.length -= 2, {
|
|
831
|
+
file: f.join(":"),
|
|
832
|
+
line: w,
|
|
833
|
+
column: n
|
|
834
|
+
}) : typeof n == "number" ? (f.length -= 1, {
|
|
835
|
+
file: f.join(":"),
|
|
836
|
+
line: n,
|
|
839
837
|
column: void 0
|
|
840
838
|
}) : {
|
|
841
|
-
file:
|
|
839
|
+
file: f.join(":"),
|
|
842
840
|
line: void 0,
|
|
843
841
|
column: void 0
|
|
844
842
|
};
|
|
@@ -846,66 +844,66 @@ const sn = (e) => {
|
|
|
846
844
|
}
|
|
847
845
|
}
|
|
848
846
|
}
|
|
849
|
-
}, Z = (e) => e.startsWith("\0"),
|
|
847
|
+
}, Z = (e) => e.startsWith("\0"), ot = (e) => {
|
|
850
848
|
try {
|
|
851
849
|
return parseInt(e, 10);
|
|
852
850
|
} catch {
|
|
853
851
|
return;
|
|
854
852
|
}
|
|
855
|
-
},
|
|
856
|
-
function
|
|
857
|
-
if (typeof
|
|
858
|
-
return
|
|
859
|
-
if (
|
|
860
|
-
return
|
|
861
|
-
const i = e.split(
|
|
862
|
-
let
|
|
863
|
-
for (let
|
|
864
|
-
|
|
865
|
-
return
|
|
853
|
+
}, _t = /\r?\n/, it = 2;
|
|
854
|
+
function sn(e, t) {
|
|
855
|
+
if (typeof t == "number")
|
|
856
|
+
return t;
|
|
857
|
+
if (t.lo != null)
|
|
858
|
+
return t.lo;
|
|
859
|
+
const i = e.split(_t), { line: r, column: o } = t;
|
|
860
|
+
let m = 0;
|
|
861
|
+
for (let l = 0; l < r - 1 && l < i.length; l++)
|
|
862
|
+
m += i[l].length + 1;
|
|
863
|
+
return m + o;
|
|
866
864
|
}
|
|
867
|
-
function
|
|
868
|
-
|
|
869
|
-
const r = e.split(
|
|
865
|
+
function an(e, t = 0, i) {
|
|
866
|
+
t = sn(e, t), i = i || t;
|
|
867
|
+
const r = e.split(_t);
|
|
870
868
|
let o = 0;
|
|
871
|
-
const
|
|
872
|
-
for (let
|
|
873
|
-
if (o += r[
|
|
874
|
-
for (let
|
|
875
|
-
if (
|
|
869
|
+
const m = [];
|
|
870
|
+
for (let l = 0; l < r.length; l++)
|
|
871
|
+
if (o += r[l].length + 1, o >= t) {
|
|
872
|
+
for (let s = l - it; s <= l + it || i > o; s++) {
|
|
873
|
+
if (s < 0 || s >= r.length)
|
|
876
874
|
continue;
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
} else if (
|
|
875
|
+
const f = s + 1;
|
|
876
|
+
m.push(`${f}${" ".repeat(Math.max(3 - String(f).length, 0))}| ${r[s]}`);
|
|
877
|
+
const n = r[s].length;
|
|
878
|
+
if (s === l) {
|
|
879
|
+
const w = Math.max(t - (o - n) + 1, 0), x = Math.max(1, i > o ? n - w : i - t);
|
|
880
|
+
m.push(" | " + " ".repeat(w) + "^".repeat(x));
|
|
881
|
+
} else if (s > l) {
|
|
884
882
|
if (i > o) {
|
|
885
|
-
const
|
|
886
|
-
|
|
883
|
+
const w = Math.max(Math.min(i - o, n), 1);
|
|
884
|
+
m.push(" | " + "^".repeat(w));
|
|
887
885
|
}
|
|
888
|
-
o +=
|
|
886
|
+
o += n + 1;
|
|
889
887
|
}
|
|
890
888
|
}
|
|
891
889
|
break;
|
|
892
890
|
}
|
|
893
|
-
return
|
|
891
|
+
return m.join(`
|
|
894
892
|
`);
|
|
895
893
|
}
|
|
896
|
-
function
|
|
894
|
+
function ln(e) {
|
|
897
895
|
return e === "win32";
|
|
898
896
|
}
|
|
899
897
|
function Le(e) {
|
|
900
|
-
const [
|
|
898
|
+
const [t, i] = e.split("?"), r = i || "";
|
|
901
899
|
return {
|
|
902
900
|
originalId: e,
|
|
903
|
-
pathId:
|
|
901
|
+
pathId: t,
|
|
904
902
|
query: r ? `?${i}` : "",
|
|
905
903
|
params: new URLSearchParams(r)
|
|
906
904
|
};
|
|
907
905
|
}
|
|
908
|
-
const
|
|
906
|
+
const cn = ["server"], dn = [
|
|
909
907
|
"onGet",
|
|
910
908
|
"onPost",
|
|
911
909
|
"onPut",
|
|
@@ -915,7 +913,7 @@ const dn = ["server"], un = [
|
|
|
915
913
|
"onOptions",
|
|
916
914
|
"onPatch",
|
|
917
915
|
"onStaticGenerate"
|
|
918
|
-
],
|
|
916
|
+
], un = [
|
|
919
917
|
"useServer",
|
|
920
918
|
"route",
|
|
921
919
|
"server",
|
|
@@ -924,7 +922,7 @@ const dn = ["server"], un = [
|
|
|
924
922
|
"zod$",
|
|
925
923
|
"validator$",
|
|
926
924
|
"globalAction$"
|
|
927
|
-
],
|
|
925
|
+
], fn = [
|
|
928
926
|
"useClient",
|
|
929
927
|
"useBrowser",
|
|
930
928
|
"useVisibleTask",
|
|
@@ -932,12 +930,12 @@ const dn = ["server"], un = [
|
|
|
932
930
|
"browser",
|
|
933
931
|
"event$"
|
|
934
932
|
];
|
|
935
|
-
var
|
|
936
|
-
function
|
|
937
|
-
const
|
|
938
|
-
let
|
|
933
|
+
var Tt = /* @__PURE__ */ ((e) => (e.preventNavigate = "preventNavigate", e.valibot = "valibot", e.noSPA = "noSPA", e.enableRequestRewrite = "enableRequestRewrite", e.webWorker = "webWorker", e.insights = "insights", e))(Tt || {});
|
|
934
|
+
function Ct(e = {}) {
|
|
935
|
+
const t = `${Math.round(Math.random() * 899) + 100}`, i = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
936
|
+
let l = null, s, f = () => {
|
|
939
937
|
};
|
|
940
|
-
const
|
|
938
|
+
const n = {
|
|
941
939
|
csr: !1,
|
|
942
940
|
target: "client",
|
|
943
941
|
buildMode: "development",
|
|
@@ -966,41 +964,41 @@ function Pt(e = {}) {
|
|
|
966
964
|
lint: !1,
|
|
967
965
|
experimental: void 0
|
|
968
966
|
};
|
|
969
|
-
let
|
|
970
|
-
const
|
|
971
|
-
if (!
|
|
967
|
+
let w, x;
|
|
968
|
+
const I = async () => {
|
|
969
|
+
if (!l && (l = await At(e), w = pn(l.sys), l.sys.env !== "browsermain" && l.sys.env !== "webworker"))
|
|
972
970
|
try {
|
|
973
|
-
|
|
971
|
+
x === void 0 && (x = await l.sys.dynamicImport("node:fs"));
|
|
974
972
|
} catch {
|
|
975
|
-
console.log("node:fs not available, disabling automatic manifest reading"),
|
|
973
|
+
console.log("node:fs not available, disabling automatic manifest reading"), x = null;
|
|
976
974
|
}
|
|
977
|
-
},
|
|
978
|
-
if (!
|
|
975
|
+
}, y = () => {
|
|
976
|
+
if (!l)
|
|
979
977
|
throw new Error("Qwik plugin has not been initialized");
|
|
980
|
-
return
|
|
981
|
-
},
|
|
982
|
-
let
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
},
|
|
986
|
-
const
|
|
987
|
-
|
|
988
|
-
let C = N(
|
|
989
|
-
if (typeof
|
|
990
|
-
|
|
991
|
-
else if (!
|
|
978
|
+
return l;
|
|
979
|
+
}, d = () => y().sys, u = () => y().sys.path;
|
|
980
|
+
let p;
|
|
981
|
+
const a = (E) => {
|
|
982
|
+
p = E;
|
|
983
|
+
}, h = async (E) => {
|
|
984
|
+
const v = Object.assign({}, E), T = y(), M = T.sys.path, N = (...U) => F(M.resolve(...U));
|
|
985
|
+
n.debug = !!v.debug, v.assetsDir && (n.assetsDir = v.assetsDir), v.target === "ssr" || v.target === "client" || v.target === "lib" || v.target === "test" ? n.target = v.target : n.target ||= "client", n.target === "lib" ? n.buildMode = "development" : v.buildMode === "production" || v.buildMode === "development" ? n.buildMode = v.buildMode : n.buildMode ||= "development", n.csr = !!v.csr, v.entryStrategy && typeof v.entryStrategy == "object" && (n.entryStrategy = { ...v.entryStrategy }), n.entryStrategy || (n.target === "ssr" || n.target === "test" ? n.entryStrategy = { type: "hoist" } : n.target === "lib" ? n.entryStrategy = { type: "inline" } : n.buildMode === "production" ? n.entryStrategy = { type: "smart" } : n.entryStrategy = { type: "segment" }), typeof v.rootDir == "string" && (n.rootDir = v.rootDir), typeof n.rootDir != "string" && (n.rootDir ||= T.sys.cwd()), n.rootDir = N(T.sys.cwd(), n.rootDir);
|
|
986
|
+
let C = N(n.rootDir, gn);
|
|
987
|
+
if (typeof v.srcDir == "string" ? (n.srcDir = N(n.rootDir, v.srcDir), C = n.srcDir) : n.srcDir ||= C, n.srcDir = N(n.rootDir, n.srcDir), Array.isArray(v.tsconfigFileNames) && v.tsconfigFileNames.length > 0 && (n.tsconfigFileNames = v.tsconfigFileNames), !n.csr && !v.input && !n.input && (n.target === "ssr" ? n.input = [N(C, "entry.ssr")] : n.target === "client" ? n.input = [N(C, "root")] : n.input = void 0), v.outDir && (n.outDir = N(n.rootDir, v.outDir)), n.clientOutDir = N(n.rootDir, v.clientOutDir || st), n.ssrOutDir = N(n.rootDir, v.ssrOutDir || yn), n.target === "ssr" ? n.outDir ||= n.ssrOutDir : n.target === "lib" ? n.outDir ||= N(n.rootDir, bn) : n.outDir ||= n.clientOutDir, typeof v.manifestOutput == "function" && (n.manifestOutput = v.manifestOutput), v.manifestInput && (n.manifestInput = et(v.manifestInput) || null), typeof v.transformedModuleOutput == "function" && (n.transformedModuleOutput = v.transformedModuleOutput), v.scope !== void 0)
|
|
988
|
+
n.scope = v.scope;
|
|
989
|
+
else if (!n.scope && x) {
|
|
992
990
|
let U = "";
|
|
993
991
|
try {
|
|
994
|
-
let B =
|
|
995
|
-
for (; U = M.resolve(B, "package.json"), !await
|
|
992
|
+
let B = n.rootDir;
|
|
993
|
+
for (; U = M.resolve(B, "package.json"), !await x.promises.stat(U).catch(() => !1); ) {
|
|
996
994
|
const j = M.resolve(B, "..");
|
|
997
995
|
if (j === B)
|
|
998
996
|
break;
|
|
999
997
|
B = j, U = "";
|
|
1000
998
|
}
|
|
1001
999
|
if (U) {
|
|
1002
|
-
const j = await
|
|
1003
|
-
typeof L.name == "string" && (
|
|
1000
|
+
const j = await x.promises.readFile(U, "utf-8"), L = JSON.parse(j);
|
|
1001
|
+
typeof L.name == "string" && (n.scope = L.name);
|
|
1004
1002
|
}
|
|
1005
1003
|
} catch (B) {
|
|
1006
1004
|
console.warn(
|
|
@@ -1008,60 +1006,60 @@ function Pt(e = {}) {
|
|
|
1008
1006
|
);
|
|
1009
1007
|
}
|
|
1010
1008
|
}
|
|
1011
|
-
if (typeof
|
|
1012
|
-
|
|
1013
|
-
for (const U of
|
|
1014
|
-
|
|
1009
|
+
if (typeof v.resolveQwikBuild == "boolean" && (n.resolveQwikBuild = v.resolveQwikBuild), typeof v.devTools == "object" && ("imageDevTools" in v.devTools && (n.devTools.imageDevTools = v.devTools.imageDevTools), "clickToSource" in v.devTools && (n.devTools.clickToSource = v.devTools.clickToSource)), "inlineStylesUpToBytes" in e && (typeof e.inlineStylesUpToBytes == "number" ? n.inlineStylesUpToBytes = e.inlineStylesUpToBytes : (typeof n.inlineStylesUpToBytes != "number" || n.inlineStylesUpToBytes < 0) && (n.inlineStylesUpToBytes = 0)), typeof v.lint == "boolean" && (n.lint = v.lint), "experimental" in v) {
|
|
1010
|
+
n.experimental = void 0;
|
|
1011
|
+
for (const U of v.experimental ?? [])
|
|
1012
|
+
Tt[U] ? (n.experimental ||= {})[U] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${U}`);
|
|
1015
1013
|
}
|
|
1016
|
-
const R = { ...
|
|
1017
|
-
return
|
|
1014
|
+
const R = { ...n };
|
|
1015
|
+
return n.input ||= v.input, n.input && typeof n.input == "string" && (n.input = [n.input]), R;
|
|
1018
1016
|
};
|
|
1019
|
-
let
|
|
1020
|
-
const
|
|
1021
|
-
if (!
|
|
1022
|
-
|
|
1023
|
-
const
|
|
1024
|
-
if (
|
|
1025
|
-
const T = await
|
|
1026
|
-
if (!T.existsSync(
|
|
1027
|
-
throw new Error(`Qwik rootDir "${
|
|
1028
|
-
if (typeof
|
|
1029
|
-
throw new Error(`Qwik srcDir "${
|
|
1030
|
-
for (const [M, N] of Object.entries(
|
|
1017
|
+
let _ = !1;
|
|
1018
|
+
const c = async (E) => {
|
|
1019
|
+
if (!_) {
|
|
1020
|
+
_ = !0;
|
|
1021
|
+
const v = d();
|
|
1022
|
+
if (v.env === "node") {
|
|
1023
|
+
const T = await v.dynamicImport("node:fs");
|
|
1024
|
+
if (!T.existsSync(n.rootDir))
|
|
1025
|
+
throw new Error(`Qwik rootDir "${n.rootDir}" not found.`);
|
|
1026
|
+
if (typeof n.srcDir == "string" && !T.existsSync(n.srcDir))
|
|
1027
|
+
throw new Error(`Qwik srcDir "${n.srcDir}" not found.`);
|
|
1028
|
+
for (const [M, N] of Object.entries(n.input || {}))
|
|
1031
1029
|
if (!await E(N))
|
|
1032
1030
|
throw new Error(`Qwik input "${N}" not found.`);
|
|
1033
1031
|
}
|
|
1034
1032
|
}
|
|
1035
1033
|
};
|
|
1036
|
-
let
|
|
1037
|
-
const
|
|
1038
|
-
if (O("buildStart()",
|
|
1034
|
+
let g, b = !1;
|
|
1035
|
+
const S = async (E) => {
|
|
1036
|
+
if (O("buildStart()", n.buildMode, n.scope, n.target, n.rootDir, n.srcDir), g = y(), b = !p, g.sys.env === "node" && n.target === "ssr" && n.lint)
|
|
1039
1037
|
try {
|
|
1040
|
-
|
|
1038
|
+
s = await en(g.sys, n.rootDir, n.tsconfigFileNames);
|
|
1041
1039
|
} catch {
|
|
1042
1040
|
}
|
|
1043
|
-
if (O("transformedOutputs.clear()"), r.clear(), o.clear(),
|
|
1044
|
-
const
|
|
1041
|
+
if (O("transformedOutputs.clear()"), r.clear(), o.clear(), n.target === "client") {
|
|
1042
|
+
const v = await E.resolve("@qwik.dev/core/qwikloader.js", void 0, {
|
|
1045
1043
|
skipSelf: !0
|
|
1046
1044
|
});
|
|
1047
|
-
|
|
1048
|
-
id:
|
|
1045
|
+
v && E.emitFile({
|
|
1046
|
+
id: v.id,
|
|
1049
1047
|
type: "chunk",
|
|
1050
1048
|
preserveSignature: "allow-extension"
|
|
1051
1049
|
});
|
|
1052
1050
|
}
|
|
1053
|
-
},
|
|
1051
|
+
}, k = (E) => p ? !!E?.ssr : n.target === "ssr" || n.target === "test";
|
|
1054
1052
|
let q = 0, D = !1;
|
|
1055
|
-
const P = async (E,
|
|
1056
|
-
if (Z(
|
|
1053
|
+
const P = async (E, v, T, M) => {
|
|
1054
|
+
if (Z(v))
|
|
1057
1055
|
return;
|
|
1058
|
-
const N =
|
|
1056
|
+
const N = p && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(v);
|
|
1059
1057
|
if (N) {
|
|
1060
1058
|
if (!D) {
|
|
1061
1059
|
D = !0, setTimeout(() => D = !1, 500);
|
|
1062
1060
|
const [, K, W] = N, ce = await E.resolve(K, T);
|
|
1063
1061
|
if (ce) {
|
|
1064
|
-
const se =
|
|
1062
|
+
const se = p.moduleGraph.getModuleById(ce.id)?.file;
|
|
1065
1063
|
if (se) {
|
|
1066
1064
|
const te = `${se}${W}`;
|
|
1067
1065
|
try {
|
|
@@ -1076,21 +1074,21 @@ function Pt(e = {}) {
|
|
|
1076
1074
|
}
|
|
1077
1075
|
return { id: "\0editor" };
|
|
1078
1076
|
}
|
|
1079
|
-
const C = q++, R =
|
|
1080
|
-
O(`resolveId(${C})`, `begin ${
|
|
1077
|
+
const C = q++, R = k(M);
|
|
1078
|
+
O(`resolveId(${C})`, `begin ${v} | ${R ? "server" : "client"} | ${T}`);
|
|
1081
1079
|
const U = T && Le(T);
|
|
1082
|
-
if (T = U && F(U.pathId),
|
|
1083
|
-
const K =
|
|
1084
|
-
W && (
|
|
1080
|
+
if (T = U && F(U.pathId), v.startsWith(".") && U) {
|
|
1081
|
+
const K = u(), W = K.dirname(U.pathId);
|
|
1082
|
+
W && (v = K.resolve(W, v));
|
|
1085
1083
|
}
|
|
1086
|
-
const B = Le(
|
|
1084
|
+
const B = Le(v), j = F(B.pathId);
|
|
1087
1085
|
let L;
|
|
1088
1086
|
if (
|
|
1089
1087
|
/**
|
|
1090
1088
|
* Check if we know the QRL. During regular builds, we'll encounter and build parents before
|
|
1091
1089
|
* their QRLs, so this will always match.
|
|
1092
1090
|
*/
|
|
1093
|
-
|
|
1091
|
+
m.get(j)
|
|
1094
1092
|
)
|
|
1095
1093
|
O(`resolveId(${C}) Resolved already known ${j}`), L = {
|
|
1096
1094
|
id: j + B.query,
|
|
@@ -1104,7 +1102,7 @@ function Pt(e = {}) {
|
|
|
1104
1102
|
// We test with endsWith because the dev server adds the base pathname
|
|
1105
1103
|
j.endsWith(ne)
|
|
1106
1104
|
)
|
|
1107
|
-
|
|
1105
|
+
n.resolveQwikBuild && (O(`resolveId(${C})`, "Resolved", ne), L = {
|
|
1108
1106
|
id: ne,
|
|
1109
1107
|
moduleSideEffects: !1
|
|
1110
1108
|
});
|
|
@@ -1113,7 +1111,7 @@ function Pt(e = {}) {
|
|
|
1113
1111
|
id: re,
|
|
1114
1112
|
moduleSideEffects: !1
|
|
1115
1113
|
};
|
|
1116
|
-
else if (!
|
|
1114
|
+
else if (!p && !R && j.endsWith(He)) {
|
|
1117
1115
|
O(`resolveId(${C})`, "Resolved", He);
|
|
1118
1116
|
const K = await E.resolve(He, T, {
|
|
1119
1117
|
skipSelf: !0
|
|
@@ -1130,8 +1128,8 @@ function Pt(e = {}) {
|
|
|
1130
1128
|
moduleSideEffects: !1
|
|
1131
1129
|
};
|
|
1132
1130
|
else {
|
|
1133
|
-
if (!R &&
|
|
1134
|
-
|
|
1131
|
+
if (!R && b && v.endsWith("@qwik.dev/core")) {
|
|
1132
|
+
b = !1;
|
|
1135
1133
|
const W = await E.resolve("@qwik.dev/core/handlers.mjs", T, {
|
|
1136
1134
|
skipSelf: !0
|
|
1137
1135
|
});
|
|
@@ -1143,12 +1141,12 @@ function Pt(e = {}) {
|
|
|
1143
1141
|
preserveSignature: "allow-extension"
|
|
1144
1142
|
});
|
|
1145
1143
|
}
|
|
1146
|
-
const K = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(
|
|
1144
|
+
const K = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(v)?.groups;
|
|
1147
1145
|
if (K) {
|
|
1148
1146
|
const { parent: W, name: ce, query: se } = K, te = await E.resolve(W, T, { skipSelf: !0 });
|
|
1149
1147
|
if (te) {
|
|
1150
|
-
const J = te.id.split("?")[0], qe =
|
|
1151
|
-
O(`resolveId(${C})`, `resolved to QRL ${ce} of ${J}`),
|
|
1148
|
+
const J = te.id.split("?")[0], qe = p && T?.endsWith(".html") ? `${J}_${ce}.js` : j;
|
|
1149
|
+
O(`resolveId(${C})`, `resolved to QRL ${ce} of ${J}`), m.set(qe, J), L = {
|
|
1152
1150
|
id: qe + se,
|
|
1153
1151
|
// QRL segments can't have side effects. Probably never useful, but it's here for consistency
|
|
1154
1152
|
moduleSideEffects: !1
|
|
@@ -1156,104 +1154,104 @@ function Pt(e = {}) {
|
|
|
1156
1154
|
} else
|
|
1157
1155
|
console.error(`resolveId(${C})`, `QRL parent ${W} does not exist!`);
|
|
1158
1156
|
} else if (T) {
|
|
1159
|
-
const W =
|
|
1157
|
+
const W = m.get(T);
|
|
1160
1158
|
if (W)
|
|
1161
|
-
return O(`resolveId(${C}) end`, `resolving via ${W}`), E.resolve(
|
|
1159
|
+
return O(`resolveId(${C}) end`, `resolving via ${W}`), E.resolve(v, W, { skipSelf: !0 });
|
|
1162
1160
|
}
|
|
1163
1161
|
}
|
|
1164
1162
|
return O(`resolveId(${C}) end`, L?.id || L), L;
|
|
1165
1163
|
};
|
|
1166
1164
|
let $ = 0;
|
|
1167
|
-
const A = async (E,
|
|
1168
|
-
if (
|
|
1165
|
+
const A = async (E, v, T) => {
|
|
1166
|
+
if (v === "\0editor")
|
|
1169
1167
|
return '"opening in editor"';
|
|
1170
|
-
if (Z(
|
|
1168
|
+
if (Z(v) || v.startsWith("/@fs/"))
|
|
1171
1169
|
return;
|
|
1172
|
-
const M = $++, N =
|
|
1173
|
-
if (
|
|
1174
|
-
return O(`load(${M})`, ne,
|
|
1170
|
+
const M = $++, N = k(T);
|
|
1171
|
+
if (n.resolveQwikBuild && v === ne)
|
|
1172
|
+
return O(`load(${M})`, ne, n.buildMode), {
|
|
1175
1173
|
moduleSideEffects: !1,
|
|
1176
|
-
code: ue(N,
|
|
1174
|
+
code: ue(N, n.target)
|
|
1177
1175
|
};
|
|
1178
|
-
if (
|
|
1179
|
-
return O(`load(${M})`, re,
|
|
1176
|
+
if (v === re)
|
|
1177
|
+
return O(`load(${M})`, re, n.buildMode), {
|
|
1180
1178
|
moduleSideEffects: !1,
|
|
1181
1179
|
code: await le(N)
|
|
1182
1180
|
};
|
|
1183
|
-
if (
|
|
1184
|
-
return O(`load(${M})`, pe,
|
|
1181
|
+
if (v === pe)
|
|
1182
|
+
return O(`load(${M})`, pe, n.buildMode), {
|
|
1185
1183
|
moduleSideEffects: !1,
|
|
1186
1184
|
code: "export * from '@qwik.dev/core';"
|
|
1187
1185
|
};
|
|
1188
|
-
const C = Le(
|
|
1189
|
-
|
|
1186
|
+
const C = Le(v);
|
|
1187
|
+
v = F(C.pathId);
|
|
1190
1188
|
const R = N ? o : r;
|
|
1191
|
-
if (
|
|
1192
|
-
const B =
|
|
1189
|
+
if (p && !R.has(v)) {
|
|
1190
|
+
const B = m.get(v);
|
|
1193
1191
|
if (B) {
|
|
1194
|
-
const j =
|
|
1192
|
+
const j = p.moduleGraph.getModuleById(B);
|
|
1195
1193
|
if (j) {
|
|
1196
|
-
if (O(`load(${M})`, "transforming QRL parent", B), await
|
|
1197
|
-
return O(`load(${M})`, `QRL segment ${
|
|
1194
|
+
if (O(`load(${M})`, "transforming QRL parent", B), await p.transformRequest(j.url), !R.has(v))
|
|
1195
|
+
return O(`load(${M})`, `QRL segment ${v} not found in ${B}`), null;
|
|
1198
1196
|
} else
|
|
1199
1197
|
console.error(`load(${M})`, `module ${B} does not exist in the build graph!`);
|
|
1200
1198
|
}
|
|
1201
1199
|
}
|
|
1202
|
-
const U = R.get(
|
|
1200
|
+
const U = R.get(v);
|
|
1203
1201
|
if (U) {
|
|
1204
|
-
O(`load(${M})`, "Found",
|
|
1202
|
+
O(`load(${M})`, "Found", v);
|
|
1205
1203
|
const { code: B, map: j, segment: L } = U[0];
|
|
1206
1204
|
return { code: B, map: j, meta: { segment: L } };
|
|
1207
1205
|
}
|
|
1208
|
-
return O(`load(${M})`, "Not a QRL or virtual module",
|
|
1206
|
+
return O(`load(${M})`, "Not a QRL or virtual module", v), null;
|
|
1209
1207
|
};
|
|
1210
1208
|
let G = 0;
|
|
1211
|
-
const X = async function(E,
|
|
1209
|
+
const X = async function(E, v, T, M = {}) {
|
|
1212
1210
|
if (Z(T))
|
|
1213
1211
|
return;
|
|
1214
|
-
const N = G++, C =
|
|
1212
|
+
const N = G++, C = k(M), R = C ? o : r;
|
|
1215
1213
|
if (R.has(T))
|
|
1216
1214
|
return;
|
|
1217
|
-
const U =
|
|
1218
|
-
if (L.ext.toLowerCase() in
|
|
1219
|
-
const se =
|
|
1215
|
+
const U = y(), B = u(), { pathId: j } = Le(T), L = B.parse(j), K = L.dir, W = L.base;
|
|
1216
|
+
if (L.ext.toLowerCase() in mn || Pt.test(j)) {
|
|
1217
|
+
const se = n.target === "client" || n.target === "ssr";
|
|
1220
1218
|
O(
|
|
1221
1219
|
`transform(${N})`,
|
|
1222
1220
|
`Transforming ${T} (for: ${C ? "server" : "client"}${se ? ", strip" : ""})`
|
|
1223
1221
|
);
|
|
1224
|
-
const te =
|
|
1225
|
-
te !== "lib" && (
|
|
1222
|
+
const te = n.target === "lib" ? "lib" : n.buildMode === "development" ? "dev" : "prod";
|
|
1223
|
+
te !== "lib" && (v = v.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (V, ae) => n.experimental?.[ae] ? "true" : "false"));
|
|
1226
1224
|
let J = W;
|
|
1227
|
-
|
|
1228
|
-
const Me =
|
|
1225
|
+
n.srcDir && (J = B.relative(n.srcDir, j)), J = F(J);
|
|
1226
|
+
const Me = n.srcDir ? n.srcDir : F(K), qe = n.entryStrategy;
|
|
1229
1227
|
let Xe;
|
|
1230
|
-
|
|
1228
|
+
p && (Xe = p.moduleGraph.getModuleById(j)?.url);
|
|
1231
1229
|
const de = {
|
|
1232
|
-
input: [{ code:
|
|
1230
|
+
input: [{ code: v, path: J, devPath: Xe }],
|
|
1233
1231
|
entryStrategy: C ? { type: "hoist" } : qe,
|
|
1234
1232
|
minify: "simplify",
|
|
1235
1233
|
// Always enable sourcemaps in dev for click-to-source
|
|
1236
|
-
sourceMaps:
|
|
1234
|
+
sourceMaps: n.sourcemap || n.buildMode === "development",
|
|
1237
1235
|
transpileTs: !0,
|
|
1238
1236
|
transpileJsx: !0,
|
|
1239
1237
|
explicitExtensions: !0,
|
|
1240
1238
|
preserveFilenames: !0,
|
|
1241
1239
|
srcDir: Me,
|
|
1242
|
-
rootDir:
|
|
1240
|
+
rootDir: n.rootDir,
|
|
1243
1241
|
mode: te,
|
|
1244
|
-
scope:
|
|
1242
|
+
scope: n.scope || void 0,
|
|
1245
1243
|
isServer: C
|
|
1246
1244
|
};
|
|
1247
|
-
se && (C ? (de.stripCtxName =
|
|
1248
|
-
const
|
|
1249
|
-
O(`transform(${N})`, `done in ${Date.now() -
|
|
1250
|
-
const Oe = fe.modules.find((V) => !
|
|
1251
|
-
|
|
1245
|
+
se && (C ? (de.stripCtxName = fn, de.stripEventHandlers = !0, de.regCtxName = cn) : (de.stripCtxName = un, de.stripExports = dn));
|
|
1246
|
+
const Ot = Date.now(), fe = await U.transformModules(de);
|
|
1247
|
+
O(`transform(${N})`, `done in ${Date.now() - Ot}ms`);
|
|
1248
|
+
const Oe = fe.modules.find((V) => !hn(V));
|
|
1249
|
+
f(fe.diagnostics, U, Me), C ? fe.diagnostics.length === 0 && s && s.lint(E, v, T) : i.set(T, fe);
|
|
1252
1250
|
const $e = /* @__PURE__ */ new Set();
|
|
1253
1251
|
for (const V of fe.modules)
|
|
1254
1252
|
if (V !== Oe) {
|
|
1255
1253
|
const ae = F(B.join(Me, V.path));
|
|
1256
|
-
O(`transform(${N})`, `segment ${ae}`, V.segment.displayName),
|
|
1254
|
+
O(`transform(${N})`, `segment ${ae}`, V.segment.displayName), m.set(ae, T), R.set(ae, [V, T]), $e.add(ae), n.target === "client" && !p && E.emitFile({
|
|
1257
1255
|
id: ae,
|
|
1258
1256
|
type: "chunk",
|
|
1259
1257
|
preserveSignature: "allow-extension"
|
|
@@ -1270,18 +1268,18 @@ function Pt(e = {}) {
|
|
|
1270
1268
|
}
|
|
1271
1269
|
return O(`transform(${N})`, "Not transforming", T), null;
|
|
1272
1270
|
}, Q = (E) => {
|
|
1273
|
-
const
|
|
1274
|
-
addInjection: (M) =>
|
|
1271
|
+
const v = [], T = {
|
|
1272
|
+
addInjection: (M) => v.push(M)
|
|
1275
1273
|
};
|
|
1276
1274
|
return T.generateManifest = async (M) => {
|
|
1277
|
-
const C =
|
|
1275
|
+
const C = y().sys.path, R = C.resolve(n.rootDir, n.outDir, "build"), U = (L) => C.relative(R, C.resolve(n.rootDir, n.outDir, L));
|
|
1278
1276
|
T.canonPath = U;
|
|
1279
|
-
const B = Array.from(i.values()).flatMap((L) => L.modules).map((L) => L.segment).filter((L) => !!L), j =
|
|
1277
|
+
const B = Array.from(i.values()).flatMap((L) => L.modules).map((L) => L.segment).filter((L) => !!L), j = Jt(
|
|
1280
1278
|
C,
|
|
1281
1279
|
B,
|
|
1282
|
-
|
|
1280
|
+
v,
|
|
1283
1281
|
E,
|
|
1284
|
-
|
|
1282
|
+
n,
|
|
1285
1283
|
O,
|
|
1286
1284
|
U
|
|
1287
1285
|
);
|
|
@@ -1290,17 +1288,17 @@ function Pt(e = {}) {
|
|
|
1290
1288
|
L.origin && (L.origin = F(L.origin));
|
|
1291
1289
|
for (const L of Object.values(j.bundles))
|
|
1292
1290
|
L.origins && (L.origins = L.origins.sort());
|
|
1293
|
-
return j.manifestHash =
|
|
1291
|
+
return j.manifestHash = $t(JSON.stringify(j)), j;
|
|
1294
1292
|
}, T;
|
|
1295
|
-
}, ee = () =>
|
|
1296
|
-
|
|
1293
|
+
}, ee = () => n, Y = () => Array.from(r.values()).map((E) => E[0]), O = (...E) => {
|
|
1294
|
+
n.debug && console.debug(`[QWIK PLUGIN: ${t}]`, ...E);
|
|
1297
1295
|
}, ie = (...E) => {
|
|
1298
|
-
console.log(`[QWIK PLUGIN: ${
|
|
1296
|
+
console.log(`[QWIK PLUGIN: ${t}]`, ...E);
|
|
1299
1297
|
}, Re = (E) => {
|
|
1300
|
-
|
|
1301
|
-
}, F = (E) =>
|
|
1302
|
-
function ue(E,
|
|
1303
|
-
const T =
|
|
1298
|
+
f = E;
|
|
1299
|
+
}, F = (E) => w(E);
|
|
1300
|
+
function ue(E, v) {
|
|
1301
|
+
const T = n.buildMode === "development";
|
|
1304
1302
|
return `// @qwik.dev/core/build
|
|
1305
1303
|
export const isServer = ${JSON.stringify(E)};
|
|
1306
1304
|
export const isBrowser = ${JSON.stringify(!E)};
|
|
@@ -1308,13 +1306,13 @@ export const isDev = ${JSON.stringify(T)};
|
|
|
1308
1306
|
`;
|
|
1309
1307
|
}
|
|
1310
1308
|
async function le(E) {
|
|
1311
|
-
if (!
|
|
1312
|
-
const M =
|
|
1313
|
-
let N =
|
|
1314
|
-
await
|
|
1309
|
+
if (!n.manifestInput && n.target === "ssr" && n.buildMode === "production" && x) {
|
|
1310
|
+
const M = u();
|
|
1311
|
+
let N = n.manifestInputPath || M.resolve(n.clientOutDir, We);
|
|
1312
|
+
await x.promises.stat(N).catch(() => !1) || (N = M.resolve(n.rootDir, st, We));
|
|
1315
1313
|
try {
|
|
1316
|
-
const C = await
|
|
1317
|
-
|
|
1314
|
+
const C = await x.promises.readFile(N, "utf-8");
|
|
1315
|
+
n.manifestInput = et(JSON.parse(C)) || null, console.info("Read client manifest from", N);
|
|
1318
1316
|
} catch (C) {
|
|
1319
1317
|
console.warn(
|
|
1320
1318
|
`
|
|
@@ -1328,28 +1326,28 @@ Without the manifest, the SSR renderer will not be able to generate event handle
|
|
|
1328
1326
|
);
|
|
1329
1327
|
}
|
|
1330
1328
|
}
|
|
1331
|
-
const
|
|
1329
|
+
const v = E ? n.manifestInput : null;
|
|
1332
1330
|
let T = null;
|
|
1333
|
-
return
|
|
1334
|
-
manifestHash:
|
|
1335
|
-
core:
|
|
1336
|
-
preloader:
|
|
1337
|
-
qwikLoader:
|
|
1338
|
-
bundleGraphAsset:
|
|
1339
|
-
injections:
|
|
1340
|
-
mapping:
|
|
1341
|
-
bundleGraph:
|
|
1331
|
+
return v?.manifestHash && (T = {
|
|
1332
|
+
manifestHash: v.manifestHash,
|
|
1333
|
+
core: v.core,
|
|
1334
|
+
preloader: v.preloader,
|
|
1335
|
+
qwikLoader: v.qwikLoader,
|
|
1336
|
+
bundleGraphAsset: v.bundleGraphAsset,
|
|
1337
|
+
injections: v.injections,
|
|
1338
|
+
mapping: v.mapping,
|
|
1339
|
+
bundleGraph: v.bundleGraph
|
|
1342
1340
|
}), `// @qwik-client-manifest
|
|
1343
1341
|
export const manifest = ${T ? JSON.stringify(T) : "globalThis.__QWIK_MANIFEST__"};
|
|
1344
1342
|
`;
|
|
1345
1343
|
}
|
|
1346
1344
|
function Ne(E) {
|
|
1347
|
-
|
|
1345
|
+
n.sourcemap = E;
|
|
1348
1346
|
}
|
|
1349
|
-
function
|
|
1347
|
+
function Nt(E) {
|
|
1350
1348
|
O("handleHotUpdate()", E.file);
|
|
1351
|
-
for (const
|
|
1352
|
-
const { id: T } =
|
|
1349
|
+
for (const v of E.modules) {
|
|
1350
|
+
const { id: T } = v;
|
|
1353
1351
|
if (T) {
|
|
1354
1352
|
O("handleHotUpdate()", `invalidate ${T}`), i.delete(T);
|
|
1355
1353
|
for (const M of [r, o])
|
|
@@ -1362,8 +1360,8 @@ export const manifest = ${T ? JSON.stringify(T) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1362
1360
|
}
|
|
1363
1361
|
}
|
|
1364
1362
|
}
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1363
|
+
const Mt = (E, { getModuleInfo: v }) => {
|
|
1364
|
+
if (n.target === "client") {
|
|
1367
1365
|
if (
|
|
1368
1366
|
// The preloader has to stay in a separate chunk if it's a client build
|
|
1369
1367
|
// the vite preload helper must be included or to prevent breaking circular dependencies
|
|
@@ -1378,28 +1376,28 @@ export const manifest = ${T ? JSON.stringify(T) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1378
1376
|
if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(E))
|
|
1379
1377
|
return "qwik-loader";
|
|
1380
1378
|
}
|
|
1381
|
-
const T =
|
|
1379
|
+
const T = v(E);
|
|
1382
1380
|
if (T) {
|
|
1383
1381
|
const M = T.meta.segment;
|
|
1384
1382
|
if (M) {
|
|
1385
1383
|
if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(M.ctxName))
|
|
1386
1384
|
return null;
|
|
1387
|
-
const { hash: N } = M, C =
|
|
1385
|
+
const { hash: N } = M, C = n.entryStrategy.manual?.[N] || M.entry;
|
|
1388
1386
|
if (C)
|
|
1389
1387
|
return C;
|
|
1390
1388
|
}
|
|
1391
1389
|
}
|
|
1392
1390
|
return null;
|
|
1393
1391
|
};
|
|
1394
|
-
async function
|
|
1395
|
-
const C = await Q(
|
|
1392
|
+
async function qt(E, v, T, M) {
|
|
1393
|
+
const C = await Q(v).generateManifest(M);
|
|
1396
1394
|
C.platform = {
|
|
1397
1395
|
...M?.platform,
|
|
1398
1396
|
rollup: E.meta?.rollupVersion || "",
|
|
1399
|
-
env:
|
|
1400
|
-
os:
|
|
1401
|
-
},
|
|
1402
|
-
const R =
|
|
1397
|
+
env: g.sys.env,
|
|
1398
|
+
os: g.sys.os
|
|
1399
|
+
}, g.sys.env === "node" && (C.platform.node = process.versions.node);
|
|
1400
|
+
const R = Zt(C, T), U = E.emitFile({
|
|
1403
1401
|
type: "asset",
|
|
1404
1402
|
name: "bundle-graph.json",
|
|
1405
1403
|
source: JSON.stringify(R)
|
|
@@ -1413,75 +1411,75 @@ export const manifest = ${T ? JSON.stringify(T) : "globalThis.__QWIK_MANIFEST__"
|
|
|
1413
1411
|
fileName: We,
|
|
1414
1412
|
type: "asset",
|
|
1415
1413
|
source: j
|
|
1416
|
-
}), typeof
|
|
1414
|
+
}), typeof n.manifestOutput == "function" && await n.manifestOutput(C), typeof n.transformedModuleOutput == "function" && await n.transformedModuleOutput(Y());
|
|
1417
1415
|
}
|
|
1418
1416
|
return {
|
|
1419
|
-
buildStart:
|
|
1417
|
+
buildStart: S,
|
|
1420
1418
|
createOutputAnalyzer: Q,
|
|
1421
1419
|
getQwikBuildModule: ue,
|
|
1422
|
-
getOptimizer:
|
|
1420
|
+
getOptimizer: y,
|
|
1423
1421
|
getOptions: ee,
|
|
1424
|
-
getPath:
|
|
1425
|
-
getSys:
|
|
1422
|
+
getPath: u,
|
|
1423
|
+
getSys: d,
|
|
1426
1424
|
getTransformedOutputs: Y,
|
|
1427
|
-
init:
|
|
1425
|
+
init: I,
|
|
1428
1426
|
load: A,
|
|
1429
1427
|
debug: O,
|
|
1430
1428
|
log: ie,
|
|
1431
|
-
normalizeOptions:
|
|
1429
|
+
normalizeOptions: h,
|
|
1432
1430
|
normalizePath: F,
|
|
1433
1431
|
onDiagnostics: Re,
|
|
1434
1432
|
resolveId: P,
|
|
1435
1433
|
transform: X,
|
|
1436
|
-
validateSource:
|
|
1434
|
+
validateSource: c,
|
|
1437
1435
|
setSourceMapSupport: Ne,
|
|
1438
|
-
configureServer:
|
|
1439
|
-
handleHotUpdate:
|
|
1440
|
-
manualChunks:
|
|
1441
|
-
generateManifest:
|
|
1436
|
+
configureServer: a,
|
|
1437
|
+
handleHotUpdate: Nt,
|
|
1438
|
+
manualChunks: Mt,
|
|
1439
|
+
generateManifest: qt
|
|
1442
1440
|
};
|
|
1443
1441
|
}
|
|
1444
|
-
const
|
|
1445
|
-
function
|
|
1442
|
+
const pn = (e) => (t) => typeof t == "string" ? ln(e.os) ? (t.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(t) || (t = t.replace(/\\/g, "/")), e.path.posix.normalize(t)) : e.path.normalize(t) : t;
|
|
1443
|
+
function hn(e) {
|
|
1446
1444
|
return e.isEntry || e.segment;
|
|
1447
1445
|
}
|
|
1448
|
-
const
|
|
1446
|
+
const mn = {
|
|
1449
1447
|
".jsx": !0,
|
|
1450
1448
|
".ts": !0,
|
|
1451
1449
|
".tsx": !0
|
|
1452
|
-
},
|
|
1453
|
-
async function
|
|
1450
|
+
}, Pt = /\.qwik\.[mc]?js$/, Ue = "@qwik.dev/core", Be = "@qwik.dev/core/internal", ne = "@qwik.dev/core/build", Qe = "@qwik.dev/core/jsx-runtime", Je = "@qwik.dev/core/jsx-dev-runtime", ze = "@qwik.dev/core/server", re = "@qwik-client-manifest", He = "@qwik.dev/core/preloader", pe = "@qwik-handlers", gn = "src", st = "dist", yn = "server", bn = "lib", We = "q-manifest.json";
|
|
1451
|
+
async function vn(e, t, i) {
|
|
1454
1452
|
if (e.env === "browsermain" || e.env === "webworker")
|
|
1455
1453
|
return;
|
|
1456
1454
|
const r = await e.dynamicImport("node:fs");
|
|
1457
1455
|
let o = i;
|
|
1458
1456
|
for (; o; ) {
|
|
1459
|
-
const
|
|
1457
|
+
const m = e.path.join(o, "node_modules", t, "package.json");
|
|
1460
1458
|
try {
|
|
1461
|
-
return await r.promises.access(
|
|
1459
|
+
return await r.promises.access(m), r.promises.realpath(m);
|
|
1462
1460
|
} catch {
|
|
1463
1461
|
}
|
|
1464
|
-
const
|
|
1465
|
-
if (
|
|
1462
|
+
const l = e.path.dirname(o);
|
|
1463
|
+
if (l === o)
|
|
1466
1464
|
break;
|
|
1467
|
-
o =
|
|
1465
|
+
o = l;
|
|
1468
1466
|
}
|
|
1469
1467
|
}
|
|
1470
|
-
function
|
|
1471
|
-
const
|
|
1468
|
+
function $r(e = {}) {
|
|
1469
|
+
const t = Ct(e.optimizerOptions);
|
|
1472
1470
|
return {
|
|
1473
1471
|
name: "rollup-plugin-qwik",
|
|
1474
1472
|
api: {
|
|
1475
|
-
getOptimizer: () =>
|
|
1476
|
-
getOptions: () =>
|
|
1473
|
+
getOptimizer: () => t.getOptimizer(),
|
|
1474
|
+
getOptions: () => t.getOptions()
|
|
1477
1475
|
},
|
|
1478
1476
|
async options(r) {
|
|
1479
|
-
await
|
|
1477
|
+
await t.init();
|
|
1480
1478
|
const o = r.onwarn;
|
|
1481
|
-
r.onwarn = (
|
|
1482
|
-
|
|
1479
|
+
r.onwarn = (s, f) => {
|
|
1480
|
+
s.plugin === "typescript" && s.message.includes("outputToFilesystem") || (o ? o(s, f) : f(s));
|
|
1483
1481
|
};
|
|
1484
|
-
const
|
|
1482
|
+
const m = {
|
|
1485
1483
|
csr: e.csr,
|
|
1486
1484
|
target: e.target,
|
|
1487
1485
|
buildMode: e.buildMode,
|
|
@@ -1499,81 +1497,81 @@ function zr(e = {}) {
|
|
|
1499
1497
|
lint: e.lint,
|
|
1500
1498
|
experimental: e.experimental
|
|
1501
1499
|
};
|
|
1502
|
-
await
|
|
1503
|
-
const { input:
|
|
1504
|
-
return r.input =
|
|
1500
|
+
await t.normalizeOptions(m);
|
|
1501
|
+
const { input: l } = t.getOptions();
|
|
1502
|
+
return r.input = l, r;
|
|
1505
1503
|
},
|
|
1506
1504
|
outputOptions(r) {
|
|
1507
|
-
return Ye(
|
|
1505
|
+
return Ye(t, r, !1);
|
|
1508
1506
|
},
|
|
1509
1507
|
async buildStart() {
|
|
1510
|
-
|
|
1511
|
-
r.forEach((
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1508
|
+
t.onDiagnostics((r, o, m) => {
|
|
1509
|
+
r.forEach((l) => {
|
|
1510
|
+
const s = t.normalizePath(o.sys.path.join(m, l.file));
|
|
1511
|
+
l.category === "error" ? this.error(Ae(s, l)) : this.warn(Ae(s, l));
|
|
1514
1512
|
});
|
|
1515
|
-
}), await
|
|
1513
|
+
}), await t.buildStart(this);
|
|
1516
1514
|
},
|
|
1517
1515
|
resolveId(r, o) {
|
|
1518
|
-
return Z(r) ? null :
|
|
1516
|
+
return Z(r) ? null : t.resolveId(this, r, o);
|
|
1519
1517
|
},
|
|
1520
1518
|
load(r) {
|
|
1521
|
-
return Z(r) ? null :
|
|
1519
|
+
return Z(r) ? null : t.load(this, r);
|
|
1522
1520
|
},
|
|
1523
1521
|
transform(r, o) {
|
|
1524
|
-
return Z(o) ? null :
|
|
1522
|
+
return Z(o) ? null : t.transform(this, r, o);
|
|
1525
1523
|
},
|
|
1526
1524
|
async generateBundle(r, o) {
|
|
1527
|
-
|
|
1525
|
+
t.getOptions().target === "client" && await t.generateManifest(this, o);
|
|
1528
1526
|
}
|
|
1529
1527
|
};
|
|
1530
1528
|
}
|
|
1531
|
-
async function
|
|
1532
|
-
return Array.isArray(
|
|
1533
|
-
|
|
1529
|
+
async function wn(e, t, i, r) {
|
|
1530
|
+
return Array.isArray(t) ? (t.length || t.push({}), await Promise.all(
|
|
1531
|
+
t.map(async (o) => ({
|
|
1534
1532
|
...await Ye(e, o, i),
|
|
1535
1533
|
dir: r || o.dir
|
|
1536
1534
|
}))
|
|
1537
1535
|
)) : {
|
|
1538
|
-
...await Ye(e,
|
|
1539
|
-
dir: r ||
|
|
1536
|
+
...await Ye(e, t, i),
|
|
1537
|
+
dir: r || t?.dir
|
|
1540
1538
|
};
|
|
1541
1539
|
}
|
|
1542
|
-
const
|
|
1543
|
-
if (r.moduleIds?.some((
|
|
1540
|
+
const xn = (e, t, i) => t.buildMode === "production" && !t.debug ? `${e}build/q-[hash].js` : (r) => {
|
|
1541
|
+
if (r.moduleIds?.some((l) => /core\.(prod|min)\.mjs$/.test(l)))
|
|
1544
1542
|
return `${e}build/core.js`;
|
|
1545
|
-
if (r.moduleIds?.some((
|
|
1543
|
+
if (r.moduleIds?.some((l) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(l)))
|
|
1546
1544
|
return `${e}build/qwik-router.js`;
|
|
1547
|
-
const
|
|
1548
|
-
return `${e}build/${
|
|
1545
|
+
const m = i.sys.path.relative(i.sys.cwd(), r.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
|
|
1546
|
+
return `${e}build/${m}.js`;
|
|
1549
1547
|
};
|
|
1550
|
-
async function Ye(e,
|
|
1551
|
-
const r = { ...
|
|
1548
|
+
async function Ye(e, t, i) {
|
|
1549
|
+
const r = { ...t }, o = e.getOptions(), m = e.getOptimizer(), l = e.manualChunks;
|
|
1552
1550
|
r.assetFileNames || (r.assetFileNames = `${i ? `${o.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
|
|
1553
|
-
const
|
|
1551
|
+
const s = xn(i ? `${o.assetsDir}` : "", o, m);
|
|
1554
1552
|
if (o.target === "client") {
|
|
1555
|
-
r.entryFileNames || (r.entryFileNames =
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1553
|
+
r.entryFileNames || (r.entryFileNames = s), r.chunkFileNames || (r.chunkFileNames = s), r.format = "es";
|
|
1554
|
+
const n = r.manualChunks;
|
|
1555
|
+
if (n && typeof n != "function")
|
|
1558
1556
|
throw new Error("manualChunks must be a function");
|
|
1559
|
-
r.manualChunks =
|
|
1557
|
+
r.manualChunks = n ? (w, x) => n(w, x) || l(w, x) : l;
|
|
1560
1558
|
} else
|
|
1561
|
-
r.chunkFileNames || (r.chunkFileNames =
|
|
1559
|
+
r.chunkFileNames || (r.chunkFileNames = s);
|
|
1562
1560
|
r.dir || (r.dir = o.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
|
|
1563
|
-
const
|
|
1564
|
-
if (
|
|
1561
|
+
const f = await vn(m.sys, "rollup", m.sys.cwd());
|
|
1562
|
+
if (f)
|
|
1565
1563
|
try {
|
|
1566
|
-
const
|
|
1567
|
-
Number.isFinite(
|
|
1568
|
-
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${
|
|
1564
|
+
const w = await (await m.sys.dynamicImport("node:fs")).promises.readFile(f, "utf-8"), x = JSON.parse(w), I = String(x?.version || ""), [y, d, u] = I.split(".").map((a) => parseInt(a, 10));
|
|
1565
|
+
Number.isFinite(y) && (y > 4 || y === 4 && (d > 52 || d === 52 && (u || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
|
|
1566
|
+
`⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${I}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
|
|
1569
1567
|
);
|
|
1570
1568
|
} catch {
|
|
1571
1569
|
}
|
|
1572
1570
|
return r;
|
|
1573
1571
|
}
|
|
1574
|
-
function Ae(e,
|
|
1575
|
-
const i =
|
|
1576
|
-
return Object.assign(new Error(
|
|
1572
|
+
function Ae(e, t) {
|
|
1573
|
+
const i = t.highlights?.[0];
|
|
1574
|
+
return Object.assign(new Error(t.message), {
|
|
1577
1575
|
id: e,
|
|
1578
1576
|
plugin: "qwik",
|
|
1579
1577
|
loc: i && {
|
|
@@ -1586,168 +1584,168 @@ function Ae(e, n) {
|
|
|
1586
1584
|
function z(e) {
|
|
1587
1585
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1588
1586
|
}
|
|
1589
|
-
var he = {}, Ge = {},
|
|
1587
|
+
var he = {}, Ge = {}, at;
|
|
1590
1588
|
function H() {
|
|
1591
|
-
return
|
|
1589
|
+
return at || (at = 1, (function(e) {
|
|
1592
1590
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.findBox = e.readUInt = e.readUInt32LE = e.readUInt32BE = e.readInt32LE = e.readUInt24LE = e.readUInt16LE = e.readUInt16BE = e.readInt16LE = e.toHexString = e.toUTF8String = void 0;
|
|
1593
|
-
const
|
|
1591
|
+
const t = new TextDecoder(), i = (u, p = 0, a = u.length) => t.decode(u.slice(p, a));
|
|
1594
1592
|
e.toUTF8String = i;
|
|
1595
|
-
const r = (
|
|
1593
|
+
const r = (u, p = 0, a = u.length) => u.slice(p, a).reduce((h, _) => h + ("0" + _.toString(16)).slice(-2), "");
|
|
1596
1594
|
e.toHexString = r;
|
|
1597
|
-
const o = (
|
|
1598
|
-
const
|
|
1599
|
-
return
|
|
1595
|
+
const o = (u, p = 0) => {
|
|
1596
|
+
const a = u[p] + u[p + 1] * 256;
|
|
1597
|
+
return a | (a & 2 ** 15) * 131070;
|
|
1600
1598
|
};
|
|
1601
1599
|
e.readInt16LE = o;
|
|
1602
|
-
const
|
|
1603
|
-
e.readUInt16BE =
|
|
1604
|
-
const
|
|
1605
|
-
e.readUInt16LE =
|
|
1606
|
-
const
|
|
1607
|
-
e.readUInt24LE =
|
|
1608
|
-
const
|
|
1609
|
-
e.readInt32LE =
|
|
1610
|
-
const
|
|
1611
|
-
e.readUInt32BE =
|
|
1612
|
-
const
|
|
1613
|
-
e.readUInt32LE =
|
|
1614
|
-
const
|
|
1600
|
+
const m = (u, p = 0) => u[p] * 2 ** 8 + u[p + 1];
|
|
1601
|
+
e.readUInt16BE = m;
|
|
1602
|
+
const l = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8;
|
|
1603
|
+
e.readUInt16LE = l;
|
|
1604
|
+
const s = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16;
|
|
1605
|
+
e.readUInt24LE = s;
|
|
1606
|
+
const f = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + (u[p + 3] << 24);
|
|
1607
|
+
e.readInt32LE = f;
|
|
1608
|
+
const n = (u, p = 0) => u[p] * 2 ** 24 + u[p + 1] * 2 ** 16 + u[p + 2] * 2 ** 8 + u[p + 3];
|
|
1609
|
+
e.readUInt32BE = n;
|
|
1610
|
+
const w = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + u[p + 3] * 2 ** 24;
|
|
1611
|
+
e.readUInt32LE = w;
|
|
1612
|
+
const x = {
|
|
1615
1613
|
readUInt16BE: e.readUInt16BE,
|
|
1616
1614
|
readUInt16LE: e.readUInt16LE,
|
|
1617
1615
|
readUInt32BE: e.readUInt32BE,
|
|
1618
1616
|
readUInt32LE: e.readUInt32LE
|
|
1619
1617
|
};
|
|
1620
|
-
function
|
|
1621
|
-
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1624
|
-
}
|
|
1625
|
-
e.readUInt =
|
|
1626
|
-
function
|
|
1627
|
-
if (
|
|
1618
|
+
function I(u, p, a, h) {
|
|
1619
|
+
a = a || 0;
|
|
1620
|
+
const _ = h ? "BE" : "LE", c = "readUInt" + p + _;
|
|
1621
|
+
return x[c](u, a);
|
|
1622
|
+
}
|
|
1623
|
+
e.readUInt = I;
|
|
1624
|
+
function y(u, p) {
|
|
1625
|
+
if (u.length - p < 4)
|
|
1628
1626
|
return;
|
|
1629
|
-
const
|
|
1630
|
-
if (!(
|
|
1627
|
+
const a = (0, e.readUInt32BE)(u, p);
|
|
1628
|
+
if (!(u.length - p < a))
|
|
1631
1629
|
return {
|
|
1632
|
-
name: (0, e.toUTF8String)(
|
|
1633
|
-
offset:
|
|
1634
|
-
size:
|
|
1630
|
+
name: (0, e.toUTF8String)(u, 4 + p, 8 + p),
|
|
1631
|
+
offset: p,
|
|
1632
|
+
size: a
|
|
1635
1633
|
};
|
|
1636
1634
|
}
|
|
1637
|
-
function
|
|
1638
|
-
for (;
|
|
1639
|
-
const
|
|
1640
|
-
if (!
|
|
1635
|
+
function d(u, p, a) {
|
|
1636
|
+
for (; a < u.length; ) {
|
|
1637
|
+
const h = y(u, a);
|
|
1638
|
+
if (!h)
|
|
1641
1639
|
break;
|
|
1642
|
-
if (
|
|
1643
|
-
return
|
|
1644
|
-
|
|
1640
|
+
if (h.name === p)
|
|
1641
|
+
return h;
|
|
1642
|
+
a += h.size > 0 ? h.size : 8;
|
|
1645
1643
|
}
|
|
1646
1644
|
}
|
|
1647
|
-
e.findBox =
|
|
1645
|
+
e.findBox = d;
|
|
1648
1646
|
})(Ge)), Ge;
|
|
1649
1647
|
}
|
|
1650
|
-
var
|
|
1651
|
-
function
|
|
1652
|
-
if (
|
|
1653
|
-
|
|
1648
|
+
var lt;
|
|
1649
|
+
function In() {
|
|
1650
|
+
if (lt) return he;
|
|
1651
|
+
lt = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.BMP = void 0;
|
|
1654
1652
|
const e = H();
|
|
1655
1653
|
return he.BMP = {
|
|
1656
|
-
validate: (
|
|
1657
|
-
calculate: (
|
|
1658
|
-
height: Math.abs((0, e.readInt32LE)(
|
|
1659
|
-
width: (0, e.readUInt32LE)(
|
|
1654
|
+
validate: (t) => (0, e.toUTF8String)(t, 0, 2) === "BM",
|
|
1655
|
+
calculate: (t) => ({
|
|
1656
|
+
height: Math.abs((0, e.readInt32LE)(t, 22)),
|
|
1657
|
+
width: (0, e.readUInt32LE)(t, 18)
|
|
1660
1658
|
})
|
|
1661
1659
|
}, he;
|
|
1662
1660
|
}
|
|
1663
|
-
var
|
|
1664
|
-
const
|
|
1665
|
-
var me = {}, ge = {},
|
|
1666
|
-
function
|
|
1667
|
-
if (
|
|
1668
|
-
|
|
1669
|
-
const e = H(),
|
|
1670
|
-
function o(
|
|
1671
|
-
const
|
|
1672
|
-
return
|
|
1673
|
-
}
|
|
1674
|
-
function
|
|
1675
|
-
const
|
|
1661
|
+
var Sn = In();
|
|
1662
|
+
const kn = /* @__PURE__ */ z(Sn);
|
|
1663
|
+
var me = {}, ge = {}, ct;
|
|
1664
|
+
function Dt() {
|
|
1665
|
+
if (ct) return ge;
|
|
1666
|
+
ct = 1, Object.defineProperty(ge, "__esModule", { value: !0 }), ge.ICO = void 0;
|
|
1667
|
+
const e = H(), t = 1, i = 6, r = 16;
|
|
1668
|
+
function o(l, s) {
|
|
1669
|
+
const f = l[s];
|
|
1670
|
+
return f === 0 ? 256 : f;
|
|
1671
|
+
}
|
|
1672
|
+
function m(l, s) {
|
|
1673
|
+
const f = i + s * r;
|
|
1676
1674
|
return {
|
|
1677
|
-
height: o(
|
|
1678
|
-
width: o(
|
|
1675
|
+
height: o(l, f + 1),
|
|
1676
|
+
width: o(l, f)
|
|
1679
1677
|
};
|
|
1680
1678
|
}
|
|
1681
1679
|
return ge.ICO = {
|
|
1682
|
-
validate(
|
|
1683
|
-
const
|
|
1684
|
-
return
|
|
1680
|
+
validate(l) {
|
|
1681
|
+
const s = (0, e.readUInt16LE)(l, 0), f = (0, e.readUInt16LE)(l, 4);
|
|
1682
|
+
return s !== 0 || f === 0 ? !1 : (0, e.readUInt16LE)(l, 2) === t;
|
|
1685
1683
|
},
|
|
1686
|
-
calculate(
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1689
|
-
return
|
|
1690
|
-
const
|
|
1691
|
-
for (let
|
|
1692
|
-
|
|
1684
|
+
calculate(l) {
|
|
1685
|
+
const s = (0, e.readUInt16LE)(l, 4), f = m(l, 0);
|
|
1686
|
+
if (s === 1)
|
|
1687
|
+
return f;
|
|
1688
|
+
const n = [f];
|
|
1689
|
+
for (let w = 1; w < s; w += 1)
|
|
1690
|
+
n.push(m(l, w));
|
|
1693
1691
|
return {
|
|
1694
|
-
height:
|
|
1695
|
-
images:
|
|
1696
|
-
width:
|
|
1692
|
+
height: f.height,
|
|
1693
|
+
images: n,
|
|
1694
|
+
width: f.width
|
|
1697
1695
|
};
|
|
1698
1696
|
}
|
|
1699
1697
|
}, ge;
|
|
1700
1698
|
}
|
|
1701
|
-
var
|
|
1702
|
-
function
|
|
1703
|
-
if (
|
|
1704
|
-
|
|
1705
|
-
const e =
|
|
1699
|
+
var dt;
|
|
1700
|
+
function En() {
|
|
1701
|
+
if (dt) return me;
|
|
1702
|
+
dt = 1, Object.defineProperty(me, "__esModule", { value: !0 }), me.CUR = void 0;
|
|
1703
|
+
const e = Dt(), t = H(), i = 2;
|
|
1706
1704
|
return me.CUR = {
|
|
1707
1705
|
validate(r) {
|
|
1708
|
-
const o = (0,
|
|
1709
|
-
return o !== 0 ||
|
|
1706
|
+
const o = (0, t.readUInt16LE)(r, 0), m = (0, t.readUInt16LE)(r, 4);
|
|
1707
|
+
return o !== 0 || m === 0 ? !1 : (0, t.readUInt16LE)(r, 2) === i;
|
|
1710
1708
|
},
|
|
1711
1709
|
calculate: (r) => e.ICO.calculate(r)
|
|
1712
1710
|
}, me;
|
|
1713
1711
|
}
|
|
1714
|
-
var
|
|
1715
|
-
const
|
|
1716
|
-
var ye = {},
|
|
1717
|
-
function
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1712
|
+
var _n = En();
|
|
1713
|
+
const Tn = /* @__PURE__ */ z(_n);
|
|
1714
|
+
var ye = {}, ut;
|
|
1715
|
+
function Cn() {
|
|
1716
|
+
if (ut) return ye;
|
|
1717
|
+
ut = 1, Object.defineProperty(ye, "__esModule", { value: !0 }), ye.DDS = void 0;
|
|
1720
1718
|
const e = H();
|
|
1721
1719
|
return ye.DDS = {
|
|
1722
|
-
validate: (
|
|
1723
|
-
calculate: (
|
|
1724
|
-
height: (0, e.readUInt32LE)(
|
|
1725
|
-
width: (0, e.readUInt32LE)(
|
|
1720
|
+
validate: (t) => (0, e.readUInt32LE)(t, 0) === 542327876,
|
|
1721
|
+
calculate: (t) => ({
|
|
1722
|
+
height: (0, e.readUInt32LE)(t, 12),
|
|
1723
|
+
width: (0, e.readUInt32LE)(t, 16)
|
|
1726
1724
|
})
|
|
1727
1725
|
}, ye;
|
|
1728
1726
|
}
|
|
1729
|
-
var
|
|
1730
|
-
const
|
|
1731
|
-
var be = {},
|
|
1732
|
-
function
|
|
1733
|
-
if (
|
|
1734
|
-
|
|
1735
|
-
const e = H(),
|
|
1727
|
+
var Pn = Cn();
|
|
1728
|
+
const Dn = /* @__PURE__ */ z(Pn);
|
|
1729
|
+
var be = {}, ft;
|
|
1730
|
+
function Nn() {
|
|
1731
|
+
if (ft) return be;
|
|
1732
|
+
ft = 1, Object.defineProperty(be, "__esModule", { value: !0 }), be.GIF = void 0;
|
|
1733
|
+
const e = H(), t = /^GIF8[79]a/;
|
|
1736
1734
|
return be.GIF = {
|
|
1737
|
-
validate: (i) =>
|
|
1735
|
+
validate: (i) => t.test((0, e.toUTF8String)(i, 0, 6)),
|
|
1738
1736
|
calculate: (i) => ({
|
|
1739
1737
|
height: (0, e.readUInt16LE)(i, 8),
|
|
1740
1738
|
width: (0, e.readUInt16LE)(i, 6)
|
|
1741
1739
|
})
|
|
1742
1740
|
}, be;
|
|
1743
1741
|
}
|
|
1744
|
-
var
|
|
1745
|
-
const
|
|
1746
|
-
var ve = {},
|
|
1747
|
-
function
|
|
1748
|
-
if (
|
|
1749
|
-
|
|
1750
|
-
const e = H(),
|
|
1742
|
+
var Mn = Nn();
|
|
1743
|
+
const qn = /* @__PURE__ */ z(Mn);
|
|
1744
|
+
var ve = {}, pt;
|
|
1745
|
+
function On() {
|
|
1746
|
+
if (pt) return ve;
|
|
1747
|
+
pt = 1, Object.defineProperty(ve, "__esModule", { value: !0 }), ve.ICNS = void 0;
|
|
1748
|
+
const e = H(), t = 8, i = 4, r = 4, o = {
|
|
1751
1749
|
ICON: 32,
|
|
1752
1750
|
"ICN#": 32,
|
|
1753
1751
|
// m => 16 x 16
|
|
@@ -1789,175 +1787,175 @@ function Ln() {
|
|
|
1789
1787
|
// . => 1024 x 1024
|
|
1790
1788
|
ic10: 1024
|
|
1791
1789
|
};
|
|
1792
|
-
function
|
|
1793
|
-
const
|
|
1790
|
+
function m(s, f) {
|
|
1791
|
+
const n = f + r;
|
|
1794
1792
|
return [
|
|
1795
|
-
(0, e.toUTF8String)(
|
|
1796
|
-
(0, e.readUInt32BE)(
|
|
1793
|
+
(0, e.toUTF8String)(s, f, n),
|
|
1794
|
+
(0, e.readUInt32BE)(s, n)
|
|
1797
1795
|
];
|
|
1798
1796
|
}
|
|
1799
|
-
function
|
|
1800
|
-
const
|
|
1801
|
-
return { width:
|
|
1797
|
+
function l(s) {
|
|
1798
|
+
const f = o[s];
|
|
1799
|
+
return { width: f, height: f, type: s };
|
|
1802
1800
|
}
|
|
1803
1801
|
return ve.ICNS = {
|
|
1804
|
-
validate: (
|
|
1805
|
-
calculate(
|
|
1806
|
-
const
|
|
1807
|
-
let
|
|
1808
|
-
if (
|
|
1809
|
-
return
|
|
1810
|
-
const
|
|
1811
|
-
height:
|
|
1812
|
-
images: [
|
|
1813
|
-
width:
|
|
1802
|
+
validate: (s) => (0, e.toUTF8String)(s, 0, 4) === "icns",
|
|
1803
|
+
calculate(s) {
|
|
1804
|
+
const f = s.length, n = (0, e.readUInt32BE)(s, i);
|
|
1805
|
+
let w = t, x = m(s, w), I = l(x[0]);
|
|
1806
|
+
if (w += x[1], w === n)
|
|
1807
|
+
return I;
|
|
1808
|
+
const y = {
|
|
1809
|
+
height: I.height,
|
|
1810
|
+
images: [I],
|
|
1811
|
+
width: I.width
|
|
1814
1812
|
};
|
|
1815
|
-
for (;
|
|
1816
|
-
|
|
1817
|
-
return
|
|
1813
|
+
for (; w < n && w < f; )
|
|
1814
|
+
x = m(s, w), I = l(x[0]), w += x[1], y.images.push(I);
|
|
1815
|
+
return y;
|
|
1818
1816
|
}
|
|
1819
1817
|
}, ve;
|
|
1820
1818
|
}
|
|
1821
|
-
var
|
|
1822
|
-
const
|
|
1823
|
-
var
|
|
1824
|
-
const
|
|
1825
|
-
var we = {},
|
|
1826
|
-
function
|
|
1827
|
-
if (
|
|
1828
|
-
|
|
1819
|
+
var Ln = On();
|
|
1820
|
+
const jn = /* @__PURE__ */ z(Ln);
|
|
1821
|
+
var Un = Dt();
|
|
1822
|
+
const Bn = /* @__PURE__ */ z(Un);
|
|
1823
|
+
var we = {}, ht;
|
|
1824
|
+
function An() {
|
|
1825
|
+
if (ht) return we;
|
|
1826
|
+
ht = 1, Object.defineProperty(we, "__esModule", { value: !0 }), we.J2C = void 0;
|
|
1829
1827
|
const e = H();
|
|
1830
1828
|
return we.J2C = {
|
|
1831
1829
|
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
1832
|
-
validate: (
|
|
1833
|
-
calculate: (
|
|
1834
|
-
height: (0, e.readUInt32BE)(
|
|
1835
|
-
width: (0, e.readUInt32BE)(
|
|
1830
|
+
validate: (t) => (0, e.readUInt32BE)(t, 0) === 4283432785,
|
|
1831
|
+
calculate: (t) => ({
|
|
1832
|
+
height: (0, e.readUInt32BE)(t, 12),
|
|
1833
|
+
width: (0, e.readUInt32BE)(t, 8)
|
|
1836
1834
|
})
|
|
1837
1835
|
}, we;
|
|
1838
1836
|
}
|
|
1839
|
-
var
|
|
1840
|
-
const
|
|
1841
|
-
var xe = {},
|
|
1842
|
-
function
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1837
|
+
var Fn = An();
|
|
1838
|
+
const Rn = /* @__PURE__ */ z(Fn);
|
|
1839
|
+
var xe = {}, mt;
|
|
1840
|
+
function $n() {
|
|
1841
|
+
if (mt) return xe;
|
|
1842
|
+
mt = 1, Object.defineProperty(xe, "__esModule", { value: !0 }), xe.JP2 = void 0;
|
|
1845
1843
|
const e = H();
|
|
1846
1844
|
return xe.JP2 = {
|
|
1847
|
-
validate(
|
|
1848
|
-
if ((0, e.toUTF8String)(
|
|
1845
|
+
validate(t) {
|
|
1846
|
+
if ((0, e.toUTF8String)(t, 4, 8) !== "jP ")
|
|
1849
1847
|
return !1;
|
|
1850
|
-
const r = (0, e.findBox)(
|
|
1851
|
-
return r ? (0, e.toUTF8String)(
|
|
1848
|
+
const r = (0, e.findBox)(t, "ftyp", 0);
|
|
1849
|
+
return r ? (0, e.toUTF8String)(t, r.offset + 8, r.offset + 12) === "jp2 " : !1;
|
|
1852
1850
|
},
|
|
1853
|
-
calculate(
|
|
1854
|
-
const i = (0, e.findBox)(
|
|
1851
|
+
calculate(t) {
|
|
1852
|
+
const i = (0, e.findBox)(t, "jp2h", 0), r = i && (0, e.findBox)(t, "ihdr", i.offset + 8);
|
|
1855
1853
|
if (r)
|
|
1856
1854
|
return {
|
|
1857
|
-
height: (0, e.readUInt32BE)(
|
|
1858
|
-
width: (0, e.readUInt32BE)(
|
|
1855
|
+
height: (0, e.readUInt32BE)(t, r.offset + 8),
|
|
1856
|
+
width: (0, e.readUInt32BE)(t, r.offset + 12)
|
|
1859
1857
|
};
|
|
1860
1858
|
throw new TypeError("Unsupported JPEG 2000 format");
|
|
1861
1859
|
}
|
|
1862
1860
|
}, xe;
|
|
1863
1861
|
}
|
|
1864
|
-
var
|
|
1865
|
-
const
|
|
1866
|
-
var Ie = {},
|
|
1867
|
-
function
|
|
1868
|
-
if (
|
|
1869
|
-
|
|
1870
|
-
const e = H(),
|
|
1871
|
-
function
|
|
1872
|
-
return (0, e.toHexString)(
|
|
1873
|
-
}
|
|
1874
|
-
function
|
|
1862
|
+
var zn = $n();
|
|
1863
|
+
const Hn = /* @__PURE__ */ z(zn);
|
|
1864
|
+
var Ie = {}, gt;
|
|
1865
|
+
function Wn() {
|
|
1866
|
+
if (gt) return Ie;
|
|
1867
|
+
gt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.JPG = void 0;
|
|
1868
|
+
const e = H(), t = "45786966", i = 2, r = 6, o = 2, m = "4d4d", l = "4949", s = 12, f = 2;
|
|
1869
|
+
function n(d) {
|
|
1870
|
+
return (0, e.toHexString)(d, 2, 6) === t;
|
|
1871
|
+
}
|
|
1872
|
+
function w(d, u) {
|
|
1875
1873
|
return {
|
|
1876
|
-
height: (0, e.readUInt16BE)(
|
|
1877
|
-
width: (0, e.readUInt16BE)(
|
|
1874
|
+
height: (0, e.readUInt16BE)(d, u),
|
|
1875
|
+
width: (0, e.readUInt16BE)(d, u + 2)
|
|
1878
1876
|
};
|
|
1879
1877
|
}
|
|
1880
|
-
function
|
|
1881
|
-
const
|
|
1882
|
-
for (let
|
|
1883
|
-
const
|
|
1884
|
-
if (
|
|
1878
|
+
function x(d, u) {
|
|
1879
|
+
const a = r + 8, h = (0, e.readUInt)(d, 16, a, u);
|
|
1880
|
+
for (let _ = 0; _ < h; _++) {
|
|
1881
|
+
const c = a + f + _ * s, g = c + s;
|
|
1882
|
+
if (c > d.length)
|
|
1885
1883
|
return;
|
|
1886
|
-
const
|
|
1887
|
-
if ((0, e.readUInt)(
|
|
1888
|
-
return (0, e.readUInt)(
|
|
1884
|
+
const b = d.slice(c, g);
|
|
1885
|
+
if ((0, e.readUInt)(b, 16, 0, u) === 274)
|
|
1886
|
+
return (0, e.readUInt)(b, 16, 2, u) !== 3 || (0, e.readUInt)(b, 32, 4, u) !== 1 ? void 0 : (0, e.readUInt)(b, 16, 8, u);
|
|
1889
1887
|
}
|
|
1890
1888
|
}
|
|
1891
|
-
function
|
|
1892
|
-
const
|
|
1893
|
-
if (
|
|
1894
|
-
return
|
|
1889
|
+
function I(d, u) {
|
|
1890
|
+
const p = d.slice(i, u), a = (0, e.toHexString)(p, r, r + o), h = a === m;
|
|
1891
|
+
if (h || a === l)
|
|
1892
|
+
return x(p, h);
|
|
1895
1893
|
}
|
|
1896
|
-
function
|
|
1897
|
-
if (
|
|
1894
|
+
function y(d, u) {
|
|
1895
|
+
if (u > d.length)
|
|
1898
1896
|
throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
1899
1897
|
}
|
|
1900
1898
|
return Ie.JPG = {
|
|
1901
|
-
validate: (
|
|
1902
|
-
calculate(
|
|
1903
|
-
|
|
1904
|
-
let
|
|
1905
|
-
for (;
|
|
1906
|
-
const
|
|
1907
|
-
if (
|
|
1908
|
-
|
|
1899
|
+
validate: (d) => (0, e.toHexString)(d, 0, 2) === "ffd8",
|
|
1900
|
+
calculate(d) {
|
|
1901
|
+
d = d.slice(4);
|
|
1902
|
+
let u, p;
|
|
1903
|
+
for (; d.length; ) {
|
|
1904
|
+
const a = (0, e.readUInt16BE)(d, 0);
|
|
1905
|
+
if (d[a] !== 255) {
|
|
1906
|
+
d = d.slice(1);
|
|
1909
1907
|
continue;
|
|
1910
1908
|
}
|
|
1911
|
-
if (
|
|
1912
|
-
const
|
|
1913
|
-
return
|
|
1914
|
-
height:
|
|
1915
|
-
orientation:
|
|
1916
|
-
width:
|
|
1917
|
-
} :
|
|
1909
|
+
if (n(d) && (u = I(d, a)), y(d, a), p = d[a + 1], p === 192 || p === 193 || p === 194) {
|
|
1910
|
+
const h = w(d, a + 5);
|
|
1911
|
+
return u ? {
|
|
1912
|
+
height: h.height,
|
|
1913
|
+
orientation: u,
|
|
1914
|
+
width: h.width
|
|
1915
|
+
} : h;
|
|
1918
1916
|
}
|
|
1919
|
-
|
|
1917
|
+
d = d.slice(a + 2);
|
|
1920
1918
|
}
|
|
1921
1919
|
throw new TypeError("Invalid JPG, no size found");
|
|
1922
1920
|
}
|
|
1923
1921
|
}, Ie;
|
|
1924
1922
|
}
|
|
1925
|
-
var
|
|
1926
|
-
const
|
|
1927
|
-
var Se = {},
|
|
1928
|
-
function
|
|
1929
|
-
if (
|
|
1930
|
-
|
|
1923
|
+
var Gn = Wn();
|
|
1924
|
+
const Kn = /* @__PURE__ */ z(Gn);
|
|
1925
|
+
var Se = {}, yt;
|
|
1926
|
+
function Qn() {
|
|
1927
|
+
if (yt) return Se;
|
|
1928
|
+
yt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.KTX = void 0;
|
|
1931
1929
|
const e = H();
|
|
1932
1930
|
return Se.KTX = {
|
|
1933
|
-
validate: (
|
|
1934
|
-
const i = (0, e.toUTF8String)(
|
|
1931
|
+
validate: (t) => {
|
|
1932
|
+
const i = (0, e.toUTF8String)(t, 1, 7);
|
|
1935
1933
|
return ["KTX 11", "KTX 20"].includes(i);
|
|
1936
1934
|
},
|
|
1937
|
-
calculate: (
|
|
1938
|
-
const i =
|
|
1935
|
+
calculate: (t) => {
|
|
1936
|
+
const i = t[5] === 49 ? "ktx" : "ktx2", r = i === "ktx" ? 36 : 20;
|
|
1939
1937
|
return {
|
|
1940
|
-
height: (0, e.readUInt32LE)(
|
|
1941
|
-
width: (0, e.readUInt32LE)(
|
|
1938
|
+
height: (0, e.readUInt32LE)(t, r + 4),
|
|
1939
|
+
width: (0, e.readUInt32LE)(t, r),
|
|
1942
1940
|
type: i
|
|
1943
1941
|
};
|
|
1944
1942
|
}
|
|
1945
1943
|
}, Se;
|
|
1946
1944
|
}
|
|
1947
|
-
var
|
|
1948
|
-
const
|
|
1949
|
-
var ke = {},
|
|
1950
|
-
function
|
|
1951
|
-
if (
|
|
1952
|
-
|
|
1953
|
-
const e = H(),
|
|
1945
|
+
var Jn = Qn();
|
|
1946
|
+
const Yn = /* @__PURE__ */ z(Jn);
|
|
1947
|
+
var ke = {}, bt;
|
|
1948
|
+
function Xn() {
|
|
1949
|
+
if (bt) return ke;
|
|
1950
|
+
bt = 1, Object.defineProperty(ke, "__esModule", { value: !0 }), ke.PNG = void 0;
|
|
1951
|
+
const e = H(), t = `PNG\r
|
|
1954
1952
|
|
|
1955
1953
|
`, i = "IHDR", r = "CgBI";
|
|
1956
1954
|
return ke.PNG = {
|
|
1957
1955
|
validate(o) {
|
|
1958
|
-
if (
|
|
1959
|
-
let
|
|
1960
|
-
if (
|
|
1956
|
+
if (t === (0, e.toUTF8String)(o, 1, 8)) {
|
|
1957
|
+
let m = (0, e.toUTF8String)(o, 12, 16);
|
|
1958
|
+
if (m === r && (m = (0, e.toUTF8String)(o, 28, 32)), m !== i)
|
|
1961
1959
|
throw new TypeError("Invalid PNG");
|
|
1962
1960
|
return !0;
|
|
1963
1961
|
}
|
|
@@ -1974,13 +1972,13 @@ function Vn() {
|
|
|
1974
1972
|
}
|
|
1975
1973
|
}, ke;
|
|
1976
1974
|
}
|
|
1977
|
-
var
|
|
1978
|
-
const
|
|
1979
|
-
var Ee = {},
|
|
1980
|
-
function
|
|
1981
|
-
if (
|
|
1982
|
-
|
|
1983
|
-
const e = H(),
|
|
1975
|
+
var Vn = Xn();
|
|
1976
|
+
const Zn = /* @__PURE__ */ z(Vn);
|
|
1977
|
+
var Ee = {}, vt;
|
|
1978
|
+
function er() {
|
|
1979
|
+
if (vt) return Ee;
|
|
1980
|
+
vt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.PNM = void 0;
|
|
1981
|
+
const e = H(), t = {
|
|
1984
1982
|
P1: "pbm/ascii",
|
|
1985
1983
|
P2: "pgm/ascii",
|
|
1986
1984
|
P3: "ppm/ascii",
|
|
@@ -1993,9 +1991,9 @@ function tr() {
|
|
|
1993
1991
|
default: (r) => {
|
|
1994
1992
|
let o = [];
|
|
1995
1993
|
for (; r.length > 0; ) {
|
|
1996
|
-
const
|
|
1997
|
-
if (
|
|
1998
|
-
o =
|
|
1994
|
+
const m = r.shift();
|
|
1995
|
+
if (m[0] !== "#") {
|
|
1996
|
+
o = m.split(" ");
|
|
1999
1997
|
break;
|
|
2000
1998
|
}
|
|
2001
1999
|
}
|
|
@@ -2009,11 +2007,11 @@ function tr() {
|
|
|
2009
2007
|
pam: (r) => {
|
|
2010
2008
|
const o = {};
|
|
2011
2009
|
for (; r.length > 0; ) {
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2010
|
+
const m = r.shift();
|
|
2011
|
+
if (m.length > 16 || m.charCodeAt(0) > 128)
|
|
2014
2012
|
continue;
|
|
2015
|
-
const [
|
|
2016
|
-
if (
|
|
2013
|
+
const [l, s] = m.split(" ");
|
|
2014
|
+
if (l && s && (o[l.toLowerCase()] = parseInt(s, 10)), o.height && o.width)
|
|
2017
2015
|
break;
|
|
2018
2016
|
}
|
|
2019
2017
|
if (o.height && o.width)
|
|
@@ -2025,37 +2023,37 @@ function tr() {
|
|
|
2025
2023
|
}
|
|
2026
2024
|
};
|
|
2027
2025
|
return Ee.PNM = {
|
|
2028
|
-
validate: (r) => (0, e.toUTF8String)(r, 0, 2) in
|
|
2026
|
+
validate: (r) => (0, e.toUTF8String)(r, 0, 2) in t,
|
|
2029
2027
|
calculate(r) {
|
|
2030
|
-
const o = (0, e.toUTF8String)(r, 0, 2),
|
|
2031
|
-
return (i[
|
|
2028
|
+
const o = (0, e.toUTF8String)(r, 0, 2), m = t[o], l = (0, e.toUTF8String)(r, 3).split(/[\r\n]+/);
|
|
2029
|
+
return (i[m] || i.default)(l);
|
|
2032
2030
|
}
|
|
2033
2031
|
}, Ee;
|
|
2034
2032
|
}
|
|
2035
|
-
var
|
|
2036
|
-
const
|
|
2037
|
-
var _e = {},
|
|
2038
|
-
function
|
|
2039
|
-
if (
|
|
2040
|
-
|
|
2033
|
+
var tr = er();
|
|
2034
|
+
const nr = /* @__PURE__ */ z(tr);
|
|
2035
|
+
var _e = {}, wt;
|
|
2036
|
+
function rr() {
|
|
2037
|
+
if (wt) return _e;
|
|
2038
|
+
wt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.PSD = void 0;
|
|
2041
2039
|
const e = H();
|
|
2042
2040
|
return _e.PSD = {
|
|
2043
|
-
validate: (
|
|
2044
|
-
calculate: (
|
|
2045
|
-
height: (0, e.readUInt32BE)(
|
|
2046
|
-
width: (0, e.readUInt32BE)(
|
|
2041
|
+
validate: (t) => (0, e.toUTF8String)(t, 0, 4) === "8BPS",
|
|
2042
|
+
calculate: (t) => ({
|
|
2043
|
+
height: (0, e.readUInt32BE)(t, 14),
|
|
2044
|
+
width: (0, e.readUInt32BE)(t, 18)
|
|
2047
2045
|
})
|
|
2048
2046
|
}, _e;
|
|
2049
2047
|
}
|
|
2050
|
-
var
|
|
2051
|
-
const
|
|
2052
|
-
var Te = {},
|
|
2053
|
-
function
|
|
2054
|
-
if (
|
|
2055
|
-
|
|
2056
|
-
const e = H(),
|
|
2048
|
+
var or = rr();
|
|
2049
|
+
const ir = /* @__PURE__ */ z(or);
|
|
2050
|
+
var Te = {}, xt;
|
|
2051
|
+
function sr() {
|
|
2052
|
+
if (xt) return Te;
|
|
2053
|
+
xt = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.SVG = void 0;
|
|
2054
|
+
const e = H(), t = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, i = {
|
|
2057
2055
|
height: /\sheight=(['"])([^%]+?)\1/,
|
|
2058
|
-
root:
|
|
2056
|
+
root: t,
|
|
2059
2057
|
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
2060
2058
|
width: /\swidth=(['"])([^%]+?)\1/
|
|
2061
2059
|
}, r = 2.54, o = {
|
|
@@ -2068,89 +2066,89 @@ function ar() {
|
|
|
2068
2066
|
pc: 96 / 72 / 12,
|
|
2069
2067
|
pt: 96 / 72,
|
|
2070
2068
|
px: 1
|
|
2071
|
-
},
|
|
2072
|
-
function
|
|
2073
|
-
const
|
|
2074
|
-
if (
|
|
2075
|
-
return Math.round(Number(
|
|
2076
|
-
}
|
|
2077
|
-
function
|
|
2078
|
-
const
|
|
2069
|
+
}, m = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(o).join("|")})?$`);
|
|
2070
|
+
function l(x) {
|
|
2071
|
+
const I = m.exec(x);
|
|
2072
|
+
if (I)
|
|
2073
|
+
return Math.round(Number(I[1]) * (o[I[2]] || 1));
|
|
2074
|
+
}
|
|
2075
|
+
function s(x) {
|
|
2076
|
+
const I = x.split(" ");
|
|
2079
2077
|
return {
|
|
2080
|
-
height:
|
|
2081
|
-
width:
|
|
2078
|
+
height: l(I[3]),
|
|
2079
|
+
width: l(I[2])
|
|
2082
2080
|
};
|
|
2083
2081
|
}
|
|
2084
|
-
function
|
|
2085
|
-
const
|
|
2082
|
+
function f(x) {
|
|
2083
|
+
const I = x.match(i.width), y = x.match(i.height), d = x.match(i.viewbox);
|
|
2086
2084
|
return {
|
|
2087
|
-
height:
|
|
2088
|
-
viewbox:
|
|
2089
|
-
width:
|
|
2085
|
+
height: y && l(y[2]),
|
|
2086
|
+
viewbox: d && s(d[2]),
|
|
2087
|
+
width: I && l(I[2])
|
|
2090
2088
|
};
|
|
2091
2089
|
}
|
|
2092
|
-
function
|
|
2090
|
+
function n(x) {
|
|
2093
2091
|
return {
|
|
2094
|
-
height:
|
|
2095
|
-
width:
|
|
2092
|
+
height: x.height,
|
|
2093
|
+
width: x.width
|
|
2096
2094
|
};
|
|
2097
2095
|
}
|
|
2098
|
-
function
|
|
2099
|
-
const
|
|
2100
|
-
return
|
|
2101
|
-
height: Math.floor(
|
|
2102
|
-
width: w.width
|
|
2103
|
-
} : w.height ? {
|
|
2104
|
-
height: w.height,
|
|
2105
|
-
width: Math.floor(w.height * _)
|
|
2106
|
-
} : {
|
|
2107
|
-
height: x.height,
|
|
2096
|
+
function w(x, I) {
|
|
2097
|
+
const y = I.width / I.height;
|
|
2098
|
+
return x.width ? {
|
|
2099
|
+
height: Math.floor(x.width / y),
|
|
2108
2100
|
width: x.width
|
|
2101
|
+
} : x.height ? {
|
|
2102
|
+
height: x.height,
|
|
2103
|
+
width: Math.floor(x.height * y)
|
|
2104
|
+
} : {
|
|
2105
|
+
height: I.height,
|
|
2106
|
+
width: I.width
|
|
2109
2107
|
};
|
|
2110
2108
|
}
|
|
2111
2109
|
return Te.SVG = {
|
|
2112
2110
|
// Scan only the first kilo-byte to speed up the check on larger files
|
|
2113
|
-
validate: (
|
|
2114
|
-
calculate(
|
|
2115
|
-
const
|
|
2116
|
-
if (
|
|
2117
|
-
const
|
|
2118
|
-
if (
|
|
2119
|
-
return
|
|
2120
|
-
if (
|
|
2121
|
-
return
|
|
2111
|
+
validate: (x) => t.test((0, e.toUTF8String)(x, 0, 1e3)),
|
|
2112
|
+
calculate(x) {
|
|
2113
|
+
const I = (0, e.toUTF8String)(x).match(i.root);
|
|
2114
|
+
if (I) {
|
|
2115
|
+
const y = f(I[0]);
|
|
2116
|
+
if (y.width && y.height)
|
|
2117
|
+
return n(y);
|
|
2118
|
+
if (y.viewbox)
|
|
2119
|
+
return w(y, y.viewbox);
|
|
2122
2120
|
}
|
|
2123
2121
|
throw new TypeError("Invalid SVG");
|
|
2124
2122
|
}
|
|
2125
2123
|
}, Te;
|
|
2126
2124
|
}
|
|
2127
|
-
var
|
|
2128
|
-
const
|
|
2129
|
-
var Ce = {},
|
|
2130
|
-
function
|
|
2131
|
-
if (
|
|
2132
|
-
|
|
2125
|
+
var ar = sr();
|
|
2126
|
+
const lr = /* @__PURE__ */ z(ar);
|
|
2127
|
+
var Ce = {}, It;
|
|
2128
|
+
function cr() {
|
|
2129
|
+
if (It) return Ce;
|
|
2130
|
+
It = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.TGA = void 0;
|
|
2133
2131
|
const e = H();
|
|
2134
2132
|
return Ce.TGA = {
|
|
2135
|
-
validate(
|
|
2136
|
-
return (0, e.readUInt16LE)(
|
|
2133
|
+
validate(t) {
|
|
2134
|
+
return (0, e.readUInt16LE)(t, 0) === 0 && (0, e.readUInt16LE)(t, 4) === 0;
|
|
2137
2135
|
},
|
|
2138
|
-
calculate(
|
|
2136
|
+
calculate(t) {
|
|
2139
2137
|
return {
|
|
2140
|
-
height: (0, e.readUInt16LE)(
|
|
2141
|
-
width: (0, e.readUInt16LE)(
|
|
2138
|
+
height: (0, e.readUInt16LE)(t, 14),
|
|
2139
|
+
width: (0, e.readUInt16LE)(t, 12)
|
|
2142
2140
|
};
|
|
2143
2141
|
}
|
|
2144
2142
|
}, Ce;
|
|
2145
2143
|
}
|
|
2146
|
-
var
|
|
2147
|
-
const
|
|
2148
|
-
var Pe = {},
|
|
2149
|
-
function
|
|
2150
|
-
if (
|
|
2151
|
-
|
|
2144
|
+
var dr = cr();
|
|
2145
|
+
const ur = /* @__PURE__ */ z(dr);
|
|
2146
|
+
var Pe = {}, St;
|
|
2147
|
+
function fr() {
|
|
2148
|
+
if (St) return Pe;
|
|
2149
|
+
St = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.WEBP = void 0;
|
|
2152
2150
|
const e = H();
|
|
2153
|
-
function
|
|
2151
|
+
function t(o) {
|
|
2154
2152
|
return {
|
|
2155
2153
|
height: 1 + (0, e.readUInt24LE)(o, 7),
|
|
2156
2154
|
width: 1 + (0, e.readUInt24LE)(o, 4)
|
|
@@ -2170,33 +2168,33 @@ function pr() {
|
|
|
2170
2168
|
}
|
|
2171
2169
|
return Pe.WEBP = {
|
|
2172
2170
|
validate(o) {
|
|
2173
|
-
const
|
|
2174
|
-
return
|
|
2171
|
+
const m = (0, e.toUTF8String)(o, 0, 4) === "RIFF", l = (0, e.toUTF8String)(o, 8, 12) === "WEBP", s = (0, e.toUTF8String)(o, 12, 15) === "VP8";
|
|
2172
|
+
return m && l && s;
|
|
2175
2173
|
},
|
|
2176
2174
|
calculate(o) {
|
|
2177
|
-
const
|
|
2178
|
-
if (o = o.slice(20, 30),
|
|
2179
|
-
const
|
|
2180
|
-
if (
|
|
2181
|
-
return
|
|
2175
|
+
const m = (0, e.toUTF8String)(o, 12, 16);
|
|
2176
|
+
if (o = o.slice(20, 30), m === "VP8X") {
|
|
2177
|
+
const s = o[0], f = (s & 192) === 0, n = (s & 1) === 0;
|
|
2178
|
+
if (f && n)
|
|
2179
|
+
return t(o);
|
|
2182
2180
|
throw new TypeError("Invalid WebP");
|
|
2183
2181
|
}
|
|
2184
|
-
if (
|
|
2182
|
+
if (m === "VP8 " && o[0] !== 47)
|
|
2185
2183
|
return r(o);
|
|
2186
|
-
const
|
|
2187
|
-
if (
|
|
2184
|
+
const l = (0, e.toHexString)(o, 3, 6);
|
|
2185
|
+
if (m === "VP8L" && l !== "9d012a")
|
|
2188
2186
|
return i(o);
|
|
2189
2187
|
throw new TypeError("Invalid WebP");
|
|
2190
2188
|
}
|
|
2191
2189
|
}, Pe;
|
|
2192
2190
|
}
|
|
2193
|
-
var
|
|
2194
|
-
const
|
|
2195
|
-
var De = {},
|
|
2196
|
-
function
|
|
2197
|
-
if (
|
|
2198
|
-
|
|
2199
|
-
const e = H(),
|
|
2191
|
+
var pr = fr();
|
|
2192
|
+
const hr = /* @__PURE__ */ z(pr);
|
|
2193
|
+
var De = {}, kt;
|
|
2194
|
+
function mr() {
|
|
2195
|
+
if (kt) return De;
|
|
2196
|
+
kt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.HEIF = void 0;
|
|
2197
|
+
const e = H(), t = {
|
|
2200
2198
|
avif: "avif",
|
|
2201
2199
|
mif1: "heif",
|
|
2202
2200
|
msf1: "heif",
|
|
@@ -2213,22 +2211,22 @@ function gr() {
|
|
|
2213
2211
|
if ((0, e.toUTF8String)(i, 4, 8) !== "ftyp")
|
|
2214
2212
|
return !1;
|
|
2215
2213
|
const o = (0, e.findBox)(i, "ftyp", 0);
|
|
2216
|
-
return o ? (0, e.toUTF8String)(i, o.offset + 8, o.offset + 12) in
|
|
2214
|
+
return o ? (0, e.toUTF8String)(i, o.offset + 8, o.offset + 12) in t : !1;
|
|
2217
2215
|
},
|
|
2218
2216
|
calculate(i) {
|
|
2219
|
-
const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12),
|
|
2220
|
-
if (
|
|
2217
|
+
const r = (0, e.findBox)(i, "meta", 0), o = r && (0, e.findBox)(i, "iprp", r.offset + 12), m = o && (0, e.findBox)(i, "ipco", o.offset + 8), l = m && (0, e.findBox)(i, "ispe", m.offset + 8);
|
|
2218
|
+
if (l)
|
|
2221
2219
|
return {
|
|
2222
|
-
height: (0, e.readUInt32BE)(i,
|
|
2223
|
-
width: (0, e.readUInt32BE)(i,
|
|
2220
|
+
height: (0, e.readUInt32BE)(i, l.offset + 16),
|
|
2221
|
+
width: (0, e.readUInt32BE)(i, l.offset + 12),
|
|
2224
2222
|
type: (0, e.toUTF8String)(i, 8, 12)
|
|
2225
2223
|
};
|
|
2226
2224
|
throw new TypeError("Invalid HEIF, no size found");
|
|
2227
2225
|
}
|
|
2228
2226
|
}, De;
|
|
2229
2227
|
}
|
|
2230
|
-
var
|
|
2231
|
-
const
|
|
2228
|
+
var gr = mr();
|
|
2229
|
+
const yr = /* @__PURE__ */ z(gr), br = {
|
|
2232
2230
|
56: "psd",
|
|
2233
2231
|
66: "bmp",
|
|
2234
2232
|
68: "dds",
|
|
@@ -2238,47 +2236,47 @@ const br = /* @__PURE__ */ z(yr), vr = {
|
|
|
2238
2236
|
137: "png",
|
|
2239
2237
|
255: "jpg"
|
|
2240
2238
|
}, Fe = {
|
|
2241
|
-
webp:
|
|
2242
|
-
jpg:
|
|
2243
|
-
png:
|
|
2244
|
-
svg:
|
|
2245
|
-
gif:
|
|
2246
|
-
avif:
|
|
2247
|
-
bmp:
|
|
2248
|
-
cur:
|
|
2249
|
-
dds:
|
|
2250
|
-
icns:
|
|
2251
|
-
ico:
|
|
2252
|
-
j2c:
|
|
2253
|
-
jp2:
|
|
2254
|
-
ktx:
|
|
2255
|
-
pnm:
|
|
2256
|
-
psd:
|
|
2257
|
-
tga:
|
|
2258
|
-
},
|
|
2259
|
-
function
|
|
2260
|
-
const
|
|
2261
|
-
return i && Fe[i].validate(e) ? i :
|
|
2239
|
+
webp: hr.WEBP,
|
|
2240
|
+
jpg: Kn.JPG,
|
|
2241
|
+
png: Zn.PNG,
|
|
2242
|
+
svg: lr.SVG,
|
|
2243
|
+
gif: qn.GIF,
|
|
2244
|
+
avif: yr.HEIF,
|
|
2245
|
+
bmp: kn.BMP,
|
|
2246
|
+
cur: Tn.CUR,
|
|
2247
|
+
dds: Dn.DDS,
|
|
2248
|
+
icns: jn.ICNS,
|
|
2249
|
+
ico: Bn.ICO,
|
|
2250
|
+
j2c: Rn.J2C,
|
|
2251
|
+
jp2: Hn.JP2,
|
|
2252
|
+
ktx: Yn.KTX,
|
|
2253
|
+
pnm: nr.PNM,
|
|
2254
|
+
psd: ir.PSD,
|
|
2255
|
+
tga: ur.TGA
|
|
2256
|
+
}, vr = Object.keys(Fe);
|
|
2257
|
+
function wr(e) {
|
|
2258
|
+
const t = e[0], i = br[t];
|
|
2259
|
+
return i && Fe[i].validate(e) ? i : vr.find((r) => Fe[r].validate(e));
|
|
2262
2260
|
}
|
|
2263
|
-
function
|
|
2264
|
-
const
|
|
2265
|
-
if (typeof
|
|
2266
|
-
const i = Fe[
|
|
2261
|
+
function xr(e) {
|
|
2262
|
+
const t = wr(e);
|
|
2263
|
+
if (typeof t < "u") {
|
|
2264
|
+
const i = Fe[t].calculate(e);
|
|
2267
2265
|
if (i !== void 0)
|
|
2268
|
-
return i.type =
|
|
2266
|
+
return i.type = t, i;
|
|
2269
2267
|
}
|
|
2270
2268
|
}
|
|
2271
|
-
async function
|
|
2269
|
+
async function Ir(e) {
|
|
2272
2270
|
if (/^(https?|file|capacitor):/.test(e))
|
|
2273
2271
|
try {
|
|
2274
|
-
const
|
|
2272
|
+
const t = await fetch(e, {
|
|
2275
2273
|
headers: { Accept: "image/*,*/*" }
|
|
2276
2274
|
});
|
|
2277
|
-
if (!
|
|
2275
|
+
if (!t.ok) {
|
|
2278
2276
|
console.error("can not fetch", e);
|
|
2279
2277
|
return;
|
|
2280
2278
|
}
|
|
2281
|
-
const i = await
|
|
2279
|
+
const i = await t.arrayBuffer(), r = xr(Buffer.from(i));
|
|
2282
2280
|
if (r)
|
|
2283
2281
|
return {
|
|
2284
2282
|
width: r.width,
|
|
@@ -2286,106 +2284,106 @@ async function Sr(e) {
|
|
|
2286
2284
|
type: r.type,
|
|
2287
2285
|
size: i.byteLength
|
|
2288
2286
|
};
|
|
2289
|
-
} catch (
|
|
2290
|
-
console.error(
|
|
2287
|
+
} catch (t) {
|
|
2288
|
+
console.error(t);
|
|
2291
2289
|
return;
|
|
2292
2290
|
}
|
|
2293
2291
|
}
|
|
2294
|
-
const
|
|
2292
|
+
const Sr = (e, t, i) => async (r, o, m) => {
|
|
2295
2293
|
try {
|
|
2296
|
-
const
|
|
2297
|
-
let
|
|
2294
|
+
const l = await e.dynamicImport("node:fs"), s = await e.dynamicImport("node:path");
|
|
2295
|
+
let f;
|
|
2298
2296
|
try {
|
|
2299
|
-
|
|
2297
|
+
f = new URL(r.url, "http://localhost:3000/");
|
|
2300
2298
|
} catch {
|
|
2301
2299
|
o.statusCode = 404, o.end();
|
|
2302
2300
|
return;
|
|
2303
2301
|
}
|
|
2304
|
-
if (r.method === "GET" &&
|
|
2305
|
-
const
|
|
2306
|
-
if (o.setHeader("content-type", "application/json"),
|
|
2307
|
-
const
|
|
2308
|
-
o.setHeader("cache-control", "public, max-age=31536000, immutable"),
|
|
2302
|
+
if (r.method === "GET" && f.pathname === "/__image_info") {
|
|
2303
|
+
const n = f.searchParams.get("url");
|
|
2304
|
+
if (o.setHeader("content-type", "application/json"), n) {
|
|
2305
|
+
const w = await Ir(n);
|
|
2306
|
+
o.setHeader("cache-control", "public, max-age=31536000, immutable"), w ? o.write(JSON.stringify(w)) : o.statusCode = 404;
|
|
2309
2307
|
} else {
|
|
2310
2308
|
o.statusCode = 500;
|
|
2311
|
-
const
|
|
2312
|
-
o.write(JSON.stringify(
|
|
2309
|
+
const w = { message: "error" };
|
|
2310
|
+
o.write(JSON.stringify(w));
|
|
2313
2311
|
}
|
|
2314
2312
|
o.end();
|
|
2315
2313
|
return;
|
|
2316
|
-
} else if (r.method === "POST" &&
|
|
2317
|
-
const
|
|
2318
|
-
let
|
|
2319
|
-
const
|
|
2320
|
-
let
|
|
2321
|
-
for (;
|
|
2322
|
-
if (
|
|
2323
|
-
|
|
2314
|
+
} else if (r.method === "POST" && f.pathname === "/__image_fix") {
|
|
2315
|
+
const n = f.searchParams.get("loc"), w = f.searchParams.get("width"), x = f.searchParams.get("height"), I = f.searchParams.get("src"), y = f.searchParams.get("currentHref"), d = n.split(":"), u = parseInt(d[d.length - 1], 10) - 1;
|
|
2316
|
+
let p = parseInt(d[d.length - 2], 10) - 1;
|
|
2317
|
+
const a = s.resolve(i, d.slice(0, d.length - 2).join(":")), h = s.extname(a).toLowerCase();
|
|
2318
|
+
let c = l.readFileSync(a).toString("utf-8"), g = 0;
|
|
2319
|
+
for (; g < c.length; g++)
|
|
2320
|
+
if (p === 0) {
|
|
2321
|
+
g += u;
|
|
2324
2322
|
break;
|
|
2325
|
-
} else if (
|
|
2323
|
+
} else if (c[g] === `
|
|
2326
2324
|
`) {
|
|
2327
|
-
|
|
2325
|
+
p--;
|
|
2328
2326
|
continue;
|
|
2329
2327
|
}
|
|
2330
|
-
if (
|
|
2328
|
+
if (c.slice(g, g + 4) !== "<img") {
|
|
2331
2329
|
console.error(
|
|
2332
2330
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2333
2331
|
), o.statusCode = 500;
|
|
2334
2332
|
return;
|
|
2335
2333
|
}
|
|
2336
|
-
const
|
|
2337
|
-
if (
|
|
2334
|
+
const b = c.indexOf(">", g) + 1;
|
|
2335
|
+
if (b < g) {
|
|
2338
2336
|
console.error(
|
|
2339
2337
|
"Could not apply auto fix, because it was not possible to find the original <img> tag"
|
|
2340
2338
|
), o.statusCode = 500;
|
|
2341
2339
|
return;
|
|
2342
2340
|
}
|
|
2343
|
-
const
|
|
2344
|
-
let
|
|
2345
|
-
if (
|
|
2346
|
-
const q = new URL(
|
|
2341
|
+
const S = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(h);
|
|
2342
|
+
let k = c.slice(g, b);
|
|
2343
|
+
if (I && y && S) {
|
|
2344
|
+
const q = new URL(I), D = new URL(y);
|
|
2347
2345
|
if (q.origin === D.origin) {
|
|
2348
|
-
const P =
|
|
2346
|
+
const P = s.join(t, "public", q.pathname), $ = s.join(t, q.pathname);
|
|
2349
2347
|
let A;
|
|
2350
|
-
if (
|
|
2351
|
-
const Y =
|
|
2352
|
-
await
|
|
2348
|
+
if (l.existsSync(P)) {
|
|
2349
|
+
const Y = s.join(i, "media", s.dirname(q.pathname));
|
|
2350
|
+
await l.promises.mkdir(Y, { recursive: !0 }), await l.promises.copyFile(
|
|
2353
2351
|
P,
|
|
2354
|
-
|
|
2352
|
+
s.join(i, "media", q.pathname)
|
|
2355
2353
|
), A = "~/media" + q.pathname;
|
|
2356
|
-
} else if (
|
|
2354
|
+
} else if (l.existsSync($))
|
|
2357
2355
|
A = q.pathname.replace("/src/", "~/");
|
|
2358
2356
|
else
|
|
2359
2357
|
return;
|
|
2360
|
-
const G =
|
|
2361
|
-
|
|
2358
|
+
const G = kr(q.pathname), X = `${A}?jsx`;
|
|
2359
|
+
k = k.replace(/^<img/, `<${G}`), k = k.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), k = k.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), k = k.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
|
|
2362
2360
|
let Q = 0;
|
|
2363
|
-
if (
|
|
2361
|
+
if (h === ".mdx" && c.startsWith("---") && (Q = c.indexOf("---", 4) + 3, Q === -1))
|
|
2364
2362
|
return;
|
|
2365
2363
|
const ee = `
|
|
2366
2364
|
import ${G} from '${X}';`;
|
|
2367
|
-
|
|
2365
|
+
c = `${c.slice(0, Q)}${ee}${c.slice(
|
|
2368
2366
|
Q,
|
|
2369
|
-
|
|
2370
|
-
)}${
|
|
2367
|
+
g
|
|
2368
|
+
)}${k}${c.slice(b)}`, l.writeFileSync(a, c);
|
|
2371
2369
|
return;
|
|
2372
2370
|
}
|
|
2373
2371
|
}
|
|
2374
|
-
|
|
2372
|
+
k = k.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${w}"`), k = k.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${x}"`), k.includes("height=") || (k = k.replace(/<img/, `<img height="${x}"`)), k.includes("width=") || (k = k.replace(/<img/, `<img width="${w}"`)), c = c.slice(0, g) + k + c.slice(b), l.writeFileSync(a, c);
|
|
2375
2373
|
} else
|
|
2376
|
-
|
|
2377
|
-
} catch (
|
|
2378
|
-
|
|
2374
|
+
m();
|
|
2375
|
+
} catch (l) {
|
|
2376
|
+
l instanceof Error && await rn(e, l), m(l);
|
|
2379
2377
|
}
|
|
2380
2378
|
};
|
|
2381
|
-
function
|
|
2382
|
-
const
|
|
2383
|
-
return e = e.substring(i + 1,
|
|
2379
|
+
function kr(e) {
|
|
2380
|
+
const t = e.lastIndexOf("."), i = e.lastIndexOf("/");
|
|
2381
|
+
return e = e.substring(i + 1, t), `Img${Er(e)}`;
|
|
2384
2382
|
}
|
|
2385
|
-
function
|
|
2386
|
-
return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (
|
|
2383
|
+
function Er(e) {
|
|
2384
|
+
return `${e}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (t, i, r) => `${i.toUpperCase() + r}`).replace(new RegExp(/\w/), (t) => t.toUpperCase());
|
|
2387
2385
|
}
|
|
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__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`).then(()=>{r.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', 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>
|
|
2386
|
+
const _r = `"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'"))`, Tr = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`).then(()=>{r.style.removeProperty("cursor")})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', Cr = `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)})}`, Pr = '[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}', Dr = '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)}', Nr = `<style>
|
|
2389
2387
|
:host {
|
|
2390
2388
|
position: absolute;
|
|
2391
2389
|
border: 1px solid red;
|
|
@@ -2549,73 +2547,73 @@ const Tr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
|
|
|
2549
2547
|
<p class="action-container"></p>
|
|
2550
2548
|
</div>
|
|
2551
2549
|
</dialog>
|
|
2552
|
-
`,
|
|
2553
|
-
async function
|
|
2554
|
-
const o = await i.dynamicImport("node:fs"),
|
|
2555
|
-
(
|
|
2556
|
-
).find((
|
|
2557
|
-
if (!
|
|
2550
|
+
`, Mr = `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}`, qr = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
|
|
2551
|
+
async function Or(e, t, i, r) {
|
|
2552
|
+
const o = await i.dynamicImport("node:fs"), m = await i.dynamicImport("node:url"), s = ["mjs", "cjs", "js"].map(
|
|
2553
|
+
(f) => r.join(t, `entry.preview.${f}`)
|
|
2554
|
+
).find((f) => o.existsSync(f));
|
|
2555
|
+
if (!s)
|
|
2558
2556
|
return Ke(
|
|
2559
2557
|
e,
|
|
2560
|
-
`Unable to find output "${
|
|
2558
|
+
`Unable to find output "${t}/entry.preview" module.
|
|
2561
2559
|
|
|
2562
2560
|
Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
|
|
2563
2561
|
);
|
|
2564
2562
|
try {
|
|
2565
|
-
const
|
|
2566
|
-
let
|
|
2567
|
-
if (
|
|
2563
|
+
const f = m.pathToFileURL(s).href, n = await i.strictDynamicImport(f);
|
|
2564
|
+
let w = null, x = null;
|
|
2565
|
+
if (n.default && (typeof n.default == "function" ? w = n.default : typeof n.default == "object" && (w = n.default.router, x = n.default.notFound)), typeof w != "function")
|
|
2568
2566
|
return Ke(
|
|
2569
2567
|
e,
|
|
2570
|
-
`Entry preview module "${
|
|
2568
|
+
`Entry preview module "${s}" does not export a default middleware function`
|
|
2571
2569
|
);
|
|
2572
|
-
e.use(
|
|
2573
|
-
} catch (
|
|
2574
|
-
return Ke(e, String(
|
|
2570
|
+
e.use(w), typeof x == "function" && e.use(x);
|
|
2571
|
+
} catch (f) {
|
|
2572
|
+
return Ke(e, String(f));
|
|
2575
2573
|
}
|
|
2576
2574
|
}
|
|
2577
|
-
function Ke(e,
|
|
2575
|
+
function Ke(e, t) {
|
|
2578
2576
|
console.log(`
|
|
2579
|
-
❌ ${
|
|
2577
|
+
❌ ${t}
|
|
2580
2578
|
`), e.use((i, r) => {
|
|
2581
2579
|
r.writeHead(400, {
|
|
2582
2580
|
"Content-Type": "text/plain"
|
|
2583
|
-
}), r.end(
|
|
2581
|
+
}), r.end(t);
|
|
2584
2582
|
});
|
|
2585
2583
|
}
|
|
2586
|
-
const
|
|
2584
|
+
const Lr = (e, t) => {
|
|
2587
2585
|
const i = [
|
|
2586
|
+
{ tag: "style", children: Mr, injectTo: "body" },
|
|
2588
2587
|
{ tag: "style", children: qr, injectTo: "body" },
|
|
2589
|
-
{ tag: "
|
|
2590
|
-
{ tag: "script", attrs: { type: "module" }, children:
|
|
2591
|
-
{ tag: "script", attrs: { type: "module" }, children: Tr, injectTo: "body" }
|
|
2588
|
+
{ tag: "script", attrs: { type: "module" }, children: Cr, injectTo: "body" },
|
|
2589
|
+
{ tag: "script", attrs: { type: "module" }, children: _r, injectTo: "body" }
|
|
2592
2590
|
];
|
|
2593
2591
|
if ((e.devTools?.imageDevTools ?? !0) && i.push(
|
|
2594
2592
|
{
|
|
2595
2593
|
tag: "style",
|
|
2596
|
-
children:
|
|
2594
|
+
children: Pr,
|
|
2597
2595
|
injectTo: "body"
|
|
2598
2596
|
},
|
|
2599
2597
|
{
|
|
2600
2598
|
tag: "script",
|
|
2601
2599
|
attrs: { type: "module" },
|
|
2602
|
-
children:
|
|
2600
|
+
children: Dr.replace(
|
|
2603
2601
|
"globalThis.__TEMPLATE__",
|
|
2604
|
-
JSON.stringify(
|
|
2602
|
+
JSON.stringify(Nr)
|
|
2605
2603
|
),
|
|
2606
2604
|
injectTo: "body"
|
|
2607
2605
|
}
|
|
2608
2606
|
), e.devTools?.clickToSource ?? !0) {
|
|
2609
2607
|
const r = e.devTools.clickToSource ?? [];
|
|
2610
|
-
|
|
2608
|
+
t.endsWith("/") && (t = t.slice(0, -1)), i.push({
|
|
2611
2609
|
tag: "script",
|
|
2612
2610
|
attrs: { type: "module" },
|
|
2613
|
-
children:
|
|
2611
|
+
children: Tr.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(t)),
|
|
2614
2612
|
injectTo: "body"
|
|
2615
2613
|
});
|
|
2616
2614
|
}
|
|
2617
2615
|
return i;
|
|
2618
|
-
},
|
|
2616
|
+
}, jr = [
|
|
2619
2617
|
Ue,
|
|
2620
2618
|
Qe,
|
|
2621
2619
|
Je,
|
|
@@ -2623,70 +2621,70 @@ const jr = (e, n) => {
|
|
|
2623
2621
|
"@builder.io/qwik",
|
|
2624
2622
|
"@builder.io/qwik/jsx-runtime",
|
|
2625
2623
|
"@builder.io/qwik/jsx-dev-runtime"
|
|
2626
|
-
],
|
|
2627
|
-
function
|
|
2628
|
-
let
|
|
2629
|
-
const
|
|
2630
|
-
let
|
|
2631
|
-
const
|
|
2624
|
+
], Ur = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Br = [".woff", ".woff2", ".ttf"];
|
|
2625
|
+
function zr(e = {}) {
|
|
2626
|
+
let t = "serve", i = null, r = null, o = "/", m = null, l, s = null, f = null, n = null;
|
|
2627
|
+
const w = e.client?.outDir;
|
|
2628
|
+
let x = null;
|
|
2629
|
+
const I = e.fileFilter ? (c, g) => Pt.test(c) || e.fileFilter(c, g) : () => !0, y = e.disableFontPreload ?? !1, d = [], u = Ct(e.optimizerOptions), p = /* @__PURE__ */ new Set();
|
|
2632
2630
|
return [{
|
|
2633
2631
|
name: "vite-plugin-qwik",
|
|
2634
2632
|
enforce: "pre",
|
|
2635
2633
|
api: {
|
|
2636
|
-
getOptimizer: () =>
|
|
2637
|
-
getOptions: () =>
|
|
2634
|
+
getOptimizer: () => u.getOptimizer(),
|
|
2635
|
+
getOptions: () => u.getOptions(),
|
|
2638
2636
|
getManifest: () => i,
|
|
2639
|
-
getRootDir: () =>
|
|
2637
|
+
getRootDir: () => u.getOptions().rootDir,
|
|
2640
2638
|
getClientOutDir: () => r,
|
|
2641
|
-
getClientPublicOutDir: () =>
|
|
2642
|
-
getAssetsDir: () =>
|
|
2643
|
-
registerBundleGraphAdder: (
|
|
2639
|
+
getClientPublicOutDir: () => m,
|
|
2640
|
+
getAssetsDir: () => l,
|
|
2641
|
+
registerBundleGraphAdder: (c) => p.add(c),
|
|
2644
2642
|
_oldDevSsrServer: () => e.devSsrServer
|
|
2645
2643
|
},
|
|
2646
|
-
async config(
|
|
2647
|
-
await
|
|
2648
|
-
let
|
|
2649
|
-
|
|
2650
|
-
let
|
|
2651
|
-
|
|
2652
|
-
const
|
|
2653
|
-
let D =
|
|
2654
|
-
D && typeof D == "string" && (D = [D]),
|
|
2655
|
-
const P =
|
|
2656
|
-
target:
|
|
2657
|
-
buildMode:
|
|
2644
|
+
async config(c, g) {
|
|
2645
|
+
await u.init();
|
|
2646
|
+
let b;
|
|
2647
|
+
c.build?.ssr || g.mode === "ssr" ? b = "ssr" : g.mode === "lib" ? b = "lib" : g.mode === "test" ? b = "test" : b = "client", t = g.command;
|
|
2648
|
+
let S;
|
|
2649
|
+
g.mode === "production" ? S = "production" : g.mode === "development" ? S = "development" : t === "build" && b === "client" ? S = "production" : S = "development", u.debug(`vite config(), command: ${t}, env.mode: ${g.mode}`), t === "serve" ? e.entryStrategy = { type: "segment" } : b === "ssr" ? e.entryStrategy = { type: "hoist" } : b === "lib" && (e.entryStrategy = { type: "inline" });
|
|
2650
|
+
const k = b === "ssr" ? typeof c.build?.ssr == "string" ? c.build.ssr : e.ssr?.input : void 0, q = b === "client" ? e.client?.input : void 0;
|
|
2651
|
+
let D = c.build?.rollupOptions?.input || q || k;
|
|
2652
|
+
D && typeof D == "string" && (D = [D]), l = c.build?.assetsDir;
|
|
2653
|
+
const P = b === "client" && !!l && l !== "_astro", $ = {
|
|
2654
|
+
target: b,
|
|
2655
|
+
buildMode: S,
|
|
2658
2656
|
csr: e.csr,
|
|
2659
2657
|
debug: e.debug,
|
|
2660
2658
|
entryStrategy: e.entryStrategy,
|
|
2661
2659
|
srcDir: e.srcDir,
|
|
2662
|
-
rootDir:
|
|
2660
|
+
rootDir: c.root,
|
|
2663
2661
|
tsconfigFileNames: e.tsconfigFileNames,
|
|
2664
2662
|
resolveQwikBuild: !0,
|
|
2665
2663
|
transformedModuleOutput: e.transformedModuleOutput,
|
|
2666
|
-
outDir:
|
|
2667
|
-
ssrOutDir: e.ssr?.outDir ||
|
|
2668
|
-
clientOutDir:
|
|
2664
|
+
outDir: c.build?.outDir,
|
|
2665
|
+
ssrOutDir: e.ssr?.outDir || c.build?.outDir,
|
|
2666
|
+
clientOutDir: w || // When ssr is true, this is probably an adapter build and not where the client build is
|
|
2669
2667
|
// However, if client.outDir was explicitly set, always use it
|
|
2670
|
-
(
|
|
2671
|
-
assetsDir: P ?
|
|
2668
|
+
(c.build?.ssr && !w ? void 0 : c.build?.outDir),
|
|
2669
|
+
assetsDir: P ? l : void 0,
|
|
2672
2670
|
devTools: e.devTools,
|
|
2673
|
-
sourcemap: !!
|
|
2671
|
+
sourcemap: !!c.build?.sourcemap,
|
|
2674
2672
|
lint: e.lint,
|
|
2675
2673
|
experimental: e.experimental,
|
|
2676
2674
|
input: D,
|
|
2677
2675
|
manifestInput: e.ssr?.manifestInput,
|
|
2678
2676
|
manifestInputPath: e.ssr?.manifestInputPath,
|
|
2679
2677
|
manifestOutput: e.client?.manifestOutput
|
|
2680
|
-
}, A = await
|
|
2681
|
-
D
|
|
2682
|
-
const G =
|
|
2678
|
+
}, A = await u.normalizeOptions($);
|
|
2679
|
+
D ||= A.input, x = $, i = A.manifestInput, s = A.srcDir, f = A.rootDir, e.csr || (r = A.clientOutDir, m = r, n = A.ssrOutDir);
|
|
2680
|
+
const G = S === "development", X = "globalThis.qDev", Q = "globalThis.qTest", ee = "globalThis.qInspector", Y = "globalThis.qSerialize", O = c?.define?.[X] ?? G, ie = c?.define?.[ee] ?? G, Re = c?.define?.[Y] ?? G, F = {
|
|
2683
2681
|
ssr: {
|
|
2684
2682
|
noExternal: [Ue, Be, ze, ne]
|
|
2685
2683
|
},
|
|
2686
2684
|
envPrefix: ["VITE_", "PUBLIC_"],
|
|
2687
2685
|
resolve: {
|
|
2688
|
-
dedupe: [...
|
|
2689
|
-
conditions:
|
|
2686
|
+
dedupe: [...jr],
|
|
2687
|
+
conditions: S === "production" && b === "client" ? ["min"] : [],
|
|
2690
2688
|
alias: {
|
|
2691
2689
|
"@builder.io/qwik": "@qwik.dev/core",
|
|
2692
2690
|
"@builder.io/qwik/build": "@qwik.dev/core/build",
|
|
@@ -2701,7 +2699,7 @@ function Hr(e = {}) {
|
|
|
2701
2699
|
"@builder.io/qwik/testing": "@qwik.dev/core/testing"
|
|
2702
2700
|
}
|
|
2703
2701
|
},
|
|
2704
|
-
esbuild:
|
|
2702
|
+
esbuild: t === "serve" ? !1 : {
|
|
2705
2703
|
logLevel: "error",
|
|
2706
2704
|
jsx: "automatic"
|
|
2707
2705
|
},
|
|
@@ -2751,9 +2749,9 @@ function Hr(e = {}) {
|
|
|
2751
2749
|
const ue = F.build.rollupOptions?.onwarn;
|
|
2752
2750
|
F.build.rollupOptions = {
|
|
2753
2751
|
...F.build.rollupOptions,
|
|
2754
|
-
output: await
|
|
2755
|
-
|
|
2756
|
-
|
|
2752
|
+
output: await wn(
|
|
2753
|
+
u,
|
|
2754
|
+
c.build?.rollupOptions?.output,
|
|
2757
2755
|
P,
|
|
2758
2756
|
A.outDir
|
|
2759
2757
|
),
|
|
@@ -2761,7 +2759,7 @@ function Hr(e = {}) {
|
|
|
2761
2759
|
onwarn: (le, Ne) => {
|
|
2762
2760
|
le.plugin === "typescript" && le.message.includes("outputToFilesystem") || (ue ? ue(le, Ne) : Ne(le));
|
|
2763
2761
|
}
|
|
2764
|
-
}, A.target === "ssr" ?
|
|
2762
|
+
}, A.target === "ssr" ? t === "build" && (F.publicDir = !1, F.build.ssr = !0, c.build?.minify == null && S === "production" && (F.build.minify = !0)) : A.target === "client" || (A.target === "lib" ? (F.build.minify = !1, F.build.rollupOptions.external = [
|
|
2765
2763
|
Ue,
|
|
2766
2764
|
Be,
|
|
2767
2765
|
ze,
|
|
@@ -2777,34 +2775,34 @@ function Hr(e = {}) {
|
|
|
2777
2775
|
}
|
|
2778
2776
|
return F;
|
|
2779
2777
|
},
|
|
2780
|
-
async configResolved(
|
|
2781
|
-
if (o =
|
|
2778
|
+
async configResolved(c) {
|
|
2779
|
+
if (o = c.base, !(o.startsWith("/") && o.endsWith("/")))
|
|
2782
2780
|
throw new Error("vite's config.base must begin and end with /");
|
|
2783
|
-
|
|
2781
|
+
c.build.sourcemap && e.optimizerOptions?.sourcemap === void 0 && u.setSourceMapSupport(!0), x ? u.normalizeOptions(x) : u.normalizeOptions(e);
|
|
2784
2782
|
},
|
|
2785
2783
|
async buildStart() {
|
|
2786
|
-
|
|
2787
|
-
const
|
|
2788
|
-
await
|
|
2789
|
-
|
|
2790
|
-
const q =
|
|
2791
|
-
|
|
2784
|
+
d.length = 0;
|
|
2785
|
+
const c = this.resolve.bind(this);
|
|
2786
|
+
await u.validateSource(c), u.onDiagnostics((g, b, S) => {
|
|
2787
|
+
g.forEach((k) => {
|
|
2788
|
+
const q = u.normalizePath(b.sys.path.join(S, k.file));
|
|
2789
|
+
k.category === "error" ? this.error(Ae(q, k)) : this.warn(Ae(q, k));
|
|
2792
2790
|
});
|
|
2793
|
-
}), await
|
|
2791
|
+
}), await u.buildStart(this);
|
|
2794
2792
|
},
|
|
2795
|
-
resolveId(
|
|
2796
|
-
const
|
|
2797
|
-
return Z(
|
|
2793
|
+
resolveId(c, g, b) {
|
|
2794
|
+
const S = I(c, "resolveId");
|
|
2795
|
+
return Z(c) || !S ? null : u.resolveId(this, c, g, b);
|
|
2798
2796
|
},
|
|
2799
|
-
load(
|
|
2800
|
-
const
|
|
2801
|
-
return Z(
|
|
2797
|
+
load(c, g) {
|
|
2798
|
+
const b = I(c, "load");
|
|
2799
|
+
return Z(c) || !b ? null : (c = u.normalizePath(c), t === "serve" && c.endsWith(re) ? {
|
|
2802
2800
|
code: "export const manifest = undefined;"
|
|
2803
|
-
} :
|
|
2801
|
+
} : u.load(this, c, g));
|
|
2804
2802
|
},
|
|
2805
|
-
transform(
|
|
2806
|
-
if (
|
|
2807
|
-
const q =
|
|
2803
|
+
transform(c, g, b) {
|
|
2804
|
+
if (g.includes(".vite/deps/") && c.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(c)) {
|
|
2805
|
+
const q = f && g.startsWith(f) ? g.slice(f.length) : g;
|
|
2808
2806
|
throw new Error(
|
|
2809
2807
|
`
|
|
2810
2808
|
|
|
@@ -2820,29 +2818,29 @@ function Hr(e = {}) {
|
|
|
2820
2818
|
`
|
|
2821
2819
|
);
|
|
2822
2820
|
}
|
|
2823
|
-
const
|
|
2824
|
-
return Z(
|
|
2821
|
+
const S = I(g, "transform"), k = g.includes("?raw");
|
|
2822
|
+
return Z(g) || !S || k ? null : u.transform(this, c, g, b);
|
|
2825
2823
|
}
|
|
2826
2824
|
}, {
|
|
2827
2825
|
name: "vite-plugin-qwik-post",
|
|
2828
2826
|
enforce: "post",
|
|
2829
2827
|
generateBundle: {
|
|
2830
2828
|
order: "post",
|
|
2831
|
-
async handler(
|
|
2832
|
-
const
|
|
2833
|
-
if (
|
|
2834
|
-
for (const [
|
|
2835
|
-
if (
|
|
2836
|
-
const q = o +
|
|
2837
|
-
if (
|
|
2838
|
-
typeof
|
|
2829
|
+
async handler(c, g) {
|
|
2830
|
+
const b = u.getOptions();
|
|
2831
|
+
if (b.target === "client") {
|
|
2832
|
+
for (const [S, k] of Object.entries(g))
|
|
2833
|
+
if (k.type === "asset") {
|
|
2834
|
+
const q = o + S;
|
|
2835
|
+
if (Ur.some((D) => S.endsWith(D)))
|
|
2836
|
+
typeof k.source == "string" && k.source.length < b.inlineStylesUpToBytes ? d.push({
|
|
2839
2837
|
tag: "style",
|
|
2840
2838
|
location: "head",
|
|
2841
2839
|
attributes: {
|
|
2842
2840
|
"data-src": q,
|
|
2843
|
-
dangerouslySetInnerHTML:
|
|
2841
|
+
dangerouslySetInnerHTML: k.source
|
|
2844
2842
|
}
|
|
2845
|
-
}) :
|
|
2843
|
+
}) : d.push({
|
|
2846
2844
|
tag: "link",
|
|
2847
2845
|
location: "head",
|
|
2848
2846
|
attributes: {
|
|
@@ -2851,8 +2849,8 @@ function Hr(e = {}) {
|
|
|
2851
2849
|
}
|
|
2852
2850
|
});
|
|
2853
2851
|
else {
|
|
2854
|
-
const D =
|
|
2855
|
-
D && !
|
|
2852
|
+
const D = Br.find((P) => S.endsWith(P));
|
|
2853
|
+
D && !y && d.unshift({
|
|
2856
2854
|
tag: "link",
|
|
2857
2855
|
location: "head",
|
|
2858
2856
|
attributes: {
|
|
@@ -2865,27 +2863,27 @@ function Hr(e = {}) {
|
|
|
2865
2863
|
});
|
|
2866
2864
|
}
|
|
2867
2865
|
}
|
|
2868
|
-
await
|
|
2869
|
-
injections:
|
|
2866
|
+
await u.generateManifest(this, g, p, {
|
|
2867
|
+
injections: d,
|
|
2870
2868
|
platform: { vite: "" }
|
|
2871
2869
|
});
|
|
2872
2870
|
}
|
|
2873
2871
|
}
|
|
2874
2872
|
},
|
|
2875
|
-
async writeBundle(
|
|
2876
|
-
const
|
|
2877
|
-
if (
|
|
2878
|
-
const
|
|
2879
|
-
if (
|
|
2880
|
-
const
|
|
2873
|
+
async writeBundle(c, g) {
|
|
2874
|
+
const b = u.getOptions();
|
|
2875
|
+
if (b.target === "ssr") {
|
|
2876
|
+
const S = u.getSys();
|
|
2877
|
+
if (S.env === "node" || S.env === "bun") {
|
|
2878
|
+
const k = Object.keys(g), q = async (D) => {
|
|
2881
2879
|
try {
|
|
2882
|
-
const P =
|
|
2880
|
+
const P = S.path.basename(D), $ = S.path.extname(P);
|
|
2883
2881
|
if ((P.startsWith("entry.") || P.startsWith("entry_")) && !P.includes("preview") && ($ === ".mjs" || $ === ".cjs")) {
|
|
2884
|
-
const G =
|
|
2885
|
-
if (!
|
|
2886
|
-
const Y =
|
|
2882
|
+
const G = S.path.basename(P, $), X = `${G}.js`, Q = G + $;
|
|
2883
|
+
if (!k.some((Y) => S.path.basename(Y) === X)) {
|
|
2884
|
+
const Y = S.path.dirname(D), O = await S.dynamicImport("node:fs"), ie = S.path.join(b.outDir, Y);
|
|
2887
2885
|
await O.promises.mkdir(ie, { recursive: !0 }), await O.promises.writeFile(
|
|
2888
|
-
|
|
2886
|
+
S.path.join(ie, X),
|
|
2889
2887
|
`export * from "./${Q}";`
|
|
2890
2888
|
);
|
|
2891
2889
|
}
|
|
@@ -2894,121 +2892,121 @@ function Hr(e = {}) {
|
|
|
2894
2892
|
console.error("patchModuleFormat", P);
|
|
2895
2893
|
}
|
|
2896
2894
|
};
|
|
2897
|
-
await Promise.all(
|
|
2895
|
+
await Promise.all(k.map(q));
|
|
2898
2896
|
}
|
|
2899
2897
|
}
|
|
2900
2898
|
},
|
|
2901
2899
|
transformIndexHtml() {
|
|
2902
|
-
if (
|
|
2903
|
-
return
|
|
2900
|
+
if (t === "serve")
|
|
2901
|
+
return Lr(u.getOptions(), o);
|
|
2904
2902
|
},
|
|
2905
|
-
configureServer(
|
|
2906
|
-
|
|
2903
|
+
configureServer(c) {
|
|
2904
|
+
u.configureServer(c), (e?.devTools?.imageDevTools ?? !0) && c.middlewares.use(Sr(u.getSys(), f, s));
|
|
2907
2905
|
},
|
|
2908
|
-
configurePreviewServer(
|
|
2906
|
+
configurePreviewServer(c) {
|
|
2909
2907
|
return async () => {
|
|
2910
|
-
const
|
|
2911
|
-
await
|
|
2908
|
+
const g = u.getSys(), b = u.getPath();
|
|
2909
|
+
await Or(c.middlewares, n, g, b);
|
|
2912
2910
|
};
|
|
2913
2911
|
},
|
|
2914
|
-
handleHotUpdate(
|
|
2915
|
-
|
|
2912
|
+
handleHotUpdate(c) {
|
|
2913
|
+
u.handleHotUpdate(c), c.modules.length && c.server.hot.send({
|
|
2916
2914
|
type: "full-reload"
|
|
2917
2915
|
});
|
|
2918
2916
|
},
|
|
2919
|
-
onLog(
|
|
2920
|
-
if (
|
|
2921
|
-
const
|
|
2917
|
+
onLog(c, g) {
|
|
2918
|
+
if (g.plugin == "vite-plugin-qwik") {
|
|
2919
|
+
const b = Fr[c] || oe.White, S = (g.frame || "").split(`
|
|
2922
2920
|
`).map(
|
|
2923
|
-
(
|
|
2921
|
+
(k) => (k.match(/^\s*\^\s*$/) ? oe.BrightWhite : oe.BrightBlack) + k
|
|
2924
2922
|
);
|
|
2925
|
-
return console[
|
|
2926
|
-
`${
|
|
2923
|
+
return console[c](
|
|
2924
|
+
`${b}%s
|
|
2927
2925
|
${oe.BrightWhite}%s
|
|
2928
2926
|
%s${oe.RESET}`,
|
|
2929
|
-
`[${
|
|
2927
|
+
`[${g.plugin}](${c}): ${g.message}
|
|
2930
2928
|
`,
|
|
2931
|
-
` ${
|
|
2929
|
+
` ${g?.loc?.file}:${g?.loc?.line}:${g?.loc?.column}
|
|
2932
2930
|
`,
|
|
2933
|
-
` ${
|
|
2931
|
+
` ${S.join(`
|
|
2934
2932
|
`)}
|
|
2935
2933
|
`
|
|
2936
2934
|
), !1;
|
|
2937
2935
|
}
|
|
2938
2936
|
}
|
|
2939
|
-
},
|
|
2937
|
+
}, Ar()];
|
|
2940
2938
|
}
|
|
2941
|
-
async function
|
|
2942
|
-
let e,
|
|
2939
|
+
async function Ar() {
|
|
2940
|
+
let e, t;
|
|
2943
2941
|
try {
|
|
2944
|
-
e = await import("node:fs").then((
|
|
2942
|
+
e = await import("node:fs").then((s) => s.promises), t = await import("node:path");
|
|
2945
2943
|
} catch {
|
|
2946
2944
|
return;
|
|
2947
2945
|
}
|
|
2948
2946
|
const i = /* @__PURE__ */ new Set();
|
|
2949
2947
|
let r;
|
|
2950
|
-
const o = "@qwik-dev/core",
|
|
2951
|
-
async function
|
|
2952
|
-
for (;
|
|
2953
|
-
const
|
|
2948
|
+
const o = "@qwik-dev/core", m = "@builder.io/qwik";
|
|
2949
|
+
async function l(s, f) {
|
|
2950
|
+
for (; f; ) {
|
|
2951
|
+
const n = t.join(f, "node_modules", s, "package.json");
|
|
2954
2952
|
try {
|
|
2955
|
-
await e.access(
|
|
2956
|
-
const
|
|
2953
|
+
await e.access(n);
|
|
2954
|
+
const x = await e.readFile(n, {
|
|
2957
2955
|
encoding: "utf-8"
|
|
2958
|
-
}),
|
|
2959
|
-
return !!(
|
|
2956
|
+
}), I = JSON.parse(x);
|
|
2957
|
+
return !!(I.qwik || I.dependencies?.[o] || I.peerDependencies?.[o] || I.dependencies?.[m] || I.peerDependencies?.[m]);
|
|
2960
2958
|
} catch {
|
|
2961
2959
|
}
|
|
2962
|
-
const
|
|
2963
|
-
if (
|
|
2960
|
+
const w = t.dirname(f);
|
|
2961
|
+
if (w === f)
|
|
2964
2962
|
break;
|
|
2965
|
-
|
|
2963
|
+
f = w;
|
|
2966
2964
|
}
|
|
2967
2965
|
return !1;
|
|
2968
2966
|
}
|
|
2969
2967
|
return {
|
|
2970
2968
|
name: "checkQwikExternals",
|
|
2971
2969
|
enforce: "pre",
|
|
2972
|
-
configResolved: (
|
|
2973
|
-
r =
|
|
2970
|
+
configResolved: (s) => {
|
|
2971
|
+
r = s.root;
|
|
2974
2972
|
},
|
|
2975
2973
|
// Attempt to mark the Qwik dependencies as non-optimizeable
|
|
2976
2974
|
config: {
|
|
2977
2975
|
order: "post",
|
|
2978
|
-
async handler(
|
|
2979
|
-
const
|
|
2980
|
-
for (const
|
|
2981
|
-
|
|
2982
|
-
return { optimizeDeps: { exclude:
|
|
2976
|
+
async handler(s) {
|
|
2977
|
+
const f = [], n = [s.ssr?.noExternal, s.environments?.ssr?.resolve?.noExternal].flat().filter((x) => typeof x == "string"), w = s.optimizeDeps?.exclude ?? [];
|
|
2978
|
+
for (const x of n)
|
|
2979
|
+
w.includes(x) || await l(x, s.root || process.cwd()) && f.push(x);
|
|
2980
|
+
return { optimizeDeps: { exclude: f } };
|
|
2983
2981
|
}
|
|
2984
2982
|
},
|
|
2985
2983
|
// We check all SSR build lookups for external Qwik deps
|
|
2986
2984
|
resolveId: {
|
|
2987
2985
|
order: "pre",
|
|
2988
|
-
async handler(
|
|
2989
|
-
if (!
|
|
2986
|
+
async handler(s, f, n) {
|
|
2987
|
+
if (!n.ssr || /^([./]|node:|[^a-z@])/i.test(s) || i.has(s))
|
|
2990
2988
|
return;
|
|
2991
|
-
const
|
|
2992
|
-
if (i.has(
|
|
2989
|
+
const w = (s.startsWith("@") ? s.split("/").slice(0, 2).join("/") : s.split("/")[0]).split("?")[0];
|
|
2990
|
+
if (i.has(w))
|
|
2993
2991
|
return;
|
|
2994
|
-
i.add(
|
|
2995
|
-
let
|
|
2992
|
+
i.add(s), i.add(w);
|
|
2993
|
+
let x;
|
|
2996
2994
|
try {
|
|
2997
|
-
|
|
2995
|
+
x = await this.resolve(w, f, { ...n, skipSelf: !0 });
|
|
2998
2996
|
} catch {
|
|
2999
2997
|
return;
|
|
3000
2998
|
}
|
|
3001
|
-
if (
|
|
2999
|
+
if (x?.external && await l(w, f ? t.dirname(f) : r))
|
|
3002
3000
|
throw new Error(
|
|
3003
3001
|
`
|
|
3004
3002
|
==============
|
|
3005
|
-
${
|
|
3003
|
+
${w} 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.
|
|
3006
3004
|
Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
|
|
3007
3005
|
==============
|
|
3008
3006
|
`
|
|
3009
3007
|
);
|
|
3010
|
-
if (
|
|
3011
|
-
return
|
|
3008
|
+
if (w === s)
|
|
3009
|
+
return x;
|
|
3012
3010
|
}
|
|
3013
3011
|
}
|
|
3014
3012
|
};
|
|
@@ -3020,15 +3018,15 @@ const oe = {
|
|
|
3020
3018
|
BrightBlack: "\x1B[90m",
|
|
3021
3019
|
BrightWhite: "\x1B[97m",
|
|
3022
3020
|
RESET: "\x1B[0m"
|
|
3023
|
-
},
|
|
3021
|
+
}, Fr = {
|
|
3024
3022
|
warn: oe.Yellow,
|
|
3025
3023
|
info: oe.Cyan,
|
|
3026
3024
|
debug: oe.BrightBlack
|
|
3027
|
-
},
|
|
3025
|
+
}, Hr = void 0;
|
|
3028
3026
|
export {
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3027
|
+
At as createOptimizer,
|
|
3028
|
+
$r as qwikRollup,
|
|
3029
|
+
zr as qwikVite,
|
|
3030
|
+
Hr as symbolMapper,
|
|
3031
|
+
Rr as versions
|
|
3034
3032
|
};
|