@qwik.dev/core 2.0.0-beta.3 → 2.0.0-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/backpatch/index.d.ts +2 -0
  2. package/dist/backpatch/index.mjs +5 -0
  3. package/dist/backpatch/package.json +8 -0
  4. package/dist/backpatch-executor.debug.js +39 -0
  5. package/dist/backpatch-executor.js +1 -0
  6. package/dist/build/package.json +1 -1
  7. package/dist/cli.mjs +12961 -0
  8. package/dist/core-internal.d.ts +1117 -707
  9. package/dist/core.min.mjs +2 -1
  10. package/dist/core.mjs +12216 -8953
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/core.prod.mjs +8677 -5376
  13. package/dist/insights/index.qwik.mjs +80 -57
  14. package/dist/insights/vite/index.mjs +36 -33
  15. package/dist/loader/index.mjs +2 -2
  16. package/dist/loader/package.json +1 -1
  17. package/dist/optimizer.d.ts +47 -278
  18. package/dist/optimizer.mjs +2427 -3791
  19. package/dist/preloader.mjs +212 -117
  20. package/dist/qwikloader.debug.js +173 -135
  21. package/dist/qwikloader.js +1 -1
  22. package/dist/server.d.ts +51 -203
  23. package/dist/server.mjs +1661 -1157
  24. package/dist/server.prod.mjs +3452 -0
  25. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +2 -2
  26. package/dist/starters/adapters/aws-lambda/package.json +3 -2
  27. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -6
  28. package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +2 -2
  29. package/dist/starters/adapters/azure-swa/package.json +3 -2
  30. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -3
  31. package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +3 -3
  32. package/dist/starters/adapters/bun/package.json +3 -2
  33. package/dist/starters/adapters/bun/src/entry.bun.ts +0 -2
  34. package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +2 -2
  35. package/dist/starters/adapters/cloud-run/package.json +3 -2
  36. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
  37. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +2 -2
  38. package/dist/starters/adapters/cloudflare-pages/package.json +3 -2
  39. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -3
  40. package/dist/starters/adapters/cloudflare-workers/README.md +52 -0
  41. package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +15 -0
  42. package/dist/starters/adapters/cloudflare-workers/gitignore +3 -0
  43. package/dist/starters/adapters/cloudflare-workers/package.json +31 -0
  44. package/dist/starters/adapters/cloudflare-workers/public/.assetsignore +4 -0
  45. package/dist/starters/adapters/cloudflare-workers/public/_headers +11 -0
  46. package/dist/starters/adapters/cloudflare-workers/public/_redirects +1 -0
  47. package/dist/starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx +23 -0
  48. package/dist/starters/adapters/cloudflare-workers/worker-configuration.d.ts +5 -0
  49. package/dist/starters/adapters/cloudflare-workers/wrangler.jsonc +41 -0
  50. package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +2 -2
  51. package/dist/starters/adapters/deno/package.json +3 -2
  52. package/dist/starters/adapters/deno/src/entry.deno.ts +0 -2
  53. package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +2 -2
  54. package/dist/starters/adapters/express/package.json +4 -3
  55. package/dist/starters/adapters/express/src/entry.express.tsx +1 -3
  56. package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +2 -2
  57. package/dist/starters/adapters/fastify/package.json +4 -3
  58. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +1 -1
  59. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
  60. package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +2 -2
  61. package/dist/starters/adapters/firebase/package.json +3 -2
  62. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -3
  63. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +2 -2
  64. package/dist/starters/adapters/netlify-edge/package.json +5 -4
  65. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -3
  66. package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +2 -2
  67. package/dist/starters/adapters/node-server/package.json +3 -2
  68. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +0 -2
  69. package/dist/starters/adapters/{static/adapters/static/vite.config.mts → ssg/adapters/ssg/vite.config.ts} +3 -3
  70. package/dist/starters/adapters/ssg/package.json +20 -0
  71. package/dist/starters/adapters/vercel-edge/README.md +2 -2
  72. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/{vite.config.mts → vite.config.ts} +2 -2
  73. package/dist/starters/adapters/vercel-edge/package.json +3 -2
  74. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -3
  75. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  76. package/dist/starters/features/auth/package.json +1 -1
  77. package/dist/starters/features/compiled-i18n/package.json +37 -0
  78. package/dist/starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx +30 -0
  79. package/dist/starters/features/compiled-i18n/src/entry.ssr.tsx +31 -0
  80. package/dist/starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts +28 -0
  81. package/dist/starters/features/csr/index.html +27 -0
  82. package/dist/starters/features/csr/package.json +29 -0
  83. package/dist/starters/features/csr/src/root.tsx +15 -0
  84. package/dist/starters/features/csr/vite.config.ts +13 -0
  85. package/dist/starters/features/cypress/src/actions/example.action.ts +5 -0
  86. package/dist/starters/features/cypress/src/components/example/example.cy.tsx +50 -8
  87. package/dist/starters/features/cypress/src/components/example/example.tsx +13 -3
  88. package/dist/starters/features/cypress/src/loaders/example.loader.ts +5 -0
  89. package/dist/starters/features/pandacss/package.json +1 -1
  90. package/dist/starters/features/postcss/postcss.config.js +1 -1
  91. package/dist/starters/features/storybook/.storybook/tsconfig.json +0 -1
  92. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  93. package/dist/starters/features/tailwind/package.json +2 -2
  94. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  95. package/dist/starters/features/tailwind-v3/package.json +1 -1
  96. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  97. package/dist/testing/index.d.ts +928 -6
  98. package/dist/testing/index.mjs +16212 -11578
  99. package/dist/testing/package.json +1 -1
  100. package/handlers.mjs +1 -1
  101. package/package.json +34 -56
  102. package/public.d.ts +5 -1
  103. package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
  104. package/server.d.ts +2 -0
  105. package/bindings/qwik.darwin-arm64.node +0 -0
  106. package/bindings/qwik.darwin-x64.node +0 -0
  107. package/bindings/qwik.linux-x64-gnu.node +0 -0
  108. package/bindings/qwik.wasm.cjs +0 -471
  109. package/bindings/qwik.wasm.mjs +0 -464
  110. package/bindings/qwik.win32-x64-msvc.node +0 -0
  111. package/bindings/qwik_wasm_bg.wasm +0 -0
  112. package/dist/build/index.cjs +0 -35
  113. package/dist/build/index.cjs.map +0 -7
  114. package/dist/build/index.dev.cjs +0 -37
  115. package/dist/build/index.dev.cjs.map +0 -7
  116. package/dist/build/index.prod.cjs +0 -37
  117. package/dist/build/index.prod.cjs.map +0 -7
  118. package/dist/cli.cjs +0 -5545
  119. package/dist/core.cjs +0 -11800
  120. package/dist/core.cjs.map +0 -1
  121. package/dist/core.prod.cjs +0 -5661
  122. package/dist/insights/index.qwik.cjs +0 -1
  123. package/dist/insights/vite/index.cjs +0 -1
  124. package/dist/loader/index.cjs +0 -4
  125. package/dist/optimizer.cjs +0 -4020
  126. package/dist/preloader.cjs +0 -269
  127. package/dist/server.cjs +0 -3037
  128. package/dist/starters/adapters/static/package.json +0 -19
  129. package/dist/starters/features/localize/package.json +0 -37
  130. package/dist/starters/features/localize/src/entry.ssr.tsx +0 -30
  131. package/dist/starters/features/localize/src/locales/message.en.json +0 -8
  132. package/dist/starters/features/localize/src/locales/message.it.json +0 -8
  133. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +0 -94
  134. package/dist/starters/features/localize/src/routes/[locale]/index.tsx +0 -52
  135. package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +0 -12
  136. package/dist/starters/features/playwright/playwright-report/index.html +0 -22026
  137. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
  138. package/dist/testing/index.cjs +0 -33331
  139. /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
