marko 6.0.60 → 6.0.62

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
@@ -17,87 +17,88 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0
17
17
  // src/dom.ts
18
18
  var dom_exports = {};
19
19
  __export(dom_exports, {
20
- attr: () => attr,
20
+ $signal: () => $signal,
21
+ $signalReset: () => $signalReset,
22
+ _attr: () => _attr,
23
+ _attr_class: () => _attr_class,
24
+ _attr_class_item: () => _attr_class_item,
25
+ _attr_class_items: () => _attr_class_items,
26
+ _attr_content: () => _attr_content,
27
+ _attr_details_open: () => _attr_details_or_dialog_open,
28
+ _attr_details_open_script: () => _attr_details_or_dialog_open_script,
29
+ _attr_dialog_open: () => _attr_details_or_dialog_open,
30
+ _attr_dialog_open_script: () => _attr_details_or_dialog_open_script,
31
+ _attr_input_checked: () => _attr_input_checked,
32
+ _attr_input_checkedValue: () => _attr_input_checkedValue,
33
+ _attr_input_checkedValue_script: () => _attr_input_checkedValue_script,
34
+ _attr_input_checked_script: () => _attr_input_checked_script,
35
+ _attr_input_value: () => _attr_input_value,
36
+ _attr_input_value_script: () => _attr_input_value_script,
37
+ _attr_select_value: () => _attr_select_value,
38
+ _attr_select_value_script: () => _attr_select_value_script,
39
+ _attr_style: () => _attr_style,
40
+ _attr_style_item: () => _attr_style_item,
41
+ _attr_style_items: () => _attr_style_items,
42
+ _attr_textarea_value: () => _attr_input_value,
43
+ _attr_textarea_value_script: () => _attr_input_value_script,
44
+ _attrs: () => _attrs,
45
+ _attrs_content: () => _attrs_content,
46
+ _attrs_partial: () => _attrs_partial,
47
+ _attrs_partial_content: () => _attrs_partial_content,
48
+ _attrs_script: () => _attrs_script,
49
+ _await: () => _await,
50
+ _closure: () => _closure,
51
+ _closure_get: () => _closure_get,
52
+ _const: () => _const,
53
+ _content: () => _content,
54
+ _content_branch: () => _content_branch,
55
+ _content_closures: () => _content_closures,
56
+ _content_resume: () => _content_resume,
57
+ _dynamic_tag: () => _dynamic_tag,
58
+ _el: () => _el,
59
+ _enable_catch: () => _enable_catch,
60
+ _for_closure: () => _for_closure,
61
+ _for_in: () => _for_in,
62
+ _for_of: () => _for_of,
63
+ _for_to: () => _for_to,
64
+ _hoist: () => _hoist,
65
+ _html: () => _html,
66
+ _id: () => _id,
67
+ _if: () => _if,
68
+ _if_closure: () => _if_closure,
69
+ _let: () => _let,
70
+ _lifecycle: () => _lifecycle,
71
+ _on: () => _on,
72
+ _or: () => _or,
73
+ _resume: () => _resume,
74
+ _return: () => _return,
75
+ _return_change: () => _return_change,
76
+ _script: () => _script,
77
+ _template: () => _template,
78
+ _text: () => _text,
79
+ _text_content: () => _text_content,
80
+ _try: () => _try,
81
+ _var: () => _var,
82
+ _var_change: () => _var_change,
83
+ _var_resume: () => _var_resume,
21
84
  attrTag: () => attrTag,
22
85
  attrTags: () => attrTags,
23
- attrs: () => attrs,
24
- attrsAndContent: () => attrsAndContent,
25
- attrsEvents: () => attrsEvents,
26
- awaitTag: () => awaitTag,
27
- classAttr: () => classAttr,
28
- classItem: () => classItem,
29
- classItems: () => classItems,
30
86
  compat: () => compat,
31
- conditional: () => conditional,
32
- conditionalClosure: () => conditionalClosure,
33
- controllable_detailsOrDialog_open: () => controllable_detailsOrDialog_open,
34
- controllable_detailsOrDialog_open_effect: () => controllable_detailsOrDialog_open_effect,
35
- controllable_input_checked: () => controllable_input_checked,
36
- controllable_input_checkedValue: () => controllable_input_checkedValue,
37
- controllable_input_checkedValue_effect: () => controllable_input_checkedValue_effect,
38
- controllable_input_checked_effect: () => controllable_input_checked_effect,
39
- controllable_input_value: () => controllable_input_value,
40
- controllable_input_value_effect: () => controllable_input_value_effect,
41
- controllable_select_value: () => controllable_select_value,
42
- controllable_select_value_effect: () => controllable_select_value_effect,
43
- controllable_textarea_value: () => controllable_input_value,
44
- controllable_textarea_value_effect: () => controllable_input_value_effect,
45
- createContent: () => createContent,
46
- createRenderer: () => createRenderer,
47
- createTemplate: () => createTemplate,
48
- createTry: () => createTry,
49
- data: () => data,
50
- dynamicClosure: () => dynamicClosure,
51
- dynamicClosureRead: () => dynamicClosureRead,
52
- dynamicTag: () => dynamicTag,
53
- effect: () => effect,
54
- enableCatch: () => enableCatch,
55
87
  forIn: () => forIn,
56
88
  forOf: () => forOf,
57
89
  forTo: () => forTo,
58
- getAbortSignal: () => getAbortSignal,
59
- hoist: () => hoist,
60
- html: () => html,
61
90
  init: () => init,
62
- insertContent: () => insertContent,
63
- intersection: () => intersection,
64
- lifecycle: () => lifecycle,
65
- localClosures: () => localClosures,
66
- loopClosure: () => loopClosure,
67
- loopIn: () => loopIn,
68
- loopOf: () => loopOf,
69
- loopTo: () => loopTo,
70
- nextTagId: () => nextTagId,
71
- nodeRef: () => nodeRef,
72
- on: () => on,
73
- partialAttrs: () => partialAttrs,
74
- partialAttrsAndContent: () => partialAttrsAndContent,
75
- props: () => props,
76
- register: () => register,
77
- registerBoundSignal: () => registerBoundSignal,
78
- registerContent: () => registerContent,
79
- resetAbortSignal: () => resetAbortSignal,
80
- run: () => run,
81
- setTagVar: () => setTagVar,
82
- setTagVarChange: () => setTagVarChange,
83
- state: () => state,
84
- styleAttr: () => styleAttr,
85
- styleItem: () => styleItem,
86
- styleItems: () => styleItems,
87
- tagVarSignal: () => tagVarSignal,
88
- tagVarSignalChange: () => tagVarSignalChange,
89
- textContent: () => textContent,
90
- value: () => value
91
+ run: () => run
91
92
  });
92
93
  module.exports = __toCommonJS(dom_exports);
93
94
 
94
95
  // src/common/attr-tag.ts
95
96
  var empty = [], rest = Symbol();
