marko 6.3.13 → 6.3.15
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/debug/html.js +197 -173
- package/dist/debug/html.mjs +197 -173
- package/dist/html/writer.d.ts +36 -36
- package/dist/html.js +149 -129
- package/dist/html.mjs +149 -129
- package/dist/translator/index.js +63 -51
- package/package.json +1 -1
package/dist/html.js
CHANGED
|
@@ -238,24 +238,26 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
238
238
|
[JSON, "JSON"],
|
|
239
239
|
[Math, "Math"],
|
|
240
240
|
[Reflect, "Reflect"]
|
|
241
|
-
]), unsafeRegExpSourceReg = /\\[\s\S]|</g, replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match, unsafeQuoteReg = /["\\<\n\r\u2028\u2029\0\ud800-\udfff]/u, $chunk,
|
|
241
|
+
]), unsafeRegExpSourceReg = /\\[\s\S]|</g, replaceUnsafeRegExpSourceChar = (match) => match === "<" || match === "\\<" ? "\\x3C" : match, unsafeQuoteReg = /["\\<\n\r\u2028\u2029\0\ud800-\udfff]/u, $chunk, kPendingContexts = Symbol("Pending Contexts"), kBranchId = Symbol("Branch Id"), kIsAsync = Symbol("Is Async"), writeScope = (scopeId, partialScope) => {
|
|
242
242
|
let { state } = $chunk.boundary, target = $chunk.serializeState, scope = scopeWithId(state, scopeId), pending = target.writeScopes[scopeId];
|
|
243
243
|
return state.needsMainRuntime = !0, Object.assign(scope, partialScope), pending && pending !== partialScope ? Object.assign(pending, partialScope) : target.writeScopes[scopeId] = partialScope, target.flushScopes = !0, scope;
|
|
244
|
-
}, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /'|&(?=[#a-zA-Z])/g, doubleQuoteAttrReplacements = /"|&(?=[#a-zA-Z])/g, needsQuotedAttr = /["'>\s]|&[#a-zA-Z]|\/$/g, voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/, _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
|
244
|
+
}, NOOP$2 = () => {}, tick = globalThis.setImmediate || globalThis.setTimeout || globalThis.queueMicrotask || ((cb) => Promise.resolve().then(cb)), tickQueue, kSelectedValue = Symbol("selectedValue"), checkedValuesRefs = /* @__PURE__ */ new WeakMap(), singleQuoteAttrReplacements = /'|&(?=[#a-zA-Z])/g, doubleQuoteAttrReplacements = /"|&(?=[#a-zA-Z])/g, needsQuotedAttr = /["'>\s]|&[#a-zA-Z]|\/$/g, voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/, _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
|
245
245
|
let shouldResume = serializeReason !== 0, renderer = normalizeDynamicRenderer(tag), state = getState(), branchId = _peek_scope_id(), rendered, result;
|
|
246
246
|
if (typeof renderer == "string") {
|
|
247
247
|
let input = (inputIsArgs ? inputOrArgs[0] : inputOrArgs) || {};
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (
|
|
253
|
-
|
|
248
|
+
rendered = !0, (() => {
|
|
249
|
+
if (_scope_id(), _html(`<${renderer}${_attrs(input, "a", branchId, renderer)}>`), !voidElementsReg.test(renderer)) {
|
|
250
|
+
let renderContent = content || normalizeDynamicRenderer(input.content);
|
|
251
|
+
if (renderer === "textarea") _html(_attr_textarea_value(branchId, "a", input.value, input.valueChange, 1));
|
|
252
|
+
else if (renderContent) {
|
|
253
|
+
if (typeof renderContent != "function") throw Error(`Body content is not supported for the \`<${renderer}>\` tag.`);
|
|
254
|
+
renderer === "select" && ("value" in input || "valueChange" in input) ? _attr_select_value(branchId, "a", input.value, input.valueChange, renderContent, 1) : _dynamic_tag(branchId, "a", renderContent, void 0, 0, void 0, serializeReason);
|
|
255
|
+
}
|
|
256
|
+
_html(`</${renderer}>`);
|
|
254
257
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
needsScript && (writeScope(branchId, { R: renderer }), _script(branchId, "d")), (shouldResume || needsScript) && _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
258
|
+
let childScope = getScopeById(branchId), needsScript = childScope && (childScope.Ia || childScope.Ea);
|
|
259
|
+
needsScript && (writeScope(branchId, { R: renderer }), _script(branchId, "d")), (shouldResume || needsScript) && _html(state.mark("'", scopeId + " " + accessor + " " + branchId));
|
|
260
|
+
})();
|
|
259
261
|
} else {
|
|
260
262
|
shouldResume && _html(state.mark("[", ""));
|
|
261
263
|
let render = () => {
|
|
@@ -674,13 +676,15 @@ function writeUnknownObject(state, val, ref) {
|
|
|
674
676
|
case Int32Array:
|
|
675
677
|
case Uint32Array:
|
|
676
678
|
case Float32Array:
|
|
677
|
-
case Float64Array:
|
|
679
|
+
case Float64Array:
|
|
680
|
+
case BigInt64Array:
|
|
681
|
+
case BigUint64Array: return writeTypedArray(state, val, ref);
|
|
678
682
|
case WeakSet: return writeWeakSet(state);
|
|
679
683
|
case WeakMap: return writeWeakMap(state);
|
|
680
684
|
case globalThis.URL: return writeURL(state, val);
|
|
681
685
|
case globalThis.URLSearchParams: return writeURLSearchParams(state, val);
|
|
682
686
|
case globalThis.Headers: return writeHeaders(state, val);
|
|
683
|
-
case globalThis.FormData: return writeFormData(state, val);
|
|
687
|
+
case globalThis.FormData: return writeFormData(state, val, ref);
|
|
684
688
|
case globalThis.ReadableStream: return writeReadableStream(state, val, ref);
|
|
685
689
|
case globalThis.Request: return writeRequest(state, val, ref);
|
|
686
690
|
case globalThis.Response: return writeResponse(state, val, ref);
|
|
@@ -789,12 +793,15 @@ function writeURLSearchParams(state, val) {
|
|
|
789
793
|
return str ? state.buf.push("new URLSearchParams(" + quote(str, 0) + ")") : state.buf.push("new URLSearchParams"), !0;
|
|
790
794
|
}
|
|
791
795
|
function writeHeaders(state, val) {
|
|
792
|
-
let headers =
|
|
793
|
-
return state.buf.push("new Headers" + (headers ? "(
|
|
796
|
+
let headers = stringEntriesToHeadersInit(val);
|
|
797
|
+
return state.buf.push("new Headers" + (headers ? "(" + headers + ")" : "")), !0;
|
|
794
798
|
}
|
|
795
|
-
function writeFormData(state, val) {
|
|
799
|
+
function writeFormData(state, val, ref) {
|
|
796
800
|
let sep = "[", valStr = "";
|
|
797
|
-
for (let [key, value] of val)
|
|
801
|
+
for (let [key, value] of val) {
|
|
802
|
+
if (typeof value != "string") return !1;
|
|
803
|
+
valStr += sep + quote(key, 0) + "," + quote(value, 0), sep = ",";
|
|
804
|
+
}
|
|
798
805
|
return sep === "[" ? state.buf.push("new FormData") : state.buf.push(valStr + "].reduce((f,v,i,a)=>i%2&&f.append(a[i-1],v)||f,new FormData)"), !0;
|
|
799
806
|
}
|
|
800
807
|
function writeRequest(state, val, ref) {
|
|
@@ -802,14 +809,14 @@ function writeRequest(state, val, ref) {
|
|
|
802
809
|
state.buf.push("new Request(" + quote(val.url, 0)), hasBody && (state.buf.push(",{body:"), writeProp(state, val.body, ref, "body") ? (state.buf.push(",duplex:\"half\""), sep = ",", bodySerialized = !0) : state.buf.pop());
|
|
803
810
|
let options = "";
|
|
804
811
|
val.cache !== "default" && (options += sep + "cache:" + quote(val.cache, 0), sep = ","), val.credentials !== "same-origin" && (options += sep + "credentials:" + quote(val.credentials, 0), sep = ",");
|
|
805
|
-
let headers =
|
|
806
|
-
return state.refs.set(val.headers, new Reference(ref, "headers", state.flush, null)), headers && (options += sep + "headers:
|
|
812
|
+
let headers = stringEntriesToHeadersInit(val.headers);
|
|
813
|
+
return state.refs.set(val.headers, new Reference(ref, "headers", state.flush, null)), headers && (options += sep + "headers:" + headers, sep = ","), val.integrity && (options += sep + "integrity:" + quote(val.integrity, 0), sep = ","), val.keepalive && (options += sep + "keepalive:true", sep = ","), val.method !== "GET" && (options += sep + "method:" + quote(val.method, 0), sep = ","), val.mode !== "cors" && (options += sep + "mode:" + quote(val.mode, 0), sep = ","), val.redirect !== "follow" && (options += sep + "redirect:" + quote(val.redirect, 0), sep = ","), val.referrer !== "about:client" && (options += sep + "referrer:" + quote(val.referrer, 0), sep = ","), val.referrerPolicy && (options += sep + "referrerPolicy:" + quote(val.referrerPolicy, 0)), state.buf.push(bodySerialized ? options + "})" : options ? ",{" + options + "})" : ")"), !0;
|
|
807
814
|
}
|
|
808
815
|
function writeResponse(state, val, ref) {
|
|
809
816
|
let sep = "", options = "";
|
|
810
817
|
val.status !== 200 && (options += "status:" + val.status, sep = ","), val.statusText && (options += sep + "statusText:" + quote(val.statusText, 0), sep = ",");
|
|
811
|
-
let headers =
|
|
812
|
-
return state.refs.set(val.headers, new Reference(ref, "headers", state.flush, null)), headers && (options += sep + "headers:
|
|
818
|
+
let headers = stringEntriesToHeadersInit(val.headers);
|
|
819
|
+
return state.refs.set(val.headers, new Reference(ref, "headers", state.flush, null)), headers && (options += sep + "headers:" + headers), !val.body || val.bodyUsed ? state.buf.push("new Response" + (options ? "(null,{" + options + "})" : "")) : (state.buf.push("new Response("), state.buf.push((writeProp(state, val.body, ref, "body") ? "" : "null") + (options ? ",{" + options + "})" : ")"))), !0;
|
|
813
820
|
}
|
|
814
821
|
function writeReadableStream(state, val, ref) {
|
|
815
822
|
let { boundary, channel } = state;
|
|
@@ -1021,18 +1028,29 @@ function nextId(state) {
|
|
|
1021
1028
|
function hasSymbolIterator(value) {
|
|
1022
1029
|
return Symbol.iterator in value;
|
|
1023
1030
|
}
|
|
1024
|
-
function
|
|
1031
|
+
function stringEntriesToHeadersInit(entries) {
|
|
1032
|
+
let list = [...entries];
|
|
1033
|
+
if (!list.length) return "";
|
|
1034
|
+
let duplicate = !1, seen = /* @__PURE__ */ new Set();
|
|
1035
|
+
for (let [key] of list) {
|
|
1036
|
+
if (seen.has(key)) {
|
|
1037
|
+
duplicate = !0;
|
|
1038
|
+
break;
|
|
1039
|
+
}
|
|
1040
|
+
seen.add(key);
|
|
1041
|
+
}
|
|
1025
1042
|
let result = "", sep = "";
|
|
1026
|
-
for (let [key, value] of
|
|
1027
|
-
return result;
|
|
1043
|
+
for (let [key, value] of list) result += duplicate ? sep + "[" + quote(key, 0) + "," + quote(value, 0) + "]" : sep + toObjectKey(key) + ":" + quote(value, 0), sep = ",";
|
|
1044
|
+
return duplicate ? "[" + result + "]" : "{" + result + "}";
|
|
1028
1045
|
}
|
|
1029
1046
|
function typedArrayToInitString(view) {
|
|
1030
|
-
let result = "[", sep = "";
|
|
1031
|
-
for (let i = 0; i < view.length; i++) result += sep + view[i], sep = ",";
|
|
1047
|
+
let suffix = typeof view[0] == "bigint" ? "n" : "", result = "[", sep = "";
|
|
1048
|
+
for (let i = 0; i < view.length; i++) result += sep + view[i] + suffix, sep = ",";
|
|
1032
1049
|
return result += "]", result;
|
|
1033
1050
|
}
|
|
1034
1051
|
function hasOnlyZeros(typedArray) {
|
|
1035
|
-
|
|
1052
|
+
let zero = typeof typedArray[0] == "bigint" ? 0n : 0;
|
|
1053
|
+
for (let i = 0; i < typedArray.length; i++) if (typedArray[i] !== zero) return !1;
|
|
1036
1054
|
return !0;
|
|
1037
1055
|
}
|
|
1038
1056
|
function patchIteratorNext(proto) {
|
|
@@ -1107,35 +1125,21 @@ function getState() {
|
|
|
1107
1125
|
function getScopeId(scope) {
|
|
1108
1126
|
return scope[K_SCOPE_ID];
|
|
1109
1127
|
}
|
|
1110
|
-
function
|
|
1111
|
-
$chunk.
|
|
1112
|
-
}
|
|
1113
|
-
function writeScript(script) {
|
|
1114
|
-
$chunk.writeScript(script);
|
|
1128
|
+
function getScopeById(scopeId) {
|
|
1129
|
+
if (scopeId !== void 0) return $chunk.boundary.state.scopes.get(scopeId);
|
|
1115
1130
|
}
|
|
1116
|
-
function
|
|
1117
|
-
|
|
1118
|
-
readyId,
|
|
1119
|
-
parent: chunk.serializeState,
|
|
1120
|
-
resumes: "",
|
|
1121
|
-
writeScopes: {},
|
|
1122
|
-
flushScopes: !1
|
|
1123
|
-
}), bodyEnd = body.render(renderer, input);
|
|
1124
|
-
body === bodyEnd ? (chunk.writeHTML(body.html), body.deferOwnReady(), chunk.deferredReady = push(chunk.deferredReady, body)) : (bodyEnd.next = $chunk = chunk.fork(boundary, chunk.next), chunk.next = body);
|
|
1131
|
+
function $global() {
|
|
1132
|
+
return $chunk.boundary.state.$global;
|
|
1125
1133
|
}
|
|
1126
|
-
function
|
|
1127
|
-
|
|
1134
|
+
function _id() {
|
|
1135
|
+
let state = $chunk.boundary.state, { $global } = state;
|
|
1136
|
+
return "s" + $global.runtimeId + $global.renderId + (state.tagId++).toString(36);
|
|
1128
1137
|
}
|
|
1129
|
-
function
|
|
1130
|
-
|
|
1131
|
-
render && (shouldResume ? withBranchId(branchId, render) : render()), _peek_scope_id() === branchId ? _scope_id() : shouldResume && writeScope(scopeId, {
|
|
1132
|
-
["A" + nodeAccessor]: writeScope(branchId, {}),
|
|
1133
|
-
["D" + nodeAccessor]: render?.a
|
|
1134
|
-
});
|
|
1138
|
+
function _scope_id() {
|
|
1139
|
+
return $chunk.boundary.state.scopeId++;
|
|
1135
1140
|
}
|
|
1136
|
-
function
|
|
1137
|
-
|
|
1138
|
-
if (renderer && typeof renderer == "function") return renderer;
|
|
1141
|
+
function _peek_scope_id() {
|
|
1142
|
+
return $chunk.boundary.state.scopeId;
|
|
1139
1143
|
}
|
|
1140
1144
|
function withContext(key, value, cb, cbValue) {
|
|
1141
1145
|
let ctx = $chunk.context ||= { [kPendingContexts]: 0 }, prev = ctx[key];
|
|
@@ -1146,43 +1150,36 @@ function withContext(key, value, cb, cbValue) {
|
|
|
1146
1150
|
ctx[kPendingContexts]--, ctx[key] = prev;
|
|
1147
1151
|
}
|
|
1148
1152
|
}
|
|
1149
|
-
function
|
|
1150
|
-
|
|
1151
|
-
let childScope = writeScopePassive(childScopeId, { T: _resume({}, registryId, parentScopeId) });
|
|
1152
|
-
nodeAccessor !== void 0 && writeScope(parentScopeId, { ["A" + nodeAccessor]: childScope });
|
|
1153
|
-
}
|
|
1154
|
-
function writeScopePassive(scopeId, partialScope) {
|
|
1155
|
-
let target = $chunk.serializeState, scope = _scope_with_id(scopeId), passive = target.passiveScopes ||= {};
|
|
1156
|
-
return Object.assign(scope, partialScope), passive[scopeId] = Object.assign(passive[scopeId] || {}, partialScope), scope;
|
|
1153
|
+
function isInResumedBranch() {
|
|
1154
|
+
return $chunk?.context?.[kBranchId] !== void 0;
|
|
1157
1155
|
}
|
|
1158
|
-
function
|
|
1159
|
-
return
|
|
1156
|
+
function withBranchId(branchId, cb) {
|
|
1157
|
+
return withContext(kBranchId, branchId, cb);
|
|
1160
1158
|
}
|
|
1161
|
-
function
|
|
1162
|
-
|
|
1163
|
-
return "s" + $global.runtimeId + $global.renderId + (state.tagId++).toString(36);
|
|
1159
|
+
function withIsAsync(cb, value) {
|
|
1160
|
+
return withContext(kIsAsync, !0, cb, value);
|
|
1164
1161
|
}
|
|
1165
|
-
function
|
|
1166
|
-
|
|
1162
|
+
function _html(html) {
|
|
1163
|
+
$chunk.writeHTML(html);
|
|
1167
1164
|
}
|
|
1168
|
-
function
|
|
1169
|
-
|
|
1165
|
+
function writeScript(script) {
|
|
1166
|
+
$chunk.writeScript(script);
|
|
1170
1167
|
}
|
|
1171
|
-
function
|
|
1172
|
-
|
|
1168
|
+
function _script(scopeId, registryId) {
|
|
1169
|
+
($chunk.serializeState.readyId || $chunk.context?.[kIsAsync]) && _resume_branch(scopeId), $chunk.boundary.state.needsMainRuntime = !0, $chunk.writeEffect(scopeId, registryId);
|
|
1173
1170
|
}
|
|
1174
|
-
function
|
|
1175
|
-
$chunk.boundary.state.
|
|
1171
|
+
function _trailers(html) {
|
|
1172
|
+
$chunk.boundary.state.trailerHTML += html;
|
|
1176
1173
|
}
|
|
1177
|
-
function
|
|
1178
|
-
|
|
1179
|
-
return $chunk.boundary.state.serializeReason = void 0, reason;
|
|
1174
|
+
function _resume(val, id, scopeId) {
|
|
1175
|
+
return register(id, val, scopeId === void 0 ? void 0 : _scope_with_id(scopeId));
|
|
1180
1176
|
}
|
|
1181
|
-
function
|
|
1182
|
-
return
|
|
1177
|
+
function _el(scopeId, id) {
|
|
1178
|
+
return _resume(() => void 0, id, scopeId);
|
|
1183
1179
|
}
|
|
1184
|
-
function
|
|
1185
|
-
|
|
1180
|
+
function _hoist(scopeId, id) {
|
|
1181
|
+
let getter = () => void 0;
|
|
1182
|
+
return getter[Symbol.iterator] = _hoist_read_error, _resume(getter, id, scopeId);
|
|
1186
1183
|
}
|
|
1187
1184
|
function _el_resume(scopeId, accessor, shouldResume) {
|
|
1188
1185
|
if (shouldResume === 0) return "";
|
|
@@ -1192,25 +1189,36 @@ function _el_resume(scopeId, accessor, shouldResume) {
|
|
|
1192
1189
|
function _sep(shouldResume) {
|
|
1193
1190
|
return shouldResume === 0 ? "" : "<!>";
|
|
1194
1191
|
}
|
|
1195
|
-
function _el(scopeId, id) {
|
|
1196
|
-
return _resume(() => void 0, id, scopeId);
|
|
1197
|
-
}
|
|
1198
|
-
function _hoist(scopeId, id) {
|
|
1199
|
-
let getter = () => void 0;
|
|
1200
|
-
return getter[Symbol.iterator] = _hoist_read_error, _resume(getter, id, scopeId);
|
|
1201
|
-
}
|
|
1202
1192
|
function _resume_branch(scopeId) {
|
|
1203
1193
|
let branchId = $chunk.context?.[kBranchId];
|
|
1204
1194
|
branchId !== void 0 && branchId !== scopeId && writeScope(scopeId, { G: branchId });
|
|
1205
1195
|
}
|
|
1206
|
-
function
|
|
1207
|
-
|
|
1196
|
+
function _attr_content(nodeAccessor, scopeId, content, serializeReason) {
|
|
1197
|
+
let shouldResume = serializeReason !== 0, render = normalizeServerRender(content), branchId = _peek_scope_id();
|
|
1198
|
+
render && (shouldResume ? withBranchId(branchId, render) : render()), _peek_scope_id() === branchId ? _scope_id() : shouldResume && writeScope(scopeId, {
|
|
1199
|
+
["A" + nodeAccessor]: writeScope(branchId, {}),
|
|
1200
|
+
["D" + nodeAccessor]: render?.a
|
|
1201
|
+
});
|
|
1208
1202
|
}
|
|
1209
|
-
function
|
|
1210
|
-
|
|
1203
|
+
function normalizeServerRender(value) {
|
|
1204
|
+
let renderer = normalizeDynamicRenderer(value);
|
|
1205
|
+
if (renderer && typeof renderer == "function") return renderer;
|
|
1211
1206
|
}
|
|
1212
|
-
function
|
|
1213
|
-
|
|
1207
|
+
function _var(parentScopeId, scopeOffsetAccessor, childScopeId, registryId, nodeAccessor) {
|
|
1208
|
+
writeScopePassive(parentScopeId, { [scopeOffsetAccessor]: _scope_id() });
|
|
1209
|
+
let childScope = writeScopePassive(childScopeId, { T: _resume({}, registryId, parentScopeId) });
|
|
1210
|
+
nodeAccessor !== void 0 && writeScope(parentScopeId, { ["A" + nodeAccessor]: childScope });
|
|
1211
|
+
}
|
|
1212
|
+
function writeScopePassive(scopeId, partialScope) {
|
|
1213
|
+
let target = $chunk.serializeState, scope = _scope_with_id(scopeId), passive = target.passiveScopes ||= {};
|
|
1214
|
+
return Object.assign(scope, partialScope), passive[scopeId] = Object.assign(passive[scopeId] || {}, partialScope), scope;
|
|
1215
|
+
}
|
|
1216
|
+
function _show_start(display, mark) {
|
|
1217
|
+
display ? mark && $chunk.writeHTML($chunk.boundary.state.mark("[", "")) : $chunk.writeHTML("<t hidden>");
|
|
1218
|
+
}
|
|
1219
|
+
function _show_end(scopeId, accessor, display, serializeMarker, serializeStateful, parentEndTag, singleNode) {
|
|
1220
|
+
let branchId = _scope_id(), wrap = !display;
|
|
1221
|
+
wrap && $chunk.writeHTML("</t>"), writeBranchEnd(scopeId, accessor, serializeStateful, serializeMarker, parentEndTag, wrap || singleNode ? 1 : void 0, " " + branchId);
|
|
1214
1222
|
}
|
|
1215
1223
|
function _for_of(list, cb, by, scopeId, accessor, serializeBranch, serializeMarker, serializeStateful, parentEndTag, singleNode) {
|
|
1216
1224
|
forBranches(by, (each) => each ? forOf(list, (item, index) => {
|
|
@@ -1273,13 +1281,6 @@ function writeBranchEnd(scopeId, accessor, serializeStateful, serializeMarker, p
|
|
|
1273
1281
|
} else $chunk.writeHTML(endTag + _el_resume(scopeId, accessor));
|
|
1274
1282
|
else $chunk.writeHTML(endTag);
|
|
1275
1283
|
}
|
|
1276
|
-
function _show_start(display, mark) {
|
|
1277
|
-
display ? mark && $chunk.writeHTML($chunk.boundary.state.mark("[", "")) : $chunk.writeHTML("<t hidden>");
|
|
1278
|
-
}
|
|
1279
|
-
function _show_end(scopeId, accessor, display, serializeMarker, serializeStateful, parentEndTag, singleNode) {
|
|
1280
|
-
let branchId = _scope_id(), wrap = !display;
|
|
1281
|
-
wrap && $chunk.writeHTML("</t>"), writeBranchEnd(scopeId, accessor, serializeStateful, serializeMarker, parentEndTag, wrap || singleNode ? 1 : void 0, " " + branchId);
|
|
1282
|
-
}
|
|
1283
1284
|
function _existing_scope(scopeId) {
|
|
1284
1285
|
return writeScope(scopeId, {});
|
|
1285
1286
|
}
|
|
@@ -1290,8 +1291,35 @@ function scopeWithId(state, scopeId) {
|
|
|
1290
1291
|
let { scopes } = state, scope = scopes.get(scopeId);
|
|
1291
1292
|
return scope || scopes.set(scopeId, scope = { [K_SCOPE_ID]: scopeId }), scope;
|
|
1292
1293
|
}
|
|
1293
|
-
function
|
|
1294
|
-
|
|
1294
|
+
function _subscribe(subscribers, scope) {
|
|
1295
|
+
if (subscribers) {
|
|
1296
|
+
let { serializer } = $chunk.boundary.state;
|
|
1297
|
+
!$chunk.serializeState.readyId && !serializer.written(subscribers) ? subscribers.add(scope) : serializer.writeCall(scope, subscribers, "add", $chunk.serializeState);
|
|
1298
|
+
}
|
|
1299
|
+
return scope;
|
|
1300
|
+
}
|
|
1301
|
+
function _set_serialize_reason(reason) {
|
|
1302
|
+
$chunk.boundary.state.serializeReason = reason;
|
|
1303
|
+
}
|
|
1304
|
+
function _scope_reason() {
|
|
1305
|
+
let reason = $chunk.boundary.state.serializeReason;
|
|
1306
|
+
return $chunk.boundary.state.serializeReason = void 0, reason;
|
|
1307
|
+
}
|
|
1308
|
+
function _serialize_if(condition, key) {
|
|
1309
|
+
return condition && (condition === 1 || (typeof condition == "number" ? condition >>> key + 1 & 1 : condition[key])) ? 1 : void 0;
|
|
1310
|
+
}
|
|
1311
|
+
function _serialize_guard(condition, key) {
|
|
1312
|
+
return _serialize_if(condition, key) || 0;
|
|
1313
|
+
}
|
|
1314
|
+
function writeWaitReady(readyId, renderer, input) {
|
|
1315
|
+
let chunk = $chunk, { boundary } = chunk, body = new Chunk(boundary, null, chunk.context, {
|
|
1316
|
+
readyId,
|
|
1317
|
+
parent: chunk.serializeState,
|
|
1318
|
+
resumes: "",
|
|
1319
|
+
writeScopes: {},
|
|
1320
|
+
flushScopes: !1
|
|
1321
|
+
}), bodyEnd = body.render(renderer, input);
|
|
1322
|
+
body === bodyEnd ? (chunk.writeHTML(body.html), body.deferOwnReady(), chunk.deferredReady = push(chunk.deferredReady, body)) : (bodyEnd.next = $chunk = chunk.fork(boundary, chunk.next), chunk.next = body);
|
|
1295
1323
|
}
|
|
1296
1324
|
function _await(scopeId, accessor, promise, content, serializeMarker) {
|
|
1297
1325
|
let resumeMarker = serializeMarker !== 0;
|
|
@@ -1618,8 +1646,20 @@ function depsMarker(deps) {
|
|
|
1618
1646
|
}
|
|
1619
1647
|
return marker;
|
|
1620
1648
|
}
|
|
1621
|
-
function
|
|
1622
|
-
|
|
1649
|
+
function getFilteredGlobals($global) {
|
|
1650
|
+
if (!$global) return 0;
|
|
1651
|
+
let serializedGlobals = $global.serializedGlobals;
|
|
1652
|
+
if (!serializedGlobals) return 0;
|
|
1653
|
+
let filtered = 0;
|
|
1654
|
+
if (Array.isArray(serializedGlobals)) for (let key of serializedGlobals) {
|
|
1655
|
+
let value = $global[key];
|
|
1656
|
+
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1657
|
+
}
|
|
1658
|
+
else for (let key in serializedGlobals) if (serializedGlobals[key]) {
|
|
1659
|
+
let value = $global[key];
|
|
1660
|
+
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1661
|
+
}
|
|
1662
|
+
return filtered;
|
|
1623
1663
|
}
|
|
1624
1664
|
function concatEffects(a, b) {
|
|
1625
1665
|
return a ? b ? a + " " + b : a : b;
|
|
@@ -1641,28 +1681,6 @@ function flushTickQueue() {
|
|
|
1641
1681
|
tickQueue = void 0;
|
|
1642
1682
|
for (let cb of queue) cb(!0);
|
|
1643
1683
|
}
|
|
1644
|
-
function getFilteredGlobals($global) {
|
|
1645
|
-
if (!$global) return 0;
|
|
1646
|
-
let serializedGlobals = $global.serializedGlobals;
|
|
1647
|
-
if (!serializedGlobals) return 0;
|
|
1648
|
-
let filtered = 0;
|
|
1649
|
-
if (Array.isArray(serializedGlobals)) for (let key of serializedGlobals) {
|
|
1650
|
-
let value = $global[key];
|
|
1651
|
-
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1652
|
-
}
|
|
1653
|
-
else for (let key in serializedGlobals) if (serializedGlobals[key]) {
|
|
1654
|
-
let value = $global[key];
|
|
1655
|
-
value !== void 0 && (filtered ? filtered[key] = value : filtered = { [key]: value });
|
|
1656
|
-
}
|
|
1657
|
-
return filtered;
|
|
1658
|
-
}
|
|
1659
|
-
function _subscribe(subscribers, scope) {
|
|
1660
|
-
if (subscribers) {
|
|
1661
|
-
let { serializer } = $chunk.boundary.state;
|
|
1662
|
-
!$chunk.serializeState.readyId && !serializer.written(subscribers) ? subscribers.add(scope) : serializer.writeCall(scope, subscribers, "add", $chunk.serializeState);
|
|
1663
|
-
}
|
|
1664
|
-
return scope;
|
|
1665
|
-
}
|
|
1666
1684
|
//#endregion
|
|
1667
1685
|
//#region src/html/attrs.ts
|
|
1668
1686
|
function _attr_class(value) {
|
|
@@ -1943,9 +1961,11 @@ var ServerRendered = class {
|
|
|
1943
1961
|
case 2:
|
|
1944
1962
|
boundary.onNext = NOOP$1, reject(boundary.signal.reason);
|
|
1945
1963
|
break;
|
|
1946
|
-
case 0:
|
|
1947
|
-
|
|
1964
|
+
case 0: {
|
|
1965
|
+
let consumed = head.consume();
|
|
1966
|
+
boundary.signal.aborted || resolve(consumed.flushHTML());
|
|
1948
1967
|
break;
|
|
1968
|
+
}
|
|
1949
1969
|
}
|
|
1950
1970
|
})();
|
|
1951
1971
|
});
|