marko 6.0.0-next.3.51 → 6.0.0-next.3.53

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/dom.js CHANGED
@@ -43,6 +43,7 @@ __export(dom_exports, {
43
43
  createTemplate: () => createTemplate,
44
44
  data: () => data,
45
45
  dynamicClosure: () => dynamicClosure,
46
+ dynamicClosureRead: () => dynamicClosureRead,
46
47
  dynamicTag: () => dynamicTag,
47
48
  effect: () => effect,
48
49
  forIn: () => forIn,
@@ -66,7 +67,6 @@ __export(dom_exports, {
66
67
  register: () => register,
67
68
  registerBoundSignal: () => registerBoundSignal,
68
69
  registerContent: () => registerContent,
69
- registerDynamicClosure: () => registerDynamicClosure,
70
70
  resetAbortSignal: () => resetAbortSignal,
71
71
  run: () => run,
72
72
  setTagVar: () => setTagVar,
@@ -201,17 +201,17 @@ var DEFAULT_RUNTIME_ID = "M", DEFAULT_RENDER_ID = "_";
201
201
  var registeredValues = {}, Render = class {
202
202
  q = [];
203
203
  s = {};
204
- C = {
204
+ F = {
205
205
  _: registeredValues
206
206
  };
207
207
  constructor(renders, runtimeId, renderId) {
208
- this.D = renders, this.E = runtimeId, this.t = renderId, this.u = renders[renderId], this.x();
208
+ this.G = renders, this.H = runtimeId, this.t = renderId, this.u = renders[renderId], this.x();
209
209
  }
210
210
  w() {
211
211
  this.u.w(), this.x();
212
212
  }
213
213
  x() {
214
- let data2 = this.u, serializeContext = this.C, scopeLookup = this.s, visits = data2.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
214
+ let data2 = this.u, serializeContext = this.F, scopeLookup = this.s, visits = data2.v, branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map();
215
215
  if (visits.length) {
216
216
  let commentPrefixLen = data2.i.length, closestBranchMarkers = /* @__PURE__ */ new Map(), visitNodes = new Set(visits), lastEndNode;
217
217
  data2.v = [];
@@ -227,22 +227,22 @@ var registeredValues = {}, Render = class {
227
227
  let commentText = visit.data, dataIndex = commentText.indexOf(" ") + 1, scopeId = commentText.slice(
228
228
  commentPrefixLen + 1,
229
229
  dataIndex ? dataIndex - 1 : commentText.length
230
- ), scope = scopeLookup[scopeId] ||= { e: +scopeId }, data3 = dataIndex ? commentText.slice(dataIndex) : "", token = commentText[commentPrefixLen];
230
+ ), scope = scopeLookup[scopeId] ||= { d: +scopeId }, data3 = dataIndex ? commentText.slice(dataIndex) : "", token = commentText[commentPrefixLen];
231
231
  if (token === "*" /* Node */) {
232
232
  let node = scope[data3] = visit.previousSibling;
233
233
  scope[data3 + ">" /* Getter */] = () => node;
234
234
  } else if (token === "$" /* ClosestBranch */)
235
235
  closestBranchMarkers.set(scopeId, visit);
236
236
  else if (token === "[" /* BranchStart */)
237
- this.g && (dataIndex && branchEnd(this.g, visit, visit), this.q.push(this.g)), this.g = scopeId, scope.a = visit;
237
+ this.f && (dataIndex && branchEnd(this.f, visit, visit), this.q.push(this.f)), this.f = scopeId, scope.a = visit;
238
238
  else if (token === "]" /* BranchEnd */) {
239
239
  scope[data3] = visit;
240
240
  let curParent = visit.parentNode, startNode = branchEnd(
241
- this.g,
241
+ this.f,
242
242
  visit,
243
243
  visit
244
244
  ).a;
245
- curParent !== startNode.parentNode && curParent.prepend(startNode), this.g = this.q.pop();
245
+ curParent !== startNode.parentNode && curParent.prepend(startNode), this.f = this.q.pop();
246
246
  } else if (token === "|" /* BranchSingleNode */ || token === "=" /* BranchSingleNodeOnlyChildInParent */) {
247
247
  let next = data3.indexOf(" "), curNode = visit;
248
248
  for (scope[~next ? data3.slice(0, next) : data3] = token === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit; ~next; ) {
@@ -263,21 +263,21 @@ var registeredValues = {}, Render = class {
263
263
  let resumeData = resumes[i++];
264
264
  if (typeof resumeData == "function") {
265
265
  let scopes = resumeData(serializeContext), { $global } = scopeLookup;
266
- $global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.E, $global.renderId = this.t, $global.h = 1e6);
266
+ $global || (scopeLookup.$global = $global = scopes.$ || {}, $global.runtimeId = this.H, $global.renderId = this.t, $global.g = 1e6);
267
267
  for (let scopeId in scopes)
268
268
  if (scopeId !== "$") {
269
269
  let scope = scopes[scopeId], prevScope = scopeLookup[scopeId];
270
- scope.$global = $global, scope.e = +scopeId, prevScope !== scope && (scopeLookup[scopeId] = Object.assign(
270
+ scope.$global = $global, scope.d = +scopeId, prevScope !== scope && (scopeLookup[scopeId] = Object.assign(
271
271
  scope,
272
272
  prevScope
273
273
  ));
274
274
  let parentBranchId = parentBranchIds.get(scopeId);
275
275
  if (parentBranchId && (scope.c = scopes[parentBranchId]), branchIds.has(scopeId)) {
276
276
  let branch = scope, parentBranch = branch.c;
277
- scope.c = branch, parentBranch && (branch.y = parentBranch, (parentBranch.o ||= /* @__PURE__ */ new Set()).add(branch));
277
+ scope.c = branch, parentBranch && (branch.y = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch));
278
278
  }
279
279
  }
280
- } else i === len || typeof resumes[i] != "string" ? delete this.D[this.t] : registeredValues[resumes[i++]](
280
+ } else i === len || typeof resumes[i] != "string" ? delete this.G[this.t] : registeredValues[resumes[i++]](
281
281
  scopeLookup[resumeData],
282
282
  scopeLookup[resumeData]
283
283
  );
@@ -713,28 +713,28 @@ function toInsertNode(startNode, endNode) {
713
713
  var pendingScopes = [];
714
714
  function createScope($global, closestBranch) {
715
715
  let scope = {
716
- e: $global.h++,
717
- j: 1,
716
+ d: $global.g++,
717
+ h: 1,
718
718
  c: closestBranch,
719
719
  $global
720
720
  };
721
721
  return pendingScopes.push(scope), scope;
722
722
  }
723
723
  function skipScope(scope) {
724
- return scope.$global.h++;
724
+ return scope.$global.g++;
725
725
  }
726
726
  function finishPendingScopes() {
727
727
  for (let scope of pendingScopes)
728
- scope.j = 0;
728
+ scope.h = 0;
729
729
  pendingScopes = [];
730
730
  }
731
731
  function destroyBranch(branch) {
732
- branch.y?.o?.delete(branch), destroyNestedBranches(branch);
732
+ branch.y?.n?.delete(branch), destroyNestedBranches(branch);
733
733
  }
734
734
  function destroyNestedBranches(branch) {
735
- branch.z = 1, branch.o?.forEach(destroyNestedBranches), branch.F?.forEach((scope) => {
736
- for (let id in scope.l)
737
- scope.l[id]?.abort();
735
+ branch.z = 1, branch.n?.forEach(destroyNestedBranches), branch.I?.forEach((scope) => {
736
+ for (let id in scope.k)
737
+ scope.k[id]?.abort();
738
738
  });
739
739
  }
740
740
  function removeAndDestroyBranch(branch) {
@@ -751,20 +751,20 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
751
751
 
752
752
  // src/dom/queue.ts
753
753
  var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), pendingEffects = [], rendering = !1, scopeKeyOffset = 1e3;
754
- function queueRender(scope, signal, signalKey, value2, scopeKey = scope.e) {
754
+ function queueRender(scope, signal, signalKey, value2, scopeKey = scope.d) {
755
755
  let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
756
756
  if (existingRender)
757
757
  existingRender.A = value2;
758
758
  else {
759
759
  let render = {
760
- k: key,
760
+ j: key,
761
761
  B: scope,
762
- G: signal,
762
+ J: signal,
763
763
  A: value2
764
764
  }, i = pendingRenders.push(render) - 1;
765
765
  for (; i; ) {
766
766
  let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
767
- if (key - parent.k >= 0) break;
767
+ if (key - parent.j >= 0) break;
768
768
  pendingRenders[i] = parent, i = parentIndex;
769
769
  }
770
770
  signalKey >= 0 && pendingRendersLookup.set(key, render), pendingRenders[i] = render;
@@ -803,27 +803,27 @@ function runRenders() {
803
803
  for (; pendingRenders.length; ) {
804
804
  let render = pendingRenders[0], item = pendingRenders.pop();
805
805
  if (render !== item) {
806
- let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).k;
806
+ let i = 0, mid = pendingRenders.length >> 1, key = (pendingRenders[0] = item).j;
807
807
  for (; i < mid; ) {
808
808
  let bestChild = (i << 1) + 1, right = bestChild + 1;
809
- if (right < pendingRenders.length && pendingRenders[right].k - pendingRenders[bestChild].k < 0 && (bestChild = right), pendingRenders[bestChild].k - key >= 0)
809
+ if (right < pendingRenders.length && pendingRenders[right].j - pendingRenders[bestChild].j < 0 && (bestChild = right), pendingRenders[bestChild].j - key >= 0)
810
810
  break;
811
811
  pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
812
812
  }
813
813
  pendingRenders[i] = item;
814
814
  }
815
- render.B.c?.z || render.G(render.B, render.A);
815
+ render.B.c?.z || render.J(render.B, render.A);
816
816
  }
817
817
  finishPendingScopes();
818
818
  }
819
819
 
820
820
  // src/dom/abort-signal.ts
821
821
  function resetAbortSignal(scope, id) {
822
- let ctrl = scope.l?.[id];
823
- ctrl && (queueEffect(ctrl, abort), scope.l[id] = void 0);
822
+ let ctrl = scope.k?.[id];
823
+ ctrl && (queueEffect(ctrl, abort), scope.k[id] = void 0);
824
824
  }
825
825
  function getAbortSignal(scope, id) {
826
- return scope.c && (scope.c.F ||= /* @__PURE__ */ new Set()).add(scope), ((scope.l ||= {})[id] ||= new AbortController()).signal;
826
+ return scope.c && (scope.c.I ||= /* @__PURE__ */ new Set()).add(scope), ((scope.k ||= {})[id] ||= new AbortController()).signal;
827
827
  }
828
828
  function abort(ctrl) {
829
829
  ctrl.abort();
@@ -949,14 +949,29 @@ function walkInternal(currentWalkIndex, walkCodes, scope) {
949
949
  // src/dom/renderer.ts
950
950
  function createBranch($global, renderer, parentScope, parentNode) {
951
951
  let branch = createScope($global), parentBranch = parentScope?.c;
952
- return branch._ = renderer.m || parentScope, branch.c = branch, parentBranch && (branch.y = parentBranch, (parentBranch.o ||= /* @__PURE__ */ new Set()).add(branch)), renderer.p?.(
952
+ return branch._ = renderer.l || parentScope, branch.c = branch, parentBranch && (branch.y = parentBranch, (parentBranch.n ||= /* @__PURE__ */ new Set()).add(branch)), renderer.o?.(
953
953
  branch,
954
954
  parentNode.namespaceURI
955
955
  ), branch;
956
956
  }
957
- function createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
958
- walks = walks ? walks.replace(/[^\0-1]+$/, "") : "";
959
- let args, clone = template ? (branch, ns) => {
957
+ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
958
+ return setupBranch(
959
+ renderer,
960
+ createBranch($global, renderer, parentScope, parentNode)
961
+ );
962
+ }
963
+ function setupBranch(renderer, branch) {
964
+ return (renderer.p || renderer.C) && queueRender(
965
+ branch,
966
+ (branch2) => {
967
+ renderer.p?.(branch2), renderer.C?.(branch2);
968
+ },
969
+ -1
970
+ ), branch;
971
+ }
972
+ function createContent(id, template, walks, setup, params, closures, dynamicScopesAccessor) {
973
+ walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup ||= void 0, params ||= void 0, closures ||= void 0;
974
+ let clone = template ? (branch, ns) => {
960
975
  ((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
961
976
  template,
962
977
  ns
@@ -969,24 +984,31 @@ function createContent(id, template, walks, setup, getArgs, dynamicScopesAccesso
969
984
  );
970
985
  };
971
986
  return (owner) => ({
972
- e: id,
973
- p: clone,
974
- d: setup,
975
- m: owner,
976
- n: dynamicScopesAccessor,
977
- get f() {
978
- return args ||= getArgs ? getArgs() : void 0;
979
- }
987
+ d: id,
988
+ o: clone,
989
+ l: owner,
990
+ p: setup,
991
+ e: params,
992
+ C: closures,
993
+ m: dynamicScopesAccessor
980
994
  });
981
995
  }
982
- function registerContent(id, template, walks, setup, getArgs, dynamicScopesAccessor) {
996
+ function registerContent(id, template, walks, setup, params, closures, dynamicScopesAccessor) {
983
997
  return register(
984
998
  id,
985
- createContent(id, template, walks, setup, getArgs, dynamicScopesAccessor)
999
+ createContent(
1000
+ id,
1001
+ template,
1002
+ walks,
1003
+ setup,
1004
+ params,
1005
+ closures,
1006
+ dynamicScopesAccessor
1007
+ )
986
1008
  );
987
1009
  }
988
- function createRenderer(template, walks, setup, getArgs) {
989
- return createContent("", template, walks, setup, getArgs)();
1010
+ function createRenderer(template, walks, setup, params, closures) {
1011
+ return createContent("", template, walks, setup, params, closures)();
990
1012
  }
991
1013
  var cloneCache = {};
992
1014
  function createCloneableHTML(html2, ns) {
@@ -1040,10 +1062,9 @@ function value(valueAccessor, fn = () => {
1040
1062
  (!(valueAccessor in scope) || scope[valueAccessor] !== value2) && (scope[valueAccessor] = value2, fn(scope, value2));
1041
1063
  };
1042
1064
  }
1043
- var accessorId = 0;
1044
- function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "e") {
1065
+ function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "d") {
1045
1066
  return (scope) => {
1046
- scope.j ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
1067
+ scope.h ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
1047
1068
  };
1048
1069
  }
1049
1070
  function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
@@ -1053,11 +1074,11 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
1053
1074
  ownerScope,
1054
1075
  () => {
1055
1076
  for (let scope of scopes)
1056
- !scope.j && !scope.z && childSignal(scope);
1077
+ !scope.h && !scope.z && childSignal(scope);
1057
1078
  },
1058
1079
  -1,
1059
1080
  0,
1060
- firstScope.e
1081
+ firstScope.d
1061
1082
  );
1062
1083
  };
1063
1084
  return ownerSignal._ = childSignal, ownerSignal;
@@ -1065,7 +1086,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
1065
1086
  function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
1066
1087
  let childSignal = closure(valueAccessor, fn), scopeAccessor = ownerConditionalNodeAccessor + "!" /* ConditionalScope */, branchAccessor = ownerConditionalNodeAccessor + "(" /* ConditionalRenderer */, ownerSignal = (scope) => {
1067
1088
  let ifScope = scope[scopeAccessor];
1068
- ifScope && !ifScope.j && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
1089
+ ifScope && !ifScope.h && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
1069
1090
  };
1070
1091
  return ownerSignal._ = childSignal, ownerSignal;
1071
1092
  }
@@ -1076,24 +1097,29 @@ function subscribeToScopeSet(ownerScope, accessor, scope) {
1076
1097
  () => ownerScope[accessor].delete(scope)
1077
1098
  ));
1078
1099
  }
1079
- function dynamicClosure(valueAccessor, fn, getOwnerScope) {
1080
- let subscribersAccessor = "?" /* Dynamic */ + accessorId++, childSignal = closure(valueAccessor, fn, getOwnerScope), ownerSignal = (ownerScope) => {
1081
- let subscribers = ownerScope[subscribersAccessor];
1082
- if (subscribers)
1083
- for (let subscriber of subscribers)
1084
- subscriber.j || queueRender(subscriber, childSignal, -1);
1085
- }, subscribe = ownerSignal.H = (scope) => subscribeToScopeSet(
1086
- getOwnerScope ? getOwnerScope(scope) : scope._,
1087
- subscribersAccessor,
1088
- scope
1089
- );
1090
- return ownerSignal._ = (scope) => {
1091
- childSignal(scope), subscribe(scope);
1092
- }, ownerSignal;
1100
+ function dynamicClosure(...closureSignals) {
1101
+ let [{ D: ___scopeInstancesAccessor, E: ___signalIndexAccessor }] = closureSignals;
1102
+ for (let i = closureSignals.length; i--; )
1103
+ closureSignals[i].K = i;
1104
+ return (scope) => {
1105
+ if (scope[___scopeInstancesAccessor])
1106
+ for (let childScope of scope[___scopeInstancesAccessor])
1107
+ childScope.h || queueRender(
1108
+ childScope,
1109
+ closureSignals[childScope[___signalIndexAccessor]],
1110
+ -1
1111
+ );
1112
+ };
1093
1113
  }
1094
- function registerDynamicClosure(registryId, valueAccessor, fn, getOwnerScope) {
1095
- let signal = dynamicClosure(valueAccessor, fn, getOwnerScope);
1096
- return register(registryId, signal.H), signal;
1114
+ function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
1115
+ let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = (scope) => {
1116
+ scope[closureSignal.E] = closureSignal.K, childSignal(scope), subscribeToScopeSet(
1117
+ getOwnerScope ? getOwnerScope(scope) : scope._,
1118
+ closureSignal.D,
1119
+ scope
1120
+ );
1121
+ };
1122
+ return closureSignal.D = valueAccessor + "!" /* ClosureScopes */, closureSignal.E = valueAccessor + "(" /* ClosureSignalIndex */, closureSignal;
1097
1123
  }
1098
1124
  function closure(valueAccessor, fn, getOwnerScope) {
1099
1125
  return (scope) => {
@@ -1150,7 +1176,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1150
1176
  let childScopeAccessor = nodeAccessor + "!" /* ConditionalScope */, rendererAccessor = nodeAccessor + "(" /* ConditionalRenderer */;
1151
1177
  return (scope, newRenderer, getInput) => {
1152
1178
  let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
1153
- if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.e || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
1179
+ if (scope[rendererAccessor] !== (scope[rendererAccessor] = normalizedRenderer?.d || normalizedRenderer) || getContent && !(normalizedRenderer || scope[childScopeAccessor]))
1154
1180
  if (setConditionalRenderer(
1155
1181
  scope,
1156
1182
  nodeAccessor,
@@ -1164,15 +1190,15 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1164
1190
  0,
1165
1191
  content,
1166
1192
  createAndSetupBranch
1167
- ), content.n && subscribeToScopeSet(
1193
+ ), content.m && subscribeToScopeSet(
1194
+ content.l,
1168
1195
  content.m,
1169
- content.n,
1170
1196
  scope[childScopeAccessor][0 + "!" /* ConditionalScope */]
1171
1197
  );
1172
1198
  }
1173
- } else normalizedRenderer?.n && subscribeToScopeSet(
1199
+ } else normalizedRenderer?.m && subscribeToScopeSet(
1200
+ normalizedRenderer.l,
1174
1201
  normalizedRenderer.m,
1175
- normalizedRenderer.n,
1176
1202
  scope[childScopeAccessor]
1177
1203
  );
1178
1204
  if (normalizedRenderer) {
@@ -1183,9 +1209,9 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1183
1209
  0,
1184
1210
  (inputIsArgs ? args[0] : args) || {}
1185
1211
  );
1186
- else if (normalizedRenderer.f)
1212
+ else if (normalizedRenderer.e)
1187
1213
  if (inputIsArgs)
1188
- normalizedRenderer.f(
1214
+ normalizedRenderer.e(
1189
1215
  scope[childScopeAccessor],
1190
1216
  normalizedRenderer._ ? args[0] : args
1191
1217
  );
@@ -1194,7 +1220,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1194
1220
  ...args,
1195
1221
  content: getContent(scope)
1196
1222
  } : args || {};
1197
- normalizedRenderer.f(
1223
+ normalizedRenderer.e(
1198
1224
  scope[childScopeAccessor],
1199
1225
  normalizedRenderer._ ? inputWithContent : [inputWithContent]
1200
1226
  );
@@ -1233,7 +1259,7 @@ function loopTo(nodeAccessor, renderer) {
1233
1259
  );
1234
1260
  }
1235
1261
  function loop(nodeAccessor, renderer, forEach) {
1236
- let params = renderer.f;
1262
+ let params = renderer.e;
1237
1263
  return (scope, value2) => {
1238
1264
  let referenceNode = scope[nodeAccessor], oldMap = scope[nodeAccessor + "(" /* LoopScopeMap */], oldArray = oldMap ? scope[nodeAccessor + "!" /* LoopScopeArray */] || [
1239
1265
  ...oldMap.values()
@@ -1246,10 +1272,6 @@ function loop(nodeAccessor, renderer, forEach) {
1246
1272
  referenceNode !== parentNode && (oldArray.length ? (afterReference = oldArray[oldArray.length - 1].b.nextSibling, newArray.length || parentNode.insertBefore(referenceNode, afterReference)) : newArray.length && (afterReference = referenceNode.nextSibling, referenceNode.remove())), reconcile(parentNode, oldArray, newArray, afterReference);
1247
1273
  };
1248
1274
  }
1249
- function createAndSetupBranch($global, renderer, parentScope, parentNode) {
1250
- let branch = createBranch($global, renderer, parentScope, parentNode);
1251
- return renderer.d && queueRender(branch, renderer.d, -1), branch;
1252
- }
1253
1275
  function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentScope, parentNode) {
1254
1276
  let branch = createBranch(
1255
1277
  $global,
@@ -1260,7 +1282,7 @@ function createBranchWithTagNameOrRenderer($global, tagNameOrRenderer, parentSco
1260
1282
  return typeof tagNameOrRenderer == "string" ? branch[0] = branch.a = branch.b = document.createElementNS(
1261
1283
  tagNameOrRenderer === "svg" ? "http://www.w3.org/2000/svg" : tagNameOrRenderer === "math" ? "http://www.w3.org/1998/Math/MathML" : parentNode.namespaceURI,
1262
1284
  tagNameOrRenderer
1263
- ) : tagNameOrRenderer.d && queueRender(branch, tagNameOrRenderer.d, -1), branch;
1285
+ ) : setupBranch(tagNameOrRenderer, branch), branch;
1264
1286
  }
1265
1287
  function bySecondArg(_item, index) {
1266
1288
  return index;
@@ -1282,7 +1304,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1282
1304
  register(RENDERER_REGISTER_ID, fn);
1283
1305
  },
1284
1306
  isRenderer(renderer) {
1285
- return renderer.p;
1307
+ return renderer.o;
1286
1308
  },
1287
1309
  getStartNode(branch) {
1288
1310
  return branch.a;
@@ -1305,9 +1327,9 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1305
1327
  value2.length === 2 && window[runtimeId]?.[componentIdPrefix === "s" ? "_" : componentIdPrefix]?.s[value2[1]]
1306
1328
  ) : value2;
1307
1329
  },
1308
- createRenderer(args, clone) {
1309
- let renderer = createRenderer(0, 0, 0, () => args);
1310
- return renderer.p = (branch) => {
1330
+ createRenderer(params, clone) {
1331
+ let renderer = createRenderer(0, 0, 0, params);
1332
+ return renderer.o = (branch) => {
1311
1333
  let cloned = clone();
1312
1334
  branch.a = cloned.startNode, branch.b = cloned.endNode;
1313
1335
  }, renderer;
@@ -1322,12 +1344,12 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1322
1344
  normalizedInput[key === "renderBody" ? "content" : key] = input[key];
1323
1345
  }
1324
1346
  if (component.effects = prepareEffects(() => {
1325
- branch ? existing = !0 : (out.global.h ||= 0, branch = component.scope = createBranch(
1347
+ branch ? existing = !0 : (out.global.g ||= 0, branch = component.scope = createAndSetupBranch(
1326
1348
  out.global,
1327
1349
  renderer,
1328
- renderer.m,
1350
+ renderer.l,
1329
1351
  document.body
1330
- ), renderer.d && renderer.d(branch)), renderer.f?.(branch, renderer._ ? args[0] : args);
1352
+ )), renderer.e?.(branch, renderer._ ? args[0] : args);
1331
1353
  }), !existing)
1332
1354
  return toInsertNode(branch.a, branch.b);
1333
1355
  }
@@ -1340,19 +1362,19 @@ var createTemplate = (id, template, walks, setup, inputSignal) => {
1340
1362
  template,
1341
1363
  walks,
1342
1364
  setup,
1343
- inputSignal && (() => inputSignal)
1365
+ inputSignal
1344
1366
  )();
1345
1367
  return renderer.mount = mount, renderer._ = renderer, register(id, renderer);
1346
1368
  };
1347
1369
  function mount(input = {}, reference, position) {
1348
1370
  let branch, parentNode = reference, nextSibling = null, { $global } = input;
1349
1371
  switch ($global ? ({ $global, ...input } = input, $global = {
1350
- h: 0,
1372
+ g: 0,
1351
1373
  runtimeId: DEFAULT_RUNTIME_ID,
1352
1374
  renderId: DEFAULT_RENDER_ID,
1353
1375
  ...$global
1354
1376
  }) : $global = {
1355
- h: 0,
1377
+ g: 0,
1356
1378
  runtimeId: DEFAULT_RUNTIME_ID,
1357
1379
  renderId: DEFAULT_RENDER_ID
1358
1380
  }, position) {
@@ -1366,13 +1388,13 @@ function mount(input = {}, reference, position) {
1366
1388
  parentNode = reference.parentNode, nextSibling = reference.nextSibling;
1367
1389
  break;
1368
1390
  }
1369
- let args = this.f, effects = prepareEffects(() => {
1391
+ let args = this.e, effects = prepareEffects(() => {
1370
1392
  branch = createBranch(
1371
1393
  $global,
1372
1394
  this,
1373
1395
  void 0,
1374
1396
  parentNode
1375
- ), this.d && this.d(branch), args && args(branch, input);
1397
+ ), this.p?.(branch), args?.(branch, input);
1376
1398
  });
1377
1399
  return insertChildNodes(
1378
1400
  parentNode,