96
- function attrTag(attrs2) {
97
- return attrs2[Symbol.iterator] = attrTagIterator, attrs2[rest] = empty, attrs2;
97
+ function attrTag(attrs) {
98
+ return attrs[Symbol.iterator] = attrTagIterator, attrs[rest] = empty, attrs;
98
99
  }
99
- function attrTags(first, attrs2) {
100
- return first ? (first[rest] === empty ? first[rest] = [attrs2] : first[rest].push(attrs2), first) : attrTag(attrs2);
100
+ function attrTags(first, attrs) {
101
+ return first ? (first[rest] === empty ? first[rest] = [attrs] : first[rest].push(attrs), first) : attrTag(attrs);
101
102
  }
102
103
  function* attrTagIterator() {
103
104
  yield this, yield* this[rest];
@@ -125,14 +126,14 @@ function forTo(to, from, step, cb) {
125
126
  function classValue(classValue2) {
126
127
  return toDelimitedString(classValue2, " ", stringifyClassObject);
127
128
  }
128
- function stringifyClassObject(name, value2) {
129
- return value2 ? name : "";
129
+ function stringifyClassObject(name, value) {
130
+ return value ? name : "";
130
131
  }
131
132
  function styleValue(styleValue2) {
132
133
  return toDelimitedString(styleValue2, ";", stringifyStyleObject);
133
134
  }
134
- function stringifyStyleObject(name, value2) {
135
- return value2 || value2 === 0 ? name + ":" + value2 : "";
135
+ function stringifyStyleObject(name, value) {
136
+ return value || value === 0 ? name + ":" + value : "";
136
137
  }
137
138
  function toDelimitedString(val, delimiter, stringify) {
138
139
  let str = "", sep = "", part;
@@ -153,13 +154,13 @@ function isEventHandler(name) {
153
154
  function getEventHandlerName(name) {
154
155
  return name[2] === "-" ? name.slice(3) : name.slice(2).toLowerCase();
155
156
  }
156
- function normalizeDynamicRenderer(value2) {
157
- return value2 ? value2.content || value2.default || value2 : void 0;
157
+ function normalizeDynamicRenderer(value) {
158
+ return value ? value.content || value.default || value : void 0;
158
159
  }
159
160
 
160
161
  // src/dom/event.ts
161
162
  var defaultDelegator = createDelegator();
162
- function on(element, type, handler) {
163
+ function _on(element, type, handler) {
163
164
  element["$" + type] === void 0 && defaultDelegator(element, type, handleDelegated), element["$" + type] = handler || null;
164
165
  }
165
166
  function createDelegator() {
@@ -251,36 +252,36 @@ function walk(startNode, walkCodes, branch) {
251
252
  walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
252
253
  }
253
254
  function walkInternal(currentWalkIndex, walkCodes, scope) {
254
- let value2, storedMultiplier = 0, currentMultiplier = 0, currentScopeIndex = 0;
255
+ let value, storedMultiplier = 0, currentMultiplier = 0, currentScopeIndex = 0;
255
256
  for (; currentWalkIndex < walkCodes.length; )
256
- if (value2 = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value2 === 32 /* Get */) {
257
+ if (value = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value === 32 /* Get */) {
257
258
  let node = walker.currentNode;
258
259
  scope[currentScopeIndex] = node, scope["j" /* Getter */ + currentScopeIndex++] = () => node;
259
- } else if (value2 === 37 /* Replace */ || value2 === 49 /* DynamicTagWithVar */)
260
+ } else if (value === 37 /* Replace */ || value === 49 /* DynamicTagWithVar */)
260
261
  walker.currentNode.replaceWith(
261
262
  walker.currentNode = scope[currentScopeIndex++] = new Text()
262
- ), value2 === 49 /* DynamicTagWithVar */ && (scope[currentScopeIndex++] = skipScope(scope));
263
+ ), value === 49 /* DynamicTagWithVar */ && (scope[currentScopeIndex++] = skipScope(scope));
263
264
  else {
264
- if (value2 === 38 /* EndChild */)
265
+ if (value === 38 /* EndChild */)
265
266
  return currentWalkIndex;
266
- if (value2 === 47 /* BeginChild */ || value2 === 48 /* BeginChildWithVar */)
267
+ if (value === 47 /* BeginChild */ || value === 48 /* BeginChildWithVar */)
267
268
  currentWalkIndex = walkInternal(
268
269
  currentWalkIndex,
269
270
  walkCodes,
270
271
  scope[currentScopeIndex++] = createScope(scope.$global, scope.k)
271
- ), value2 === 48 /* BeginChildWithVar */ && (scope[currentScopeIndex++] = skipScope(scope));
272
- else if (value2 < 92)
273
- for (value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */; value2--; )
272
+ ), value === 48 /* BeginChildWithVar */ && (scope[currentScopeIndex++] = skipScope(scope));
273
+ else if (value < 92)
274
+ for (value = 20 /* Next */ * currentMultiplier + value - 67 /* Next */; value--; )
274
275
  walker.nextNode();
275
- else if (value2 < 107)
276
- for (value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */; value2--; )
276
+ else if (value < 107)
277
+ for (value = 10 /* Over */ * currentMultiplier + value - 97 /* Over */; value--; )
277
278
  walker.nextSibling();
278
- else if (value2 < 117) {
279
- for (value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */; value2--; )
279
+ else if (value < 117) {
280
+ for (value = 10 /* Out */ * currentMultiplier + value - 107 /* Out */; value--; )
280
281
  walker.parentNode();
281
282
  walker.nextSibling();
282
283
  } else
283
- storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
284
+ storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value - 117 /* Multiplier */;
284
285
  }
285
286
  }
286
287
 
@@ -293,59 +294,50 @@ function init(runtimeId = "M") {
293
294
  let renders = self[runtimeId], defineRuntime = (desc) => Object.defineProperty(self, runtimeId, desc), resumeRender, initRuntime = (renders2) => {
294
295
  defineRuntime({
295
296
  value: resumeRender = ((renderId) => {
296
- let render = resumeRender[renderId] = renders2[renderId] || renders2(renderId), walk2 = render.w, commentPrefixLen = render.i.length, scopeLookup = render.s = {}, serializeContext = {
297
+ let render = resumeRender[renderId] = renders2[renderId] || renders2(renderId), walk2 = render.w, scopeLookup = render.s = {}, serializeContext = {
297
298
  _: registeredValues
298
299
  }, branches = branchesEnabled && /* @__PURE__ */ (() => {
299
- let branchStack = [], branchIds = /* @__PURE__ */ new Set(), parentBranchIds = /* @__PURE__ */ new Map(), lastEndNode, currentBranchId, endBranch = (branchId, reference) => {
300
- let branch = scopeLookup[branchId] ||= {}, endNode = reference, prevNode;
301
- for (; (prevNode = endNode.previousSibling) !== branch.h && ~visits.indexOf(endNode = prevNode); ) ;
302
- return branch.j = lastEndNode = endNode === lastEndNode ? reference.parentNode.insertBefore(new Text(), reference) : endNode, branch.h ||= lastEndNode, branchIds.add(branchId), branch;
300
+ let branchParents = /* @__PURE__ */ new Map(), branchStarts = [], orphanBranches = [], endBranch = (singleNode) => {
301
+ let parent = visit.parentNode, startVisit = visit, i = orphanBranches.length, claimed = 0, branchId, branch;
302
+ for (; branchId = +lastToken; ) {
303
+ if (branch = scopeLookup[branchId] ||= {}, singleNode) {
304
+ for (; startVisit.previousSibling && ~visits.indexOf(
305
+ startVisit = startVisit.previousSibling
306
+ ); ) ;
307
+ branch.j = branch.h = startVisit, visitType === "'" /* BranchEndNativeTag */ && (branch[0] = startVisit);
308
+ } else
309
+ startVisit = branchStarts.pop(), parent !== startVisit.parentNode && parent.prepend(startVisit), branch.h = startVisit, branch.j = visit.previousSibling === startVisit ? startVisit : parent.insertBefore(new Text(), visit);
310
+ for (; i-- && orphanBranches[i] > branchId; )
311
+ branchParents.set(orphanBranches[i], branchId), claimed++;
312
+ orphanBranches.push(branchId), branchParents.set(branchId, 0), nextToken();
313
+ }
314
+ orphanBranches.splice(i, claimed);
303
315
  };
304
316
  return {
305
317
  K() {
306
- if (visitToken === "[" /* BranchStart */)
307
- currentBranchId && visitDataIndex && (endBranch(currentBranchId, visit), currentBranchId = branchStack.pop()), currentBranchId && (branchStack.push(currentBranchId), parentBranchIds.set(scopeId, currentBranchId)), currentBranchId = scopeId, visitScope.h = visit;
308
- else if (visitToken === "]" /* BranchEnd */) {
309
- let curParent = visit.parentNode, startNode = endBranch(
310
- currentBranchId,
311
- visit
312
- ).h;
313
- visitScope[visitData] = visit, curParent !== startNode.parentNode && curParent.prepend(startNode), currentBranchId = branchStack.pop();
314
- } else {
315
- let next = visitData.indexOf(" "), curNode = visit;
316
- for (visitScope[~next ? visitData.slice(0, next) : visitData] = visitToken === "=" /* BranchSingleNodeOnlyChildInParent */ ? visit.parentNode : visit; ~next; ) {
317
- let start = next + 1;
318
- next = visitData.indexOf(" ", start);
319
- let childScopeId = +visitData.slice(
320
- start,
321
- ~next ? next : visitData.length
322
- );
323
- if (curNode = endBranch(childScopeId, curNode).j, parentBranchIds.set(childScopeId, scopeId), visitToken === "'" /* BranchNativeTag */) {
324
- let childBranch = scopeLookup[childScopeId];
325
- childBranch[0] = childBranch.h = childBranch.j = curNode;
326
- }
327
- }
328
- }
318
+ visitType === "[" /* BranchStart */ ? (endBranch(), branchStarts.push(visit)) : (visitScope[
319
+ nextToken()
320
+ /* read accessor */
321
+ ] = visitType === ")" /* BranchEndOnlyChildInParent */ || visitType === "}" /* BranchEndSingleNodeOnlyChildInParent */ ? visit.parentNode : visit, nextToken(), endBranch(
322
+ visitType !== "]" /* BranchEnd */ && visitType !== ")" /* BranchEndOnlyChildInParent */
323
+ ));
329
324
  },
330
325
  t(scope) {
331
- let parentBranchId = scope.g || parentBranchIds.get(scopeId);
332
- if (parentBranchId && (scope.k = scopeLookup[parentBranchId]), branchIds.has(scopeId)) {
333
- let branch = scope, parentBranch = branch.k;
334
- scope.k = branch, parentBranch && (branch.y = parentBranch, (parentBranch.A ||= /* @__PURE__ */ new Set()).add(branch));
335
- }
326
+ scope.k = scopeLookup[scope.g || branchParents.get(scopeId)], branchParents.has(scopeId) && (scope.k && ((scope.y = scope.k).A ||= /* @__PURE__ */ new Set()).add(scope), scope.k = scope);
336
327
  }
337
328
  };
338
- })(), $global, lastScopeId = 0, lastEffect, visits, resumes, scopeId, visit, visitText, visitData, visitDataIndex, visitToken, visitScope;
329
+ })(), $global, lastScopeId = 0, lastEffect, visits, resumes, scopeId, visit, visitText, visitType, visitScope, lastToken, lastTokenIndex, nextToken = () => lastToken = visitText.slice(
330
+ lastTokenIndex,
331
+ // eslint-disable-next-line no-cond-assign
332
+ (lastTokenIndex = visitText.indexOf(" ", lastTokenIndex) + 1) ? lastTokenIndex - 1 : visitText.length
333
+ );
339
334
  return render.w = () => {
340
335
  try {
341
336
  walk2(), isResuming = 1;
342
337
  for (visit of visits = render.v)
343
- visitText = visit.data, visitDataIndex = visitText.indexOf(" ") + 1, scopeId = +visitText.slice(
344
- commentPrefixLen + 1,
345
- visitDataIndex ? visitDataIndex - 1 : visitText.length
346
- ), visitData = visitDataIndex ? visitText.slice(visitDataIndex) : "", visitToken = visitText[commentPrefixLen], visitScope = scopeLookup[scopeId] ||= {
338
+ lastTokenIndex = render.i.length, visitText = visit.data, visitType = visitText[lastTokenIndex++], (scopeId = +nextToken()) && (visitScope = scopeLookup[scopeId] ||= {
347
339
  l: scopeId
348
- }, visitToken === "*" /* Node */ ? visitScope["j" /* Getter */ + visitData] = /* @__PURE__ */ ((node) => () => node)(visitScope[visitData] = visit.previousSibling) : branches && branches.K();
340
+ }), visitType === "*" /* Node */ ? visitScope["j" /* Getter */ + nextToken()] = /* @__PURE__ */ ((node) => () => node)(visitScope[lastToken] = visit.previousSibling) : branchesEnabled && branches.K();
349
341
  for (let serialized of resumes = render.r || [])
350
342
  if (typeof serialized == "string")
351
343
  lastEffect = serialized;
@@ -361,7 +353,7 @@ function init(runtimeId = "M") {
361
353
  $global ? typeof scope == "number" ? lastScopeId += scope : (scopeId = ++lastScopeId, scope.$global = $global, scope.l = scopeId, scopeLookup[scopeId] !== scope && (scopeLookup[scopeId] = Object.assign(
362
354
  scope,
363
355
  scopeLookup[scopeId]
364
- )), branches && branches.t(scope)) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId, $global.p = 1e6);
356
+ )), branchesEnabled && branches.t(scope)) : ($global = scope || {}, $global.runtimeId = runtimeId, $global.renderId = renderId, $global.p = 1e6);
365
357
  } finally {
366
358
  isResuming = visits.length = resumes.length = 0;
367
359
  }
@@ -380,22 +372,22 @@ function init(runtimeId = "M") {
380
372
  });
381
373
  }
382
374
  var isResuming;
383
- function register(id, obj) {
375
+ function _resume(id, obj) {
384
376
  return registeredValues[id] = obj, obj;
385
377
  }
386
- function registerBoundSignal(id, signal) {
387
- return registeredValues[id] = (scope) => (value2) => signal(scope, value2), signal;
378
+ function _var_resume(id, signal) {
379
+ return registeredValues[id] = (scope) => (value) => signal(scope, value), signal;
388
380
  }
389
381
  function getRegisteredWithScope(id, scope) {
390
382
  let val = registeredValues[id];
391
383
  return scope ? val(scope) : val;
392
384
  }
393
- function nodeRef(id, key) {
394
- return register(id, (scope) => () => scope[key]());
385
+ function _el(id, key) {
386
+ return _resume(id, (scope) => () => scope[key]());
395
387
  }
396
388
 
397
389
  // src/dom/controllable.ts
398
- function controllable_input_checked(scope, nodeAccessor, checked, checkedChange) {
390
+ function _attr_input_checked(scope, nodeAccessor, checked, checkedChange) {
399
391
  setCheckboxValue(
400
392
  scope,
401
393
  nodeAccessor,
@@ -404,7 +396,7 @@ function controllable_input_checked(scope, nodeAccessor, checked, checkedChange)
404
396
  checkedChange
405
397
  );
406
398
  }
407
- function controllable_input_checked_effect(scope, nodeAccessor) {
399
+ function _attr_input_checked_script(scope, nodeAccessor) {
408
400
  let el = scope[nodeAccessor];
409
401
  syncControllable(el, "input", hasCheckboxChanged, () => {
410
402
  let checkedChange = scope["e" /* ControlledHandler */ + nodeAccessor];
@@ -414,16 +406,16 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
414
406
  }
415
407
  });
416
408
  }
417
- function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
418
- scope["g" /* ControlledValue */ + nodeAccessor] = checkedValue, attr(scope[nodeAccessor], "value", value2), setCheckboxValue(
409
+ function _attr_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value) {
410
+ scope["g" /* ControlledValue */ + nodeAccessor] = checkedValue, _attr(scope[nodeAccessor], "value", value), setCheckboxValue(
419
411
  scope,
420
412
  nodeAccessor,
421
413
  1 /* InputCheckedValue */,
422
- Array.isArray(checkedValue) ? checkedValue.includes(value2) : checkedValue === value2,
414
+ Array.isArray(checkedValue) ? checkedValue.includes(value) : checkedValue === value,
423
415
  checkedValueChange
424
416
  );
425
417
  }
426
- function controllable_input_checkedValue_effect(scope, nodeAccessor) {
418
+ function _attr_input_checkedValue_script(scope, nodeAccessor) {
427
419
  let el = scope[nodeAccessor];
428
420
  syncControllable(el, "input", hasCheckboxChanged, () => {
429
421
  let checkedValueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
@@ -440,11 +432,11 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
440
432
  }
441
433
  });
442
434
  }
443
- function controllable_input_value(scope, nodeAccessor, value2, valueChange) {
444
- let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value2);
445
- scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 0 /* InputChecked */, scope["g" /* ControlledValue */ + nodeAccessor] = value2, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
435
+ function _attr_input_value(scope, nodeAccessor, value, valueChange) {
436
+ let el = scope[nodeAccessor], normalizedValue = normalizeStrProp(value);
437
+ scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 0 /* InputChecked */, scope["g" /* ControlledValue */ + nodeAccessor] = value, el.isConnected ? setValueAndUpdateSelection(el, normalizedValue) : el.defaultValue = normalizedValue) : (scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, el.defaultValue = normalizedValue);
446
438
  }
447
- function controllable_input_value_effect(scope, nodeAccessor) {
439
+ function _attr_input_value_script(scope, nodeAccessor) {
448
440
  let el = scope[nodeAccessor];
449
441
  isResuming && (scope["g" /* ControlledValue */ + nodeAccessor] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
450
442
  let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
@@ -454,17 +446,17 @@ function controllable_input_value_effect(scope, nodeAccessor) {
454
446
  ), inputType = "");
455
447
  });
456
448
  }
457
- function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
458
- scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 3 /* SelectValue */, scope["g" /* ControlledValue */ + nodeAccessor] = value2) : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, pendingEffects.unshift(
449
+ function _attr_select_value(scope, nodeAccessor, value, valueChange) {
450
+ scope["e" /* ControlledHandler */ + nodeAccessor] = valueChange, valueChange ? (scope["f" /* ControlledType */ + nodeAccessor] = 3 /* SelectValue */, scope["g" /* ControlledValue */ + nodeAccessor] = value) : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, pendingEffects.unshift(
459
451
  () => setSelectOptions(
460
452
  scope[nodeAccessor],
461
- value2,
453
+ value,
462
454
  valueChange
463
455
  ),
464
456
  scope
465
457
  );
466
458
  }
467
- function controllable_select_value_effect(scope, nodeAccessor) {
459
+ function _attr_select_value_script(scope, nodeAccessor) {
468
460
  let el = scope[nodeAccessor], onChange = () => {
469
461
  let valueChange = scope["e" /* ControlledHandler */ + nodeAccessor];
470
462
  if (valueChange) {
@@ -479,21 +471,21 @@ function controllable_select_value_effect(scope, nodeAccessor) {
479
471
  }
480
472
  };
481
473
  el._ || new MutationObserver(() => {
482
- let value2 = scope["g" /* ControlledValue */ + nodeAccessor];
483
- (Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) && onChange();
474
+ let value = scope["g" /* ControlledValue */ + nodeAccessor];
475
+ (Array.isArray(value) ? value.length !== el.selectedOptions.length || value.some((value2, i) => value2 != el.selectedOptions[i].value) : el.value != value) && onChange();
484
476
  }).observe(el, {
485
477
  childList: !0,
486
478
  subtree: !0
487
479
  }), syncControllable(el, "input", hasSelectChanged, onChange);
488
480
  }
489
- function setSelectOptions(el, value2, valueChange) {
490
- if (Array.isArray(value2))
481
+ function setSelectOptions(el, value, valueChange) {
482
+ if (Array.isArray(value))
491
483
  for (let opt of el.options) {
492
- let selected = value2.includes(opt.value);
484
+ let selected = value.includes(opt.value);
493
485
  valueChange ? opt.selected = selected : opt.defaultSelected = selected;
494
486
  }
495
487
  else {
496
- let normalizedValue = normalizeStrProp(value2);
488
+ let normalizedValue = normalizeStrProp(value);
497
489
  if (valueChange)
498
490
  el.value = normalizedValue;
499
491
  else
@@ -501,10 +493,10 @@ function setSelectOptions(el, value2, valueChange) {
501
493
  opt.defaultSelected = opt.value === normalizedValue;
502
494
  }
503
495
  }
504
- function controllable_detailsOrDialog_open(scope, nodeAccessor, open, openChange) {
496
+ function _attr_details_or_dialog_open(scope, nodeAccessor, open, openChange) {
505
497
  scope["e" /* ControlledHandler */ + nodeAccessor] = openChange, openChange ? scope["f" /* ControlledType */ + nodeAccessor] = 4 /* DetailsOrDialogOpen */ : scope["f" /* ControlledType */ + nodeAccessor] = 5 /* None */, scope[nodeAccessor].open = scope["g" /* ControlledValue */ + nodeAccessor] = normalizeBoolProp(open);
506
498
  }
507
- function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
499
+ function _attr_details_or_dialog_open_script(scope, nodeAccessor) {
508
500
  let el = scope[nodeAccessor], hasChanged = () => el.open !== scope["g" /* ControlledValue */ + nodeAccessor];
509
501
  syncControllable(
510
502
  el,
@@ -520,13 +512,13 @@ function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
520
512
  );
521
513
  }
522
514
  var inputType = "";
523
- function setValueAndUpdateSelection(el, value2) {
524
- if (el.value !== value2) {
515
+ function setValueAndUpdateSelection(el, value) {
516
+ if (el.value !== value) {
525
517
  let updatedPosition = resolveCursorPosition(
526
518
  inputType,
527
519
  el.getRootNode().activeElement === el && el.selectionStart,
528
520
  el.value,
529
- el.value = value2
521
+ el.value = value
530
522
  );
531
523
  ~updatedPosition && el.setSelectionRange(updatedPosition, updatedPosition);
532
524
  }
@@ -565,11 +557,11 @@ function hasSelectChanged(el) {
565
557
  function hasFormElementChanged(el) {
566
558
  return el.options ? hasSelectChanged(el) : hasValueChanged(el) || hasCheckboxChanged(el);
567
559
  }
568
- function normalizeStrProp(value2) {
569
- return normalizeAttrValue(value2) || "";
560
+ function normalizeStrProp(value) {
561
+ return normalizeAttrValue(value) || "";
570
562
  }
571
- function normalizeBoolProp(value2) {
572
- return value2 != null && value2 !== !1;
563
+ function normalizeBoolProp(value) {
564
+ return value != null && value !== !1;
573
565
  }
574
566
  function updateList(arr, val, push) {
575
567
  let index = arr.indexOf(val);
@@ -581,9 +573,9 @@ function toValueProp(it) {
581
573
 
582
574
  // src/dom/parse-html.ts
583
575
  var parsers = {};
584
- function parseHTML(html2, ns) {
576
+ function parseHTML(html, ns) {
585
577
  let parser = parsers[ns] ||= document.createElementNS(ns, "template");
586
- return parser.innerHTML = html2, parser.content || parser;
578
+ return parser.innerHTML = html, parser.content || parser;
587
579
  }
588
580
 
589
581
  // src/dom/schedule.ts
@@ -601,31 +593,31 @@ function triggerMacroTask() {
601
593
  }
602
594
 
603
595
  // src/dom/signals.ts
604
- function state(valueAccessor, fn) {
596
+ function _let(valueAccessor, fn) {
605
597
  if (0)
606
598
  var id;
607
- let valueChangeAccessor = "o" /* TagVariableChange */ + valueAccessor, update = (scope, value2) => {
608
- scope[valueAccessor] !== value2 && (scope[valueAccessor] = value2, fn(scope, value2));
599
+ let valueChangeAccessor = "o" /* TagVariableChange */ + valueAccessor, update = (scope, value) => {
600
+ scope[valueAccessor] !== value && (scope[valueAccessor] = value, fn(scope, value));
609
601
  };
610
- return (scope, value2, valueChange) => (rendering ? ((scope[valueChangeAccessor] = valueChange) && scope[valueAccessor] !== value2 || !(valueAccessor in scope)) && (scope[valueAccessor] = value2, fn(scope, value2)) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value2) : (schedule(), queueRender(
602
+ return (scope, value, valueChange) => (rendering ? ((scope[valueChangeAccessor] = valueChange) && scope[valueAccessor] !== value || !(valueAccessor in scope)) && (scope[valueAccessor] = value, fn(scope, value)) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](value) : (schedule(), queueRender(
611
603
  scope,
612
604
  update,
613
605
  valueAccessor,
614
- value2
615
- )), value2);
606
+ value
607
+ )), value);
616
608
  }
617
- function value(valueAccessor, fn = () => {
609
+ function _const(valueAccessor, fn = () => {
618
610
  }) {
619
- return (scope, value2) => {
620
- (!(valueAccessor in scope) || scope[valueAccessor] !== value2) && (scope[valueAccessor] = value2, fn(scope, value2));
611
+ return (scope, value) => {
612
+ (!(valueAccessor in scope) || scope[valueAccessor] !== value) && (scope[valueAccessor] = value, fn(scope, value));
621
613
  };
622
614
  }
623
- function intersection(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "l") {
615
+ function _or(id, fn, defaultPending = 1, scopeIdAccessor = /* @__KEY__ */ "l") {
624
616
  return (scope) => {
625
617
  scope.q ? scope[id] === void 0 ? scope[id] = defaultPending : --scope[id] || fn(scope) : queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
626
618
  };
627
619
  }
628
- function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
620
+ function _for_closure(valueAccessor, ownerLoopNodeAccessor, fn) {
629
621
  let childSignal = closure(valueAccessor, fn), loopScopeAccessor = "l" /* LoopScopeArray */ + ownerLoopNodeAccessor, loopScopeMapAccessor = "m" /* LoopScopeMap */ + ownerLoopNodeAccessor, ownerSignal = (ownerScope) => {
630
622
  let scopes = ownerScope[loopScopeAccessor] ||= ownerScope[loopScopeMapAccessor] ? [...ownerScope[loopScopeMapAccessor].values()] : [], [firstScope] = scopes;
631
623
  firstScope && queueRender(
@@ -641,7 +633,7 @@ function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn) {
641
633
  };
642
634
  return ownerSignal._ = childSignal, ownerSignal;
643
635
  }
644
- function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
636
+ function _if_closure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
645
637
  let childSignal = closure(valueAccessor, fn), scopeAccessor = "d" /* ConditionalScope */ + ownerConditionalNodeAccessor, branchAccessor = "c" /* ConditionalRenderer */ + ownerConditionalNodeAccessor, ownerSignal = (scope) => {
646
638
  let ifScope = scope[scopeAccessor];
647
639
  ifScope && !ifScope.q && scope[branchAccessor] === branch && queueRender(ifScope, childSignal, -1);
@@ -650,12 +642,12 @@ function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch,
650
642
  }
651
643
  function subscribeToScopeSet(ownerScope, accessor, scope) {
652
644
  let subscribers = ownerScope[accessor] ||= /* @__PURE__ */ new Set();
653
- subscribers.has(scope) || (subscribers.add(scope), getAbortSignal(scope, -1).addEventListener(
645
+ subscribers.has(scope) || (subscribers.add(scope), $signal(scope, -1).addEventListener(
654
646
  "abort",
655
647
  () => ownerScope[accessor].delete(scope)
656
648
  ));
657
649
  }
658
- function dynamicClosure(...closureSignals) {
650
+ function _closure(...closureSignals) {
659
651
  let [{ E: ___scopeInstancesAccessor, F: ___signalIndexAccessor }] = closureSignals;
660
652
  for (let i = closureSignals.length; i--; )
661
653
  closureSignals[i].L = i;
@@ -669,7 +661,7 @@ function dynamicClosure(...closureSignals) {
669
661
  );
670
662
  };
671
663
  }
672
- function dynamicClosureRead(valueAccessor, fn, getOwnerScope) {
664
+ function _closure_get(valueAccessor, fn, getOwnerScope) {
673
665
  let childSignal = closure(valueAccessor, fn, getOwnerScope), closureSignal = ((scope) => {
674
666
  scope[closureSignal.F] = closureSignal.L, childSignal(scope), subscribeToScopeSet(
675
667
  getOwnerScope ? getOwnerScope(scope) : scope._,
@@ -687,20 +679,20 @@ function closure(valueAccessor, fn, getOwnerScope) {
687
679
  );
688
680
  };
689
681
  }
690
- function setTagVar(scope, childAccessor, tagVarSignal2) {
691
- scope[childAccessor].e = (value2) => tagVarSignal2(scope, value2);
682
+ function _var(scope, childAccessor, signal) {
683
+ scope[childAccessor].e = (value) => signal(scope, value);
692
684
  }
693
- var tagVarSignal = (scope, value2) => scope.e?.(value2);
694
- function setTagVarChange(scope, changeHandler) {
685
+ var _return = (scope, value) => scope.e?.(value);
686
+ function _return_change(scope, changeHandler) {
695
687
  scope.f = changeHandler;
696
688
  }
697
- var tagVarSignalChange = (scope, value2) => scope.f?.(value2), tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
698
- function nextTagId({ $global }) {
689
+ var _var_change = (scope, value) => scope.f?.(value), tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
690
+ function _id({ $global }) {
699
691
  let id = tagIdsByGlobal.get($global) || 0;
700
692
  return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
701
693
  }
702
- function effect(id, fn) {
703
- return register(id, fn), (scope) => {
694
+ function _script(id, fn) {
695
+ return _resume(id, fn), (scope) => {
704
696
  queueEffect(scope, fn);
705
697
  };
706
698
  }
@@ -711,7 +703,7 @@ function* traverseAllHoisted(scope, path, curIndex = path.length - 1) {
711
703
  yield* traverseAllHoisted(s, path, curIndex);
712
704
  else curIndex ? yield* traverseAllHoisted(scope[path[curIndex]], path, curIndex - 1) : yield scope[path[0]];
713
705
  }
714
- function hoist(...path) {
706
+ function _hoist(...path) {
715
707
  return (scope) => {
716
708
  let getOne = (...args) => iterator().next().value(...args), iterator = getOne[Symbol.iterator] = () => traverseAllHoisted(scope, path);
717
709
  return getOne;
@@ -735,7 +727,7 @@ function createAndSetupBranch($global, renderer, parentScope, parentNode) {
735
727
  function setupBranch(renderer, branch) {
736
728
  return renderer.D && queueRender(branch, renderer.D, -1), branch;
737
729
  }
738
- function createContent(id, template, walks, setup, params, dynamicScopesAccessor) {
730
+ function _content(id, template, walks, setup, params, dynamicScopesAccessor) {
739
731
  walks = walks ? walks.replace(/[^\0-1]+$/, "") : "", setup = setup ? setup._ || setup : void 0, params ||= void 0;
740
732
  let clone = template ? (branch, ns) => {
741
733
  ((cloneCache[ns] ||= {})[template] ||= createCloneableHTML(
@@ -758,27 +750,27 @@ function createContent(id, template, walks, setup, params, dynamicScopesAccessor
758
750
  n: dynamicScopesAccessor
759
751
  });
760
752
  }
761
- function registerContent(id, template, walks, setup, params, dynamicScopesAccessor) {
762
- return register(
753
+ function _content_resume(id, template, walks, setup, params, dynamicScopesAccessor) {
754
+ return _resume(
763
755
  id,
764
- createContent(id, template, walks, setup, params, dynamicScopesAccessor)
756
+ _content(id, template, walks, setup, params, dynamicScopesAccessor)
765
757
  );
766
758
  }
767
- function localClosures(renderer, closureFns) {
759
+ function _content_closures(renderer, closureFns) {
768
760
  let closureSignals = {};
769
761
  for (let key in closureFns)
770
- closureSignals[key] = value(key, closureFns[key]);
762
+ closureSignals[key] = _const(key, closureFns[key]);
771
763
  return (owner, closureValues) => {
772
764
  let instance = renderer(owner);
773
765
  return instance.G = closureSignals, instance.M = closureValues, instance;
774
766
  };
775
767
  }
776
- function createRenderer(template, walks, setup, params) {
777
- return createContent("", template, walks, setup, params)();
768
+ function _content_branch(template, walks, setup, params) {
769
+ return _content("", template, walks, setup, params)();
778
770
  }
779
771
  var cloneCache = {};
780
- function createCloneableHTML(html2, ns) {
781
- let { firstChild, lastChild } = parseHTML(html2, ns), parent = document.createElementNS(ns, "t");
772
+ function createCloneableHTML(html, ns) {
773
+ let { firstChild, lastChild } = parseHTML(html, ns), parent = document.createElementNS(ns, "t");
782
774
  return insertChildNodes(parent, null, firstChild, lastChild), firstChild === lastChild && firstChild.nodeType < 8 /* Comment */ ? (branch, walks) => {
783
775
  walk(
784
776
  branch.h = branch.j = firstChild.cloneNode(!0),
@@ -792,41 +784,41 @@ function createCloneableHTML(html2, ns) {
792
784
  }
793
785
 
794
786
  // src/dom/dom.ts
795
- function attr(element, name, value2) {
796
- setAttribute(element, name, normalizeAttrValue(value2));
787
+ function _attr(element, name, value) {
788
+ setAttribute(element, name, normalizeAttrValue(value));
797
789
  }
798
- function setAttribute(element, name, value2) {
799
- element.getAttribute(name) != value2 && (value2 === void 0 ? element.removeAttribute(name) : element.setAttribute(name, value2));
790
+ function setAttribute(element, name, value) {
791
+ element.getAttribute(name) != value && (value === void 0 ? element.removeAttribute(name) : element.setAttribute(name, value));
800
792
  }
801
- function classAttr(element, value2) {
802
- setAttribute(element, "class", classValue(value2) || void 0);
793
+ function _attr_class(element, value) {
794
+ setAttribute(element, "class", classValue(value) || void 0);
803
795
  }
804
- function classItems(element, items) {
796
+ function _attr_class_items(element, items) {
805
797
  for (let key in items)
806
- classItem(element, key, items[key]);
798
+ _attr_class_item(element, key, items[key]);
807
799
  }
808
- function classItem(element, name, value2) {
809
- element.classList.toggle(name, !!value2);
800
+ function _attr_class_item(element, name, value) {
801
+ element.classList.toggle(name, !!value);
810
802
  }
811
- function styleAttr(element, value2) {
812
- setAttribute(element, "style", styleValue(value2) || void 0);
803
+ function _attr_style(element, value) {
804
+ setAttribute(element, "style", styleValue(value) || void 0);
813
805
  }
814
- function styleItems(element, items) {
806
+ function _attr_style_items(element, items) {
815
807
  for (let key in items)
816
- styleItem(element, key, items[key]);
808
+ _attr_style_item(element, key, items[key]);
817
809
  }
818
- function styleItem(element, name, value2) {
819
- element.style.setProperty(name, value2 || value2 === 0 ? value2 + "" : "");
810
+ function _attr_style_item(element, name, value) {
811
+ element.style.setProperty(name, value || value === 0 ? value + "" : "");
820
812
  }
821
- function data(node, value2) {
822
- let normalizedValue = normalizeString(value2);
813
+ function _text(node, value) {
814
+ let normalizedValue = normalizeString(value);
823
815
  node.data !== normalizedValue && (node.data = normalizedValue);
824
816
  }
825
- function textContent(node, value2) {
826
- let normalizedValue = normalizeString(value2);
817
+ function _text_content(node, value) {
818
+ let normalizedValue = normalizeString(value);
827
819
  node.textContent !== normalizedValue && (node.textContent = normalizedValue);
828
820
  }
829
- function attrs(scope, nodeAccessor, nextAttrs) {
821
+ function _attrs(scope, nodeAccessor, nextAttrs) {
830
822
  let el = scope[nodeAccessor];
831
823
  for (let i = el.attributes.length; i--; ) {
832
824
  let { name } = el.attributes.item(i);
@@ -834,13 +826,13 @@ function attrs(scope, nodeAccessor, nextAttrs) {
834
826
  }
835
827
  attrsInternal(scope, nodeAccessor, nextAttrs);
836
828
  }
837
- function attrsAndContent(scope, nodeAccessor, nextAttrs) {
838
- attrs(scope, nodeAccessor, nextAttrs), insertContent(scope, nodeAccessor, nextAttrs?.content);
829
+ function _attrs_content(scope, nodeAccessor, nextAttrs) {
830
+ _attrs(scope, nodeAccessor, nextAttrs), _attr_content(scope, nodeAccessor, nextAttrs?.content);
839
831
  }
840
- function hasAttrAlias(element, attr2, nextAttrs) {
841
- return attr2 === "checked" && element.tagName === "INPUT" && "checkedValue" in nextAttrs;
832
+ function hasAttrAlias(element, attr, nextAttrs) {
833
+ return attr === "checked" && element.tagName === "INPUT" && "checkedValue" in nextAttrs;
842
834
  }
843
- function partialAttrs(scope, nodeAccessor, nextAttrs, skip) {
835
+ function _attrs_partial(scope, nodeAccessor, nextAttrs, skip) {
844
836
  let el = scope[nodeAccessor], partial = {};
845
837
  for (let i = el.attributes.length; i--; ) {
846
838
  let { name } = el.attributes.item(i);
@@ -850,22 +842,22 @@ function partialAttrs(scope, nodeAccessor, nextAttrs, skip) {
850
842
  skip[key] || (partial[key] = nextAttrs[key]);
851
843
  attrsInternal(scope, nodeAccessor, partial);
852
844
  }
853
- function partialAttrsAndContent(scope, nodeAccessor, nextAttrs, skip) {
854
- partialAttrs(scope, nodeAccessor, nextAttrs, skip), insertContent(scope, nodeAccessor, nextAttrs?.content);
845
+ function _attrs_partial_content(scope, nodeAccessor, nextAttrs, skip) {
846
+ _attrs_partial(scope, nodeAccessor, nextAttrs, skip), _attr_content(scope, nodeAccessor, nextAttrs?.content);
855
847
  }
856
848
  function attrsInternal(scope, nodeAccessor, nextAttrs) {
857
849
  let el = scope[nodeAccessor], events, skip;
858
850
  switch (el.tagName) {
859
851
  case "INPUT":
860
852
  if ("checked" in nextAttrs || "checkedChange" in nextAttrs)
861
- controllable_input_checked(
853
+ _attr_input_checked(
862
854
  scope,
863
855
  nodeAccessor,
864
856
  nextAttrs.checked,
865
857
  nextAttrs.checkedChange
866
858
  );
867
859
  else if ("checkedValue" in nextAttrs || "checkedValueChange" in nextAttrs)
868
- controllable_input_checkedValue(
860
+ _attr_input_checkedValue(
869
861
  scope,
870
862
  nodeAccessor,
871
863
  nextAttrs.checkedValue,
@@ -873,7 +865,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
873
865
  nextAttrs.value
874
866
  );
875
867
  else if ("value" in nextAttrs || "valueChange" in nextAttrs)
876
- controllable_input_value(
868
+ _attr_input_value(
877
869
  scope,
878
870
  nodeAccessor,
879
871
  nextAttrs.value,
@@ -884,7 +876,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
884
876
  skip = /^(?:value|checked(?:Value)?)(?:Change)?$/;
885
877
  break;
886
878
  case "SELECT":
887
- ("value" in nextAttrs || "valueChange" in nextAttrs) && (controllable_select_value(
879
+ ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_select_value(
888
880
  scope,
889
881
  nodeAccessor,
890
882
  nextAttrs.value,
@@ -892,7 +884,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
892
884
  ), skip = /^value(?:Change)?$/);
893
885
  break;
894
886
  case "TEXTAREA":
895
- ("value" in nextAttrs || "valueChange" in nextAttrs) && (controllable_input_value(
887
+ ("value" in nextAttrs || "valueChange" in nextAttrs) && (_attr_input_value(
896
888
  scope,
897
889
  nodeAccessor,
898
890
  nextAttrs.value,
@@ -901,7 +893,7 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
901
893
  break;
902
894
  case "DETAILS":
903
895
  case "DIALOG":
904
- ("open" in nextAttrs || "openChange" in nextAttrs) && (controllable_detailsOrDialog_open(
896
+ ("open" in nextAttrs || "openChange" in nextAttrs) && (_attr_details_or_dialog_open(
905
897
  scope,
906
898
  nodeAccessor,
907
899
  nextAttrs.open,
@@ -910,54 +902,54 @@ function attrsInternal(scope, nodeAccessor, nextAttrs) {
910
902
  break;
911
903
  }
912
904
  for (let name in nextAttrs) {
913
- let value2 = nextAttrs[name];
905
+ let value = nextAttrs[name];
914
906
  switch (name) {
915
907
  case "class":
916
- classAttr(el, value2);
908
+ _attr_class(el, value);
917
909
  break;
918
910
  case "style":
919
- styleAttr(el, value2);
911
+ _attr_style(el, value);
920
912
  break;
921
913
  default: {
922
- isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value2 : skip?.test(name) || name === "content" && el.tagName !== "META" || attr(el, name, value2);
914
+ isEventHandler(name) ? (events ||= scope["i" /* EventAttributes */ + nodeAccessor] = {})[getEventHandlerName(name)] = value : skip?.test(name) || name === "content" && el.tagName !== "META" || _attr(el, name, value);
923
915
  break;
924
916
  }
925
917
  }
926
918
  }
927
919
  }
928
- function insertContent(scope, nodeAccessor, value2) {
929
- let content = normalizeClientRender(value2), rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
920
+ function _attr_content(scope, nodeAccessor, value) {
921
+ let content = normalizeClientRender(value), rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
930
922
  scope[rendererAccessor] !== (scope[rendererAccessor] = content?.l) && (setConditionalRenderer(scope, nodeAccessor, content, createAndSetupBranch), content?.n && subscribeToScopeSet(
931
923
  content.u,
932
924
  content.n,
933
925
  scope["d" /* ConditionalScope */ + nodeAccessor]
934
926
  ));
935
927
  }
936
- function attrsEvents(scope, nodeAccessor) {
928
+ function _attrs_script(scope, nodeAccessor) {
937
929
  let el = scope[nodeAccessor], events = scope["i" /* EventAttributes */ + nodeAccessor];
938
930
  switch (scope["f" /* ControlledType */ + nodeAccessor]) {
939
931
  case 0 /* InputChecked */:
940
- controllable_input_checked_effect(scope, nodeAccessor);
932
+ _attr_input_checked_script(scope, nodeAccessor);
941
933
  break;
942
934
  case 1 /* InputCheckedValue */:
943
- controllable_input_checkedValue_effect(scope, nodeAccessor);
935
+ _attr_input_checkedValue_script(scope, nodeAccessor);
944
936
  break;
945
937
  case 2 /* InputValue */:
946
- controllable_input_value_effect(scope, nodeAccessor);
938
+ _attr_input_value_script(scope, nodeAccessor);
947
939
  break;
948
940
  case 3 /* SelectValue */:
949
- controllable_select_value_effect(scope, nodeAccessor);
941
+ _attr_select_value_script(scope, nodeAccessor);
950
942
  break;
951
943
  case 4 /* DetailsOrDialogOpen */:
952
- controllable_detailsOrDialog_open_effect(scope, nodeAccessor);
944
+ _attr_details_or_dialog_open_script(scope, nodeAccessor);
953
945
  break;
954
946
  }
955
947
  for (let name in events)
956
- on(el, name, events[name]);
948
+ _on(el, name, events[name]);
957
949
  }
958
- function html(scope, value2, accessor) {
950
+ function _html(scope, value, accessor) {
959
951
  let firstChild = scope[accessor], parentNode = firstChild.parentNode, lastChild = scope["h" /* DynamicPlaceholderLastChild */ + accessor] || firstChild, newContent = parseHTML(
960
- value2 || value2 === 0 ? value2 + "" : "",
952
+ value || value === 0 ? value + "" : "",
961
953
  parentNode.namespaceURI
962
954
  );
963
955
  insertChildNodes(
@@ -967,33 +959,21 @@ function html(scope, value2, accessor) {
967
959
  scope["h" /* DynamicPlaceholderLastChild */ + accessor] = newContent.lastChild
968
960
  ), removeChildNodes(firstChild, lastChild);
969
961
  }
970
- function normalizeClientRender(value2) {
971
- let renderer = normalizeDynamicRenderer(value2);
962
+ function normalizeClientRender(value) {
963
+ let renderer = normalizeDynamicRenderer(value);
972
964
  if (renderer && renderer.l)
973
965
  return renderer;
974
966
  }
975
- function props(scope, nodeIndex, index) {
976
- let nextProps = scope[index], prevProps = scope[index + "-"], node = scope[nodeIndex];
977
- if (prevProps)
978
- for (let name in prevProps)
979
- name in nextProps || (node[name] = void 0);
980
- for (let name in nextProps)
981
- node[name] = nextProps[name];
982
- scope[index + "-"] = nextProps;
967
+ function normalizeAttrValue(value) {
968
+ if (value || value === 0)
969
+ return value === !0 ? "" : value + "";
983
970
  }
984
- function normalizeAttrValue(value2) {
985
- if (value2 || value2 === 0)
986
- return value2 === !0 ? "" : value2 + "";
971
+ function normalizeString(value) {
972
+ return value || value === 0 ? value + "" : "\u200D";
987
973
  }
988
- function normalizeString(value2) {
989
- return value2 || value2 === 0 ? value2 + "" : "\u200D";
990
- }
991
- function lifecycle(scope, index, thisObj) {
974
+ function _lifecycle(scope, index, thisObj) {
992
975
  let instance = scope[index];
993
- instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), getAbortSignal(
994
- scope,
995
- "k" /* LifecycleAbortController */ + index
996
- ).onabort = () => thisObj.onDestroy?.());
976
+ instance ? (Object.assign(instance, thisObj), instance.onUpdate?.()) : (scope[index] = thisObj, thisObj.onMount?.(), $signal(scope, "k" /* LifecycleAbortController */ + index).onabort = () => thisObj.onDestroy?.());
997
977
  }
998
978
  function removeChildNodes(startNode, endNode) {
999
979
  let stop = endNode.nextSibling, current = startNode;
@@ -1091,7 +1071,7 @@ function longestIncreasingSubsequence(a) {
1091
1071
  }
1092
1072
 
1093
1073
  // src/dom/control-flow.ts
1094
- function awaitTag(nodeAccessor, renderer) {
1074
+ function _await(nodeAccessor, renderer) {
1095
1075
  let promiseAccessor = "n" /* Promise */ + nodeAccessor, branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
1096
1076
  return (scope, promise) => {
1097
1077
  let referenceNode = scope[nodeAccessor], tryWithPlaceholder = findBranchWithKey(
@@ -1124,7 +1104,7 @@ function awaitTag(nodeAccessor, renderer) {
1124
1104
  awaitBranch.h
1125
1105
  ), tempDetachBranch(awaitBranch));
1126
1106
  let thisPromise = scope[promiseAccessor] = promise.then(
1127
- (data2) => {
1107
+ (data) => {
1128
1108
  thisPromise === scope[promiseAccessor] && (scope[promiseAccessor] = 0, schedule(), queueRender(
1129
1109
  scope,
1130
1110
  () => {
@@ -1139,7 +1119,7 @@ function awaitTag(nodeAccessor, renderer) {
1139
1119
  ),
1140
1120
  referenceNode.parentNode,
1141
1121
  referenceNode
1142
- ), referenceNode.remove()), renderer.m?.(awaitBranch, [data2]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.o)) {
1122
+ ), referenceNode.remove()), renderer.m?.(awaitBranch, [data]), tryWithPlaceholder && (placeholderShown.add(pendingEffects), !--tryWithPlaceholder.o)) {
1143
1123
  let placeholderBranch = tryWithPlaceholder.c;
1144
1124
  tryWithPlaceholder.c = 0, placeholderBranch && (placeholderBranch.h.parentNode.insertBefore(
1145
1125
  tryWithPlaceholder.h.parentNode,
@@ -1156,13 +1136,13 @@ function awaitTag(nodeAccessor, renderer) {
1156
1136
  );
1157
1137
  };
1158
1138
  }
1159
- function createTry(nodeAccessor, tryContent) {
1139
+ function _try(nodeAccessor, content) {
1160
1140
  let branchAccessor = "d" /* ConditionalScope */ + nodeAccessor;
1161
1141
  return (scope, input) => {
1162
1142
  scope[branchAccessor] || setConditionalRenderer(
1163
1143
  scope,
1164
1144
  nodeAccessor,
1165
- tryContent,
1145
+ content,
1166
1146
  createAndSetupBranch
1167
1147
  );
1168
1148
  let branch = scope[branchAccessor];
@@ -1187,7 +1167,7 @@ function renderCatch(scope, error) {
1187
1167
  } else
1188
1168
  throw error;
1189
1169
  }
1190
- function conditional(nodeAccessor, ...branches) {
1170
+ function _if(nodeAccessor, ...branches) {
1191
1171
  let branchAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
1192
1172
  return enableBranches(), (scope, newBranch) => {
1193
1173
  newBranch !== scope[branchAccessor] && setConditionalRenderer(
@@ -1199,9 +1179,9 @@ function conditional(nodeAccessor, ...branches) {
1199
1179
  };
1200
1180
  }
1201
1181
  function patchDynamicTag(fn) {
1202
- dynamicTag = fn(dynamicTag);
1182
+ _dynamic_tag = fn(_dynamic_tag);
1203
1183
  }
1204
- var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1184
+ var _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1205
1185
  let childScopeAccessor = "d" /* ConditionalScope */ + nodeAccessor, rendererAccessor = "c" /* ConditionalRenderer */ + nodeAccessor;
1206
1186
  return enableBranches(), (scope, newRenderer, getInput) => {
1207
1187
  let normalizedRenderer = normalizeDynamicRenderer(newRenderer);
@@ -1211,7 +1191,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1211
1191
  nodeAccessor,
1212
1192
  normalizedRenderer || (getContent ? getContent(scope) : void 0),
1213
1193
  createBranchWithTagNameOrRenderer
1214
- ), getTagVar && setTagVar(scope, childScopeAccessor, getTagVar()), typeof normalizedRenderer == "string") {
1194
+ ), getTagVar && _var(scope, childScopeAccessor, getTagVar()), typeof normalizedRenderer == "string") {
1215
1195
  if (getContent) {
1216
1196
  let content = getContent(scope);
1217
1197
  setConditionalRenderer(
@@ -1233,7 +1213,7 @@ var dynamicTag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
1233
1213
  if (normalizedRenderer) {
1234
1214
  let childScope = scope[childScopeAccessor], args = getInput?.();
1235
1215
  if (typeof normalizedRenderer == "string")
1236
- (getContent ? attrs : attrsAndContent)(
1216
+ (getContent ? _attrs : _attrs_content)(
1237
1217
  childScope,
1238
1218
  0,
1239
1219
  (inputIsArgs ? args[0] : args) || {}
@@ -1265,7 +1245,7 @@ function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2)
1265
1245
  let referenceNode = scope[nodeAccessor], prevBranch = scope["d" /* ConditionalScope */ + nodeAccessor], parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.h || referenceNode).parentNode : referenceNode, newBranch = scope["d" /* ConditionalScope */ + nodeAccessor] = newRenderer && createBranch2(scope.$global, newRenderer, scope, parentNode);
1266
1246
  referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(newBranch, parentNode, prevBranch.h) : parentNode.insertBefore(referenceNode, prevBranch.h), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
1267
1247
  }
1268
- function loopOf(nodeAccessor, renderer) {
1248
+ function _for_of(nodeAccessor, renderer) {
1269
1249
  return loop(
1270
1250
  nodeAccessor,
1271
1251
  renderer,
@@ -1277,14 +1257,14 @@ function loopOf(nodeAccessor, renderer) {
1277
1257
  }
1278
1258
  );
1279
1259
  }
1280
- function loopIn(nodeAccessor, renderer) {
1260
+ function _for_in(nodeAccessor, renderer) {
1281
1261
  return loop(
1282
1262
  nodeAccessor,
1283
1263
  renderer,
1284
- ([obj, by = byFirstArg], cb) => forIn(obj, (key, value2) => cb(by(key, value2), [key, value2]))
1264
+ ([obj, by = byFirstArg], cb) => forIn(obj, (key, value) => cb(by(key, value), [key, value]))
1285
1265
  );
1286
1266
  }
1287
- function loopTo(nodeAccessor, renderer) {
1267
+ function _for_to(nodeAccessor, renderer) {
1288
1268
  return loop(
1289
1269
  nodeAccessor,
1290
1270
  renderer,
@@ -1293,11 +1273,11 @@ function loopTo(nodeAccessor, renderer) {
1293
1273
  }
1294
1274
  function loop(nodeAccessor, renderer, forEach) {
1295
1275
  let params = renderer.m;
1296
- return enableBranches(), (scope, value2) => {
1276
+ return enableBranches(), (scope, value) => {
1297
1277
  let referenceNode = scope[nodeAccessor], oldMap = scope["m" /* LoopScopeMap */ + nodeAccessor], oldArray = oldMap ? scope["l" /* LoopScopeArray */ + nodeAccessor] || [
1298
1278
  ...oldMap.values()
1299
1279
  ] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].h.parentNode : referenceNode, newMap = scope["m" /* LoopScopeMap */ + nodeAccessor] = /* @__PURE__ */ new Map(), newArray = scope["l" /* LoopScopeArray */ + nodeAccessor] = [];
1300
- forEach(value2, (key, args) => {
1280
+ forEach(value, (key, args) => {
1301
1281
  let branch = oldMap?.get(key) || createAndSetupBranch(scope.$global, renderer, scope, parentNode);
1302
1282
  params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
1303
1283
  });
@@ -1326,16 +1306,16 @@ function byFirstArg(name) {
1326
1306
 
1327
1307
  // src/dom/queue.ts
1328
1308
  var pendingRenders = [], pendingRendersLookup = /* @__PURE__ */ new Map(), caughtError = /* @__PURE__ */ new WeakSet(), placeholderShown = /* @__PURE__ */ new WeakSet(), pendingEffects = [], pendingScopes = [], rendering, scopeKeyOffset = 1e3;
1329
- function queueRender(scope, signal, signalKey, value2, scopeKey = scope.l) {
1309
+ function queueRender(scope, signal, signalKey, value, scopeKey = scope.l) {
1330
1310
  let key = scopeKey * scopeKeyOffset + signalKey, existingRender = signalKey >= 0 && pendingRendersLookup.get(key);
1331
1311
  if (existingRender)
1332
- existingRender.I = value2;
1312
+ existingRender.I = value;
1333
1313
  else {
1334
1314
  let render = {
1335
1315
  x: key,
1336
1316
  t: scope,
1337
1317
  N: signal,
1338
- I: value2
1318
+ I: value
1339
1319
  }, i = pendingRenders.push(render) - 1;
1340
1320
  for (; i; ) {
1341
1321
  let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
@@ -1393,8 +1373,8 @@ function runRenders() {
1393
1373
  scope.q = 0;
1394
1374
  pendingScopes = [];
1395
1375
  }
1396
- var runRender = (render) => render.N(render.t, render.I), enableCatch = () => {
1397
- enableCatch = () => {
1376
+ var runRender = (render) => render.N(render.t, render.I), _enable_catch = () => {
1377
+ _enable_catch = () => {
1398
1378
  }, enableBranches();
1399
1379
  let handlePendingTry = (fn, scope, branch) => {
1400
1380
  for (; branch; ) {
@@ -1420,11 +1400,11 @@ var runRender = (render) => render.N(render.t, render.I), enableCatch = () => {
1420
1400
  };
1421
1401
 
1422
1402
  // src/dom/abort-signal.ts
1423
- function resetAbortSignal(scope, id) {
1403
+ function $signalReset(scope, id) {
1424
1404
  let ctrl = scope.z?.[id];
1425
1405
  ctrl && (queueEffect(ctrl, abort), scope.z[id] = void 0);
1426
1406
  }
1427
- function getAbortSignal(scope, id) {
1407
+ function $signal(scope, id) {
1428
1408
  return scope.k && (scope.k.J ||= /* @__PURE__ */ new Set()).add(scope), ((scope.z ||= {})[id] ||= new AbortController()).signal;
1429
1409
  }
1430
1410
  function abort(ctrl) {
@@ -1439,12 +1419,12 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1439
1419
  patchDynamicTag,
1440
1420
  queueEffect,
1441
1421
  init(warp10Noop) {
1442
- register(SET_SCOPE_REGISTER_ID, (branch) => {
1422
+ _resume(SET_SCOPE_REGISTER_ID, (branch) => {
1443
1423
  classIdToBranch.set(branch.m5c, branch);
1444
- }), register(RENDER_BODY_ID, warp10Noop);
1424
+ }), _resume(RENDER_BODY_ID, warp10Noop);
1445
1425
  },
1446
1426
  registerRenderer(fn) {
1447
- register(RENDERER_REGISTER_ID, fn);
1427
+ _resume(RENDERER_REGISTER_ID, fn);
1448
1428
  },
1449
1429
  isRenderer(renderer) {
1450
1430
  return renderer.C;
@@ -1461,14 +1441,14 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1461
1441
  runComponentDestroy() {
1462
1442
  this.scope && destroyBranch(this.scope);
1463
1443
  },
1464
- resolveRegistered(value2, $global) {
1465
- return Array.isArray(value2) && typeof value2[0] == "string" ? getRegisteredWithScope(
1466
- value2[0],
1467
- value2.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value2[1]]
1468
- ) : value2;
1444
+ resolveRegistered(value, $global) {
1445
+ return Array.isArray(value) && typeof value[0] == "string" ? getRegisteredWithScope(
1446
+ value[0],
1447
+ value.length === 2 && self[$global.runtimeId]?.[$global.renderId]?.s[value[1]]
1448
+ ) : value;
1469
1449
  },
1470
1450
  createRenderer(params, clone) {
1471
- let renderer = createRenderer(0, 0, 0, params);
1451
+ let renderer = _content_branch(0, 0, 0, params);
1472
1452
  return renderer.C = (branch) => {
1473
1453
  let cloned = clone();
1474
1454
  branch.h = cloned.startNode, branch.j = cloned.endNode;
@@ -1494,15 +1474,15 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
1494
1474
  };
1495
1475
 
1496
1476
  // src/dom/template.ts
1497
- var createTemplate = (id, template, walks, setup, inputSignal) => {
1498
- let renderer = createContent(
1477
+ var _template = (id, template, walks, setup, inputSignal) => {
1478
+ let renderer = _content(
1499
1479
  id,
1500
1480
  template,
1501
1481
  walks,
1502
1482
  setup,
1503
1483
  inputSignal
1504
1484
  )();
1505
- return renderer.mount = mount, renderer._ = renderer, register(id, renderer);
1485
+ return renderer.mount = mount, renderer._ = renderer, _resume(id, renderer);
1506
1486
  };
1507
1487
  function mount(input = {}, reference, position) {
1508
1488
  let branch, parentNode = reference, nextSibling = null, { $global } = input;
@@ -1546,7 +1526,7 @@ function mount(input = {}, reference, position) {
1546
1526
  return curValue;
1547
1527
  },
1548
1528
  set value(newValue) {
1549
- tagVarSignalChange(branch, newValue);
1529
+ _var_change(branch, newValue);
1550
1530
  },
1551
1531
  update(newInput) {
1552
1532
  args && runEffects(