@@ -1,72 +1,95 @@
1
- import { sync$ as k, component$ as L, isDev as R } from "@qwik.dev/core";
2
- import { jsx as $ } from "@qwik.dev/core/jsx-runtime";
3
- const Q = k(
4
- () => ((o, i, S, c, g, l, b) => {
5
- var y = __QI_KEY__, h = __QI_URL__, w = i.querySelector("[q\\:version]")?.getAttribute("q:version") || "unknown", d = i.querySelector("[q\\:manifest-hash]")?.getAttribute("q:manifest-hash") || "dev", s = [], f = /* @__PURE__ */ new Set(), r = 0, q = 0, a, v = g.now(), m = i.querySelector("[q\\:route]"), p = () => {
6
- if (a = void 0, s.length > r) {
7
- var t = {
8
- qVersion: w,
9
- publicApiKey: y,
10
- manifestHash: d,
11
- previousSymbol: r == 0 ? void 0 : s[r - 1].symbol,
12
- symbols: s.slice(r)
1
+ import { sync$, component$, isDev } from "@qwik.dev/core";
2
+ import { jsx } from "@qwik.dev/core/jsx-runtime";
3
+ const insightsPing = sync$(
4
+ () => ((w, d, l, n, p, r, S) => {
5
+ var publicApiKey = __QI_KEY__, postUrl = __QI_URL__, qVersion = d.querySelector(`[q\\:version]`)?.getAttribute(`q:version`) || "unknown", manifestHash = d.querySelector(`[q\\:manifest-hash]`)?.getAttribute(`q:manifest-hash`) || "dev", qSymbols = [], existingSymbols = /* @__PURE__ */ new Set(), flushSymbolIndex = 0, lastReqTime = 0, timeoutID, qRouteChangeTime = p.now(), qRouteEl = d.querySelector(`[q\\:route]`), flush = () => {
6
+ timeoutID = void 0;
7
+ if (qSymbols.length > flushSymbolIndex) {
8
+ var payload = {
9
+ qVersion,
10
+ publicApiKey,
11
+ manifestHash,
12
+ previousSymbol: flushSymbolIndex == 0 ? void 0 : qSymbols[flushSymbolIndex - 1].symbol,
13
+ symbols: qSymbols.slice(flushSymbolIndex)
13
14
  };
14
- c.sendBeacon(h, b(t)), r = s.length;
15
+ n.sendBeacon(postUrl, S(payload));
16
+ flushSymbolIndex = qSymbols.length;
15
17
  }
16
- }, T = () => {
17
- a != null && clearTimeout(a), a = setTimeout(p, 1e3);
18
+ }, debounceFlush = () => {
19
+ timeoutID != void 0 && clearTimeout(timeoutID);
20
+ timeoutID = setTimeout(flush, 1e3);
18
21
  };
19
- o.qSymbolTracker = {
20
- symbols: s,
21
- publicApiKey: y
22
- }, m && new MutationObserver((t) => {
23
- var e = t.find((n) => n.attributeName === "q:route");
24
- e && (v = g.now());
25
- }).observe(m, { attributes: !0 }), i.addEventListener("visibilitychange", () => i.visibilityState === "hidden" && p()), i.addEventListener("qsymbol", (t) => {
26
- var e = t, n = e.detail, u = n.reqTime, I = e.timeStamp, _ = n.symbol;
27
- if (!f.has(_)) {
28
- f.add(_);
29
- var E = m?.getAttribute("q:route") || "/";
30
- s.push({
31
- symbol: _,
32
- route: E,
33
- delay: l(0 - q + u),
34
- latency: l(I - u),
35
- timeline: l(0 - v + u),
36
- interaction: !!n.element
37
- }), q = I, T();
22
+ w.qSymbolTracker = {
23
+ symbols: qSymbols,
24
+ publicApiKey
25
+ };
26
+ if (qRouteEl) {
27
+ new MutationObserver((mutations) => {
28
+ var mutation = mutations.find((m) => m.attributeName === `q:route`);
29
+ if (mutation) {
30
+ qRouteChangeTime = p.now();
31
+ }
32
+ }).observe(qRouteEl, { attributes: true });
33
+ }
34
+ d.addEventListener("visibilitychange", () => d.visibilityState === "hidden" && flush());
35
+ d.addEventListener(`qsymbol`, (_event) => {
36
+ var event = _event, detail = event.detail, symbolRequestTime = detail.reqTime, symbolDeliveredTime = event.timeStamp, symbol = detail.symbol;
37
+ if (!existingSymbols.has(symbol)) {
38
+ existingSymbols.add(symbol);
39
+ var route = qRouteEl?.getAttribute(`q:route`) || "/";
40
+ qSymbols.push({
41
+ symbol,
42
+ route,
43
+ delay: r(0 - lastReqTime + symbolRequestTime),
44
+ latency: r(symbolDeliveredTime - symbolRequestTime),
45
+ timeline: r(0 - qRouteChangeTime + symbolRequestTime),
46
+ interaction: !!detail.element
47
+ });
48
+ lastReqTime = symbolDeliveredTime;
49
+ debounceFlush();
38
50
  }
39
- }), o.addEventListener("error", (t) => {
40
- var e = t.error;
41
- if (e && typeof e == "object") {
42
- var n = {
43
- url: `${S}`,
44
- manifestHash: d,
45
- timestamp: (/* @__PURE__ */ new Date()).getTime(),
46
- source: t.filename,
47
- line: t.lineno,
48
- column: t.colno,
49
- message: t.message,
50
- error: "message" in e ? e.message : `${e}`,
51
- stack: "stack" in e && e.stack || ""
52
- };
53
- c.sendBeacon(`${h}error/`, b(n));
51
+ });
52
+ w.addEventListener("error", (event) => {
53
+ var error = event.error;
54
+ if (!(error && typeof error === "object")) {
55
+ return;
54
56
  }
57
+ var payload = {
58
+ url: `${l}`,
59
+ manifestHash,
60
+ timestamp: (/* @__PURE__ */ new Date()).getTime(),
61
+ source: event.filename,
62
+ line: event.lineno,
63
+ column: event.colno,
64
+ message: event.message,
65
+ error: "message" in error ? error.message : `${error}`,
66
+ stack: "stack" in error ? error.stack || "" : ""
67
+ };
68
+ n.sendBeacon(`${postUrl}error/`, S(payload));
55
69
  });
56
70
  })(window, document, location, navigator, performance, Math.round, JSON.stringify)
57
- ), N = L(() => {
58
- if (!__EXPERIMENTAL__.insights)
71
+ );
72
+ const Insights = component$(() => {
73
+ if (!__EXPERIMENTAL__.insights) {
59
74
  throw new Error(
60
75
  'Insights is experimental and must be enabled with `experimental: ["insights"]` in the `qwikVite` plugin.'
61
76
  );
62
- const o = globalThis.__QI_KEY__, i = globalThis.__QI_URL__;
63
- return !o || !i ? (R || console.warn("<Insights />: no config from qwikInsights plugin, skipping..."), null) : /* @__PURE__ */ $("script", {
64
- "document:onQInit$": Q,
77
+ }
78
+ const key = globalThis.__QI_KEY__;
79
+ const url = globalThis.__QI_URL__;
80
+ if (!key || !url) {
81
+ if (!isDev) {
82
+ console.warn("<Insights />: no config from qwikInsights plugin, skipping...");
83
+ }
84
+ return null;
85
+ }
86
+ return /* @__PURE__ */ jsx("script", {
87
+ "document:onQInit$": insightsPing,
65
88
  // We must pass the vite injected variables via window because sync$ code doesn't get replaced by the vite plugin
66
- dangerouslySetInnerHTML: `__QI_KEY__=${JSON.stringify(o)};__QI_URL__=${JSON.stringify(i)}`
89
+ dangerouslySetInnerHTML: `__QI_KEY__=${JSON.stringify(key)};__QI_URL__=${JSON.stringify(url)}`
67
90
  });
68
91
  });
69
92
  export {
70
- N as Insights,
71
- Q as insightsPing
93
+ Insights,
94
+ insightsPing
72
95
  };
@@ -1,31 +1,31 @@
1
- import { existsSync as w, mkdirSync as _ } from "node:fs";
2
- import { readFile as y, writeFile as v } from "node:fs/promises";
3
- import { resolve as k, join as $ } from "node:path";
4
- const q = (r, ...o) => {
5
- console.warn("\x1B[33m%s\x1B[0m", `qwikInsight()[WARN]: ${r}`, ...o);
6
- }, b = (r) => {
1
+ import { existsSync as y, mkdirSync as v } from "node:fs";
2
+ import { readFile as k, writeFile as $ } from "node:fs/promises";
3
+ import { resolve as q, join as B } from "node:path";
4
+ const b = (r, ...a) => {
5
+ console.warn("\x1B[33m%s\x1B[0m", `qwikInsight()[WARN]: ${r}`, ...a);
6
+ }, I = (r) => {
7
7
  console.log("\x1B[35m%s\x1B[0m", `qwikInsight(): ${r}`);
8
8
  };
9
- async function F(r) {
10
- const { publicApiKey: o, baseUrl: I = "https://insights.qwik.dev", outDir: h = "" } = r;
11
- if (!o) {
9
+ async function O(r) {
10
+ const { publicApiKey: a, baseUrl: _ = "https://insights.qwik.dev", outDir: m = "" } = r;
11
+ if (!a) {
12
12
  console.warn("qwikInsights: publicApiKey is required, skipping...");
13
13
  return;
14
14
  }
15
- let f = !1, u, n, i = null, l = null;
16
- const g = `${I}/api/v1/${o}`, p = `${g}/post/`;
17
- async function m() {
18
- return i || (w(n) ? (b("Reading Qwik Insight data from: " + n), i = JSON.parse(await y(n, "utf-8"))) : null);
15
+ let f = !1, g, n, i = null, l = null;
16
+ const u = `${_}/api/v1/${a}`, p = `${u}/post/`;
17
+ async function w() {
18
+ return i || (y(n) ? (I("Reading Qwik Insight data from: " + n), i = JSON.parse(await k(n, "utf-8"))) : null);
19
19
  }
20
20
  return {
21
21
  name: "vite-plugin-qwik-insights",
22
22
  enforce: "pre",
23
23
  // Only activate in production builds
24
24
  apply: "build",
25
- async config(s) {
26
- return u = k(s.root || ".", h), n = $(u, "q-insights.json"), f = s.mode !== "ssr", {
25
+ async config(e) {
26
+ return g = q(e.root || ".", m), n = B(g, "q-insights.json"), f = e.mode !== "ssr", {
27
27
  define: {
28
- "globalThis.__QI_KEY__": JSON.stringify(o),
28
+ "globalThis.__QI_KEY__": JSON.stringify(a),
29
29
  "globalThis.__QI_URL__": JSON.stringify(p)
30
30
  }
31
31
  };
@@ -33,51 +33,54 @@ async function F(r) {
33
33
  configResolved: {
34
34
  // we want to register the bundle graph adder last so we overwrite existing routes
35
35
  order: "post",
36
- async handler(s) {
37
- if (l = s.plugins.find(
36
+ async handler(e) {
37
+ if (l = e.plugins.find(
38
38
  (t) => t.name === "vite-plugin-qwik"
39
39
  ), !l)
40
40
  throw new Error("Missing vite-plugin-qwik");
41
41
  const c = l.api.getOptions();
42
42
  if (f)
43
43
  try {
44
- const t = { manual: {}, prefetch: [] }, a = await (await fetch(`${g}/bundles/strategy/`)).json();
45
- Object.assign(t, a), i = t, _(u, { recursive: !0 }), b("Fetched latest Qwik Insight data into: " + n), await v(n, JSON.stringify(t));
44
+ const t = { manual: {}, prefetch: [] }, o = await (await fetch(`${u}/bundles/strategy/`)).json();
45
+ Object.assign(t, o), i = t, v(g, { recursive: !0 }), I("Fetched latest Qwik Insight data into: " + n), await $(n, JSON.stringify(t));
46
46
  } catch (t) {
47
- q(`Failed to fetch manifest from Insights DB at ${g}/bundles/strategy/`, t), await m();
47
+ b(`Failed to fetch manifest from Insights DB at ${u}/bundles/strategy/`, t), await w();
48
48
  }
49
49
  else
50
- await m();
50
+ await w();
51
51
  i && (c.entryStrategy.manual = {
52
52
  ...i.manual,
53
53
  ...c.entryStrategy.manual
54
54
  }, l.api.registerBundleGraphAdder((t) => {
55
- const d = {};
56
- for (const a of i?.prefetch || [])
57
- if (a.symbols) {
58
- let e = a.route;
59
- e.startsWith("/") && (e = e.slice(1)), e.endsWith("/") || (e += "/"), d[e] = { ...t.bundles[e], imports: a.symbols };
55
+ const h = {};
56
+ if (i)
57
+ for (let o = 0; o < i.prefetch.length; o++) {
58
+ const d = i.prefetch[o];
59
+ if (d.symbols) {
60
+ let s = d.route;
61
+ s.startsWith("/") && (s = s.slice(1)), s.endsWith("/") || (s += "/"), h[s] = { ...t.bundles[s], imports: d.symbols };
62
+ }
60
63
  }
61
- return d;
64
+ return h;
62
65
  }));
63
66
  }
64
67
  },
65
68
  closeBundle: async () => {
66
- const s = k(h, "q-manifest.json");
67
- if (f && w(s)) {
68
- const c = await y(s, "utf-8");
69
+ const e = q(m, "q-manifest.json");
70
+ if (f && y(e)) {
71
+ const c = await k(e, "utf-8");
69
72
  try {
70
73
  await fetch(`${p}manifest`, {
71
74
  method: "post",
72
75
  body: c
73
76
  });
74
77
  } catch (t) {
75
- q(`Failed to post manifest to Insights DB at ${p}manifest`, t);
78
+ b(`Failed to post manifest to Insights DB at ${p}manifest`, t);
76
79
  }
77
80
  }
78
81
  }
79
82
  };
80
83
  }
81
84
  export {
82
- F as qwikInsights
85
+ O as qwikInsights
83
86
  };
@@ -1,3 +1,3 @@
1
- const QWIK_LOADER = "const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),i=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},a=t=>{v(t),s(t,\"[q\\\\:shadowroot]\").forEach(t=>{const e=t.shadowRoot;e&&a(e)})},c=t=>t&&\"function\"==typeof t.then;let l=!0;const f=(t,e,n=e.type)=>{let o=l;i(\"[on\"+t+\"\\\\:\"+n+\"]\").forEach(r=>{o=!0,b(r,t,e,n)}),o||window[t.slice(1)].removeEventListener(n,\"-window\"===t?d:_)},p=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if(\"SCRIPT\"===n.tagName&&\"qwik/json\"===n.getAttribute(\"type\")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,\"<$1\"));break}n=n.previousElementSibling}}},u=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s=\"on\"+n+\":\"+r;e.hasAttribute(\"preventdefault:\"+r)&&o.preventDefault(),e.hasAttribute(\"stoppropagation:\"+r)&&o.stopPropagation();const i=e._qc_,a=i&&i.li.filter(t=>t[0]===s);if(a&&a.length>0){for(const t of a){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s),f=e.qDispatchEvent;if(f)return f(o,n);if(l){const n=e.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"),r=n.getAttribute(\"q:base\"),s=n.getAttribute(\"q:version\")||\"unknown\",i=n.getAttribute(\"q:manifest-hash\")||\"dev\",a=new URL(r,t.baseURI);for(const f of l.split(\"\\n\")){const l=new URL(f,a),u=l.href,b=l.hash.replace(/^#?([^?[|]*).*$/,\"$1\")||\"default\",h=performance.now();let _,d,w;const m=f.startsWith(\"#\"),y={qBase:r,qManifest:i,qVersion:s,href:u,symbol:b,element:e,reqTime:h};if(m){const e=n.getAttribute(\"q:instance\");_=(t[\"qFuncs_\"+e]||[])[Number.parseInt(b)],_||(d=\"sync\",w=Error(\"sym:\"+b))}else{q(\"qsymbol\",y);const t=l.href.split(\"#\")[0];try{const e=import(t);p(n),_=(await e)[b],_||(d=\"no-symbol\",w=Error(`${b} not in ${t}`))}catch(t){d||(d=\"async\"),w=t}}if(!_){q(\"qerror\",{importError:d,error:w,...y}),console.error(w);break}const v=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){q(\"qerror\",{error:t,...y})}finally{t.__q_context__=v}}}},q=(e,n)=>{t.dispatchEvent(u(e,n))},h=t=>t.replace(/([A-Z])/g,t=>\"-\"+t.toLowerCase()),_=async t=>{let e=h(t.type),n=t.target;for(f(\"-document\",t,e);n&&n.getAttribute;){const o=b(n,\"\",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute(\"stoppropagation:\"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},d=t=>{f(\"-window\",t,h(t.type))},w=()=>{var s;const c=t.readyState;if(!r&&(\"interactive\"==c||\"complete\"==c)&&(o.forEach(a),r=1,q(\"qinit\"),(null!=(s=e.requestIdleCallback)?s:e.setTimeout).bind(e)(()=>q(\"qidle\")),n.has(\"qvisible\"))){const t=i(\"[on\\\\:qvisible]\"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,\"\",u(\"qvisible\",n)))});t.forEach(t=>e.observe(t))}},m=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})};let y;const v=(...t)=>{l=!0,clearTimeout(y),y=setTimeout(()=>l=!1,2e4);for(const r of t)\"string\"==typeof r?n.has(r)||(o.forEach(t=>m(t,r,_,!0)),m(e,r,d,!0),n.add(r)):o.has(r)||(n.forEach(t=>m(r,t,_,!0)),o.add(r))};if(!(\"__q_context__\"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?v(...r):v(\"click\",\"input\")),e.qwikevents={events:n,roots:o,push:v},m(t,\"readystatechange\",w),w()}";
2
- const QWIK_LOADER_DEBUG = "const doc = document;\nconst win = window;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst findShadowRoots = (fragment) => {\n processEventOrNode(fragment);\n nativeQuerySelectorAll(fragment, \"[q\\\\:shadowroot]\").forEach((parent) => {\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n });\n};\nconst isPromise = (promise) => promise && typeof promise.then === \"function\";\nlet doNotClean = true;\nconst broadcast = (infix, ev, type = ev.type) => {\n let found = doNotClean;\n querySelectorAll(\"[on\" + infix + \"\\\\:\" + type + \"]\").forEach((el) => {\n found = true;\n dispatch(el, infix, ev, type);\n });\n if (!found) {\n window[infix.slice(1)].removeEventListener(\n type,\n infix === \"-window\" ? processWindowEvent : processDocumentEvent\n );\n }\n};\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === \"SCRIPT\" && script.getAttribute(\"type\") === \"qwik/json\") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, \"<$1\")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, {\n detail\n});\nconst dispatch = async (element, scope, ev, eventName = ev.type) => {\n const attrName = \"on\" + scope + \":\" + eventName;\n if (element.hasAttribute(\"preventdefault:\" + eventName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute(\"stoppropagation:\" + eventName)) {\n ev.stopPropagation();\n }\n const ctx = element._qc_;\n const relevantListeners = ctx && ctx.li.filter((li) => li[0] === attrName);\n if (relevantListeners && relevantListeners.length > 0) {\n for (const listener of relevantListeners) {\n const results = listener[1].getFn([element, ev], () => element.isConnected)(ev, element);\n const cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n if (cancelBubble) {\n ev.stopPropagation();\n }\n }\n return;\n }\n const attrValue = element.getAttribute(attrName);\n const qDispatchEvent = element.qDispatchEvent;\n if (qDispatchEvent) {\n return qDispatchEvent(ev, scope);\n }\n if (attrValue) {\n const container = element.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n const qBase = container.getAttribute(\"q:base\");\n const qVersion = container.getAttribute(\"q:version\") || \"unknown\";\n const qManifest = container.getAttribute(\"q:manifest-hash\") || \"dev\";\n const base = new URL(qBase, doc.baseURI);\n for (const qrl of attrValue.split(\"\\n\")) {\n const url = new URL(qrl, base);\n const href = url.href;\n const symbol = url.hash.replace(/^#?([^?[|]*).*$/, \"$1\") || \"default\";\n const reqTime = performance.now();\n let handler;\n let importError;\n let error;\n const isSync = qrl.startsWith(\"#\");\n const eventData = {\n qBase,\n qManifest,\n qVersion,\n href,\n symbol,\n element,\n reqTime\n };\n if (isSync) {\n const hash = container.getAttribute(\"q:instance\");\n handler = (doc[\"qFuncs_\" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = \"sync\";\n error = new Error(\"sym:\" + symbol);\n }\n } else {\n emitEvent(\"qsymbol\", eventData);\n const uri = url.href.split(\"#\")[0];\n try {\n const module = import(\n uri\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = \"no-symbol\";\n error = new Error(`${symbol} not in ${uri}`);\n }\n } catch (err) {\n importError || (importError = \"async\");\n error = err;\n }\n }\n if (!handler) {\n emitEvent(\"qerror\", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n break;\n }\n const previousCtx = doc.__q_context__;\n if (element.isConnected) {\n try {\n doc.__q_context__ = [element, ev, url];\n const results = handler(ev, element);\n if (isPromise(results)) {\n await results;\n }\n } catch (error2) {\n emitEvent(\"qerror\", { error: error2, ...eventData });\n } finally {\n doc.__q_context__ = previousCtx;\n }\n }\n }\n }\n};\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z])/g, (a) => \"-\" + a.toLowerCase());\nconst processDocumentEvent = async (ev) => {\n let type = camelToKebab(ev.type);\n let element = ev.target;\n broadcast(\"-document\", ev, type);\n while (element && element.getAttribute) {\n const results = dispatch(element, \"\", ev, type);\n let cancelBubble = ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n cancelBubble || (cancelBubble = cancelBubble || ev.cancelBubble || element.hasAttribute(\"stoppropagation:\" + ev.type));\n element = ev.bubbles && cancelBubble !== true ? element.parentElement : null;\n }\n};\nconst processWindowEvent = (ev) => {\n broadcast(\"-window\", ev, camelToKebab(ev.type));\n};\nconst processReadyStateChange = () => {\n var _a;\n const readyState = doc.readyState;\n if (!hasInitialized && (readyState == \"interactive\" || readyState == \"complete\")) {\n roots.forEach(findShadowRoots);\n hasInitialized = 1;\n emitEvent(\"qinit\");\n const riC = (_a = win.requestIdleCallback) != null ? _a : win.setTimeout;\n riC.bind(win)(() => emitEvent(\"qidle\"));\n if (events.has(\"qvisible\")) {\n const results = querySelectorAll(\"[on\\\\:qvisible]\");\n const observer = new IntersectionObserver((entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, \"\", createEvent(\"qvisible\", entry));\n }\n }\n });\n results.forEach((el) => observer.observe(el));\n }\n }\n};\nconst addEventListener = (el, eventName, handler, capture = false) => {\n el.addEventListener(eventName, handler, { capture, passive: false });\n};\nlet cleanTimer;\nconst processEventOrNode = (...eventNames) => {\n doNotClean = true;\n clearTimeout(cleanTimer);\n cleanTimer = setTimeout(() => doNotClean = false, 2e4);\n for (const eventNameOrNode of eventNames) {\n if (typeof eventNameOrNode === \"string\") {\n if (!events.has(eventNameOrNode)) {\n roots.forEach(\n (root) => addEventListener(root, eventNameOrNode, processDocumentEvent, true)\n );\n addEventListener(win, eventNameOrNode, processWindowEvent, true);\n events.add(eventNameOrNode);\n }\n } else {\n if (!roots.has(eventNameOrNode)) {\n events.forEach(\n (eventName) => addEventListener(eventNameOrNode, eventName, processDocumentEvent, true)\n );\n roots.add(eventNameOrNode);\n }\n }\n }\n};\nif (!(\"__q_context__\" in doc)) {\n doc.__q_context__ = 0;\n const qwikevents = win.qwikevents;\n if (qwikevents) {\n if (Array.isArray(qwikevents)) {\n processEventOrNode(...qwikevents);\n } else {\n processEventOrNode(\"click\", \"input\");\n }\n }\n win.qwikevents = {\n events,\n roots,\n push: processEventOrNode\n };\n addEventListener(doc, \"readystatechange\", processReadyStateChange);\n processReadyStateChange();\n}";
1
+ const QWIK_LOADER = "const e=document,t=window,n=\"w\",o=\"d\",r=new Set,s=new Set([e]),i=new Map;let a,c;const l=(e,t)=>Array.from(e.querySelectorAll(t)),q=e=>{const t=[];return s.forEach(n=>t.push(...l(n,e))),t},d=(e,t,n,o=!1)=>e.addEventListener(t,n,{capture:o,passive:!1}),b=e=>{_(e);const t=l(e,\"[q\\\\:shadowroot]\");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&b(n)}},f=e=>e&&\"function\"==typeof e.then,p=t=>{if(void 0===t._qwikjson_){let n=(t===e.documentElement?e.body:t).lastElementChild;for(;n;){if(\"SCRIPT\"===n.tagName&&\"qwik/json\"===n.getAttribute(\"type\")){t._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,\"<$1\"));break}n=n.previousElementSibling}}},u=(e,t)=>new CustomEvent(e,{detail:t}),h=(t,n)=>{e.dispatchEvent(u(t,n))},g=e=>e.replace(/([A-Z-])/g,e=>\"-\"+e.toLowerCase()),m=e=>e.replace(/-./g,e=>e[1].toUpperCase()),v=e=>({scope:e.charAt(0),eventName:m(e.slice(2))}),w=async(t,n,o,r)=>{r&&(t.hasAttribute(\"preventdefault:\"+r)&&n.preventDefault(),t.hasAttribute(\"stoppropagation:\"+r)&&n.stopPropagation());const s=t._qDispatch?.[o];if(s){if(\"function\"==typeof s){const e=s(n,t);f(e)&&await e}else if(s.length)for(let e=0;e<s.length;e++){const o=s[e],r=o?.(n,t);f(r)&&await r}return}const a=t.getAttribute(\"q-\"+o);if(a){const o=t.closest(\"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"),r=o.getAttribute(\"q:base\"),s=new URL(r,e.baseURI),c=a.split(\"|\");for(let a=0;a<c.length;a++){const l=c[a],q=performance.now(),[d,b,u]=l.split(\"#\"),g={qBase:r,symbol:b,element:t,reqTime:q};let m,v,w;if(\"\"===d){const t=o.getAttribute(\"q:instance\");m=(e[\"qFuncs_\"+t]||[])[Number.parseInt(b)],m||(v=\"sync\",w=Error(\"sym:\"+b))}else{const e=`${b}|${r}|${d}`;if(m=i.get(e),!m){const t=new URL(d,s).href;try{const n=import(t);p(o),m=(await n)[b],m?(i.set(e,m),h(\"qsymbol\",g)):(v=\"no-symbol\",w=Error(`${b} not in ${t}`))}catch(e){v=\"async\",w=e}}}if(m){if(t.isConnected)try{const e=m.call(u,n,t);f(e)&&await e}catch(e){h(\"qerror\",{error:e,...g})}}else h(\"qerror\",{importError:v,error:w,...g}),console.error(w)}}},y=async e=>{const t=g(e.type),n=\"e:\"+t;let o=e.target;for(;o&&o.getAttribute;){const r=w(o,e,n,t),s=e.bubbles&&!e.cancelBubble;f(r)&&await r,o=s&&e.bubbles&&!e.cancelBubble?o.parentElement:null}},A=(e,t)=>{const n=g(t.type),o=e+\":\"+n,r=q(\"[q-\"+e+\"\\\\:\"+n+\"]\");for(let e=0;e<r.length;e++){const s=r[e];w(s,t,o,n)}},E=async e=>{A(o,e)},C=e=>{A(n,e)},k=()=>{const n=e.readyState;if(\"interactive\"==n||\"complete\"==n){if(c=1,s.forEach(b),r.has(\"d:qinit\")){r.delete(\"d:qinit\");const e=u(\"qinit\"),t=q(\"[q-d\\\\:qinit]\");for(let n=0;n<t.length;n++){const o=t[n];w(o,e,\"d:qinit\"),o.removeAttribute(\"q-d:qinit\")}}if(r.has(\"d:qidle\")&&(r.delete(\"d:qidle\"),(t.requestIdleCallback??t.setTimeout).bind(t)(()=>{const e=u(\"qidle\"),t=q(\"[q-d\\\\:qidle]\");for(let n=0;n<t.length;n++){const o=t[n];w(o,e,\"d:qidle\"),o.removeAttribute(\"q-d:qidle\")}})),r.has(\"e:qvisible\")){a||(a=new IntersectionObserver(e=>{for(let t=0;t<e.length;t++){const n=e[t];n.isIntersecting&&(a.unobserve(n.target),w(n.target,u(\"qvisible\",n),\"e:qvisible\"))}}));const e=q(\"[q-e\\\\:qvisible]:not([q\\\\:observed])\");for(let t=0;t<e.length;t++){const n=e[t];a.observe(n),n.setAttribute(\"q:observed\",\"true\")}}}},_=(...e)=>{for(let i=0;i<e.length;i++){const a=e[i];if(\"string\"==typeof a){if(!r.has(a)){r.add(a);const{scope:e,eventName:i}=v(a);e===n?d(t,i,C,!0):s.forEach(t=>d(t,i,e===o?E:y,!0)),1!==c||\"e:qvisible\"!==a&&\"d:qinit\"!==a&&\"d:qidle\"!==a||k()}}else s.has(a)||(r.forEach(e=>{const{scope:t,eventName:r}=v(e);t!==n&&d(a,r,t===o?E:y,!0)}),s.add(a))}},S=t._qwikEv;S?.roots||(Array.isArray(S)?_(...S):_(\"e:click\",\"e:input\"),t._qwikEv={events:r,roots:s,push:_},d(e,\"readystatechange\",k),k())";
2
+ const QWIK_LOADER_DEBUG = "const doc = document;\nconst win = window;\nconst windowPrefix = \"w\";\nconst documentPrefix = \"d\";\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = /* @__PURE__ */ new Map();\nlet observer;\nlet hasInitialized;\nconst nativeQuerySelectorAll = (root, selector) => Array.from(root.querySelectorAll(selector));\nconst querySelectorAll = (query) => {\n const elements = [];\n roots.forEach((root) => elements.push(...nativeQuerySelectorAll(root, query)));\n return elements;\n};\nconst addEventListener = (el, eventName, handler, capture = false) => el.addEventListener(eventName, handler, { capture, passive: false });\nconst findShadowRoots = (fragment) => {\n addEventOrRoot(fragment);\n const shadowRoots = nativeQuerySelectorAll(fragment, \"[q\\\\:shadowroot]\");\n for (let i = 0; i < shadowRoots.length; i++) {\n const parent = shadowRoots[i];\n const shadowRoot = parent.shadowRoot;\n shadowRoot && findShadowRoots(shadowRoot);\n }\n};\nconst isPromise = (promise) => promise && typeof promise.then === \"function\";\nconst resolveContainer = (containerEl) => {\n if (containerEl._qwikjson_ === void 0) {\n const parentJSON = containerEl === doc.documentElement ? doc.body : containerEl;\n let script = parentJSON.lastElementChild;\n while (script) {\n if (script.tagName === \"SCRIPT\" && script.getAttribute(\"type\") === \"qwik/json\") {\n containerEl._qwikjson_ = JSON.parse(\n script.textContent.replace(/\\\\x3C(\\/?script)/gi, \"<$1\")\n );\n break;\n }\n script = script.previousElementSibling;\n }\n }\n};\nconst createEvent = (eventName, detail) => new CustomEvent(eventName, { detail });\nconst emitEvent = (eventName, detail) => {\n doc.dispatchEvent(createEvent(eventName, detail));\n};\nconst camelToKebab = (str) => str.replace(/([A-Z-])/g, (a) => \"-\" + a.toLowerCase());\nconst kebabToCamel = (eventName) => eventName.replace(/-./g, (a) => a[1].toUpperCase());\nconst parseKebabEvent = (event) => ({\n scope: event.charAt(0),\n eventName: kebabToCamel(event.slice(2))\n});\nconst dispatch = async (element, ev, scopedKebabName, kebabName) => {\n if (kebabName) {\n if (element.hasAttribute(\"preventdefault:\" + kebabName)) {\n ev.preventDefault();\n }\n if (element.hasAttribute(\"stoppropagation:\" + kebabName)) {\n ev.stopPropagation();\n }\n }\n const handlers = element._qDispatch?.[scopedKebabName];\n if (handlers) {\n if (typeof handlers === \"function\") {\n const result = handlers(ev, element);\n if (isPromise(result)) {\n await result;\n }\n } else if (handlers.length) {\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i];\n const result = handler?.(ev, element);\n if (isPromise(result)) {\n await result;\n }\n }\n }\n return;\n }\n const attrValue = element.getAttribute(\"q-\" + scopedKebabName);\n if (attrValue) {\n const container = element.closest(\n \"[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])\"\n );\n const qBase = container.getAttribute(\"q:base\");\n const base = new URL(qBase, doc.baseURI);\n const qrls = attrValue.split(\"|\");\n for (let i = 0; i < qrls.length; i++) {\n const qrl = qrls[i];\n const reqTime = performance.now();\n const [chunk, symbol, capturedIds] = qrl.split(\"#\");\n const eventData = {\n qBase,\n symbol,\n element,\n reqTime\n };\n let handler;\n let importError;\n let error;\n if (chunk === \"\") {\n const hash = container.getAttribute(\"q:instance\");\n handler = (doc[\"qFuncs_\" + hash] || [])[Number.parseInt(symbol)];\n if (!handler) {\n importError = \"sync\";\n error = new Error(\"sym:\" + symbol);\n }\n } else {\n const key = `${symbol}|${qBase}|${chunk}`;\n handler = symbols.get(key);\n if (!handler) {\n const href = new URL(chunk, base).href;\n try {\n const module = import(\n href\n );\n resolveContainer(container);\n handler = (await module)[symbol];\n if (!handler) {\n importError = \"no-symbol\";\n error = new Error(`${symbol} not in ${href}`);\n } else {\n symbols.set(key, handler);\n emitEvent(\"qsymbol\", eventData);\n }\n } catch (err) {\n importError = \"async\";\n error = err;\n }\n }\n }\n if (!handler) {\n emitEvent(\"qerror\", {\n importError,\n error,\n ...eventData\n });\n console.error(error);\n continue;\n }\n if (element.isConnected) {\n try {\n const result = handler.call(capturedIds, ev, element);\n if (isPromise(result)) {\n await result;\n }\n } catch (error2) {\n emitEvent(\"qerror\", { error: error2, ...eventData });\n }\n }\n }\n }\n};\nconst processElementEvent = async (ev) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = \"e:\" + kebabName;\n let element = ev.target;\n while (element && element.getAttribute) {\n const results = dispatch(element, ev, scopedKebabName, kebabName);\n const doBubble = ev.bubbles && !ev.cancelBubble;\n if (isPromise(results)) {\n await results;\n }\n element = doBubble && ev.bubbles && !ev.cancelBubble ? element.parentElement : null;\n }\n};\nconst broadcast = (infix, ev) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = infix + \":\" + kebabName;\n const elements = querySelectorAll(\"[q-\" + infix + \"\\\\:\" + kebabName + \"]\");\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, scopedKebabName, kebabName);\n }\n};\nconst processDocumentEvent = async (ev) => {\n broadcast(documentPrefix, ev);\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev);\n};\nconst processReadyStateChange = () => {\n const readyState = doc.readyState;\n if (readyState == \"interactive\" || readyState == \"complete\") {\n hasInitialized = 1;\n roots.forEach(findShadowRoots);\n if (events.has(\"d:qinit\")) {\n events.delete(\"d:qinit\");\n const ev = createEvent(\"qinit\");\n const elements = querySelectorAll(\"[q-d\\\\:qinit]\");\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, \"d:qinit\");\n el.removeAttribute(\"q-d:qinit\");\n }\n }\n if (events.has(\"d:qidle\")) {\n events.delete(\"d:qidle\");\n const riC = win.requestIdleCallback ?? win.setTimeout;\n riC.bind(win)(() => {\n const ev = createEvent(\"qidle\");\n const elements = querySelectorAll(\"[q-d\\\\:qidle]\");\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, \"d:qidle\");\n el.removeAttribute(\"q-d:qidle\");\n }\n });\n }\n if (events.has(\"e:qvisible\")) {\n observer || (observer = new IntersectionObserver((entries) => {\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i];\n if (entry.isIntersecting) {\n observer.unobserve(entry.target);\n dispatch(entry.target, createEvent(\"qvisible\", entry), \"e:qvisible\");\n }\n }\n }));\n const elements = querySelectorAll(\"[q-e\\\\:qvisible]:not([q\\\\:observed])\");\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n observer.observe(el);\n el.setAttribute(\"q:observed\", \"true\");\n }\n }\n }\n};\nconst addEventOrRoot = (...eventNames) => {\n for (let i = 0; i < eventNames.length; i++) {\n const eventNameOrRoot = eventNames[i];\n if (typeof eventNameOrRoot === \"string\") {\n if (!events.has(eventNameOrRoot)) {\n events.add(eventNameOrRoot);\n const { scope, eventName } = parseKebabEvent(eventNameOrRoot);\n if (scope === windowPrefix) {\n addEventListener(win, eventName, processWindowEvent, true);\n } else {\n roots.forEach(\n (root) => addEventListener(\n root,\n eventName,\n scope === documentPrefix ? processDocumentEvent : processElementEvent,\n true\n )\n );\n }\n if (hasInitialized === 1 && (eventNameOrRoot === \"e:qvisible\" || eventNameOrRoot === \"d:qinit\" || eventNameOrRoot === \"d:qidle\")) {\n processReadyStateChange();\n }\n }\n } else {\n if (!roots.has(eventNameOrRoot)) {\n events.forEach((kebabEventName) => {\n const { scope, eventName } = parseKebabEvent(kebabEventName);\n if (scope !== windowPrefix) {\n addEventListener(\n eventNameOrRoot,\n eventName,\n scope === documentPrefix ? processDocumentEvent : processElementEvent,\n true\n );\n }\n });\n roots.add(eventNameOrRoot);\n }\n }\n }\n};\nconst _qwikEv = win._qwikEv;\nif (!_qwikEv?.roots) {\n if (Array.isArray(_qwikEv)) {\n addEventOrRoot(..._qwikEv);\n } else {\n addEventOrRoot(\"e:click\", \"e:input\");\n }\n win._qwikEv = {\n events,\n roots,\n push: addEventOrRoot\n };\n addEventListener(doc, \"readystatechange\", processReadyStateChange);\n processReadyStateChange();\n}";
3
3
  export { QWIK_LOADER, QWIK_LOADER_DEBUG };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qwik.dev/core/loader",
3
- "version": "2.0.0-beta.3-dev+aa098fc",
3
+ "version": "2.0.0-beta.31-dev+906321a",
4
4
  "main": "index.mjs",
5
5
  "types": "index.d.ts",
6
6
  "private": true,