@qwik.dev/core 2.0.0-beta.36 → 2.0.0-beta.38

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.
@@ -1,10 +1,10 @@
1
- const cn = (t, e = 0) => {
1
+ const Cn = (t, e = 0) => {
2
2
  for (let n = 0; n < t.length; n++) {
3
3
  const r = t.charCodeAt(n);
4
4
  e = (e << 5) - e + r, e |= 0;
5
5
  }
6
6
  return Number(Math.abs(e)).toString(36);
7
- }, dn = /* @__PURE__ */ new Set([
7
+ }, Tn = /* @__PURE__ */ new Set([
8
8
  "_chk",
9
9
  "_rsc",
10
10
  "_res",
@@ -14,6 +14,9 @@ const cn = (t, e = 0) => {
14
14
  // Each
15
15
  "_eaC",
16
16
  "_eaT",
17
+ // Show
18
+ "_shC",
19
+ "_shT",
17
20
  // Suspense
18
21
  "_suC",
19
22
  "_suT",
@@ -22,7 +25,7 @@ const cn = (t, e = 0) => {
22
25
  "_reC",
23
26
  "_reT"
24
27
  ]);
25
- function un(t) {
28
+ function Pn(t) {
26
29
  const e = t.symbols;
27
30
  return Object.keys(e).sort((n, r) => {
28
31
  const i = e[n], s = e[r];
@@ -31,36 +34,36 @@ function un(t) {
31
34
  if (i.ctxKind !== "eventHandler" && s.ctxKind === "eventHandler")
32
35
  return 1;
33
36
  if (i.ctxKind === "eventHandler" && s.ctxKind === "eventHandler") {
34
- const a = ht.indexOf(i.ctxName.toLowerCase()), l = ht.indexOf(s.ctxName.toLowerCase());
35
- if (a > -1 && l > -1) {
36
- if (a < l)
37
+ const l = bt.indexOf(i.ctxName.toLowerCase()), a = bt.indexOf(s.ctxName.toLowerCase());
38
+ if (l > -1 && a > -1) {
39
+ if (l < a)
37
40
  return -1;
38
- if (a > l)
41
+ if (l > a)
39
42
  return 1;
40
43
  } else {
41
- if (a > -1)
42
- return -1;
43
44
  if (l > -1)
45
+ return -1;
46
+ if (a > -1)
44
47
  return 1;
45
48
  }
46
49
  } else if (i.ctxKind === "function" && s.ctxKind === "function") {
47
- const a = ft.indexOf(i.ctxName.toLowerCase()), l = ft.indexOf(s.ctxName.toLowerCase());
48
- if (a > -1 && l > -1) {
49
- if (a < l)
50
+ const l = xt.indexOf(i.ctxName.toLowerCase()), a = xt.indexOf(s.ctxName.toLowerCase());
51
+ if (l > -1 && a > -1) {
52
+ if (l < a)
50
53
  return -1;
51
- if (a > l)
54
+ if (l > a)
52
55
  return 1;
53
56
  } else {
54
- if (a > -1)
55
- return -1;
56
57
  if (l > -1)
58
+ return -1;
59
+ if (a > -1)
57
60
  return 1;
58
61
  }
59
62
  }
60
63
  return !i.parent && s.parent ? -1 : i.parent && !s.parent ? 1 : i.hash < s.hash ? -1 : i.hash > s.hash ? 1 : 0;
61
64
  });
62
65
  }
63
- const ht = [
66
+ const bt = [
64
67
  // Click Events
65
68
  "click",
66
69
  "dblclick",
@@ -116,36 +119,36 @@ const ht = [
116
119
  "reset",
117
120
  // Scroll Events
118
121
  "scroll"
119
- ].map((t) => `on${t.toLowerCase()}$`), ft = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
122
+ ].map((t) => `on${t.toLowerCase()}$`), xt = ["useTask$", "useVisibleTask$", "component$", "useStyles$", "useStylesScoped$"].map(
120
123
  (t) => t.toLowerCase()
121
124
  );
122
- function hn(t) {
123
- return Object.keys(t.bundles).sort(Qe);
124
- }
125
- function fn(t) {
126
- const e = un(t), n = {}, r = {};
127
- for (const a of e)
128
- n[a] = t.symbols[a], r[a] = t.mapping[a];
129
- const i = hn(t), s = {};
130
- for (const a of i) {
131
- s[a] = t.bundles[a];
132
- const l = t.bundles[a];
133
- Array.isArray(l.imports) && l.imports.sort(Qe), Array.isArray(l.dynamicImports) && l.dynamicImports.sort(Qe);
125
+ function Nn(t) {
126
+ return Object.keys(t.bundles).sort(Ye);
127
+ }
128
+ function Dn(t) {
129
+ const e = Pn(t), n = {}, r = {};
130
+ for (const l of e)
131
+ n[l] = t.symbols[l], r[l] = t.mapping[l];
132
+ const i = Nn(t), s = {};
133
+ for (const l of i) {
134
+ s[l] = t.bundles[l];
135
+ const a = t.bundles[l];
136
+ Array.isArray(a.imports) && a.imports.sort(Ye), Array.isArray(a.dynamicImports) && a.dynamicImports.sort(Ye);
134
137
  const c = [];
135
- for (const o of e)
136
- a === r[o] && c.push(o);
137
- c.length > 0 && (c.sort(Qe), l.symbols = c);
138
+ for (const h of e)
139
+ l === r[h] && c.push(h);
140
+ c.length > 0 && (c.sort(Ye), a.symbols = c);
138
141
  }
139
142
  return t.symbols = n, t.mapping = r, t.bundles = s, t;
140
143
  }
141
- function Qe(t, e) {
144
+ function Ye(t, e) {
142
145
  return t = t.toLocaleLowerCase(), e = e.toLocaleLowerCase(), t < e ? -1 : t > e ? 1 : 0;
143
146
  }
144
- function pt(t) {
147
+ function St(t) {
145
148
  if (t != null && t.mapping != null && typeof t.mapping == "object" && t.symbols != null && typeof t.symbols == "object" && t.bundles != null && typeof t.bundles == "object")
146
149
  return t;
147
150
  }
148
- const pn = (t, e) => {
151
+ const Rn = (t, e) => {
149
152
  let n = 0;
150
153
  if (t.symbols)
151
154
  for (const r of t.symbols) {
@@ -155,71 +158,71 @@ const pn = (t, e) => {
155
158
  }
156
159
  return n;
157
160
  };
158
- function gn(t) {
161
+ function Ln(t) {
159
162
  let e = 0;
160
- const n = [], r = [], i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
161
- function l(d) {
162
- i.set(d, e), s.set(d, e), e++, n.push(d), a.add(d);
163
- const f = t[d].imports || [];
164
- for (const u of f)
165
- i.has(u) ? a.has(u) && s.set(d, Math.min(s.get(d), i.get(u))) : (l(u), s.set(d, Math.min(s.get(d), s.get(u))));
163
+ const n = [], r = [], i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
164
+ function a(d) {
165
+ i.set(d, e), s.set(d, e), e++, n.push(d), l.add(d);
166
+ const u = t[d].imports || [];
167
+ for (const p of u)
168
+ i.has(p) ? l.has(p) && s.set(d, Math.min(s.get(d), i.get(p))) : (a(p), s.set(d, Math.min(s.get(d), s.get(p))));
166
169
  if (s.get(d) === i.get(d)) {
167
- const u = [];
168
- let w;
170
+ const p = [];
171
+ let x;
169
172
  do
170
- w = n.pop(), a.delete(w), u.push(w);
171
- while (w !== d);
172
- r.push(u);
173
+ x = n.pop(), l.delete(x), p.push(x);
174
+ while (x !== d);
175
+ r.push(p);
173
176
  }
174
177
  }
175
178
  for (const d of Object.keys(t))
176
- i.has(d) || l(d);
179
+ i.has(d) || a(d);
177
180
  const c = /* @__PURE__ */ new Map();
178
- r.forEach((d, f) => {
179
- for (const u of d)
180
- c.set(u, f);
181
+ r.forEach((d, u) => {
182
+ for (const p of d)
183
+ c.set(p, u);
181
184
  });
182
- const o = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
185
+ const h = Array.from({ length: r.length }, () => /* @__PURE__ */ new Set());
183
186
  for (const d of Object.keys(t)) {
184
- const f = c.get(d);
185
- for (const u of t[d].imports || []) {
186
- const w = c.get(u);
187
- f !== w && o[f].add(w);
187
+ const u = c.get(d);
188
+ for (const p of t[d].imports || []) {
189
+ const x = c.get(p);
190
+ u !== x && h[u].add(x);
188
191
  }
189
192
  }
190
- const g = /* @__PURE__ */ new Set(), m = [];
191
- function b(d) {
192
- g.add(d);
193
- for (const f of o[d])
194
- g.has(f) || b(f);
195
- m.push(d);
193
+ const o = /* @__PURE__ */ new Set(), w = [];
194
+ function v(d) {
195
+ o.add(d);
196
+ for (const u of h[d])
197
+ o.has(u) || v(u);
198
+ w.push(d);
196
199
  }
197
200
  for (let d = 0; d < r.length; d++)
198
- g.has(d) || b(d);
199
- m.reverse();
200
- const h = new Array(r.length).fill(0);
201
+ o.has(d) || v(d);
202
+ w.reverse();
203
+ const g = new Array(r.length).fill(0);
201
204
  for (let d = 0; d < r.length; d++) {
202
- let f = 0;
203
- for (const u of r[d])
204
- f += t[u].size;
205
- h[d] = f;
206
- }
207
- for (let d = m.length - 1; d >= 0; d--) {
208
- const f = m[d];
209
- let u = h[f];
210
- for (const w of o[f])
211
- u += h[w];
212
- h[f] = u;
205
+ let u = 0;
206
+ for (const p of r[d])
207
+ u += t[p].size;
208
+ g[d] = u;
209
+ }
210
+ for (let d = w.length - 1; d >= 0; d--) {
211
+ const u = w[d];
212
+ let p = g[u];
213
+ for (const x of h[u])
214
+ p += g[x];
215
+ g[u] = p;
213
216
  }
214
217
  for (let d = 0; d < r.length; d++) {
215
- const f = h[d];
216
- for (const u of r[d])
217
- t[u].total = f;
218
+ const u = g[d];
219
+ for (const p of r[d])
220
+ t[p].total = u;
218
221
  }
219
222
  }
220
- const gt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, mt = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, wt = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
221
- function mn(t, e, n, r, i, s, a) {
222
- const l = {
223
+ const kt = /[/\\](core|qwik)[/\\]dist[/\\]preloader\.(|c|m)js$/, Et = /[/\\](core|qwik)[/\\]dist[/\\]core(\.min|\.prod)?\.(|c|m)js$/, It = /[/\\](core|qwik)[/\\](dist[/\\])?qwikloader(\.debug)?\.[^/]*js$/;
224
+ function On(t, e, n, r, i, s, l) {
225
+ const a = {
223
226
  version: "1",
224
227
  manifestHash: "",
225
228
  options: {
@@ -238,193 +241,193 @@ function mn(t, e, n, r, i, s, a) {
238
241
  assets: {},
239
242
  symbols: {},
240
243
  bundleGraph: void 0
241
- }, c = (h) => {
242
- const d = r[h];
244
+ }, c = (g) => {
245
+ const d = r[g];
243
246
  if (!d) {
244
- console.warn(`Client manifest generation: skipping external import "${h}"`);
247
+ console.warn(`Client manifest generation: skipping external import "${g}"`);
245
248
  return;
246
249
  }
247
- return a(d.fileName);
250
+ return l(d.fileName);
248
251
  };
249
- let o, g, m;
250
- for (const h of Object.values(r)) {
251
- const d = c(h.fileName);
252
- h.name === "core" && (o = d), h.name === "preloader" && (g = d), h.name === "handlers" && (m = d);
253
- }
254
- const b = new Set(e.map((h) => h.name));
255
- for (const h of Object.values(r)) {
256
- if (h.type === "asset") {
257
- h.fileName.endsWith("js.map") || (l.assets[h.fileName] = {
258
- name: h.names[0],
259
- size: h.source.length
252
+ let h, o, w;
253
+ for (const g of Object.values(r)) {
254
+ const d = c(g.fileName);
255
+ g.name === "core" && (h = d), g.name === "preloader" && (o = d), g.name === "handlers" && (w = d);
256
+ }
257
+ const v = new Set(e.map((g) => g.name));
258
+ for (const g of Object.values(r)) {
259
+ if (g.type === "asset") {
260
+ g.fileName.endsWith("js.map") || (a.assets[g.fileName] = {
261
+ name: g.names[0],
262
+ size: g.source.length
260
263
  });
261
264
  continue;
262
265
  }
263
- const d = a(h.fileName), u = {
264
- size: h.code.length,
266
+ const d = l(g.fileName), p = {
267
+ size: g.code.length,
265
268
  total: -1
266
269
  };
267
- for (const I of h.exports)
268
- b.has(I) && (!l.mapping[I] || h.exports.length !== 1) && (l.mapping[I] = d);
269
- const w = h.imports.filter((I) => h.code.includes(t.basename(I))).map((I) => c(I)).filter((I) => I !== g && I !== o && I !== m).filter(Boolean);
270
- w.length > 0 && (u.imports = w);
271
- const T = h.dynamicImports.filter((I) => h.code.includes(t.basename(I))).map((I) => c(I)).filter(Boolean);
272
- T.length > 0 && (u.dynamicImports = T), h.facadeModuleId && (gt.test(h.facadeModuleId) ? l.preloader = d : mt.test(h.facadeModuleId) ? l.core = d : wt.test(h.facadeModuleId) && (l.qwikLoader = d));
273
- const j = (h.moduleIds || Object.keys(h.modules)).filter((I) => !I.startsWith("\0")).map((I) => t.relative(i.rootDir, I));
274
- j.length > 0 && (u.origins = j, !l.preloader && j.some((I) => gt.test(I)) && (l.preloader = d), !l.core && j.some((I) => mt.test(I)) && (l.core = d), !l.qwikLoader && j.some((I) => wt.test(I)) && (l.qwikLoader = d)), l.bundles[d] = u;
275
- }
276
- for (const h of e) {
277
- const d = h.name, f = l.mapping[d];
278
- if (!f) {
279
- s(`Note: qrl ${h.name} is not in the bundle, likely tree shaken`, l);
270
+ for (const b of g.exports)
271
+ v.has(b) && (!a.mapping[b] || g.exports.length !== 1) && (a.mapping[b] = d);
272
+ const x = g.imports.filter((b) => g.code.includes(t.basename(b))).map((b) => c(b)).filter((b) => b !== o && b !== h && b !== w).filter(Boolean);
273
+ x.length > 0 && (p.imports = x);
274
+ const R = g.dynamicImports.filter((b) => g.code.includes(t.basename(b))).map((b) => c(b)).filter(Boolean);
275
+ R.length > 0 && (p.dynamicImports = R), g.facadeModuleId && (kt.test(g.facadeModuleId) ? a.preloader = d : Et.test(g.facadeModuleId) ? a.core = d : It.test(g.facadeModuleId) && (a.qwikLoader = d));
276
+ const m = (g.moduleIds || Object.keys(g.modules)).filter((b) => !b.startsWith("\0")).map((b) => t.relative(i.rootDir, b));
277
+ m.length > 0 && (p.origins = m, !a.preloader && m.some((b) => kt.test(b)) && (a.preloader = d), !a.core && m.some((b) => Et.test(b)) && (a.core = d), !a.qwikLoader && m.some((b) => It.test(b)) && (a.qwikLoader = d)), a.bundles[d] = p;
278
+ }
279
+ for (const g of e) {
280
+ const d = g.name, u = a.mapping[d];
281
+ if (!u) {
282
+ s(`Note: qrl ${g.name} is not in the bundle, likely tree shaken`, a);
280
283
  continue;
281
284
  }
282
- (l.bundles[f].symbols ||= []).push(d), l.symbols[d] = {
283
- displayName: h.displayName,
284
- hash: h.hash,
285
- ctxKind: h.ctxKind,
286
- ctxName: h.ctxName,
287
- captures: h.captures,
288
- canonicalFilename: h.canonicalFilename,
289
- parent: h.parent,
290
- origin: h.origin,
291
- loc: h.loc,
292
- paramNames: h.paramNames,
293
- captureNames: h.captureNames
285
+ (a.bundles[u].symbols ||= []).push(d), a.symbols[d] = {
286
+ displayName: g.displayName,
287
+ hash: g.hash,
288
+ ctxKind: g.ctxKind,
289
+ ctxName: g.ctxName,
290
+ captures: g.captures,
291
+ canonicalFilename: g.canonicalFilename,
292
+ parent: g.parent,
293
+ origin: g.origin,
294
+ loc: g.loc,
295
+ paramNames: g.paramNames,
296
+ captureNames: g.captureNames
294
297
  };
295
298
  }
296
- if (m)
297
- for (const h of dn)
298
- l.symbols[h] = {
299
+ if (w)
300
+ for (const g of Tn)
301
+ a.symbols[g] = {
299
302
  origin: "Qwik core",
300
- displayName: h,
303
+ displayName: g,
301
304
  canonicalFilename: "",
302
- hash: h,
305
+ hash: g,
303
306
  ctxKind: "function",
304
- ctxName: h,
307
+ ctxName: g,
305
308
  captures: !1,
306
309
  parent: null,
307
310
  loc: [0, 0]
308
- }, l.mapping[h] = m;
311
+ }, a.mapping[g] = w;
309
312
  else
310
313
  console.error("Qwik core bundle not found, is Qwik actually used in this project?");
311
- for (const h of Object.values(l.bundles)) {
312
- const d = pn(h, l);
313
- h.interactivity = d;
314
+ for (const g of Object.values(a.bundles)) {
315
+ const d = Rn(g, a);
316
+ g.interactivity = d;
314
317
  }
315
- return gn(l.bundles), fn(l);
318
+ return Ln(a.bundles), Dn(a);
316
319
  }
317
- const wn = 300, bn = 0.5 / (wn * 1024 / 8), vn = (t) => {
320
+ const Mn = 300, $n = 0.5 / (Mn * 1024 / 8), jn = (t) => {
318
321
  const e = t.lastIndexOf("_");
319
322
  return e > -1 ? t.slice(e + 1) : t;
320
323
  };
321
- function yn(t, e) {
324
+ function qn(t, e) {
322
325
  const n = [];
323
326
  if (!t.bundles)
324
327
  return [];
325
328
  const r = { ...t.bundles };
326
- for (const [c, o] of Object.entries(t.mapping)) {
329
+ for (const [c, h] of Object.entries(t.mapping)) {
327
330
  if (c.startsWith("_") && c.length < 10)
328
331
  continue;
329
- const g = vn(c);
330
- g && (r[g] = { dynamicImports: [o] });
332
+ const o = jn(c);
333
+ o && (r[o] = { dynamicImports: [h] });
331
334
  }
332
335
  if (e) {
333
336
  const c = { ...t, bundles: r };
334
- for (const o of e) {
335
- const g = o(c);
336
- g && Object.assign(r, g);
337
+ for (const h of e) {
338
+ const o = h(c);
339
+ o && Object.assign(r, o);
337
340
  }
338
341
  }
339
342
  for (const c of Object.keys(r)) {
340
- const o = r[c], g = o.imports?.filter((b) => r[b]) || [], m = o.dynamicImports?.filter(
343
+ const h = r[c], o = h.imports?.filter((v) => r[v]) || [], w = h.dynamicImports?.filter(
341
344
  // we only want to include dynamic imports that belong to the app
342
345
  // e.g. not all languages supported by shiki
343
- (b) => r[b] && // either there are qrls
344
- (r[b].symbols || // or it's a dynamic import from the app source
345
- r[b].origins?.some((h) => !h.includes("node_modules")))
346
+ (v) => r[v] && // either there are qrls
347
+ (r[v].symbols || // or it's a dynamic import from the app source
348
+ r[v].origins?.some((g) => !g.includes("node_modules")))
346
349
  ) || [];
347
350
  r[c] = {
348
- ...o,
349
- imports: g,
350
- dynamicImports: m
351
+ ...h,
352
+ imports: o,
353
+ dynamicImports: w
351
354
  };
352
355
  }
353
356
  const i = new Set(Object.keys(r));
354
357
  for (const c of Object.keys(r)) {
355
- for (const o of r[c].imports)
356
- i.delete(o);
357
- for (const o of r[c].dynamicImports)
358
- i.delete(o);
358
+ for (const h of r[c].imports)
359
+ i.delete(h);
360
+ for (const h of r[c].dynamicImports)
361
+ i.delete(h);
359
362
  }
360
363
  for (const c of i) {
361
- const o = r[c];
362
- !o.imports?.length && !o.dynamicImports?.length && delete r[c];
364
+ const h = r[c];
365
+ !h.imports?.length && !h.dynamicImports?.length && delete r[c];
363
366
  }
364
- const s = Object.keys(r), a = /* @__PURE__ */ new Map(), l = (c, o, g = /* @__PURE__ */ new Set()) => {
365
- const m = r[o];
366
- for (const b of m.imports)
367
- c.has(b) && c.delete(b), g.has(b) || (g.add(b), l(c, b, g));
367
+ const s = Object.keys(r), l = /* @__PURE__ */ new Map(), a = (c, h, o = /* @__PURE__ */ new Set()) => {
368
+ const w = r[h];
369
+ for (const v of w.imports)
370
+ c.has(v) && c.delete(v), o.has(v) || (o.add(v), a(c, v, o));
368
371
  };
369
372
  for (const c of s) {
370
- const o = r[c], g = new Set(o.imports);
371
- for (const d of g)
372
- l(g, d);
373
- const m = new Set(o.dynamicImports), b = /* @__PURE__ */ new Map();
374
- for (const d of m) {
375
- l(m, d);
376
- const f = r[d];
377
- let u = 0.5;
378
- if (u += (f.interactivity || 0) * 0.08, o.origins && f.origins) {
379
- for (const w of o.origins)
380
- if (f.origins.some((T) => T.startsWith(w))) {
381
- u += 0.25;
373
+ const h = r[c], o = new Set(h.imports);
374
+ for (const d of o)
375
+ a(o, d);
376
+ const w = new Set(h.dynamicImports), v = /* @__PURE__ */ new Map();
377
+ for (const d of w) {
378
+ a(w, d);
379
+ const u = r[d];
380
+ let p = 0.5;
381
+ if (p += (u.interactivity || 0) * 0.08, h.origins && u.origins) {
382
+ for (const x of h.origins)
383
+ if (u.origins.some((R) => R.startsWith(x))) {
384
+ p += 0.25;
382
385
  break;
383
386
  }
384
387
  }
385
- f.total > bn && (u += u > 0.5 ? 0.02 : -0.02), f.total < 1e3 && (u += 0.15), b.set(d, Math.min(u, 0.99));
388
+ u.total > $n && (p += p > 0.5 ? 0.02 : -0.02), u.total < 1e3 && (p += 0.15), v.set(d, Math.min(p, 0.99));
386
389
  }
387
- if (m.size > 0) {
388
- const d = Array.from(m).sort(
389
- (u, w) => b.get(w) - b.get(u)
390
+ if (w.size > 0) {
391
+ const d = Array.from(w).sort(
392
+ (p, x) => v.get(x) - v.get(p)
390
393
  );
391
- let f = -1;
392
- for (const u of d)
393
- b.get(u) !== f && (f = b.get(u), g.add(-Math.round(f * 10))), g.add(u);
394
+ let u = -1;
395
+ for (const p of d)
396
+ v.get(p) !== u && (u = v.get(p), o.add(-Math.round(u * 10))), o.add(p);
394
397
  }
395
- const h = n.length;
398
+ const g = n.length;
396
399
  n.push(c);
397
- for (let d = 0; d < g.size; d++)
400
+ for (let d = 0; d < o.size; d++)
398
401
  n.push(null);
399
- a.set(c, { index: h, deps: g });
402
+ l.set(c, { index: g, deps: o });
400
403
  }
401
404
  for (const c of s) {
402
- const o = a.get(c);
403
- let { index: g, deps: m } = o;
404
- g++;
405
- for (const b of m) {
406
- if (typeof b == "number") {
407
- n[g++] = b;
405
+ const h = l.get(c);
406
+ let { index: o, deps: w } = h;
407
+ o++;
408
+ for (const v of w) {
409
+ if (typeof v == "number") {
410
+ n[o++] = v;
408
411
  continue;
409
412
  }
410
- const d = a.get(b).index;
411
- n[g++] = d;
413
+ const d = l.get(v).index;
414
+ n[o++] = d;
412
415
  }
413
416
  }
414
417
  return n;
415
418
  }
416
- async function xn(t, e, n) {
419
+ async function Un(t, e, n) {
417
420
  const r = await t.dynamicImport("eslint");
418
421
  let i = new r.ESLint({ cache: !0 });
419
422
  if ((await i.calculateConfigForFile("no-real-file.tsx")).parser === null) {
420
- const l = {
423
+ const a = {
421
424
  cache: !0,
422
425
  overrideConfig: {
423
426
  languageOptions: {
424
427
  parserOptions: {
425
428
  tsconfigRootDir: e,
426
429
  project: n,
427
- ecmaVersion: 2021,
430
+ ecmaVersion: 2022,
428
431
  sourceType: "module",
429
432
  ecmaFeatures: {
430
433
  jsx: !0
@@ -433,34 +436,34 @@ async function xn(t, e, n) {
433
436
  }
434
437
  }
435
438
  };
436
- i = new r.ESLint(l);
439
+ i = new r.ESLint(a);
437
440
  }
438
441
  return {
439
- async lint(l, c, o) {
442
+ async lint(a, c, h) {
440
443
  try {
441
- const g = kn(o);
442
- if (await i.isPathIgnored(g))
444
+ const o = Bn(h);
445
+ if (await i.isPathIgnored(o))
443
446
  return null;
444
447
  (await i.lintText(c, {
445
- filePath: g
446
- })).forEach((b) => {
447
- for (const h of b.messages) {
448
- if (h.ruleId != null && !h.ruleId.startsWith("qwik/"))
448
+ filePath: o
449
+ })).forEach((v) => {
450
+ for (const g of v.messages) {
451
+ if (g.ruleId != null && !g.ruleId.startsWith("qwik/"))
449
452
  continue;
450
- const d = En(b.filePath, h);
451
- l.warn(d);
453
+ const d = Fn(v.filePath, g);
454
+ a.warn(d);
452
455
  }
453
456
  });
454
- } catch (g) {
455
- console.warn(g);
457
+ } catch (o) {
458
+ console.warn(o);
456
459
  }
457
460
  }
458
461
  };
459
462
  }
460
- function kn(t) {
463
+ function Bn(t) {
461
464
  return t.split("?", 2)[0];
462
465
  }
463
- function En(t, e) {
466
+ function Fn(t, e) {
464
467
  return Object.assign(new Error(e.message), {
465
468
  id: t,
466
469
  plugin: "vite-plugin-eslint",
@@ -472,21 +475,27 @@ function En(t, e) {
472
475
  stack: ""
473
476
  });
474
477
  }
475
- async function Sn(t, e) {
476
- const n = e;
477
- let r = n.loc;
478
- if (!n.frame && !n.plugin && (r || (r = In(n)), r && (n.loc = r, r.file))) {
479
- const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
480
- n.id = s(n.loc.file);
481
- try {
482
- const a = i.readFileSync(n.loc.file, "utf-8");
483
- n.frame = Cn(a, n.loc);
484
- } catch {
485
- }
486
- }
487
- return e;
488
- }
489
- const In = (t) => {
478
+ const An = /\.server\.[cm]?[jt]sx?$/, zn = /\.server\.[cm]?[jt]sx?_/, Wn = /(^|\/)server(\/|$)/, _t = (t) => t.includes(".server") || t.includes("/server") || t.includes("\\server") || t.includes("server/") || t.includes("server\\"), Xe = (t) => t.replace(/\\/g, "/").replace(/^\/@fs\//, ""), Hn = (t, e) => {
479
+ const n = Xe(t), r = e.rootDir ? Xe(e.rootDir).replace(/\/+$/, "") : "";
480
+ return r && (n === r || n.startsWith(r + "/")) ? n : r && n.startsWith("/") && !n.startsWith("//") && !/^[a-zA-Z]:\//.test(n) ? `${r}${n}` : n;
481
+ }, Gn = (t) => {
482
+ const e = Xe(t);
483
+ return An.test(e) || zn.test(e);
484
+ }, Qn = (t, e) => {
485
+ const n = typeof e == "string" || e == null ? { srcDir: e } : e;
486
+ if (!n.srcDir)
487
+ return !1;
488
+ const r = Hn(t, n), i = Xe(n.srcDir).replace(/\/+$/, "");
489
+ return r.startsWith(i + "/") ? Wn.test(r.slice(i.length + 1)) : !1;
490
+ }, Kn = (t, e) => Gn(t) || Qn(t, e), Jn = (t, e) => {
491
+ const n = e ? `
492
+ Importer: ${e}` : "";
493
+ return `Server-only module cannot be imported by client code.
494
+
495
+ Server-only module: ${t}${n}
496
+
497
+ Files named \`.server.*\` or placed under \`src/**/server/**\` are excluded from client bundles. Move this import behind SSR-only route loaders, actions, endpoint handlers, or expose the operation through an intentional \`server$\` API.`;
498
+ }, Yn = (t) => {
490
499
  const e = t.stack;
491
500
  if (typeof e == "string") {
492
501
  const n = e.split(`
@@ -494,16 +503,16 @@ const In = (t) => {
494
503
  for (let r = 1; r < n.length; r++) {
495
504
  const i = n[r].replace("file:///", "/");
496
505
  if (/^\s+at/.test(i)) {
497
- const s = i.indexOf("/"), a = i.lastIndexOf(")", s);
506
+ const s = i.indexOf("/"), l = i.lastIndexOf(")", s);
498
507
  if (s > 0) {
499
- const c = i.slice(s, a).split(":"), o = bt(c[c.length - 1]), g = bt(c[c.length - 2]);
500
- return typeof o == "number" && typeof g == "number" ? (c.length -= 2, {
501
- file: c.join(":"),
502
- line: g,
503
- column: o
504
- }) : typeof o == "number" ? (c.length -= 1, {
508
+ const c = i.slice(s, l).split(":"), h = Ct(c[c.length - 1]), o = Ct(c[c.length - 2]);
509
+ return typeof h == "number" && typeof o == "number" ? (c.length -= 2, {
505
510
  file: c.join(":"),
506
511
  line: o,
512
+ column: h
513
+ }) : typeof h == "number" ? (c.length -= 1, {
514
+ file: c.join(":"),
515
+ line: h,
507
516
  column: void 0
508
517
  }) : {
509
518
  file: c.join(":"),
@@ -514,46 +523,46 @@ const In = (t) => {
514
523
  }
515
524
  }
516
525
  }
517
- }, ae = (t) => t.startsWith("\0"), bt = (t) => {
526
+ }, ne = (t) => t.startsWith("\0"), Ct = (t) => {
518
527
  try {
519
528
  return parseInt(t, 10);
520
529
  } catch {
521
530
  return;
522
531
  }
523
- }, Ht = /\r?\n/, vt = 2;
524
- function _n(t, e) {
532
+ }, on = /\r?\n/, Tt = 2;
533
+ function Xn(t, e) {
525
534
  if (typeof e == "number")
526
535
  return e;
527
536
  if (e.lo != null)
528
537
  return e.lo;
529
- const n = t.split(Ht), { line: r, column: i } = e;
538
+ const n = t.split(on), { line: r, column: i } = e;
530
539
  let s = 0;
531
- for (let a = 0; a < r - 1 && a < n.length; a++)
532
- s += n[a].length + 1;
540
+ for (let l = 0; l < r - 1 && l < n.length; l++)
541
+ s += n[l].length + 1;
533
542
  return s + i;
534
543
  }
535
- function Cn(t, e = 0, n) {
536
- e = _n(t, e), n = n || e;
537
- const r = t.split(Ht);
544
+ function Zn(t, e = 0, n) {
545
+ e = Xn(t, e), n = n || e;
546
+ const r = t.split(on);
538
547
  let i = 0;
539
548
  const s = [];
540
- for (let a = 0; a < r.length; a++)
541
- if (i += r[a].length + 1, i >= e) {
542
- for (let l = a - vt; l <= a + vt || n > i; l++) {
543
- if (l < 0 || l >= r.length)
549
+ for (let l = 0; l < r.length; l++)
550
+ if (i += r[l].length + 1, i >= e) {
551
+ for (let a = l - Tt; a <= l + Tt || n > i; a++) {
552
+ if (a < 0 || a >= r.length)
544
553
  continue;
545
- const c = l + 1;
546
- s.push(`${c}${" ".repeat(Math.max(3 - String(c).length, 0))}| ${r[l]}`);
547
- const o = r[l].length;
548
- if (l === a) {
549
- const g = Math.max(e - (i - o) + 1, 0), m = Math.max(1, n > i ? o - g : n - e);
550
- s.push(" | " + " ".repeat(g) + "^".repeat(m));
551
- } else if (l > a) {
554
+ const c = a + 1;
555
+ s.push(`${c}${" ".repeat(Math.max(3 - String(c).length, 0))}| ${r[a]}`);
556
+ const h = r[a].length;
557
+ if (a === l) {
558
+ const o = Math.max(e - (i - h) + 1, 0), w = Math.max(1, n > i ? h - o : n - e);
559
+ s.push(" | " + " ".repeat(o) + "^".repeat(w));
560
+ } else if (a > l) {
552
561
  if (n > i) {
553
- const g = Math.max(Math.min(n - i, o), 1);
554
- s.push(" | " + "^".repeat(g));
562
+ const o = Math.max(Math.min(n - i, h), 1);
563
+ s.push(" | " + "^".repeat(o));
555
564
  }
556
- i += o + 1;
565
+ i += h + 1;
557
566
  }
558
567
  }
559
568
  break;
@@ -561,10 +570,10 @@ function Cn(t, e = 0, n) {
561
570
  return s.join(`
562
571
  `);
563
572
  }
564
- function Tn(t) {
573
+ function Vn(t) {
565
574
  return t === "win32";
566
575
  }
567
- function We(t) {
576
+ function me(t) {
568
577
  const [e, n] = t.split("?"), r = n || "";
569
578
  return {
570
579
  originalId: t,
@@ -573,21 +582,21 @@ function We(t) {
573
582
  params: new URLSearchParams(r)
574
583
  };
575
584
  }
576
- var Pn = 44, Nn = 59, yt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Gt = new Uint8Array(64), Dn = new Uint8Array(128);
577
- for (let t = 0; t < yt.length; t++) {
578
- const e = yt.charCodeAt(t);
579
- Gt[t] = e, Dn[e] = t;
585
+ var er = 44, tr = 59, Pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", sn = new Uint8Array(64), nr = new Uint8Array(128);
586
+ for (let t = 0; t < Pt.length; t++) {
587
+ const e = Pt.charCodeAt(t);
588
+ sn[t] = e, nr[e] = t;
580
589
  }
581
- function ye(t, e, n) {
590
+ function ke(t, e, n) {
582
591
  let r = e - n;
583
592
  r = r < 0 ? -r << 1 | 1 : r << 1;
584
593
  do {
585
594
  let i = r & 31;
586
- r >>>= 5, r > 0 && (i |= 32), t.write(Gt[i]);
595
+ r >>>= 5, r > 0 && (i |= 32), t.write(sn[i]);
587
596
  } while (r > 0);
588
597
  return e;
589
598
  }
590
- var xt = 1024 * 16, kt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
599
+ var Nt = 1024 * 16, Dt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
591
600
  decode(t) {
592
601
  return Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString();
593
602
  }
@@ -598,36 +607,36 @@ var xt = 1024 * 16, kt = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDeco
598
607
  e += String.fromCharCode(t[n]);
599
608
  return e;
600
609
  }
601
- }, Ln = class {
610
+ }, rr = class {
602
611
  constructor() {
603
- this.pos = 0, this.out = "", this.buffer = new Uint8Array(xt);
612
+ this.pos = 0, this.out = "", this.buffer = new Uint8Array(Nt);
604
613
  }
605
614
  write(t) {
606
615
  const { buffer: e } = this;
607
- e[this.pos++] = t, this.pos === xt && (this.out += kt.decode(e), this.pos = 0);
616
+ e[this.pos++] = t, this.pos === Nt && (this.out += Dt.decode(e), this.pos = 0);
608
617
  }
609
618
  flush() {
610
619
  const { buffer: t, out: e, pos: n } = this;
611
- return n > 0 ? e + kt.decode(t.subarray(0, n)) : e;
620
+ return n > 0 ? e + Dt.decode(t.subarray(0, n)) : e;
612
621
  }
613
622
  };
614
- function On(t) {
615
- const e = new Ln();
623
+ function ir(t) {
624
+ const e = new rr();
616
625
  let n = 0, r = 0, i = 0, s = 0;
617
- for (let a = 0; a < t.length; a++) {
618
- const l = t[a];
619
- if (a > 0 && e.write(Nn), l.length === 0) continue;
626
+ for (let l = 0; l < t.length; l++) {
627
+ const a = t[l];
628
+ if (l > 0 && e.write(tr), a.length === 0) continue;
620
629
  let c = 0;
621
- for (let o = 0; o < l.length; o++) {
622
- const g = l[o];
623
- o > 0 && e.write(Pn), c = ye(e, g[0], c), g.length !== 1 && (n = ye(e, g[1], n), r = ye(e, g[2], r), i = ye(e, g[3], i), g.length !== 4 && (s = ye(e, g[4], s)));
630
+ for (let h = 0; h < a.length; h++) {
631
+ const o = a[h];
632
+ h > 0 && e.write(er), c = ke(e, o[0], c), o.length !== 1 && (n = ke(e, o[1], n), r = ke(e, o[2], r), i = ke(e, o[3], i), o.length !== 4 && (s = ke(e, o[4], s)));
624
633
  }
625
634
  }
626
635
  return e.flush();
627
636
  }
628
- class Ke {
637
+ class Ze {
629
638
  constructor(e) {
630
- this.bits = e instanceof Ke ? e.bits.slice() : [];
639
+ this.bits = e instanceof Ze ? e.bits.slice() : [];
631
640
  }
632
641
  add(e) {
633
642
  this.bits[e >> 5] |= 1 << (e & 31);
@@ -636,7 +645,7 @@ class Ke {
636
645
  return !!(this.bits[e >> 5] & 1 << (e & 31));
637
646
  }
638
647
  }
639
- class Be {
648
+ class ze {
640
649
  constructor(e, n, r) {
641
650
  this.start = e, this.end = n, this.original = r, this.intro = "", this.outro = "", this.content = r, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
642
651
  }
@@ -647,7 +656,7 @@ class Be {
647
656
  this.intro = this.intro + e;
648
657
  }
649
658
  clone() {
650
- const e = new Be(this.start, this.end, this.original);
659
+ const e = new ze(this.start, this.end, this.original);
651
660
  return e.intro = this.intro, e.outro = this.outro, e.content = this.content, e.storeName = this.storeName, e.edited = this.edited, e;
652
661
  }
653
662
  contains(e) {
@@ -678,7 +687,7 @@ class Be {
678
687
  split(e) {
679
688
  const n = e - this.start, r = this.original.slice(0, n), i = this.original.slice(n);
680
689
  this.original = r;
681
- const s = new Be(e, this.end, i);
690
+ const s = new ze(e, this.end, i);
682
691
  return s.outro = this.outro, this.outro = "", this.end = e, this.edited ? (s.edit("", !1), this.content = "") : this.content = r, s.next = this.next, s.next && (s.next.previous = s), s.previous = this, this.next = s, s;
683
692
  }
684
693
  toString() {
@@ -703,37 +712,37 @@ class Be {
703
712
  } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
704
713
  }
705
714
  }
706
- function Rn() {
715
+ function or() {
707
716
  return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (t) => globalThis.btoa(unescape(encodeURIComponent(t))) : typeof Buffer == "function" ? (t) => Buffer.from(t, "utf-8").toString("base64") : () => {
708
717
  throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
709
718
  };
710
719
  }
711
- const Mn = /* @__PURE__ */ Rn();
712
- class jn {
720
+ const sr = /* @__PURE__ */ or();
721
+ class ar {
713
722
  constructor(e) {
714
- this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = On(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
723
+ this.version = 3, this.file = e.file, this.sources = e.sources, this.sourcesContent = e.sourcesContent, this.names = e.names, this.mappings = ir(e.mappings), typeof e.x_google_ignoreList < "u" && (this.x_google_ignoreList = e.x_google_ignoreList), typeof e.debugId < "u" && (this.debugId = e.debugId);
715
724
  }
716
725
  toString() {
717
726
  return JSON.stringify(this);
718
727
  }
719
728
  toUrl() {
720
- return "data:application/json;charset=utf-8;base64," + Mn(this.toString());
729
+ return "data:application/json;charset=utf-8;base64," + sr(this.toString());
721
730
  }
722
731
  }
723
- function $n(t) {
732
+ function lr(t) {
724
733
  const e = t.split(`
725
734
  `), n = e.filter((s) => /^\t+/.test(s)), r = e.filter((s) => /^ {2,}/.test(s));
726
735
  if (n.length === 0 && r.length === 0)
727
736
  return null;
728
737
  if (n.length >= r.length)
729
738
  return " ";
730
- const i = r.reduce((s, a) => {
731
- const l = /^ +/.exec(a)[0].length;
732
- return Math.min(l, s);
739
+ const i = r.reduce((s, l) => {
740
+ const a = /^ +/.exec(l)[0].length;
741
+ return Math.min(a, s);
733
742
  }, 1 / 0);
734
743
  return new Array(i + 1).join(" ");
735
744
  }
736
- function Un(t, e) {
745
+ function cr(t, e) {
737
746
  const n = t.split(/[/\\]/), r = e.split(/[/\\]/);
738
747
  for (n.pop(); n[0] === r[0]; )
739
748
  n.shift(), r.shift();
@@ -743,59 +752,59 @@ function Un(t, e) {
743
752
  }
744
753
  return n.concat(r).join("/");
745
754
  }
746
- const qn = Object.prototype.toString;
747
- function Bn(t) {
748
- return qn.call(t) === "[object Object]";
755
+ const dr = Object.prototype.toString;
756
+ function ur(t) {
757
+ return dr.call(t) === "[object Object]";
749
758
  }
750
- function Et(t) {
759
+ function Rt(t) {
751
760
  const e = t.split(`
752
761
  `), n = [];
753
762
  for (let r = 0, i = 0; r < e.length; r++)
754
763
  n.push(i), i += e[r].length + 1;
755
764
  return function(i) {
756
- let s = 0, a = n.length;
757
- for (; s < a; ) {
758
- const o = s + a >> 1;
759
- i < n[o] ? a = o : s = o + 1;
765
+ let s = 0, l = n.length;
766
+ for (; s < l; ) {
767
+ const h = s + l >> 1;
768
+ i < n[h] ? l = h : s = h + 1;
760
769
  }
761
- const l = s - 1, c = i - n[l];
762
- return { line: l, column: c };
770
+ const a = s - 1, c = i - n[a];
771
+ return { line: a, column: c };
763
772
  };
764
773
  }
765
- const Fn = /\w/;
766
- class An {
774
+ const fr = /\w/;
775
+ class hr {
767
776
  constructor(e) {
768
777
  this.hires = e, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
769
778
  }
770
779
  addEdit(e, n, r, i) {
771
780
  if (n.length) {
772
781
  const s = n.length - 1;
773
- let a = n.indexOf(`
774
- `, 0), l = -1;
775
- for (; a >= 0 && s > a; ) {
776
- const o = [this.generatedCodeColumn, e, r.line, r.column];
777
- i >= 0 && o.push(i), this.rawSegments.push(o), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, l = a, a = n.indexOf(`
778
- `, a + 1);
782
+ let l = n.indexOf(`
783
+ `, 0), a = -1;
784
+ for (; l >= 0 && s > l; ) {
785
+ const h = [this.generatedCodeColumn, e, r.line, r.column];
786
+ i >= 0 && h.push(i), this.rawSegments.push(h), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = l, l = n.indexOf(`
787
+ `, l + 1);
779
788
  }
780
789
  const c = [this.generatedCodeColumn, e, r.line, r.column];
781
- i >= 0 && c.push(i), this.rawSegments.push(c), this.advance(n.slice(l + 1));
790
+ i >= 0 && c.push(i), this.rawSegments.push(c), this.advance(n.slice(a + 1));
782
791
  } else this.pending && (this.rawSegments.push(this.pending), this.advance(n));
783
792
  this.pending = null;
784
793
  }
785
794
  addUneditedChunk(e, n, r, i, s) {
786
- let a = n.start, l = !0, c = !1;
787
- for (; a < n.end; ) {
788
- if (r[a] === `
795
+ let l = n.start, a = !0, c = !1;
796
+ for (; l < n.end; ) {
797
+ if (r[l] === `
789
798
  `)
790
- i.line += 1, i.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, l = !0, c = !1;
799
+ i.line += 1, i.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, a = !0, c = !1;
791
800
  else {
792
- if (this.hires || l || s.has(a)) {
793
- const o = [this.generatedCodeColumn, e, i.line, i.column];
794
- this.hires === "boundary" ? Fn.test(r[a]) ? c || (this.rawSegments.push(o), c = !0) : (this.rawSegments.push(o), c = !1) : this.rawSegments.push(o);
801
+ if (this.hires || a || s.has(l)) {
802
+ const h = [this.generatedCodeColumn, e, i.line, i.column];
803
+ this.hires === "boundary" ? fr.test(r[l]) ? c || (this.rawSegments.push(h), c = !0) : (this.rawSegments.push(h), c = !1) : this.rawSegments.push(h);
795
804
  }
796
- i.column += 1, this.generatedCodeColumn += 1, l = !1;
805
+ i.column += 1, this.generatedCodeColumn += 1, a = !1;
797
806
  }
798
- a += 1;
807
+ l += 1;
799
808
  }
800
809
  this.pending = null;
801
810
  }
@@ -811,15 +820,15 @@ class An {
811
820
  this.generatedCodeColumn += n[n.length - 1].length;
812
821
  }
813
822
  }
814
- const xe = `
815
- `, me = {
823
+ const Ee = `
824
+ `, ve = {
816
825
  insertLeft: !1,
817
826
  insertRight: !1,
818
827
  storeName: !1
819
828
  };
820
- class lt {
829
+ class ht {
821
830
  constructor(e, n = {}) {
822
- const r = new Be(0, e.length, e);
831
+ const r = new ze(0, e.length, e);
823
832
  Object.defineProperties(this, {
824
833
  original: { writable: !0, value: e },
825
834
  outro: { writable: !0, value: "" },
@@ -831,7 +840,7 @@ class lt {
831
840
  byEnd: { writable: !0, value: {} },
832
841
  filename: { writable: !0, value: n.filename },
833
842
  indentExclusionRanges: { writable: !0, value: n.indentExclusionRanges },
834
- sourcemapLocations: { writable: !0, value: new Ke() },
843
+ sourcemapLocations: { writable: !0, value: new Ze() },
835
844
  storedNames: { writable: !0, value: {} },
836
845
  indentStr: { writable: !0, value: void 0 },
837
846
  ignoreList: { writable: !0, value: n.ignoreList },
@@ -858,30 +867,30 @@ class lt {
858
867
  return r ? r.appendRight(n) : this.outro += n, this;
859
868
  }
860
869
  clone() {
861
- const e = new lt(this.original, { filename: this.filename, offset: this.offset });
870
+ const e = new ht(this.original, { filename: this.filename, offset: this.offset });
862
871
  let n = this.firstChunk, r = e.firstChunk = e.lastSearchedChunk = n.clone();
863
872
  for (; n; ) {
864
873
  e.byStart[r.start] = r, e.byEnd[r.end] = r;
865
874
  const i = n.next, s = i && i.clone();
866
875
  s && (r.next = s, s.previous = r, r = s), n = i;
867
876
  }
868
- return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new Ke(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
877
+ return e.lastChunk = r, this.indentExclusionRanges && (e.indentExclusionRanges = this.indentExclusionRanges.slice()), e.sourcemapLocations = new Ze(this.sourcemapLocations), e.intro = this.intro, e.outro = this.outro, e;
869
878
  }
870
879
  generateDecodedMap(e) {
871
880
  e = e || {};
872
- const n = 0, r = Object.keys(this.storedNames), i = new An(e.hires), s = Et(this.original);
873
- return this.intro && i.advance(this.intro), this.firstChunk.eachNext((a) => {
874
- const l = s(a.start);
875
- a.intro.length && i.advance(a.intro), a.edited ? i.addEdit(
881
+ const n = 0, r = Object.keys(this.storedNames), i = new hr(e.hires), s = Rt(this.original);
882
+ return this.intro && i.advance(this.intro), this.firstChunk.eachNext((l) => {
883
+ const a = s(l.start);
884
+ l.intro.length && i.advance(l.intro), l.edited ? i.addEdit(
876
885
  n,
877
- a.content,
878
- l,
879
- a.storeName ? r.indexOf(a.original) : -1
880
- ) : i.addUneditedChunk(n, a, this.original, l, this.sourcemapLocations), a.outro.length && i.advance(a.outro);
886
+ l.content,
887
+ a,
888
+ l.storeName ? r.indexOf(l.original) : -1
889
+ ) : i.addUneditedChunk(n, l, this.original, a, this.sourcemapLocations), l.outro.length && i.advance(l.outro);
881
890
  }), this.outro && i.advance(this.outro), {
882
891
  file: e.file ? e.file.split(/[/\\]/).pop() : void 0,
883
892
  sources: [
884
- e.source ? Un(e.file || "", e.source) : e.file || ""
893
+ e.source ? cr(e.file || "", e.source) : e.file || ""
885
894
  ],
886
895
  sourcesContent: e.includeContent ? [this.original] : void 0,
887
896
  names: r,
@@ -890,10 +899,10 @@ class lt {
890
899
  };
891
900
  }
892
901
  generateMap(e) {
893
- return new jn(this.generateDecodedMap(e));
902
+ return new ar(this.generateDecodedMap(e));
894
903
  }
895
904
  _ensureindentStr() {
896
- this.indentStr === void 0 && (this.indentStr = $n(this.original));
905
+ this.indentStr === void 0 && (this.indentStr = lr(this.original));
897
906
  }
898
907
  _getRawIndentString() {
899
908
  return this._ensureindentStr(), this.indentStr;
@@ -903,34 +912,34 @@ class lt {
903
912
  }
904
913
  indent(e, n) {
905
914
  const r = /^[^\r\n]/gm;
906
- if (Bn(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
915
+ if (ur(e) && (n = e, e = void 0), e === void 0 && (this._ensureindentStr(), e = this.indentStr || " "), e === "") return this;
907
916
  n = n || {};
908
917
  const i = {};
909
- n.exclude && (typeof n.exclude[0] == "number" ? [n.exclude] : n.exclude).forEach((g) => {
910
- for (let m = g[0]; m < g[1]; m += 1)
911
- i[m] = !0;
918
+ n.exclude && (typeof n.exclude[0] == "number" ? [n.exclude] : n.exclude).forEach((o) => {
919
+ for (let w = o[0]; w < o[1]; w += 1)
920
+ i[w] = !0;
912
921
  });
913
922
  let s = n.indentStart !== !1;
914
- const a = (o) => s ? `${e}${o}` : (s = !0, o);
915
- this.intro = this.intro.replace(r, a);
916
- let l = 0, c = this.firstChunk;
923
+ const l = (h) => s ? `${e}${h}` : (s = !0, h);
924
+ this.intro = this.intro.replace(r, l);
925
+ let a = 0, c = this.firstChunk;
917
926
  for (; c; ) {
918
- const o = c.end;
927
+ const h = c.end;
919
928
  if (c.edited)
920
- i[l] || (c.content = c.content.replace(r, a), c.content.length && (s = c.content[c.content.length - 1] === `
929
+ i[a] || (c.content = c.content.replace(r, l), c.content.length && (s = c.content[c.content.length - 1] === `
921
930
  `));
922
931
  else
923
- for (l = c.start; l < o; ) {
924
- if (!i[l]) {
925
- const g = this.original[l];
926
- g === `
927
- ` ? s = !0 : g !== "\r" && s && (s = !1, l === c.start || (this._splitChunk(c, l), c = c.next), c.prependRight(e));
932
+ for (a = c.start; a < h; ) {
933
+ if (!i[a]) {
934
+ const o = this.original[a];
935
+ o === `
936
+ ` ? s = !0 : o !== "\r" && s && (s = !1, a === c.start || (this._splitChunk(c, a), c = c.next), c.prependRight(e));
928
937
  }
929
- l += 1;
938
+ a += 1;
930
939
  }
931
- l = c.end, c = c.next;
940
+ a = c.end, c = c.next;
932
941
  }
933
- return this.outro = this.outro.replace(r, a), this;
942
+ return this.outro = this.outro.replace(r, l), this;
934
943
  }
935
944
  insert() {
936
945
  throw new Error(
@@ -938,22 +947,22 @@ class lt {
938
947
  );
939
948
  }
940
949
  insertLeft(e, n) {
941
- return me.insertLeft || (console.warn(
950
+ return ve.insertLeft || (console.warn(
942
951
  "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
943
- ), me.insertLeft = !0), this.appendLeft(e, n);
952
+ ), ve.insertLeft = !0), this.appendLeft(e, n);
944
953
  }
945
954
  insertRight(e, n) {
946
- return me.insertRight || (console.warn(
955
+ return ve.insertRight || (console.warn(
947
956
  "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
948
- ), me.insertRight = !0), this.prependRight(e, n);
957
+ ), ve.insertRight = !0), this.prependRight(e, n);
949
958
  }
950
959
  move(e, n, r) {
951
960
  if (e = e + this.offset, n = n + this.offset, r = r + this.offset, r >= e && r <= n) throw new Error("Cannot move a selection inside itself");
952
961
  this._split(e), this._split(n), this._split(r);
953
- const i = this.byStart[e], s = this.byEnd[n], a = i.previous, l = s.next, c = this.byStart[r];
962
+ const i = this.byStart[e], s = this.byEnd[n], l = i.previous, a = s.next, c = this.byStart[r];
954
963
  if (!c && s === this.lastChunk) return this;
955
- const o = c ? c.previous : this.lastChunk;
956
- return a && (a.next = l), l && (l.previous = a), o && (o.next = i), c && (c.previous = s), i.previous || (this.firstChunk = s.next), s.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = o, s.next = c || null, o || (this.firstChunk = i), c || (this.lastChunk = s), this;
964
+ const h = c ? c.previous : this.lastChunk;
965
+ return l && (l.next = a), a && (a.previous = l), h && (h.next = i), c && (c.previous = s), i.previous || (this.firstChunk = s.next), s.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = h, s.next = c || null, h || (this.firstChunk = i), c || (this.lastChunk = s), this;
957
966
  }
958
967
  overwrite(e, n, r, i) {
959
968
  return i = i || {}, this.update(e, n, r, { ...i, overwrite: !i.contentOnly });
@@ -969,30 +978,30 @@ class lt {
969
978
  throw new Error(
970
979
  "Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
971
980
  );
972
- this._split(e), this._split(n), i === !0 && (me.storeName || (console.warn(
981
+ this._split(e), this._split(n), i === !0 && (ve.storeName || (console.warn(
973
982
  "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
974
- ), me.storeName = !0), i = { storeName: !0 });
975
- const s = i !== void 0 ? i.storeName : !1, a = i !== void 0 ? i.overwrite : !1;
983
+ ), ve.storeName = !0), i = { storeName: !0 });
984
+ const s = i !== void 0 ? i.storeName : !1, l = i !== void 0 ? i.overwrite : !1;
976
985
  if (s) {
977
- const o = this.original.slice(e, n);
978
- Object.defineProperty(this.storedNames, o, {
986
+ const h = this.original.slice(e, n);
987
+ Object.defineProperty(this.storedNames, h, {
979
988
  writable: !0,
980
989
  value: !0,
981
990
  enumerable: !0
982
991
  });
983
992
  }
984
- const l = this.byStart[e], c = this.byEnd[n];
985
- if (l) {
986
- let o = l;
987
- for (; o !== c; ) {
988
- if (o.next !== this.byStart[o.end])
993
+ const a = this.byStart[e], c = this.byEnd[n];
994
+ if (a) {
995
+ let h = a;
996
+ for (; h !== c; ) {
997
+ if (h.next !== this.byStart[h.end])
989
998
  throw new Error("Cannot overwrite across a split point");
990
- o = o.next, o.edit("", !1);
999
+ h = h.next, h.edit("", !1);
991
1000
  }
992
- l.edit(r, s, !a);
1001
+ a.edit(r, s, !l);
993
1002
  } else {
994
- const o = new Be(e, n, "").edit(r, s);
995
- c.next = o, o.previous = c;
1003
+ const h = new ze(e, n, "").edit(r, s);
1004
+ c.next = h, h.previous = c;
996
1005
  }
997
1006
  return this;
998
1007
  }
@@ -1051,24 +1060,24 @@ class lt {
1051
1060
  return this.intro.length ? this.intro[this.intro.length - 1] : "";
1052
1061
  }
1053
1062
  lastLine() {
1054
- let e = this.outro.lastIndexOf(xe);
1063
+ let e = this.outro.lastIndexOf(Ee);
1055
1064
  if (e !== -1) return this.outro.substr(e + 1);
1056
1065
  let n = this.outro, r = this.lastChunk;
1057
1066
  do {
1058
1067
  if (r.outro.length > 0) {
1059
- if (e = r.outro.lastIndexOf(xe), e !== -1) return r.outro.substr(e + 1) + n;
1068
+ if (e = r.outro.lastIndexOf(Ee), e !== -1) return r.outro.substr(e + 1) + n;
1060
1069
  n = r.outro + n;
1061
1070
  }
1062
1071
  if (r.content.length > 0) {
1063
- if (e = r.content.lastIndexOf(xe), e !== -1) return r.content.substr(e + 1) + n;
1072
+ if (e = r.content.lastIndexOf(Ee), e !== -1) return r.content.substr(e + 1) + n;
1064
1073
  n = r.content + n;
1065
1074
  }
1066
1075
  if (r.intro.length > 0) {
1067
- if (e = r.intro.lastIndexOf(xe), e !== -1) return r.intro.substr(e + 1) + n;
1076
+ if (e = r.intro.lastIndexOf(Ee), e !== -1) return r.intro.substr(e + 1) + n;
1068
1077
  n = r.intro + n;
1069
1078
  }
1070
1079
  } while (r = r.previous);
1071
- return e = this.intro.lastIndexOf(xe), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
1080
+ return e = this.intro.lastIndexOf(Ee), e !== -1 ? this.intro.substr(e + 1) + n : this.intro + n;
1072
1081
  }
1073
1082
  slice(e = 0, n = this.original.length - this.offset) {
1074
1083
  if (e = e + this.offset, n = n + this.offset, this.original.length !== 0) {
@@ -1086,11 +1095,11 @@ class lt {
1086
1095
  const s = i;
1087
1096
  for (; i; ) {
1088
1097
  i.intro && (s !== i || i.start === e) && (r += i.intro);
1089
- const a = i.start < n && i.end >= n;
1090
- if (a && i.edited && i.end !== n)
1098
+ const l = i.start < n && i.end >= n;
1099
+ if (l && i.edited && i.end !== n)
1091
1100
  throw new Error(`Cannot use replaced character ${n} as slice end anchor.`);
1092
- const l = s === i ? e - i.start : 0, c = a ? i.content.length + n - i.end : i.content.length;
1093
- if (r += i.content.slice(l, c), i.outro && (!a || i.end === n) && (r += i.outro), a)
1101
+ const a = s === i ? e - i.start : 0, c = l ? i.content.length + n - i.end : i.content.length;
1102
+ if (r += i.content.slice(a, c), i.outro && (!l || i.end === n) && (r += i.outro), l)
1094
1103
  break;
1095
1104
  i = i.next;
1096
1105
  }
@@ -1113,7 +1122,7 @@ class lt {
1113
1122
  }
1114
1123
  _splitChunk(e, n) {
1115
1124
  if (e.edited && e.content.length) {
1116
- const i = Et(this.original)(n);
1125
+ const i = Rt(this.original)(n);
1117
1126
  throw new Error(
1118
1127
  `Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${e.original}")`
1119
1128
  );
@@ -1180,28 +1189,28 @@ class lt {
1180
1189
  return this.original !== this.toString();
1181
1190
  }
1182
1191
  _replaceRegexp(e, n) {
1183
- function r(s, a) {
1184
- return typeof n == "string" ? n.replace(/\$(\$|&|\d+)/g, (l, c) => c === "$" ? "$" : c === "&" ? s[0] : +c < s.length ? s[+c] : `$${c}`) : n(...s, s.index, a, s.groups);
1192
+ function r(s, l) {
1193
+ return typeof n == "string" ? n.replace(/\$(\$|&|\d+)/g, (a, c) => c === "$" ? "$" : c === "&" ? s[0] : +c < s.length ? s[+c] : `$${c}`) : n(...s, s.index, l, s.groups);
1185
1194
  }
1186
- function i(s, a) {
1187
- let l;
1195
+ function i(s, l) {
1196
+ let a;
1188
1197
  const c = [];
1189
- for (; l = s.exec(a); )
1190
- c.push(l);
1198
+ for (; a = s.exec(l); )
1199
+ c.push(a);
1191
1200
  return c;
1192
1201
  }
1193
1202
  if (e.global)
1194
- i(e, this.original).forEach((a) => {
1195
- if (a.index != null) {
1196
- const l = r(a, this.original);
1197
- l !== a[0] && this.overwrite(a.index, a.index + a[0].length, l);
1203
+ i(e, this.original).forEach((l) => {
1204
+ if (l.index != null) {
1205
+ const a = r(l, this.original);
1206
+ a !== l[0] && this.overwrite(l.index, l.index + l[0].length, a);
1198
1207
  }
1199
1208
  });
1200
1209
  else {
1201
1210
  const s = this.original.match(e);
1202
1211
  if (s && s.index != null) {
1203
- const a = r(s, this.original);
1204
- a !== s[0] && this.overwrite(s.index, s.index + s[0].length, a);
1212
+ const l = r(s, this.original);
1213
+ l !== s[0] && this.overwrite(s.index, s.index + s[0].length, l);
1205
1214
  }
1206
1215
  }
1207
1216
  return this;
@@ -1216,9 +1225,9 @@ class lt {
1216
1225
  _replaceAllString(e, n) {
1217
1226
  const { original: r } = this, i = e.length;
1218
1227
  for (let s = r.indexOf(e); s !== -1; s = r.indexOf(e, s + i)) {
1219
- const a = r.slice(s, s + i);
1220
- let l = n;
1221
- typeof n == "function" && (l = n(a, s, r)), a !== l && this.overwrite(s, s + i, l);
1228
+ const l = r.slice(s, s + i);
1229
+ let a = n;
1230
+ typeof n == "function" && (a = n(l, s, r)), l !== a && this.overwrite(s, s + i, a);
1222
1231
  }
1223
1232
  return this;
1224
1233
  }
@@ -1232,13 +1241,13 @@ class lt {
1232
1241
  return this._replaceRegexp(e, n);
1233
1242
  }
1234
1243
  }
1235
- const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn = new RegExp(`${Wn}([^"'\\\`\\s]+)`, "g"), it = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), Qt = (t) => {
1244
+ const pr = "__QWIK_WORKER_QRL__", gr = `${pr}:`, at = "__QWIK_WORKER_CORE__", mr = new RegExp(`${gr}([^"'\\\`\\s]+)`, "g"), lt = (t, e) => `${t.endsWith("/") ? t : `${t}/`}${e}`.replace(/\/{2,}/g, "/"), an = (t) => {
1236
1245
  const e = t.replace(/\/+$/, ""), n = e.lastIndexOf("/");
1237
1246
  return n === -1 ? "." : n === 0 ? "/" : e.slice(0, n);
1238
- }, Gn = (t, e) => {
1247
+ }, vr = (t, e) => {
1239
1248
  const n = e.replace(/^\.\//, "");
1240
- return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? it(t, n) : new URL(n, `https://qwik.dev${it(t, "build/")}`).pathname;
1241
- }, Qn = (t, e) => {
1249
+ return n === "build" || n.startsWith("build/") || !n.startsWith("../") && /^[^./][^?]*\/build\//.test(n) ? lt(t, n) : new URL(n, `https://qwik.dev${lt(t, "build/")}`).pathname;
1250
+ }, wr = (t, e) => {
1242
1251
  const n = /* @__PURE__ */ new Map();
1243
1252
  for (const [r, i] of Object.entries(t.symbols)) {
1244
1253
  const s = t.mapping[r];
@@ -1250,35 +1259,35 @@ const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn
1250
1259
  return (r) => n.get(
1251
1260
  r.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, "")
1252
1261
  );
1253
- }, Kt = (t, e) => t.replace(Hn, (n, r) => e(r) ?? n), Kn = (t, e) => Qn(
1262
+ }, ln = (t, e) => t.replace(mr, (n, r) => e(r) ?? n), yr = (t, e) => wr(
1254
1263
  t,
1255
- (n) => Gn(e, n)
1256
- ), Jn = (t) => {
1257
- const e = t.replace(/\\/g, "/"), n = Qt(e);
1264
+ (n) => vr(e, n)
1265
+ ), br = (t) => {
1266
+ const e = t.replace(/\\/g, "/"), n = an(e);
1258
1267
  return (r) => {
1259
- const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], a = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), l = it(n, `${a}.js`);
1260
- return s.startsWith("?") ? `${l}?worker_file&type=module&${s.slice(1)}` : s.startsWith("#") ? `${l}?worker_file&type=module${s}` : `${l}?worker_file&type=module`;
1268
+ const [, i = "", s = ""] = /^([^?#]*)(.*)$/.exec(r) ?? [], l = i.replace(/^\.\//, "").replace(/\.[^./?]+(?:\?.*)?$/, ""), a = lt(n, `${l}.js`);
1269
+ return s.startsWith("?") ? `${a}?worker_file&type=module&${s.slice(1)}` : s.startsWith("#") ? `${a}?worker_file&type=module${s}` : `${a}?worker_file&type=module`;
1261
1270
  };
1262
- }, Yn = (t) => t.startsWith(".") ? t : `./${t}`, St = (t) => {
1271
+ }, xr = (t) => t.startsWith(".") ? t : `./${t}`, Lt = (t) => {
1263
1272
  const e = [];
1264
1273
  for (const n of t.replace(/\\/g, "/").split("/"))
1265
1274
  !n || n === "." || (n === ".." && e.length > 0 && e[e.length - 1] !== ".." ? e.pop() : e.push(n));
1266
1275
  return e;
1267
- }, Xn = (t, e) => {
1268
- const n = t === "." ? [] : St(t), r = St(e);
1276
+ }, Sr = (t, e) => {
1277
+ const n = t === "." ? [] : Lt(t), r = Lt(e);
1269
1278
  let i = 0;
1270
1279
  for (; i < n.length && i < r.length && n[i] === r[i]; )
1271
1280
  i++;
1272
1281
  return [...n.slice(i).map(() => ".."), ...r.slice(i)].join("/");
1273
- }, Jt = (t) => (e) => {
1274
- const n = Xn(Qt(e), t);
1275
- return Yn(n);
1276
- }, It = (t, e) => {
1277
- if (!t.includes(rt))
1282
+ }, cn = (t) => (e) => {
1283
+ const n = Sr(an(e), t);
1284
+ return xr(n);
1285
+ }, Ot = (t, e) => {
1286
+ if (!t.includes(at))
1278
1287
  return t;
1279
1288
  const n = e();
1280
- return n ? t.replaceAll(rt, n) : t;
1281
- }, Zn = ["server"], Vn = [
1289
+ return n ? t.replaceAll(at, n) : t;
1290
+ }, kr = ["server"], Mt = [
1282
1291
  "onGet",
1283
1292
  "onPost",
1284
1293
  "onPut",
@@ -1288,7 +1297,7 @@ const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn
1288
1297
  "onOptions",
1289
1298
  "onPatch",
1290
1299
  "onStaticGenerate"
1291
- ], er = [
1300
+ ], $t = [
1292
1301
  "useServer",
1293
1302
  "route",
1294
1303
  "server",
@@ -1297,7 +1306,7 @@ const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn
1297
1306
  "zod$",
1298
1307
  "validator$",
1299
1308
  "globalAction$"
1300
- ], tr = [
1309
+ ], Er = [
1301
1310
  "useClient",
1302
1311
  "useBrowser",
1303
1312
  "useVisibleTask",
@@ -1305,10 +1314,10 @@ const zn = "__QWIK_WORKER_QRL__", Wn = `${zn}:`, rt = "__QWIK_WORKER_CORE__", Hn
1305
1314
  "browser",
1306
1315
  "event$"
1307
1316
  ];
1308
- var Yt = /* @__PURE__ */ ((t) => (t.each = "each", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t))(Yt || {});
1309
- function Xt(t = {}) {
1310
- const e = `${Math.round(Math.random() * 899) + 100}`, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
1311
- let a = null, l, c = () => {
1317
+ var dn = /* @__PURE__ */ ((t) => (t.each = "each", t.show = "show", t.suspense = "suspense", t.valibot = "valibot", t.noSPA = "noSPA", t.insights = "insights", t.blockSSR = "blockSSR", t))(dn || {});
1318
+ function un(t = {}) {
1319
+ const e = `${Math.round(Math.random() * 899) + 100}`, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set();
1320
+ let a = null, c, h = () => {
1312
1321
  };
1313
1322
  const o = {
1314
1323
  csr: !1,
@@ -1319,7 +1328,6 @@ function Xt(t = {}) {
1319
1328
  tsconfigFileNames: ["./tsconfig.json"],
1320
1329
  input: void 0,
1321
1330
  outDir: void 0,
1322
- assetsDir: void 0,
1323
1331
  resolveQwikBuild: !0,
1324
1332
  entryStrategy: void 0,
1325
1333
  srcDir: void 0,
@@ -1340,140 +1348,201 @@ function Xt(t = {}) {
1340
1348
  lint: !1,
1341
1349
  experimental: void 0
1342
1350
  };
1343
- let g, m;
1344
- const b = async () => {
1351
+ let w, v;
1352
+ const g = async () => {
1345
1353
  if (!a) {
1346
1354
  const y = (t._optimizer || await import("@qwik.dev/optimizer")).createOptimizer;
1347
- if (a = await y(t), g = nr(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
1355
+ if (a = await y(t), w = Ir(a.sys), a.sys.env !== "browsermain" && a.sys.env !== "webworker")
1348
1356
  try {
1349
- m === void 0 && (m = await a.sys.dynamicImport("node:fs"));
1357
+ v === void 0 && (v = await a.sys.dynamicImport("node:fs"));
1350
1358
  } catch {
1351
- console.log("node:fs not available, disabling automatic manifest reading"), m = null;
1359
+ console.log("node:fs not available, disabling automatic manifest reading"), v = null;
1352
1360
  }
1353
1361
  }
1354
- }, h = () => {
1362
+ }, d = () => {
1355
1363
  if (!a)
1356
1364
  throw new Error("Qwik plugin has not been initialized");
1357
1365
  return a;
1358
- }, d = () => h().sys, f = () => h().sys.path;
1359
- let u;
1360
- const w = (y) => {
1361
- u = y;
1362
- }, T = async (y) => {
1363
- const p = Object.assign({}, y), E = h(), P = E.sys.path, C = (...D) => A(P.resolve(...D));
1364
- o.debug = !!p.debug, p.devTools && (o.devTools = {
1366
+ }, u = () => d().sys, p = () => d().sys.path;
1367
+ let x;
1368
+ const R = (y) => {
1369
+ x = y;
1370
+ }, K = async (y) => {
1371
+ const f = Object.assign({}, y), k = d(), _ = k.sys.path, E = (...P) => Q(_.resolve(...P));
1372
+ o.debug = !!f.debug, f.devTools && (o.devTools = {
1365
1373
  ...o.devTools,
1366
- ...p.devTools
1367
- }), p.assetsDir && (o.assetsDir = p.assetsDir), p.target === "ssr" || p.target === "client" || p.target === "lib" || p.target === "test" ? o.target = p.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : p.buildMode === "production" || p.buildMode === "development" ? o.buildMode = p.buildMode : o.buildMode ||= "development", o.csr = !!p.csr, p.entryStrategy && typeof p.entryStrategy == "object" && (o.entryStrategy = { ...p.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof p.rootDir == "string" && (o.rootDir = p.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= E.sys.cwd()), o.rootDir = C(E.sys.cwd(), o.rootDir);
1368
- let S = C(o.rootDir, sr);
1369
- if (typeof p.srcDir == "string" ? (o.srcDir = C(o.rootDir, p.srcDir), S = o.srcDir) : o.srcDir ||= S, o.srcDir = C(o.rootDir, o.srcDir), Array.isArray(p.tsconfigFileNames) && p.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = p.tsconfigFileNames), !o.csr && !p.input && !o.input && (o.target === "ssr" ? o.input = [C(S, "entry.ssr")] : o.target === "client" ? o.input = [C(S, "root")] : o.input = void 0), p.outDir && (o.outDir = C(o.rootDir, p.outDir)), o.clientOutDir = C(o.rootDir, p.clientOutDir || _t), o.ssrOutDir = C(o.rootDir, p.ssrOutDir || ar), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= C(o.rootDir, lr) : o.outDir ||= o.clientOutDir, typeof p.manifestOutput == "function" && (o.manifestOutput = p.manifestOutput), p.manifestInput && (o.manifestInput = pt(p.manifestInput) || null), typeof p.transformedModuleOutput == "function" && (o.transformedModuleOutput = p.transformedModuleOutput), p.scope !== void 0)
1370
- o.scope = p.scope;
1371
- else if (!o.scope && m) {
1372
- let D = "";
1374
+ ...f.devTools
1375
+ }), f.target === "ssr" || f.target === "client" || f.target === "lib" || f.target === "test" ? o.target = f.target : o.target ||= "client", o.target === "lib" ? o.buildMode = "development" : f.buildMode === "production" || f.buildMode === "development" ? o.buildMode = f.buildMode : o.buildMode ||= "development", o.csr = !!f.csr, f.entryStrategy && typeof f.entryStrategy == "object" && (o.entryStrategy = { ...f.entryStrategy }), o.entryStrategy || (o.target === "ssr" || o.target === "test" ? o.entryStrategy = { type: "hoist" } : o.target === "lib" ? o.entryStrategy = { type: "inline" } : o.buildMode === "production" ? o.entryStrategy = { type: "smart" } : o.entryStrategy = { type: "segment" }), typeof f.rootDir == "string" && (o.rootDir = f.rootDir), typeof o.rootDir != "string" && (o.rootDir ||= k.sys.cwd()), o.rootDir = E(k.sys.cwd(), o.rootDir);
1376
+ let S = E(o.rootDir, Cr);
1377
+ if (typeof f.srcDir == "string" ? (o.srcDir = E(o.rootDir, f.srcDir), S = o.srcDir) : o.srcDir ||= S, o.srcDir = E(o.rootDir, o.srcDir), Array.isArray(f.tsconfigFileNames) && f.tsconfigFileNames.length > 0 && (o.tsconfigFileNames = f.tsconfigFileNames), !o.csr && !f.input && !o.input && (o.target === "ssr" ? o.input = [E(S, "entry.ssr")] : o.target === "client" ? o.input = [E(S, "root")] : o.input = void 0), f.outDir && (o.outDir = E(o.rootDir, f.outDir)), o.clientOutDir = E(o.rootDir, f.clientOutDir || Ut), o.ssrOutDir = E(o.rootDir, f.ssrOutDir || Tr), o.target === "ssr" ? o.outDir ||= o.ssrOutDir : o.target === "lib" ? o.outDir ||= E(o.rootDir, Pr) : o.outDir ||= o.clientOutDir, typeof f.manifestOutput == "function" && (o.manifestOutput = f.manifestOutput), f.manifestInput && (o.manifestInput = St(f.manifestInput) || null), typeof f.transformedModuleOutput == "function" && (o.transformedModuleOutput = f.transformedModuleOutput), f.scope !== void 0)
1378
+ o.scope = f.scope;
1379
+ else if (!o.scope && v) {
1380
+ let P = "";
1373
1381
  try {
1374
- let U = o.rootDir;
1375
- for (; D = P.resolve(U, "package.json"), !await m.promises.stat(D).catch(() => !1); ) {
1376
- const L = P.resolve(U, "..");
1377
- if (L === U)
1382
+ let M = o.rootDir;
1383
+ for (; P = _.resolve(M, "package.json"), !await v.promises.stat(P).catch(() => !1); ) {
1384
+ const N = _.resolve(M, "..");
1385
+ if (N === M)
1378
1386
  break;
1379
- U = L, D = "";
1387
+ M = N, P = "";
1380
1388
  }
1381
- if (D) {
1382
- const L = await m.promises.readFile(D, "utf-8"), N = JSON.parse(L);
1383
- typeof N.name == "string" && (o.scope = N.name);
1389
+ if (P) {
1390
+ const N = await v.promises.readFile(P, "utf-8"), D = JSON.parse(N);
1391
+ typeof D.name == "string" && (o.scope = D.name);
1384
1392
  }
1385
- } catch (U) {
1393
+ } catch (M) {
1386
1394
  console.warn(
1387
- `could not read ${D || "package.json"} to determine package name, ignoring. (${U})`
1395
+ `could not read ${P || "package.json"} to determine package name, ignoring. (${M})`
1388
1396
  );
1389
1397
  }
1390
1398
  }
1391
- if (typeof p.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = p.resolveQwikBuild), typeof p.devTools == "object" && ("imageDevTools" in p.devTools && (o.devTools.imageDevTools = p.devTools.imageDevTools), "clickToSource" in p.devTools && (o.devTools.clickToSource = p.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof p.lint == "boolean" && (o.lint = p.lint), "experimental" in p) {
1399
+ if (typeof f.resolveQwikBuild == "boolean" && (o.resolveQwikBuild = f.resolveQwikBuild), typeof f.devTools == "object" && ("imageDevTools" in f.devTools && (o.devTools.imageDevTools = f.devTools.imageDevTools), "clickToSource" in f.devTools && (o.devTools.clickToSource = f.devTools.clickToSource)), "inlineStylesUpToBytes" in t && (typeof t.inlineStylesUpToBytes == "number" ? o.inlineStylesUpToBytes = t.inlineStylesUpToBytes : (typeof o.inlineStylesUpToBytes != "number" || o.inlineStylesUpToBytes < 0) && (o.inlineStylesUpToBytes = 0)), typeof f.lint == "boolean" && (o.lint = f.lint), "experimental" in f) {
1392
1400
  o.experimental = void 0;
1393
- for (const D of p.experimental ?? [])
1394
- Yt[D] ? (o.experimental ||= {})[D] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${D}`);
1401
+ for (const P of f.experimental ?? [])
1402
+ dn[P] ? (o.experimental ||= {})[P] = !0 : console.error(`Qwik plugin: Unknown experimental feature: ${P}`);
1395
1403
  }
1396
- const q = { ...o };
1397
- return o.input ||= p.input, o.input && typeof o.input == "string" && (o.input = [o.input]), q;
1404
+ const L = { ...o };
1405
+ return o.input ||= f.input, o.input && typeof o.input == "string" && (o.input = [o.input]), L;
1398
1406
  };
1399
- let Y = !1;
1400
- const j = async (y) => {
1401
- if (!Y) {
1402
- Y = !0;
1403
- const p = d();
1404
- if (p.env === "node") {
1405
- const E = await p.dynamicImport("node:fs");
1406
- if (!E.existsSync(o.rootDir))
1407
+ let m = !1;
1408
+ const b = async (y) => {
1409
+ if (!m) {
1410
+ m = !0;
1411
+ const f = u();
1412
+ if (f.env === "node") {
1413
+ const k = await f.dynamicImport("node:fs");
1414
+ if (!k.existsSync(o.rootDir))
1407
1415
  throw new Error(`Qwik rootDir "${o.rootDir}" not found.`);
1408
- if (typeof o.srcDir == "string" && !E.existsSync(o.srcDir))
1416
+ if (typeof o.srcDir == "string" && !k.existsSync(o.srcDir))
1409
1417
  throw new Error(`Qwik srcDir "${o.srcDir}" not found.`);
1410
- for (const [P, C] of Object.entries(o.input || {}))
1411
- if (!await y(C))
1412
- throw new Error(`Qwik input "${C}" not found.`);
1418
+ for (const [_, E] of Object.entries(o.input || {}))
1419
+ if (!await y(E))
1420
+ throw new Error(`Qwik input "${E}" not found.`);
1413
1421
  }
1414
1422
  }
1415
1423
  };
1416
- let I, v = !1;
1417
- const k = async (y) => {
1418
- if (M("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), I = h(), v = !u, I.sys.env === "node" && o.target === "ssr" && o.lint)
1424
+ let C, $ = !1;
1425
+ const I = async (y) => {
1426
+ if (O("buildStart()", o.buildMode, o.scope, o.target, o.rootDir, o.srcDir), C = d(), $ = !x, C.sys.env === "node" && o.target === "ssr" && o.lint)
1419
1427
  try {
1420
- l = await xn(I.sys, o.rootDir, o.tsconfigFileNames);
1428
+ c = await Un(C.sys, o.rootDir, o.tsconfigFileNames);
1421
1429
  } catch {
1422
1430
  }
1423
- if (M("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !u) {
1424
- const p = await y.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1431
+ if (O("transformedOutputs.clear()"), r.clear(), i.clear(), o.target === "client" && !x) {
1432
+ const f = await y.resolve("@qwik.dev/core/qwikloader.js", void 0, {
1425
1433
  skipSelf: !0
1426
1434
  });
1427
- p && y.emitFile({
1428
- id: p.id,
1435
+ f && y.emitFile({
1436
+ id: f.id,
1429
1437
  type: "chunk",
1430
1438
  preserveSignature: "allow-extension"
1431
1439
  });
1432
1440
  }
1433
- }, x = (y, p) => y.environment ? y.environment.config.consumer === "server" : u ? !!p?.ssr : o.target === "ssr" || o.target === "test";
1434
- let $ = 0, _ = !1;
1435
- const O = async (y, p, E, P) => {
1436
- if (ae(p))
1441
+ }, T = (y, f) => y.environment ? y.environment.config.consumer === "server" : x ? !!f?.ssr : o.target === "ssr" || o.target === "test", z = (y) => !y && (o.target === "client" || !!x && o.target === "ssr"), j = (y) => !!x && y && (o.target === "client" || o.target === "ssr"), q = (y, f, k = !1) => {
1442
+ if (z(k) && Kn(y, o))
1443
+ throw new Error(Jn(y, f));
1444
+ }, A = (y) => {
1445
+ const f = y.replace(/\\/g, "/");
1446
+ return f.includes(".server") || /(^|\/)server(\/|$)/.test(f);
1447
+ }, J = (y, f) => {
1448
+ const k = /* @__PURE__ */ new Set(), _ = (S) => {
1449
+ typeof S?.value == "string" && k.add(S.value);
1450
+ }, E = [y.parse(f)];
1451
+ for (; E.length > 0; ) {
1452
+ const S = E.pop();
1453
+ if (!(!S || typeof S != "object" || typeof S.type != "string")) {
1454
+ S.type === "ImportDeclaration" && S.importKind !== "type" || (S.type === "ExportNamedDeclaration" || S.type === "ExportAllDeclaration") && S.exportKind !== "type" || S.type === "ImportExpression" ? _(S.source) : S.type === "CallExpression" && S.callee?.type === "Import" && _(S.arguments?.[0]);
1455
+ for (const L of Object.keys(S)) {
1456
+ if (L === "parent")
1457
+ continue;
1458
+ const P = S[L];
1459
+ if (Array.isArray(P))
1460
+ for (const M of P)
1461
+ E.push(M);
1462
+ else
1463
+ E.push(P);
1464
+ }
1465
+ }
1466
+ }
1467
+ return Array.from(k);
1468
+ }, X = async (y, f, k, _ = k) => {
1469
+ if (_t(f))
1470
+ for (const E of J(y, f)) {
1471
+ if (!A(E))
1472
+ continue;
1473
+ q(E, _);
1474
+ const S = await y.resolve(E, k, { skipSelf: !0 });
1475
+ S && q(Q(me(S.id).pathId), _);
1476
+ }
1477
+ }, Y = async (y, f, k, _, E = !1) => {
1478
+ const S = p();
1479
+ for (const L of f.modules) {
1480
+ if (E && !jt(L))
1481
+ continue;
1482
+ const P = Q(S.join(k, L.path));
1483
+ await X(y, L.code, P, _ ?? P);
1484
+ }
1485
+ }, ae = async (y, f, k) => {
1486
+ const _ = await y.resolve(f, k, { skipSelf: !0 });
1487
+ if (!_ || _.external || ne(_.id))
1437
1488
  return;
1438
- const C = u && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(p);
1439
- if (C) {
1440
- if (!_) {
1441
- _ = !0, setTimeout(() => _ = !1, 500);
1442
- const [, B, W] = C, ue = await y.resolve(B, E);
1443
- if (ue) {
1444
- const ne = y.environment.moduleGraph.getModuleById(ue.id)?.file;
1445
- if (ne) {
1446
- const re = `${ne}${W}`;
1489
+ const E = me(_.id);
1490
+ if (E.query)
1491
+ return;
1492
+ const S = Q(E.pathId);
1493
+ if (p().extname(S).toLowerCase() in qt || ct.test(S))
1494
+ return S;
1495
+ }, W = async (y, f, k) => {
1496
+ if (f.length === 0)
1497
+ return [];
1498
+ const _ = [];
1499
+ for (const E of f) {
1500
+ const S = await ae(y, E, k);
1501
+ S && _.push(S);
1502
+ }
1503
+ return _;
1504
+ };
1505
+ let le = 0, V = !1;
1506
+ const de = async (y, f, k, _) => {
1507
+ if (ne(f))
1508
+ return;
1509
+ const E = x && /^(.*)\?editor(:(\d+)(:\d+)?)?$/.exec(f);
1510
+ if (E) {
1511
+ if (!V) {
1512
+ V = !0, setTimeout(() => V = !1, 500);
1513
+ const [, F, U] = E, re = await y.resolve(F, k);
1514
+ if (re) {
1515
+ const ue = y.environment.moduleGraph.getModuleById(re.id)?.file;
1516
+ if (ue) {
1517
+ const ee = `${ue}${U}`;
1447
1518
  try {
1448
- console.warn(`Opening in editor: ${re}`);
1449
- const he = (await import("launch-editor")).default;
1450
- he(re);
1451
- } catch (he) {
1452
- console.error(`Failed to open editor: ${he.message}`);
1519
+ console.warn(`Opening in editor: ${ee}`);
1520
+ const fe = (await import("launch-editor")).default;
1521
+ fe(ee);
1522
+ } catch (fe) {
1523
+ console.error(`Failed to open editor: ${fe.message}`);
1453
1524
  }
1454
1525
  }
1455
1526
  }
1456
1527
  }
1457
1528
  return { id: "\0editor" };
1458
1529
  }
1459
- const S = $++, q = x(y, P);
1460
- M(`resolveId(${S})`, `begin ${p} | ${q ? "server" : "client"} | ${E}`);
1461
- const D = E && We(E);
1462
- if (E = D && A(D.pathId), p.startsWith(".") && D) {
1463
- const B = f(), W = B.dirname(D.pathId);
1464
- W && (p = B.resolve(W, p));
1465
- }
1466
- const U = We(p), L = A(U.pathId);
1467
- let N;
1468
- if (
1469
- /**
1470
- * Check if we know the QRL. During regular builds, we'll encounter and build parents before
1471
- * their QRLs, so this will always match.
1472
- */
1473
- s.get(L)
1474
- )
1475
- M(`resolveId(${S}) Resolved already known ${L}`), N = {
1476
- id: L + U.query,
1530
+ const S = le++, L = T(y, _);
1531
+ O(`resolveId(${S})`, `begin ${f} | ${L ? "server" : "client"} | ${k}`);
1532
+ const P = k && me(k);
1533
+ if (k = P && Q(P.pathId), f.startsWith(".") && P) {
1534
+ const F = p(), U = F.dirname(P.pathId);
1535
+ U && (f = F.resolve(U, f));
1536
+ }
1537
+ const M = me(f), N = Q(M.pathId);
1538
+ let D;
1539
+ if (x && _?.scan || q(N, k, L), /**
1540
+ * Check if we know the QRL. During regular builds, we'll encounter and build parents before
1541
+ * their QRLs, so this will always match.
1542
+ */
1543
+ s.get(N))
1544
+ O(`resolveId(${S}) Resolved already known ${N}`), D = {
1545
+ id: N + M.query,
1477
1546
  moduleSideEffects: !1
1478
1547
  };
1479
1548
  else if (
@@ -1482,149 +1551,158 @@ function Xt(t = {}) {
1482
1551
  * been transformed yet.
1483
1552
  */
1484
1553
  // We test with endsWith because the dev server adds the base pathname
1485
- L.endsWith(se)
1554
+ N.endsWith(se)
1486
1555
  )
1487
- o.resolveQwikBuild && (M(`resolveId(${S})`, "Resolved", se), N = {
1556
+ o.resolveQwikBuild && (O(`resolveId(${S})`, "Resolved", se), D = {
1488
1557
  id: se,
1489
1558
  moduleSideEffects: !1
1490
1559
  });
1491
- else if (L.endsWith(oe))
1560
+ else if (N.endsWith(oe))
1492
1561
  console.error(
1493
- `${E ? `${E}: ` : ""}importing ${oe} is deprecated. Use \`getClientManifest()\` instead.`
1494
- ), M(`resolveId(${S})`, "Resolved", oe), N = {
1562
+ `${k ? `${k}: ` : ""}importing ${oe} is deprecated. Use \`getClientManifest()\` instead.`
1563
+ ), O(`resolveId(${S})`, "Resolved", oe), D = {
1495
1564
  id: oe,
1496
1565
  moduleSideEffects: !1
1497
1566
  };
1498
- else if (!u && !q && L.endsWith(Ze)) {
1499
- M(`resolveId(${S})`, "Resolved", Ze);
1500
- const B = await y.resolve(Ze, E, {
1567
+ else if (!x && !L && N.endsWith(nt)) {
1568
+ O(`resolveId(${S})`, "Resolved", nt);
1569
+ const F = await y.resolve(nt, k, {
1501
1570
  skipSelf: !0
1502
1571
  });
1503
- if (B)
1572
+ if (F)
1504
1573
  return y.emitFile({
1505
- id: B.id,
1574
+ id: F.id,
1506
1575
  type: "chunk",
1507
1576
  preserveSignature: "allow-extension"
1508
- }), B;
1509
- } else if (L.endsWith(ke))
1510
- M(`resolveId(${S})`, "Resolved", ke), N = {
1511
- id: ke,
1577
+ }), F;
1578
+ } else if (N.endsWith(Ie))
1579
+ O(`resolveId(${S})`, "Resolved", Ie), D = {
1580
+ id: Ie,
1512
1581
  moduleSideEffects: !1
1513
1582
  };
1514
1583
  else {
1515
- if (!q && v && p.endsWith("@qwik.dev/core")) {
1516
- v = !1;
1517
- const W = await y.resolve("@qwik.dev/core/handlers.mjs", E, {
1584
+ if (!L && $ && f.endsWith("@qwik.dev/core")) {
1585
+ $ = !1;
1586
+ const U = await y.resolve("@qwik.dev/core/handlers.mjs", k, {
1518
1587
  skipSelf: !0
1519
1588
  });
1520
- if (!W)
1589
+ if (!U)
1521
1590
  throw new Error("Failed to resolve @qwik.dev/core/handlers.mjs");
1522
1591
  y.emitFile({
1523
- id: W.id,
1592
+ id: U.id,
1524
1593
  type: "chunk",
1525
1594
  preserveSignature: "allow-extension"
1526
1595
  });
1527
1596
  }
1528
- const B = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(p)?.groups;
1529
- if (B) {
1530
- const { parent: W, name: ue, query: Ae } = B, ne = await y.resolve(W, E, { skipSelf: !0 });
1531
- if (ne) {
1532
- const re = ne.id.split("?")[0], V = u && E?.endsWith(".html") ? `${re}_${ue}.js` : L;
1533
- M(`resolveId(${S})`, `resolved to QRL ${ue} of ${re}`), s.set(V, re), N = {
1534
- id: V + Ae,
1597
+ const F = /^(?<parent>.*\.[mc]?[jt]sx?)_(?<name>[^/]+)\.js(?<query>$|\?.*$)/.exec(f)?.groups;
1598
+ if (F) {
1599
+ const { parent: U, name: re, query: Ge } = F, ue = await y.resolve(U, k, { skipSelf: !0 });
1600
+ if (ue) {
1601
+ const ee = ue.id.split("?")[0], be = x && k?.endsWith(".html") ? `${ee}_${re}.js` : N;
1602
+ O(`resolveId(${S})`, `resolved to QRL ${re} of ${ee}`), s.set(be, ee), D = {
1603
+ id: be + Ge,
1535
1604
  // QRL segments can't have side effects. Probably never useful, but it's here for consistency
1536
1605
  moduleSideEffects: !1
1537
1606
  };
1538
1607
  } else
1539
- console.error(`resolveId(${S})`, `QRL parent ${W} does not exist!`);
1540
- } else if (E) {
1541
- const W = s.get(E);
1542
- if (W)
1543
- return M(`resolveId(${S}) end`, `resolving via ${W}`), y.resolve(p, W, { skipSelf: !0 });
1608
+ console.error(`resolveId(${S})`, `QRL parent ${U} does not exist!`);
1609
+ } else if (k) {
1610
+ const U = s.get(k);
1611
+ if (U)
1612
+ return O(`resolveId(${S}) end`, `resolving via ${U}`), y.resolve(f, U, { skipSelf: !0 });
1544
1613
  }
1545
1614
  }
1546
- return M(`resolveId(${S}) end`, N?.id || N), N;
1615
+ return O(`resolveId(${S}) end`, D?.id || D), D;
1547
1616
  };
1548
- let Q = 0;
1549
- const F = async (y, p, E) => {
1550
- if (p === "\0editor")
1617
+ let pn = 0;
1618
+ const gn = async (y, f, k) => {
1619
+ if (f === "\0editor")
1551
1620
  return '"opening in editor"';
1552
- if (ae(p) || p.startsWith("/@fs/"))
1621
+ if (ne(f))
1553
1622
  return;
1554
- const P = Q++, C = x(y, E);
1555
- if (o.resolveQwikBuild && p === se)
1556
- return M(`load(${P})`, se, o.buildMode), {
1623
+ const _ = pn++, E = T(y, k), S = me(f), L = Q(S.pathId);
1624
+ if (q(L, void 0, E), f.startsWith("/@fs/"))
1625
+ return;
1626
+ if (o.resolveQwikBuild && f === se)
1627
+ return O(`load(${_})`, se, o.buildMode), {
1557
1628
  moduleSideEffects: !1,
1558
- code: ve(C, o.target)
1629
+ code: mt(E, o.target)
1559
1630
  };
1560
- if (p === oe)
1561
- return M(`load(${P})`, oe, o.buildMode), {
1631
+ if (f === oe)
1632
+ return O(`load(${_})`, oe, o.buildMode), {
1562
1633
  moduleSideEffects: !1,
1563
1634
  code: `import { getClientManifest } from '@qwik.dev/core'; export const manifest = getClientManifest();
1564
1635
  `
1565
1636
  };
1566
- if (p === ke)
1567
- return M(`load(${P})`, ke, o.buildMode), {
1637
+ if (f === Ie)
1638
+ return O(`load(${_})`, Ie, o.buildMode), {
1568
1639
  moduleSideEffects: !1,
1569
1640
  code: "export * from '@qwik.dev/core';"
1570
1641
  };
1571
- const S = We(p);
1572
- p = A(S.pathId);
1573
- const q = C ? i : r;
1574
- if (u && !q.has(p)) {
1575
- const U = s.get(p);
1576
- if (U) {
1577
- const L = u.moduleGraph.getModuleById(U);
1578
- if (L) {
1579
- if (M(`load(${P})`, "transforming QRL parent", U), await u.transformRequest(L.url), !q.has(p))
1580
- return M(`load(${P})`, `QRL segment ${p} not found in ${U}`), null;
1581
- } else
1582
- console.error(`load(${P})`, `module ${U} does not exist in the build graph!`);
1642
+ f = L;
1643
+ const P = E ? i : r;
1644
+ if (x && !P.has(f)) {
1645
+ const N = s.get(f);
1646
+ if (N) {
1647
+ O(`load(${_})`, "transforming QRL parent", N);
1648
+ const D = x.moduleGraph.getModuleById(N);
1649
+ if (D)
1650
+ await x.transformRequest(D.url);
1651
+ else
1652
+ try {
1653
+ await x.transformRequest(N);
1654
+ } catch (F) {
1655
+ console.error(`load(${_})`, `could not transform QRL parent ${N}:`, F);
1656
+ }
1657
+ if (!P.has(f))
1658
+ return O(`load(${_})`, `QRL segment ${f} not found in ${N}`), null;
1583
1659
  }
1584
1660
  }
1585
- const D = q.get(p);
1586
- if (D) {
1587
- M(`load(${P})`, "Found", p);
1588
- let { code: U } = D[0];
1589
- const { map: L, segment: N } = D[0], B = D[1];
1590
- if (u?.hot && B && o.devTools.hmr && N?.ctxName !== "worker$") {
1591
- const W = B.startsWith(o.rootDir) ? B.slice(o.rootDir.length) : B;
1592
- U += `
1593
- if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(W)}], t: document.__hmrT}}));});}`;
1661
+ const M = P.get(f);
1662
+ if (M) {
1663
+ O(`load(${_})`, "Found", f);
1664
+ let { code: N } = M[0];
1665
+ const { map: D, segment: F } = M[0], U = M[1];
1666
+ if (x?.hot && U && o.devTools.hmr && F?.ctxName !== "worker$") {
1667
+ const re = U.startsWith(o.rootDir) ? U.slice(o.rootDir.length) : U;
1668
+ N += `
1669
+ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(()=>{document.dispatchEvent(new CustomEvent('qHmr', {detail: {files:[${JSON.stringify(re)}], t: document.__hmrT}}));});}`;
1594
1670
  }
1595
- return { code: U, map: L, meta: { segment: N } };
1671
+ return { code: N, map: D, meta: { segment: F } };
1596
1672
  }
1597
- return M(`load(${P})`, "Not a QRL or virtual module", p), null;
1673
+ return O(`load(${_})`, "Not a QRL or virtual module", f), null;
1598
1674
  };
1599
- let R, J = 0;
1600
- const K = async function(y, p, E, P = {}) {
1601
- if (ae(E))
1675
+ let He, mn = 0;
1676
+ const vn = async function(y, f, k, _ = {}) {
1677
+ if (ne(k))
1602
1678
  return;
1603
- const C = x(y, P), S = C ? i : r;
1604
- if (S.has(E))
1679
+ const E = T(y, _), S = E ? i : r;
1680
+ if (S.has(k))
1605
1681
  return;
1606
- let q = !1;
1607
- const D = J++, U = h(), L = f(), { pathId: N } = We(E), B = L.parse(N), W = B.dir, ue = B.base, Ae = B.ext.toLowerCase();
1608
- let ne, re;
1609
- const he = o.target === "lib" ? "lib" : o.buildMode === "development" ? u?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
1610
- if (he !== "lib" && (p = p.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (V, fe) => (q = !0, o.experimental?.[fe] ? "true" : "false"))), Ae in or || Zt.test(N)) {
1611
- const V = o.target === "client" || o.target === "ssr";
1612
- M(
1613
- `transform(${D})`,
1614
- `Transforming ${E} (for: ${C ? "server" : "client"}${V ? ", strip" : ""})`
1682
+ let L = !1;
1683
+ const P = mn++, M = d(), N = p(), { pathId: D } = me(k), F = Q(D);
1684
+ q(F, void 0, E);
1685
+ const U = N.parse(D), re = U.dir, Ge = U.base, ue = U.ext.toLowerCase();
1686
+ let ee, fe;
1687
+ const be = o.target === "lib" ? "lib" : o.buildMode === "development" ? x?.hot && o.devTools.hmr ? "hmr" : "dev" : "prod";
1688
+ if (be !== "lib" && (f = f.replaceAll(/__EXPERIMENTAL__\.(\w+)/g, (te, ge) => (L = !0, o.experimental?.[ge] ? "true" : "false"))), ue in qt || ct.test(D)) {
1689
+ const te = o.target === "client" || o.target === "ssr";
1690
+ O(
1691
+ `transform(${P})`,
1692
+ `Transforming ${k} (for: ${E ? "server" : "client"}${te ? ", strip" : ""})`
1615
1693
  );
1616
- let fe = ue;
1617
- o.srcDir && (fe = L.relative(o.srcDir, N)), fe = A(fe);
1618
- const Xe = o.srcDir ? o.srcDir : A(W), an = o.entryStrategy;
1694
+ let ge = Ge;
1695
+ o.srcDir && (ge = N.relative(o.srcDir, D)), ge = Q(ge);
1696
+ const xe = o.srcDir ? o.srcDir : Q(re), vt = o.entryStrategy;
1619
1697
  let ie;
1620
- const ct = y.environment?.moduleGraph ?? u?.moduleGraph;
1621
- if (ct && (ie = ct.getModuleById(N)?.url, !ie && o.rootDir)) {
1622
- const ee = A(o.rootDir), Z = A(N);
1623
- Z.startsWith(ee) && (ie = Z.slice(ee.length), ie.startsWith("/") || (ie = "/" + ie));
1698
+ const wt = y.environment?.moduleGraph ?? x?.moduleGraph;
1699
+ if (wt && (ie = wt.getModuleById(D)?.url, !ie && o.rootDir)) {
1700
+ const B = Q(o.rootDir), Z = Q(D);
1701
+ Z.startsWith(B) && (ie = Z.slice(B.length), ie.startsWith("/") || (ie = "/" + ie));
1624
1702
  }
1625
- const pe = {
1626
- input: [{ code: p, path: fe, devPath: ie }],
1627
- entryStrategy: C ? { type: "hoist" } : an,
1703
+ const he = {
1704
+ input: [{ code: f, path: ge, devPath: ie }],
1705
+ entryStrategy: E ? { type: "hoist" } : vt,
1628
1706
  minify: "simplify",
1629
1707
  // Always enable sourcemaps in dev for click-to-source
1630
1708
  sourceMaps: o.sourcemap || o.buildMode === "development",
@@ -1632,84 +1710,106 @@ if (import.meta.hot && typeof document !== 'undefined') {import.meta.hot.accept(
1632
1710
  transpileJsx: !0,
1633
1711
  explicitExtensions: !0,
1634
1712
  preserveFilenames: !0,
1635
- srcDir: Xe,
1713
+ srcDir: xe,
1636
1714
  rootDir: o.rootDir,
1637
- mode: he,
1715
+ mode: be,
1638
1716
  scope: o.scope || void 0,
1639
- isServer: C
1717
+ isServer: E
1640
1718
  };
1641
- V && (C ? (pe.stripCtxName = tr, pe.stripEventHandlers = !0, pe.regCtxName = Zn) : (pe.stripCtxName = er, pe.stripExports = Vn));
1642
- const ln = Date.now(), ge = await U.transformModules(pe);
1643
- if (M(`transform(${D})`, `done in ${Date.now() - ln}ms`), ie) {
1644
- const ee = Jn(ie);
1645
- for (const Z of ge.modules)
1646
- Z.code = Kt(
1719
+ te && (E ? (he.stripCtxName = Er, he.stripEventHandlers = !0, he.regCtxName = kr) : (he.stripCtxName = $t, he.stripExports = Mt));
1720
+ const _n = Date.now(), pe = await M.transformModules(he);
1721
+ if (O(`transform(${P})`, `done in ${Date.now() - _n}ms`), ie) {
1722
+ const B = br(ie);
1723
+ for (const Z of pe.modules)
1724
+ Z.code = ln(
1647
1725
  Z.code,
1648
- ee
1726
+ B
1649
1727
  );
1650
1728
  }
1651
- const ze = ge.modules.find((ee) => !rr(ee));
1652
- c(ge.diagnostics, U, Xe), C ? ge.diagnostics.length === 0 && l && l.lint(y, p, E) : n.set(E, ge);
1653
- const dt = /* @__PURE__ */ new Set();
1654
- for (const ee of ge.modules)
1655
- if (ee !== ze) {
1656
- const Z = A(L.join(Xe, ee.path));
1657
- if (M(`transform(${D})`, `segment ${Z}`, ee.segment.displayName), s.set(Z, E), S.set(Z, [ee, E]), dt.add(Z), u) {
1658
- const ut = u.moduleGraph.getModuleById(Z);
1659
- ut && u.moduleGraph.invalidateModule(ut);
1729
+ const Se = pe.modules.find((B) => !jt(B));
1730
+ if (z(E))
1731
+ await Y(y, pe, xe, F);
1732
+ else if (j(E) && _t(f)) {
1733
+ const B = {
1734
+ ...he,
1735
+ entryStrategy: vt,
1736
+ isServer: !1
1737
+ };
1738
+ te && (B.stripCtxName = $t, B.stripExports = Mt, B.stripEventHandlers = void 0, B.regCtxName = void 0), await Y(
1739
+ y,
1740
+ await M.transformModules(B),
1741
+ xe,
1742
+ F,
1743
+ !0
1744
+ );
1745
+ }
1746
+ h(pe.diagnostics, M, xe);
1747
+ let yt = [];
1748
+ E && te && (yt = await W(y, Se.imports ?? [], k)), E ? pe.diagnostics.length === 0 && c && c.lint(y, f, k) : n.set(k, pe);
1749
+ const tt = /* @__PURE__ */ new Set();
1750
+ for (const B of pe.modules)
1751
+ if (B !== Se) {
1752
+ const Z = Q(N.join(xe, B.path));
1753
+ if (O(`transform(${P})`, `segment ${Z}`, B.segment.displayName), s.set(Z, k), S.set(Z, [B, k]), tt.add(Z), x) {
1754
+ const Qe = x.moduleGraph.getModuleById(Z);
1755
+ Qe && x.moduleGraph.invalidateModule(Qe);
1660
1756
  }
1661
- o.target === "client" && !u && y.emitFile({
1757
+ if (o.target === "client" && !x && y.emitFile({
1662
1758
  id: Z,
1663
1759
  type: "chunk",
1664
1760
  preserveSignature: "allow-extension"
1665
- });
1761
+ }), B.segment && l.size > 0)
1762
+ for (const Qe of l)
1763
+ Qe(k, B.segment);
1666
1764
  }
1667
- y.addWatchFile(E), p = ze.code, ne = ze.map, re = {
1668
- segment: ze.segment,
1669
- qwikdeps: Array.from(dt)
1670
- }, q = !0;
1671
- }
1672
- if (p.includes(`globalThis.${Ge}`)) {
1673
- R === void 0 && (R = await tn(C));
1674
- const V = new lt(p);
1675
- V.replace(`!globalThis.${Ge}`, "false"), R && V.replace(`globalThis.${Ge}`, R), p = V.toString(), ne ||= V.generateMap({ source: E, includeContent: !1 }), q = !0, M(`transform(${D})`, `Replaced globalThis.${Ge} with manifest input`);
1676
- }
1677
- if (q)
1678
- return ir(E) && (ne = null), { code: p, map: ne, meta: re };
1679
- M(`transform(${D})`, "Not transforming", E);
1680
- }, X = (y) => {
1681
- const p = [], E = {
1682
- addInjection: (P) => p.push(P)
1765
+ for (const B of yt)
1766
+ tt.add(B);
1767
+ y.addWatchFile(k), f = Se.code, ee = Se.map, fe = {
1768
+ segment: Se.segment,
1769
+ qwikdeps: Array.from(tt)
1770
+ }, L = !0;
1771
+ }
1772
+ if (f.includes(`globalThis.${Je}`)) {
1773
+ He === void 0 && (He = await xn(E));
1774
+ const te = new ht(f);
1775
+ te.replace(`!globalThis.${Je}`, "false"), He && te.replace(`globalThis.${Je}`, He), f = te.toString(), ee ||= te.generateMap({ source: k, includeContent: !1 }), L = !0, O(`transform(${P})`, `Replaced globalThis.${Je} with manifest input`);
1776
+ }
1777
+ if (L)
1778
+ return _r(k) && (ee = null), { code: f, map: ee, meta: fe };
1779
+ O(`transform(${P})`, "Not transforming", k);
1780
+ }, pt = (y) => {
1781
+ const f = [], k = {
1782
+ addInjection: (_) => f.push(_)
1683
1783
  };
1684
- return E.generateManifest = async (P) => {
1685
- const S = h().sys.path, q = S.resolve(o.rootDir, o.outDir, "build"), D = (N) => S.relative(q, S.resolve(o.rootDir, o.outDir, N));
1686
- E.canonPath = D;
1687
- const U = Array.from(n.values()).flatMap((N) => N.modules).map((N) => N.segment).filter((N) => !!N), L = mn(
1784
+ return k.generateManifest = async (_) => {
1785
+ const S = d().sys.path, L = S.resolve(o.rootDir, o.outDir, "build"), P = (D) => S.relative(L, S.resolve(o.rootDir, o.outDir, D));
1786
+ k.canonPath = P;
1787
+ const M = Array.from(n.values()).flatMap((D) => D.modules).map((D) => D.segment).filter((D) => !!D), N = On(
1688
1788
  S,
1689
- U,
1690
- p,
1789
+ M,
1790
+ f,
1691
1791
  y,
1692
1792
  o,
1693
- M,
1694
- D
1793
+ O,
1794
+ P
1695
1795
  );
1696
- P && Object.assign(L, P);
1697
- for (const N of Object.values(L.symbols))
1698
- N.origin && (N.origin = A(N.origin));
1699
- for (const N of Object.values(L.bundles))
1700
- N.origins && (N.origins = N.origins.sort());
1701
- return L.manifestHash = cn(JSON.stringify(L)), L;
1702
- }, E;
1703
- }, te = () => o, ce = () => Array.from(r.values()).map((y) => y[0]), M = (...y) => {
1796
+ _ && Object.assign(N, _);
1797
+ for (const D of Object.values(N.symbols))
1798
+ D.origin && (D.origin = Q(D.origin));
1799
+ for (const D of Object.values(N.bundles))
1800
+ D.origins && (D.origins = D.origins.sort());
1801
+ return N.manifestHash = Cn(JSON.stringify(N)), N;
1802
+ }, k;
1803
+ }, wn = () => o, gt = () => Array.from(r.values()).map((y) => y[0]), O = (...y) => {
1704
1804
  o.debug && console.debug(`[QWIK PLUGIN: ${e}]`, ...y);
1705
- }, z = (...y) => {
1805
+ }, yn = (...y) => {
1706
1806
  console.log(`[QWIK PLUGIN: ${e}]`, ...y);
1707
- }, de = (y) => {
1708
- c = y;
1709
- }, A = (y) => g(y);
1710
- function ve(y, p) {
1711
- const E = o.buildMode === "development";
1712
- return E ? `// @qwik.dev/core/build
1807
+ }, bn = (y) => {
1808
+ h = y;
1809
+ }, Q = (y) => w(y);
1810
+ function mt(y, f) {
1811
+ const k = o.buildMode === "development";
1812
+ return k ? `// @qwik.dev/core/build
1713
1813
  export const isBrowser = /*#__PURE__*/ (() =>
1714
1814
  typeof window !== 'undefined' &&
1715
1815
  typeof HTMLElement !== 'undefined' &&
@@ -1720,22 +1820,22 @@ export const isDev = true;
1720
1820
  ` : `// @qwik.dev/core/build
1721
1821
  export const isServer = ${JSON.stringify(y)};
1722
1822
  export const isBrowser = ${JSON.stringify(!y)};
1723
- export const isDev = ${JSON.stringify(E)};
1823
+ export const isDev = ${JSON.stringify(k)};
1724
1824
  `;
1725
1825
  }
1726
- async function tn(y) {
1727
- if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && m) {
1728
- const P = f();
1729
- let C = o.manifestInputPath || P.resolve(o.clientOutDir, Ve);
1730
- await m.promises.stat(C).catch(() => !1) || (C = P.resolve(o.rootDir, _t, Ve));
1826
+ async function xn(y) {
1827
+ if (!o.manifestInput && o.target === "ssr" && o.buildMode === "production" && v) {
1828
+ const _ = p();
1829
+ let E = o.manifestInputPath || _.resolve(o.clientOutDir, rt);
1830
+ await v.promises.stat(E).catch(() => !1) || (E = _.resolve(o.rootDir, Ut, rt));
1731
1831
  try {
1732
- const S = await m.promises.readFile(C, "utf-8");
1733
- o.manifestInput = pt(JSON.parse(S)) || null, console.info("Read client manifest from", C);
1832
+ const S = await v.promises.readFile(E, "utf-8");
1833
+ o.manifestInput = St(JSON.parse(S)) || null, console.info("Read client manifest from", E);
1734
1834
  } catch (S) {
1735
1835
  console.warn(
1736
1836
  `
1737
1837
  ==========
1738
- Could not read Qwik client manifest ${C}.
1838
+ Could not read Qwik client manifest ${E}.
1739
1839
  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__\`.
1740
1840
  Without the manifest, the SSR renderer will not be able to generate event handlers.
1741
1841
  (${S})
@@ -1744,40 +1844,40 @@ Without the manifest, the SSR renderer will not be able to generate event handle
1744
1844
  );
1745
1845
  }
1746
1846
  }
1747
- const p = y ? o.manifestInput : null;
1748
- let E = null;
1749
- return p?.manifestHash && (E = {
1750
- manifestHash: p.manifestHash,
1751
- core: p.core,
1752
- preloader: p.preloader,
1753
- qwikLoader: p.qwikLoader,
1754
- bundleGraphAsset: p.bundleGraphAsset,
1755
- injections: p.injections,
1756
- mapping: p.mapping,
1757
- bundleGraph: p.bundleGraph
1758
- }), E && JSON.stringify(E);
1759
- }
1760
- function nn(y) {
1847
+ const f = y ? o.manifestInput : null;
1848
+ let k = null;
1849
+ return f?.manifestHash && (k = {
1850
+ manifestHash: f.manifestHash,
1851
+ core: f.core,
1852
+ preloader: f.preloader,
1853
+ qwikLoader: f.qwikLoader,
1854
+ bundleGraphAsset: f.bundleGraphAsset,
1855
+ injections: f.injections,
1856
+ mapping: f.mapping,
1857
+ bundleGraph: f.bundleGraph
1858
+ }), k && JSON.stringify(k);
1859
+ }
1860
+ function Sn(y) {
1761
1861
  o.sourcemap = y;
1762
1862
  }
1763
- function rn(y, p) {
1764
- const E = y.name === "ssr";
1765
- M("hotUpdate()", p.file, y.name);
1766
- const P = E ? i : r;
1767
- for (const C of p.modules) {
1768
- const { id: S } = C;
1863
+ function kn(y, f) {
1864
+ const k = y.name === "ssr";
1865
+ O("hotUpdate()", f.file, y.name);
1866
+ const _ = k ? i : r;
1867
+ for (const E of f.modules) {
1868
+ const { id: S } = E;
1769
1869
  if (S) {
1770
- M("hotUpdate()", `invalidate ${S}`), n.delete(S);
1771
- for (const [q, [D, U]] of P)
1772
- if (U === S) {
1773
- M("hotUpdate()", `invalidate ${S} segment ${q}`), P.delete(q);
1774
- const L = y.moduleGraph.getModuleById(q);
1775
- L && y.moduleGraph.invalidateModule(L);
1870
+ O("hotUpdate()", `invalidate ${S}`), n.delete(S);
1871
+ for (const [L, [P, M]] of _)
1872
+ if (M === S) {
1873
+ O("hotUpdate()", `invalidate ${S} segment ${L}`), _.delete(L);
1874
+ const N = y.moduleGraph.getModuleById(L);
1875
+ N && y.moduleGraph.invalidateModule(N);
1776
1876
  }
1777
1877
  }
1778
1878
  }
1779
1879
  }
1780
- const on = (y, { getModuleInfo: p }) => {
1880
+ const En = (y, { getModuleInfo: f }) => {
1781
1881
  if (o.target === "client") {
1782
1882
  if (
1783
1883
  // The preloader has to stay in a separate chunk if it's a client build
@@ -1792,79 +1892,80 @@ Without the manifest, the SSR renderer will not be able to generate event handle
1792
1892
  if (/[/\\](core|qwik)[/\\]dist[/\\]qwikloader\.js$/.test(y))
1793
1893
  return "qwik-loader";
1794
1894
  }
1795
- const E = p(y);
1796
- if (E) {
1797
- const P = E.meta.segment;
1798
- if (P) {
1799
- if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(P.ctxName))
1895
+ const k = f(y);
1896
+ if (k) {
1897
+ const _ = k.meta.segment;
1898
+ if (_) {
1899
+ if (["qwikify$", "useVisibleTask$", "useComputed$"].includes(_.ctxName))
1800
1900
  return null;
1801
- const { hash: C } = P, S = o.entryStrategy.manual?.[C] || P.entry;
1901
+ const { hash: E } = _, S = o.entryStrategy.manual?.[E] || _.entry;
1802
1902
  if (S)
1803
1903
  return S;
1804
1904
  }
1805
1905
  }
1806
1906
  return null;
1807
1907
  };
1808
- async function sn(y, p, E, P) {
1809
- const S = await X(p).generateManifest(P);
1908
+ async function In(y, f, k, _) {
1909
+ const S = await pt(f).generateManifest(_);
1810
1910
  S.platform = {
1811
- ...P?.platform,
1911
+ ..._?.platform,
1812
1912
  rollup: y.meta?.rollupVersion || "",
1813
- env: I.sys.env,
1814
- os: I.sys.os
1815
- }, I.sys.env === "node" && (S.platform.node = process.versions.node);
1816
- const q = yn(S, E), D = y.emitFile({
1913
+ env: C.sys.env,
1914
+ os: C.sys.os
1915
+ }, C.sys.env === "node" && (S.platform.node = process.versions.node);
1916
+ const L = qn(S, k), P = y.emitFile({
1817
1917
  type: "asset",
1818
1918
  name: "bundle-graph.json",
1819
- source: JSON.stringify(q)
1820
- }), U = y.getFileName(D);
1821
- S.bundleGraphAsset = U, S.assets[U] = {
1919
+ source: JSON.stringify(L)
1920
+ }), M = y.getFileName(P);
1921
+ S.bundleGraphAsset = M, S.assets[M] = {
1822
1922
  name: "bundle-graph.json",
1823
- size: q.length
1923
+ size: L.length
1824
1924
  };
1825
- const L = JSON.stringify(S, null, " ");
1925
+ const N = JSON.stringify(S, null, " ");
1826
1926
  return y.emitFile({
1827
- fileName: Ve,
1927
+ fileName: rt,
1828
1928
  type: "asset",
1829
- source: L
1830
- }), typeof o.manifestOutput == "function" && await o.manifestOutput(S), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(ce()), S;
1929
+ source: N
1930
+ }), typeof o.manifestOutput == "function" && await o.manifestOutput(S), typeof o.transformedModuleOutput == "function" && await o.transformedModuleOutput(gt()), S;
1831
1931
  }
1832
1932
  return {
1833
- buildStart: k,
1834
- createOutputAnalyzer: X,
1835
- getQwikBuildModule: ve,
1836
- getOptimizer: h,
1837
- getOptions: te,
1838
- getPath: f,
1839
- getSys: d,
1840
- getTransformedOutputs: ce,
1841
- init: b,
1842
- load: F,
1843
- debug: M,
1844
- log: z,
1845
- normalizeOptions: T,
1846
- normalizePath: A,
1847
- onDiagnostics: de,
1848
- resolveId: O,
1849
- transform: K,
1850
- validateSource: j,
1851
- setSourceMapSupport: nn,
1852
- configureServer: w,
1853
- hotUpdate: rn,
1854
- manualChunks: on,
1855
- generateManifest: sn
1933
+ buildStart: I,
1934
+ createOutputAnalyzer: pt,
1935
+ getQwikBuildModule: mt,
1936
+ getOptimizer: d,
1937
+ getOptions: wn,
1938
+ getPath: p,
1939
+ getSys: u,
1940
+ getTransformedOutputs: gt,
1941
+ init: g,
1942
+ load: gn,
1943
+ debug: O,
1944
+ log: yn,
1945
+ normalizeOptions: K,
1946
+ normalizePath: Q,
1947
+ onDiagnostics: bn,
1948
+ resolveId: de,
1949
+ segmentCallbacks: l,
1950
+ transform: vn,
1951
+ validateSource: b,
1952
+ setSourceMapSupport: Sn,
1953
+ configureServer: R,
1954
+ hotUpdate: kn,
1955
+ manualChunks: En,
1956
+ generateManifest: In
1856
1957
  };
1857
1958
  }
1858
- const nr = (t) => (e) => typeof e == "string" ? Tn(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
1859
- function rr(t) {
1959
+ const Ir = (t) => (e) => typeof e == "string" ? Vn(t.os) ? (e.startsWith("\\\\?\\") || /[^\u0000-\u0080]+/.test(e) || (e = e.replace(/\\/g, "/")), t.path.posix.normalize(e)) : t.path.normalize(e) : e;
1960
+ function jt(t) {
1860
1961
  return t.isEntry || t.segment;
1861
1962
  }
1862
- const ir = (t) => t.startsWith("virtual:"), or = {
1963
+ const _r = (t) => t.startsWith("virtual:"), qt = {
1863
1964
  ".jsx": !0,
1864
1965
  ".ts": !0,
1865
1966
  ".tsx": !0
1866
- }, Zt = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", be = "@qwik.dev/core/internal", se = "@qwik.dev/core/build", ot = "@qwik.dev/core/jsx-runtime", st = "@qwik.dev/core/jsx-dev-runtime", He = "@qwik.dev/core/server", oe = "@qwik-client-manifest", Ze = "@qwik.dev/core/preloader", ke = "@qwik-handlers", sr = "src", _t = "dist", ar = "server", lr = "lib", Ve = "q-manifest.json", Ge = "__QWIK_MANIFEST__";
1867
- async function cr(t, e, n) {
1967
+ }, ct = /\.qwik\.[mc]?js$/, we = "@qwik.dev/core", ye = "@qwik.dev/core/internal", se = "@qwik.dev/core/build", dt = "@qwik.dev/core/jsx-runtime", ut = "@qwik.dev/core/jsx-dev-runtime", Ke = "@qwik.dev/core/server", oe = "@qwik-client-manifest", nt = "@qwik.dev/core/preloader", Ie = "@qwik-handlers", Cr = "src", Ut = "dist", Tr = "server", Pr = "lib", rt = "q-manifest.json", Je = "__QWIK_MANIFEST__";
1968
+ async function Nr(t, e, n) {
1868
1969
  if (t.env === "browsermain" || t.env === "webworker")
1869
1970
  return;
1870
1971
  const r = await t.dynamicImport("node:fs");
@@ -1875,14 +1976,14 @@ async function cr(t, e, n) {
1875
1976
  return await r.promises.access(s), r.promises.realpath(s);
1876
1977
  } catch {
1877
1978
  }
1878
- const a = t.path.dirname(i);
1879
- if (a === i)
1979
+ const l = t.path.dirname(i);
1980
+ if (l === i)
1880
1981
  break;
1881
- i = a;
1982
+ i = l;
1882
1983
  }
1883
1984
  }
1884
- function Wi(t = {}) {
1885
- const e = Xt(t.optimizerOptions);
1985
+ function ho(t = {}) {
1986
+ const e = un(t.optimizerOptions);
1886
1987
  return {
1887
1988
  name: "rollup-plugin-qwik",
1888
1989
  api: {
@@ -1892,8 +1993,8 @@ function Wi(t = {}) {
1892
1993
  async options(r) {
1893
1994
  await e.init();
1894
1995
  const i = r.onwarn;
1895
- r.onwarn = (l, c) => {
1896
- l.plugin === "typescript" && l.message.includes("outputToFilesystem") || (i ? i(l, c) : c(l));
1996
+ r.onwarn = (a, c) => {
1997
+ a.plugin === "typescript" && a.message.includes("outputToFilesystem") || (i ? i(a, c) : c(a));
1897
1998
  };
1898
1999
  const s = {
1899
2000
  csr: t.csr,
@@ -1914,81 +2015,81 @@ function Wi(t = {}) {
1914
2015
  experimental: t.experimental
1915
2016
  };
1916
2017
  await e.normalizeOptions(s);
1917
- const { input: a } = e.getOptions();
1918
- return r.input = a, r;
2018
+ const { input: l } = e.getOptions();
2019
+ return r.input = l, r;
1919
2020
  },
1920
2021
  outputOptions(r) {
1921
- return at(e, r, !1);
2022
+ return ft(
2023
+ e,
2024
+ r,
2025
+ e.getOptions().outDir
2026
+ );
1922
2027
  },
1923
2028
  async buildStart() {
1924
2029
  e.onDiagnostics((r, i, s) => {
1925
- r.forEach((a) => {
1926
- const l = e.normalizePath(i.sys.path.join(s, a.file));
1927
- a.category === "error" ? this.error(Je(l, a)) : this.warn(Je(l, a));
2030
+ r.forEach((l) => {
2031
+ const a = e.normalizePath(i.sys.path.join(s, l.file));
2032
+ l.category === "error" ? this.error(Ve(a, l)) : this.warn(Ve(a, l));
1928
2033
  });
1929
2034
  }), await e.buildStart(this);
1930
2035
  },
1931
2036
  resolveId(r, i) {
1932
- return ae(r) ? null : e.resolveId(this, r, i);
2037
+ return ne(r) ? null : e.resolveId(this, r, i);
1933
2038
  },
1934
2039
  load(r) {
1935
- return ae(r) ? null : e.load(this, r);
2040
+ return ne(r) ? null : e.load(this, r);
1936
2041
  },
1937
2042
  transform(r, i) {
1938
- return ae(i) ? null : e.transform(this, r, i);
2043
+ return ne(i) ? null : e.transform(this, r, i);
1939
2044
  },
1940
2045
  async generateBundle(r, i) {
1941
2046
  e.getOptions().target === "client" && await e.generateManifest(this, i);
1942
2047
  }
1943
2048
  };
1944
2049
  }
1945
- async function dr(t, e, n, r) {
2050
+ async function Dr(t, e) {
1946
2051
  return Array.isArray(e) ? (e.length || e.push({}), await Promise.all(
1947
- e.map(async (i) => ({
1948
- ...await at(t, i, n),
1949
- dir: r || i.dir
1950
- }))
1951
- )) : {
1952
- ...await at(t, e, n),
1953
- dir: r || e?.dir
1954
- };
2052
+ e.map(
2053
+ (n) => ft(t, n)
2054
+ )
2055
+ )) : ft(t, e);
1955
2056
  }
1956
- const ur = (t) => t ? `${t.replace(/\/+$/, "")}/` : "", hr = (t) => `${ur(t)}build/`, fr = (t, e, n) => {
1957
- const r = hr(t);
2057
+ const Rr = (t) => "", Lr = (t) => `${Rr()}build/`, Or = (t, e, n) => {
2058
+ const r = Lr();
1958
2059
  return e.buildMode === "production" && !e.debug ? `${r}q-[hash].js` : (i) => {
1959
- if (i.moduleIds?.some((l) => /core\.(prod|min)\.mjs$/.test(l)))
2060
+ if (i.moduleIds?.some((a) => /core\.(prod|min)\.mjs$/.test(a)))
1960
2061
  return `${r}core.js`;
1961
- if (i.moduleIds?.some((l) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(l)))
2062
+ if (i.moduleIds?.some((a) => /qwik-router\/lib\/index\.qwik\.mjs$/.test(a)))
1962
2063
  return `${r}qwik-router.js`;
1963
- const a = n.sys.path.relative(n.sys.cwd(), i.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
1964
- return `${r}${a}.js`;
2064
+ const l = n.sys.path.relative(n.sys.cwd(), i.name).replace(/^(\.\.\/)+/, "").replace(/^\/+/, "").replace(/\//g, "-");
2065
+ return `${r}${l}.js`;
1965
2066
  };
1966
2067
  };
1967
- async function at(t, e, n) {
1968
- const r = { ...e }, i = t.getOptions(), s = t.getOptimizer(), a = t.manualChunks;
1969
- r.assetFileNames || (r.assetFileNames = `${n ? `${i.assetsDir}/` : ""}assets/[hash]-[name].[ext]`);
1970
- const l = fr(n ? `${i.assetsDir}` : "", i, s);
2068
+ async function ft(t, e, n) {
2069
+ const r = { ...e }, i = t.getOptions(), s = t.getOptimizer(), l = t.manualChunks;
2070
+ r.assetFileNames || (r.assetFileNames = "assets/[hash]-[name].[ext]");
2071
+ const a = Or("", i, s);
1971
2072
  if (i.target === "client") {
1972
- r.entryFileNames || (r.entryFileNames = l), r.chunkFileNames || (r.chunkFileNames = l), r.format = "es";
1973
- const o = r.manualChunks;
1974
- if (o && typeof o != "function")
2073
+ r.entryFileNames || (r.entryFileNames = a), r.chunkFileNames || (r.chunkFileNames = a), r.format = "es";
2074
+ const h = r.manualChunks;
2075
+ if (h && typeof h != "function")
1975
2076
  throw new Error("manualChunks must be a function");
1976
- r.manualChunks = o ? (g, m) => o(g, m) || a(g, m) : a;
2077
+ r.manualChunks = h ? (o, w) => h(o, w) || l(o, w) : l;
1977
2078
  } else
1978
- r.chunkFileNames || (r.chunkFileNames = l);
1979
- r.dir || (r.dir = i.outDir), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
1980
- const c = await cr(s.sys, "rollup", s.sys.cwd());
2079
+ r.chunkFileNames || (r.chunkFileNames = a);
2080
+ !r.dir && n && (r.dir = n), r.format === "cjs" && typeof r.exports != "string" && (r.exports = "auto"), r.hoistTransitiveImports = !1;
2081
+ const c = await Nr(s.sys, "rollup", s.sys.cwd());
1981
2082
  if (c)
1982
2083
  try {
1983
- const g = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), m = JSON.parse(g), b = String(m?.version || ""), [h, d, f] = b.split(".").map((w) => parseInt(w, 10));
1984
- Number.isFinite(h) && (h > 4 || h === 4 && (d > 52 || d === 52 && (f || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
1985
- `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${b}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
2084
+ const o = await (await s.sys.dynamicImport("node:fs")).promises.readFile(c, "utf-8"), w = JSON.parse(o), v = String(w?.version || ""), [g, d, u] = v.split(".").map((x) => parseInt(x, 10));
2085
+ Number.isFinite(g) && (g > 4 || g === 4 && (d > 52 || d === 52 && (u || 0) >= 0)) ? r.onlyExplicitManualChunks = !0 : console.warn(
2086
+ `⚠️ We detected that you're using a Rollup version prior to 4.52.0 (${v}). For the latest and greatest, we recommend to let Vite install the latest version for you, or manually install the latest version of Rollup in your project if that doesn't work. It will enable the new Rollup \`outputOpts.onlyExplicitManualChunks\` feature flag, which improves preloading performance and reduces cache invalidation for a snappier user experience.`
1986
2087
  );
1987
2088
  } catch {
1988
2089
  }
1989
2090
  return r;
1990
2091
  }
1991
- function Je(t, e) {
2092
+ function Ve(t, e) {
1992
2093
  const n = e.highlights?.[0];
1993
2094
  return Object.assign(new Error(e.message), {
1994
2095
  id: t,
@@ -2000,7 +2101,7 @@ function Je(t, e) {
2000
2101
  stack: ""
2001
2102
  });
2002
2103
  }
2003
- const pr = `"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'"))`, gr = 'if("undefined"!=typeof document){const e=()=>{const e="data-qwik-inspector",t=globalThis.__HOTKEYS__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', mr = `if("undefined"!=typeof HTMLElement){class e extends HTMLElement{get _root(){return this.shadowRoot||this}constructor(){super(),this.state={},this.props||(this.props={}),this.componentProps=["children","error"],this.nodesToDestroy=[],this.pendingUpdate=!1,this.attachShadow({mode:"open"})}destroyAnyNodes(){this.nodesToDestroy.forEach(e=>e.remove()),this.nodesToDestroy=[]}connectedCallback(){this.getAttributeNames().forEach(e=>{const t=e.replace(/-/g,""),o=new RegExp(t,"i");this.componentProps.forEach(t=>{if(o.test(t)){const o=this.getAttribute(e);this.props[t]!==o&&(this.props[t]=o)}})}),this._root.innerHTML='\\n\\n <template data-el="show-errored-host">\\n <div class="error">\\n <template data-el="div-errored-host-2">\\n \\x3c!-- String(props.error) --\\x3e\\n </template>\\n </div>\\n </template>\\n\\n <div class="arrow">👇 Uncaught error happened here 👇\\n <span class="dev-tools">DevTools: Cmd+Alt+I</span>\\n </div>\\n <div class="div">\\n <slot></slot>\\n </div>\\n\\n <style>\\n .error {\\n border-radius: 5px 5px 0px 0;\\n background: black;\\n color: white;\\n font-family: monospace;\\n font-size: 12px;\\n margin: 0;\\n padding: 10px;\\n }\\n .arrow {\\n background: #f47e81;\\n color: black;\\n font-size: 14px;\\n padding: 10px;\\n text-align: center;\\n font-family: sans-serif;\\n }\\n .dev-tools {\\n background: red;\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-weight: 800;\\n }\\n .div {\\n outline: 5px solid red;\\n border-radius: 10px;\\n }\\n </style>',this.pendingUpdate=!0,this.render(),this.onMount(),this.pendingUpdate=!1,this.update()}showContent(e){const t=e.content.cloneNode(!0);Array.from(t.childNodes).forEach(t=>{e?.scope&&(t.scope=e.scope),e?.context&&(t.context=e.context),this.nodesToDestroy.push(t)}),e.after(t)}onMount(){}onUpdate(){}update(){!0!==this.pendingUpdate&&(this.pendingUpdate=!0,this.render(),this.onUpdate(),this.pendingUpdate=!1)}render(){this.destroyAnyNodes(),this.updateBindings()}updateBindings(){this._root.querySelectorAll("[data-el='show-errored-host']").forEach(e=>{this.props.error&&this.showContent(e)}),this._root.querySelectorAll("[data-el='div-errored-host-2']").forEach(e=>{this.renderTextNode(e,String(this.props.error))})}renderTextNode(e,t){const o=document.createTextNode(t);e?.scope&&(o.scope=e.scope),e?.context&&(o.context=e.context),e.after(o),this.nodesToDestroy.push(e.nextSibling)}}customElements.define("errored-host",e),document.addEventListener("qerror",e=>{const t=customElements.get("vite-error-overlay");if(!t)return;const o=new t(e.detail.error);document.body.appendChild(o)})}`, wr = '[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}', br = '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)}', vr = `<style>
2104
+ const Mr = `"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__,o=globalThis.__BASE__;let n=document.querySelector("#qwik-inspector-info-popup");n||(n=document.createElement("div"),n.id="qwik-inspector-info-popup",n["aria-hidden"]="true",document.body.appendChild(n)),n.textContent=`Click-to-Source: ${t.join(" + ")}`,console.debug("%c🔍 Qwik Click-To-Source","background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;",`Hold-press the \'${t.join(" + ")}\' key${t.length>1?"s":""} and click a component to jump directly to the source code in your IDE!`),window.__qwik_inspector_state={pressedKeys:new Set};const r=document.body,i=document.createElement("div");function s(t){return t&&t instanceof Element?t.closest(`[${e}]`):null}function d(){const e=window.__qwik_inspector_state.hoveredElement;if(e&&c()){const t=e.getBoundingClientRect();i.style.setProperty("height",t.height+"px"),i.style.setProperty("width",t.width+"px"),i.style.setProperty("top",t.top+"px"),i.style.setProperty("left",t.left+"px"),i.style.setProperty("visibility","visible"),r.style.setProperty("cursor","pointer")}else i.style.setProperty("height","0px"),i.style.setProperty("width","0px"),i.style.setProperty("visibility","hidden"),r.style.removeProperty("cursor")}function c(){return function(){const e=Array.from(window.__qwik_inspector_state.pressedKeys).map(e=>e?e.replace(/(Left|Right)$/g,""):void 0);return t.every(t=>e.includes(t))}()}i.id="qwik-inspector-overlay",i.setAttribute("aria-hidden","true"),r.appendChild(i),document.addEventListener("keydown",e=>{window.__qwik_inspector_state.pressedKeys.add(e.code),d()},{capture:!0}),document.addEventListener("keyup",e=>{window.__qwik_inspector_state.pressedKeys.delete(e.code),d()},{capture:!0}),window.addEventListener("blur",()=>{window.__qwik_inspector_state.pressedKeys.clear(),d()},{capture:!0}),document.addEventListener("mouseover",e=>{const t=s(e.target);window.__qwik_inspector_state.hoveredElement=t||void 0,d()},{capture:!0}),document.addEventListener("click",t=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();const n=s(t.target);if(n){t.preventDefault(),t.stopPropagation();const i=n.getAttribute(e);if("false"!==i){r.style.setProperty("cursor","progress");const e=i.match(/^(.*?)(:\\d+(:\\d+)?)?$/);if(e){const[,t,n]=e;fetch(`${o}${t}?editor${n}`,{cache:"no-cache"}).then(e=>{r.style.removeProperty("cursor"),e.blob()})}}}}},{capture:!0}),document.addEventListener("contextmenu",e=>{if(c()){window.__qwik_inspector_state.pressedKeys.clear();s(e.target)&&e.preventDefault()}},{capture:!0}),window.addEventListener("resize",d),document.addEventListener("scroll",d)};document.addEventListener("DOMContentLoaded",e)}', jr = `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)})}`, qr = '[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}', Ur = '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)}', Br = `<style>
2004
2105
  :host {
2005
2106
  position: absolute;
2006
2107
  border: 1px solid red;
@@ -2164,32 +2265,32 @@ const pr = `"undefined"==typeof window||window.__qwikViteLog||(window.__qwikVite
2164
2265
  <p class="action-container"></p>
2165
2266
  </div>
2166
2267
  </dialog>
2167
- `, yr = `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}`, xr = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
2168
- async function kr(t, e, n, r) {
2169
- const i = await n.dynamicImport("node:fs"), s = await n.dynamicImport("node:url"), l = ["mjs", "cjs", "js"].map(
2268
+ `, Fr = `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}`, Ar = "#qwik-inspector-overlay{position:fixed;background:#18b6f645;pointer-events:none;box-sizing:border-box;border:2px solid rgba(172,126,244,.46);border-radius:4px;contain:strict;cursor:pointer;z-index:999999}#qwik-inspector-info-popup{position:fixed;bottom:10px;right:10px;font-family:monospace;background:#000000c2;color:#fff;padding:10px 20px;border-radius:8px;box-shadow:0 20px 25px -5px #00000057,0 8px 10px -6px #0000003d;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);-webkit-animation:fadeOut .3s 3s ease-in-out forwards;animation:fadeOut .3s 3s ease-in-out forwards;z-index:999999;contain:layout}#qwik-inspector-info-popup p{margin:0}@-webkit-keyframes fadeOut{0%{opacity:1}to{opacity:0}}@keyframes fadeOut{0%{opacity:1}to{opacity:0;visibility:hidden}}";
2269
+ async function zr(t, e, n, r) {
2270
+ const i = await n.dynamicImport("node:fs"), s = await n.dynamicImport("node:url"), a = ["mjs", "cjs", "js"].map(
2170
2271
  (c) => r.join(e, `entry.preview.${c}`)
2171
2272
  ).find((c) => i.existsSync(c));
2172
- if (!l)
2173
- return et(
2273
+ if (!a)
2274
+ return it(
2174
2275
  t,
2175
2276
  `Unable to find output "${e}/entry.preview" module.
2176
2277
 
2177
2278
  Please ensure "src/entry.preview.tsx" has been built before the "preview" command.`
2178
2279
  );
2179
2280
  try {
2180
- const c = s.pathToFileURL(l).href, o = await n.strictDynamicImport(c);
2181
- let g = null;
2182
- if (o.default && (typeof o.default == "function" ? g = o.default : typeof o.default == "object" && (g = o.default.router)), typeof g != "function")
2183
- return et(
2281
+ const c = s.pathToFileURL(a).href, h = await n.strictDynamicImport(c);
2282
+ let o = null;
2283
+ if (h.default && (typeof h.default == "function" ? o = h.default : typeof h.default == "object" && (o = h.default.router)), typeof o != "function")
2284
+ return it(
2184
2285
  t,
2185
- `Entry preview module "${l}" does not export a default middleware function`
2286
+ `Entry preview module "${a}" does not export a default middleware function`
2186
2287
  );
2187
- t.use(g);
2288
+ t.use(o);
2188
2289
  } catch (c) {
2189
- return et(t, String(c));
2290
+ return it(t, String(c));
2190
2291
  }
2191
2292
  }
2192
- function et(t, e) {
2293
+ function it(t, e) {
2193
2294
  console.log(`
2194
2295
  ❌ ${e}
2195
2296
  `), t.use((n, r) => {
@@ -2198,25 +2299,25 @@ function et(t, e) {
2198
2299
  }), r.end(e);
2199
2300
  });
2200
2301
  }
2201
- const Er = (t, e) => {
2302
+ const Wr = (t, e) => {
2202
2303
  const n = [
2203
- { tag: "style", children: yr, injectTo: "body" },
2204
- { tag: "style", children: xr, injectTo: "body" },
2205
- { tag: "script", attrs: { type: "module" }, children: mr, injectTo: "body" },
2206
- { tag: "script", attrs: { type: "module" }, children: pr, injectTo: "body" }
2304
+ { tag: "style", children: Fr, injectTo: "body" },
2305
+ { tag: "style", children: Ar, injectTo: "body" },
2306
+ { tag: "script", attrs: { type: "module" }, children: jr, injectTo: "body" },
2307
+ { tag: "script", attrs: { type: "module" }, children: Mr, injectTo: "body" }
2207
2308
  ];
2208
2309
  if ((t.devTools?.imageDevTools ?? !0) && n.push(
2209
2310
  {
2210
2311
  tag: "style",
2211
- children: wr,
2312
+ children: qr,
2212
2313
  injectTo: "body"
2213
2314
  },
2214
2315
  {
2215
2316
  tag: "script",
2216
2317
  attrs: { type: "module" },
2217
- children: br.replace(
2318
+ children: Ur.replace(
2218
2319
  "globalThis.__TEMPLATE__",
2219
- JSON.stringify(vr)
2320
+ JSON.stringify(Br)
2220
2321
  ),
2221
2322
  injectTo: "body"
2222
2323
  }
@@ -2225,7 +2326,7 @@ const Er = (t, e) => {
2225
2326
  e.endsWith("/") && (e = e.slice(0, -1)), n.push({
2226
2327
  tag: "script",
2227
2328
  attrs: { type: "module" },
2228
- children: gr.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
2329
+ children: $r.replace("globalThis.__HOTKEYS__", JSON.stringify(r)).replace("globalThis.__BASE__", JSON.stringify(e)),
2229
2330
  injectTo: "body"
2230
2331
  });
2231
2332
  }
@@ -2234,167 +2335,167 @@ const Er = (t, e) => {
2234
2335
  function H(t) {
2235
2336
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2236
2337
  }
2237
- var Ee = {}, tt = {}, Ct;
2338
+ var _e = {}, ot = {}, Bt;
2238
2339
  function G() {
2239
- return Ct || (Ct = 1, (function(t) {
2340
+ return Bt || (Bt = 1, (function(t) {
2240
2341
  Object.defineProperty(t, "__esModule", { value: !0 }), t.findBox = t.readUInt = t.readUInt32LE = t.readUInt32BE = t.readInt32LE = t.readUInt24LE = t.readUInt16LE = t.readUInt16BE = t.readInt16LE = t.toHexString = t.toUTF8String = void 0;
2241
- const e = new TextDecoder(), n = (f, u = 0, w = f.length) => e.decode(f.slice(u, w));
2342
+ const e = new TextDecoder(), n = (u, p = 0, x = u.length) => e.decode(u.slice(p, x));
2242
2343
  t.toUTF8String = n;
2243
- const r = (f, u = 0, w = f.length) => f.slice(u, w).reduce((T, Y) => T + ("0" + Y.toString(16)).slice(-2), "");
2344
+ const r = (u, p = 0, x = u.length) => u.slice(p, x).reduce((R, K) => R + ("0" + K.toString(16)).slice(-2), "");
2244
2345
  t.toHexString = r;
2245
- const i = (f, u = 0) => {
2246
- const w = f[u] + f[u + 1] * 256;
2247
- return w | (w & 2 ** 15) * 131070;
2346
+ const i = (u, p = 0) => {
2347
+ const x = u[p] + u[p + 1] * 256;
2348
+ return x | (x & 2 ** 15) * 131070;
2248
2349
  };
2249
2350
  t.readInt16LE = i;
2250
- const s = (f, u = 0) => f[u] * 2 ** 8 + f[u + 1];
2351
+ const s = (u, p = 0) => u[p] * 2 ** 8 + u[p + 1];
2251
2352
  t.readUInt16BE = s;
2252
- const a = (f, u = 0) => f[u] + f[u + 1] * 2 ** 8;
2253
- t.readUInt16LE = a;
2254
- const l = (f, u = 0) => f[u] + f[u + 1] * 2 ** 8 + f[u + 2] * 2 ** 16;
2255
- t.readUInt24LE = l;
2256
- const c = (f, u = 0) => f[u] + f[u + 1] * 2 ** 8 + f[u + 2] * 2 ** 16 + (f[u + 3] << 24);
2353
+ const l = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8;
2354
+ t.readUInt16LE = l;
2355
+ const a = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16;
2356
+ t.readUInt24LE = a;
2357
+ const c = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + (u[p + 3] << 24);
2257
2358
  t.readInt32LE = c;
2258
- const o = (f, u = 0) => f[u] * 2 ** 24 + f[u + 1] * 2 ** 16 + f[u + 2] * 2 ** 8 + f[u + 3];
2259
- t.readUInt32BE = o;
2260
- const g = (f, u = 0) => f[u] + f[u + 1] * 2 ** 8 + f[u + 2] * 2 ** 16 + f[u + 3] * 2 ** 24;
2261
- t.readUInt32LE = g;
2262
- const m = {
2359
+ const h = (u, p = 0) => u[p] * 2 ** 24 + u[p + 1] * 2 ** 16 + u[p + 2] * 2 ** 8 + u[p + 3];
2360
+ t.readUInt32BE = h;
2361
+ const o = (u, p = 0) => u[p] + u[p + 1] * 2 ** 8 + u[p + 2] * 2 ** 16 + u[p + 3] * 2 ** 24;
2362
+ t.readUInt32LE = o;
2363
+ const w = {
2263
2364
  readUInt16BE: t.readUInt16BE,
2264
2365
  readUInt16LE: t.readUInt16LE,
2265
2366
  readUInt32BE: t.readUInt32BE,
2266
2367
  readUInt32LE: t.readUInt32LE
2267
2368
  };
2268
- function b(f, u, w, T) {
2269
- w = w || 0;
2270
- const Y = T ? "BE" : "LE", j = "readUInt" + u + Y;
2271
- return m[j](f, w);
2272
- }
2273
- t.readUInt = b;
2274
- function h(f, u) {
2275
- if (f.length - u < 4)
2369
+ function v(u, p, x, R) {
2370
+ x = x || 0;
2371
+ const K = R ? "BE" : "LE", m = "readUInt" + p + K;
2372
+ return w[m](u, x);
2373
+ }
2374
+ t.readUInt = v;
2375
+ function g(u, p) {
2376
+ if (u.length - p < 4)
2276
2377
  return;
2277
- const w = (0, t.readUInt32BE)(f, u);
2278
- if (!(f.length - u < w))
2378
+ const x = (0, t.readUInt32BE)(u, p);
2379
+ if (!(u.length - p < x))
2279
2380
  return {
2280
- name: (0, t.toUTF8String)(f, 4 + u, 8 + u),
2281
- offset: u,
2282
- size: w
2381
+ name: (0, t.toUTF8String)(u, 4 + p, 8 + p),
2382
+ offset: p,
2383
+ size: x
2283
2384
  };
2284
2385
  }
2285
- function d(f, u, w) {
2286
- for (; w < f.length; ) {
2287
- const T = h(f, w);
2288
- if (!T)
2386
+ function d(u, p, x) {
2387
+ for (; x < u.length; ) {
2388
+ const R = g(u, x);
2389
+ if (!R)
2289
2390
  break;
2290
- if (T.name === u)
2291
- return T;
2292
- w += T.size > 0 ? T.size : 8;
2391
+ if (R.name === p)
2392
+ return R;
2393
+ x += R.size > 0 ? R.size : 8;
2293
2394
  }
2294
2395
  }
2295
2396
  t.findBox = d;
2296
- })(tt)), tt;
2397
+ })(ot)), ot;
2297
2398
  }
2298
- var Tt;
2299
- function Sr() {
2300
- if (Tt) return Ee;
2301
- Tt = 1, Object.defineProperty(Ee, "__esModule", { value: !0 }), Ee.BMP = void 0;
2399
+ var Ft;
2400
+ function Hr() {
2401
+ if (Ft) return _e;
2402
+ Ft = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.BMP = void 0;
2302
2403
  const t = G();
2303
- return Ee.BMP = {
2404
+ return _e.BMP = {
2304
2405
  validate: (e) => (0, t.toUTF8String)(e, 0, 2) === "BM",
2305
2406
  calculate: (e) => ({
2306
2407
  height: Math.abs((0, t.readInt32LE)(e, 22)),
2307
2408
  width: (0, t.readUInt32LE)(e, 18)
2308
2409
  })
2309
- }, Ee;
2310
- }
2311
- var Ir = Sr();
2312
- const _r = /* @__PURE__ */ H(Ir);
2313
- var Se = {}, Ie = {}, Pt;
2314
- function Vt() {
2315
- if (Pt) return Ie;
2316
- Pt = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.ICO = void 0;
2410
+ }, _e;
2411
+ }
2412
+ var Gr = Hr();
2413
+ const Qr = /* @__PURE__ */ H(Gr);
2414
+ var Ce = {}, Te = {}, At;
2415
+ function fn() {
2416
+ if (At) return Te;
2417
+ At = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.ICO = void 0;
2317
2418
  const t = G(), e = 1, n = 6, r = 16;
2318
- function i(a, l) {
2319
- const c = a[l];
2419
+ function i(l, a) {
2420
+ const c = l[a];
2320
2421
  return c === 0 ? 256 : c;
2321
2422
  }
2322
- function s(a, l) {
2323
- const c = n + l * r;
2423
+ function s(l, a) {
2424
+ const c = n + a * r;
2324
2425
  return {
2325
- height: i(a, c + 1),
2326
- width: i(a, c)
2426
+ height: i(l, c + 1),
2427
+ width: i(l, c)
2327
2428
  };
2328
2429
  }
2329
- return Ie.ICO = {
2330
- validate(a) {
2331
- const l = (0, t.readUInt16LE)(a, 0), c = (0, t.readUInt16LE)(a, 4);
2332
- return l !== 0 || c === 0 ? !1 : (0, t.readUInt16LE)(a, 2) === e;
2430
+ return Te.ICO = {
2431
+ validate(l) {
2432
+ const a = (0, t.readUInt16LE)(l, 0), c = (0, t.readUInt16LE)(l, 4);
2433
+ return a !== 0 || c === 0 ? !1 : (0, t.readUInt16LE)(l, 2) === e;
2333
2434
  },
2334
- calculate(a) {
2335
- const l = (0, t.readUInt16LE)(a, 4), c = s(a, 0);
2336
- if (l === 1)
2435
+ calculate(l) {
2436
+ const a = (0, t.readUInt16LE)(l, 4), c = s(l, 0);
2437
+ if (a === 1)
2337
2438
  return c;
2338
- const o = [c];
2339
- for (let g = 1; g < l; g += 1)
2340
- o.push(s(a, g));
2439
+ const h = [c];
2440
+ for (let o = 1; o < a; o += 1)
2441
+ h.push(s(l, o));
2341
2442
  return {
2342
2443
  height: c.height,
2343
- images: o,
2444
+ images: h,
2344
2445
  width: c.width
2345
2446
  };
2346
2447
  }
2347
- }, Ie;
2448
+ }, Te;
2348
2449
  }
2349
- var Nt;
2350
- function Cr() {
2351
- if (Nt) return Se;
2352
- Nt = 1, Object.defineProperty(Se, "__esModule", { value: !0 }), Se.CUR = void 0;
2353
- const t = Vt(), e = G(), n = 2;
2354
- return Se.CUR = {
2450
+ var zt;
2451
+ function Kr() {
2452
+ if (zt) return Ce;
2453
+ zt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.CUR = void 0;
2454
+ const t = fn(), e = G(), n = 2;
2455
+ return Ce.CUR = {
2355
2456
  validate(r) {
2356
2457
  const i = (0, e.readUInt16LE)(r, 0), s = (0, e.readUInt16LE)(r, 4);
2357
2458
  return i !== 0 || s === 0 ? !1 : (0, e.readUInt16LE)(r, 2) === n;
2358
2459
  },
2359
2460
  calculate: (r) => t.ICO.calculate(r)
2360
- }, Se;
2361
- }
2362
- var Tr = Cr();
2363
- const Pr = /* @__PURE__ */ H(Tr);
2364
- var _e = {}, Dt;
2365
- function Nr() {
2366
- if (Dt) return _e;
2367
- Dt = 1, Object.defineProperty(_e, "__esModule", { value: !0 }), _e.DDS = void 0;
2461
+ }, Ce;
2462
+ }
2463
+ var Jr = Kr();
2464
+ const Yr = /* @__PURE__ */ H(Jr);
2465
+ var Pe = {}, Wt;
2466
+ function Xr() {
2467
+ if (Wt) return Pe;
2468
+ Wt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.DDS = void 0;
2368
2469
  const t = G();
2369
- return _e.DDS = {
2470
+ return Pe.DDS = {
2370
2471
  validate: (e) => (0, t.readUInt32LE)(e, 0) === 542327876,
2371
2472
  calculate: (e) => ({
2372
2473
  height: (0, t.readUInt32LE)(e, 12),
2373
2474
  width: (0, t.readUInt32LE)(e, 16)
2374
2475
  })
2375
- }, _e;
2476
+ }, Pe;
2376
2477
  }
2377
- var Dr = Nr();
2378
- const Lr = /* @__PURE__ */ H(Dr);
2379
- var Ce = {}, Lt;
2380
- function Or() {
2381
- if (Lt) return Ce;
2382
- Lt = 1, Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.GIF = void 0;
2478
+ var Zr = Xr();
2479
+ const Vr = /* @__PURE__ */ H(Zr);
2480
+ var Ne = {}, Ht;
2481
+ function ei() {
2482
+ if (Ht) return Ne;
2483
+ Ht = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.GIF = void 0;
2383
2484
  const t = G(), e = /^GIF8[79]a/;
2384
- return Ce.GIF = {
2485
+ return Ne.GIF = {
2385
2486
  validate: (n) => e.test((0, t.toUTF8String)(n, 0, 6)),
2386
2487
  calculate: (n) => ({
2387
2488
  height: (0, t.readUInt16LE)(n, 8),
2388
2489
  width: (0, t.readUInt16LE)(n, 6)
2389
2490
  })
2390
- }, Ce;
2491
+ }, Ne;
2391
2492
  }
2392
- var Rr = Or();
2393
- const Mr = /* @__PURE__ */ H(Rr);
2394
- var Te = {}, Ot;
2395
- function jr() {
2396
- if (Ot) return Te;
2397
- Ot = 1, Object.defineProperty(Te, "__esModule", { value: !0 }), Te.ICNS = void 0;
2493
+ var ti = ei();
2494
+ const ni = /* @__PURE__ */ H(ti);
2495
+ var De = {}, Gt;
2496
+ function ri() {
2497
+ if (Gt) return De;
2498
+ Gt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.ICNS = void 0;
2398
2499
  const t = G(), e = 8, n = 4, r = 4, i = {
2399
2500
  ICON: 32,
2400
2501
  "ICN#": 32,
@@ -2437,61 +2538,61 @@ function jr() {
2437
2538
  // . => 1024 x 1024
2438
2539
  ic10: 1024
2439
2540
  };
2440
- function s(l, c) {
2441
- const o = c + r;
2541
+ function s(a, c) {
2542
+ const h = c + r;
2442
2543
  return [
2443
- (0, t.toUTF8String)(l, c, o),
2444
- (0, t.readUInt32BE)(l, o)
2544
+ (0, t.toUTF8String)(a, c, h),
2545
+ (0, t.readUInt32BE)(a, h)
2445
2546
  ];
2446
2547
  }
2447
- function a(l) {
2448
- const c = i[l];
2449
- return { width: c, height: c, type: l };
2548
+ function l(a) {
2549
+ const c = i[a];
2550
+ return { width: c, height: c, type: a };
2450
2551
  }
2451
- return Te.ICNS = {
2452
- validate: (l) => (0, t.toUTF8String)(l, 0, 4) === "icns",
2453
- calculate(l) {
2454
- const c = l.length, o = (0, t.readUInt32BE)(l, n);
2455
- let g = e, m = s(l, g), b = a(m[0]);
2456
- if (g += m[1], g === o)
2457
- return b;
2458
- const h = {
2459
- height: b.height,
2460
- images: [b],
2461
- width: b.width
2552
+ return De.ICNS = {
2553
+ validate: (a) => (0, t.toUTF8String)(a, 0, 4) === "icns",
2554
+ calculate(a) {
2555
+ const c = a.length, h = (0, t.readUInt32BE)(a, n);
2556
+ let o = e, w = s(a, o), v = l(w[0]);
2557
+ if (o += w[1], o === h)
2558
+ return v;
2559
+ const g = {
2560
+ height: v.height,
2561
+ images: [v],
2562
+ width: v.width
2462
2563
  };
2463
- for (; g < o && g < c; )
2464
- m = s(l, g), b = a(m[0]), g += m[1], h.images.push(b);
2465
- return h;
2564
+ for (; o < h && o < c; )
2565
+ w = s(a, o), v = l(w[0]), o += w[1], g.images.push(v);
2566
+ return g;
2466
2567
  }
2467
- }, Te;
2568
+ }, De;
2468
2569
  }
2469
- var $r = jr();
2470
- const Ur = /* @__PURE__ */ H($r);
2471
- var qr = Vt();
2472
- const Br = /* @__PURE__ */ H(qr);
2473
- var Pe = {}, Rt;
2474
- function Fr() {
2475
- if (Rt) return Pe;
2476
- Rt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.J2C = void 0;
2570
+ var ii = ri();
2571
+ const oi = /* @__PURE__ */ H(ii);
2572
+ var si = fn();
2573
+ const ai = /* @__PURE__ */ H(si);
2574
+ var Re = {}, Qt;
2575
+ function li() {
2576
+ if (Qt) return Re;
2577
+ Qt = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.J2C = void 0;
2477
2578
  const t = G();
2478
- return Pe.J2C = {
2579
+ return Re.J2C = {
2479
2580
  // TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
2480
2581
  validate: (e) => (0, t.readUInt32BE)(e, 0) === 4283432785,
2481
2582
  calculate: (e) => ({
2482
2583
  height: (0, t.readUInt32BE)(e, 12),
2483
2584
  width: (0, t.readUInt32BE)(e, 8)
2484
2585
  })
2485
- }, Pe;
2586
+ }, Re;
2486
2587
  }
2487
- var Ar = Fr();
2488
- const zr = /* @__PURE__ */ H(Ar);
2489
- var Ne = {}, Mt;
2490
- function Wr() {
2491
- if (Mt) return Ne;
2492
- Mt = 1, Object.defineProperty(Ne, "__esModule", { value: !0 }), Ne.JP2 = void 0;
2588
+ var ci = li();
2589
+ const di = /* @__PURE__ */ H(ci);
2590
+ var Le = {}, Kt;
2591
+ function ui() {
2592
+ if (Kt) return Le;
2593
+ Kt = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.JP2 = void 0;
2493
2594
  const t = G();
2494
- return Ne.JP2 = {
2595
+ return Le.JP2 = {
2495
2596
  validate(e) {
2496
2597
  if ((0, t.toUTF8String)(e, 4, 8) !== "jP ")
2497
2598
  return !1;
@@ -2507,77 +2608,77 @@ function Wr() {
2507
2608
  };
2508
2609
  throw new TypeError("Unsupported JPEG 2000 format");
2509
2610
  }
2510
- }, Ne;
2611
+ }, Le;
2511
2612
  }
2512
- var Hr = Wr();
2513
- const Gr = /* @__PURE__ */ H(Hr);
2514
- var De = {}, jt;
2515
- function Qr() {
2516
- if (jt) return De;
2517
- jt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.JPG = void 0;
2518
- const t = G(), e = "45786966", n = 2, r = 6, i = 2, s = "4d4d", a = "4949", l = 12, c = 2;
2519
- function o(d) {
2613
+ var fi = ui();
2614
+ const hi = /* @__PURE__ */ H(fi);
2615
+ var Oe = {}, Jt;
2616
+ function pi() {
2617
+ if (Jt) return Oe;
2618
+ Jt = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.JPG = void 0;
2619
+ const t = G(), e = "45786966", n = 2, r = 6, i = 2, s = "4d4d", l = "4949", a = 12, c = 2;
2620
+ function h(d) {
2520
2621
  return (0, t.toHexString)(d, 2, 6) === e;
2521
2622
  }
2522
- function g(d, f) {
2623
+ function o(d, u) {
2523
2624
  return {
2524
- height: (0, t.readUInt16BE)(d, f),
2525
- width: (0, t.readUInt16BE)(d, f + 2)
2625
+ height: (0, t.readUInt16BE)(d, u),
2626
+ width: (0, t.readUInt16BE)(d, u + 2)
2526
2627
  };
2527
2628
  }
2528
- function m(d, f) {
2529
- const w = r + 8, T = (0, t.readUInt)(d, 16, w, f);
2530
- for (let Y = 0; Y < T; Y++) {
2531
- const j = w + c + Y * l, I = j + l;
2532
- if (j > d.length)
2629
+ function w(d, u) {
2630
+ const x = r + 8, R = (0, t.readUInt)(d, 16, x, u);
2631
+ for (let K = 0; K < R; K++) {
2632
+ const m = x + c + K * a, b = m + a;
2633
+ if (m > d.length)
2533
2634
  return;
2534
- const v = d.slice(j, I);
2535
- if ((0, t.readUInt)(v, 16, 0, f) === 274)
2536
- return (0, t.readUInt)(v, 16, 2, f) !== 3 || (0, t.readUInt)(v, 32, 4, f) !== 1 ? void 0 : (0, t.readUInt)(v, 16, 8, f);
2635
+ const C = d.slice(m, b);
2636
+ if ((0, t.readUInt)(C, 16, 0, u) === 274)
2637
+ return (0, t.readUInt)(C, 16, 2, u) !== 3 || (0, t.readUInt)(C, 32, 4, u) !== 1 ? void 0 : (0, t.readUInt)(C, 16, 8, u);
2537
2638
  }
2538
2639
  }
2539
- function b(d, f) {
2540
- const u = d.slice(n, f), w = (0, t.toHexString)(u, r, r + i), T = w === s;
2541
- if (T || w === a)
2542
- return m(u, T);
2640
+ function v(d, u) {
2641
+ const p = d.slice(n, u), x = (0, t.toHexString)(p, r, r + i), R = x === s;
2642
+ if (R || x === l)
2643
+ return w(p, R);
2543
2644
  }
2544
- function h(d, f) {
2545
- if (f > d.length)
2645
+ function g(d, u) {
2646
+ if (u > d.length)
2546
2647
  throw new TypeError("Corrupt JPG, exceeded buffer limits");
2547
2648
  }
2548
- return De.JPG = {
2649
+ return Oe.JPG = {
2549
2650
  validate: (d) => (0, t.toHexString)(d, 0, 2) === "ffd8",
2550
2651
  calculate(d) {
2551
2652
  d = d.slice(4);
2552
- let f, u;
2653
+ let u, p;
2553
2654
  for (; d.length; ) {
2554
- const w = (0, t.readUInt16BE)(d, 0);
2555
- if (d[w] !== 255) {
2655
+ const x = (0, t.readUInt16BE)(d, 0);
2656
+ if (d[x] !== 255) {
2556
2657
  d = d.slice(1);
2557
2658
  continue;
2558
2659
  }
2559
- if (o(d) && (f = b(d, w)), h(d, w), u = d[w + 1], u === 192 || u === 193 || u === 194) {
2560
- const T = g(d, w + 5);
2561
- return f ? {
2562
- height: T.height,
2563
- orientation: f,
2564
- width: T.width
2565
- } : T;
2660
+ if (h(d) && (u = v(d, x)), g(d, x), p = d[x + 1], p === 192 || p === 193 || p === 194) {
2661
+ const R = o(d, x + 5);
2662
+ return u ? {
2663
+ height: R.height,
2664
+ orientation: u,
2665
+ width: R.width
2666
+ } : R;
2566
2667
  }
2567
- d = d.slice(w + 2);
2668
+ d = d.slice(x + 2);
2568
2669
  }
2569
2670
  throw new TypeError("Invalid JPG, no size found");
2570
2671
  }
2571
- }, De;
2672
+ }, Oe;
2572
2673
  }
2573
- var Kr = Qr();
2574
- const Jr = /* @__PURE__ */ H(Kr);
2575
- var Le = {}, $t;
2576
- function Yr() {
2577
- if ($t) return Le;
2578
- $t = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.KTX = void 0;
2674
+ var gi = pi();
2675
+ const mi = /* @__PURE__ */ H(gi);
2676
+ var Me = {}, Yt;
2677
+ function vi() {
2678
+ if (Yt) return Me;
2679
+ Yt = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.KTX = void 0;
2579
2680
  const t = G();
2580
- return Le.KTX = {
2681
+ return Me.KTX = {
2581
2682
  validate: (e) => {
2582
2683
  const n = (0, t.toUTF8String)(e, 1, 7);
2583
2684
  return ["KTX 11", "KTX 20"].includes(n);
@@ -2590,18 +2691,18 @@ function Yr() {
2590
2691
  type: n
2591
2692
  };
2592
2693
  }
2593
- }, Le;
2694
+ }, Me;
2594
2695
  }
2595
- var Xr = Yr();
2596
- const Zr = /* @__PURE__ */ H(Xr);
2597
- var Oe = {}, Ut;
2598
- function Vr() {
2599
- if (Ut) return Oe;
2600
- Ut = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.PNG = void 0;
2696
+ var wi = vi();
2697
+ const yi = /* @__PURE__ */ H(wi);
2698
+ var $e = {}, Xt;
2699
+ function bi() {
2700
+ if (Xt) return $e;
2701
+ Xt = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.PNG = void 0;
2601
2702
  const t = G(), e = `PNG\r
2602
2703
  
2603
2704
  `, n = "IHDR", r = "CgBI";
2604
- return Oe.PNG = {
2705
+ return $e.PNG = {
2605
2706
  validate(i) {
2606
2707
  if (e === (0, t.toUTF8String)(i, 1, 8)) {
2607
2708
  let s = (0, t.toUTF8String)(i, 12, 16);
@@ -2620,14 +2721,14 @@ function Vr() {
2620
2721
  width: (0, t.readUInt32BE)(i, 16)
2621
2722
  };
2622
2723
  }
2623
- }, Oe;
2724
+ }, $e;
2624
2725
  }
2625
- var ei = Vr();
2626
- const ti = /* @__PURE__ */ H(ei);
2627
- var Re = {}, qt;
2628
- function ni() {
2629
- if (qt) return Re;
2630
- qt = 1, Object.defineProperty(Re, "__esModule", { value: !0 }), Re.PNM = void 0;
2726
+ var xi = bi();
2727
+ const Si = /* @__PURE__ */ H(xi);
2728
+ var je = {}, Zt;
2729
+ function ki() {
2730
+ if (Zt) return je;
2731
+ Zt = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.PNM = void 0;
2631
2732
  const t = G(), e = {
2632
2733
  P1: "pbm/ascii",
2633
2734
  P2: "pgm/ascii",
@@ -2660,8 +2761,8 @@ function ni() {
2660
2761
  const s = r.shift();
2661
2762
  if (s.length > 16 || s.charCodeAt(0) > 128)
2662
2763
  continue;
2663
- const [a, l] = s.split(" ");
2664
- if (a && l && (i[a.toLowerCase()] = parseInt(l, 10)), i.height && i.width)
2764
+ const [l, a] = s.split(" ");
2765
+ if (l && a && (i[l.toLowerCase()] = parseInt(a, 10)), i.height && i.width)
2665
2766
  break;
2666
2767
  }
2667
2768
  if (i.height && i.width)
@@ -2672,35 +2773,35 @@ function ni() {
2672
2773
  throw new TypeError("Invalid PAM");
2673
2774
  }
2674
2775
  };
2675
- return Re.PNM = {
2776
+ return je.PNM = {
2676
2777
  validate: (r) => (0, t.toUTF8String)(r, 0, 2) in e,
2677
2778
  calculate(r) {
2678
- const i = (0, t.toUTF8String)(r, 0, 2), s = e[i], a = (0, t.toUTF8String)(r, 3).split(/[\r\n]+/);
2679
- return (n[s] || n.default)(a);
2779
+ const i = (0, t.toUTF8String)(r, 0, 2), s = e[i], l = (0, t.toUTF8String)(r, 3).split(/[\r\n]+/);
2780
+ return (n[s] || n.default)(l);
2680
2781
  }
2681
- }, Re;
2782
+ }, je;
2682
2783
  }
2683
- var ri = ni();
2684
- const ii = /* @__PURE__ */ H(ri);
2685
- var Me = {}, Bt;
2686
- function oi() {
2687
- if (Bt) return Me;
2688
- Bt = 1, Object.defineProperty(Me, "__esModule", { value: !0 }), Me.PSD = void 0;
2784
+ var Ei = ki();
2785
+ const Ii = /* @__PURE__ */ H(Ei);
2786
+ var qe = {}, Vt;
2787
+ function _i() {
2788
+ if (Vt) return qe;
2789
+ Vt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.PSD = void 0;
2689
2790
  const t = G();
2690
- return Me.PSD = {
2791
+ return qe.PSD = {
2691
2792
  validate: (e) => (0, t.toUTF8String)(e, 0, 4) === "8BPS",
2692
2793
  calculate: (e) => ({
2693
2794
  height: (0, t.readUInt32BE)(e, 14),
2694
2795
  width: (0, t.readUInt32BE)(e, 18)
2695
2796
  })
2696
- }, Me;
2797
+ }, qe;
2697
2798
  }
2698
- var si = oi();
2699
- const ai = /* @__PURE__ */ H(si);
2700
- var je = {}, Ft;
2701
- function li() {
2702
- if (Ft) return je;
2703
- Ft = 1, Object.defineProperty(je, "__esModule", { value: !0 }), je.SVG = void 0;
2799
+ var Ci = _i();
2800
+ const Ti = /* @__PURE__ */ H(Ci);
2801
+ var Ue = {}, en;
2802
+ function Pi() {
2803
+ if (en) return Ue;
2804
+ en = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.SVG = void 0;
2704
2805
  const t = G(), e = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/, n = {
2705
2806
  height: /\sheight=(['"])([^%]+?)\1/,
2706
2807
  root: e,
@@ -2717,69 +2818,69 @@ function li() {
2717
2818
  pt: 96 / 72,
2718
2819
  px: 1
2719
2820
  }, s = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(i).join("|")})?$`);
2720
- function a(m) {
2721
- const b = s.exec(m);
2722
- if (b)
2723
- return Math.round(Number(b[1]) * (i[b[2]] || 1));
2821
+ function l(w) {
2822
+ const v = s.exec(w);
2823
+ if (v)
2824
+ return Math.round(Number(v[1]) * (i[v[2]] || 1));
2724
2825
  }
2725
- function l(m) {
2726
- const b = m.split(" ");
2826
+ function a(w) {
2827
+ const v = w.split(" ");
2727
2828
  return {
2728
- height: a(b[3]),
2729
- width: a(b[2])
2829
+ height: l(v[3]),
2830
+ width: l(v[2])
2730
2831
  };
2731
2832
  }
2732
- function c(m) {
2733
- const b = m.match(n.width), h = m.match(n.height), d = m.match(n.viewbox);
2833
+ function c(w) {
2834
+ const v = w.match(n.width), g = w.match(n.height), d = w.match(n.viewbox);
2734
2835
  return {
2735
- height: h && a(h[2]),
2736
- viewbox: d && l(d[2]),
2737
- width: b && a(b[2])
2836
+ height: g && l(g[2]),
2837
+ viewbox: d && a(d[2]),
2838
+ width: v && l(v[2])
2738
2839
  };
2739
2840
  }
2740
- function o(m) {
2841
+ function h(w) {
2741
2842
  return {
2742
- height: m.height,
2743
- width: m.width
2843
+ height: w.height,
2844
+ width: w.width
2744
2845
  };
2745
2846
  }
2746
- function g(m, b) {
2747
- const h = b.width / b.height;
2748
- return m.width ? {
2749
- height: Math.floor(m.width / h),
2750
- width: m.width
2751
- } : m.height ? {
2752
- height: m.height,
2753
- width: Math.floor(m.height * h)
2847
+ function o(w, v) {
2848
+ const g = v.width / v.height;
2849
+ return w.width ? {
2850
+ height: Math.floor(w.width / g),
2851
+ width: w.width
2852
+ } : w.height ? {
2853
+ height: w.height,
2854
+ width: Math.floor(w.height * g)
2754
2855
  } : {
2755
- height: b.height,
2756
- width: b.width
2856
+ height: v.height,
2857
+ width: v.width
2757
2858
  };
2758
2859
  }
2759
- return je.SVG = {
2860
+ return Ue.SVG = {
2760
2861
  // Scan only the first kilo-byte to speed up the check on larger files
2761
- validate: (m) => e.test((0, t.toUTF8String)(m, 0, 1e3)),
2762
- calculate(m) {
2763
- const b = (0, t.toUTF8String)(m).match(n.root);
2764
- if (b) {
2765
- const h = c(b[0]);
2766
- if (h.width && h.height)
2767
- return o(h);
2768
- if (h.viewbox)
2769
- return g(h, h.viewbox);
2862
+ validate: (w) => e.test((0, t.toUTF8String)(w, 0, 1e3)),
2863
+ calculate(w) {
2864
+ const v = (0, t.toUTF8String)(w).match(n.root);
2865
+ if (v) {
2866
+ const g = c(v[0]);
2867
+ if (g.width && g.height)
2868
+ return h(g);
2869
+ if (g.viewbox)
2870
+ return o(g, g.viewbox);
2770
2871
  }
2771
2872
  throw new TypeError("Invalid SVG");
2772
2873
  }
2773
- }, je;
2874
+ }, Ue;
2774
2875
  }
2775
- var ci = li();
2776
- const di = /* @__PURE__ */ H(ci);
2777
- var $e = {}, At;
2778
- function ui() {
2779
- if (At) return $e;
2780
- At = 1, Object.defineProperty($e, "__esModule", { value: !0 }), $e.TGA = void 0;
2876
+ var Ni = Pi();
2877
+ const Di = /* @__PURE__ */ H(Ni);
2878
+ var Be = {}, tn;
2879
+ function Ri() {
2880
+ if (tn) return Be;
2881
+ tn = 1, Object.defineProperty(Be, "__esModule", { value: !0 }), Be.TGA = void 0;
2781
2882
  const t = G();
2782
- return $e.TGA = {
2883
+ return Be.TGA = {
2783
2884
  validate(e) {
2784
2885
  return (0, t.readUInt16LE)(e, 0) === 0 && (0, t.readUInt16LE)(e, 4) === 0;
2785
2886
  },
@@ -2789,14 +2890,14 @@ function ui() {
2789
2890
  width: (0, t.readUInt16LE)(e, 12)
2790
2891
  };
2791
2892
  }
2792
- }, $e;
2893
+ }, Be;
2793
2894
  }
2794
- var hi = ui();
2795
- const fi = /* @__PURE__ */ H(hi);
2796
- var Ue = {}, zt;
2797
- function pi() {
2798
- if (zt) return Ue;
2799
- zt = 1, Object.defineProperty(Ue, "__esModule", { value: !0 }), Ue.WEBP = void 0;
2895
+ var Li = Ri();
2896
+ const Oi = /* @__PURE__ */ H(Li);
2897
+ var Fe = {}, nn;
2898
+ function Mi() {
2899
+ if (nn) return Fe;
2900
+ nn = 1, Object.defineProperty(Fe, "__esModule", { value: !0 }), Fe.WEBP = void 0;
2800
2901
  const t = G();
2801
2902
  function e(i) {
2802
2903
  return {
@@ -2816,34 +2917,34 @@ function pi() {
2816
2917
  width: (0, t.readInt16LE)(i, 6) & 16383
2817
2918
  };
2818
2919
  }
2819
- return Ue.WEBP = {
2920
+ return Fe.WEBP = {
2820
2921
  validate(i) {
2821
- const s = (0, t.toUTF8String)(i, 0, 4) === "RIFF", a = (0, t.toUTF8String)(i, 8, 12) === "WEBP", l = (0, t.toUTF8String)(i, 12, 15) === "VP8";
2822
- return s && a && l;
2922
+ const s = (0, t.toUTF8String)(i, 0, 4) === "RIFF", l = (0, t.toUTF8String)(i, 8, 12) === "WEBP", a = (0, t.toUTF8String)(i, 12, 15) === "VP8";
2923
+ return s && l && a;
2823
2924
  },
2824
2925
  calculate(i) {
2825
2926
  const s = (0, t.toUTF8String)(i, 12, 16);
2826
2927
  if (i = i.slice(20, 30), s === "VP8X") {
2827
- const l = i[0], c = (l & 192) === 0, o = (l & 1) === 0;
2828
- if (c && o)
2928
+ const a = i[0], c = (a & 192) === 0, h = (a & 1) === 0;
2929
+ if (c && h)
2829
2930
  return e(i);
2830
2931
  throw new TypeError("Invalid WebP");
2831
2932
  }
2832
2933
  if (s === "VP8 " && i[0] !== 47)
2833
2934
  return r(i);
2834
- const a = (0, t.toHexString)(i, 3, 6);
2835
- if (s === "VP8L" && a !== "9d012a")
2935
+ const l = (0, t.toHexString)(i, 3, 6);
2936
+ if (s === "VP8L" && l !== "9d012a")
2836
2937
  return n(i);
2837
2938
  throw new TypeError("Invalid WebP");
2838
2939
  }
2839
- }, Ue;
2940
+ }, Fe;
2840
2941
  }
2841
- var gi = pi();
2842
- const mi = /* @__PURE__ */ H(gi);
2843
- var qe = {}, Wt;
2844
- function wi() {
2845
- if (Wt) return qe;
2846
- Wt = 1, Object.defineProperty(qe, "__esModule", { value: !0 }), qe.HEIF = void 0;
2942
+ var $i = Mi();
2943
+ const ji = /* @__PURE__ */ H($i);
2944
+ var Ae = {}, rn;
2945
+ function qi() {
2946
+ if (rn) return Ae;
2947
+ rn = 1, Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.HEIF = void 0;
2847
2948
  const t = G(), e = {
2848
2949
  avif: "avif",
2849
2950
  mif1: "heif",
@@ -2856,7 +2957,7 @@ function wi() {
2856
2957
  hevx: "heic"
2857
2958
  // heic-sequence
2858
2959
  };
2859
- return qe.HEIF = {
2960
+ return Ae.HEIF = {
2860
2961
  validate(n) {
2861
2962
  if ((0, t.toUTF8String)(n, 4, 8) !== "ftyp")
2862
2963
  return !1;
@@ -2864,19 +2965,34 @@ function wi() {
2864
2965
  return i ? (0, t.toUTF8String)(n, i.offset + 8, i.offset + 12) in e : !1;
2865
2966
  },
2866
2967
  calculate(n) {
2867
- const r = (0, t.findBox)(n, "meta", 0), i = r && (0, t.findBox)(n, "iprp", r.offset + 12), s = i && (0, t.findBox)(n, "ipco", i.offset + 8), a = s && (0, t.findBox)(n, "ispe", s.offset + 8);
2868
- if (a)
2968
+ const r = (0, t.findBox)(n, "meta", 0), i = r && (0, t.findBox)(n, "iprp", r.offset + 12), s = i && (0, t.findBox)(n, "ipco", i.offset + 8), l = s && (0, t.findBox)(n, "ispe", s.offset + 8);
2969
+ if (l)
2869
2970
  return {
2870
- height: (0, t.readUInt32BE)(n, a.offset + 16),
2871
- width: (0, t.readUInt32BE)(n, a.offset + 12),
2971
+ height: (0, t.readUInt32BE)(n, l.offset + 16),
2972
+ width: (0, t.readUInt32BE)(n, l.offset + 12),
2872
2973
  type: (0, t.toUTF8String)(n, 8, 12)
2873
2974
  };
2874
2975
  throw new TypeError("Invalid HEIF, no size found");
2875
2976
  }
2876
- }, qe;
2977
+ }, Ae;
2877
2978
  }
2878
- var bi = wi();
2879
- const vi = /* @__PURE__ */ H(bi), yi = {
2979
+ var Ui = qi();
2980
+ const Bi = /* @__PURE__ */ H(Ui);
2981
+ async function Fi(t, e) {
2982
+ const n = e;
2983
+ let r = n.loc;
2984
+ if (!n.frame && !n.plugin && (r || (r = Yn(n)), r && (n.loc = r, r.file))) {
2985
+ const i = await t.dynamicImport("node:fs"), { normalizePath: s } = await t.dynamicImport("vite");
2986
+ n.id = s(n.loc.file);
2987
+ try {
2988
+ const l = i.readFileSync(n.loc.file, "utf-8");
2989
+ n.frame = Zn(l, n.loc);
2990
+ } catch {
2991
+ }
2992
+ }
2993
+ return e;
2994
+ }
2995
+ const Ai = {
2880
2996
  56: "psd",
2881
2997
  66: "bmp",
2882
2998
  68: "dds",
@@ -2885,38 +3001,38 @@ const vi = /* @__PURE__ */ H(bi), yi = {
2885
3001
  105: "icns",
2886
3002
  137: "png",
2887
3003
  255: "jpg"
2888
- }, Ye = {
2889
- webp: mi.WEBP,
2890
- jpg: Jr.JPG,
2891
- png: ti.PNG,
2892
- svg: di.SVG,
2893
- gif: Mr.GIF,
2894
- avif: vi.HEIF,
2895
- bmp: _r.BMP,
2896
- cur: Pr.CUR,
2897
- dds: Lr.DDS,
2898
- icns: Ur.ICNS,
2899
- ico: Br.ICO,
2900
- j2c: zr.J2C,
2901
- jp2: Gr.JP2,
2902
- ktx: Zr.KTX,
2903
- pnm: ii.PNM,
2904
- psd: ai.PSD,
2905
- tga: fi.TGA
2906
- }, xi = Object.keys(Ye);
2907
- function ki(t) {
2908
- const e = t[0], n = yi[e];
2909
- return n && Ye[n].validate(t) ? n : xi.find((r) => Ye[r].validate(t));
2910
- }
2911
- function Ei(t) {
2912
- const e = ki(t);
3004
+ }, et = {
3005
+ webp: ji.WEBP,
3006
+ jpg: mi.JPG,
3007
+ png: Si.PNG,
3008
+ svg: Di.SVG,
3009
+ gif: ni.GIF,
3010
+ avif: Bi.HEIF,
3011
+ bmp: Qr.BMP,
3012
+ cur: Yr.CUR,
3013
+ dds: Vr.DDS,
3014
+ icns: oi.ICNS,
3015
+ ico: ai.ICO,
3016
+ j2c: di.J2C,
3017
+ jp2: hi.JP2,
3018
+ ktx: yi.KTX,
3019
+ pnm: Ii.PNM,
3020
+ psd: Ti.PSD,
3021
+ tga: Oi.TGA
3022
+ }, zi = Object.keys(et);
3023
+ function Wi(t) {
3024
+ const e = t[0], n = Ai[e];
3025
+ return n && et[n].validate(t) ? n : zi.find((r) => et[r].validate(t));
3026
+ }
3027
+ function Hi(t) {
3028
+ const e = Wi(t);
2913
3029
  if (typeof e < "u") {
2914
- const n = Ye[e].calculate(t);
3030
+ const n = et[e].calculate(t);
2915
3031
  if (n !== void 0)
2916
3032
  return n.type = e, n;
2917
3033
  }
2918
3034
  }
2919
- async function Si(t) {
3035
+ async function Gi(t) {
2920
3036
  if (/^(https?|file|capacitor):/.test(t))
2921
3037
  try {
2922
3038
  const e = await fetch(t, {
@@ -2926,7 +3042,7 @@ async function Si(t) {
2926
3042
  console.error("can not fetch", t);
2927
3043
  return;
2928
3044
  }
2929
- const n = await e.arrayBuffer(), r = Ei(Buffer.from(n));
3045
+ const n = await e.arrayBuffer(), r = Hi(Buffer.from(n));
2930
3046
  if (r)
2931
3047
  return {
2932
3048
  width: r.width,
@@ -2939,9 +3055,9 @@ async function Si(t) {
2939
3055
  return;
2940
3056
  }
2941
3057
  }
2942
- const Ii = (t, e, n) => async (r, i, s) => {
3058
+ const Qi = (t, e, n) => async (r, i, s) => {
2943
3059
  try {
2944
- const a = await t.dynamicImport("node:fs"), l = await t.dynamicImport("node:path");
3060
+ const l = await t.dynamicImport("node:fs"), a = await t.dynamicImport("node:path");
2945
3061
  let c;
2946
3062
  try {
2947
3063
  c = new URL(r.url, "http://localhost:3000/");
@@ -2950,139 +3066,139 @@ const Ii = (t, e, n) => async (r, i, s) => {
2950
3066
  return;
2951
3067
  }
2952
3068
  if (r.method === "GET" && c.pathname === "/__image_info") {
2953
- const o = c.searchParams.get("url");
2954
- if (i.setHeader("content-type", "application/json"), o) {
2955
- const g = await Si(o);
2956
- i.setHeader("cache-control", "public, max-age=31536000, immutable"), g ? i.write(JSON.stringify(g)) : i.statusCode = 404;
3069
+ const h = c.searchParams.get("url");
3070
+ if (i.setHeader("content-type", "application/json"), h) {
3071
+ const o = await Gi(h);
3072
+ i.setHeader("cache-control", "public, max-age=31536000, immutable"), o ? i.write(JSON.stringify(o)) : i.statusCode = 404;
2957
3073
  } else {
2958
3074
  i.statusCode = 500;
2959
- const g = { message: "error" };
2960
- i.write(JSON.stringify(g));
3075
+ const o = { message: "error" };
3076
+ i.write(JSON.stringify(o));
2961
3077
  }
2962
3078
  i.end();
2963
3079
  return;
2964
3080
  } else if (r.method === "POST" && c.pathname === "/__image_fix") {
2965
- const o = c.searchParams.get("loc"), g = c.searchParams.get("width"), m = c.searchParams.get("height"), b = c.searchParams.get("src"), h = c.searchParams.get("currentHref"), d = o.split(":"), f = parseInt(d[d.length - 1], 10) - 1;
2966
- let u = parseInt(d[d.length - 2], 10) - 1;
2967
- const w = l.resolve(n, d.slice(0, d.length - 2).join(":")), T = l.extname(w).toLowerCase();
2968
- let j = a.readFileSync(w).toString("utf-8"), I = 0;
2969
- for (; I < j.length; I++)
2970
- if (u === 0) {
2971
- I += f;
3081
+ const h = c.searchParams.get("loc"), o = c.searchParams.get("width"), w = c.searchParams.get("height"), v = c.searchParams.get("src"), g = c.searchParams.get("currentHref"), d = h.split(":"), u = parseInt(d[d.length - 1], 10) - 1;
3082
+ let p = parseInt(d[d.length - 2], 10) - 1;
3083
+ const x = a.resolve(n, d.slice(0, d.length - 2).join(":")), R = a.extname(x).toLowerCase();
3084
+ let m = l.readFileSync(x).toString("utf-8"), b = 0;
3085
+ for (; b < m.length; b++)
3086
+ if (p === 0) {
3087
+ b += u;
2972
3088
  break;
2973
- } else if (j[I] === `
3089
+ } else if (m[b] === `
2974
3090
  `) {
2975
- u--;
3091
+ p--;
2976
3092
  continue;
2977
3093
  }
2978
- if (j.slice(I, I + 4) !== "<img") {
3094
+ if (m.slice(b, b + 4) !== "<img") {
2979
3095
  console.error(
2980
3096
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
2981
3097
  ), i.statusCode = 500;
2982
3098
  return;
2983
3099
  }
2984
- const v = j.indexOf(">", I) + 1;
2985
- if (v < I) {
3100
+ const C = m.indexOf(">", b) + 1;
3101
+ if (C < b) {
2986
3102
  console.error(
2987
3103
  "Could not apply auto fix, because it was not possible to find the original <img> tag"
2988
3104
  ), i.statusCode = 500;
2989
3105
  return;
2990
3106
  }
2991
- const k = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(T);
2992
- let x = j.slice(I, v);
2993
- if (b && h && k) {
2994
- const $ = new URL(b), _ = new URL(h);
2995
- if ($.origin === _.origin) {
2996
- const O = l.join(e, "public", $.pathname), Q = l.join(e, $.pathname);
2997
- let F;
2998
- if (a.existsSync(O)) {
2999
- const te = l.join(n, "media", l.dirname($.pathname));
3000
- await a.promises.mkdir(te, { recursive: !0 }), await a.promises.copyFile(
3001
- O,
3002
- l.join(n, "media", $.pathname)
3003
- ), F = "~/media" + $.pathname;
3004
- } else if (a.existsSync(Q))
3005
- F = $.pathname.replace("/src/", "~/");
3107
+ const $ = [".ts", ".tsx", ".js", ".jsx", ".mdx"].includes(R);
3108
+ let I = m.slice(b, C);
3109
+ if (v && g && $) {
3110
+ const T = new URL(v), z = new URL(g);
3111
+ if (T.origin === z.origin) {
3112
+ const j = a.join(e, "public", T.pathname), q = a.join(e, T.pathname);
3113
+ let A;
3114
+ if (l.existsSync(j)) {
3115
+ const W = a.join(n, "media", a.dirname(T.pathname));
3116
+ await l.promises.mkdir(W, { recursive: !0 }), await l.promises.copyFile(
3117
+ j,
3118
+ a.join(n, "media", T.pathname)
3119
+ ), A = "~/media" + T.pathname;
3120
+ } else if (l.existsSync(q))
3121
+ A = T.pathname.replace("/src/", "~/");
3006
3122
  else
3007
3123
  return;
3008
- const R = _i($.pathname), J = `${F}?jsx`;
3009
- x = x.replace(/^<img/, `<${R}`), x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), x = x.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
3010
- let K = 0;
3011
- if (T === ".mdx" && j.startsWith("---") && (K = j.indexOf("---", 4) + 3, K === -1))
3124
+ const J = Ki(T.pathname), X = `${A}?jsx`;
3125
+ I = I.replace(/^<img/, `<${J}`), I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, ""), I = I.replace(/\bsrc=(({[^}]*})|('[^']*')|("[^"]*"))\s*/, "");
3126
+ let Y = 0;
3127
+ if (R === ".mdx" && m.startsWith("---") && (Y = m.indexOf("---", 4) + 3, Y === -1))
3012
3128
  return;
3013
- const X = `
3014
- import ${R} from '${J}';`;
3015
- j = `${j.slice(0, K)}${X}${j.slice(
3016
- K,
3017
- I
3018
- )}${x}${j.slice(v)}`, a.writeFileSync(w, j);
3129
+ const ae = `
3130
+ import ${J} from '${X}';`;
3131
+ m = `${m.slice(0, Y)}${ae}${m.slice(
3132
+ Y,
3133
+ b
3134
+ )}${I}${m.slice(C)}`, l.writeFileSync(x, m);
3019
3135
  return;
3020
3136
  }
3021
3137
  }
3022
- x = x.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${g}"`), x = x.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${m}"`), x.includes("height=") || (x = x.replace(/<img/, `<img height="${m}"`)), x.includes("width=") || (x = x.replace(/<img/, `<img width="${g}"`)), j = j.slice(0, I) + x + j.slice(v), a.writeFileSync(w, j);
3138
+ I = I.replace(/\bwidth=(({[^}]*})|('[^']*')|("[^"]*"))/, `width="${o}"`), I = I.replace(/\bheight=(({[^}]*})|('[^']*')|("[^"]*"))/, `height="${w}"`), I.includes("height=") || (I = I.replace(/<img/, `<img height="${w}"`)), I.includes("width=") || (I = I.replace(/<img/, `<img width="${o}"`)), m = m.slice(0, b) + I + m.slice(C), l.writeFileSync(x, m);
3023
3139
  } else
3024
3140
  s();
3025
- } catch (a) {
3026
- a instanceof Error && await Sn(t, a), s(a);
3141
+ } catch (l) {
3142
+ l instanceof Error && await Fi(t, l), s(l);
3027
3143
  }
3028
3144
  };
3029
- function _i(t) {
3145
+ function Ki(t) {
3030
3146
  const e = t.lastIndexOf("."), n = t.lastIndexOf("/");
3031
- return t = t.substring(n + 1, e), `Img${Ci(t)}`;
3147
+ return t = t.substring(n + 1, e), `Img${Ji(t)}`;
3032
3148
  }
3033
- function Ci(t) {
3149
+ function Ji(t) {
3034
3150
  return `${t}`.toLowerCase().replace(new RegExp(/[-_]+/, "g"), " ").replace(new RegExp(/[^\w\s]/, "g"), "").replace(new RegExp(/\s+(.)(\w*)/, "g"), (e, n, r) => `${n.toUpperCase() + r}`).replace(new RegExp(/\w/), (e) => e.toUpperCase());
3035
3151
  }
3036
- const Fe = "@qwik-worker-core", Ti = `
3152
+ const We = "@qwik-worker-core", Yi = `
3037
3153
  export { setPlatform } from '@qwik.dev/core';
3038
3154
  export { _deserialize } from '@qwik.dev/core/internal';
3039
- `, Pi = (t) => t.endsWith(Fe), Ni = () => ({
3155
+ `, Xi = (t) => t.endsWith(We), Zi = () => ({
3040
3156
  moduleSideEffects: !1,
3041
- code: Ti
3042
- }), Di = (t) => {
3157
+ code: Yi
3158
+ }), Vi = (t) => {
3043
3159
  t.emitFile({
3044
- id: Fe,
3160
+ id: We,
3045
3161
  name: "qwik-worker-core",
3046
3162
  type: "chunk",
3047
3163
  preserveSignature: "allow-extension"
3048
3164
  });
3049
- }, Li = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
3165
+ }, eo = (t, e, n) => e !== "client" && e !== "ssr" || n !== "build" ? t : {
3050
3166
  ...t,
3051
3167
  format: "es",
3052
- plugins: ji(t?.plugins)
3053
- }, Oi = (t) => {
3168
+ plugins: io(t?.plugins)
3169
+ }, to = (t) => {
3054
3170
  const e = Object.values(t).find(
3055
- (r) => r.type === "chunk" && r.facadeModuleId === Fe
3056
- ), n = e ? Jt(e.fileName) : void 0;
3057
- en(
3171
+ (r) => r.type === "chunk" && r.facadeModuleId === We
3172
+ ), n = e ? cn(e.fileName) : void 0;
3173
+ hn(
3058
3174
  t,
3059
3175
  (r) => n?.(r)
3060
3176
  );
3061
- }, Ri = (t, e) => {
3062
- const n = $i(e), r = n ? Jt(n) : void 0;
3063
- en(
3177
+ }, no = (t, e) => {
3178
+ const n = oo(e), r = n ? cn(n) : void 0;
3179
+ hn(
3064
3180
  t,
3065
3181
  (i) => r?.(i)
3066
3182
  );
3067
- }, Mi = () => ({
3183
+ }, ro = () => ({
3068
3184
  name: "vite-plugin-qwik-worker-core-external",
3069
3185
  enforce: "pre",
3070
3186
  resolveId(t) {
3071
- return t === we || t === be ? {
3072
- id: rt,
3187
+ return t === we || t === ye ? {
3188
+ id: at,
3073
3189
  external: !0
3074
3190
  } : null;
3075
3191
  }
3076
- }), ji = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], Mi()], en = (t, e) => {
3192
+ }), io = (t) => () => [...typeof t == "function" ? t() : Array.isArray(t) ? t : [], ro()], hn = (t, e) => {
3077
3193
  for (const n of Object.values(t))
3078
- n.type === "chunk" ? n.code = It(
3194
+ n.type === "chunk" ? n.code = Ot(
3079
3195
  n.code,
3080
3196
  () => e(n.fileName)
3081
- ) : n.type === "asset" && typeof n.source == "string" && (n.source = It(
3197
+ ) : n.type === "asset" && typeof n.source == "string" && (n.source = Ot(
3082
3198
  n.source,
3083
3199
  () => e(n.fileName)
3084
3200
  ));
3085
- }, $i = (t) => {
3201
+ }, oo = (t) => {
3086
3202
  if (!t)
3087
3203
  return;
3088
3204
  const e = Object.keys(t.bundles).find(
@@ -3090,15 +3206,15 @@ export { _deserialize } from '@qwik.dev/core/internal';
3090
3206
  );
3091
3207
  if (e)
3092
3208
  return e === "build" || e.startsWith("build/") || /[/\\]build[/\\]/.test(e) ? e : `build/${e}`;
3093
- }, Ui = [
3209
+ }, so = [
3094
3210
  we,
3095
- ot,
3096
- st,
3097
- be,
3211
+ dt,
3212
+ ut,
3213
+ ye,
3098
3214
  "@builder.io/qwik",
3099
3215
  "@builder.io/qwik/jsx-runtime",
3100
3216
  "@builder.io/qwik/jsx-dev-runtime"
3101
- ], qi = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], Bi = [".woff", ".woff2", ".ttf"], nt = "@qwik-hmr-bridge", Fi = `
3217
+ ], ao = [".css", ".scss", ".sass", ".less", ".styl", ".stylus"], lo = [".woff", ".woff2", ".ttf"], st = "@qwik-hmr-bridge", co = `
3102
3218
  // HMR bridge: connects Vite HMR events to Qwik's component re-rendering.
3103
3219
  if (import.meta.hot) {
3104
3220
  let timeout;
@@ -3123,67 +3239,68 @@ export { _deserialize } from '@qwik.dev/core/internal';
3123
3239
  });
3124
3240
  }
3125
3241
  `;
3126
- function Hi(t = {}) {
3127
- let e = "serve", n = null, r = null, i = "/", s = null, a, l = null, c = null, o = null, g = "development", m;
3128
- const b = t.client?.outDir;
3129
- let h = null;
3130
- const d = t.fileFilter ? (v, k) => Zt.test(v) || t.fileFilter(v, k) : () => !0, f = t.disableFontPreload ?? !1, u = [], w = Xt(t.optimizerOptions), T = /* @__PURE__ */ new Set();
3242
+ function po(t = {}) {
3243
+ let e = "serve", n = null, r = "/", i = null, s = null, l = null, a = null, c = "development", h;
3244
+ const o = t.client?.outDir;
3245
+ let w = null;
3246
+ const v = t.fileFilter ? (m, b) => ct.test(m) || t.fileFilter(m, b) : () => !0, g = t.disableFontPreload ?? !1, d = [], u = un(t.optimizerOptions), p = /* @__PURE__ */ new Set();
3131
3247
  return [{
3132
3248
  name: "vite-plugin-qwik",
3133
3249
  enforce: "pre",
3134
3250
  api: {
3135
- getOptimizer: () => w.getOptimizer(),
3136
- getOptions: () => w.getOptions(),
3137
- getManifest: () => n,
3138
- getRootDir: () => w.getOptions().rootDir,
3139
- getClientOutDir: () => r,
3140
- getClientPublicOutDir: () => s,
3141
- getAssetsDir: () => a,
3142
- registerBundleGraphAdder: (v) => T.add(v),
3251
+ getOptimizer: () => u.getOptimizer(),
3252
+ getOptions: () => u.getOptions(),
3253
+ getManifest: () => u.getOptions().manifestInput,
3254
+ getRootDir: () => u.getOptions().rootDir,
3255
+ getClientOutDir: () => n,
3256
+ getClientPublicOutDir: () => i,
3257
+ registerBundleGraphAdder: (m) => p.add(m),
3258
+ onSegment: (m) => {
3259
+ u.segmentCallbacks.add(m);
3260
+ },
3143
3261
  _oldDevSsrServer: () => t.devSsrServer
3144
3262
  },
3145
- async config(v, k) {
3146
- await w.init();
3147
- let x;
3148
- k.mode === "lib" ? x = "lib" : v.build?.ssr || k.mode === "ssr" ? x = "ssr" : k.mode === "test" || k.mode === "benchmark" ? x = "test" : x = "client", e = k.command, k.mode === "production" ? g = "production" : k.mode === "development" ? g = "development" : e === "build" && x === "client" ? g = "production" : g = "development", w.debug(`vite config(), command: ${e}, env.mode: ${k.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : x === "ssr" ? t.entryStrategy = { type: "hoist" } : x === "lib" && (t.entryStrategy = { type: "inline" });
3149
- const $ = x === "ssr" ? typeof v.build?.ssr == "string" ? v.build.ssr : t.ssr?.input : void 0, _ = x === "client" ? t.client?.input : void 0;
3150
- let O = v.build?.rollupOptions?.input || _ || $;
3151
- O && typeof O == "string" && (O = [O]), a = v.build?.assetsDir;
3152
- const Q = x === "client" && !!a && a !== "_astro", F = {
3153
- target: x,
3154
- buildMode: g,
3263
+ async config(m, b) {
3264
+ await u.init();
3265
+ let C;
3266
+ b.mode === "lib" ? C = "lib" : m.build?.ssr || b.mode === "ssr" ? C = "ssr" : b.mode === "test" || b.mode === "benchmark" ? C = "test" : C = "client", e = b.command, b.mode === "production" ? c = "production" : b.mode === "development" ? c = "development" : e === "build" && C === "client" ? c = "production" : c = "development", u.debug(`vite config(), command: ${e}, env.mode: ${b.mode}`), e === "serve" ? t.entryStrategy = { type: "segment" } : C === "ssr" ? t.entryStrategy = { type: "hoist" } : C === "lib" && (t.entryStrategy = { type: "inline" });
3267
+ const $ = C === "ssr" ? typeof m.build?.ssr == "string" ? m.build.ssr : t.ssr?.input : void 0, I = C === "client" ? t.client?.input : void 0;
3268
+ let T = m.build?.rollupOptions?.input || I || $;
3269
+ T && typeof T == "string" && (T = [T]);
3270
+ const z = {
3271
+ target: C,
3272
+ buildMode: c,
3155
3273
  csr: t.csr,
3156
3274
  debug: t.debug,
3157
3275
  entryStrategy: t.entryStrategy,
3158
3276
  srcDir: t.srcDir,
3159
- rootDir: v.root,
3277
+ rootDir: m.root,
3160
3278
  tsconfigFileNames: t.tsconfigFileNames,
3161
3279
  resolveQwikBuild: !0,
3162
3280
  transformedModuleOutput: t.transformedModuleOutput,
3163
- outDir: v.build?.outDir,
3164
- ssrOutDir: t.ssr?.outDir || v.build?.outDir,
3165
- clientOutDir: b || // When ssr is true, this is probably an adapter build and not where the client build is
3281
+ outDir: m.build?.outDir,
3282
+ ssrOutDir: t.ssr?.outDir || m.build?.outDir,
3283
+ clientOutDir: o || // When ssr is true, this is probably an adapter build and not where the client build is
3166
3284
  // However, if client.outDir was explicitly set, always use it
3167
- (v.build?.ssr && !b ? void 0 : v.build?.outDir),
3168
- assetsDir: Q ? a : void 0,
3285
+ (m.build?.ssr && !o ? void 0 : m.build?.outDir),
3169
3286
  devTools: t.devTools,
3170
- sourcemap: !!v.build?.sourcemap,
3287
+ sourcemap: !!m.build?.sourcemap,
3171
3288
  lint: t.lint,
3172
3289
  experimental: t.experimental,
3173
- input: O,
3290
+ input: T,
3174
3291
  manifestInput: t.ssr?.manifestInput,
3175
3292
  manifestInputPath: t.ssr?.manifestInputPath,
3176
3293
  manifestOutput: t.client?.manifestOutput
3177
- }, R = await w.normalizeOptions(F);
3178
- O ||= R.input, h = F, n = R.manifestInput, l = R.srcDir, c = R.rootDir, t.csr || (r = R.clientOutDir, s = r, o = R.ssrOutDir);
3179
- const J = g === "development", K = "globalThis.qDev", X = "globalThis.qTest", te = "globalThis.qInspector", ce = v?.define?.[K] ?? J, M = v?.define?.[te] ?? J, z = {
3294
+ }, j = await u.normalizeOptions(z);
3295
+ T ||= j.input, w = z, s = j.srcDir, l = j.rootDir, t.csr || (n = j.clientOutDir, i = n, a = j.ssrOutDir);
3296
+ const q = c === "development", A = "globalThis.qDev", J = "globalThis.qTest", X = "globalThis.qInspector", Y = m?.define?.[A] ?? q, ae = m?.define?.[X] ?? q, W = {
3180
3297
  // Duplicated in configEnvironment to support legacy vite build --ssr compatibility
3181
3298
  ssr: {
3182
- noExternal: [we, be, He, se]
3299
+ noExternal: [we, ye, Ke, se]
3183
3300
  },
3184
3301
  envPrefix: ["VITE_", "PUBLIC_"],
3185
3302
  resolve: {
3186
- dedupe: [...Ui],
3303
+ dedupe: [...so],
3187
3304
  alias: {
3188
3305
  "@builder.io/qwik": "@qwik.dev/core",
3189
3306
  "@builder.io/qwik/build": "@qwik.dev/core/build",
@@ -3203,16 +3320,16 @@ function Hi(t = {}) {
3203
3320
  // using optimized deps for qwik libraries will lead to duplicate imports
3204
3321
  // this breaks Qwik because it relies a lot on module scoped symbols
3205
3322
  we,
3206
- be,
3207
- He,
3208
- ot,
3209
- st,
3323
+ ye,
3324
+ Ke,
3325
+ dt,
3326
+ ut,
3210
3327
  se,
3211
3328
  oe,
3212
3329
  "@builder.io/qwik"
3213
3330
  ],
3214
3331
  // Enforce scanning our input even when overridden later
3215
- entries: O && (typeof O == "string" ? [O] : typeof O == "object" ? Object.values(O) : O)
3332
+ entries: T && (typeof T == "string" ? [T] : typeof T == "object" ? Object.values(T) : T)
3216
3333
  },
3217
3334
  build: {
3218
3335
  modulePreload: !1,
@@ -3222,101 +3339,99 @@ function Hi(t = {}) {
3222
3339
  rollupOptions: {
3223
3340
  external: ["node:async_hooks"],
3224
3341
  // This will amend the existing input
3225
- input: O
3342
+ input: T
3226
3343
  // temporary fix for rolldown-vite types
3227
3344
  }
3228
3345
  },
3229
- worker: Li(v.worker, x, e),
3346
+ worker: eo(m.worker, C, e),
3230
3347
  define: {
3231
- [K]: ce,
3232
- [te]: M,
3233
- [X]: JSON.stringify(process.env.NODE_ENV === "test")
3348
+ [A]: Y,
3349
+ [X]: ae,
3350
+ [J]: JSON.stringify(process.env.NODE_ENV === "test")
3234
3351
  }
3235
3352
  };
3236
3353
  if (!t.csr) {
3237
- z.build.cssCodeSplit = !1, R.outDir && (z.build.outDir = R.outDir);
3238
- const de = z.build.rollupOptions?.onwarn;
3239
- z.build.rollupOptions = {
3240
- ...z.build.rollupOptions,
3241
- output: await dr(
3242
- w,
3243
- v.build?.rollupOptions?.output,
3244
- Q,
3245
- R.outDir
3354
+ W.build.cssCodeSplit = !1, j.outDir && (W.build.outDir = j.outDir);
3355
+ const le = W.build.rollupOptions?.onwarn;
3356
+ W.build.rollupOptions = {
3357
+ ...W.build.rollupOptions,
3358
+ output: await Dr(
3359
+ u,
3360
+ m.build?.rollupOptions?.output
3246
3361
  ),
3247
3362
  preserveEntrySignatures: "exports-only",
3248
- onwarn: (A, ve) => {
3249
- A.plugin === "typescript" && A.message.includes("outputToFilesystem") || (de ? de(A, ve) : ve(A));
3363
+ onwarn: (V, de) => {
3364
+ V.plugin === "typescript" && V.message.includes("outputToFilesystem") || (le ? le(V, de) : de(V));
3250
3365
  }
3251
- }, R.target === "ssr" ? e === "build" && (z.publicDir = !1, z.build.ssr = !0, v.build?.minify == null && g === "production" && (z.build.minify = !0)) : R.target === "client" || (R.target === "lib" ? (z.build.minify = !1, z.build.rollupOptions.external = [
3366
+ }, j.target === "ssr" ? e === "build" && (W.publicDir = !1, W.build.ssr = !0, m.build?.minify == null && c === "production" && (W.build.minify = !0)) : j.target === "client" || (j.target === "lib" ? (W.build.minify = !1, W.build.rollupOptions.external = [
3252
3367
  we,
3253
- be,
3254
- He,
3255
- ot,
3256
- st,
3368
+ ye,
3369
+ Ke,
3370
+ dt,
3371
+ ut,
3257
3372
  se,
3258
3373
  oe
3259
- ]) : z.define = {
3260
- [K]: !0,
3261
- [X]: !0,
3262
- [te]: !1
3263
- }), globalThis.qDev = ce, globalThis.qTest = !0, globalThis.qInspector = M;
3374
+ ]) : W.define = {
3375
+ [A]: !0,
3376
+ [J]: !0,
3377
+ [X]: !1
3378
+ }), globalThis.qDev = Y, globalThis.qTest = !0, globalThis.qInspector = ae;
3264
3379
  }
3265
- return z;
3380
+ return W;
3266
3381
  },
3267
- configEnvironment(v, k, x) {
3268
- return v === "ssr" ? {
3382
+ configEnvironment(m, b, C) {
3383
+ return m === "ssr" || m === "ssg" ? {
3269
3384
  resolve: {
3270
- noExternal: [we, be, He, se]
3385
+ noExternal: [we, ye, Ke, se]
3271
3386
  }
3272
- } : g === "production" ? {
3387
+ } : c === "production" ? {
3273
3388
  resolve: {
3274
3389
  conditions: ["min"]
3275
3390
  }
3276
3391
  } : {};
3277
3392
  },
3278
- async configResolved(v) {
3279
- if (i = v.base, !(i.startsWith("/") && i.endsWith("/")))
3393
+ async configResolved(m) {
3394
+ if (r = m.base, !(r.startsWith("/") && r.endsWith("/")))
3280
3395
  throw new Error("vite's config.base must begin and end with /");
3281
- if (v.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && w.setSourceMapSupport(!0), h ? w.normalizeOptions(h) : w.normalizeOptions(t), e === "build" && !t.csr && w.getOptions().target === "client") {
3282
- const x = ["vite:build-import-analysis"], $ = v.plugins;
3283
- for (const _ of x) {
3284
- const O = $.findIndex((Q) => Q?.name === _);
3285
- O >= 0 && $.splice(O, 1);
3396
+ if (m.build.sourcemap && t.optimizerOptions?.sourcemap === void 0 && u.setSourceMapSupport(!0), w ? u.normalizeOptions(w) : u.normalizeOptions(t), e === "build" && !t.csr && u.getOptions().target === "client") {
3397
+ const C = ["vite:build-import-analysis"], $ = m.plugins;
3398
+ for (const I of C) {
3399
+ const T = $.findIndex((z) => z?.name === I);
3400
+ T >= 0 && $.splice(T, 1);
3286
3401
  }
3287
3402
  }
3288
3403
  },
3289
3404
  async buildStart() {
3290
- u.length = 0;
3291
- const v = this.resolve.bind(this);
3292
- await w.validateSource(v), w.onDiagnostics((k, x, $) => {
3293
- k.forEach((_) => {
3294
- const O = w.normalizePath(x.sys.path.join($, _.file));
3295
- _.category === "error" ? this.error(Je(O, _)) : this.warn(Je(O, _));
3405
+ d.length = 0;
3406
+ const m = this.resolve.bind(this);
3407
+ await u.validateSource(m), u.onDiagnostics((b, C, $) => {
3408
+ b.forEach((I) => {
3409
+ const T = u.normalizePath(C.sys.path.join($, I.file));
3410
+ I.category === "error" ? this.error(Ve(T, I)) : this.warn(Ve(T, I));
3296
3411
  });
3297
- }), await w.buildStart(this), e === "build" && w.getOptions().target === "client" && Di(this);
3412
+ }), await u.buildStart(this), e === "build" && u.getOptions().target === "client" && Vi(this);
3298
3413
  },
3299
- resolveId(v, k, x) {
3300
- if (v.endsWith(nt))
3301
- return nt;
3302
- if (Pi(v))
3303
- return Fe;
3304
- const $ = d(v, "resolveId");
3305
- return ae(v) || !$ ? null : w.resolveId(this, v, k, x);
3414
+ resolveId(m, b, C) {
3415
+ if (m.endsWith(st))
3416
+ return st;
3417
+ if (Xi(m))
3418
+ return We;
3419
+ const $ = v(m, "resolveId");
3420
+ return ne(m) || !$ ? null : u.resolveId(this, m, b, C);
3306
3421
  },
3307
- load(v, k) {
3308
- if (v === nt)
3309
- return { code: Fi };
3310
- if (v === Fe)
3311
- return Ni();
3312
- const x = d(v, "load");
3313
- return ae(v) || !x ? null : (v = w.normalizePath(v), e === "serve" && v.endsWith(oe) ? {
3422
+ load(m, b) {
3423
+ if (m === st)
3424
+ return { code: co };
3425
+ if (m === We)
3426
+ return Zi();
3427
+ const C = v(m, "load");
3428
+ return ne(m) || !C ? null : (m = u.normalizePath(m), e === "serve" && m.endsWith(oe) ? {
3314
3429
  code: "export const manifest = undefined;"
3315
- } : w.load(this, v, k));
3430
+ } : u.load(this, m, b));
3316
3431
  },
3317
- transform(v, k, x) {
3318
- if (k.includes(".vite/deps/") && v.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(v)) {
3319
- const O = c && k.startsWith(c) ? k.slice(c.length) : k;
3432
+ transform(m, b, C) {
3433
+ if (b.includes(".vite/deps/") && m.slice(0, 5e3).includes("qwik") && /import[^\n]*qwik[^\n]*\n/.test(m)) {
3434
+ const T = l && b.startsWith(l) ? b.slice(l.length) : b;
3320
3435
  throw new Error(
3321
3436
  `
3322
3437
 
@@ -3325,148 +3440,148 @@ function Hi(t = {}) {
3325
3440
  ⚠️ IMPORTANT: This dependency was pre-bundled by Vite, but it seems to use Qwik, which needs processing by the optimizer.
3326
3441
 
3327
3442
  👉 Please add the original modulename to the "optimizeDeps.exclude" array in your Vite config
3328
- 👉 ${O}
3443
+ 👉 ${T}
3329
3444
 
3330
3445
  ==============
3331
3446
 
3332
3447
  `
3333
3448
  );
3334
3449
  }
3335
- const $ = d(k, "transform"), _ = k.includes("?raw");
3336
- return ae(k) || !$ || _ ? null : w.transform(this, v, k, x);
3450
+ const $ = v(b, "transform"), I = b.includes("?raw");
3451
+ return ne(b) || !$ || I ? null : u.transform(this, m, b, C);
3337
3452
  }
3338
3453
  }, {
3339
3454
  name: "vite-plugin-qwik-post",
3340
3455
  enforce: "post",
3341
3456
  generateBundle: {
3342
3457
  order: "post",
3343
- async handler(v, k) {
3344
- const x = this.environment.config.consumer === "client", $ = this.environment.config.consumer === "server";
3345
- if (x) {
3346
- const _ = w.getOptions();
3347
- for (const [F, R] of Object.entries(k))
3348
- if (R.type === "asset") {
3349
- const J = i + F;
3350
- if (qi.some((K) => F.endsWith(K)))
3351
- typeof R.source == "string" && R.source.length < _.inlineStylesUpToBytes ? u.push({
3458
+ async handler(m, b) {
3459
+ const C = this.environment.config.consumer === "client", $ = this.environment.config.consumer === "server";
3460
+ if (C) {
3461
+ const I = u.getOptions();
3462
+ for (const [j, q] of Object.entries(b))
3463
+ if (q.type === "asset") {
3464
+ const A = r + j;
3465
+ if (ao.some((J) => j.endsWith(J)))
3466
+ typeof q.source == "string" && q.source.length < I.inlineStylesUpToBytes ? d.push({
3352
3467
  tag: "style",
3353
3468
  location: "head",
3354
3469
  attributes: {
3355
- "data-src": J,
3356
- dangerouslySetInnerHTML: R.source
3470
+ "data-src": A,
3471
+ dangerouslySetInnerHTML: q.source
3357
3472
  }
3358
- }) : u.push({
3473
+ }) : d.push({
3359
3474
  tag: "link",
3360
3475
  location: "head",
3361
3476
  attributes: {
3362
3477
  rel: "stylesheet",
3363
- href: J
3478
+ href: A
3364
3479
  }
3365
3480
  });
3366
3481
  else {
3367
- const K = Bi.find((X) => F.endsWith(X));
3368
- K && !f && u.unshift({
3482
+ const J = lo.find((X) => j.endsWith(X));
3483
+ J && !g && d.unshift({
3369
3484
  tag: "link",
3370
3485
  location: "head",
3371
3486
  attributes: {
3372
3487
  rel: "preload",
3373
- href: J,
3488
+ href: A,
3374
3489
  as: "font",
3375
- type: `font/${K.slice(1)}`,
3490
+ type: `font/${J.slice(1)}`,
3376
3491
  crossorigin: ""
3377
3492
  }
3378
3493
  });
3379
3494
  }
3380
3495
  }
3381
- const O = await w.generateManifest(
3496
+ const T = await u.generateManifest(
3382
3497
  this,
3383
- k,
3384
- T,
3498
+ b,
3499
+ p,
3385
3500
  {
3386
- injections: u,
3501
+ injections: d,
3387
3502
  platform: { vite: "" }
3388
3503
  }
3389
- ), Q = Kn(O, i);
3390
- for (const F of Object.values(k))
3391
- F.type === "chunk" && (F.code = Kt(F.code, Q));
3392
- Oi(k);
3393
- } else $ && Ri(k, n);
3504
+ ), z = yr(T, r);
3505
+ for (const j of Object.values(b))
3506
+ j.type === "chunk" && (j.code = ln(j.code, z));
3507
+ to(b);
3508
+ } else $ && no(b, u.getOptions().manifestInput);
3394
3509
  }
3395
3510
  },
3396
- async writeBundle(v, k) {
3397
- const x = w.getOptions();
3511
+ async writeBundle(m, b) {
3512
+ const C = u.getOptions();
3398
3513
  if (this.environment.config.consumer === "server") {
3399
- const _ = w.getSys();
3400
- if (_.env === "node" || _.env === "bun" || _.env === "deno") {
3401
- const O = Object.keys(k), Q = async (F) => {
3514
+ const I = u.getSys();
3515
+ if (I.env === "node" || I.env === "bun" || I.env === "deno") {
3516
+ const T = Object.keys(b), z = async (j) => {
3402
3517
  try {
3403
- const R = _.path.basename(F), J = _.path.extname(R);
3404
- if ((R.startsWith("entry.") || R.startsWith("entry_")) && !R.includes("preview") && (J === ".mjs" || J === ".cjs")) {
3405
- const X = _.path.basename(R, J), te = `${X}.js`, ce = X + J;
3406
- if (!O.some((z) => _.path.basename(z) === te)) {
3407
- const z = _.path.dirname(F), de = await _.dynamicImport("node:fs"), A = _.path.join(x.outDir, z);
3408
- await de.promises.mkdir(A, { recursive: !0 }), await de.promises.writeFile(
3409
- _.path.join(A, te),
3410
- `export * from "./${ce}";`
3518
+ const q = I.path.basename(j), A = I.path.extname(q);
3519
+ if ((q.startsWith("entry.") || q.startsWith("entry_")) && !q.includes("preview") && (A === ".mjs" || A === ".cjs")) {
3520
+ const X = I.path.basename(q, A), Y = `${X}.js`, ae = X + A;
3521
+ if (!T.some((le) => I.path.basename(le) === Y)) {
3522
+ const le = I.path.dirname(j), V = await I.dynamicImport("node:fs"), de = I.path.join(m.dir || C.outDir, le);
3523
+ await V.promises.mkdir(de, { recursive: !0 }), await V.promises.writeFile(
3524
+ I.path.join(de, Y),
3525
+ `export * from "./${ae}";`
3411
3526
  );
3412
3527
  }
3413
3528
  }
3414
- } catch (R) {
3415
- console.error("patchModuleFormat", R);
3529
+ } catch (q) {
3530
+ console.error("patchModuleFormat", q);
3416
3531
  }
3417
3532
  };
3418
- await Promise.all(O.map(Q));
3533
+ await Promise.all(T.map(z));
3419
3534
  }
3420
3535
  }
3421
3536
  },
3422
3537
  transformIndexHtml() {
3423
3538
  if (e === "serve")
3424
- return Er(w.getOptions(), i);
3539
+ return Wr(u.getOptions(), r);
3425
3540
  },
3426
- configureServer(v) {
3427
- m = v, w.configureServer(v), (t?.devTools?.imageDevTools ?? !0) && v.middlewares.use(Ii(w.getSys(), c, l));
3541
+ configureServer(m) {
3542
+ h = m, u.configureServer(m), (t?.devTools?.imageDevTools ?? !0) && m.middlewares.use(Qi(u.getSys(), l, s));
3428
3543
  },
3429
- configurePreviewServer(v) {
3544
+ configurePreviewServer(m) {
3430
3545
  return async () => {
3431
- const k = w.getSys(), x = w.getPath();
3432
- await kr(v.middlewares, o, k, x);
3546
+ const b = u.getSys(), C = u.getPath();
3547
+ await zr(m.middlewares, a, b, C);
3433
3548
  };
3434
3549
  },
3435
- hotUpdate(v) {
3436
- w.hotUpdate(this.environment, v);
3437
- const k = t?.devTools?.hmr ?? !0;
3438
- if (this.environment.name === "ssr" && v.modules.length)
3439
- if (k) {
3440
- const x = /* @__PURE__ */ new Set(), $ = (_) => /\.([mc]?[jt]sx?|mdx?)$/.test(_.split("?")[0]);
3441
- for (const _ of v.modules) {
3442
- const O = _.url.split("?")[0];
3443
- if (_.type === "js" && $(_.url))
3444
- x.add(O);
3550
+ hotUpdate(m) {
3551
+ u.hotUpdate(this.environment, m);
3552
+ const b = t?.devTools?.hmr ?? !0;
3553
+ if (this.environment.name === "ssr" && m.modules.length)
3554
+ if (b) {
3555
+ const C = /* @__PURE__ */ new Set(), $ = (I) => /\.([mc]?[jt]sx?|mdx?)$/.test(I.split("?")[0]);
3556
+ for (const I of m.modules) {
3557
+ const T = I.url.split("?")[0];
3558
+ if (I.type === "js" && $(I.url))
3559
+ C.add(T);
3445
3560
  else
3446
- for (const Q of _.importers)
3447
- Q.type === "js" && $(Q.url) && x.add(Q.url.split("?")[0]);
3561
+ for (const z of I.importers)
3562
+ z.type === "js" && $(z.url) && C.add(z.url.split("?")[0]);
3448
3563
  }
3449
- x.size > 0 && m && m.environments.client.hot.send({
3564
+ C.size > 0 && h && h.environments.client.hot.send({
3450
3565
  type: "custom",
3451
3566
  event: "qwik:hmr",
3452
- data: { files: [...x], t: v.timestamp }
3567
+ data: { files: [...C], t: m.timestamp }
3453
3568
  });
3454
3569
  } else
3455
- m?.environments.client.hot.send({ type: "full-reload" });
3570
+ h?.environments.client.hot.send({ type: "full-reload" });
3456
3571
  },
3457
- onLog(v, k) {
3458
- if (k.plugin == "vite-plugin-qwik") {
3459
- const x = zi[v] || le.White, $ = (k.frame || "").split(`
3572
+ onLog(m, b) {
3573
+ if (b.plugin == "vite-plugin-qwik") {
3574
+ const C = fo[m] || ce.White, $ = (b.frame || "").split(`
3460
3575
  `).map(
3461
- (_) => (_.match(/^\s*\^\s*$/) ? le.BrightWhite : le.BrightBlack) + _
3576
+ (I) => (I.match(/^\s*\^\s*$/) ? ce.BrightWhite : ce.BrightBlack) + I
3462
3577
  );
3463
- return console[v](
3464
- `${x}%s
3465
- ${le.BrightWhite}%s
3466
- %s${le.RESET}`,
3467
- `[${k.plugin}](${v}): ${k.message}
3578
+ return console[m](
3579
+ `${C}%s
3580
+ ${ce.BrightWhite}%s
3581
+ %s${ce.RESET}`,
3582
+ `[${b.plugin}](${m}): ${b.message}
3468
3583
  `,
3469
- ` ${k?.loc?.file}:${k?.loc?.line}:${k?.loc?.column}
3584
+ ` ${b?.loc?.file}:${b?.loc?.line}:${b?.loc?.column}
3470
3585
  `,
3471
3586
  ` ${$.join(`
3472
3587
  `)}
@@ -3474,140 +3589,140 @@ ${le.BrightWhite}%s
3474
3589
  ), !1;
3475
3590
  }
3476
3591
  }
3477
- }, Ai()];
3592
+ }, uo()];
3478
3593
  }
3479
- async function Ai() {
3594
+ async function uo() {
3480
3595
  let t, e, n = !1;
3481
3596
  async function r() {
3482
3597
  if (n)
3483
3598
  return !0;
3484
3599
  try {
3485
- return t = await import("node:fs").then((m) => m.promises), e = await import("node:path"), n = !0, !0;
3600
+ return t = await import("node:fs").then((w) => w.promises), e = await import("node:path"), n = !0, !0;
3486
3601
  } catch {
3487
3602
  return !1;
3488
3603
  }
3489
3604
  }
3490
3605
  const i = /* @__PURE__ */ new Set(), s = [];
3491
- let a;
3492
- const l = "@qwik.dev/core", c = "@builder.io/qwik";
3493
- async function o(m) {
3494
- const b = /* @__PURE__ */ new Set();
3495
- let h = m;
3496
- for (; h; ) {
3606
+ let l;
3607
+ const a = "@qwik.dev/core", c = "@builder.io/qwik";
3608
+ async function h(w) {
3609
+ const v = /* @__PURE__ */ new Set();
3610
+ let g = w;
3611
+ for (; g; ) {
3497
3612
  try {
3498
- const f = e.join(h, "package.json"), u = await t.readFile(f, { encoding: "utf-8" }), w = JSON.parse(u);
3499
- for (const T of Object.keys(w.dependencies || {}))
3500
- b.add(T);
3501
- for (const T of Object.keys(w.devDependencies || {}))
3502
- b.add(T);
3503
- for (const T of Object.keys(w.optionalDependencies || {}))
3504
- b.add(T);
3613
+ const u = e.join(g, "package.json"), p = await t.readFile(u, { encoding: "utf-8" }), x = JSON.parse(p);
3614
+ for (const R of Object.keys(x.dependencies || {}))
3615
+ v.add(R);
3616
+ for (const R of Object.keys(x.devDependencies || {}))
3617
+ v.add(R);
3618
+ for (const R of Object.keys(x.optionalDependencies || {}))
3619
+ v.add(R);
3505
3620
  } catch {
3506
3621
  }
3507
- const d = e.dirname(h);
3508
- if (d === h)
3622
+ const d = e.dirname(g);
3623
+ if (d === g)
3509
3624
  break;
3510
- h = d;
3625
+ g = d;
3511
3626
  }
3512
- return [...b];
3627
+ return [...v];
3513
3628
  }
3514
- async function g(m, b) {
3515
- for (; b; ) {
3516
- const h = e.join(b, "node_modules", m, "package.json");
3629
+ async function o(w, v) {
3630
+ for (; v; ) {
3631
+ const g = e.join(v, "node_modules", w, "package.json");
3517
3632
  try {
3518
- await t.access(h);
3519
- const f = await t.readFile(h, {
3633
+ await t.access(g);
3634
+ const u = await t.readFile(g, {
3520
3635
  encoding: "utf-8"
3521
- }), u = JSON.parse(f);
3522
- return !!(u.qwik || u.dependencies?.[l] || u.peerDependencies?.[l] || u.devDependencies?.[l] || u.dependencies?.[c] || u.peerDependencies?.[c] || u.devDependencies?.[c]);
3636
+ }), p = JSON.parse(u);
3637
+ return !!(p.qwik || p.dependencies?.[a] || p.peerDependencies?.[a] || p.devDependencies?.[a] || p.dependencies?.[c] || p.peerDependencies?.[c] || p.devDependencies?.[c]);
3523
3638
  } catch {
3524
3639
  }
3525
- const d = e.dirname(b);
3526
- if (d === b)
3640
+ const d = e.dirname(v);
3641
+ if (d === v)
3527
3642
  break;
3528
- b = d;
3643
+ v = d;
3529
3644
  }
3530
3645
  return !1;
3531
3646
  }
3532
3647
  return {
3533
3648
  name: "checkQwikExternals",
3534
3649
  enforce: "pre",
3535
- configResolved: (m) => {
3536
- a = m.root;
3650
+ configResolved: (w) => {
3651
+ l = w.root;
3537
3652
  },
3538
3653
  // Attempt to mark the Qwik dependencies as non-optimizeable
3539
3654
  config: {
3540
3655
  order: "post",
3541
- async handler(m) {
3656
+ async handler(w) {
3542
3657
  if (!await r())
3543
3658
  return;
3544
- const b = m.root || process.cwd(), h = m.optimizeDeps?.exclude ?? [], d = await o(b);
3659
+ const v = w.root || process.cwd(), g = w.optimizeDeps?.exclude ?? [], d = await h(v);
3545
3660
  s.length = 0;
3546
- for (const u of d)
3547
- await g(u, b) && s.push(u);
3548
- const f = s.filter((u) => !h.includes(u));
3661
+ for (const p of d)
3662
+ await o(p, v) && s.push(p);
3663
+ const u = s.filter((p) => !g.includes(p));
3549
3664
  return {
3550
- optimizeDeps: { exclude: f },
3551
- ssr: { noExternal: f }
3665
+ optimizeDeps: { exclude: u },
3666
+ ssr: { noExternal: u }
3552
3667
  };
3553
3668
  }
3554
3669
  },
3555
3670
  // qwik deps need to be marked as noExternal per-environment
3556
- configEnvironment(m, b) {
3671
+ configEnvironment(w, v) {
3557
3672
  if (s.length === 0)
3558
3673
  return;
3559
- const h = b.resolve?.noExternal;
3560
- if (h === !0)
3674
+ const g = v.resolve?.noExternal;
3675
+ if (g === !0)
3561
3676
  return;
3562
3677
  let d;
3563
- return Array.isArray(h) ? d = h : h ? d = [h] : d = [], {
3678
+ return Array.isArray(g) ? d = g : g ? d = [g] : d = [], {
3564
3679
  resolve: { noExternal: [...d, ...s] }
3565
3680
  };
3566
3681
  },
3567
3682
  // We check all SSR build lookups for external Qwik deps
3568
3683
  resolveId: {
3569
3684
  order: "pre",
3570
- async handler(m, b, h) {
3571
- if (!await r() || !(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(m) || i.has(m))
3685
+ async handler(w, v, g) {
3686
+ if (!await r() || !(this.environment.config.consumer === "server") || /^([./]|node:|[^a-z@])/i.test(w) || i.has(w))
3572
3687
  return;
3573
- const f = (m.startsWith("@") ? m.split("/").slice(0, 2).join("/") : m.split("/")[0]).split("?")[0];
3574
- if (i.has(f))
3688
+ const u = (w.startsWith("@") ? w.split("/").slice(0, 2).join("/") : w.split("/")[0]).split("?")[0];
3689
+ if (i.has(u))
3575
3690
  return;
3576
- i.add(m), i.add(f);
3577
- let u;
3691
+ i.add(w), i.add(u);
3692
+ let p;
3578
3693
  try {
3579
- u = await this.resolve(f, b, { ...h, skipSelf: !0 });
3694
+ p = await this.resolve(u, v, { ...g, skipSelf: !0 });
3580
3695
  } catch {
3581
3696
  return;
3582
3697
  }
3583
- if (u?.external && await g(f, b ? e.dirname(b) : a))
3698
+ if (p?.external && await o(u, v ? e.dirname(v) : l))
3584
3699
  throw new Error(
3585
3700
  `
3586
3701
  ==============
3587
- ${f} 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.
3702
+ ${u} 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.
3588
3703
  Please add the package to "ssr.noExternal[]" as well as "optimizeDeps.exclude[]" in the Vite config.
3589
3704
  ==============
3590
3705
  `
3591
3706
  );
3592
- if (f === m)
3593
- return u;
3707
+ if (u === w)
3708
+ return p;
3594
3709
  }
3595
3710
  }
3596
3711
  };
3597
3712
  }
3598
- const le = {
3713
+ const ce = {
3599
3714
  Yellow: "\x1B[33m",
3600
3715
  Cyan: "\x1B[36m",
3601
3716
  White: "\x1B[37m",
3602
3717
  BrightBlack: "\x1B[90m",
3603
3718
  BrightWhite: "\x1B[97m",
3604
3719
  RESET: "\x1B[0m"
3605
- }, zi = {
3606
- warn: le.Yellow,
3607
- info: le.Cyan,
3608
- debug: le.BrightBlack
3720
+ }, fo = {
3721
+ warn: ce.Yellow,
3722
+ info: ce.Cyan,
3723
+ debug: ce.BrightBlack
3609
3724
  };
3610
3725
  export {
3611
- Wi as qwikRollup,
3612
- Hi as qwikVite
3726
+ ho as qwikRollup,
3727
+ po as qwikVite
3613
3728
  };