@qwik.dev/core 2.0.0-beta.10 → 2.0.0-beta.13

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