@qwik.dev/core 2.0.0-beta.35 → 2.0.0-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backpatch/index.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +2 -1
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +183 -39
- package/dist/core.min.mjs +8 -9
- package/dist/core.mjs +2223 -1290
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4492 -3645
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +0 -4
- package/dist/optimizer.mjs +429 -424
- package/dist/out-of-order-executor.debug.js +163 -0
- package/dist/out-of-order-executor.js +1 -0
- package/dist/preloader.mjs +1 -1
- package/dist/qwikloader.debug.js +47 -26
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.mjs +1160 -143
- package/dist/server.prod.mjs +1231 -428
- package/dist/testing/index.d.ts +75 -20
- package/dist/testing/index.mjs +2966 -1218
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +4 -4
- package/public.d.ts +1 -0
package/dist/server.prod.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* @qwik.dev/core/server 2.0.0-beta.
|
|
3
|
+
* @qwik.dev/core/server 2.0.0-beta.36-dev+3268fab
|
|
4
4
|
* Copyright QwikDev. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { setPlatform as setPlatform2 } from "@qwik.dev/core";
|
|
10
10
|
|
|
11
11
|
// packages/qwik/src/server/platform.ts
|
|
12
|
-
import { setPlatform as
|
|
12
|
+
import { setPlatform as Bs } from "@qwik.dev/core";
|
|
13
13
|
|
|
14
14
|
import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
|
17
17
|
import { isDev as isDev2 } from "@qwik.dev/core/build";
|
|
18
18
|
|
|
19
19
|
// packages/qwik/src/core/shared/error/assert.ts
|
|
20
|
-
import { isDev as
|
|
20
|
+
import { isDev as me } from "@qwik.dev/core/build";
|
|
21
21
|
|
|
22
22
|
// packages/qwik/src/core/shared/utils/qdev.ts
|
|
23
23
|
var qDev = globalThis.qDev !== false;
|
|
@@ -34,18 +34,18 @@ var qRuntimeQrl = globalThis.qRuntimeQrl === true;
|
|
|
34
34
|
var STYLE = qDev ? `background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;` : "";
|
|
35
35
|
|
|
36
36
|
var throwErrorAndStop = (e, ...t) => {
|
|
37
|
-
const n =
|
|
37
|
+
const n = be(false, e, ...t);
|
|
38
38
|
debugger;
|
|
39
39
|
throw n;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
var logErrorAndStop = (e, ...t) => {
|
|
43
|
-
const n =
|
|
43
|
+
const n = be(qDev, e, ...t);
|
|
44
44
|
debugger;
|
|
45
45
|
return n;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var be = (e, t, ...n) => {
|
|
49
49
|
const r = t instanceof Error ? t : new Error(t);
|
|
50
50
|
!qTest && console.error("%cQWIK ERROR", STYLE, r.message, ...n, r.stack);
|
|
51
51
|
e && !qTest && setTimeout(() => {
|
|
@@ -58,7 +58,7 @@ var fe = (e, t, ...n) => {
|
|
|
58
58
|
var ASSERT_DISCLAIMER = "Internal assert, this is likely caused by a bug in Qwik: ";
|
|
59
59
|
|
|
60
60
|
function assertTrue(e, t, ...n) {
|
|
61
|
-
if (
|
|
61
|
+
if (me) {
|
|
62
62
|
if (e === true) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
@@ -67,7 +67,7 @@ function assertTrue(e, t, ...n) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// packages/qwik/src/core/client/util-mapArray.ts
|
|
70
|
-
var
|
|
70
|
+
var ve = (e, t, n) => {
|
|
71
71
|
isDev2 && assertTrue(n % 2 === 0, "Expecting even number.");
|
|
72
72
|
let r = n >> 1;
|
|
73
73
|
let s = e.length - 2 >> 1;
|
|
@@ -86,8 +86,8 @@ var ae = (e, t, n) => {
|
|
|
86
86
|
return r << 1 ^ -1;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
var
|
|
90
|
-
const i =
|
|
89
|
+
var _e = (e, t, n, r, s = false) => {
|
|
90
|
+
const i = ve(e, t, r);
|
|
91
91
|
if (i >= 0) {
|
|
92
92
|
if (n == null && !s) {
|
|
93
93
|
e.splice(i, 2);
|
|
@@ -100,7 +100,7 @@ var he = (e, t, n, r, s = false) => {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
var mapApp_remove = (e, t, n) => {
|
|
103
|
-
const r =
|
|
103
|
+
const r = ve(e, t, n);
|
|
104
104
|
let s = null;
|
|
105
105
|
if (r >= 0) {
|
|
106
106
|
s = e[r + 1];
|
|
@@ -110,8 +110,8 @@ var mapApp_remove = (e, t, n) => {
|
|
|
110
110
|
return s;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
var
|
|
114
|
-
const r =
|
|
113
|
+
var ge = (e, t, n) => {
|
|
114
|
+
const r = ve(e, t, n);
|
|
115
115
|
if (r >= 0) {
|
|
116
116
|
return e[r + 1];
|
|
117
117
|
} else {
|
|
@@ -119,17 +119,17 @@ var de = (e, t, n) => {
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
var
|
|
122
|
+
var Ee = (e, t, n) => ve(e, t, n) >= 0;
|
|
123
123
|
|
|
124
124
|
// packages/qwik/src/core/shared/error/error.ts
|
|
125
125
|
import { isDev as isDev3 } from "@qwik.dev/core/build";
|
|
126
126
|
|
|
127
127
|
// packages/qwik/src/core/shared/utils/types.ts
|
|
128
|
-
var
|
|
128
|
+
var ke = e => typeof e === "object" && e !== null;
|
|
129
129
|
|
|
130
|
-
var
|
|
130
|
+
var Re = e => Array.isArray(e);
|
|
131
131
|
|
|
132
|
-
var
|
|
132
|
+
var Pe = e => typeof e === "string";
|
|
133
133
|
|
|
134
134
|
// packages/qwik/src/core/shared/error/error.ts
|
|
135
135
|
var baseUrl = "https://qwikdev-build-v2.qwik-8nx.pages.dev/docs/errors/#q";
|
|
@@ -211,7 +211,7 @@ var codeToText = (e, ...t) => {
|
|
|
211
211
|
if (t.length) {
|
|
212
212
|
r = r.replaceAll(/{{(\d+)}}/g, (e, n) => {
|
|
213
213
|
let r = t[n];
|
|
214
|
-
if (r &&
|
|
214
|
+
if (r && ke(r) && r.constructor === Object) {
|
|
215
215
|
r = JSON.stringify(r).slice(0, 50);
|
|
216
216
|
}
|
|
217
217
|
return r;
|
|
@@ -223,7 +223,7 @@ var codeToText = (e, ...t) => {
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
|
|
226
|
-
var
|
|
226
|
+
var qe = (e, t = []) => {
|
|
227
227
|
const n = codeToText(e, ...t);
|
|
228
228
|
return logErrorAndStop(n, ...t);
|
|
229
229
|
};
|
|
@@ -231,10 +231,10 @@ var ve = (e, t = []) => {
|
|
|
231
231
|
// packages/qwik/src/core/shared/qrl/qrl-utils.ts
|
|
232
232
|
import { isDev as isDev4 } from "@qwik.dev/core/build";
|
|
233
233
|
|
|
234
|
-
var
|
|
234
|
+
var Me = "<sync>";
|
|
235
235
|
|
|
236
236
|
// packages/qwik/src/core/shared/types.ts
|
|
237
|
-
var
|
|
237
|
+
var xe = "q:type";
|
|
238
238
|
|
|
239
239
|
// packages/qwik/src/core/shared/vnode-data-types.ts
|
|
240
240
|
var VNodeDataSeparator = {
|
|
@@ -406,6 +406,12 @@ var VNodeDataChar = {
|
|
|
406
406
|
/* ******* */ "~"
|
|
407
407
|
};
|
|
408
408
|
|
|
409
|
+
var je = (e, t) => {
|
|
410
|
+
const n = parseInt(e, 10) - 1;
|
|
411
|
+
const r = n + t;
|
|
412
|
+
return -(r * (r + 1) / 2 + t + 1);
|
|
413
|
+
};
|
|
414
|
+
|
|
409
415
|
// packages/qwik/src/core/shared/utils/character-escaping.ts
|
|
410
416
|
function escapeHTML(e) {
|
|
411
417
|
let t = "";
|
|
@@ -457,26 +463,62 @@ function encodeVNodeDataString(e) {
|
|
|
457
463
|
}
|
|
458
464
|
}
|
|
459
465
|
|
|
466
|
+
function encodeVNodeDataKey(e) {
|
|
467
|
+
const t = encodeURI(e);
|
|
468
|
+
let n = "";
|
|
469
|
+
const r = t.length;
|
|
470
|
+
let s = 0;
|
|
471
|
+
let i = s;
|
|
472
|
+
for (;s < r; s++) {
|
|
473
|
+
const e = t.charCodeAt(s);
|
|
474
|
+
let r = null;
|
|
475
|
+
if (e === 59) {
|
|
476
|
+
r = "%3B";
|
|
477
|
+
} else if (e === 61) {
|
|
478
|
+
r = "%3D";
|
|
479
|
+
} else if (e === 63) {
|
|
480
|
+
r = "%3F";
|
|
481
|
+
} else if (e === 64) {
|
|
482
|
+
r = "%40";
|
|
483
|
+
} else if (e === 126) {
|
|
484
|
+
r = "%7E";
|
|
485
|
+
} else {
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
n += t.substring(i, s) + r;
|
|
489
|
+
i = s + 1;
|
|
490
|
+
}
|
|
491
|
+
if (i === 0) {
|
|
492
|
+
return t;
|
|
493
|
+
} else {
|
|
494
|
+
return n + t.substring(i);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
460
498
|
// packages/qwik/src/core/shared/utils/markers.ts
|
|
461
|
-
var
|
|
499
|
+
var Le = "q:renderFn";
|
|
462
500
|
|
|
463
|
-
var
|
|
501
|
+
var De = "q:slot";
|
|
464
502
|
|
|
465
503
|
var QSlotParent = "q:sparent";
|
|
466
504
|
|
|
467
|
-
var
|
|
505
|
+
var QStatePatchAttr = "q:patch";
|
|
506
|
+
|
|
507
|
+
var kh = "q:r";
|
|
508
|
+
|
|
509
|
+
var Ue = "q:style";
|
|
468
510
|
|
|
469
|
-
var
|
|
511
|
+
var ze = "style[q\\:style]";
|
|
470
512
|
|
|
471
513
|
var QStyleSSelector = "style[q\\:sstyle]";
|
|
472
514
|
|
|
473
|
-
var
|
|
515
|
+
var Be = ze + "," + QStyleSSelector;
|
|
474
516
|
|
|
475
|
-
var
|
|
517
|
+
var He = "q:sstyle";
|
|
476
518
|
|
|
477
|
-
var
|
|
519
|
+
var Je = "q:ctx";
|
|
478
520
|
|
|
479
|
-
var
|
|
521
|
+
var Qe = "q:brefs";
|
|
480
522
|
|
|
481
523
|
var QRenderAttr = "q:render";
|
|
482
524
|
|
|
@@ -484,7 +526,7 @@ var QRuntimeAttr = "q:runtime";
|
|
|
484
526
|
|
|
485
527
|
var QVersionAttr = "q:version";
|
|
486
528
|
|
|
487
|
-
var
|
|
529
|
+
var Ge = "q:base";
|
|
488
530
|
|
|
489
531
|
var QLocaleAttr = "q:locale";
|
|
490
532
|
|
|
@@ -492,78 +534,74 @@ var QManifestHashAttr = "q:manifest-hash";
|
|
|
492
534
|
|
|
493
535
|
var QInstanceAttr = "q:instance";
|
|
494
536
|
|
|
495
|
-
var
|
|
537
|
+
var Ke = "q:container-island";
|
|
496
538
|
|
|
497
|
-
var
|
|
539
|
+
var Ze = "/" + Ke;
|
|
498
540
|
|
|
499
|
-
var
|
|
541
|
+
var ts = "q:ignore";
|
|
500
542
|
|
|
501
|
-
var
|
|
543
|
+
var ns = "/" + ts;
|
|
502
544
|
|
|
503
|
-
var
|
|
545
|
+
var es = "q:container";
|
|
504
546
|
|
|
505
|
-
var
|
|
547
|
+
var ss = "/" + es;
|
|
506
548
|
|
|
507
|
-
var
|
|
549
|
+
var is = "q:template";
|
|
508
550
|
|
|
509
|
-
var
|
|
551
|
+
var os = "[q\\:container]:not([q\\:container=" + "html" /* HTML */ + "]):not([q\\:container=" + "text" /* TEXT */ + "])";
|
|
510
552
|
|
|
511
|
-
var
|
|
553
|
+
var QDefaultSlot = "";
|
|
512
554
|
|
|
513
|
-
var
|
|
555
|
+
var as = "q:id";
|
|
514
556
|
|
|
515
|
-
var
|
|
557
|
+
var hs = "q:key";
|
|
516
558
|
|
|
517
|
-
var
|
|
559
|
+
var ds = "q:props";
|
|
518
560
|
|
|
519
|
-
var
|
|
561
|
+
var ps = "q:seq";
|
|
520
562
|
|
|
521
|
-
var
|
|
563
|
+
var $s = "q:seqIdx";
|
|
522
564
|
|
|
523
565
|
var ELEMENT_BACKPATCH_DATA = "qwik/backpatch";
|
|
524
566
|
|
|
525
|
-
var
|
|
526
|
-
|
|
527
|
-
var nr = "q:p";
|
|
528
|
-
|
|
529
|
-
var er = "q:ps";
|
|
567
|
+
var ys = "q:p";
|
|
530
568
|
|
|
531
|
-
var
|
|
569
|
+
var ms = "q:ps";
|
|
532
570
|
|
|
533
|
-
var
|
|
571
|
+
var ws = ":";
|
|
534
572
|
|
|
535
|
-
var
|
|
573
|
+
var bs = ws + "on";
|
|
536
574
|
|
|
537
|
-
var
|
|
575
|
+
var vs = ws + "onIdx";
|
|
538
576
|
|
|
539
|
-
var
|
|
577
|
+
var _s = ws + "onFlags";
|
|
540
578
|
|
|
541
|
-
var
|
|
579
|
+
var gs = ws + "nearestCursorBoundary";
|
|
542
580
|
|
|
543
|
-
var
|
|
581
|
+
var Es = ":";
|
|
544
582
|
|
|
545
|
-
var
|
|
583
|
+
var Ss = "dangerouslySetInnerHTML";
|
|
546
584
|
|
|
547
585
|
// packages/qwik/src/core/shared/utils/promises.ts
|
|
548
|
-
import { isDev as isDev5, isServer as
|
|
586
|
+
import { isDev as isDev5, isServer as $e } from "@qwik.dev/core/build";
|
|
549
587
|
|
|
550
|
-
var
|
|
588
|
+
var Rs = 100;
|
|
551
589
|
|
|
552
|
-
var
|
|
590
|
+
var Ps = e => !!e && typeof e == "object" && typeof e.then === "function";
|
|
553
591
|
|
|
554
|
-
var
|
|
592
|
+
var qs = (e, t) => Ps(e) ? e.then(t) : t(e);
|
|
555
593
|
|
|
556
594
|
var checkError = e => {
|
|
557
|
-
if (
|
|
595
|
+
if ($e && e instanceof ReferenceError && e.message.includes("window")) {
|
|
558
596
|
e.message = 'It seems like you forgot to add "if (isBrowser) {...}" here:' + e.message;
|
|
559
597
|
}
|
|
560
598
|
};
|
|
561
599
|
|
|
562
|
-
var
|
|
600
|
+
var Ms = e => {
|
|
563
601
|
throw e;
|
|
564
602
|
};
|
|
565
603
|
|
|
566
|
-
function n(e, t =
|
|
604
|
+
function n(e, t = Ms) {
|
|
567
605
|
let n = false;
|
|
568
606
|
let r;
|
|
569
607
|
try {
|
|
@@ -572,21 +610,21 @@ function n(e, t = yr) {
|
|
|
572
610
|
} catch (e) {
|
|
573
611
|
r = e;
|
|
574
612
|
}
|
|
575
|
-
if (!
|
|
613
|
+
if (!Ps(r)) {
|
|
576
614
|
if (n) {
|
|
577
615
|
return r;
|
|
578
616
|
}
|
|
579
617
|
isDev5 && checkError(r);
|
|
580
618
|
return t(r);
|
|
581
619
|
}
|
|
582
|
-
let s =
|
|
620
|
+
let s = Rs;
|
|
583
621
|
const i = async n => {
|
|
584
|
-
while (
|
|
622
|
+
while (Ps(n)) {
|
|
585
623
|
try {
|
|
586
624
|
await n;
|
|
587
625
|
return await e();
|
|
588
626
|
} catch (e) {
|
|
589
|
-
if (
|
|
627
|
+
if (Ps(e)) {
|
|
590
628
|
if (! --s) {
|
|
591
629
|
n = new Error("Exceeded max retry count in retryOnPromise");
|
|
592
630
|
break;
|
|
@@ -615,34 +653,34 @@ function convertStyleIdsToString(e) {
|
|
|
615
653
|
}
|
|
616
654
|
|
|
617
655
|
// packages/qwik/src/core/shared/utils/event-names.ts
|
|
618
|
-
var
|
|
656
|
+
var Is = e => e.charCodeAt(0) === 113 && e.charCodeAt(1) === 45 && (e.charCodeAt(3) === 58 || e.charCodeAt(3) === 112 && e.charCodeAt(4) === 58);
|
|
619
657
|
|
|
620
658
|
function isPreventDefault(e) {
|
|
621
659
|
return e.startsWith("preventdefault:");
|
|
622
660
|
}
|
|
623
661
|
|
|
624
662
|
// packages/qwik/src/core/shared/utils/unitless_number.ts
|
|
625
|
-
var
|
|
663
|
+
var js = /* @__PURE__ */ new Set([ "animationIterationCount", "aspectRatio", "borderImageOutset", "borderImageSlice", "borderImageWidth", "boxFlex", "boxFlexGroup", "boxOrdinalGroup", "columnCount", "columns", "flex", "flexGrow", "flexShrink", "gridArea", "gridRow", "gridRowEnd", "gridRowStart", "gridColumn", "gridColumnEnd", "gridColumnStart", "fontWeight", "lineClamp", "lineHeight", "opacity", "order", "orphans", "scale", "tabSize", "widows", "zIndex", "zoom", "MozAnimationIterationCount",
|
|
626
664
|
// Known Prefixed Properties
|
|
627
665
|
"MozBoxFlex",
|
|
628
666
|
// TODO: Remove these since they shouldn't be used in modern code
|
|
629
667
|
"msFlex", "msFlexPositive", "WebkitAnimationIterationCount", "WebkitBoxFlex", "WebkitBoxOrdinalGroup", "WebkitColumnCount", "WebkitColumns", "WebkitFlex", "WebkitFlexGrow", "WebkitFlexShrink", "WebkitLineClamp" ]);
|
|
630
668
|
|
|
631
|
-
var isUnitlessNumber = e =>
|
|
669
|
+
var isUnitlessNumber = e => js.has(e);
|
|
632
670
|
|
|
633
671
|
// packages/qwik/src/core/shared/utils/styles.ts
|
|
634
|
-
var
|
|
672
|
+
var Fs = e => {
|
|
635
673
|
if (!e) {
|
|
636
674
|
return "";
|
|
637
675
|
}
|
|
638
|
-
if (
|
|
676
|
+
if (Pe(e)) {
|
|
639
677
|
return e.trim();
|
|
640
678
|
}
|
|
641
679
|
const t = [];
|
|
642
|
-
if (
|
|
680
|
+
if (Re(e)) {
|
|
643
681
|
for (let n = 0; n < e.length; n++) {
|
|
644
682
|
const r = e[n];
|
|
645
|
-
const s =
|
|
683
|
+
const s = Fs(r);
|
|
646
684
|
if (s) {
|
|
647
685
|
t.push(s);
|
|
648
686
|
}
|
|
@@ -657,15 +695,15 @@ var Er = e => {
|
|
|
657
695
|
return t.join(" ");
|
|
658
696
|
};
|
|
659
697
|
|
|
660
|
-
var
|
|
698
|
+
var Xs = e => e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
661
699
|
|
|
662
700
|
var stringifyStyle = e => {
|
|
663
701
|
if (e == null) {
|
|
664
702
|
return "";
|
|
665
703
|
}
|
|
666
704
|
if (typeof e == "object") {
|
|
667
|
-
if (
|
|
668
|
-
throw
|
|
705
|
+
if (Re(e)) {
|
|
706
|
+
throw qe(0 /* stringifyClassOrStyle */ , [ e, "style" ]);
|
|
669
707
|
} else {
|
|
670
708
|
const t = [];
|
|
671
709
|
for (const n in e) {
|
|
@@ -675,7 +713,7 @@ var stringifyStyle = e => {
|
|
|
675
713
|
if (n.startsWith("--")) {
|
|
676
714
|
t.push(n + ":" + r);
|
|
677
715
|
} else {
|
|
678
|
-
t.push(
|
|
716
|
+
t.push(Xs(n) + ":" + Ds(n, r));
|
|
679
717
|
}
|
|
680
718
|
}
|
|
681
719
|
}
|
|
@@ -688,9 +726,9 @@ var stringifyStyle = e => {
|
|
|
688
726
|
|
|
689
727
|
var serializeBooleanOrNumberAttribute = e => e != null ? String(e) : null;
|
|
690
728
|
|
|
691
|
-
function
|
|
729
|
+
function s(e, t, n) {
|
|
692
730
|
if (isClassAttr(e)) {
|
|
693
|
-
const e =
|
|
731
|
+
const e = Fs(t);
|
|
694
732
|
t = n ? n + (e.length ? " " + e : e) : e;
|
|
695
733
|
} else if (e === "style") {
|
|
696
734
|
t = stringifyStyle(t);
|
|
@@ -708,7 +746,7 @@ function isEnumeratedBooleanAttribute(e) {
|
|
|
708
746
|
return isAriaAttribute(e) || [ "spellcheck", "draggable", "contenteditable" ].includes(e);
|
|
709
747
|
}
|
|
710
748
|
|
|
711
|
-
var
|
|
749
|
+
var Ds = (e, t) => {
|
|
712
750
|
if (typeof t === "number" && t !== 0 && !isUnitlessNumber(e)) {
|
|
713
751
|
return t + "px";
|
|
714
752
|
}
|
|
@@ -737,9 +775,9 @@ var parseBundleGraph = e => {
|
|
|
737
775
|
o = -i / 10;
|
|
738
776
|
} else {
|
|
739
777
|
s.push({
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
778
|
+
Wt: e[i],
|
|
779
|
+
Yt: o,
|
|
780
|
+
Gt: 1
|
|
743
781
|
});
|
|
744
782
|
}
|
|
745
783
|
n++;
|
|
@@ -758,7 +796,7 @@ var initPreloader = e => {
|
|
|
758
796
|
};
|
|
759
797
|
|
|
760
798
|
// packages/qwik/src/core/shared/utils/objects.ts
|
|
761
|
-
var
|
|
799
|
+
var hr = e => {
|
|
762
800
|
for (const t in e) {
|
|
763
801
|
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
764
802
|
return false;
|
|
@@ -767,6 +805,29 @@ var Kr = e => {
|
|
|
767
805
|
return true;
|
|
768
806
|
};
|
|
769
807
|
|
|
808
|
+
// packages/qwik/src/core/ssr/stream-writer.ts
|
|
809
|
+
var stringifyRootRefPath = e => {
|
|
810
|
+
let t = String(e[0]);
|
|
811
|
+
for (let n = 1; n < e.length; n++) {
|
|
812
|
+
t += " " + e[n];
|
|
813
|
+
}
|
|
814
|
+
return t;
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
var writeStringRootRef = (e, t) => e.write(String(t));
|
|
818
|
+
|
|
819
|
+
var writeStringRootRefPath = (e, t) => e.write(stringifyRootRefPath(t));
|
|
820
|
+
|
|
821
|
+
var dr = e => ({
|
|
822
|
+
write: e,
|
|
823
|
+
writeRootRef(e) {
|
|
824
|
+
return writeStringRootRef(this, e);
|
|
825
|
+
},
|
|
826
|
+
writeRootRefPath(e) {
|
|
827
|
+
return writeStringRootRefPath(this, e);
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
|
|
770
831
|
// packages/qwik/src/core/shared/ssr-const.ts
|
|
771
832
|
var LT = "<";
|
|
772
833
|
|
|
@@ -774,21 +835,21 @@ var GT = ">";
|
|
|
774
835
|
|
|
775
836
|
var CLOSE_TAG = "</";
|
|
776
837
|
|
|
777
|
-
var
|
|
838
|
+
var va = " ";
|
|
778
839
|
|
|
779
840
|
var ATTR_EQUALS_QUOTE = '="';
|
|
780
841
|
|
|
781
|
-
var
|
|
842
|
+
var pr = '"';
|
|
782
843
|
|
|
783
844
|
var EMPTY_ATTR = '=""';
|
|
784
845
|
|
|
785
|
-
var
|
|
846
|
+
var $r = "[";
|
|
786
847
|
|
|
787
|
-
var
|
|
848
|
+
var yr = "]";
|
|
788
849
|
|
|
789
850
|
var PAREN_CLOSE = ")";
|
|
790
851
|
|
|
791
|
-
var
|
|
852
|
+
var mr = ",";
|
|
792
853
|
|
|
793
854
|
// packages/qwik/src/server/platform.ts
|
|
794
855
|
var getDevSegmentPath = (e, t, n, r) => {
|
|
@@ -796,7 +857,7 @@ var getDevSegmentPath = (e, t, n, r) => {
|
|
|
796
857
|
if (s) {
|
|
797
858
|
return s;
|
|
798
859
|
}
|
|
799
|
-
if (n ===
|
|
860
|
+
if (n === Me) {
|
|
800
861
|
return [ n, "" ];
|
|
801
862
|
}
|
|
802
863
|
if (!r) {
|
|
@@ -810,14 +871,14 @@ var getDevSegmentPath = (e, t, n, r) => {
|
|
|
810
871
|
return [ n, i ];
|
|
811
872
|
};
|
|
812
873
|
|
|
813
|
-
function
|
|
874
|
+
function Vs(e, t) {
|
|
814
875
|
const n = t?.mapper;
|
|
815
876
|
const r = e.symbolMapper ? e.symbolMapper : (e, t, r) => {
|
|
816
877
|
if (n || isDev6 && import.meta.env?.MODE !== "test") {
|
|
817
|
-
const t =
|
|
878
|
+
const t = Sh(e);
|
|
818
879
|
const s = !isDev6 ? n[t] : getDevSegmentPath(n, t, e, r);
|
|
819
880
|
if (!s) {
|
|
820
|
-
if (t ===
|
|
881
|
+
if (t === Me) {
|
|
821
882
|
return [ t, "" ];
|
|
822
883
|
}
|
|
823
884
|
const s = globalThis.__qwik_reg_symbols?.has(t);
|
|
@@ -832,12 +893,12 @@ function Pr(e, t) {
|
|
|
832
893
|
const s = {
|
|
833
894
|
isServer: true,
|
|
834
895
|
async importSymbol(e, t, n) {
|
|
835
|
-
const r =
|
|
896
|
+
const r = Sh(n);
|
|
836
897
|
const s = globalThis.__qwik_reg_symbols?.get(r);
|
|
837
898
|
if (s) {
|
|
838
899
|
return s;
|
|
839
900
|
}
|
|
840
|
-
throw
|
|
901
|
+
throw qe(6 /* dynamicImportFailed */ , [ n ]);
|
|
841
902
|
},
|
|
842
903
|
raf: () => {
|
|
843
904
|
console.error("server can not rerender");
|
|
@@ -851,11 +912,11 @@ function Pr(e, t) {
|
|
|
851
912
|
}
|
|
852
913
|
|
|
853
914
|
async function setServerPlatform(e, t) {
|
|
854
|
-
const n =
|
|
855
|
-
|
|
915
|
+
const n = Vs(e, t);
|
|
916
|
+
Bs(n);
|
|
856
917
|
}
|
|
857
918
|
|
|
858
|
-
var
|
|
919
|
+
var Sh = e => {
|
|
859
920
|
const t = e.lastIndexOf("_");
|
|
860
921
|
if (t > -1) {
|
|
861
922
|
return e.slice(t + 1);
|
|
@@ -864,15 +925,77 @@ var Ha = e => {
|
|
|
864
925
|
};
|
|
865
926
|
|
|
866
927
|
// packages/qwik/src/server/ssr-render.ts
|
|
867
|
-
import { getClientManifest as
|
|
928
|
+
import { getClientManifest as Hf } from "@qwik.dev/core";
|
|
868
929
|
|
|
869
930
|
// packages/qwik/src/server/ssr-container.ts
|
|
870
931
|
import { isDev as isDev8 } from "@qwik.dev/core/build";
|
|
871
932
|
|
|
872
|
-
import { _SubscriptionData as
|
|
933
|
+
import { _SubscriptionData as Ri, _SharedContainer as ic, _jsxSorted as Fi, _jsxSplit as Xi, _res as _, _setEvent, _walkJSX as Xn, _createQRL as Mf, isSignal as iu } from "@qwik.dev/core/internal";
|
|
934
|
+
|
|
935
|
+
// packages/qwik/src/server/ooos-utils.ts
|
|
936
|
+
import { _SubscriptionPatch as Pu } from "@qwik.dev/core/internal";
|
|
937
|
+
|
|
938
|
+
var recordExternalRootEffect = (e, t, n, r, s, i, o, a) => {
|
|
939
|
+
if (!r || o !== null && !a) {
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
let c = s;
|
|
943
|
+
if (o !== null && s && (typeof s === "object" || typeof s === "function")) {
|
|
944
|
+
c = n.get(s) || s;
|
|
945
|
+
}
|
|
946
|
+
const l = e.ge(c);
|
|
947
|
+
t.St(c);
|
|
948
|
+
t.St(i);
|
|
949
|
+
if (o !== null && typeof o !== "string") {
|
|
950
|
+
t.St(o);
|
|
951
|
+
}
|
|
952
|
+
r.push({
|
|
953
|
+
rootObj: c,
|
|
954
|
+
rootId: l,
|
|
955
|
+
effect: i,
|
|
956
|
+
prop: o
|
|
957
|
+
});
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
var collectSubscriptionPatches = (e, t, n) => {
|
|
961
|
+
if (!t?.length) {
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
const r = [];
|
|
965
|
+
const s = /* @__PURE__ */ new Map;
|
|
966
|
+
for (let i = 0; i < t.length; i++) {
|
|
967
|
+
const o = t[i];
|
|
968
|
+
const a = o.rootId === void 0 ? e.ge(o.rootObj) : o.rootId;
|
|
969
|
+
if (a === void 0 || a >= n) {
|
|
970
|
+
continue;
|
|
971
|
+
}
|
|
972
|
+
let c = s.get(a);
|
|
973
|
+
if (!c) {
|
|
974
|
+
c = new Pu(a, o.prop === null ? /* @__PURE__ */ new Set : /* @__PURE__ */ new Map);
|
|
975
|
+
s.set(a, c);
|
|
976
|
+
r.push(c);
|
|
977
|
+
}
|
|
978
|
+
const l = c.subscriptions;
|
|
979
|
+
if (o.prop === null) {
|
|
980
|
+
if (l instanceof Set) {
|
|
981
|
+
l.add(o.effect);
|
|
982
|
+
}
|
|
983
|
+
} else {
|
|
984
|
+
if (l instanceof Map) {
|
|
985
|
+
let e = l.get(o.prop);
|
|
986
|
+
if (!e) {
|
|
987
|
+
e = /* @__PURE__ */ new Set;
|
|
988
|
+
l.set(o.prop, e);
|
|
989
|
+
}
|
|
990
|
+
e.add(o.effect);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
return r.length ? r : void 0;
|
|
995
|
+
};
|
|
873
996
|
|
|
874
997
|
// packages/qwik/src/server/preload-impl.ts
|
|
875
|
-
import { getPlatform as
|
|
998
|
+
import { getPlatform as Hs } from "@qwik.dev/core";
|
|
876
999
|
|
|
877
1000
|
var simplifyPath = (e, t) => {
|
|
878
1001
|
if (t == null) {
|
|
@@ -892,7 +1015,7 @@ var simplifyPath = (e, t) => {
|
|
|
892
1015
|
};
|
|
893
1016
|
|
|
894
1017
|
var getBase = e => {
|
|
895
|
-
let t = e.
|
|
1018
|
+
let t = e.qe;
|
|
896
1019
|
if (import.meta.env?.DEV && !qTest) {
|
|
897
1020
|
t = import.meta.env?.BASE_URL;
|
|
898
1021
|
}
|
|
@@ -916,15 +1039,15 @@ var preloaderPre = (e, t, n) => {
|
|
|
916
1039
|
a.push(`P:${t.maxIdlePreloads}`);
|
|
917
1040
|
}
|
|
918
1041
|
}
|
|
919
|
-
const
|
|
920
|
-
const
|
|
1042
|
+
const c = a.length ? `,{${a.join(",")}}` : "";
|
|
1043
|
+
const l = {
|
|
921
1044
|
rel: "modulepreload",
|
|
922
1045
|
href: i
|
|
923
1046
|
};
|
|
924
1047
|
if (n) {
|
|
925
|
-
|
|
1048
|
+
l["nonce"] = n;
|
|
926
1049
|
}
|
|
927
|
-
e.openElement("link", null,
|
|
1050
|
+
e.openElement("link", null, l, null, null, null);
|
|
928
1051
|
e.closeElement();
|
|
929
1052
|
e.openElement("link", null, {
|
|
930
1053
|
rel: "preload",
|
|
@@ -933,7 +1056,7 @@ var preloaderPre = (e, t, n) => {
|
|
|
933
1056
|
crossorigin: "anonymous"
|
|
934
1057
|
}, null, null, null);
|
|
935
1058
|
e.closeElement();
|
|
936
|
-
const u = `let b=fetch("${o}");import("${i}").then(({l})=>l(${JSON.stringify(s)},b${
|
|
1059
|
+
const u = `let b=fetch("${o}");import("${i}").then(({l})=>l(${JSON.stringify(s)},b${c}));`;
|
|
937
1060
|
const h = {
|
|
938
1061
|
type: "module",
|
|
939
1062
|
async: true,
|
|
@@ -942,9 +1065,7 @@ var preloaderPre = (e, t, n) => {
|
|
|
942
1065
|
if (n) {
|
|
943
1066
|
h["nonce"] = n;
|
|
944
1067
|
}
|
|
945
|
-
e.
|
|
946
|
-
e.write(u);
|
|
947
|
-
e.closeElement();
|
|
1068
|
+
e.writeScript(h, u);
|
|
948
1069
|
}
|
|
949
1070
|
const a = simplifyPath(s, r?.manifest.core);
|
|
950
1071
|
if (a) {
|
|
@@ -968,10 +1089,10 @@ var includePreloader = (e, t, n, r) => {
|
|
|
968
1089
|
let i = s;
|
|
969
1090
|
const o = getBase(e);
|
|
970
1091
|
const a = [];
|
|
971
|
-
const {resolvedManifest:
|
|
1092
|
+
const {resolvedManifest: c} = e;
|
|
972
1093
|
if (i) {
|
|
973
|
-
const e =
|
|
974
|
-
const t =
|
|
1094
|
+
const e = c?.manifest.preloader;
|
|
1095
|
+
const t = c?.manifest.core;
|
|
975
1096
|
for (let r = 0; r < n.length; r++) {
|
|
976
1097
|
const s = n[r];
|
|
977
1098
|
if (s === e || s === t) {
|
|
@@ -983,7 +1104,7 @@ var includePreloader = (e, t, n, r) => {
|
|
|
983
1104
|
}
|
|
984
1105
|
}
|
|
985
1106
|
}
|
|
986
|
-
const
|
|
1107
|
+
const l = simplifyPath(o, c?.manifest.preloader);
|
|
987
1108
|
const u = a.length ?
|
|
988
1109
|
/**
|
|
989
1110
|
* We only use modulepreload links because they behave best. Older browsers can rely on the
|
|
@@ -991,8 +1112,8 @@ var includePreloader = (e, t, n, r) => {
|
|
|
991
1112
|
* links.
|
|
992
1113
|
*/ `${JSON.stringify(a)}.map((l,e)=>{e=document.createElement('link');e.rel='modulepreload';e.href=${JSON.stringify(o)}+l;document.head.appendChild(e)});` : "";
|
|
993
1114
|
let h = u;
|
|
994
|
-
if (
|
|
995
|
-
h += `window.addEventListener('load',f=>{f=_=>import("${
|
|
1115
|
+
if (l) {
|
|
1116
|
+
h += `window.addEventListener('load',f=>{f=_=>import("${l}").then(({p})=>p(${JSON.stringify(n)}));try{requestIdleCallback(f,{timeout:2000})}catch(e){setTimeout(f,200)}})`;
|
|
996
1117
|
}
|
|
997
1118
|
if (h) {
|
|
998
1119
|
const t = {
|
|
@@ -1003,9 +1124,7 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1003
1124
|
if (r) {
|
|
1004
1125
|
t["nonce"] = r;
|
|
1005
1126
|
}
|
|
1006
|
-
e.
|
|
1007
|
-
e.write(h);
|
|
1008
|
-
e.closeElement();
|
|
1127
|
+
e.writeScript(t, h);
|
|
1009
1128
|
}
|
|
1010
1129
|
return null;
|
|
1011
1130
|
};
|
|
@@ -1015,7 +1134,7 @@ var preloaderPost = (e, t, n) => {
|
|
|
1015
1134
|
return;
|
|
1016
1135
|
}
|
|
1017
1136
|
if (t.preloader !== false) {
|
|
1018
|
-
const r = Array.from(e.serializationCtx.
|
|
1137
|
+
const r = Array.from(e.serializationCtx.xt);
|
|
1019
1138
|
const s = getBundles(r);
|
|
1020
1139
|
includePreloader(e, t.preloader, s, n);
|
|
1021
1140
|
}
|
|
@@ -1029,10 +1148,10 @@ function normalizePreLoaderOptions(e) {
|
|
|
1029
1148
|
}
|
|
1030
1149
|
|
|
1031
1150
|
var getBundles = e => {
|
|
1032
|
-
const t =
|
|
1151
|
+
const t = Hs();
|
|
1033
1152
|
const n = e?.map(e => {
|
|
1034
|
-
const n = e.
|
|
1035
|
-
const r = e.
|
|
1153
|
+
const n = e.vt;
|
|
1154
|
+
const r = e._t;
|
|
1036
1155
|
const s = t.chunkForSymbol(n, r, e.dev?.file);
|
|
1037
1156
|
if (s) {
|
|
1038
1157
|
return s[1];
|
|
@@ -1048,13 +1167,17 @@ var preLoaderOptionsDefault = {
|
|
|
1048
1167
|
};
|
|
1049
1168
|
|
|
1050
1169
|
// packages/qwik/src/server/scripts.ts
|
|
1051
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const e=document,t=window,
|
|
1170
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const e=document,t=window,n="w",r="wp",o="d",s="dp",i="e",c="ep",a="capture:",l="readystatechange",p="qready",u=new Set,q=new Set([e]),d=new Map;let h,f,b;const g=(e,t)=>Array.from(e.querySelectorAll(t)),m=e=>{const t=[];return q.forEach(n=>t.push(...g(n,e))),t},v=(e,t,n,r=!1,o=!1)=>e.addEventListener(t,n,{capture:r,passive:o}),y=e=>{z(e);const t=g(e,"[q\\\\:shadowroot]");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&y(n)}},w=e=>e&&"function"==typeof e.then,E=async e=>{for(let t=0;t<e.length;t++)await e[t]()},A=e=>{if(e.length){const t=()=>E(e);b=b?b.then(t,t):t()}},C=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}}},_=t=>{const n=t.getAttribute("q:instance");return"paused"===t.getAttribute("q:container")&&"loading"===e.readyState&&!e[p]?.[n]&&new Promise(t=>{const r=o=>{o.detail===n&&(e.removeEventListener(p,r),t())};v(e,l,t),v(e,p,r)})},k=(e,t)=>new CustomEvent(e,{detail:t}),S=(t,n)=>{e.dispatchEvent(k(t,n))},$=e=>e.replace(/([A-Z-])/g,e=>"-"+e.toLowerCase()),I=e=>e.replace(/-./g,e=>e[1].toUpperCase()),L=e=>{const t=e.indexOf(":");return{scope:e.slice(0,t),eventName:I(e.slice(t+1))}},N=e=>2===e.length,R=e=>e.charAt(0),T=e=>!!e&&1===e.nodeType,x=(e,t,n)=>e.hasAttribute(n)&&(!!e._qDispatch?.[t]||e.hasAttribute("q-"+t)),B=(t,n,r,o,s,i,c,a=!0)=>{const l={qBase:r,symbol:i,element:n,reqTime:c};if(!s){const n=(e["qFuncs_"+t.getAttribute("q:instance")]||[])[+i];if(!n&&a){const e=Error("sym:"+i);S("qerror",{importError:"sync",error:e,...l}),console.error(e)}return n}const p=`${i}|${r}|${s}`,u=d.get(p);if(u)return u;const q=new URL(s,o).href,h=import(q);return C(t),h.then(e=>{const t=e[i];if(t)d.set(p,t),S("qsymbol",l);else{const e=Error(`${i} not in ${q}`);S("qerror",{importError:"no-symbol",error:e,...l}),console.error(e)}return t},e=>{S("qerror",{importError:"async",error:e,...l}),console.error(e)})},U=(t,n,r,o,s,i=!0)=>{let c=!1;s&&(i&&t.hasAttribute("preventdefault:"+s)&&n.preventDefault(),t.hasAttribute("stoppropagation:"+s)&&n.stopPropagation());const a=t._qDispatch?.[r];if(a){if("function"==typeof a){const e=()=>a(n,t);if(c)o.push(async()=>{const t=e();w(t)&&await t});else{const t=e();w(t)&&(c=!0,o.push(()=>t))}}else if(a.length)for(let e=0;e<a.length;e++){const r=a[e];if(r){const e=()=>r(n,t);if(c)o.push(async()=>{const t=e();w(t)&&await t});else{const t=e();w(t)&&(c=!0,o.push(()=>t))}}}return}const l=t.getAttribute("q-"+r);if(l){const r=t.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"),s=r.getAttribute("q:base"),i=new URL(s,e.baseURI),a=l.split("|"),p=_(r);for(let e=0;e<a.length;e++){const l=a[e],u=performance.now(),[q,d,h]=l.split("#"),f=e=>{if(e&&t.isConnected){const o=n=>{const o=_(r);if(o)return o.then(()=>f(e));S("qerror",{error:n,qBase:s,symbol:d,element:t,reqTime:u})};try{const r=e.call(h,n,t);if(w(r))return r.catch(o)}catch(e){return o(e)}}},b=(e=!0)=>B(r,t,s,i,q,d,u,e),g=p&&!q?b(!1):b();if(w(g))c=!0,o.push(()=>g.then(f));else if(c||p&&!q&&!g)c=!0,o.push(async()=>{let e=g;!e&&p&&(await p,e=b(!1)),await f(e||await b())});else{const e=f(g);w(e)&&(c=!0,o.push(()=>e))}}}},j=(e,t=i,n=!0)=>{const r=$(e.type),o=t+":"+r,s=a+r,c=[],l=[],p=[];let u=e.target;for(;u;)T(u)?(c.push(u),l.push(x(u,o,s)),u=u.parentElement):u=u.parentElement;for(let t=c.length-1;t>=0;t--)if(l[t]&&(U(c[t],e,o,p,r,n),e.cancelBubble))return void A(p);for(let t=0;t<c.length;t++)if(!l[t]&&(U(c[t],e,o,p,r,n),!e.bubbles||e.cancelBubble))return void A(p);A(p)},D=e=>j(e,c,!1),O=(e,t,n=!0)=>{const r=$(t.type),o=e+":"+r,s=m("[q-"+e+"\\\\:"+r+"]"),i=[];for(let e=0;e<s.length;e++){const c=s[e];U(c,t,o,i,r,n)}A(i)},P=e=>{O(o,e)},F=e=>{O(s,e,!1)},J=e=>{O(n,e)},M=e=>{O(r,e,!1)},Z=()=>{const n=e.readyState;if("interactive"==n||"complete"==n){if(f=1,q.forEach(y),u.has("d:qinit")){u.delete("d:qinit");const e=k("qinit"),t=m("[q-d\\\\:qinit]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];U(o,e,"d:qinit",n),o.removeAttribute("q-d:qinit")}A(n)}if(u.has("d:qidle")&&(u.delete("d:qidle"),(t.requestIdleCallback??t.setTimeout).bind(t)(()=>{const e=k("qidle"),t=m("[q-d\\\\:qidle]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];U(o,e,"d:qidle",n),o.removeAttribute("q-d:qidle")}A(n)})),u.has("e:qvisible")){h||(h=new IntersectionObserver(e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.isIntersecting&&(h.unobserve(r.target),U(r.target,k("qvisible",r),"e:qvisible",t))}A(t)}));const e=m("[q-e\\\\:qvisible]:not([q\\\\:observed])");for(let t=0;t<e.length;t++){const n=e[t];h.observe(n),n.setAttribute("q:observed","true")}}}},z=(...e)=>{for(let r=0;r<e.length;r++){const s=e[r];if("string"==typeof s){if(!u.has(s)){u.add(s);const{scope:e,eventName:r}=L(s),i=N(e),c=R(e);c===n?v(t,r,i?M:J,!0,i):q.forEach(e=>v(e,r,c===o?i?F:P:i?D:j,!0,i)),1!==f||"e:qvisible"!==s&&"d:qinit"!==s&&"d:qidle"!==s||Z()}}else q.has(s)||(u.forEach(e=>{const{scope:t,eventName:r}=L(e),i=N(t),c=R(t);c!==n&&v(s,r,c===o?i?F:P:i?D:j,!0,i)}),q.add(s))}},G=t._qwikEv;G?.roots||(Array.isArray(G)?z(...G):z("e:click","e:input"),t._qwikEv={events:u,roots:q,push:z},v(e,l,Z),Z())';
|
|
1171
|
+
|
|
1172
|
+
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst windowPrefix = "w";\nconst passiveWindowPrefix = "wp";\nconst documentPrefix = "d";\nconst passiveDocumentPrefix = "dp";\nconst elementPrefix = "e";\nconst passiveElementPrefix = "ep";\nconst capturePrefix = "capture:";\nconst readyStateChange = "readystatechange";\nconst containerReady = "qready";\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = /* @__PURE__ */ new Map();\nlet observer;\nlet hasInitialized;\nlet queuedTasks;\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, passive = false) => el.addEventListener(eventName, handler, { capture, passive });\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 runTasks = async (tasks) => {\n for (let i = 0; i < tasks.length; i++) {\n await tasks[i]();\n }\n};\nconst queueTasks = (tasks) => {\n if (tasks.length) {\n const run = () => runTasks(tasks);\n queuedTasks = queuedTasks ? queuedTasks.then(run, run) : run();\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 waitForContainerReady = (container) => {\n const hash = container.getAttribute("q:instance");\n return container.getAttribute("q:container") === "paused" && doc.readyState === "loading" && !doc[containerReady]?.[hash] && new Promise((resolve) => {\n const ready = (ev) => {\n if (ev.detail === hash) {\n doc.removeEventListener(containerReady, ready);\n resolve();\n }\n };\n addEventListener(doc, readyStateChange, resolve);\n addEventListener(doc, containerReady, ready);\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 const separatorIndex = event.indexOf(":");\n const scope = event.slice(0, separatorIndex);\n return {\n scope,\n eventName: kebabToCamel(event.slice(separatorIndex + 1))\n };\n};\nconst isPassiveScope = (scope) => scope.length === 2;\nconst getRootScope = (scope) => scope.charAt(0);\nconst isElementNode = (node) => !!node && node.nodeType === 1;\nconst isCaptureHandlerElement = (element, scopedKebabName, captureAttribute) => element.hasAttribute(captureAttribute) && (!!element._qDispatch?.[scopedKebabName] || element.hasAttribute("q-" + scopedKebabName));\nconst resolveHandler = (container, element, qBase, base, chunk, symbol, reqTime, reportSyncError = true) => {\n const eventData = {\n qBase,\n symbol,\n element,\n reqTime\n };\n if (!chunk) {\n const handler2 = (doc["qFuncs_" + container.getAttribute("q:instance")] || [])[+symbol];\n if (!handler2 && reportSyncError) {\n const error = new Error("sym:" + symbol);\n emitEvent("qerror", {\n importError: "sync",\n error,\n ...eventData\n });\n console.error(error);\n }\n return handler2;\n }\n const key = `${symbol}|${qBase}|${chunk}`;\n const handler = symbols.get(key);\n if (handler) {\n return handler;\n }\n const href = new URL(chunk, base).href;\n const module = import(\n href\n );\n resolveContainer(container);\n return module.then(\n (module2) => {\n const handler2 = module2[symbol];\n if (!handler2) {\n const error = new Error(`${symbol} not in ${href}`);\n emitEvent("qerror", {\n importError: "no-symbol",\n error,\n ...eventData\n });\n console.error(error);\n } else {\n symbols.set(key, handler2);\n emitEvent("qsymbol", eventData);\n }\n return handler2;\n },\n (error) => {\n emitEvent("qerror", {\n importError: "async",\n error,\n ...eventData\n });\n console.error(error);\n return void 0;\n }\n );\n};\nconst dispatch = (element, ev, scopedKebabName, tasks, kebabName, allowPreventDefault = true) => {\n let defer = false;\n if (kebabName) {\n if (allowPreventDefault && 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 run = () => handlers(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n } else if (handlers.length) {\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i];\n if (handler) {\n const run = () => handler(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\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 const waitForReady = waitForContainerReady(container);\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 run = (handler2) => {\n if (handler2 && element.isConnected) {\n const onError = (error) => {\n const retry = waitForContainerReady(container);\n if (retry) {\n return retry.then(() => run(handler2));\n }\n emitEvent("qerror", {\n error,\n qBase,\n symbol,\n element,\n reqTime\n });\n };\n try {\n const result = handler2.call(capturedIds, ev, element);\n if (isPromise(result)) {\n return result.catch(onError);\n }\n } catch (error) {\n return onError(error);\n }\n }\n };\n const resolve = (reportSyncError = true) => resolveHandler(container, element, qBase, base, chunk, symbol, reqTime, reportSyncError);\n const handler = waitForReady && !chunk ? resolve(false) : resolve();\n if (isPromise(handler)) {\n defer = true;\n tasks.push(() => handler.then(run));\n } else if (defer || waitForReady && !chunk && !handler) {\n defer = true;\n tasks.push(async () => {\n let retryHandler = handler;\n if (!retryHandler && waitForReady) {\n await waitForReady;\n retryHandler = resolve(false);\n }\n await run(retryHandler || await resolve());\n });\n } else {\n const result = run(handler);\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n }\n }\n};\nconst processElementEvent = (ev, scope = elementPrefix, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const captureAttribute = capturePrefix + kebabName;\n const elements = [];\n const captureHandlers = [];\n const tasks = [];\n let current = ev.target;\n while (current) {\n if (isElementNode(current)) {\n elements.push(current);\n captureHandlers.push(isCaptureHandlerElement(current, scopedKebabName, captureAttribute));\n current = current.parentElement;\n } else {\n current = current.parentElement;\n }\n }\n for (let i = elements.length - 1; i >= 0; i--) {\n if (captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n if (ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n for (let i = 0; i < elements.length; i++) {\n if (!captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n if (!ev.bubbles || ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n queueTasks(tasks);\n};\nconst processPassiveElementEvent = (ev) => processElementEvent(ev, passiveElementPrefix, false);\nconst broadcast = (scope, ev, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const elements = querySelectorAll("[q-" + scope + "\\\\:" + kebabName + "]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n }\n queueTasks(tasks);\n};\nconst processDocumentEvent = (ev) => {\n broadcast(documentPrefix, ev);\n};\nconst processPassiveDocumentEvent = (ev) => {\n broadcast(passiveDocumentPrefix, ev, false);\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev);\n};\nconst processPassiveWindowEvent = (ev) => {\n broadcast(passiveWindowPrefix, ev, false);\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 const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qinit", tasks);\n el.removeAttribute("q-d:qinit");\n }\n queueTasks(tasks);\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 const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qidle", tasks);\n el.removeAttribute("q-d:qidle");\n }\n queueTasks(tasks);\n });\n }\n if (events.has("e:qvisible")) {\n observer || (observer = new IntersectionObserver((entries) => {\n const tasks = [];\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(\n entry.target,\n createEvent("qvisible", entry),\n "e:qvisible",\n tasks\n );\n }\n }\n queueTasks(tasks);\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 const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope === windowPrefix) {\n addEventListener(\n win,\n eventName,\n passive ? processPassiveWindowEvent : processWindowEvent,\n true,\n passive\n );\n } else {\n roots.forEach(\n (root) => addEventListener(\n root,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\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 const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope !== windowPrefix) {\n addEventListener(\n eventNameOrRoot,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\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}';
|
|
1173
|
+
|
|
1174
|
+
var QWIK_BACKPATCH_EXECUTOR_MINIFIED = `const t='script[type="qwik/backpatch"]';function e(e,n){const o=n||e.querySelector("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");if(o){const n=o.querySelectorAll(t),r=n[n.length-1];if(r){const t=JSON.parse(r.textContent||"[]"),n=e.createTreeWalker(o,NodeFilter.SHOW_ELEMENT);let c=n.currentNode,i=c.hasAttribute(":")?0:-1;for(let e=0;e<t.length;e+=3){const o=t[e],r=t[e+1];let l=t[e+2];for(;i<o&&(c=n.nextNode(),c);)c.hasAttribute(":")&&i++;const s=c;null==l||!1===l?s.removeAttribute(r):("boolean"==typeof l&&(l=""),s.setAttribute(r,l))}}}}const n=document.currentScript;if(n){const t=n.closest("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");t&&e(document,t)}`;
|
|
1052
1175
|
|
|
1053
|
-
var QWIK_LOADER_DEFAULT_DEBUG = 'const doc = document;\nconst win = window;\nconst windowPrefix = "w";\nconst passiveWindowPrefix = "wp";\nconst documentPrefix = "d";\nconst passiveDocumentPrefix = "dp";\nconst elementPrefix = "e";\nconst passiveElementPrefix = "ep";\nconst capturePrefix = "capture:";\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = /* @__PURE__ */ new Map();\nlet observer;\nlet hasInitialized;\nlet queuedTasks;\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, passive = false) => el.addEventListener(eventName, handler, { capture, passive });\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 runTasks = async (tasks) => {\n for (let i = 0; i < tasks.length; i++) {\n await tasks[i]();\n }\n};\nconst queueTasks = (tasks) => {\n if (tasks.length) {\n const run = () => runTasks(tasks);\n queuedTasks = queuedTasks ? queuedTasks.then(run, run) : run();\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, { 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 const separatorIndex = event.indexOf(":");\n const scope = event.slice(0, separatorIndex);\n return {\n scope,\n eventName: kebabToCamel(event.slice(separatorIndex + 1))\n };\n};\nconst isPassiveScope = (scope) => scope.length === 2;\nconst getRootScope = (scope) => scope.charAt(0);\nconst isElementNode = (node) => !!node && node.nodeType === 1;\nconst isCaptureHandlerElement = (element, scopedKebabName, captureAttribute) => element.hasAttribute(captureAttribute) && (!!element._qDispatch?.[scopedKebabName] || element.hasAttribute("q-" + scopedKebabName));\nconst resolveHandler = (container, element, qBase, base, chunk, symbol, reqTime) => {\n const eventData = {\n qBase,\n symbol,\n element,\n reqTime\n };\n if (chunk === "") {\n const hash = container.getAttribute("q:instance");\n const handler2 = (doc["qFuncs_" + hash] || [])[Number.parseInt(symbol)];\n if (!handler2) {\n const error = new Error("sym:" + symbol);\n emitEvent("qerror", {\n importError: "sync",\n error,\n ...eventData\n });\n console.error(error);\n }\n return handler2;\n }\n const key = `${symbol}|${qBase}|${chunk}`;\n const handler = symbols.get(key);\n if (handler) {\n return handler;\n }\n const href = new URL(chunk, base).href;\n const module = import(\n href\n );\n resolveContainer(container);\n return module.then(\n (module2) => {\n const handler2 = module2[symbol];\n if (!handler2) {\n const error = new Error(`${symbol} not in ${href}`);\n emitEvent("qerror", {\n importError: "no-symbol",\n error,\n ...eventData\n });\n console.error(error);\n } else {\n symbols.set(key, handler2);\n emitEvent("qsymbol", eventData);\n }\n return handler2;\n },\n (error) => {\n emitEvent("qerror", {\n importError: "async",\n error,\n ...eventData\n });\n console.error(error);\n return void 0;\n }\n );\n};\nconst dispatch = (element, ev, scopedKebabName, tasks, kebabName, allowPreventDefault = true) => {\n let defer = false;\n if (kebabName) {\n if (allowPreventDefault && 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 run = () => handlers(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n } else if (handlers.length) {\n for (let i = 0; i < handlers.length; i++) {\n const handler = handlers[i];\n if (handler) {\n const run = () => handler(ev, element);\n if (defer) {\n tasks.push(async () => {\n const result = run();\n if (isPromise(result)) {\n await result;\n }\n });\n } else {\n const result = run();\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\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 run = (handler2) => {\n if (handler2 && element.isConnected) {\n try {\n const result = handler2.call(capturedIds, ev, element);\n if (isPromise(result)) {\n return result.catch((error) => {\n emitEvent("qerror", {\n error,\n qBase,\n symbol,\n element,\n reqTime\n });\n });\n }\n } catch (error) {\n emitEvent("qerror", {\n error,\n qBase,\n symbol,\n element,\n reqTime\n });\n }\n }\n };\n const handler = resolveHandler(container, element, qBase, base, chunk, symbol, reqTime);\n if (defer || isPromise(handler)) {\n defer = true;\n tasks.push(async () => {\n await run(isPromise(handler) ? await handler : handler);\n });\n } else {\n const result = run(handler);\n if (isPromise(result)) {\n defer = true;\n tasks.push(() => result);\n }\n }\n }\n }\n};\nconst processElementEvent = (ev, scope = elementPrefix, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const captureAttribute = capturePrefix + kebabName;\n const elements = [];\n const captureHandlers = [];\n const tasks = [];\n let current = ev.target;\n while (current) {\n if (isElementNode(current)) {\n elements.push(current);\n captureHandlers.push(isCaptureHandlerElement(current, scopedKebabName, captureAttribute));\n current = current.parentElement;\n } else {\n current = current.parentElement;\n }\n }\n for (let i = elements.length - 1; i >= 0; i--) {\n if (captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n const continuePropagation = !ev.cancelBubble;\n if (!continuePropagation || ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n for (let i = 0; i < elements.length; i++) {\n if (!captureHandlers[i]) {\n dispatch(elements[i], ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n const doBubble = ev.bubbles && !ev.cancelBubble;\n if (!doBubble || ev.cancelBubble) {\n queueTasks(tasks);\n return;\n }\n }\n }\n queueTasks(tasks);\n};\nconst processPassiveElementEvent = (ev) => processElementEvent(ev, passiveElementPrefix, false);\nconst broadcast = (scope, ev, allowPreventDefault = true) => {\n const kebabName = camelToKebab(ev.type);\n const scopedKebabName = scope + ":" + kebabName;\n const elements = querySelectorAll("[q-" + scope + "\\\\:" + kebabName + "]");\n const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, scopedKebabName, tasks, kebabName, allowPreventDefault);\n }\n queueTasks(tasks);\n};\nconst processDocumentEvent = (ev) => {\n broadcast(documentPrefix, ev);\n};\nconst processPassiveDocumentEvent = (ev) => {\n broadcast(passiveDocumentPrefix, ev, false);\n};\nconst processWindowEvent = (ev) => {\n broadcast(windowPrefix, ev);\n};\nconst processPassiveWindowEvent = (ev) => {\n broadcast(passiveWindowPrefix, ev, false);\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 const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qinit", tasks);\n el.removeAttribute("q-d:qinit");\n }\n queueTasks(tasks);\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 const tasks = [];\n for (let i = 0; i < elements.length; i++) {\n const el = elements[i];\n dispatch(el, ev, "d:qidle", tasks);\n el.removeAttribute("q-d:qidle");\n }\n queueTasks(tasks);\n });\n }\n if (events.has("e:qvisible")) {\n observer || (observer = new IntersectionObserver((entries) => {\n const tasks = [];\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(\n entry.target,\n createEvent("qvisible", entry),\n "e:qvisible",\n tasks\n );\n }\n }\n queueTasks(tasks);\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 const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope === windowPrefix) {\n addEventListener(\n win,\n eventName,\n passive ? processPassiveWindowEvent : processWindowEvent,\n true,\n passive\n );\n } else {\n roots.forEach(\n (root) => addEventListener(\n root,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\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 const passive = isPassiveScope(scope);\n const rootScope = getRootScope(scope);\n if (rootScope !== windowPrefix) {\n addEventListener(\n eventNameOrRoot,\n eventName,\n rootScope === documentPrefix ? passive ? processPassiveDocumentEvent : processDocumentEvent : passive ? processPassiveElementEvent : processElementEvent,\n true,\n passive\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}';
|
|
1176
|
+
var QWIK_BACKPATCH_EXECUTOR_DEBUG = `const BACKPATCH_DATA_SELECTOR = 'script[type="qwik/backpatch"]';\nfunction executeBackpatch(doc, containerElement) {\n const container = containerElement || doc.querySelector("[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])");\n if (container) {\n const scripts = container.querySelectorAll(BACKPATCH_DATA_SELECTOR);\n const script = scripts[scripts.length - 1];\n if (script) {\n const data = JSON.parse(script.textContent || "[]");\n const walker = doc.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);\n let currentNode = walker.currentNode;\n let currentNodeIdx = currentNode.hasAttribute(":") ? 0 : -1;\n for (let i = 0; i < data.length; i += 3) {\n const elementIdx = data[i];\n const attrName = data[i + 1];\n let value = data[i + 2];\n while (currentNodeIdx < elementIdx) {\n currentNode = walker.nextNode();\n if (!currentNode) {\n break;\n }\n if (currentNode.hasAttribute(":")) {\n currentNodeIdx++;\n }\n }\n const element = currentNode;\n if (value == null || value === false) {\n element.removeAttribute(attrName);\n } else {\n if (typeof value === "boolean") {\n value = "";\n }\n element.setAttribute(attrName, value);\n }\n }\n }\n }\n}\nconst executorScript = document.currentScript;\nif (executorScript) {\n const container = executorScript.closest(\n "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])"\n );\n if (container) {\n executeBackpatch(document, container);\n }\n}`;
|
|
1054
1177
|
|
|
1055
|
-
var
|
|
1178
|
+
var QWIK_OUT_OF_ORDER_EXECUTOR_MINIFIED = `const t='template[q\\\\:r="',e="q:r",n='[q\\\\:rp="',r="q:g",l="q:i",o="q:o",s="[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])",u=u=>{const i=new WeakMap,c=()=>{const t=u.currentScript;return t&&t.closest(s)||u},f=(t,e,n,r)=>{let l=i.get(t);return l||i.set(t,l={}),l[e]||(l[e]={r:{},n:0,t:n,o:r})},a=(t,e)=>t?(e&&e.style&&(e.style.display="none"),t.style&&(t.style.display="contents"),1):0,q=t=>{const e=t.o;let n,r,l=0;if("p"===e)for(const e in t.r)n=t.r[e],n[0]&&a(n[0],n[1])&&(n[0]=0,l++);else if("s"===e)for(r=t.n;(n=t.r[r])&&n[0]&&a(n[0],n[1]);r++)n[0]=0,l++,t.n=r+1;else if("r"===e){if(t.t<0)return 0;for(t.n<0&&(t.n=t.t-1),r=t.n;(n=t.r[r])&&n[0]&&a(n[0],n[1]);r--)n[0]=0,l++,t.n=r-1}else{if(t.t<0)return 0;for(r=0;r<t.t;r++)if(n=t.r[r],!n)return 0;for(r=0;r<t.t;r++)n=t.r[r],n[0]&&a(n[0],n[1])&&(n[0]=0,l++)}return l},p=s=>{const i=c(),p=((n,r)=>{const l=u.currentScript,o=l?l.previousElementSibling:null;if(o&&"template"===o.localName&&o.getAttribute(e)===r+"")return o;const s=n.querySelectorAll(t+r+'"]');return s.length?s[s.length-1]:null})(i,s);if(!p)return;const g=((e,r,l)=>{if(!l)return null;const o=((t,e)=>t.querySelector(n+e+'"]'))(e,r),s=o?((e,n)=>e.querySelector(t+n+'"]'))(o,r):null,u=s?s.parentNode:null;return s&&o&&u?(u.insertBefore(l.content,s),s.remove(),l.remove(),[o,o.previousElementSibling]):null})(i,s,p);if(!g)return;((t,e)=>{var n;const r=u;null==(n=r.qProcessOOOS)||n.call(r,t,e)})(s,g[0]||null);const m=p.getAttribute(r);if(m){const t=+(p.getAttribute(l)||0),e=f(i,m,-1,p.getAttribute(o)||"p");return e.r[t]=g,void q(e)}a(g[0]||null,g[1])};p.g=(t,e,n)=>{const r=f(c(),t,e,n);r.t=e,r.o=n,"r"===r.o&&0===r.n&&(r.n=e-1),q(r)},p.d=u,globalThis.qO=p};u(document)`;
|
|
1056
1179
|
|
|
1057
|
-
var
|
|
1180
|
+
var QWIK_OUT_OF_ORDER_EXECUTOR_DEBUG = `const Q_RESOLVED_SELECTOR = 'template[q\\\\:r="';\nconst Q_RESOLVED_ATTR = "q:r";\nconst Q_RESULT_PARENT_SELECTOR = '[q\\\\:rp="';\nconst Q_GROUP_ATTR = "q:g";\nconst Q_INDEX_ATTR = "q:i";\nconst Q_ORDER_ATTR = "q:o";\nconst Q_CONTAINER_SELECTOR = "[q\\\\:container]:not([q\\\\:container=html]):not([q\\\\:container=text])";\nconst installOutOfOrderExecutor = (doc) => {\n const groups = /* @__PURE__ */ new WeakMap();\n const process = (boundaryId, content) => {\n var _a;\n const executorDoc = doc;\n (_a = executorDoc.qProcessOOOS) == null ? void 0 : _a.call(executorDoc, boundaryId, content);\n };\n const getScope = () => {\n const script = doc.currentScript;\n return script ? script.closest(Q_CONTAINER_SELECTOR) || doc : doc;\n };\n const group = (scope, groupId, total, order) => {\n let scopedGroups = groups.get(scope);\n if (!scopedGroups) {\n groups.set(scope, scopedGroups = {});\n }\n return scopedGroups[groupId] || (scopedGroups[groupId] = {\n r: {},\n n: 0,\n t: total,\n o: order\n });\n };\n const getResolvedTemplate = (scope, boundaryId) => {\n const currentScript = doc.currentScript;\n const previousElement = currentScript ? currentScript.previousElementSibling : null;\n if (previousElement && previousElement.localName === "template" && previousElement.getAttribute(Q_RESOLVED_ATTR) === String(boundaryId)) {\n return previousElement;\n }\n const templates = scope.querySelectorAll(Q_RESOLVED_SELECTOR + boundaryId + '"]');\n return templates.length ? templates[templates.length - 1] : null;\n };\n const getPlaceholderTemplate = (content, boundaryId) => {\n return content.querySelector(Q_RESOLVED_SELECTOR + boundaryId + '"]');\n };\n const getResultParent = (scope, boundaryId) => {\n return scope.querySelector(Q_RESULT_PARENT_SELECTOR + boundaryId + '"]');\n };\n const reveal = (content, fallback) => {\n if (!content) {\n return 0;\n }\n if (fallback && fallback.style) {\n fallback.style.display = "none";\n }\n if (content.style) {\n content.style.display = "contents";\n }\n return 1;\n };\n const move = (scope, boundaryId, resolved) => {\n if (!resolved) {\n return null;\n }\n const content = getResultParent(scope, boundaryId);\n const placeholder = content ? getPlaceholderTemplate(content, boundaryId) : null;\n const parent = placeholder ? placeholder.parentNode : null;\n if (!placeholder || !content || !parent) {\n return null;\n }\n parent.insertBefore(resolved.content, placeholder);\n placeholder.remove();\n resolved.remove();\n return [content, content.previousElementSibling];\n };\n const flush = (group2) => {\n const order = group2.o;\n let entry;\n let index;\n let swapped = 0;\n if (order === "p") {\n for (const key in group2.r) {\n entry = group2.r[key];\n if (entry[0] && reveal(entry[0], entry[1])) {\n entry[0] = 0;\n swapped++;\n }\n }\n } else if (order === "s") {\n for (index = group2.n; (entry = group2.r[index]) && entry[0]; index++) {\n if (!reveal(entry[0], entry[1])) {\n break;\n }\n entry[0] = 0;\n swapped++;\n group2.n = index + 1;\n }\n } else if (order === "r") {\n if (group2.t < 0) {\n return 0;\n }\n if (group2.n < 0) {\n group2.n = group2.t - 1;\n }\n for (index = group2.n; (entry = group2.r[index]) && entry[0]; index--) {\n if (!reveal(entry[0], entry[1])) {\n break;\n }\n entry[0] = 0;\n swapped++;\n group2.n = index - 1;\n }\n } else {\n if (group2.t < 0) {\n return 0;\n }\n for (index = 0; index < group2.t; index++) {\n entry = group2.r[index];\n if (!entry) {\n return 0;\n }\n }\n for (index = 0; index < group2.t; index++) {\n entry = group2.r[index];\n if (entry[0] && reveal(entry[0], entry[1])) {\n entry[0] = 0;\n swapped++;\n }\n }\n }\n return swapped;\n };\n const qO = ((boundaryId) => {\n const scope = getScope();\n const resolved = getResolvedTemplate(scope, boundaryId);\n if (!resolved) {\n return;\n }\n const entry = move(scope, boundaryId, resolved);\n if (!entry) {\n return;\n }\n process(boundaryId, entry[0] || null);\n const groupId = resolved.getAttribute(Q_GROUP_ATTR);\n if (groupId) {\n const index = +(resolved.getAttribute(Q_INDEX_ATTR) || 0);\n const currentGroup = group(scope, groupId, -1, resolved.getAttribute(Q_ORDER_ATTR) || "p");\n currentGroup.r[index] = entry;\n flush(currentGroup);\n return;\n }\n reveal(entry[0] || null, entry[1]);\n });\n qO.g = (groupId, total, order) => {\n const currentGroup = group(getScope(), groupId, total, order);\n currentGroup.t = total;\n currentGroup.o = order;\n if (currentGroup.o === "r" && currentGroup.n === 0) {\n currentGroup.n = total - 1;\n }\n flush(currentGroup);\n };\n qO.d = doc;\n globalThis.qO = qO;\n};\ninstallOutOfOrderExecutor(document)`;
|
|
1058
1181
|
|
|
1059
1182
|
function getQwikLoaderScript(e = {}) {
|
|
1060
1183
|
return e.debug ? QWIK_LOADER_DEFAULT_DEBUG : QWIK_LOADER_DEFAULT_MINIFIED;
|
|
@@ -1072,8 +1195,16 @@ function getQwikBackpatchExecutorScript(e = {}) {
|
|
|
1072
1195
|
return e.debug ? QWIK_BACKPATCH_EXECUTOR_DEBUG : QWIK_BACKPATCH_EXECUTOR_MINIFIED;
|
|
1073
1196
|
}
|
|
1074
1197
|
|
|
1198
|
+
function getQwikOutOfOrderExecutorScript(e = {}) {
|
|
1199
|
+
if (!__EXPERIMENTAL__.suspense) {
|
|
1200
|
+
return "";
|
|
1201
|
+
}
|
|
1202
|
+
const t = e.debug ? QWIK_OUT_OF_ORDER_EXECUTOR_DEBUG : QWIK_OUT_OF_ORDER_EXECUTOR_MINIFIED;
|
|
1203
|
+
return `if(!globalThis.qO||globalThis.qO.d!==document){${t}}`;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1075
1206
|
// packages/qwik/src/server/ssr-node.ts
|
|
1076
|
-
import { _isJSXNode as
|
|
1207
|
+
import { _isJSXNode as qi, _EMPTY_OBJ, _EFFECT_BACK_REF as vr } from "@qwik.dev/core/internal";
|
|
1077
1208
|
|
|
1078
1209
|
import { isDev as isDev7 } from "@qwik.dev/core/build";
|
|
1079
1210
|
|
|
@@ -1105,19 +1236,19 @@ var SsrNode = class {
|
|
|
1105
1236
|
attrs;
|
|
1106
1237
|
/** Local props which don't serialize; */
|
|
1107
1238
|
localProps=null;
|
|
1108
|
-
get [
|
|
1109
|
-
return this.getProp(
|
|
1239
|
+
get [vr]() {
|
|
1240
|
+
return this.getProp(Qe);
|
|
1110
1241
|
}
|
|
1111
1242
|
setProp(e, t) {
|
|
1112
1243
|
if (this.attrs === _EMPTY_OBJ) {
|
|
1113
1244
|
this.setEmptyArrayAsVNodeDataAttributes();
|
|
1114
1245
|
}
|
|
1115
|
-
if (e.startsWith(
|
|
1246
|
+
if (e.startsWith(ws)) {
|
|
1116
1247
|
(this.localProps ||= {})[e] = t;
|
|
1117
1248
|
} else {
|
|
1118
1249
|
this.attrs[e] = t;
|
|
1119
1250
|
}
|
|
1120
|
-
if (e ==
|
|
1251
|
+
if (e == ps && t) {
|
|
1121
1252
|
this.cleanupQueue.push(t);
|
|
1122
1253
|
}
|
|
1123
1254
|
}
|
|
@@ -1133,14 +1264,14 @@ var SsrNode = class {
|
|
|
1133
1264
|
}
|
|
1134
1265
|
}
|
|
1135
1266
|
getProp(e) {
|
|
1136
|
-
if (e.startsWith(
|
|
1267
|
+
if (e.startsWith(ws)) {
|
|
1137
1268
|
return this.localProps ? this.localProps[e] ?? null : null;
|
|
1138
1269
|
} else {
|
|
1139
1270
|
return this.attrs[e] ?? null;
|
|
1140
1271
|
}
|
|
1141
1272
|
}
|
|
1142
1273
|
removeProp(e) {
|
|
1143
|
-
if (e.startsWith(
|
|
1274
|
+
if (e.startsWith(ws)) {
|
|
1144
1275
|
if (this.localProps) {
|
|
1145
1276
|
delete this.localProps[e];
|
|
1146
1277
|
}
|
|
@@ -1183,7 +1314,7 @@ var SsrNode = class {
|
|
|
1183
1314
|
|
|
1184
1315
|
var DomRef = class {
|
|
1185
1316
|
constructor(e) {
|
|
1186
|
-
this.
|
|
1317
|
+
this.ne = e;
|
|
1187
1318
|
}
|
|
1188
1319
|
__brand__="DomRef";
|
|
1189
1320
|
};
|
|
@@ -1200,16 +1331,16 @@ var SsrComponentFrame = class {
|
|
|
1200
1331
|
distributeChildrenIntoSlots(e, t, n) {
|
|
1201
1332
|
this.projectionScopedStyle = t;
|
|
1202
1333
|
this.projectionComponentFrame = n;
|
|
1203
|
-
if (
|
|
1334
|
+
if (qi(e)) {
|
|
1204
1335
|
const t = this.getSlotName(e);
|
|
1205
|
-
|
|
1336
|
+
_e(this.slots, t, e, 0);
|
|
1206
1337
|
} else if (Array.isArray(e) && e.length > 0) {
|
|
1207
1338
|
const t = [];
|
|
1208
1339
|
for (let n = 0; n < e.length; n++) {
|
|
1209
1340
|
const r = e[n];
|
|
1210
|
-
if (
|
|
1341
|
+
if (qi(r)) {
|
|
1211
1342
|
const e = this.getSlotName(r);
|
|
1212
|
-
if (e ===
|
|
1343
|
+
if (e === QDefaultSlot) {
|
|
1213
1344
|
t.push(r);
|
|
1214
1345
|
} else {
|
|
1215
1346
|
this.updateSlot(e, r);
|
|
@@ -1218,13 +1349,13 @@ var SsrComponentFrame = class {
|
|
|
1218
1349
|
t.push(r);
|
|
1219
1350
|
}
|
|
1220
1351
|
}
|
|
1221
|
-
t.length > 0 &&
|
|
1352
|
+
t.length > 0 && _e(this.slots, QDefaultSlot, t, 0);
|
|
1222
1353
|
} else {
|
|
1223
|
-
|
|
1354
|
+
_e(this.slots, QDefaultSlot, e, 0);
|
|
1224
1355
|
}
|
|
1225
1356
|
}
|
|
1226
1357
|
updateSlot(e, t) {
|
|
1227
|
-
let n =
|
|
1358
|
+
let n = ge(this.slots, e, 0);
|
|
1228
1359
|
if (n === null) {
|
|
1229
1360
|
n = t;
|
|
1230
1361
|
} else if (Array.isArray(n)) {
|
|
@@ -1232,25 +1363,99 @@ var SsrComponentFrame = class {
|
|
|
1232
1363
|
} else {
|
|
1233
1364
|
n = [ n, t ];
|
|
1234
1365
|
}
|
|
1235
|
-
|
|
1366
|
+
_e(this.slots, e, n, 0);
|
|
1236
1367
|
}
|
|
1237
1368
|
getSlotName(e) {
|
|
1238
|
-
if (e.props[
|
|
1239
|
-
return e.props[
|
|
1369
|
+
if (e.props[De]) {
|
|
1370
|
+
return e.props[De];
|
|
1240
1371
|
}
|
|
1241
|
-
return
|
|
1372
|
+
return QDefaultSlot;
|
|
1242
1373
|
}
|
|
1243
1374
|
hasSlot(e) {
|
|
1244
|
-
return
|
|
1375
|
+
return Ee(this.slots, e, 0);
|
|
1376
|
+
}
|
|
1377
|
+
claimChildrenForSlot(e) {
|
|
1378
|
+
return mapApp_remove(this.slots, e, 0);
|
|
1245
1379
|
}
|
|
1246
1380
|
consumeChildrenForSlot(e, t) {
|
|
1247
|
-
const n =
|
|
1381
|
+
const n = this.claimChildrenForSlot(t);
|
|
1248
1382
|
this.componentNode.setProp(t, e.id);
|
|
1249
1383
|
e.setProp(QSlotParent, this.componentNode.id);
|
|
1250
1384
|
return n;
|
|
1251
1385
|
}
|
|
1252
1386
|
};
|
|
1253
1387
|
|
|
1388
|
+
// packages/qwik/src/server/ssr-stream-writer.ts
|
|
1389
|
+
var renderSSRChunks = (e, t) => {
|
|
1390
|
+
let n = "";
|
|
1391
|
+
for (let r = 0; r < e.length; r++) {
|
|
1392
|
+
const s = e[r];
|
|
1393
|
+
if (typeof s === "string") {
|
|
1394
|
+
n += s;
|
|
1395
|
+
} else {
|
|
1396
|
+
const e = s.type === "root-ref" ? s.localId : s.localPath[0];
|
|
1397
|
+
n += String(t ? t[e] ?? e : e);
|
|
1398
|
+
if (s.type !== "root-ref-path") {
|
|
1399
|
+
continue;
|
|
1400
|
+
}
|
|
1401
|
+
const r = s.localPath;
|
|
1402
|
+
for (let e = 1; e < r.length; e++) {
|
|
1403
|
+
n += " " + r[e];
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
return n;
|
|
1408
|
+
};
|
|
1409
|
+
|
|
1410
|
+
var StringSSRWriter = class {
|
|
1411
|
+
buffer=[];
|
|
1412
|
+
write(e) {
|
|
1413
|
+
this.buffer.push(e);
|
|
1414
|
+
}
|
|
1415
|
+
writeRootRef(e) {
|
|
1416
|
+
writeStringRootRef(this, e);
|
|
1417
|
+
}
|
|
1418
|
+
writeRootRefPath(e) {
|
|
1419
|
+
writeStringRootRefPath(this, e);
|
|
1420
|
+
}
|
|
1421
|
+
clear() {
|
|
1422
|
+
this.buffer.length = 0;
|
|
1423
|
+
}
|
|
1424
|
+
toString(e) {
|
|
1425
|
+
return this.buffer.join("");
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
var StringBufferSegmentWriter = class {
|
|
1430
|
+
chunks=[];
|
|
1431
|
+
write(e) {
|
|
1432
|
+
this.chunks.push(e);
|
|
1433
|
+
}
|
|
1434
|
+
writeRootRef(e) {
|
|
1435
|
+
this.chunks.push({
|
|
1436
|
+
type: "root-ref",
|
|
1437
|
+
localId: e
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
writeRootRefPath(e) {
|
|
1441
|
+
this.chunks.push({
|
|
1442
|
+
type: "root-ref-path",
|
|
1443
|
+
localPath: e
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
clear() {
|
|
1447
|
+
this.chunks.length = 0;
|
|
1448
|
+
}
|
|
1449
|
+
extract() {
|
|
1450
|
+
const e = this.chunks;
|
|
1451
|
+
this.chunks = [];
|
|
1452
|
+
return e;
|
|
1453
|
+
}
|
|
1454
|
+
toString(e) {
|
|
1455
|
+
return renderSSRChunks(this.chunks, e);
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1254
1459
|
// packages/qwik/src/server/tag-nesting.ts
|
|
1255
1460
|
var allowedContent = e => {
|
|
1256
1461
|
switch (e) {
|
|
@@ -1667,7 +1872,7 @@ function getBuildBase(e) {
|
|
|
1667
1872
|
}
|
|
1668
1873
|
|
|
1669
1874
|
var versions = {
|
|
1670
|
-
qwik: "2.0.0-beta.
|
|
1875
|
+
qwik: "2.0.0-beta.36-dev+3268fab",
|
|
1671
1876
|
qwikDom: "2.1.19"
|
|
1672
1877
|
};
|
|
1673
1878
|
|
|
@@ -1736,7 +1941,7 @@ function vNodeData_createSsrNodeReference(e, t, n, r, s) {
|
|
|
1736
1941
|
i[i.length - 1]++;
|
|
1737
1942
|
}
|
|
1738
1943
|
}
|
|
1739
|
-
let a = n
|
|
1944
|
+
let a = String(n);
|
|
1740
1945
|
if (t[0] & (2 /* VIRTUAL_NODE */ | 1 /* TEXT_DATA */)) {
|
|
1741
1946
|
for (let e = 0; e < i.length; e++) {
|
|
1742
1947
|
const t = i[e];
|
|
@@ -1766,11 +1971,13 @@ function encodeAsAlphanumeric(e) {
|
|
|
1766
1971
|
}
|
|
1767
1972
|
|
|
1768
1973
|
// packages/qwik/src/server/ssr-container.ts
|
|
1974
|
+
var NO_SCRIPT_HERE_ELEMENTS = /* @__PURE__ */ new Set([ "script", "style", "textarea", "title", "iframe", "noframes", "noscript", "xmp", "template", "svg", "math" ]);
|
|
1975
|
+
|
|
1769
1976
|
function ssrCreateContainer(e) {
|
|
1770
1977
|
e.renderOptions ||= {};
|
|
1771
1978
|
return new SSRContainer({
|
|
1772
1979
|
tagName: e.tagName || "div",
|
|
1773
|
-
writer: e.writer || new
|
|
1980
|
+
writer: e.writer || new StringSSRWriter,
|
|
1774
1981
|
streamHandler: e.streamHandler,
|
|
1775
1982
|
locale: e.locale || "",
|
|
1776
1983
|
timing: e.timing || {
|
|
@@ -1790,24 +1997,19 @@ function ssrCreateContainer(e) {
|
|
|
1790
1997
|
});
|
|
1791
1998
|
}
|
|
1792
1999
|
|
|
1793
|
-
var
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
}
|
|
1798
|
-
toString() {
|
|
1799
|
-
return this.buffer.join("");
|
|
1800
|
-
}
|
|
2000
|
+
var noopStreamHandler = {
|
|
2001
|
+
flush() {},
|
|
2002
|
+
waitForPendingFlush() {},
|
|
2003
|
+
streamBlockStart() {},
|
|
2004
|
+
streamBlockEnd() {}
|
|
1801
2005
|
};
|
|
1802
2006
|
|
|
1803
|
-
var js = {};
|
|
1804
|
-
|
|
1805
2007
|
var QTemplateProps = {
|
|
1806
2008
|
hidden: true,
|
|
1807
2009
|
"aria-hidden": true
|
|
1808
2010
|
};
|
|
1809
2011
|
|
|
1810
|
-
var SSRContainer = class extends
|
|
2012
|
+
var SSRContainer = class extends ic {
|
|
1811
2013
|
tag;
|
|
1812
2014
|
isHtml;
|
|
1813
2015
|
writer;
|
|
@@ -1817,7 +2019,12 @@ var SSRContainer = class extends Ou {
|
|
|
1817
2019
|
resolvedManifest;
|
|
1818
2020
|
symbolToChunkResolver;
|
|
1819
2021
|
renderOptions;
|
|
2022
|
+
outOfOrderStreaming;
|
|
1820
2023
|
serializationCtx;
|
|
2024
|
+
// Sometimes there is no app state, but framework metadata still points to a vnode id.
|
|
2025
|
+
// For example, an OOOS segment can point outside the segment to a root vnode through
|
|
2026
|
+
// q:sparent, so root vnode data must still be emitted for the client ref table.
|
|
2027
|
+
hasVNodeRefsForSerialization=false;
|
|
1821
2028
|
/**
|
|
1822
2029
|
* We use this to append additional nodes in the head node
|
|
1823
2030
|
*
|
|
@@ -1835,6 +2042,7 @@ var SSRContainer = class extends Ou {
|
|
|
1835
2042
|
currentComponentNode=null;
|
|
1836
2043
|
styleIds=/* @__PURE__ */ new Set;
|
|
1837
2044
|
isBackpatchExecutorEmitted=false;
|
|
2045
|
+
isOutOfOrderExecutorEmitted=false;
|
|
1838
2046
|
backpatchMap=/* @__PURE__ */ new Map;
|
|
1839
2047
|
currentElementFrame=null;
|
|
1840
2048
|
renderTimer;
|
|
@@ -1846,16 +2054,31 @@ var SSRContainer = class extends Ou {
|
|
|
1846
2054
|
*/
|
|
1847
2055
|
depthFirstElementCount=-1;
|
|
1848
2056
|
vNodeDatas=[];
|
|
2057
|
+
vNodeDataOffset=0;
|
|
1849
2058
|
componentStack=[];
|
|
1850
2059
|
cleanupQueue=[];
|
|
1851
2060
|
emitContainerDataFrame=null;
|
|
1852
|
-
|
|
2061
|
+
Te=randomStr();
|
|
1853
2062
|
// Temporary flag to find missing roots after the state was serialized
|
|
1854
2063
|
t=false;
|
|
1855
2064
|
qlInclude;
|
|
1856
2065
|
promiseAttributes=null;
|
|
2066
|
+
vnodeSegment=null;
|
|
2067
|
+
i=0 /* NotReady */;
|
|
2068
|
+
// OOOS related fields
|
|
2069
|
+
outOfOrderId=0;
|
|
2070
|
+
outOfOrderUsed=false;
|
|
2071
|
+
outOfOrderPendingSegments=[];
|
|
2072
|
+
outOfOrderSegments=[];
|
|
2073
|
+
rootContainerReadyPromise=null;
|
|
2074
|
+
resolveRootContainerReady=null;
|
|
2075
|
+
renderQueue=Promise.resolve();
|
|
2076
|
+
emittedQwikEventNames=/* @__PURE__ */ new Set;
|
|
2077
|
+
emittedSyncFnCount=0;
|
|
2078
|
+
rootContainerSerializedRootCount=0;
|
|
2079
|
+
emittedVNodeDataOwners=null;
|
|
1857
2080
|
constructor(e) {
|
|
1858
|
-
super(e.renderOptions.serverData ??
|
|
2081
|
+
super(e.renderOptions.serverData ?? {}, e.locale);
|
|
1859
2082
|
this.symbolToChunkResolver = e => {
|
|
1860
2083
|
const t = e.lastIndexOf("_");
|
|
1861
2084
|
const n = this.resolvedManifest.mapper[t == -1 ? e : e.substring(t + 1)];
|
|
@@ -1868,19 +2091,28 @@ var SSRContainer = class extends Ou {
|
|
|
1868
2091
|
this.writer = e.writer;
|
|
1869
2092
|
this.streamHandler = e.streamHandler;
|
|
1870
2093
|
this.timing = e.timing;
|
|
1871
|
-
this.
|
|
2094
|
+
this.qe = e.buildBase;
|
|
1872
2095
|
this.resolvedManifest = e.resolvedManifest;
|
|
1873
2096
|
this.renderOptions = e.renderOptions;
|
|
1874
|
-
this.
|
|
1875
|
-
|
|
1876
|
-
|
|
2097
|
+
const t = this.renderOptions.streaming?.outOfOrder === true;
|
|
2098
|
+
if (!__EXPERIMENTAL__.suspense) {
|
|
2099
|
+
if (t) {
|
|
2100
|
+
throw new Error('Out-of-order Suspense streaming requires `experimental: ["suspense"]` in the `qwikVite` plugin.');
|
|
2101
|
+
}
|
|
2102
|
+
this.outOfOrderStreaming = false;
|
|
2103
|
+
} else {
|
|
2104
|
+
this.outOfOrderStreaming = t;
|
|
2105
|
+
}
|
|
2106
|
+
this.Pe = 1e5;
|
|
2107
|
+
const n = this.renderOptions.qwikLoader;
|
|
2108
|
+
this.qlInclude = n ? typeof n === "object" ? n.include === "never" ? 2 /* Done */ : 0 /* Module */ : n === "inline" ? 1 /* Inline */ : n === "never" ? 2 /* Done */ : 0 /* Module */ : 0 /* Module */;
|
|
1877
2109
|
if (this.qlInclude === 0 /* Module */) {
|
|
1878
2110
|
const e = this.resolvedManifest?.manifest.qwikLoader;
|
|
1879
2111
|
if (!e) {
|
|
1880
2112
|
this.qlInclude = 1 /* Inline */;
|
|
1881
2113
|
}
|
|
1882
2114
|
}
|
|
1883
|
-
this.
|
|
2115
|
+
this.v();
|
|
1884
2116
|
}
|
|
1885
2117
|
ensureProjectionResolved(e) {}
|
|
1886
2118
|
handleError(e, t) {
|
|
@@ -1905,23 +2137,158 @@ var SSRContainer = class extends Ou {
|
|
|
1905
2137
|
await this.closeContainer();
|
|
1906
2138
|
}
|
|
1907
2139
|
async renderJSX(e, t) {
|
|
1908
|
-
await
|
|
2140
|
+
await Xn(this, e, t);
|
|
2141
|
+
}
|
|
2142
|
+
A() {
|
|
2143
|
+
return this.i === 2 /* OOOSReady */;
|
|
2144
|
+
}
|
|
2145
|
+
/** Queue OOOS serialization/write work that must not overlap with root state serialization. */ S(e) {
|
|
2146
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2147
|
+
return e();
|
|
2148
|
+
}
|
|
2149
|
+
if (this.i === 0 /* NotReady */) {
|
|
2150
|
+
return e();
|
|
2151
|
+
}
|
|
2152
|
+
const t = this.i === 1 /* DataStreamStarted */ ? this.renderQueue.then(() => this.C()).then(e) : this.renderQueue.then(e);
|
|
2153
|
+
this.renderQueue = t.catch(() => {});
|
|
2154
|
+
return t;
|
|
2155
|
+
}
|
|
2156
|
+
C() {
|
|
2157
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || this.A()) {
|
|
2158
|
+
return;
|
|
2159
|
+
}
|
|
2160
|
+
return this.rootContainerReadyPromise ||= new Promise(e => {
|
|
2161
|
+
this.resolveRootContainerReady = e;
|
|
2162
|
+
});
|
|
2163
|
+
}
|
|
2164
|
+
I() {
|
|
2165
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || this.A()) {
|
|
2166
|
+
return;
|
|
2167
|
+
}
|
|
2168
|
+
this.rootContainerSerializedRootCount = this.serializationCtx.Yn.length;
|
|
2169
|
+
this.i = 2 /* OOOSReady */;
|
|
2170
|
+
this.resolveRootContainerReady?.();
|
|
2171
|
+
this.resolveRootContainerReady = null;
|
|
2172
|
+
this.rootContainerReadyPromise = null;
|
|
2173
|
+
}
|
|
2174
|
+
nextOutOfOrderId() {
|
|
2175
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2176
|
+
return 0;
|
|
2177
|
+
}
|
|
2178
|
+
this.outOfOrderUsed = true;
|
|
2179
|
+
return ++this.outOfOrderId;
|
|
2180
|
+
}
|
|
2181
|
+
emitOutOfOrderSegmentScripts(e) {
|
|
2182
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !e) {
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
this.write(e);
|
|
2186
|
+
}
|
|
2187
|
+
async segment(e, t, n) {
|
|
2188
|
+
if (!__EXPERIMENTAL__.suspense) {
|
|
2189
|
+
throw new Error('Out-of-order Suspense streaming requires `experimental: ["suspense"]` in the `qwikVite` plugin.');
|
|
2190
|
+
}
|
|
2191
|
+
if (!this.outOfOrderStreaming) {
|
|
2192
|
+
throw new Error("Out-of-order Suspense streaming requires `streaming.outOfOrder` to be `true`.");
|
|
2193
|
+
}
|
|
2194
|
+
this.markVNodeRefForSerialization(n.parentComponentFrame?.componentNode);
|
|
2195
|
+
const r = new StringBufferSegmentWriter;
|
|
2196
|
+
const s = this.createSegmentContainer(e, r);
|
|
2197
|
+
this.outOfOrderSegments.push(s);
|
|
2198
|
+
try {
|
|
2199
|
+
await s.renderJSX(t, n);
|
|
2200
|
+
await s.resolvePromiseAttributes();
|
|
2201
|
+
const e = r.extract();
|
|
2202
|
+
return {
|
|
2203
|
+
container: s,
|
|
2204
|
+
writer: r,
|
|
2205
|
+
htmlChunks: e
|
|
2206
|
+
};
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
this.removeOutOfOrderSegment(s);
|
|
2209
|
+
throw e;
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
F() {
|
|
2213
|
+
let e = this;
|
|
2214
|
+
while (e instanceof SSRSegmentContainer) {
|
|
2215
|
+
e = e.Re;
|
|
2216
|
+
}
|
|
2217
|
+
return e;
|
|
2218
|
+
}
|
|
2219
|
+
createSegmentContainer(e, t) {
|
|
2220
|
+
const n = this.F();
|
|
2221
|
+
const r = this.getOrCreateLastNode();
|
|
2222
|
+
this.addRoot(r);
|
|
2223
|
+
this.markVNodeRefForSerialization(r);
|
|
2224
|
+
const s = {
|
|
2225
|
+
tagNesting: 10 /* ANYTHING */ ,
|
|
2226
|
+
parent: null,
|
|
2227
|
+
elementName: "#segment",
|
|
2228
|
+
depthFirstElementIdx: -1,
|
|
2229
|
+
// OOOS inserts this synthetic root under the Suspense content host on the client.
|
|
2230
|
+
vNodeData: [ 16 /* SERIALIZE */ ],
|
|
2231
|
+
currentFile: null,
|
|
2232
|
+
refBase: r.id
|
|
2233
|
+
};
|
|
2234
|
+
const i = new SSRSegmentContainer({
|
|
2235
|
+
tagName: this.tag,
|
|
2236
|
+
writer: t,
|
|
2237
|
+
streamHandler: noopStreamHandler,
|
|
2238
|
+
locale: this.jt,
|
|
2239
|
+
timing: this.timing,
|
|
2240
|
+
buildBase: this.qe || "/build/",
|
|
2241
|
+
resolvedManifest: this.resolvedManifest,
|
|
2242
|
+
renderOptions: this.renderOptions
|
|
2243
|
+
}, n);
|
|
2244
|
+
const o = i;
|
|
2245
|
+
o.Cn = true;
|
|
2246
|
+
o.dt = this.dt;
|
|
2247
|
+
i.serializationCtx = i.serializationCtxFactory(SsrNode, DomRef, this.symbolToChunkResolver, t);
|
|
2248
|
+
i.serializationCtx.gt = this.serializationCtx.gt.bind(this.serializationCtx);
|
|
2249
|
+
i.currentElementFrame = s;
|
|
2250
|
+
i.currentComponentNode = this.currentComponentNode;
|
|
2251
|
+
i.depthFirstElementCount = 0;
|
|
2252
|
+
i.vNodeDatas = [ s.vNodeData ];
|
|
2253
|
+
i.componentStack = this.componentStack.slice();
|
|
2254
|
+
i.vnodeSegment = e;
|
|
2255
|
+
i.styleIds = this.styleIds;
|
|
2256
|
+
i.emittedQwikEventNames = this.emittedQwikEventNames;
|
|
2257
|
+
i.qlInclude = 2 /* Done */;
|
|
2258
|
+
i.Te = this.Te;
|
|
2259
|
+
o._didAddQwikLoader = true;
|
|
2260
|
+
return i;
|
|
2261
|
+
}
|
|
2262
|
+
queueOutOfOrderSegment(e) {
|
|
2263
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2266
|
+
this.outOfOrderPendingSegments.push(e);
|
|
2267
|
+
}
|
|
2268
|
+
removeOutOfOrderSegment(e) {
|
|
2269
|
+
const t = this.outOfOrderSegments;
|
|
2270
|
+
for (let n = 0; n < t.length; n++) {
|
|
2271
|
+
if (t[n] === e) {
|
|
2272
|
+
t.splice(n, 1);
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
1909
2276
|
}
|
|
1910
2277
|
setContext(e, t, n) {
|
|
1911
2278
|
const r = e;
|
|
1912
|
-
let s = r.getProp(
|
|
2279
|
+
let s = r.getProp(Je);
|
|
1913
2280
|
if (s == null) {
|
|
1914
|
-
r.setProp(
|
|
2281
|
+
r.setProp(Je, s = []);
|
|
1915
2282
|
}
|
|
1916
|
-
|
|
2283
|
+
_e(s, t.id, n, 0, true);
|
|
1917
2284
|
this.addRoot(r);
|
|
1918
2285
|
}
|
|
1919
2286
|
resolveContext(e, t) {
|
|
1920
2287
|
let n = e;
|
|
1921
2288
|
while (n) {
|
|
1922
|
-
const e = n.getProp(
|
|
1923
|
-
if (e != null &&
|
|
1924
|
-
return
|
|
2289
|
+
const e = n.getProp(Je);
|
|
2290
|
+
if (e != null && Ee(e, t.id, 0)) {
|
|
2291
|
+
return ge(e, t.id, 0);
|
|
1925
2292
|
}
|
|
1926
2293
|
n = n.parentComponent;
|
|
1927
2294
|
}
|
|
@@ -1948,15 +2315,15 @@ var SSRContainer = class extends Ou {
|
|
|
1948
2315
|
}
|
|
1949
2316
|
const e = this.renderOptions.containerAttributes || {};
|
|
1950
2317
|
const t = e[QRenderAttr];
|
|
1951
|
-
e[
|
|
2318
|
+
e[es] = "paused" /* PAUSED */;
|
|
1952
2319
|
e[QRuntimeAttr] = "2";
|
|
1953
|
-
e[QVersionAttr] = this.
|
|
2320
|
+
e[QVersionAttr] = this.ke ?? "dev";
|
|
1954
2321
|
e[QRenderAttr] = (t ? t + "-" : "") + (isDev8 ? "ssr-dev" : "ssr");
|
|
1955
|
-
e[
|
|
1956
|
-
e[QLocaleAttr] = this.
|
|
2322
|
+
e[Ge] = this.qe || "";
|
|
2323
|
+
e[QLocaleAttr] = this.jt;
|
|
1957
2324
|
e[QManifestHashAttr] = this.resolvedManifest.manifest.manifestHash;
|
|
1958
|
-
e[QInstanceAttr] = this.
|
|
1959
|
-
this.
|
|
2325
|
+
e[QInstanceAttr] = this.Te;
|
|
2326
|
+
this.Dt.containerAttributes = e;
|
|
1960
2327
|
this.openElement(this.tag, null, e);
|
|
1961
2328
|
if (!this.isHtml) {
|
|
1962
2329
|
this.emitContainerDataFrame = this.currentElementFrame;
|
|
@@ -1965,22 +2332,22 @@ var SSRContainer = class extends Ou {
|
|
|
1965
2332
|
/** Renders closing tag for current container */ closeContainer() {
|
|
1966
2333
|
return this.closeElement();
|
|
1967
2334
|
}
|
|
1968
|
-
|
|
2335
|
+
qt=0;
|
|
1969
2336
|
/** Renders opening tag for DOM element */
|
|
1970
2337
|
openElement(e, t, n, r = null, s = null, i = null, o = true) {
|
|
1971
2338
|
const a = isQwikStyleElement(e, n) || isQwikStyleElement(e, r);
|
|
1972
|
-
if (e
|
|
1973
|
-
this.
|
|
2339
|
+
if (NO_SCRIPT_HERE_ELEMENTS.has(e)) {
|
|
2340
|
+
this.qt++;
|
|
1974
2341
|
}
|
|
1975
2342
|
if (
|
|
1976
2343
|
// don't append qwik loader before qwik style elements
|
|
1977
2344
|
// it will confuse the resuming, because styles are expected to be the first nodes in subtree
|
|
1978
2345
|
!a && this.qlInclude === 1 /* Inline */) {
|
|
1979
|
-
if (this.
|
|
2346
|
+
if (this.qt === 0 && this.size > 30 * 1024 && e !== "body") {
|
|
1980
2347
|
this.emitQwikLoaderInline();
|
|
1981
2348
|
}
|
|
1982
2349
|
}
|
|
1983
|
-
let
|
|
2350
|
+
let c = void 0;
|
|
1984
2351
|
this.lastNode = null;
|
|
1985
2352
|
if (!a && this.currentElementFrame) {
|
|
1986
2353
|
vNodeData_incrementElementCount(this.currentElementFrame.vNodeData);
|
|
@@ -1992,31 +2359,31 @@ var SSRContainer = class extends Ou {
|
|
|
1992
2359
|
vNodeData_openElement(this.currentElementFrame.vNodeData);
|
|
1993
2360
|
this.write(LT);
|
|
1994
2361
|
this.write(e);
|
|
1995
|
-
const
|
|
2362
|
+
const l = this.getOrCreateLastNode();
|
|
1996
2363
|
if (n) {
|
|
1997
|
-
|
|
2364
|
+
c = this.writeAttrs(e, n, false, s, i, o);
|
|
1998
2365
|
}
|
|
1999
|
-
this.write(" " +
|
|
2366
|
+
this.write(" " + Es);
|
|
2000
2367
|
if (t !== null) {
|
|
2001
2368
|
this.write(`="${t}"`);
|
|
2002
2369
|
} else if (qTest) {
|
|
2003
2370
|
this.write(EMPTY_ATTR);
|
|
2004
2371
|
}
|
|
2005
|
-
if (r && !
|
|
2006
|
-
|
|
2372
|
+
if (r && !hr(r)) {
|
|
2373
|
+
c = this.writeAttrs(e, r, true, s, i, o) || c;
|
|
2007
2374
|
}
|
|
2008
2375
|
this.write(GT);
|
|
2009
|
-
if (
|
|
2010
|
-
|
|
2376
|
+
if (l) {
|
|
2377
|
+
l.setTreeNonUpdatable();
|
|
2011
2378
|
}
|
|
2012
|
-
return
|
|
2379
|
+
return c;
|
|
2013
2380
|
}
|
|
2014
2381
|
/** Renders closing tag for DOM element */ closeElement() {
|
|
2015
2382
|
if (this.currentElementFrame === this.emitContainerDataFrame) {
|
|
2016
2383
|
this.emitContainerDataFrame = null;
|
|
2017
2384
|
this.onRenderDone();
|
|
2018
2385
|
const e = createTimer();
|
|
2019
|
-
return
|
|
2386
|
+
return qs(qs(this.emitContainerData(), () => this._closeElement()), () => {
|
|
2020
2387
|
this.timing.snapshot = e();
|
|
2021
2388
|
});
|
|
2022
2389
|
}
|
|
@@ -2032,7 +2399,7 @@ var SSRContainer = class extends Ou {
|
|
|
2032
2399
|
for (let t = 0; t < e.length; t++) {
|
|
2033
2400
|
const n = e[t];
|
|
2034
2401
|
if (hasDestroy(n)) {
|
|
2035
|
-
n.
|
|
2402
|
+
n.Tn();
|
|
2036
2403
|
}
|
|
2037
2404
|
}
|
|
2038
2405
|
e = this.cleanupQueue.pop();
|
|
@@ -2047,8 +2414,8 @@ var SSRContainer = class extends Ou {
|
|
|
2047
2414
|
this.write(GT);
|
|
2048
2415
|
}
|
|
2049
2416
|
this.lastNode = null;
|
|
2050
|
-
if (t
|
|
2051
|
-
this.
|
|
2417
|
+
if (NO_SCRIPT_HERE_ELEMENTS.has(t)) {
|
|
2418
|
+
this.qt--;
|
|
2052
2419
|
}
|
|
2053
2420
|
}
|
|
2054
2421
|
/** Writes opening data to vNodeData for fragment boundaries */ openFragment(e) {
|
|
@@ -2067,7 +2434,13 @@ var SSRContainer = class extends Ou {
|
|
|
2067
2434
|
this.openFragment(e);
|
|
2068
2435
|
const t = this.getComponentFrame();
|
|
2069
2436
|
if (t) {
|
|
2070
|
-
this.
|
|
2437
|
+
const e = this.getOrCreateLastNode();
|
|
2438
|
+
this.markVNodeRefForSerialization(e);
|
|
2439
|
+
if (!this.vnodeSegment) {
|
|
2440
|
+
this.addRoot(t.componentNode);
|
|
2441
|
+
} else {
|
|
2442
|
+
this.markVNodeRefForSerialization(t.componentNode);
|
|
2443
|
+
}
|
|
2071
2444
|
t.projectionDepth++;
|
|
2072
2445
|
}
|
|
2073
2446
|
}
|
|
@@ -2108,21 +2481,24 @@ var SSRContainer = class extends Ou {
|
|
|
2108
2481
|
if (e.slots.length === 0) {
|
|
2109
2482
|
return;
|
|
2110
2483
|
}
|
|
2111
|
-
this.openElement(
|
|
2484
|
+
this.openElement(is, null, QTemplateProps, null);
|
|
2112
2485
|
const t = e.projectionScopedStyle;
|
|
2113
2486
|
for (let n = 0; n < e.slots.length; n += 2) {
|
|
2114
2487
|
const r = e.slots[n];
|
|
2115
2488
|
const s = e.slots[n + 1];
|
|
2489
|
+
if (this.vnodeSegment) {
|
|
2490
|
+
this.markVNodeRefForSerialization(e.componentNode);
|
|
2491
|
+
}
|
|
2116
2492
|
this.openFragment(isDev8 ? {
|
|
2117
|
-
[
|
|
2118
|
-
[QSlotParent]: e.componentNode.id
|
|
2493
|
+
[xe]: "P" /* Projection */ ,
|
|
2494
|
+
[QSlotParent]: e.componentNode.id,
|
|
2495
|
+
[De]: r
|
|
2119
2496
|
} : {
|
|
2120
|
-
[QSlotParent]: e.componentNode.id
|
|
2497
|
+
[QSlotParent]: e.componentNode.id,
|
|
2498
|
+
[De]: r
|
|
2121
2499
|
});
|
|
2122
2500
|
const i = this.getOrCreateLastNode();
|
|
2123
|
-
|
|
2124
|
-
i.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
2125
|
-
}
|
|
2501
|
+
i.vnodeData[0] |= 16 /* SERIALIZE */;
|
|
2126
2502
|
e.componentNode.setProp(r, i.id);
|
|
2127
2503
|
await this.renderJSX(s, {
|
|
2128
2504
|
currentStyleScoped: t,
|
|
@@ -2145,29 +2521,31 @@ var SSRContainer = class extends Ou {
|
|
|
2145
2521
|
}
|
|
2146
2522
|
addRoot(e) {
|
|
2147
2523
|
if (this.t) {
|
|
2148
|
-
|
|
2524
|
+
const t = this.serializationCtx.ge(e);
|
|
2525
|
+
return t;
|
|
2149
2526
|
}
|
|
2150
2527
|
return this.serializationCtx.St(e);
|
|
2151
2528
|
}
|
|
2152
2529
|
getOrCreateLastNode() {
|
|
2153
2530
|
if (!this.lastNode) {
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
this.
|
|
2531
|
+
const e = this.currentElementFrame;
|
|
2532
|
+
const t = e.depthFirstElementIdx + 1;
|
|
2533
|
+
const n = e.refBase ?? (this.vnodeSegment ? je(this.vnodeSegment, t) : t + this.vNodeDataOffset);
|
|
2534
|
+
this.lastNode = vNodeData_createSsrNodeReference(this.currentComponentNode, e.vNodeData, n, this.cleanupQueue, e.currentFile);
|
|
2157
2535
|
}
|
|
2158
2536
|
return this.lastNode;
|
|
2159
2537
|
}
|
|
2160
2538
|
addUnclaimedProjection(e, t, n) {
|
|
2161
2539
|
e.slots.push(t, n);
|
|
2162
2540
|
}
|
|
2163
|
-
|
|
2541
|
+
v() {
|
|
2164
2542
|
const e = this.resolvedManifest.manifest.injections;
|
|
2165
2543
|
if (!e) {
|
|
2166
2544
|
return;
|
|
2167
2545
|
}
|
|
2168
2546
|
for (let t = 0; t < e.length; t++) {
|
|
2169
2547
|
const n = e[t];
|
|
2170
|
-
const r =
|
|
2548
|
+
const r = Xi(n.tag, null, n.attributes || {}, null, 0, null);
|
|
2171
2549
|
if (n.location === "head") {
|
|
2172
2550
|
this.additionalHeadNodes.push(r);
|
|
2173
2551
|
} else {
|
|
@@ -2175,19 +2553,19 @@ var SSRContainer = class extends Ou {
|
|
|
2175
2553
|
}
|
|
2176
2554
|
}
|
|
2177
2555
|
}
|
|
2178
|
-
|
|
2556
|
+
Xe(e, t, n, r) {
|
|
2179
2557
|
if (r) {
|
|
2180
2558
|
const e = this.getComponentFrame(0);
|
|
2181
2559
|
e.scopedStyleIds.add(t);
|
|
2182
2560
|
const r = convertStyleIdsToString(e.scopedStyleIds);
|
|
2183
|
-
this.setHostProp(n,
|
|
2561
|
+
this.setHostProp(n, He, r);
|
|
2184
2562
|
}
|
|
2185
2563
|
if (!this.styleIds.has(t)) {
|
|
2186
2564
|
this.styleIds.add(t);
|
|
2187
2565
|
if (this.currentElementFrame?.elementName === "html") {
|
|
2188
|
-
this.additionalHeadNodes.push(
|
|
2566
|
+
this.additionalHeadNodes.push(Fi("style", null, {
|
|
2189
2567
|
dangerouslySetInnerHTML: e,
|
|
2190
|
-
[
|
|
2568
|
+
[Ue]: t
|
|
2191
2569
|
}, null, 0, t));
|
|
2192
2570
|
} else {
|
|
2193
2571
|
this._styleNode(t, e);
|
|
@@ -2196,24 +2574,65 @@ var SSRContainer = class extends Ou {
|
|
|
2196
2574
|
}
|
|
2197
2575
|
_styleNode(e, t) {
|
|
2198
2576
|
this.openElement("style", null, {
|
|
2199
|
-
[
|
|
2577
|
+
[Ue]: e
|
|
2200
2578
|
});
|
|
2201
2579
|
this.write(t);
|
|
2202
2580
|
this.closeElement();
|
|
2203
2581
|
}
|
|
2582
|
+
ut(e) {
|
|
2583
|
+
if (this.isHtml && this.currentElementFrame?.elementName === "html") {
|
|
2584
|
+
this.additionalHeadNodes.push(e);
|
|
2585
|
+
return true;
|
|
2586
|
+
}
|
|
2587
|
+
return false;
|
|
2588
|
+
}
|
|
2204
2589
|
////////////////////////////////////
|
|
2205
2590
|
emitContainerData() {
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2591
|
+
const e = this.renderOptions.streaming?.inOrder?.strategy === "disabled";
|
|
2592
|
+
const t = !e || __EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed;
|
|
2593
|
+
return qs(qs(t ? this.streamHandler.flush() : void 0, () => this.resolvePromiseAttributes()), () => {
|
|
2594
|
+
this.i = 1 /* DataStreamStarted */;
|
|
2595
|
+
return qs(this.emitStateData(), () => {
|
|
2596
|
+
this.t = true;
|
|
2597
|
+
return qs(this.emitRestStateData(), () => this.emitOutOfOrderSegmentsAndData());
|
|
2598
|
+
});
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2601
|
+
emitRestStateData() {
|
|
2602
|
+
this.emitVNodeData();
|
|
2603
|
+
this.emitDelayedOutOfOrderSegmentVNodeData();
|
|
2604
|
+
if (!isDev8) {
|
|
2605
|
+
preloaderPost(this, this.renderOptions, this.Dt?.nonce);
|
|
2606
|
+
}
|
|
2607
|
+
this.emitSyncFnsData();
|
|
2608
|
+
this.emitPatchDataIfNeeded();
|
|
2609
|
+
this.emitExecutorIfNeeded();
|
|
2610
|
+
this.emitQwikLoaderAtBottomIfNeeded();
|
|
2611
|
+
this.emitContainerReadyEventIfNeeded();
|
|
2612
|
+
}
|
|
2613
|
+
emitDelayedOutOfOrderSegmentVNodeData() {
|
|
2614
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
2615
|
+
return;
|
|
2616
|
+
}
|
|
2617
|
+
for (let e = 0; e < this.outOfOrderSegments.length; e++) {
|
|
2618
|
+
const t = this.outOfOrderSegments[e];
|
|
2619
|
+
if (t.Qe === 1 /* EarlyFinalized */) {
|
|
2620
|
+
t.He();
|
|
2621
|
+
e--;
|
|
2211
2622
|
}
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
emitOutOfOrderSegmentsAndData() {
|
|
2626
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
2627
|
+
return;
|
|
2628
|
+
}
|
|
2629
|
+
this.emitOutOfOrderExecutorIfNeeded();
|
|
2630
|
+
return qs(this.streamHandler.flush(), async () => {
|
|
2631
|
+
this.I();
|
|
2632
|
+
if (this.outOfOrderPendingSegments.length) {
|
|
2633
|
+
await Promise.all(this.outOfOrderPendingSegments);
|
|
2634
|
+
}
|
|
2635
|
+
});
|
|
2217
2636
|
}
|
|
2218
2637
|
/**
|
|
2219
2638
|
* Serialize the vNodeData into a string and emit it as a script tag.
|
|
@@ -2232,50 +2651,59 @@ var SSRContainer = class extends Ou {
|
|
|
2232
2651
|
*
|
|
2233
2652
|
* NOTE: Not every element will need vNodeData. So we need to encode how many elements should be
|
|
2234
2653
|
* skipped. By choosing different separators we can encode different numbers of elements to skip.
|
|
2235
|
-
*/ emitVNodeData() {
|
|
2236
|
-
|
|
2654
|
+
*/ emitVNodeData(e) {
|
|
2655
|
+
this.F().markVNodeDataOwnerEmitted(e);
|
|
2656
|
+
if (!e && !this.serializationCtx.Yn.length && !this.hasVNodeRefsForSerialization) {
|
|
2237
2657
|
return;
|
|
2238
2658
|
}
|
|
2239
|
-
this.
|
|
2659
|
+
this.emitVNodeDataScript(e, this.vNodeDatas.entries());
|
|
2660
|
+
}
|
|
2661
|
+
emitVNodeDataScript(e, t, n = false) {
|
|
2662
|
+
const r = {
|
|
2240
2663
|
type: "qwik/vnode"
|
|
2241
|
-
}
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2664
|
+
};
|
|
2665
|
+
if (__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && e) {
|
|
2666
|
+
r[kh] = e;
|
|
2667
|
+
}
|
|
2668
|
+
if (n) {
|
|
2669
|
+
r[QStatePatchAttr] = true;
|
|
2670
|
+
}
|
|
2671
|
+
this.openScript(r);
|
|
2672
|
+
const s = [];
|
|
2673
|
+
let i = 0;
|
|
2674
|
+
for (const [e, n] of t) {
|
|
2675
|
+
const t = n[0];
|
|
2676
|
+
if (t & 16 /* SERIALIZE */) {
|
|
2677
|
+
i = this.emitVNodeSeparators(i, e);
|
|
2678
|
+
if (t & 8 /* REFERENCE */) {
|
|
2251
2679
|
this.write(VNodeDataSeparator.REFERENCE_CH);
|
|
2252
2680
|
}
|
|
2253
|
-
if (
|
|
2254
|
-
let
|
|
2255
|
-
let
|
|
2256
|
-
for (let r = 1; r <
|
|
2257
|
-
const i =
|
|
2681
|
+
if (t & (1 /* TEXT_DATA */ | 2 /* VIRTUAL_NODE */ | 4 /* ELEMENT_NODE */)) {
|
|
2682
|
+
let e = null;
|
|
2683
|
+
let t = 0;
|
|
2684
|
+
for (let r = 1; r < n.length; r++) {
|
|
2685
|
+
const i = n[r];
|
|
2258
2686
|
if (typeof i === "object" && i !== null) {
|
|
2259
|
-
|
|
2260
|
-
|
|
2687
|
+
s.push(e);
|
|
2688
|
+
e = i;
|
|
2261
2689
|
} else if (i === OPEN_FRAGMENT) {
|
|
2262
|
-
|
|
2690
|
+
t++;
|
|
2263
2691
|
this.write(VNodeDataChar.OPEN_CHAR);
|
|
2264
2692
|
} else if (i === CLOSE_FRAGMENT) {
|
|
2265
|
-
if (
|
|
2266
|
-
this.writeFragmentAttrs(
|
|
2267
|
-
|
|
2693
|
+
if (e) {
|
|
2694
|
+
this.writeFragmentAttrs(e);
|
|
2695
|
+
e = s.pop();
|
|
2268
2696
|
}
|
|
2269
|
-
|
|
2697
|
+
t--;
|
|
2270
2698
|
this.write(VNodeDataChar.CLOSE_CHAR);
|
|
2271
2699
|
} else if (i === WRITE_ELEMENT_ATTRS) {
|
|
2272
|
-
if (
|
|
2700
|
+
if (e && !hr(e)) {
|
|
2273
2701
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2274
2702
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2275
|
-
this.writeFragmentAttrs(
|
|
2703
|
+
this.writeFragmentAttrs(e);
|
|
2276
2704
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2277
2705
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2278
|
-
|
|
2706
|
+
e = s.pop();
|
|
2279
2707
|
}
|
|
2280
2708
|
} else if (i >= 0) {
|
|
2281
2709
|
this.write(encodeAsAlphanumeric(i));
|
|
@@ -2283,60 +2711,101 @@ var SSRContainer = class extends Ou {
|
|
|
2283
2711
|
this.write(String(0 - i));
|
|
2284
2712
|
}
|
|
2285
2713
|
}
|
|
2286
|
-
while (
|
|
2287
|
-
if (
|
|
2288
|
-
this.writeFragmentAttrs(
|
|
2289
|
-
|
|
2714
|
+
while (t-- > 0) {
|
|
2715
|
+
if (e) {
|
|
2716
|
+
this.writeFragmentAttrs(e);
|
|
2717
|
+
e = s.pop();
|
|
2290
2718
|
}
|
|
2291
2719
|
this.write(VNodeDataChar.CLOSE_CHAR);
|
|
2292
2720
|
}
|
|
2293
2721
|
}
|
|
2294
2722
|
}
|
|
2295
2723
|
}
|
|
2296
|
-
this.
|
|
2724
|
+
this.closeScript();
|
|
2725
|
+
if (n && !e) {
|
|
2726
|
+
this.emitInlineScript("document.qProcessVNodeDataPatch&&document.qProcessVNodeDataPatch(document.currentScript.previousElementSibling)");
|
|
2727
|
+
}
|
|
2728
|
+
}
|
|
2729
|
+
markVNodeRefForSerialization(e) {
|
|
2730
|
+
if (e) {
|
|
2731
|
+
this.hasVNodeRefsForSerialization = true;
|
|
2732
|
+
e.vnodeData[0] |= 16 /* SERIALIZE */ | 8 /* REFERENCE */;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
markVNodeDataOwnerEmitted(e) {
|
|
2736
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
2737
|
+
return;
|
|
2738
|
+
}
|
|
2739
|
+
(this.emittedVNodeDataOwners ||= /* @__PURE__ */ new Set).add(e);
|
|
2740
|
+
}
|
|
2741
|
+
isVNodeDataOwnerEmitted(e) {
|
|
2742
|
+
return this.emittedVNodeDataOwners?.has(e) === true;
|
|
2743
|
+
}
|
|
2744
|
+
getVNodeDataOwnerFromNodeId(e) {
|
|
2745
|
+
const t = parseInt(e, 10);
|
|
2746
|
+
if (t >= 0) {
|
|
2747
|
+
return {
|
|
2748
|
+
owner: void 0,
|
|
2749
|
+
localIndex: t
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2752
|
+
const n = -t - 1;
|
|
2753
|
+
const r = Math.floor((Math.sqrt(8 * n + 1) - 1) / 2);
|
|
2754
|
+
const s = r * (r + 1) / 2;
|
|
2755
|
+
const i = n - s;
|
|
2756
|
+
const o = r - i;
|
|
2757
|
+
return {
|
|
2758
|
+
owner: String(o + 1),
|
|
2759
|
+
localIndex: i
|
|
2760
|
+
};
|
|
2297
2761
|
}
|
|
2298
2762
|
writeFragmentAttrs(e) {
|
|
2299
2763
|
for (const t in e) {
|
|
2300
|
-
|
|
2301
|
-
let r =
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2764
|
+
const n = e[t];
|
|
2765
|
+
let r = n;
|
|
2766
|
+
let s;
|
|
2767
|
+
let i = null;
|
|
2768
|
+
if (t === as && typeof n === "number") {
|
|
2769
|
+
s = n;
|
|
2770
|
+
r = String(n);
|
|
2771
|
+
} else if (typeof n !== "string") {
|
|
2772
|
+
s = this.addRoot(n);
|
|
2773
|
+
if (s === void 0) {
|
|
2305
2774
|
continue;
|
|
2306
2775
|
}
|
|
2307
|
-
|
|
2776
|
+
r = String(s);
|
|
2308
2777
|
}
|
|
2309
2778
|
switch (t) {
|
|
2310
|
-
case
|
|
2779
|
+
case He:
|
|
2311
2780
|
this.write(VNodeDataChar.SCOPED_STYLE_CHAR);
|
|
2312
2781
|
break;
|
|
2313
2782
|
|
|
2314
|
-
case
|
|
2783
|
+
case Le:
|
|
2315
2784
|
this.write(VNodeDataChar.RENDER_FN_CHAR);
|
|
2316
2785
|
break;
|
|
2317
2786
|
|
|
2318
|
-
case
|
|
2787
|
+
case as:
|
|
2319
2788
|
this.write(VNodeDataChar.ID_CHAR);
|
|
2320
2789
|
break;
|
|
2321
2790
|
|
|
2322
|
-
case
|
|
2791
|
+
case ds:
|
|
2323
2792
|
this.write(VNodeDataChar.PROPS_CHAR);
|
|
2324
2793
|
break;
|
|
2325
2794
|
|
|
2326
|
-
case
|
|
2327
|
-
|
|
2795
|
+
case hs:
|
|
2796
|
+
i = encodeVNodeDataKey;
|
|
2328
2797
|
this.write(VNodeDataChar.KEY_CHAR);
|
|
2329
2798
|
break;
|
|
2330
2799
|
|
|
2331
|
-
case
|
|
2800
|
+
case ps:
|
|
2332
2801
|
this.write(VNodeDataChar.SEQ_CHAR);
|
|
2333
2802
|
break;
|
|
2334
2803
|
|
|
2335
|
-
case
|
|
2804
|
+
case $s:
|
|
2336
2805
|
this.write(VNodeDataChar.SEQ_IDX_CHAR);
|
|
2337
2806
|
break;
|
|
2338
2807
|
|
|
2339
|
-
case
|
|
2808
|
+
case Qe:
|
|
2340
2809
|
this.write(VNodeDataChar.BACK_REFS_CHAR);
|
|
2341
2810
|
break;
|
|
2342
2811
|
|
|
@@ -2345,68 +2814,86 @@ var SSRContainer = class extends Ou {
|
|
|
2345
2814
|
break;
|
|
2346
2815
|
|
|
2347
2816
|
// Skipping `\` character for now because it is used for escaping.
|
|
2348
|
-
case
|
|
2817
|
+
case Je:
|
|
2349
2818
|
this.write(VNodeDataChar.CONTEXT_CHAR);
|
|
2350
2819
|
break;
|
|
2351
2820
|
|
|
2352
|
-
case
|
|
2821
|
+
case De:
|
|
2353
2822
|
this.write(VNodeDataChar.SLOT_CHAR);
|
|
2354
2823
|
break;
|
|
2355
2824
|
|
|
2356
2825
|
default:
|
|
2357
2826
|
{
|
|
2358
|
-
|
|
2827
|
+
i = encodeURI;
|
|
2359
2828
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2360
2829
|
this.write(encodeVNodeDataString(t));
|
|
2361
2830
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2362
2831
|
}
|
|
2363
2832
|
}
|
|
2364
|
-
const
|
|
2365
|
-
const
|
|
2366
|
-
if (
|
|
2833
|
+
const o = encodeVNodeDataString(i ? i(r) : r);
|
|
2834
|
+
const a = i ? o !== r : false;
|
|
2835
|
+
if (a) {
|
|
2367
2836
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2368
|
-
this.write(
|
|
2837
|
+
this.write(o);
|
|
2369
2838
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2839
|
+
} else if (typeof s === "number") {
|
|
2840
|
+
this.writeRootRef(s);
|
|
2370
2841
|
} else {
|
|
2371
|
-
this.write(
|
|
2842
|
+
this.write(r);
|
|
2372
2843
|
}
|
|
2373
2844
|
}
|
|
2374
2845
|
}
|
|
2375
2846
|
emitStateData() {
|
|
2376
|
-
if (!this.serializationCtx.
|
|
2847
|
+
if (!this.serializationCtx.Yn.length) {
|
|
2377
2848
|
return;
|
|
2378
2849
|
}
|
|
2379
2850
|
const e = this.stateScriptAttrs();
|
|
2380
|
-
this.
|
|
2381
|
-
|
|
2382
|
-
|
|
2851
|
+
this.openScript(e);
|
|
2852
|
+
this.serializationCtx.Bn(this.writer);
|
|
2853
|
+
return qs(this.serializationCtx.It(), () => {
|
|
2854
|
+
this.closeScript();
|
|
2383
2855
|
});
|
|
2384
2856
|
}
|
|
2385
2857
|
/** Add q-d:qidle attribute to eagerly resume some state if needed */ stateScriptAttrs() {
|
|
2386
2858
|
const e = {
|
|
2387
|
-
type: "qwik/state"
|
|
2859
|
+
type: "qwik/state",
|
|
2860
|
+
[QInstanceAttr]: this.Te
|
|
2388
2861
|
};
|
|
2389
|
-
const t = this.serializationCtx.
|
|
2862
|
+
const t = this.serializationCtx.Tt;
|
|
2390
2863
|
if (t.size > 0) {
|
|
2391
|
-
e["q-d:qidle"] =
|
|
2864
|
+
e["q-d:qidle"] = Mf(null, "_res", _, null, [ ...t ]);
|
|
2392
2865
|
}
|
|
2393
2866
|
return e;
|
|
2394
2867
|
}
|
|
2395
|
-
emitSyncFnsData() {
|
|
2396
|
-
const
|
|
2397
|
-
|
|
2398
|
-
|
|
2868
|
+
emitSyncFnsData(e = false) {
|
|
2869
|
+
const t = this.serializationCtx.$e;
|
|
2870
|
+
const n = e ? this.emittedSyncFnCount : 0;
|
|
2871
|
+
if (t.length > n) {
|
|
2872
|
+
const r = {
|
|
2399
2873
|
"q:func": "qwik/json"
|
|
2400
2874
|
};
|
|
2401
2875
|
if (this.renderOptions.serverData?.nonce) {
|
|
2402
|
-
|
|
2876
|
+
r["nonce"] = this.renderOptions.serverData.nonce;
|
|
2403
2877
|
}
|
|
2404
|
-
this.
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2878
|
+
this.openScript(r);
|
|
2879
|
+
if (e) {
|
|
2880
|
+
const e = Q_FUNCS_PREFIX.replace("HASH", this.Te).slice(0, -1);
|
|
2881
|
+
this.write(`(${e}||(${e}=[])).push(`);
|
|
2882
|
+
} else {
|
|
2883
|
+
this.write(Q_FUNCS_PREFIX.replace("HASH", this.Te));
|
|
2884
|
+
}
|
|
2885
|
+
if (!e) {
|
|
2886
|
+
this.write($r);
|
|
2887
|
+
}
|
|
2888
|
+
this.writeArray(e ? t.slice(n) : t, mr);
|
|
2889
|
+
if (!e) {
|
|
2890
|
+
this.write(yr);
|
|
2891
|
+
}
|
|
2892
|
+
if (e) {
|
|
2893
|
+
this.write(")");
|
|
2894
|
+
}
|
|
2895
|
+
this.closeScript();
|
|
2896
|
+
this.emittedSyncFnCount = t.length;
|
|
2410
2897
|
}
|
|
2411
2898
|
}
|
|
2412
2899
|
emitPatchDataIfNeeded() {
|
|
@@ -2414,7 +2901,7 @@ var SSRContainer = class extends Ou {
|
|
|
2414
2901
|
for (const [t, n] of this.backpatchMap) {
|
|
2415
2902
|
for (let r = 0; r < n.length; r++) {
|
|
2416
2903
|
const s = n[r];
|
|
2417
|
-
e.push(t, s.attrName,
|
|
2904
|
+
e.push(t, s.attrName, iu(s.value) ? s.value.untrackedValue : s.value);
|
|
2418
2905
|
}
|
|
2419
2906
|
}
|
|
2420
2907
|
this.backpatchMap.clear();
|
|
@@ -2426,27 +2913,73 @@ var SSRContainer = class extends Ou {
|
|
|
2426
2913
|
if (this.renderOptions.serverData?.nonce) {
|
|
2427
2914
|
t["nonce"] = this.renderOptions.serverData.nonce;
|
|
2428
2915
|
}
|
|
2429
|
-
this.
|
|
2430
|
-
|
|
2431
|
-
|
|
2916
|
+
this.writeScript(t, JSON.stringify(e));
|
|
2917
|
+
}
|
|
2918
|
+
}
|
|
2919
|
+
emitBackpatchDataAndExecutorIfNeeded() {
|
|
2920
|
+
if (this.backpatchMap.size === 0) {
|
|
2921
|
+
return;
|
|
2432
2922
|
}
|
|
2923
|
+
this.emitPatchDataIfNeeded();
|
|
2924
|
+
this.emitExecutorIfNeeded();
|
|
2433
2925
|
}
|
|
2434
2926
|
emitExecutorIfNeeded() {
|
|
2435
2927
|
if (!this.isBackpatchExecutorEmitted) {
|
|
2436
2928
|
return;
|
|
2437
2929
|
}
|
|
2930
|
+
this.isBackpatchExecutorEmitted = false;
|
|
2438
2931
|
const e = {
|
|
2439
2932
|
type: "text/javascript"
|
|
2440
2933
|
};
|
|
2441
2934
|
if (this.renderOptions.serverData?.nonce) {
|
|
2442
2935
|
e["nonce"] = this.renderOptions.serverData.nonce;
|
|
2443
2936
|
}
|
|
2444
|
-
this.openElement("script", null, e);
|
|
2445
2937
|
const t = getQwikBackpatchExecutorScript({
|
|
2446
2938
|
debug: isDev8
|
|
2447
2939
|
});
|
|
2448
|
-
this.
|
|
2449
|
-
|
|
2940
|
+
this.writeScript(e, t);
|
|
2941
|
+
}
|
|
2942
|
+
emitOutOfOrderExecutorIfNeeded() {
|
|
2943
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed || this.isOutOfOrderExecutorEmitted) {
|
|
2944
|
+
return;
|
|
2945
|
+
}
|
|
2946
|
+
this.isOutOfOrderExecutorEmitted = true;
|
|
2947
|
+
this.writeScript({
|
|
2948
|
+
type: "text/javascript",
|
|
2949
|
+
nonce: this.renderOptions.serverData?.nonce
|
|
2950
|
+
}, getQwikOutOfOrderExecutorScript({
|
|
2951
|
+
debug: isDev8
|
|
2952
|
+
}));
|
|
2953
|
+
}
|
|
2954
|
+
emitInlineScript(e) {
|
|
2955
|
+
const t = {
|
|
2956
|
+
type: "text/javascript"
|
|
2957
|
+
};
|
|
2958
|
+
if (this.renderOptions.serverData?.nonce) {
|
|
2959
|
+
t["nonce"] = this.renderOptions.serverData.nonce;
|
|
2960
|
+
}
|
|
2961
|
+
this.writeScript(t, e);
|
|
2962
|
+
}
|
|
2963
|
+
emitContainerReadyEventIfNeeded() {
|
|
2964
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
2965
|
+
return;
|
|
2966
|
+
}
|
|
2967
|
+
this.emitInlineScript(`document.qready||(document.qready={});document.qready["${this.Te}"]=1;try{document.dispatchEvent(new CustomEvent("qready",{detail:"${this.Te}"}))}catch(e){}`);
|
|
2968
|
+
}
|
|
2969
|
+
writeScript(e, t) {
|
|
2970
|
+
this.openScript(e);
|
|
2971
|
+
if (t) {
|
|
2972
|
+
this.write(t);
|
|
2973
|
+
}
|
|
2974
|
+
this.closeScript();
|
|
2975
|
+
}
|
|
2976
|
+
openScript(e) {
|
|
2977
|
+
this.write("<script");
|
|
2978
|
+
this.writeAttrs("script", e, true, null, null, true);
|
|
2979
|
+
this.write(GT);
|
|
2980
|
+
}
|
|
2981
|
+
closeScript() {
|
|
2982
|
+
this.write("<\/script>");
|
|
2450
2983
|
}
|
|
2451
2984
|
emitPreloaderPre() {
|
|
2452
2985
|
if (!isDev8) {
|
|
@@ -2454,12 +2987,12 @@ var SSRContainer = class extends Ou {
|
|
|
2454
2987
|
}
|
|
2455
2988
|
}
|
|
2456
2989
|
isStatic() {
|
|
2457
|
-
return this.serializationCtx.
|
|
2990
|
+
return !(__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && this.outOfOrderUsed) && this.serializationCtx.xt.size === 0;
|
|
2458
2991
|
}
|
|
2459
2992
|
emitQwikLoaderAtTopIfNeeded() {
|
|
2460
2993
|
if (this.qlInclude === 0 /* Module */) {
|
|
2461
2994
|
this.qlInclude = 2 /* Done */;
|
|
2462
|
-
const e = this.
|
|
2995
|
+
const e = this.qe + this.resolvedManifest.manifest.qwikLoader;
|
|
2463
2996
|
const t = {
|
|
2464
2997
|
rel: "modulepreload",
|
|
2465
2998
|
href: e
|
|
@@ -2478,8 +3011,7 @@ var SSRContainer = class extends Ou {
|
|
|
2478
3011
|
if (n) {
|
|
2479
3012
|
r["nonce"] = n;
|
|
2480
3013
|
}
|
|
2481
|
-
this.
|
|
2482
|
-
this.closeElement();
|
|
3014
|
+
this.writeScript(r);
|
|
2483
3015
|
}
|
|
2484
3016
|
}
|
|
2485
3017
|
emitQwikLoaderInline() {
|
|
@@ -2495,17 +3027,25 @@ var SSRContainer = class extends Ou {
|
|
|
2495
3027
|
if (this.renderOptions.serverData?.nonce) {
|
|
2496
3028
|
t["nonce"] = this.renderOptions.serverData.nonce;
|
|
2497
3029
|
}
|
|
2498
|
-
this.
|
|
2499
|
-
this.write(e);
|
|
2500
|
-
this.closeElement();
|
|
3030
|
+
this.writeScript(t, e);
|
|
2501
3031
|
}
|
|
2502
3032
|
emitQwikLoaderAtBottomIfNeeded() {
|
|
2503
3033
|
if (!this.isStatic()) {
|
|
2504
3034
|
if (this.qlInclude !== 2 /* Done */) {
|
|
2505
3035
|
this.emitQwikLoaderInline();
|
|
2506
3036
|
}
|
|
2507
|
-
this.
|
|
3037
|
+
this.emitNewQwikEvents();
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
emitNewQwikEvents() {
|
|
3041
|
+
const e = [];
|
|
3042
|
+
for (const t of this.serializationCtx.At) {
|
|
3043
|
+
if (!this.emittedQwikEventNames.has(t)) {
|
|
3044
|
+
this.emittedQwikEventNames.add(t);
|
|
3045
|
+
e.push(JSON.stringify(t));
|
|
3046
|
+
}
|
|
2508
3047
|
}
|
|
3048
|
+
this.emitQwikEvents(e);
|
|
2509
3049
|
}
|
|
2510
3050
|
emitQwikEvents(e) {
|
|
2511
3051
|
if (e.length > 0) {
|
|
@@ -2514,11 +3054,11 @@ var SSRContainer = class extends Ou {
|
|
|
2514
3054
|
if (n) {
|
|
2515
3055
|
t["nonce"] = n;
|
|
2516
3056
|
}
|
|
2517
|
-
this.
|
|
3057
|
+
this.openScript(t);
|
|
2518
3058
|
this.write(`(window._qwikEv||(window._qwikEv=[])).push(`);
|
|
2519
|
-
this.writeArray(e,
|
|
3059
|
+
this.writeArray(e, mr);
|
|
2520
3060
|
this.write(PAREN_CLOSE);
|
|
2521
|
-
this.
|
|
3061
|
+
this.closeScript();
|
|
2522
3062
|
}
|
|
2523
3063
|
}
|
|
2524
3064
|
// Keep in sync with process-vnode-data.unit.ts
|
|
@@ -2577,7 +3117,7 @@ var SSRContainer = class extends Ou {
|
|
|
2577
3117
|
o += " ";
|
|
2578
3118
|
}
|
|
2579
3119
|
i.push(`${o}<${e}> <= is not allowed as a child of ${allowedContent(s)[0]}.`);
|
|
2580
|
-
throw newTagError(i.
|
|
3120
|
+
throw newTagError(i.join("\n"));
|
|
2581
3121
|
}
|
|
2582
3122
|
}
|
|
2583
3123
|
}
|
|
@@ -2587,7 +3127,8 @@ var SSRContainer = class extends Ou {
|
|
|
2587
3127
|
elementName: e,
|
|
2588
3128
|
depthFirstElementIdx: t,
|
|
2589
3129
|
vNodeData: [ 0 /* NONE */ ],
|
|
2590
|
-
currentFile: isDev8 ? n || null : null
|
|
3130
|
+
currentFile: isDev8 ? n || null : null,
|
|
3131
|
+
refBase: null
|
|
2591
3132
|
};
|
|
2592
3133
|
this.currentElementFrame = s;
|
|
2593
3134
|
this.vNodeDatas.push(s.vNodeData);
|
|
@@ -2602,6 +3143,17 @@ var SSRContainer = class extends Ou {
|
|
|
2602
3143
|
this.size += e.length;
|
|
2603
3144
|
this.writer.write(e);
|
|
2604
3145
|
}
|
|
3146
|
+
writeRootRef(e) {
|
|
3147
|
+
this.size += String(e).length;
|
|
3148
|
+
this.writer.writeRootRef(e);
|
|
3149
|
+
}
|
|
3150
|
+
writeRootRefPath(e) {
|
|
3151
|
+
this.size += String(e[0]).length;
|
|
3152
|
+
this.writer.writeRootRefPath(e);
|
|
3153
|
+
for (let t = 1; t < e.length; t++) {
|
|
3154
|
+
this.size += 1 + String(e[t]).length;
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
2605
3157
|
writeArray(e, t) {
|
|
2606
3158
|
for (let n = 0; n < e.length; n++) {
|
|
2607
3159
|
const r = e[n];
|
|
@@ -2611,22 +3163,22 @@ var SSRContainer = class extends Ou {
|
|
|
2611
3163
|
this.write(r);
|
|
2612
3164
|
}
|
|
2613
3165
|
}
|
|
2614
|
-
writeAttrs(e, t,
|
|
2615
|
-
let
|
|
2616
|
-
for (let
|
|
2617
|
-
let u = t[
|
|
2618
|
-
if (isSSRUnsafeAttr(
|
|
3166
|
+
writeAttrs(e, t, r, i, o, a) {
|
|
3167
|
+
let c = void 0;
|
|
3168
|
+
for (let l in t) {
|
|
3169
|
+
let u = t[l];
|
|
3170
|
+
if (isSSRUnsafeAttr(l)) {
|
|
2619
3171
|
if (isDev8) {
|
|
2620
|
-
throw
|
|
3172
|
+
throw qe(32 /* unsafeAttr */ , [ l ]);
|
|
2621
3173
|
}
|
|
2622
3174
|
continue;
|
|
2623
3175
|
}
|
|
2624
|
-
if (
|
|
2625
|
-
u = _setEvent(this.serializationCtx,
|
|
2626
|
-
} else if (
|
|
3176
|
+
if (Is(l)) {
|
|
3177
|
+
u = _setEvent(this.serializationCtx, l, u, a);
|
|
3178
|
+
} else if (l === "ref") {
|
|
2627
3179
|
const e = this.getOrCreateLastNode();
|
|
2628
|
-
if (
|
|
2629
|
-
u.
|
|
3180
|
+
if (iu(u)) {
|
|
3181
|
+
u.Zt = new DomRef(e);
|
|
2630
3182
|
continue;
|
|
2631
3183
|
} else if (typeof u === "function") {
|
|
2632
3184
|
u(new DomRef(e));
|
|
@@ -2634,63 +3186,83 @@ var SSRContainer = class extends Ou {
|
|
|
2634
3186
|
} else if (u == null) {
|
|
2635
3187
|
continue;
|
|
2636
3188
|
} else {
|
|
2637
|
-
throw
|
|
3189
|
+
throw qe(15 /* invalidRefValue */ , [ o ]);
|
|
3190
|
+
}
|
|
3191
|
+
} else if (l === ys || l === ms) {
|
|
3192
|
+
const e = this.addRoot(u);
|
|
3193
|
+
if (e === void 0) {
|
|
3194
|
+
continue;
|
|
2638
3195
|
}
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
} else if (Ll(u)) {
|
|
3196
|
+
u = typeof e === "number" ? [ e ] : String(e);
|
|
3197
|
+
} else if (iu(u)) {
|
|
2642
3198
|
const e = this.getOrCreateLastNode();
|
|
2643
|
-
const t = new
|
|
2644
|
-
|
|
2645
|
-
et:
|
|
3199
|
+
const t = new Ri({
|
|
3200
|
+
O: i,
|
|
3201
|
+
et: r
|
|
2646
3202
|
});
|
|
2647
|
-
const
|
|
2648
|
-
u = n(() => this.trackSignalValue(
|
|
3203
|
+
const s = u;
|
|
3204
|
+
u = n(() => this.trackSignalValue(s, e, l, t));
|
|
2649
3205
|
}
|
|
2650
|
-
if (
|
|
3206
|
+
if (Ps(u)) {
|
|
2651
3207
|
const e = this.getOrCreateLastNode();
|
|
2652
3208
|
this.addPromiseAttribute(u);
|
|
2653
3209
|
u.then(t => {
|
|
2654
|
-
this.addBackpatchEntry(e.id,
|
|
3210
|
+
this.addBackpatchEntry(e.id, l, s(l, t, i));
|
|
2655
3211
|
});
|
|
2656
3212
|
continue;
|
|
2657
3213
|
}
|
|
2658
|
-
if (
|
|
3214
|
+
if (l === Ss) {
|
|
2659
3215
|
if (u) {
|
|
2660
|
-
|
|
2661
|
-
|
|
3216
|
+
c = String(u);
|
|
3217
|
+
l = es;
|
|
2662
3218
|
u = "html" /* HTML */;
|
|
2663
3219
|
}
|
|
2664
3220
|
if (e === "style") {
|
|
2665
3221
|
continue;
|
|
2666
3222
|
}
|
|
2667
|
-
} else if (isPreventDefault(
|
|
2668
|
-
addPreventDefaultEventToSerializationContext(this.serializationCtx,
|
|
3223
|
+
} else if (isPreventDefault(l)) {
|
|
3224
|
+
addPreventDefaultEventToSerializationContext(this.serializationCtx, l);
|
|
2669
3225
|
}
|
|
2670
|
-
if (e === "textarea" &&
|
|
3226
|
+
if (e === "textarea" && l === "value") {
|
|
2671
3227
|
if (u && typeof u !== "string") {
|
|
2672
3228
|
if (isDev8) {
|
|
2673
|
-
throw
|
|
3229
|
+
throw qe(23 /* wrongTextareaValue */ , [ o, u ]);
|
|
2674
3230
|
}
|
|
2675
3231
|
continue;
|
|
2676
3232
|
}
|
|
2677
|
-
|
|
2678
|
-
|
|
3233
|
+
c = escapeHTML(u || "");
|
|
3234
|
+
l = es;
|
|
2679
3235
|
u = "text" /* TEXT */;
|
|
2680
3236
|
}
|
|
2681
|
-
const h =
|
|
3237
|
+
const h = s(l, u, i);
|
|
2682
3238
|
if (h != null && h !== false) {
|
|
2683
|
-
this.write(
|
|
2684
|
-
this.write(
|
|
3239
|
+
this.write(va);
|
|
3240
|
+
this.write(l);
|
|
2685
3241
|
if (h !== true) {
|
|
2686
3242
|
this.write(ATTR_EQUALS_QUOTE);
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
3243
|
+
if (Array.isArray(h)) {
|
|
3244
|
+
this.writeEscapedChunks(h);
|
|
3245
|
+
} else {
|
|
3246
|
+
const e = escapeHTML(String(h));
|
|
3247
|
+
this.write(e);
|
|
3248
|
+
}
|
|
3249
|
+
this.write(pr);
|
|
2690
3250
|
}
|
|
2691
3251
|
}
|
|
2692
3252
|
}
|
|
2693
|
-
return
|
|
3253
|
+
return c;
|
|
3254
|
+
}
|
|
3255
|
+
writeEscapedChunks(e) {
|
|
3256
|
+
for (let t = 0; t < e.length; t++) {
|
|
3257
|
+
const n = e[t];
|
|
3258
|
+
if (typeof n === "string") {
|
|
3259
|
+
this.write(escapeHTML(n));
|
|
3260
|
+
} else if (typeof n === "number") {
|
|
3261
|
+
this.writeRootRef(n);
|
|
3262
|
+
} else {
|
|
3263
|
+
this.writeRootRefPath(n.path);
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
2694
3266
|
}
|
|
2695
3267
|
addPromiseAttribute(e) {
|
|
2696
3268
|
this.promiseAttributes ||= [];
|
|
@@ -2704,19 +3276,261 @@ var SSRContainer = class extends Ou {
|
|
|
2704
3276
|
}
|
|
2705
3277
|
};
|
|
2706
3278
|
|
|
3279
|
+
var SSRSegmentContainer = class extends SSRContainer {
|
|
3280
|
+
constructor(e, t) {
|
|
3281
|
+
super(e);
|
|
3282
|
+
this.Re = t;
|
|
3283
|
+
}
|
|
3284
|
+
Qe=0 /* Rendering */;
|
|
3285
|
+
Ke=null;
|
|
3286
|
+
subscriptionPatchRecords=[];
|
|
3287
|
+
pendingVNodeDataPatches=null;
|
|
3288
|
+
nextOutOfOrderId() {
|
|
3289
|
+
return this.Re.nextOutOfOrderId();
|
|
3290
|
+
}
|
|
3291
|
+
S(e) {
|
|
3292
|
+
return this.Re.S(e);
|
|
3293
|
+
}
|
|
3294
|
+
queueOutOfOrderSegment(e) {
|
|
3295
|
+
this.Re.queueOutOfOrderSegment(e);
|
|
3296
|
+
}
|
|
3297
|
+
emitOutOfOrderSegmentScripts(e) {
|
|
3298
|
+
this.Re.emitOutOfOrderSegmentScripts(e);
|
|
3299
|
+
}
|
|
3300
|
+
emitOutOfOrderExecutorIfNeeded() {
|
|
3301
|
+
this.Re.emitOutOfOrderExecutorIfNeeded();
|
|
3302
|
+
}
|
|
3303
|
+
nn(e, t, n, r) {
|
|
3304
|
+
recordExternalRootEffect(this.Re.serializationCtx, this.serializationCtx, this.Re.dt, this.subscriptionPatchRecords, e, t, n, r);
|
|
3305
|
+
}
|
|
3306
|
+
async P(e, t) {
|
|
3307
|
+
const n = this.Re;
|
|
3308
|
+
const r = n.A();
|
|
3309
|
+
const s = this.serializationCtx;
|
|
3310
|
+
try {
|
|
3311
|
+
const i = this.Ge(n, s);
|
|
3312
|
+
this.Je(n, s);
|
|
3313
|
+
this.Ye(n, s);
|
|
3314
|
+
const o = this.Ze(n, r, s);
|
|
3315
|
+
if (r && (i.newRootLocalIds.length > 0 || o !== void 0)) {
|
|
3316
|
+
s.ue = n.serializationCtx.zn;
|
|
3317
|
+
await this.emitStatePatchData(e, i.newRootStart, i.newRootLocalIds, o);
|
|
3318
|
+
n.serializationCtx.ae = n.serializationCtx.Yn.length + (n.serializationCtx.fe ? 1 : 0);
|
|
3319
|
+
n.serializationCtx.zn += s.zn;
|
|
3320
|
+
}
|
|
3321
|
+
this.emitPendingVNodeDataPatches();
|
|
3322
|
+
if (r) {
|
|
3323
|
+
this.t = true;
|
|
3324
|
+
this.emitVNodeData(e);
|
|
3325
|
+
const t = this.serializationCtx;
|
|
3326
|
+
this.serializationCtx = n.serializationCtx;
|
|
3327
|
+
this.emittedSyncFnCount = n.emittedSyncFnCount;
|
|
3328
|
+
this.emitSyncFnsData(true);
|
|
3329
|
+
n.emittedSyncFnCount = this.emittedSyncFnCount;
|
|
3330
|
+
this.serializationCtx = t;
|
|
3331
|
+
this.emitNewQwikEvents();
|
|
3332
|
+
}
|
|
3333
|
+
this.emitPatchDataIfNeeded();
|
|
3334
|
+
this.drainCleanupQueue();
|
|
3335
|
+
const a = i.rootIdMap;
|
|
3336
|
+
if (r) {
|
|
3337
|
+
this.Qe = 2 /* Done */;
|
|
3338
|
+
} else {
|
|
3339
|
+
this.Ke = a;
|
|
3340
|
+
this.Qe = 1 /* EarlyFinalized */;
|
|
3341
|
+
}
|
|
3342
|
+
return {
|
|
3343
|
+
html: renderSSRChunks(t.htmlChunks, a),
|
|
3344
|
+
scripts: t.writer.toString(a)
|
|
3345
|
+
};
|
|
3346
|
+
} finally {
|
|
3347
|
+
if (this.Qe !== 1 /* EarlyFinalized */) {
|
|
3348
|
+
s.me = void 0;
|
|
3349
|
+
n.removeOutOfOrderSegment(this);
|
|
3350
|
+
}
|
|
3351
|
+
n.serializationCtx.Bn(n.writer);
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
He() {
|
|
3355
|
+
try {
|
|
3356
|
+
this.emitVNodeData(this.vnodeSegment);
|
|
3357
|
+
this.emitPendingVNodeDataPatches();
|
|
3358
|
+
this.Re.emitOutOfOrderSegmentScripts(this.writer.toString(this.Ke));
|
|
3359
|
+
this.Qe = 2 /* Done */;
|
|
3360
|
+
this.Re.removeOutOfOrderSegment(this);
|
|
3361
|
+
} finally {
|
|
3362
|
+
this.serializationCtx.me = void 0;
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
markVNodeDataForSerialization(e, t = 16 /* SERIALIZE */) {
|
|
3366
|
+
const n = e.vnodeData[0];
|
|
3367
|
+
const r = n | t;
|
|
3368
|
+
if (r !== n) {
|
|
3369
|
+
e.vnodeData[0] = r;
|
|
3370
|
+
this.queueLateVNodeDataPatch(e, r & ~n);
|
|
3371
|
+
}
|
|
3372
|
+
}
|
|
3373
|
+
queueLateVNodeDataPatch(e, t) {
|
|
3374
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !(t & (16 /* SERIALIZE */ | 8 /* REFERENCE */))) {
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3377
|
+
const n = this.getVNodeDataOwnerFromNodeId(e.id);
|
|
3378
|
+
if (!this.F().isVNodeDataOwnerEmitted(n.owner)) {
|
|
3379
|
+
return;
|
|
3380
|
+
}
|
|
3381
|
+
let r = (this.pendingVNodeDataPatches ||= /* @__PURE__ */ new Map).get(n.owner);
|
|
3382
|
+
if (!r) {
|
|
3383
|
+
this.pendingVNodeDataPatches.set(n.owner, r = /* @__PURE__ */ new Map);
|
|
3384
|
+
}
|
|
3385
|
+
r.set(n.localIndex, e.vnodeData);
|
|
3386
|
+
}
|
|
3387
|
+
emitPendingVNodeDataPatches() {
|
|
3388
|
+
const e = this.pendingVNodeDataPatches;
|
|
3389
|
+
this.pendingVNodeDataPatches = null;
|
|
3390
|
+
if (!e) {
|
|
3391
|
+
return;
|
|
3392
|
+
}
|
|
3393
|
+
for (const [t, n] of e) {
|
|
3394
|
+
if (n.size === 0) {
|
|
3395
|
+
continue;
|
|
3396
|
+
}
|
|
3397
|
+
const e = Array.from(n).sort((e, t) => e[0] - t[0]);
|
|
3398
|
+
this.emitVNodeDataScript(t, e, true);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
Ge(e, t) {
|
|
3402
|
+
const n = this.commitSegmentRoots(e, t);
|
|
3403
|
+
t.me = (t, r, s) => {
|
|
3404
|
+
this.commitSegmentRoot(e, t, r, s, n);
|
|
3405
|
+
};
|
|
3406
|
+
return n;
|
|
3407
|
+
}
|
|
3408
|
+
Ze(e, t, n) {
|
|
3409
|
+
let r = void 0;
|
|
3410
|
+
const s = t ? this.collectSubscriptionPatches(e, e.rootContainerSerializedRootCount) : void 0;
|
|
3411
|
+
if (s) {
|
|
3412
|
+
r = n.St(s);
|
|
3413
|
+
}
|
|
3414
|
+
return r;
|
|
3415
|
+
}
|
|
3416
|
+
commitSegmentRoots(e, t) {
|
|
3417
|
+
const n = [];
|
|
3418
|
+
const r = e.A() ? e.serializationCtx.ae : e.serializationCtx.Yn.length;
|
|
3419
|
+
const s = [];
|
|
3420
|
+
const i = {
|
|
3421
|
+
rootIdMap: n,
|
|
3422
|
+
newRootStart: r,
|
|
3423
|
+
newRootLocalIds: s
|
|
3424
|
+
};
|
|
3425
|
+
this.promoteSharedSegmentRoots(e, t, i);
|
|
3426
|
+
const o = t.Yn;
|
|
3427
|
+
const a = t.ye;
|
|
3428
|
+
for (let t = 0; t < o.length; t++) {
|
|
3429
|
+
const n = a[t];
|
|
3430
|
+
this.commitSegmentRoot(e, t, o[t], n, i);
|
|
3431
|
+
}
|
|
3432
|
+
return i;
|
|
3433
|
+
}
|
|
3434
|
+
promoteSharedSegmentRoots(e, t, n) {
|
|
3435
|
+
const r = t.Yn;
|
|
3436
|
+
const s = t.ye;
|
|
3437
|
+
for (let t = 0; t < s.length; t++) {
|
|
3438
|
+
const i = s[t];
|
|
3439
|
+
if (this.isRootOrUsedByOtherLiveSegment(e, i)) {
|
|
3440
|
+
this.commitSegmentRoot(e, t, r[t], i, n);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
}
|
|
3444
|
+
isRootOrUsedByOtherLiveSegment(e, t) {
|
|
3445
|
+
if (e.serializationCtx.ge(t) !== void 0) {
|
|
3446
|
+
return true;
|
|
3447
|
+
}
|
|
3448
|
+
const n = e.outOfOrderSegments;
|
|
3449
|
+
for (let e = 0; e < n.length; e++) {
|
|
3450
|
+
const r = n[e];
|
|
3451
|
+
if (r === this) {
|
|
3452
|
+
continue;
|
|
3453
|
+
}
|
|
3454
|
+
const s = r.serializationCtx.ye;
|
|
3455
|
+
for (let e = 0; e < s.length; e++) {
|
|
3456
|
+
if (s[e] === t) {
|
|
3457
|
+
return true;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
return false;
|
|
3462
|
+
}
|
|
3463
|
+
commitSegmentRoot(e, t, n, r, s) {
|
|
3464
|
+
if (s.rootIdMap[t] !== void 0) {
|
|
3465
|
+
return;
|
|
3466
|
+
}
|
|
3467
|
+
let i = e.serializationCtx.ge(r);
|
|
3468
|
+
if (i === void 0) {
|
|
3469
|
+
i = e.serializationCtx._e(n, r);
|
|
3470
|
+
s.newRootLocalIds.push(t);
|
|
3471
|
+
this.seedCommittedRootForLiveSegments(e, r);
|
|
3472
|
+
}
|
|
3473
|
+
const o = e.serializationCtx;
|
|
3474
|
+
s.rootIdMap[t] = e.A() && i >= o.ce ? i + (o.fe ? 1 : 0) : i;
|
|
3475
|
+
}
|
|
3476
|
+
seedCommittedRootForLiveSegments(e, t) {
|
|
3477
|
+
const n = e.outOfOrderSegments;
|
|
3478
|
+
for (let e = 0; e < n.length; e++) {
|
|
3479
|
+
const r = n[e];
|
|
3480
|
+
if (r !== this && r.Qe === 0 /* Rendering */) {
|
|
3481
|
+
r.serializationCtx.St(t);
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
Je(e, t) {
|
|
3486
|
+
for (const n of t.At) {
|
|
3487
|
+
e.serializationCtx.At.add(n);
|
|
3488
|
+
}
|
|
3489
|
+
for (const n of t.xt) {
|
|
3490
|
+
e.serializationCtx.xt.add(n);
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
Ye(e, t) {
|
|
3494
|
+
e.serializationCtx.$e.push(...t.$e);
|
|
3495
|
+
}
|
|
3496
|
+
collectSubscriptionPatches(e, t) {
|
|
3497
|
+
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming) {
|
|
3498
|
+
return;
|
|
3499
|
+
}
|
|
3500
|
+
return collectSubscriptionPatches(e.serializationCtx, this.subscriptionPatchRecords, t);
|
|
3501
|
+
}
|
|
3502
|
+
emitStatePatchData(e, t, n, r) {
|
|
3503
|
+
const s = this.statePatchScriptAttrs(e);
|
|
3504
|
+
this.openScript(s);
|
|
3505
|
+
this.serializationCtx.Bn(this.writer);
|
|
3506
|
+
this.serializationCtx.te = this.markVNodeDataForSerialization.bind(this);
|
|
3507
|
+
return qs(this.serializationCtx.be(t, n, r, 0), () => {
|
|
3508
|
+
this.closeScript();
|
|
3509
|
+
});
|
|
3510
|
+
}
|
|
3511
|
+
statePatchScriptAttrs(e) {
|
|
3512
|
+
const t = this.stateScriptAttrs();
|
|
3513
|
+
t[QStatePatchAttr] = true;
|
|
3514
|
+
if (e) {
|
|
3515
|
+
t[kh] = e;
|
|
3516
|
+
}
|
|
3517
|
+
return t;
|
|
3518
|
+
}
|
|
3519
|
+
};
|
|
3520
|
+
|
|
2707
3521
|
var isQwikStyleElement = (e, t) => {
|
|
2708
3522
|
if (e === "style" && t != null) {
|
|
2709
|
-
return Object.prototype.hasOwnProperty.call(t,
|
|
3523
|
+
return Object.prototype.hasOwnProperty.call(t, Ue) || Object.prototype.hasOwnProperty.call(t, He);
|
|
2710
3524
|
}
|
|
2711
3525
|
return false;
|
|
2712
3526
|
};
|
|
2713
3527
|
|
|
2714
3528
|
function newTagError(e) {
|
|
2715
|
-
return
|
|
3529
|
+
return qe(12 /* tagError */ , [ e ]);
|
|
2716
3530
|
}
|
|
2717
3531
|
|
|
2718
3532
|
function hasDestroy(e) {
|
|
2719
|
-
return e && typeof e === "object" && typeof e.
|
|
3533
|
+
return e && typeof e === "object" && typeof e.Tn === "function";
|
|
2720
3534
|
}
|
|
2721
3535
|
|
|
2722
3536
|
function isSSRUnsafeAttr(e) {
|
|
@@ -2736,7 +3550,7 @@ function randomStr() {
|
|
|
2736
3550
|
function addPreventDefaultEventToSerializationContext(e, t) {
|
|
2737
3551
|
const n = "e" + t.substring(14);
|
|
2738
3552
|
if (n) {
|
|
2739
|
-
e.
|
|
3553
|
+
e.At.add(n);
|
|
2740
3554
|
}
|
|
2741
3555
|
}
|
|
2742
3556
|
|
|
@@ -2770,37 +3584,27 @@ var StreamHandler = class {
|
|
|
2770
3584
|
let t;
|
|
2771
3585
|
switch (this.inOrderStreaming.strategy) {
|
|
2772
3586
|
case "disabled":
|
|
2773
|
-
t = {
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
return;
|
|
2777
|
-
}
|
|
2778
|
-
e.enqueue(t);
|
|
2779
|
-
},
|
|
2780
|
-
waitForDrain() {
|
|
2781
|
-
return e.waitForPendingFlush();
|
|
3587
|
+
t = dr(t => {
|
|
3588
|
+
if (t === void 0 || t === null) {
|
|
3589
|
+
return;
|
|
2782
3590
|
}
|
|
2783
|
-
|
|
3591
|
+
e.enqueue(t);
|
|
3592
|
+
});
|
|
2784
3593
|
break;
|
|
2785
3594
|
|
|
2786
3595
|
case "direct":
|
|
2787
3596
|
{
|
|
2788
3597
|
const n = this.nativeStream;
|
|
2789
|
-
t = {
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
return e.trackPendingFlush(r);
|
|
2797
|
-
}
|
|
2798
|
-
return e.trackPendingFlush(n.write(t));
|
|
2799
|
-
},
|
|
2800
|
-
waitForDrain() {
|
|
2801
|
-
return e.waitForPendingFlush();
|
|
3598
|
+
t = dr(t => {
|
|
3599
|
+
if (t === void 0 || t === null) {
|
|
3600
|
+
return;
|
|
3601
|
+
}
|
|
3602
|
+
if (e.pendingFlush) {
|
|
3603
|
+
const r = e.pendingFlush.then(() => n.write(t));
|
|
3604
|
+
return e.trackPendingFlush(r);
|
|
2802
3605
|
}
|
|
2803
|
-
|
|
3606
|
+
return e.trackPendingFlush(n.write(t));
|
|
3607
|
+
});
|
|
2804
3608
|
break;
|
|
2805
3609
|
}
|
|
2806
3610
|
|
|
@@ -2809,23 +3613,18 @@ var StreamHandler = class {
|
|
|
2809
3613
|
{
|
|
2810
3614
|
const n = this.inOrderStreaming.maximumChunk ?? 0;
|
|
2811
3615
|
const r = this.inOrderStreaming.maximumInitialChunk ?? 0;
|
|
2812
|
-
t = {
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
return e.flush();
|
|
2822
|
-
}
|
|
3616
|
+
t = dr(t => {
|
|
3617
|
+
if (t === void 0 || t === null) {
|
|
3618
|
+
return;
|
|
3619
|
+
}
|
|
3620
|
+
e.enqueue(t);
|
|
3621
|
+
if (e.streamBlockDepth === 0) {
|
|
3622
|
+
const t = e.networkFlushes === 0 ? r : n;
|
|
3623
|
+
if (e.bufferSize >= t) {
|
|
3624
|
+
return e.flush();
|
|
2823
3625
|
}
|
|
2824
|
-
},
|
|
2825
|
-
waitForDrain() {
|
|
2826
|
-
return e.waitForPendingFlush();
|
|
2827
3626
|
}
|
|
2828
|
-
};
|
|
3627
|
+
});
|
|
2829
3628
|
break;
|
|
2830
3629
|
}
|
|
2831
3630
|
}
|
|
@@ -2842,7 +3641,7 @@ var StreamHandler = class {
|
|
|
2842
3641
|
}
|
|
2843
3642
|
}
|
|
2844
3643
|
trackPendingFlush(e) {
|
|
2845
|
-
if (!
|
|
3644
|
+
if (!Ps(e)) {
|
|
2846
3645
|
return;
|
|
2847
3646
|
}
|
|
2848
3647
|
const t = Promise.resolve(e).finally(() => {
|
|
@@ -2905,26 +3704,30 @@ var StreamHandler = class {
|
|
|
2905
3704
|
|
|
2906
3705
|
// packages/qwik/src/server/ssr-render.ts
|
|
2907
3706
|
var renderToString = async (e, t = {}) => {
|
|
2908
|
-
const n =
|
|
2909
|
-
const r = {
|
|
2910
|
-
write(e) {
|
|
2911
|
-
n.push(e);
|
|
2912
|
-
}
|
|
2913
|
-
};
|
|
2914
|
-
const s = await renderToStream(e, {
|
|
3707
|
+
const n = new StringSSRWriter;
|
|
3708
|
+
const r = await renderToStream(e, {
|
|
2915
3709
|
...t,
|
|
2916
|
-
stream:
|
|
3710
|
+
stream: n
|
|
2917
3711
|
});
|
|
2918
3712
|
return {
|
|
2919
|
-
isStatic:
|
|
2920
|
-
timing:
|
|
2921
|
-
manifest:
|
|
2922
|
-
snapshotResult:
|
|
2923
|
-
html: n.
|
|
3713
|
+
isStatic: r.isStatic,
|
|
3714
|
+
timing: r.timing,
|
|
3715
|
+
manifest: r.manifest,
|
|
3716
|
+
snapshotResult: r.snapshotResult,
|
|
3717
|
+
html: n.toString()
|
|
2924
3718
|
};
|
|
2925
3719
|
};
|
|
2926
3720
|
|
|
2927
3721
|
var renderToStream = async (e, t) => {
|
|
3722
|
+
if (__EXPERIMENTAL__.suspense && t.streaming?.outOfOrder === void 0) {
|
|
3723
|
+
t = {
|
|
3724
|
+
...t,
|
|
3725
|
+
streaming: {
|
|
3726
|
+
...t.streaming,
|
|
3727
|
+
outOfOrder: true
|
|
3728
|
+
}
|
|
3729
|
+
};
|
|
3730
|
+
}
|
|
2928
3731
|
const n = {
|
|
2929
3732
|
firstFlush: 0,
|
|
2930
3733
|
render: 0,
|
|
@@ -2935,7 +3738,7 @@ var renderToStream = async (e, t) => {
|
|
|
2935
3738
|
const i = resolveManifest(t.manifest);
|
|
2936
3739
|
const o = typeof t.locale === "function" ? t.locale(t) : t.serverData?.locale || t.locale || t.containerAttributes?.locale || "";
|
|
2937
3740
|
const a = new StreamHandler(t, n);
|
|
2938
|
-
const
|
|
3741
|
+
const c = ssrCreateContainer({
|
|
2939
3742
|
tagName: r,
|
|
2940
3743
|
locale: o,
|
|
2941
3744
|
writer: a.stream,
|
|
@@ -2946,21 +3749,21 @@ var renderToStream = async (e, t) => {
|
|
|
2946
3749
|
renderOptions: t
|
|
2947
3750
|
});
|
|
2948
3751
|
await setServerPlatform(t, i);
|
|
2949
|
-
await
|
|
2950
|
-
await
|
|
3752
|
+
await c.render(e);
|
|
3753
|
+
await c.l;
|
|
2951
3754
|
await a.flush();
|
|
2952
|
-
const
|
|
3755
|
+
const l = {
|
|
2953
3756
|
flushes: a.networkFlushes,
|
|
2954
3757
|
manifest: i?.manifest,
|
|
2955
|
-
size:
|
|
3758
|
+
size: c.size,
|
|
2956
3759
|
isStatic: false,
|
|
2957
3760
|
timing: n
|
|
2958
3761
|
};
|
|
2959
|
-
return
|
|
3762
|
+
return l;
|
|
2960
3763
|
};
|
|
2961
3764
|
|
|
2962
3765
|
function resolveManifest(e) {
|
|
2963
|
-
const t =
|
|
3766
|
+
const t = Hf();
|
|
2964
3767
|
const n = e ? {
|
|
2965
3768
|
...t,
|
|
2966
3769
|
...e
|
|
@@ -2972,7 +3775,7 @@ function resolveManifest(e) {
|
|
|
2972
3775
|
const e = {};
|
|
2973
3776
|
for (const t in n.mapping) {
|
|
2974
3777
|
const r = n.mapping[t];
|
|
2975
|
-
e[
|
|
3778
|
+
e[Sh(t)] = [ t, r ];
|
|
2976
3779
|
}
|
|
2977
3780
|
return {
|
|
2978
3781
|
mapper: e,
|
|
@@ -2987,7 +3790,7 @@ var Q_FUNCS_PREFIX = 'document["qFuncs_HASH"]=';
|
|
|
2987
3790
|
|
|
2988
3791
|
// packages/qwik/src/server/index.ts
|
|
2989
3792
|
async function setServerPlatform2(e) {
|
|
2990
|
-
const t =
|
|
3793
|
+
const t = Vs({
|
|
2991
3794
|
manifest: e
|
|
2992
3795
|
}, resolveManifest(e));
|
|
2993
3796
|
setPlatform2(t);
|