@qwik.dev/core 2.0.0-beta.36 → 2.0.0-beta.37
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/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +91 -41
- package/dist/core.min.mjs +8 -8
- package/dist/core.mjs +60 -15
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +1755 -1728
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +6 -0
- package/dist/optimizer.mjs +1537 -1449
- package/dist/qwikloader.debug.js +23 -21
- package/dist/qwikloader.js +1 -1
- package/dist/server.mjs +16 -21
- package/dist/server.prod.mjs +139 -141
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.mjs +64 -27
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/package.json +3 -3
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.37-dev+82dc74d
|
|
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 Hs } from "@qwik.dev/core";
|
|
13
13
|
|
|
14
14
|
import { isDev as isDev6 } from "@qwik.dev/core/build";
|
|
15
15
|
|
|
@@ -504,7 +504,7 @@ var QSlotParent = "q:sparent";
|
|
|
504
504
|
|
|
505
505
|
var QStatePatchAttr = "q:patch";
|
|
506
506
|
|
|
507
|
-
var
|
|
507
|
+
var Ph = "q:r";
|
|
508
508
|
|
|
509
509
|
var Ue = "q:style";
|
|
510
510
|
|
|
@@ -520,6 +520,8 @@ var Je = "q:ctx";
|
|
|
520
520
|
|
|
521
521
|
var Qe = "q:brefs";
|
|
522
522
|
|
|
523
|
+
var QwikEvContainerReady = 0;
|
|
524
|
+
|
|
523
525
|
var QRenderAttr = "q:render";
|
|
524
526
|
|
|
525
527
|
var QRuntimeAttr = "q:runtime";
|
|
@@ -597,11 +599,11 @@ var checkError = e => {
|
|
|
597
599
|
}
|
|
598
600
|
};
|
|
599
601
|
|
|
600
|
-
var
|
|
602
|
+
var As = e => {
|
|
601
603
|
throw e;
|
|
602
604
|
};
|
|
603
605
|
|
|
604
|
-
function n(e, t =
|
|
606
|
+
function n(e, t = As) {
|
|
605
607
|
let n = false;
|
|
606
608
|
let r;
|
|
607
609
|
try {
|
|
@@ -653,23 +655,23 @@ function convertStyleIdsToString(e) {
|
|
|
653
655
|
}
|
|
654
656
|
|
|
655
657
|
// packages/qwik/src/core/shared/utils/event-names.ts
|
|
656
|
-
var
|
|
658
|
+
var Ns = e => e.charCodeAt(0) === 113 && e.charCodeAt(1) === 45 && (e.charCodeAt(3) === 58 || e.charCodeAt(3) === 112 && e.charCodeAt(4) === 58);
|
|
657
659
|
|
|
658
660
|
function isPreventDefault(e) {
|
|
659
661
|
return e.startsWith("preventdefault:");
|
|
660
662
|
}
|
|
661
663
|
|
|
662
664
|
// packages/qwik/src/core/shared/utils/unitless_number.ts
|
|
663
|
-
var
|
|
665
|
+
var Ls = /* @__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",
|
|
664
666
|
// Known Prefixed Properties
|
|
665
667
|
"MozBoxFlex",
|
|
666
668
|
// TODO: Remove these since they shouldn't be used in modern code
|
|
667
669
|
"msFlex", "msFlexPositive", "WebkitAnimationIterationCount", "WebkitBoxFlex", "WebkitBoxOrdinalGroup", "WebkitColumnCount", "WebkitColumns", "WebkitFlex", "WebkitFlexGrow", "WebkitFlexShrink", "WebkitLineClamp" ]);
|
|
668
670
|
|
|
669
|
-
var isUnitlessNumber = e =>
|
|
671
|
+
var isUnitlessNumber = e => Ls.has(e);
|
|
670
672
|
|
|
671
673
|
// packages/qwik/src/core/shared/utils/styles.ts
|
|
672
|
-
var
|
|
674
|
+
var Xs = e => {
|
|
673
675
|
if (!e) {
|
|
674
676
|
return "";
|
|
675
677
|
}
|
|
@@ -680,7 +682,7 @@ var Fs = e => {
|
|
|
680
682
|
if (Re(e)) {
|
|
681
683
|
for (let n = 0; n < e.length; n++) {
|
|
682
684
|
const r = e[n];
|
|
683
|
-
const s =
|
|
685
|
+
const s = Xs(r);
|
|
684
686
|
if (s) {
|
|
685
687
|
t.push(s);
|
|
686
688
|
}
|
|
@@ -695,7 +697,7 @@ var Fs = e => {
|
|
|
695
697
|
return t.join(" ");
|
|
696
698
|
};
|
|
697
699
|
|
|
698
|
-
var
|
|
700
|
+
var Ds = e => e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
699
701
|
|
|
700
702
|
var stringifyStyle = e => {
|
|
701
703
|
if (e == null) {
|
|
@@ -713,7 +715,7 @@ var stringifyStyle = e => {
|
|
|
713
715
|
if (n.startsWith("--")) {
|
|
714
716
|
t.push(n + ":" + r);
|
|
715
717
|
} else {
|
|
716
|
-
t.push(
|
|
718
|
+
t.push(Ds(n) + ":" + Ws(n, r));
|
|
717
719
|
}
|
|
718
720
|
}
|
|
719
721
|
}
|
|
@@ -728,7 +730,7 @@ var serializeBooleanOrNumberAttribute = e => e != null ? String(e) : null;
|
|
|
728
730
|
|
|
729
731
|
function s(e, t, n) {
|
|
730
732
|
if (isClassAttr(e)) {
|
|
731
|
-
const e =
|
|
733
|
+
const e = Xs(t);
|
|
732
734
|
t = n ? n + (e.length ? " " + e : e) : e;
|
|
733
735
|
} else if (e === "style") {
|
|
734
736
|
t = stringifyStyle(t);
|
|
@@ -746,7 +748,7 @@ function isEnumeratedBooleanAttribute(e) {
|
|
|
746
748
|
return isAriaAttribute(e) || [ "spellcheck", "draggable", "contenteditable" ].includes(e);
|
|
747
749
|
}
|
|
748
750
|
|
|
749
|
-
var
|
|
751
|
+
var Ws = (e, t) => {
|
|
750
752
|
if (typeof t === "number" && t !== 0 && !isUnitlessNumber(e)) {
|
|
751
753
|
return t + "px";
|
|
752
754
|
}
|
|
@@ -796,7 +798,7 @@ var initPreloader = e => {
|
|
|
796
798
|
};
|
|
797
799
|
|
|
798
800
|
// packages/qwik/src/core/shared/utils/objects.ts
|
|
799
|
-
var
|
|
801
|
+
var dr = e => {
|
|
800
802
|
for (const t in e) {
|
|
801
803
|
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
802
804
|
return false;
|
|
@@ -818,7 +820,7 @@ var writeStringRootRef = (e, t) => e.write(String(t));
|
|
|
818
820
|
|
|
819
821
|
var writeStringRootRefPath = (e, t) => e.write(stringifyRootRefPath(t));
|
|
820
822
|
|
|
821
|
-
var
|
|
823
|
+
var pr = e => ({
|
|
822
824
|
write: e,
|
|
823
825
|
writeRootRef(e) {
|
|
824
826
|
return writeStringRootRef(this, e);
|
|
@@ -835,21 +837,21 @@ var GT = ">";
|
|
|
835
837
|
|
|
836
838
|
var CLOSE_TAG = "</";
|
|
837
839
|
|
|
838
|
-
var
|
|
840
|
+
var ga = " ";
|
|
839
841
|
|
|
840
842
|
var ATTR_EQUALS_QUOTE = '="';
|
|
841
843
|
|
|
842
|
-
var
|
|
844
|
+
var $r = '"';
|
|
843
845
|
|
|
844
846
|
var EMPTY_ATTR = '=""';
|
|
845
847
|
|
|
846
|
-
var
|
|
848
|
+
var yr = "[";
|
|
847
849
|
|
|
848
|
-
var
|
|
850
|
+
var mr = "]";
|
|
849
851
|
|
|
850
852
|
var PAREN_CLOSE = ")";
|
|
851
853
|
|
|
852
|
-
var
|
|
854
|
+
var wr = ",";
|
|
853
855
|
|
|
854
856
|
// packages/qwik/src/server/platform.ts
|
|
855
857
|
var getDevSegmentPath = (e, t, n, r) => {
|
|
@@ -871,11 +873,11 @@ var getDevSegmentPath = (e, t, n, r) => {
|
|
|
871
873
|
return [ n, i ];
|
|
872
874
|
};
|
|
873
875
|
|
|
874
|
-
function
|
|
876
|
+
function Us(e, t) {
|
|
875
877
|
const n = t?.mapper;
|
|
876
878
|
const r = e.symbolMapper ? e.symbolMapper : (e, t, r) => {
|
|
877
879
|
if (n || isDev6 && import.meta.env?.MODE !== "test") {
|
|
878
|
-
const t =
|
|
880
|
+
const t = Rh(e);
|
|
879
881
|
const s = !isDev6 ? n[t] : getDevSegmentPath(n, t, e, r);
|
|
880
882
|
if (!s) {
|
|
881
883
|
if (t === Me) {
|
|
@@ -893,7 +895,7 @@ function Vs(e, t) {
|
|
|
893
895
|
const s = {
|
|
894
896
|
isServer: true,
|
|
895
897
|
async importSymbol(e, t, n) {
|
|
896
|
-
const r =
|
|
898
|
+
const r = Rh(n);
|
|
897
899
|
const s = globalThis.__qwik_reg_symbols?.get(r);
|
|
898
900
|
if (s) {
|
|
899
901
|
return s;
|
|
@@ -912,11 +914,11 @@ function Vs(e, t) {
|
|
|
912
914
|
}
|
|
913
915
|
|
|
914
916
|
async function setServerPlatform(e, t) {
|
|
915
|
-
const n =
|
|
916
|
-
|
|
917
|
+
const n = Us(e, t);
|
|
918
|
+
Hs(n);
|
|
917
919
|
}
|
|
918
920
|
|
|
919
|
-
var
|
|
921
|
+
var Rh = e => {
|
|
920
922
|
const t = e.lastIndexOf("_");
|
|
921
923
|
if (t > -1) {
|
|
922
924
|
return e.slice(t + 1);
|
|
@@ -925,33 +927,33 @@ var Sh = e => {
|
|
|
925
927
|
};
|
|
926
928
|
|
|
927
929
|
// packages/qwik/src/server/ssr-render.ts
|
|
928
|
-
import { getClientManifest as
|
|
930
|
+
import { getClientManifest as Qf } from "@qwik.dev/core";
|
|
929
931
|
|
|
930
932
|
// packages/qwik/src/server/ssr-container.ts
|
|
931
933
|
import { isDev as isDev8 } from "@qwik.dev/core/build";
|
|
932
934
|
|
|
933
|
-
import { _SubscriptionData as
|
|
935
|
+
import { _SubscriptionData as Ti, _SharedContainer as lc, _jsxSorted as Di, _jsxSplit as Wi, _res as _, _setEvent, _walkJSX as Xn, _createQRL as xf, isSignal as lu } from "@qwik.dev/core/internal";
|
|
934
936
|
|
|
935
937
|
// packages/qwik/src/server/ooos-utils.ts
|
|
936
|
-
import { _SubscriptionPatch as
|
|
938
|
+
import { _SubscriptionPatch as qu } from "@qwik.dev/core/internal";
|
|
937
939
|
|
|
938
940
|
var recordExternalRootEffect = (e, t, n, r, s, i, o, a) => {
|
|
939
941
|
if (!r || o !== null && !a) {
|
|
940
942
|
return;
|
|
941
943
|
}
|
|
942
|
-
let
|
|
944
|
+
let l = s;
|
|
943
945
|
if (o !== null && s && (typeof s === "object" || typeof s === "function")) {
|
|
944
|
-
|
|
946
|
+
l = n.get(s) || s;
|
|
945
947
|
}
|
|
946
|
-
const
|
|
947
|
-
t.St(
|
|
948
|
+
const c = e.ge(l);
|
|
949
|
+
t.St(l);
|
|
948
950
|
t.St(i);
|
|
949
951
|
if (o !== null && typeof o !== "string") {
|
|
950
952
|
t.St(o);
|
|
951
953
|
}
|
|
952
954
|
r.push({
|
|
953
|
-
rootObj:
|
|
954
|
-
rootId:
|
|
955
|
+
rootObj: l,
|
|
956
|
+
rootId: c,
|
|
955
957
|
effect: i,
|
|
956
958
|
prop: o
|
|
957
959
|
});
|
|
@@ -969,23 +971,23 @@ var collectSubscriptionPatches = (e, t, n) => {
|
|
|
969
971
|
if (a === void 0 || a >= n) {
|
|
970
972
|
continue;
|
|
971
973
|
}
|
|
972
|
-
let
|
|
973
|
-
if (!
|
|
974
|
-
|
|
975
|
-
s.set(a,
|
|
976
|
-
r.push(
|
|
974
|
+
let l = s.get(a);
|
|
975
|
+
if (!l) {
|
|
976
|
+
l = new qu(a, o.prop === null ? /* @__PURE__ */ new Set : /* @__PURE__ */ new Map);
|
|
977
|
+
s.set(a, l);
|
|
978
|
+
r.push(l);
|
|
977
979
|
}
|
|
978
|
-
const
|
|
980
|
+
const c = l.subscriptions;
|
|
979
981
|
if (o.prop === null) {
|
|
980
|
-
if (
|
|
981
|
-
|
|
982
|
+
if (c instanceof Set) {
|
|
983
|
+
c.add(o.effect);
|
|
982
984
|
}
|
|
983
985
|
} else {
|
|
984
|
-
if (
|
|
985
|
-
let e =
|
|
986
|
+
if (c instanceof Map) {
|
|
987
|
+
let e = c.get(o.prop);
|
|
986
988
|
if (!e) {
|
|
987
989
|
e = /* @__PURE__ */ new Set;
|
|
988
|
-
|
|
990
|
+
c.set(o.prop, e);
|
|
989
991
|
}
|
|
990
992
|
e.add(o.effect);
|
|
991
993
|
}
|
|
@@ -995,7 +997,7 @@ var collectSubscriptionPatches = (e, t, n) => {
|
|
|
995
997
|
};
|
|
996
998
|
|
|
997
999
|
// packages/qwik/src/server/preload-impl.ts
|
|
998
|
-
import { getPlatform as
|
|
1000
|
+
import { getPlatform as Js } from "@qwik.dev/core";
|
|
999
1001
|
|
|
1000
1002
|
var simplifyPath = (e, t) => {
|
|
1001
1003
|
if (t == null) {
|
|
@@ -1039,15 +1041,15 @@ var preloaderPre = (e, t, n) => {
|
|
|
1039
1041
|
a.push(`P:${t.maxIdlePreloads}`);
|
|
1040
1042
|
}
|
|
1041
1043
|
}
|
|
1042
|
-
const
|
|
1043
|
-
const
|
|
1044
|
+
const l = a.length ? `,{${a.join(",")}}` : "";
|
|
1045
|
+
const c = {
|
|
1044
1046
|
rel: "modulepreload",
|
|
1045
1047
|
href: i
|
|
1046
1048
|
};
|
|
1047
1049
|
if (n) {
|
|
1048
|
-
|
|
1050
|
+
c["nonce"] = n;
|
|
1049
1051
|
}
|
|
1050
|
-
e.openElement("link", null,
|
|
1052
|
+
e.openElement("link", null, c, null, null, null);
|
|
1051
1053
|
e.closeElement();
|
|
1052
1054
|
e.openElement("link", null, {
|
|
1053
1055
|
rel: "preload",
|
|
@@ -1056,7 +1058,7 @@ var preloaderPre = (e, t, n) => {
|
|
|
1056
1058
|
crossorigin: "anonymous"
|
|
1057
1059
|
}, null, null, null);
|
|
1058
1060
|
e.closeElement();
|
|
1059
|
-
const u = `let b=fetch("${o}");import("${i}").then(({l})=>l(${JSON.stringify(s)},b${
|
|
1061
|
+
const u = `let b=fetch("${o}");import("${i}").then(({l})=>l(${JSON.stringify(s)},b${l}));`;
|
|
1060
1062
|
const h = {
|
|
1061
1063
|
type: "module",
|
|
1062
1064
|
async: true,
|
|
@@ -1089,10 +1091,10 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1089
1091
|
let i = s;
|
|
1090
1092
|
const o = getBase(e);
|
|
1091
1093
|
const a = [];
|
|
1092
|
-
const {resolvedManifest:
|
|
1094
|
+
const {resolvedManifest: l} = e;
|
|
1093
1095
|
if (i) {
|
|
1094
|
-
const e =
|
|
1095
|
-
const t =
|
|
1096
|
+
const e = l?.manifest.preloader;
|
|
1097
|
+
const t = l?.manifest.core;
|
|
1096
1098
|
for (let r = 0; r < n.length; r++) {
|
|
1097
1099
|
const s = n[r];
|
|
1098
1100
|
if (s === e || s === t) {
|
|
@@ -1104,7 +1106,7 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1104
1106
|
}
|
|
1105
1107
|
}
|
|
1106
1108
|
}
|
|
1107
|
-
const
|
|
1109
|
+
const c = simplifyPath(o, l?.manifest.preloader);
|
|
1108
1110
|
const u = a.length ?
|
|
1109
1111
|
/**
|
|
1110
1112
|
* We only use modulepreload links because they behave best. Older browsers can rely on the
|
|
@@ -1112,8 +1114,8 @@ var includePreloader = (e, t, n, r) => {
|
|
|
1112
1114
|
* links.
|
|
1113
1115
|
*/ `${JSON.stringify(a)}.map((l,e)=>{e=document.createElement('link');e.rel='modulepreload';e.href=${JSON.stringify(o)}+l;document.head.appendChild(e)});` : "";
|
|
1114
1116
|
let h = u;
|
|
1115
|
-
if (
|
|
1116
|
-
h += `window.addEventListener('load',f=>{f=_=>import("${
|
|
1117
|
+
if (c) {
|
|
1118
|
+
h += `window.addEventListener('load',f=>{f=_=>import("${c}").then(({p})=>p(${JSON.stringify(n)}));try{requestIdleCallback(f,{timeout:2000})}catch(e){setTimeout(f,200)}})`;
|
|
1117
1119
|
}
|
|
1118
1120
|
if (h) {
|
|
1119
1121
|
const t = {
|
|
@@ -1148,7 +1150,7 @@ function normalizePreLoaderOptions(e) {
|
|
|
1148
1150
|
}
|
|
1149
1151
|
|
|
1150
1152
|
var getBundles = e => {
|
|
1151
|
-
const t =
|
|
1153
|
+
const t = Js();
|
|
1152
1154
|
const n = e?.map(e => {
|
|
1153
1155
|
const n = e.vt;
|
|
1154
1156
|
const r = e._t;
|
|
@@ -1167,9 +1169,9 @@ var preLoaderOptionsDefault = {
|
|
|
1167
1169
|
};
|
|
1168
1170
|
|
|
1169
1171
|
// packages/qwik/src/server/scripts.ts
|
|
1170
|
-
var QWIK_LOADER_DEFAULT_MINIFIED = 'const e=document,t=window,n="w",r="wp",o="d",s="dp",i="e",
|
|
1172
|
+
var QWIK_LOADER_DEFAULT_MINIFIED = 'const e=document,t=window,n="w",r="wp",o="d",s="dp",i="e",a="ep",c="capture:",l="readystatechange",p=0,u=new Set,d=new Set([e]),f=new Map,h={};let q,b,g;const m=(e,t)=>Array.from(e.querySelectorAll(t)),v=e=>{const t=[];return d.forEach(n=>t.push(...m(n,e))),t},w=(e,t,n,r=!1,o=!1)=>e.addEventListener(t,n,{capture:r,passive:o}),y=e=>{H(e);const t=m(e,"[q\\\\:shadowroot]");for(let e=0;e<t.length;e++){const n=t[e].shadowRoot;n&&y(n)}},A=e=>e&&"function"==typeof e.then,E=async e=>{for(let t=0;t<e.length;t++)await e[t]()},C=e=>{if(e.length){const t=()=>E(e);g=g?g.then(t,t):t()}},S=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}}},_=e=>{h[e]=1,I(l)},k=t=>{const n=t.getAttribute("q:instance");return"paused"===t.getAttribute("q:container")&&"loading"===e.readyState&&!h[n]&&new Promise(t=>{w(e,l,()=>{("loading"!==e.readyState||h[n])&&t()})})},$=(e,t)=>new CustomEvent(e,{detail:t}),I=(t,n)=>{e.dispatchEvent($(t,n))},N=e=>e.replace(/([A-Z-])/g,e=>"-"+e.toLowerCase()),R=e=>e.replace(/-./g,e=>e[1].toUpperCase()),T=e=>{const t=e.indexOf(":");return{scope:e.slice(0,t),eventName:R(e.slice(t+1))}},x=e=>2===e.length,B=e=>e.charAt(0),L=e=>!!e&&1===e.nodeType,U=(e,t,n)=>e.hasAttribute(n)&&(!!e._qDispatch?.[t]||e.hasAttribute("q-"+t)),j=(t,n,r,o,s,i,a,c=!0)=>{const l={qBase:r,symbol:i,element:n,reqTime:a};if(!s){const n=(e["qFuncs_"+t.getAttribute("q:instance")]||[])[+i];if(!n&&c){const e=Error("sym:"+i);I("qerror",{importError:"sync",error:e,...l}),console.error(e)}return n}const p=`${i}|${r}|${s}`,u=f.get(p);if(u)return u;const d=new URL(s,o).href,h=import(d);return S(t),h.then(e=>{const t=e[i];if(t)f.set(p,t),I("qsymbol",l);else{const e=Error(`${i} not in ${d}`);I("qerror",{importError:"no-symbol",error:e,...l}),console.error(e)}return t},e=>{I("qerror",{importError:"async",error:e,...l}),console.error(e)})},D=(t,n,r,o,s,i=!0)=>{let a=!1;s&&(i&&t.hasAttribute("preventdefault:"+s)&&n.preventDefault(),t.hasAttribute("stoppropagation:"+s)&&n.stopPropagation());const c=t._qDispatch?.[r];if(c){if("function"==typeof c){const e=()=>c(n,t);if(a)o.push(async()=>{const t=e();A(t)&&await t});else{const t=e();A(t)&&(a=!0,o.push(()=>t))}}else if(c.length)for(let e=0;e<c.length;e++){const r=c[e];if(r){const e=()=>r(n,t);if(a)o.push(async()=>{const t=e();A(t)&&await t});else{const t=e();A(t)&&(a=!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),c=l.split("|"),p=k(r);for(let e=0;e<c.length;e++){const l=c[e],u=performance.now(),[d,f,h]=l.split("#"),q=e=>{if(e&&t.isConnected){const r=e=>{I("qerror",{error:e,qBase:s,symbol:f,element:t,reqTime:u})};try{const o=e.call(h,n,t);if(A(o))return o.catch(r)}catch(e){return r(e)}}},b=(e=!0)=>j(r,t,s,i,d,f,u,e),g=p?void 0:b();if(p)a=!0,o.push(async()=>{await p,await q(await b(!1)||await b())});else if(A(g))a=!0,o.push(()=>g.then(q));else if(a)a=!0,o.push(async()=>{await q(g||await b())});else{const e=q(g);A(e)&&(a=!0,o.push(()=>e))}}}},O=(e,t=i,n=!0)=>{const r=N(e.type),o=t+":"+r,s=c+r,a=[],l=[],p=[];let u=e.target;for(;u;)L(u)?(a.push(u),l.push(U(u,o,s)),u=u.parentElement):u=u.parentElement;for(let t=a.length-1;t>=0;t--)if(l[t]&&(D(a[t],e,o,p,r,n),e.cancelBubble))return void C(p);for(let t=0;t<a.length;t++)if(!l[t]&&(D(a[t],e,o,p,r,n),!e.bubbles||e.cancelBubble))return void C(p);C(p)},P=e=>O(e,a,!1),F=(e,t,n=!0)=>{const r=N(t.type),o=e+":"+r,s=v("[q-"+e+"\\\\:"+r+"]"),i=[];for(let e=0;e<s.length;e++){const a=s[e];D(a,t,o,i,r,n)}C(i)},J=e=>{F(o,e)},M=e=>{F(s,e,!1)},Z=e=>{F(n,e)},z=e=>{F(r,e,!1)},G=()=>{const n=e.readyState;if("interactive"==n||"complete"==n){if(b=1,d.forEach(y),u.has("d:qinit")){u.delete("d:qinit");const e=$("qinit"),t=v("[q-d\\\\:qinit]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qinit",n),o.removeAttribute("q-d:qinit")}C(n)}if(u.has("d:qidle")&&(u.delete("d:qidle"),(t.requestIdleCallback??t.setTimeout).bind(t)(()=>{const e=$("qidle"),t=v("[q-d\\\\:qidle]"),n=[];for(let r=0;r<t.length;r++){const o=t[r];D(o,e,"d:qidle",n),o.removeAttribute("q-d:qidle")}C(n)})),u.has("e:qvisible")){q||(q=new IntersectionObserver(e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.isIntersecting&&(q.unobserve(r.target),D(r.target,$("qvisible",r),"e:qvisible",t))}C(t)}));const e=v("[q-e\\\\:qvisible]:not([q\\\\:observed])");for(let t=0;t<e.length;t++){const n=e[t];q.observe(n),n.setAttribute("q:observed","true")}}}},H=(...e)=>{for(let r=0;r<e.length;r++){const s=e[r];if(0===s)_(e[++r]);else if("string"==typeof s){if(!u.has(s)){u.add(s);const{scope:e,eventName:r}=T(s),i=x(e),a=B(e);a===n?w(t,r,i?z:Z,!0,i):d.forEach(e=>w(e,r,a===o?i?M:J:i?P:O,!0,i)),1!==b||"e:qvisible"!==s&&"d:qinit"!==s&&"d:qidle"!==s||G()}}else d.has(s)||(u.forEach(e=>{const{scope:t,eventName:r}=T(e),i=x(t),a=B(t);a!==n&&w(s,r,a===o?i?M:J:i?P:O,!0,i)}),d.add(s))}},K=t._qwikEv;K?.roots||(Array.isArray(K)?H(...K):H("e:click","e:input"),t._qwikEv={events:u,roots:d,push:H},w(e,l,G),G())';
|
|
1171
1173
|
|
|
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}';
|
|
1174
|
+
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 QwikEvContainerReady = 0;\nconst events = /* @__PURE__ */ new Set();\nconst roots = /* @__PURE__ */ new Set([doc]);\nconst symbols = /* @__PURE__ */ new Map();\nconst readyContainers = {};\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 markContainerReady = (hash) => {\n readyContainers[hash] = 1;\n emitEvent(readyStateChange);\n};\nconst waitForContainerReady = (container) => {\n const hash = container.getAttribute("q:instance");\n return container.getAttribute("q:container") === "paused" && doc.readyState === "loading" && !readyContainers[hash] && new Promise((resolve) => {\n const ready = () => {\n if (doc.readyState !== "loading" || readyContainers[hash]) {\n resolve();\n }\n };\n addEventListener(doc, readyStateChange, 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 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 ? void 0 : resolve();\n if (waitForReady) {\n defer = true;\n tasks.push(async () => {\n await waitForReady;\n await run(await resolve(false) || await resolve());\n });\n } else if (isPromise(handler)) {\n defer = true;\n tasks.push(() => handler.then(run));\n } else if (defer) {\n defer = true;\n tasks.push(async () => {\n await run(handler || 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 (eventNameOrRoot === QwikEvContainerReady) {\n markContainerReady(eventNames[++i]);\n } else 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
1175
|
|
|
1174
1176
|
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)}`;
|
|
1175
1177
|
|
|
@@ -1204,7 +1206,7 @@ function getQwikOutOfOrderExecutorScript(e = {}) {
|
|
|
1204
1206
|
}
|
|
1205
1207
|
|
|
1206
1208
|
// packages/qwik/src/server/ssr-node.ts
|
|
1207
|
-
import { _isJSXNode as
|
|
1209
|
+
import { _isJSXNode as Ai, _EMPTY_OBJ, _EFFECT_BACK_REF as _r } from "@qwik.dev/core/internal";
|
|
1208
1210
|
|
|
1209
1211
|
import { isDev as isDev7 } from "@qwik.dev/core/build";
|
|
1210
1212
|
|
|
@@ -1236,7 +1238,7 @@ var SsrNode = class {
|
|
|
1236
1238
|
attrs;
|
|
1237
1239
|
/** Local props which don't serialize; */
|
|
1238
1240
|
localProps=null;
|
|
1239
|
-
get [
|
|
1241
|
+
get [_r]() {
|
|
1240
1242
|
return this.getProp(Qe);
|
|
1241
1243
|
}
|
|
1242
1244
|
setProp(e, t) {
|
|
@@ -1331,14 +1333,14 @@ var SsrComponentFrame = class {
|
|
|
1331
1333
|
distributeChildrenIntoSlots(e, t, n) {
|
|
1332
1334
|
this.projectionScopedStyle = t;
|
|
1333
1335
|
this.projectionComponentFrame = n;
|
|
1334
|
-
if (
|
|
1336
|
+
if (Ai(e)) {
|
|
1335
1337
|
const t = this.getSlotName(e);
|
|
1336
1338
|
_e(this.slots, t, e, 0);
|
|
1337
1339
|
} else if (Array.isArray(e) && e.length > 0) {
|
|
1338
1340
|
const t = [];
|
|
1339
1341
|
for (let n = 0; n < e.length; n++) {
|
|
1340
1342
|
const r = e[n];
|
|
1341
|
-
if (
|
|
1343
|
+
if (Ai(r)) {
|
|
1342
1344
|
const e = this.getSlotName(r);
|
|
1343
1345
|
if (e === QDefaultSlot) {
|
|
1344
1346
|
t.push(r);
|
|
@@ -1872,7 +1874,7 @@ function getBuildBase(e) {
|
|
|
1872
1874
|
}
|
|
1873
1875
|
|
|
1874
1876
|
var versions = {
|
|
1875
|
-
qwik: "2.0.0-beta.
|
|
1877
|
+
qwik: "2.0.0-beta.37-dev+82dc74d",
|
|
1876
1878
|
qwikDom: "2.1.19"
|
|
1877
1879
|
};
|
|
1878
1880
|
|
|
@@ -2009,7 +2011,7 @@ var QTemplateProps = {
|
|
|
2009
2011
|
"aria-hidden": true
|
|
2010
2012
|
};
|
|
2011
2013
|
|
|
2012
|
-
var SSRContainer = class extends
|
|
2014
|
+
var SSRContainer = class extends lc {
|
|
2013
2015
|
tag;
|
|
2014
2016
|
isHtml;
|
|
2015
2017
|
writer;
|
|
@@ -2347,7 +2349,7 @@ var SSRContainer = class extends ic {
|
|
|
2347
2349
|
this.emitQwikLoaderInline();
|
|
2348
2350
|
}
|
|
2349
2351
|
}
|
|
2350
|
-
let
|
|
2352
|
+
let l = void 0;
|
|
2351
2353
|
this.lastNode = null;
|
|
2352
2354
|
if (!a && this.currentElementFrame) {
|
|
2353
2355
|
vNodeData_incrementElementCount(this.currentElementFrame.vNodeData);
|
|
@@ -2359,9 +2361,9 @@ var SSRContainer = class extends ic {
|
|
|
2359
2361
|
vNodeData_openElement(this.currentElementFrame.vNodeData);
|
|
2360
2362
|
this.write(LT);
|
|
2361
2363
|
this.write(e);
|
|
2362
|
-
const
|
|
2364
|
+
const c = this.getOrCreateLastNode();
|
|
2363
2365
|
if (n) {
|
|
2364
|
-
|
|
2366
|
+
l = this.writeAttrs(e, n, false, s, i, o);
|
|
2365
2367
|
}
|
|
2366
2368
|
this.write(" " + Es);
|
|
2367
2369
|
if (t !== null) {
|
|
@@ -2369,14 +2371,14 @@ var SSRContainer = class extends ic {
|
|
|
2369
2371
|
} else if (qTest) {
|
|
2370
2372
|
this.write(EMPTY_ATTR);
|
|
2371
2373
|
}
|
|
2372
|
-
if (r && !
|
|
2373
|
-
|
|
2374
|
+
if (r && !dr(r)) {
|
|
2375
|
+
l = this.writeAttrs(e, r, true, s, i, o) || l;
|
|
2374
2376
|
}
|
|
2375
2377
|
this.write(GT);
|
|
2376
|
-
if (
|
|
2377
|
-
|
|
2378
|
+
if (c) {
|
|
2379
|
+
c.setTreeNonUpdatable();
|
|
2378
2380
|
}
|
|
2379
|
-
return
|
|
2381
|
+
return l;
|
|
2380
2382
|
}
|
|
2381
2383
|
/** Renders closing tag for DOM element */ closeElement() {
|
|
2382
2384
|
if (this.currentElementFrame === this.emitContainerDataFrame) {
|
|
@@ -2545,7 +2547,7 @@ var SSRContainer = class extends ic {
|
|
|
2545
2547
|
}
|
|
2546
2548
|
for (let t = 0; t < e.length; t++) {
|
|
2547
2549
|
const n = e[t];
|
|
2548
|
-
const r =
|
|
2550
|
+
const r = Wi(n.tag, null, n.attributes || {}, null, 0, null);
|
|
2549
2551
|
if (n.location === "head") {
|
|
2550
2552
|
this.additionalHeadNodes.push(r);
|
|
2551
2553
|
} else {
|
|
@@ -2563,7 +2565,7 @@ var SSRContainer = class extends ic {
|
|
|
2563
2565
|
if (!this.styleIds.has(t)) {
|
|
2564
2566
|
this.styleIds.add(t);
|
|
2565
2567
|
if (this.currentElementFrame?.elementName === "html") {
|
|
2566
|
-
this.additionalHeadNodes.push(
|
|
2568
|
+
this.additionalHeadNodes.push(Di("style", null, {
|
|
2567
2569
|
dangerouslySetInnerHTML: e,
|
|
2568
2570
|
[Ue]: t
|
|
2569
2571
|
}, null, 0, t));
|
|
@@ -2608,7 +2610,6 @@ var SSRContainer = class extends ic {
|
|
|
2608
2610
|
this.emitPatchDataIfNeeded();
|
|
2609
2611
|
this.emitExecutorIfNeeded();
|
|
2610
2612
|
this.emitQwikLoaderAtBottomIfNeeded();
|
|
2611
|
-
this.emitContainerReadyEventIfNeeded();
|
|
2612
2613
|
}
|
|
2613
2614
|
emitDelayedOutOfOrderSegmentVNodeData() {
|
|
2614
2615
|
if (!__EXPERIMENTAL__.suspense || !this.outOfOrderStreaming || !this.outOfOrderUsed) {
|
|
@@ -2663,7 +2664,7 @@ var SSRContainer = class extends ic {
|
|
|
2663
2664
|
type: "qwik/vnode"
|
|
2664
2665
|
};
|
|
2665
2666
|
if (__EXPERIMENTAL__.suspense && this.outOfOrderStreaming && e) {
|
|
2666
|
-
r[
|
|
2667
|
+
r[Ph] = e;
|
|
2667
2668
|
}
|
|
2668
2669
|
if (n) {
|
|
2669
2670
|
r[QStatePatchAttr] = true;
|
|
@@ -2697,7 +2698,7 @@ var SSRContainer = class extends ic {
|
|
|
2697
2698
|
t--;
|
|
2698
2699
|
this.write(VNodeDataChar.CLOSE_CHAR);
|
|
2699
2700
|
} else if (i === WRITE_ELEMENT_ATTRS) {
|
|
2700
|
-
if (e && !
|
|
2701
|
+
if (e && !dr(e)) {
|
|
2701
2702
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2702
2703
|
this.write(VNodeDataChar.SEPARATOR_CHAR);
|
|
2703
2704
|
this.writeFragmentAttrs(e);
|
|
@@ -2861,7 +2862,7 @@ var SSRContainer = class extends ic {
|
|
|
2861
2862
|
};
|
|
2862
2863
|
const t = this.serializationCtx.Tt;
|
|
2863
2864
|
if (t.size > 0) {
|
|
2864
|
-
e["q-d:qidle"] =
|
|
2865
|
+
e["q-d:qidle"] = xf(null, "_res", _, null, [ ...t ]);
|
|
2865
2866
|
}
|
|
2866
2867
|
return e;
|
|
2867
2868
|
}
|
|
@@ -2883,11 +2884,11 @@ var SSRContainer = class extends ic {
|
|
|
2883
2884
|
this.write(Q_FUNCS_PREFIX.replace("HASH", this.Te));
|
|
2884
2885
|
}
|
|
2885
2886
|
if (!e) {
|
|
2886
|
-
this.write(
|
|
2887
|
+
this.write(yr);
|
|
2887
2888
|
}
|
|
2888
|
-
this.writeArray(e ? t.slice(n) : t,
|
|
2889
|
+
this.writeArray(e ? t.slice(n) : t, wr);
|
|
2889
2890
|
if (!e) {
|
|
2890
|
-
this.write(
|
|
2891
|
+
this.write(mr);
|
|
2891
2892
|
}
|
|
2892
2893
|
if (e) {
|
|
2893
2894
|
this.write(")");
|
|
@@ -2901,7 +2902,7 @@ var SSRContainer = class extends ic {
|
|
|
2901
2902
|
for (const [t, n] of this.backpatchMap) {
|
|
2902
2903
|
for (let r = 0; r < n.length; r++) {
|
|
2903
2904
|
const s = n[r];
|
|
2904
|
-
e.push(t, s.attrName,
|
|
2905
|
+
e.push(t, s.attrName, lu(s.value) ? s.value.untrackedValue : s.value);
|
|
2905
2906
|
}
|
|
2906
2907
|
}
|
|
2907
2908
|
this.backpatchMap.clear();
|
|
@@ -2960,12 +2961,6 @@ var SSRContainer = class extends ic {
|
|
|
2960
2961
|
}
|
|
2961
2962
|
this.writeScript(t, e);
|
|
2962
2963
|
}
|
|
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
2964
|
writeScript(e, t) {
|
|
2970
2965
|
this.openScript(e);
|
|
2971
2966
|
if (t) {
|
|
@@ -3034,18 +3029,21 @@ var SSRContainer = class extends ic {
|
|
|
3034
3029
|
if (this.qlInclude !== 2 /* Done */) {
|
|
3035
3030
|
this.emitQwikLoaderInline();
|
|
3036
3031
|
}
|
|
3037
|
-
this.emitNewQwikEvents();
|
|
3032
|
+
this.emitNewQwikEvents(true);
|
|
3038
3033
|
}
|
|
3039
3034
|
}
|
|
3040
|
-
emitNewQwikEvents() {
|
|
3041
|
-
const
|
|
3042
|
-
for (const
|
|
3043
|
-
if (!this.emittedQwikEventNames.has(
|
|
3044
|
-
this.emittedQwikEventNames.add(
|
|
3045
|
-
|
|
3035
|
+
emitNewQwikEvents(e = false) {
|
|
3036
|
+
const t = [];
|
|
3037
|
+
for (const e of this.serializationCtx.At) {
|
|
3038
|
+
if (!this.emittedQwikEventNames.has(e)) {
|
|
3039
|
+
this.emittedQwikEventNames.add(e);
|
|
3040
|
+
t.push(JSON.stringify(e));
|
|
3046
3041
|
}
|
|
3047
3042
|
}
|
|
3048
|
-
|
|
3043
|
+
if (e) {
|
|
3044
|
+
t.push(`${QwikEvContainerReady}`, JSON.stringify(this.Te));
|
|
3045
|
+
}
|
|
3046
|
+
this.emitQwikEvents(t);
|
|
3049
3047
|
}
|
|
3050
3048
|
emitQwikEvents(e) {
|
|
3051
3049
|
if (e.length > 0) {
|
|
@@ -3056,7 +3054,7 @@ var SSRContainer = class extends ic {
|
|
|
3056
3054
|
}
|
|
3057
3055
|
this.openScript(t);
|
|
3058
3056
|
this.write(`(window._qwikEv||(window._qwikEv=[])).push(`);
|
|
3059
|
-
this.writeArray(e,
|
|
3057
|
+
this.writeArray(e, wr);
|
|
3060
3058
|
this.write(PAREN_CLOSE);
|
|
3061
3059
|
this.closeScript();
|
|
3062
3060
|
}
|
|
@@ -3164,20 +3162,20 @@ var SSRContainer = class extends ic {
|
|
|
3164
3162
|
}
|
|
3165
3163
|
}
|
|
3166
3164
|
writeAttrs(e, t, r, i, o, a) {
|
|
3167
|
-
let
|
|
3168
|
-
for (let
|
|
3169
|
-
let u = t[
|
|
3170
|
-
if (isSSRUnsafeAttr(
|
|
3165
|
+
let l = void 0;
|
|
3166
|
+
for (let c in t) {
|
|
3167
|
+
let u = t[c];
|
|
3168
|
+
if (isSSRUnsafeAttr(c)) {
|
|
3171
3169
|
if (isDev8) {
|
|
3172
|
-
throw qe(32 /* unsafeAttr */ , [
|
|
3170
|
+
throw qe(32 /* unsafeAttr */ , [ c ]);
|
|
3173
3171
|
}
|
|
3174
3172
|
continue;
|
|
3175
3173
|
}
|
|
3176
|
-
if (
|
|
3177
|
-
u = _setEvent(this.serializationCtx,
|
|
3178
|
-
} else if (
|
|
3174
|
+
if (Ns(c)) {
|
|
3175
|
+
u = _setEvent(this.serializationCtx, c, u, a);
|
|
3176
|
+
} else if (c === "ref") {
|
|
3179
3177
|
const e = this.getOrCreateLastNode();
|
|
3180
|
-
if (
|
|
3178
|
+
if (lu(u)) {
|
|
3181
3179
|
u.Zt = new DomRef(e);
|
|
3182
3180
|
continue;
|
|
3183
3181
|
} else if (typeof u === "function") {
|
|
@@ -3188,56 +3186,56 @@ var SSRContainer = class extends ic {
|
|
|
3188
3186
|
} else {
|
|
3189
3187
|
throw qe(15 /* invalidRefValue */ , [ o ]);
|
|
3190
3188
|
}
|
|
3191
|
-
} else if (
|
|
3189
|
+
} else if (c === ys || c === ms) {
|
|
3192
3190
|
const e = this.addRoot(u);
|
|
3193
3191
|
if (e === void 0) {
|
|
3194
3192
|
continue;
|
|
3195
3193
|
}
|
|
3196
3194
|
u = typeof e === "number" ? [ e ] : String(e);
|
|
3197
|
-
} else if (
|
|
3195
|
+
} else if (lu(u)) {
|
|
3198
3196
|
const e = this.getOrCreateLastNode();
|
|
3199
|
-
const t = new
|
|
3197
|
+
const t = new Ti({
|
|
3200
3198
|
O: i,
|
|
3201
3199
|
et: r
|
|
3202
3200
|
});
|
|
3203
3201
|
const s = u;
|
|
3204
|
-
u = n(() => this.trackSignalValue(s, e,
|
|
3202
|
+
u = n(() => this.trackSignalValue(s, e, c, t));
|
|
3205
3203
|
}
|
|
3206
3204
|
if (Ps(u)) {
|
|
3207
3205
|
const e = this.getOrCreateLastNode();
|
|
3208
3206
|
this.addPromiseAttribute(u);
|
|
3209
3207
|
u.then(t => {
|
|
3210
|
-
this.addBackpatchEntry(e.id,
|
|
3208
|
+
this.addBackpatchEntry(e.id, c, s(c, t, i));
|
|
3211
3209
|
});
|
|
3212
3210
|
continue;
|
|
3213
3211
|
}
|
|
3214
|
-
if (
|
|
3212
|
+
if (c === Ss) {
|
|
3215
3213
|
if (u) {
|
|
3216
|
-
|
|
3217
|
-
|
|
3214
|
+
l = String(u);
|
|
3215
|
+
c = es;
|
|
3218
3216
|
u = "html" /* HTML */;
|
|
3219
3217
|
}
|
|
3220
3218
|
if (e === "style") {
|
|
3221
3219
|
continue;
|
|
3222
3220
|
}
|
|
3223
|
-
} else if (isPreventDefault(
|
|
3224
|
-
addPreventDefaultEventToSerializationContext(this.serializationCtx,
|
|
3221
|
+
} else if (isPreventDefault(c)) {
|
|
3222
|
+
addPreventDefaultEventToSerializationContext(this.serializationCtx, c);
|
|
3225
3223
|
}
|
|
3226
|
-
if (e === "textarea" &&
|
|
3224
|
+
if (e === "textarea" && c === "value") {
|
|
3227
3225
|
if (u && typeof u !== "string") {
|
|
3228
3226
|
if (isDev8) {
|
|
3229
3227
|
throw qe(23 /* wrongTextareaValue */ , [ o, u ]);
|
|
3230
3228
|
}
|
|
3231
3229
|
continue;
|
|
3232
3230
|
}
|
|
3233
|
-
|
|
3234
|
-
|
|
3231
|
+
l = escapeHTML(u || "");
|
|
3232
|
+
c = es;
|
|
3235
3233
|
u = "text" /* TEXT */;
|
|
3236
3234
|
}
|
|
3237
|
-
const h = s(
|
|
3235
|
+
const h = s(c, u, i);
|
|
3238
3236
|
if (h != null && h !== false) {
|
|
3239
|
-
this.write(
|
|
3240
|
-
this.write(
|
|
3237
|
+
this.write(ga);
|
|
3238
|
+
this.write(c);
|
|
3241
3239
|
if (h !== true) {
|
|
3242
3240
|
this.write(ATTR_EQUALS_QUOTE);
|
|
3243
3241
|
if (Array.isArray(h)) {
|
|
@@ -3246,11 +3244,11 @@ var SSRContainer = class extends ic {
|
|
|
3246
3244
|
const e = escapeHTML(String(h));
|
|
3247
3245
|
this.write(e);
|
|
3248
3246
|
}
|
|
3249
|
-
this.write(
|
|
3247
|
+
this.write($r);
|
|
3250
3248
|
}
|
|
3251
3249
|
}
|
|
3252
3250
|
}
|
|
3253
|
-
return
|
|
3251
|
+
return l;
|
|
3254
3252
|
}
|
|
3255
3253
|
writeEscapedChunks(e) {
|
|
3256
3254
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -3512,7 +3510,7 @@ var SSRSegmentContainer = class extends SSRContainer {
|
|
|
3512
3510
|
const t = this.stateScriptAttrs();
|
|
3513
3511
|
t[QStatePatchAttr] = true;
|
|
3514
3512
|
if (e) {
|
|
3515
|
-
t[
|
|
3513
|
+
t[Ph] = e;
|
|
3516
3514
|
}
|
|
3517
3515
|
return t;
|
|
3518
3516
|
}
|
|
@@ -3584,7 +3582,7 @@ var StreamHandler = class {
|
|
|
3584
3582
|
let t;
|
|
3585
3583
|
switch (this.inOrderStreaming.strategy) {
|
|
3586
3584
|
case "disabled":
|
|
3587
|
-
t =
|
|
3585
|
+
t = pr(t => {
|
|
3588
3586
|
if (t === void 0 || t === null) {
|
|
3589
3587
|
return;
|
|
3590
3588
|
}
|
|
@@ -3595,7 +3593,7 @@ var StreamHandler = class {
|
|
|
3595
3593
|
case "direct":
|
|
3596
3594
|
{
|
|
3597
3595
|
const n = this.nativeStream;
|
|
3598
|
-
t =
|
|
3596
|
+
t = pr(t => {
|
|
3599
3597
|
if (t === void 0 || t === null) {
|
|
3600
3598
|
return;
|
|
3601
3599
|
}
|
|
@@ -3613,7 +3611,7 @@ var StreamHandler = class {
|
|
|
3613
3611
|
{
|
|
3614
3612
|
const n = this.inOrderStreaming.maximumChunk ?? 0;
|
|
3615
3613
|
const r = this.inOrderStreaming.maximumInitialChunk ?? 0;
|
|
3616
|
-
t =
|
|
3614
|
+
t = pr(t => {
|
|
3617
3615
|
if (t === void 0 || t === null) {
|
|
3618
3616
|
return;
|
|
3619
3617
|
}
|
|
@@ -3738,7 +3736,7 @@ var renderToStream = async (e, t) => {
|
|
|
3738
3736
|
const i = resolveManifest(t.manifest);
|
|
3739
3737
|
const o = typeof t.locale === "function" ? t.locale(t) : t.serverData?.locale || t.locale || t.containerAttributes?.locale || "";
|
|
3740
3738
|
const a = new StreamHandler(t, n);
|
|
3741
|
-
const
|
|
3739
|
+
const l = ssrCreateContainer({
|
|
3742
3740
|
tagName: r,
|
|
3743
3741
|
locale: o,
|
|
3744
3742
|
writer: a.stream,
|
|
@@ -3749,21 +3747,21 @@ var renderToStream = async (e, t) => {
|
|
|
3749
3747
|
renderOptions: t
|
|
3750
3748
|
});
|
|
3751
3749
|
await setServerPlatform(t, i);
|
|
3752
|
-
await
|
|
3753
|
-
await
|
|
3750
|
+
await l.render(e);
|
|
3751
|
+
await l.l;
|
|
3754
3752
|
await a.flush();
|
|
3755
|
-
const
|
|
3753
|
+
const c = {
|
|
3756
3754
|
flushes: a.networkFlushes,
|
|
3757
3755
|
manifest: i?.manifest,
|
|
3758
|
-
size:
|
|
3756
|
+
size: l.size,
|
|
3759
3757
|
isStatic: false,
|
|
3760
3758
|
timing: n
|
|
3761
3759
|
};
|
|
3762
|
-
return
|
|
3760
|
+
return c;
|
|
3763
3761
|
};
|
|
3764
3762
|
|
|
3765
3763
|
function resolveManifest(e) {
|
|
3766
|
-
const t =
|
|
3764
|
+
const t = Qf();
|
|
3767
3765
|
const n = e ? {
|
|
3768
3766
|
...t,
|
|
3769
3767
|
...e
|
|
@@ -3775,7 +3773,7 @@ function resolveManifest(e) {
|
|
|
3775
3773
|
const e = {};
|
|
3776
3774
|
for (const t in n.mapping) {
|
|
3777
3775
|
const r = n.mapping[t];
|
|
3778
|
-
e[
|
|
3776
|
+
e[Rh(t)] = [ t, r ];
|
|
3779
3777
|
}
|
|
3780
3778
|
return {
|
|
3781
3779
|
mapper: e,
|
|
@@ -3790,7 +3788,7 @@ var Q_FUNCS_PREFIX = 'document["qFuncs_HASH"]=';
|
|
|
3790
3788
|
|
|
3791
3789
|
// packages/qwik/src/server/index.ts
|
|
3792
3790
|
async function setServerPlatform2(e) {
|
|
3793
|
-
const t =
|
|
3791
|
+
const t = Us({
|
|
3794
3792
|
manifest: e
|
|
3795
3793
|
}, resolveManifest(e));
|
|
3796
3794
|
setPlatform2(t);
|