marko 6.0.0-next.3.39 → 6.0.0-next.3.40
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/dom.js +799 -862
- package/dist/debug/dom.mjs +799 -862
- package/dist/dom/control-flow.d.ts +1 -2
- package/dist/dom/scope.d.ts +0 -1
- package/dist/dom.js +299 -332
- package/dist/dom.mjs +299 -332
- package/dist/translator/index.js +8 -1
- package/package.json +1 -1
package/dist/dom.js
CHANGED
@@ -158,26 +158,20 @@ function normalizeDynamicRenderer(value2) {
|
|
158
158
|
}
|
159
159
|
|
160
160
|
// src/dom/event.ts
|
161
|
-
var
|
161
|
+
var defaultDelegator = createDelegator();
|
162
162
|
function on(element, type, handler) {
|
163
|
-
|
164
|
-
handlersByElement || elementHandlersByEvent.set(type, handlersByElement = /* @__PURE__ */ new WeakMap()), handlersByElement.has(element) || defaultDelegator(element, type, handleDelegated), handlersByElement.set(element, handler || null);
|
163
|
+
element["$" + type] === void 0 && defaultDelegator(element, type, handleDelegated), element["$" + type] = handler || null;
|
165
164
|
}
|
166
165
|
function createDelegator() {
|
167
166
|
let kEvents = Symbol();
|
168
167
|
return function(node, type, handler) {
|
169
|
-
|
170
|
-
(root[kEvents] ||= {})[type] ||= (root.addEventListener(type, handler, !0), 1);
|
168
|
+
((node = node.getRootNode())[kEvents] ||= {})[type] ||= (node.addEventListener(type, handler, !0), 1);
|
171
169
|
};
|
172
170
|
}
|
173
171
|
function handleDelegated(ev) {
|
174
172
|
let target = !rendering && ev.target;
|
175
|
-
|
176
|
-
|
177
|
-
if (handlersByElement.get(target)?.(ev, target), ev.bubbles)
|
178
|
-
for (; (target = target.parentNode) && !ev.cancelBubble; )
|
179
|
-
handlersByElement.get(target)?.(ev, target);
|
180
|
-
}
|
173
|
+
for (; target; )
|
174
|
+
target["$" + ev.type]?.(ev, target), target = ev.bubbles && !ev.cancelBubble && target.parentNode;
|
181
175
|
}
|
182
176
|
|
183
177
|
// src/dom/resolve-cursor-position.ts
|
@@ -398,7 +392,7 @@ function controllable_select_value_effect(scope, nodeAccessor) {
|
|
398
392
|
valueChange
|
399
393
|
));
|
400
394
|
};
|
401
|
-
|
395
|
+
el._ || new MutationObserver(() => {
|
402
396
|
let value2 = scope[nodeAccessor + ":" /* ControlledValue */];
|
403
397
|
(Array.isArray(value2) ? value2.length !== el.selectedOptions.length || value2.some((value3, i) => value3 != el.selectedOptions[i].value) : el.value != value2) && onChange();
|
404
398
|
}).observe(el, {
|
@@ -456,19 +450,17 @@ function setValueAndUpdateSelection(el, value2) {
|
|
456
450
|
function setCheckboxValue(scope, nodeAccessor, type, checked, checkedChange) {
|
457
451
|
scope[nodeAccessor + ";" /* ControlledHandler */] = checkedChange, checkedChange ? (scope[nodeAccessor + "=" /* ControlledType */] = type, scope[nodeAccessor].checked = checked) : (scope[nodeAccessor + "=" /* ControlledType */] = 5 /* None */, scope[nodeAccessor].defaultChecked = checked);
|
458
452
|
}
|
459
|
-
var controllableDelegate = createDelegator()
|
453
|
+
var controllableDelegate = createDelegator();
|
460
454
|
function syncControllable(el, event, hasChanged, onChange) {
|
461
|
-
|
455
|
+
el._ || (controllableDelegate(el, event, handleChange), el.form && controllableDelegate(el.form, "reset", handleFormReset), isResuming && hasChanged(el) && queueMicrotask(onChange)), el._ = onChange;
|
462
456
|
}
|
463
457
|
function handleChange(ev) {
|
464
|
-
|
458
|
+
ev.target._?.(ev);
|
465
459
|
}
|
466
460
|
function handleFormReset(ev) {
|
467
461
|
let handlers = [];
|
468
|
-
for (let el of ev.target.elements)
|
469
|
-
|
470
|
-
handler && hasFormElementChanged(el) && handlers.push(handler);
|
471
|
-
}
|
462
|
+
for (let el of ev.target.elements)
|
463
|
+
el._ && hasFormElementChanged(el) && handlers.push(el._);
|
472
464
|
requestAnimationFrame(() => {
|
473
465
|
if (!ev.defaultPrevented)
|
474
466
|
for (let change of handlers)
|
@@ -716,10 +708,6 @@ function finishPendingScopes() {
|
|
716
708
|
scope.g = 0;
|
717
709
|
pendingScopes = [];
|
718
710
|
}
|
719
|
-
var emptyBranch = createScope({});
|
720
|
-
function getEmptyBranch(marker) {
|
721
|
-
return emptyBranch.a = emptyBranch.b = marker, emptyBranch;
|
722
|
-
}
|
723
711
|
function destroyBranch(branch) {
|
724
712
|
branch.q?.j?.delete(branch), destroyNestedBranches(branch);
|
725
713
|
}
|
@@ -741,6 +729,222 @@ function insertBranchBefore(branch, parentNode, nextSibling) {
|
|
741
729
|
);
|
742
730
|
}
|
743
731
|
|
732
|
+
// src/dom/schedule.ts
|
733
|
+
var port2 = /* @__PURE__ */ (() => {
|
734
|
+
let { port1, port2: port22 } = new MessageChannel();
|
735
|
+
return port1.onmessage = () => {
|
736
|
+
isScheduled = !1, run();
|
737
|
+
}, port22;
|
738
|
+
})(), isScheduled;
|
739
|
+
function schedule() {
|
740
|
+
isScheduled || (isScheduled = !0, queueMicrotask(flushAndWaitFrame));
|
741
|
+
}
|
742
|
+
function flushAndWaitFrame() {
|
743
|
+
run(), requestAnimationFrame(triggerMacroTask);
|
744
|
+
}
|
745
|
+
function triggerMacroTask() {
|
746
|
+
port2.postMessage(0);
|
747
|
+
}
|
748
|
+
|
749
|
+
// src/dom/signals.ts
|
750
|
+
var MARK = {}, CLEAN = {}, DIRTY = {};
|
751
|
+
function state(valueAccessor, fn, getIntersection) {
|
752
|
+
let valueSignal = value(valueAccessor, fn, getIntersection), markAccessor = valueAccessor + "#" /* Mark */, valueChangeAccessor = valueAccessor + "@" /* TagVariableChange */;
|
753
|
+
return (scope, valueOrOp, valueChange) => (rendering ? valueSignal(
|
754
|
+
scope,
|
755
|
+
valueOrOp === MARK || valueOrOp === CLEAN || valueOrOp === DIRTY || (scope[valueChangeAccessor] = valueChange) || scope[markAccessor] === void 0 ? valueOrOp : CLEAN
|
756
|
+
) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](valueOrOp) : (schedule(), queueSource(scope, valueSignal, valueOrOp)), valueOrOp);
|
757
|
+
}
|
758
|
+
function value(valueAccessor, fn, getIntersection) {
|
759
|
+
let markAccessor = valueAccessor + "#" /* Mark */, intersection2;
|
760
|
+
return (scope, valueOrOp) => {
|
761
|
+
if (valueOrOp === MARK)
|
762
|
+
(scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK);
|
763
|
+
else if (valueOrOp !== DIRTY) {
|
764
|
+
let existing = scope[markAccessor] !== void 0;
|
765
|
+
(scope[markAccessor] ||= 1) === 1 && (valueOrOp === CLEAN || existing && scope[valueAccessor] === valueOrOp ? getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : (scope[valueAccessor] = valueOrOp, fn && fn(scope, valueOrOp), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY))), scope[markAccessor]--;
|
766
|
+
}
|
767
|
+
};
|
768
|
+
}
|
769
|
+
var accessorId = 0;
|
770
|
+
function intersection(count, fn, getIntersection) {
|
771
|
+
let dirtyAccessor = "?" /* Dynamic */ + accessorId++, markAccessor = dirtyAccessor + "#" /* Mark */, intersection2;
|
772
|
+
return (scope, op) => {
|
773
|
+
op === MARK ? (scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK) : scope[markAccessor] === void 0 ? (scope[markAccessor] = count - 1, scope[dirtyAccessor] = !0) : --scope[markAccessor] === 0 ? op === DIRTY || scope[dirtyAccessor] ? (scope[dirtyAccessor] = !1, fn(scope), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY)) : getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : scope[dirtyAccessor] ||= op === DIRTY;
|
774
|
+
};
|
775
|
+
}
|
776
|
+
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn, getIntersection) {
|
777
|
+
let childSignal = closure(valueAccessor, fn, getIntersection), loopScopeAccessor = ownerLoopNodeAccessor + "!" /* LoopScopeArray */, loopScopeMapAccessor = ownerLoopNodeAccessor + "(" /* LoopScopeMap */, ownerSignal = (ownerScope) => {
|
778
|
+
for (let scope of ownerScope[loopScopeAccessor] || ownerScope[loopScopeMapAccessor]?.values() || [])
|
779
|
+
scope.g || queueSource(scope, childSignal);
|
780
|
+
};
|
781
|
+
return ownerSignal._ = childSignal, ownerSignal;
|
782
|
+
}
|
783
|
+
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn, getIntersection) {
|
784
|
+
let childSignal = closure(valueAccessor, fn, getIntersection), scopeAccessor = ownerConditionalNodeAccessor + "!" /* ConditionalScope */, branchAccessor = ownerConditionalNodeAccessor + "(" /* ConditionalRenderer */, ownerSignal = (scope) => {
|
785
|
+
let ifScope = scope[scopeAccessor];
|
786
|
+
ifScope && !ifScope.g && scope[branchAccessor] === branch && queueSource(ifScope, childSignal);
|
787
|
+
};
|
788
|
+
return ownerSignal._ = childSignal, ownerSignal;
|
789
|
+
}
|
790
|
+
function dynamicClosure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
791
|
+
let subscribersAccessor = "?" /* Dynamic */ + accessorId++, childSignal = closure(
|
792
|
+
valueAccessor,
|
793
|
+
fn,
|
794
|
+
getIntersection,
|
795
|
+
getOwnerScope
|
796
|
+
), ownerSignal = (ownerScope) => {
|
797
|
+
let subscribers = ownerScope[subscribersAccessor];
|
798
|
+
if (subscribers)
|
799
|
+
for (let subscriber of subscribers)
|
800
|
+
subscriber.g || queueSource(subscriber, childSignal);
|
801
|
+
}, subscribe = (scope) => {
|
802
|
+
let owner = getOwnerScope ? getOwnerScope(scope) : scope._, subscribers = owner[subscribersAccessor] ||= /* @__PURE__ */ new Set();
|
803
|
+
subscribers.has(scope) || (subscribers.add(scope), getAbortSignal(scope, -1).addEventListener(
|
804
|
+
"abort",
|
805
|
+
() => subscribers.delete(scope)
|
806
|
+
));
|
807
|
+
};
|
808
|
+
return ownerSignal.H = subscribe, ownerSignal._ = (scope) => {
|
809
|
+
childSignal(scope), subscribe(scope);
|
810
|
+
}, ownerSignal;
|
811
|
+
}
|
812
|
+
function registerDynamicClosure(id, valueAccessor, fn, getIntersection, getOwnerScope) {
|
813
|
+
let signal = dynamicClosure(
|
814
|
+
valueAccessor,
|
815
|
+
fn,
|
816
|
+
getIntersection,
|
817
|
+
getOwnerScope
|
818
|
+
);
|
819
|
+
return register(id, signal.H), signal;
|
820
|
+
}
|
821
|
+
function closure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
822
|
+
let intersection2;
|
823
|
+
return (scope, op) => {
|
824
|
+
op || fn && fn(
|
825
|
+
scope,
|
826
|
+
(getOwnerScope ? getOwnerScope(scope) : scope._)[valueAccessor]
|
827
|
+
), getIntersection && (intersection2 ||= getIntersection())(scope, op ? MARK : DIRTY);
|
828
|
+
};
|
829
|
+
}
|
830
|
+
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
831
|
+
scope[childAccessor]["/" /* TagVariable */] = (valueOrOp) => tagVarSignal2(scope, valueOrOp);
|
832
|
+
}
|
833
|
+
var tagVarSignal = (scope, valueOrOp) => scope["/" /* TagVariable */]?.(valueOrOp);
|
834
|
+
function setTagVarChange(scope, changeHandler) {
|
835
|
+
scope["@" /* TagVariableChange */] = changeHandler;
|
836
|
+
}
|
837
|
+
var tagVarSignalChange = (scope, value2) => scope["@" /* TagVariableChange */]?.(value2);
|
838
|
+
var tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
|
839
|
+
function nextTagId({ $global }) {
|
840
|
+
let id = tagIdsByGlobal.get($global) || 0;
|
841
|
+
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
842
|
+
}
|
843
|
+
function inChild(childAccessor, signal) {
|
844
|
+
return (scope, valueOrOp) => {
|
845
|
+
signal(scope[childAccessor], valueOrOp);
|
846
|
+
};
|
847
|
+
}
|
848
|
+
function intersections(signals) {
|
849
|
+
return (scope, op) => {
|
850
|
+
for (let signal of signals)
|
851
|
+
signal(scope, op);
|
852
|
+
};
|
853
|
+
}
|
854
|
+
function effect(id, fn) {
|
855
|
+
return register(id, fn), (scope) => {
|
856
|
+
queueEffect(scope, fn);
|
857
|
+
};
|
858
|
+
}
|
859
|
+
|
860
|
+
// src/dom/queue.ts
|
861
|
+
var pendingRenders = [], pendingEffects = [], rendering = !1;
|
862
|
+
function queueSource(scope, signal, value2) {
|
863
|
+
let prevRendering = rendering;
|
864
|
+
rendering = !0, signal(scope, MARK), rendering = prevRendering, queueRender(scope, signal, value2);
|
865
|
+
}
|
866
|
+
function queueRender(scope, signal, value2) {
|
867
|
+
let i = pendingRenders.length, render = {
|
868
|
+
s: scope,
|
869
|
+
I: signal,
|
870
|
+
J: value2,
|
871
|
+
t: scope.c?.f || 0,
|
872
|
+
u: i
|
873
|
+
};
|
874
|
+
for (pendingRenders.push(render); i; ) {
|
875
|
+
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
876
|
+
if (comparePendingRenders(render, parent) >= 0) break;
|
877
|
+
pendingRenders[i] = parent, i = parentIndex;
|
878
|
+
}
|
879
|
+
pendingRenders[i] = render;
|
880
|
+
}
|
881
|
+
function queueEffect(scope, fn) {
|
882
|
+
pendingEffects.push(scope, fn);
|
883
|
+
}
|
884
|
+
function run() {
|
885
|
+
let effects = pendingEffects;
|
886
|
+
try {
|
887
|
+
rendering = !0, runRenders();
|
888
|
+
} finally {
|
889
|
+
pendingRenders = [], pendingEffects = [], rendering = !1;
|
890
|
+
}
|
891
|
+
runEffects(effects);
|
892
|
+
}
|
893
|
+
function prepareEffects(fn) {
|
894
|
+
let prevRenders = pendingRenders, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
895
|
+
pendingRenders = [];
|
896
|
+
try {
|
897
|
+
rendering = !0, fn(), runRenders();
|
898
|
+
} finally {
|
899
|
+
rendering = !1, pendingRenders = prevRenders, pendingEffects = prevEffects;
|
900
|
+
}
|
901
|
+
return preparedEffects;
|
902
|
+
}
|
903
|
+
function runEffects(effects) {
|
904
|
+
for (let i = 0; i < effects.length; i += 2 /* Total */) {
|
905
|
+
let scope = effects[i], fn = effects[i + 1];
|
906
|
+
fn(scope, scope);
|
907
|
+
}
|
908
|
+
}
|
909
|
+
function runRenders() {
|
910
|
+
for (; pendingRenders.length; ) {
|
911
|
+
let render = pendingRenders[0], next = pendingRenders.pop();
|
912
|
+
if (render !== next) {
|
913
|
+
let i = 0, mid = pendingRenders.length >> 1, item = pendingRenders[0] = next;
|
914
|
+
for (; i < mid; ) {
|
915
|
+
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
916
|
+
if (right < pendingRenders.length && comparePendingRenders(
|
917
|
+
pendingRenders[right],
|
918
|
+
pendingRenders[bestChild]
|
919
|
+
) < 0 && (bestChild = right), comparePendingRenders(pendingRenders[bestChild], item) >= 0)
|
920
|
+
break;
|
921
|
+
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
922
|
+
}
|
923
|
+
pendingRenders[i] = item;
|
924
|
+
}
|
925
|
+
render.s.c?.F || render.I(render.s, render.J);
|
926
|
+
}
|
927
|
+
finishPendingScopes();
|
928
|
+
}
|
929
|
+
function comparePendingRenders(a, b) {
|
930
|
+
return a.t - b.t || a.u - b.u;
|
931
|
+
}
|
932
|
+
|
933
|
+
// src/dom/abort-signal.ts
|
934
|
+
function resetAbortSignal(scope, id) {
|
935
|
+
let ctrl = scope.h?.[id];
|
936
|
+
ctrl && (queueEffect(ctrl, abort), scope.h[id] = void 0);
|
937
|
+
}
|
938
|
+
function getAbortSignal(scope, id) {
|
939
|
+
return scope.c && (scope.c.G ||= /* @__PURE__ */ new Set()).add(scope), ((scope.h ||= {})[id] ||= new AbortController()).signal;
|
940
|
+
}
|
941
|
+
function abort(ctrl) {
|
942
|
+
ctrl.abort();
|
943
|
+
}
|
944
|
+
|
945
|
+
// src/common/compat-meta.ts
|
946
|
+
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
947
|
+
|
744
948
|
// src/dom/reconcile.ts
|
745
949
|
var WRONG_POS = 2147483647;
|
746
950
|
function reconcile(parent, oldBranches, newBranches, afterReference) {
|
@@ -796,9 +1000,7 @@ function reconcile(parent, oldBranches, newBranches, afterReference) {
|
|
796
1000
|
}
|
797
1001
|
}
|
798
1002
|
function longestIncreasingSubsequence(a) {
|
799
|
-
let p = a.slice(), result = [];
|
800
|
-
result.push(0);
|
801
|
-
let u, v;
|
1003
|
+
let p = a.slice(), result = [0], u, v;
|
802
1004
|
for (let i = 0, il = a.length; i < il; ++i) {
|
803
1005
|
if (a[i] === -1)
|
804
1006
|
continue;
|
@@ -826,47 +1028,46 @@ function trimWalkString(walkString) {
|
|
826
1028
|
return walkString.slice(0, end + 1);
|
827
1029
|
}
|
828
1030
|
function walk(startNode, walkCodes, branch) {
|
829
|
-
walker.currentNode = startNode, walkInternal(0, walkCodes, branch)
|
1031
|
+
walker.currentNode = startNode, walkInternal(0, walkCodes, branch);
|
830
1032
|
}
|
831
1033
|
function walkInternal(currentWalkIndex, walkCodes, scope) {
|
832
1034
|
let value2, storedMultiplier = 0, currentMultiplier = 0, currentScopeIndex = 0;
|
833
|
-
for (;
|
834
|
-
if (currentMultiplier = storedMultiplier, storedMultiplier = 0, value2
|
835
|
-
|
836
|
-
else if (value2
|
837
|
-
|
838
|
-
walker.
|
839
|
-
walker.nextSibling();
|
840
|
-
} else if (value2 >= 97 /* Over */)
|
841
|
-
for (value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */; value2--; )
|
842
|
-
walker.nextSibling();
|
843
|
-
else if (value2 >= 67 /* Next */)
|
844
|
-
for (value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */; value2--; )
|
845
|
-
walker.nextNode();
|
846
|
-
else if (value2 === 47 /* BeginChild */)
|
847
|
-
currentWalkIndex = walkInternal(
|
848
|
-
currentWalkIndex,
|
849
|
-
walkCodes,
|
850
|
-
scope[currentScopeIndex++] = createScope(scope.$global, scope.c)
|
1035
|
+
for (; currentWalkIndex < walkCodes.length; )
|
1036
|
+
if (value2 = walkCodes.charCodeAt(currentWalkIndex++), currentMultiplier = storedMultiplier, storedMultiplier = 0, value2 === 32 /* Get */)
|
1037
|
+
scope[currentScopeIndex++] = walker.currentNode;
|
1038
|
+
else if (value2 === 37 /* Replace */)
|
1039
|
+
walker.currentNode.replaceWith(
|
1040
|
+
walker.currentNode = scope[currentScopeIndex++] = new Text()
|
851
1041
|
);
|
852
1042
|
else {
|
853
1043
|
if (value2 === 38 /* EndChild */)
|
854
1044
|
return currentWalkIndex;
|
855
|
-
if (value2 ===
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
1045
|
+
if (value2 === 47 /* BeginChild */)
|
1046
|
+
currentWalkIndex = walkInternal(
|
1047
|
+
currentWalkIndex,
|
1048
|
+
walkCodes,
|
1049
|
+
scope[currentScopeIndex++] = createScope(scope.$global, scope.c)
|
1050
|
+
);
|
1051
|
+
else if (value2 < 92)
|
1052
|
+
for (value2 = 20 /* Next */ * currentMultiplier + value2 - 67 /* Next */; value2--; )
|
1053
|
+
walker.nextNode();
|
1054
|
+
else if (value2 < 107)
|
1055
|
+
for (value2 = 10 /* Over */ * currentMultiplier + value2 - 97 /* Over */; value2--; )
|
1056
|
+
walker.nextSibling();
|
1057
|
+
else if (value2 < 117) {
|
1058
|
+
for (value2 = 10 /* Out */ * currentMultiplier + value2 - 107 /* Out */; value2--; )
|
1059
|
+
walker.parentNode();
|
1060
|
+
walker.nextSibling();
|
1061
|
+
} else
|
1062
|
+
storedMultiplier = currentMultiplier * 10 /* Multiplier */ + value2 - 117 /* Multiplier */;
|
861
1063
|
}
|
862
|
-
return currentWalkIndex;
|
863
1064
|
}
|
864
1065
|
|
865
1066
|
// src/dom/renderer.ts
|
866
1067
|
function createBranchScopeWithRenderer(renderer, $global, parentScope, parentNode) {
|
867
1068
|
let branch = createBranch(
|
868
1069
|
$global,
|
869
|
-
renderer.
|
1070
|
+
renderer.x || parentScope,
|
870
1071
|
parentScope
|
871
1072
|
);
|
872
1073
|
return initBranch(renderer, branch, parentNode), branch;
|
@@ -891,7 +1092,7 @@ function createBranch($global, ownerScope, parentScope) {
|
|
891
1092
|
}
|
892
1093
|
function initBranch(renderer, branch, parentNode) {
|
893
1094
|
let clone = renderer.k(parentNode.namespaceURI), cloneParent = clone.parentNode;
|
894
|
-
cloneParent ? (walk(cloneParent.firstChild, renderer.
|
1095
|
+
cloneParent ? (walk(cloneParent.firstChild, renderer.y, branch), branch.a = cloneParent.firstChild, branch.b = cloneParent.lastChild) : (walk(clone, renderer.y, branch), branch.a = branch.b = clone), renderer.z && queueRender(branch, renderer.z);
|
895
1096
|
}
|
896
1097
|
function dynamicTagAttrs(nodeAccessor, getContent, inputIsArgs) {
|
897
1098
|
return (scope, attrsOrOp) => {
|
@@ -903,7 +1104,7 @@ function dynamicTagAttrs(nodeAccessor, getContent, inputIsArgs) {
|
|
903
1104
|
return renderer.d?.(childScope, attrsOrOp);
|
904
1105
|
let content = getContent?.(scope);
|
905
1106
|
if (typeof renderer == "string")
|
906
|
-
|
1107
|
+
setConditionalRenderer(
|
907
1108
|
childScope,
|
908
1109
|
0,
|
909
1110
|
content,
|
@@ -926,12 +1127,12 @@ function dynamicTagAttrs(nodeAccessor, getContent, inputIsArgs) {
|
|
926
1127
|
function createRendererWithOwner(template, rawWalks, setup, getArgs) {
|
927
1128
|
let args, id = {}, walks = rawWalks ? /* @__PURE__ */ trimWalkString(rawWalks) : " ";
|
928
1129
|
return (owner) => ({
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
1130
|
+
A: id,
|
1131
|
+
B: template,
|
1132
|
+
y: walks,
|
1133
|
+
z: setup,
|
933
1134
|
k: _clone,
|
934
|
-
|
1135
|
+
x: owner,
|
935
1136
|
get d() {
|
936
1137
|
return args ||= getArgs?.();
|
937
1138
|
}
|
@@ -941,8 +1142,8 @@ function createRenderer(template, walks, setup, getArgs) {
|
|
941
1142
|
return createRendererWithOwner(template, walks, setup, getArgs)();
|
942
1143
|
}
|
943
1144
|
function _clone(ns) {
|
944
|
-
return ((cloneCache[ns] ||= {})[this.
|
945
|
-
this.
|
1145
|
+
return ((cloneCache[ns] ||= {})[this.B] ||= createCloneableHTML(
|
1146
|
+
this.B,
|
946
1147
|
ns
|
947
1148
|
))();
|
948
1149
|
}
|
@@ -956,7 +1157,7 @@ function createCloneableHTML(html2, ns) {
|
|
956
1157
|
function conditional(nodeAccessor, ...branches) {
|
957
1158
|
let branchAccessor = nodeAccessor + "(" /* ConditionalRenderer */;
|
958
1159
|
return (scope, newBranchIndexOrOp) => {
|
959
|
-
newBranchIndexOrOp !== scope[branchAccessor] && newBranchIndexOrOp !== DIRTY && newBranchIndexOrOp !== MARK && newBranchIndexOrOp !== CLEAN &&
|
1160
|
+
newBranchIndexOrOp !== scope[branchAccessor] && newBranchIndexOrOp !== DIRTY && newBranchIndexOrOp !== MARK && newBranchIndexOrOp !== CLEAN && setConditionalRenderer(
|
960
1161
|
scope,
|
961
1162
|
nodeAccessor,
|
962
1163
|
branches[scope[branchAccessor] = newBranchIndexOrOp],
|
@@ -972,40 +1173,21 @@ var dynamicTag = function(nodeAccessor, fn, getIntersection) {
|
|
972
1173
|
return (scope, newRendererOrOp) => {
|
973
1174
|
if (newRendererOrOp === DIRTY) return;
|
974
1175
|
let currentRenderer = scope[rendererAccessor], op = newRendererOrOp;
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
intersection2?.(scope, op);
|
1176
|
+
newRendererOrOp !== MARK && newRendererOrOp !== CLEAN && (isDifferentRenderer(
|
1177
|
+
currentRenderer,
|
1178
|
+
scope[rendererAccessor] = normalizeDynamicRenderer(newRendererOrOp)
|
1179
|
+
) ? (setConditionalRenderer(
|
1180
|
+
scope,
|
1181
|
+
nodeAccessor,
|
1182
|
+
scope[rendererAccessor],
|
1183
|
+
createBranchScopeWithTagNameOrRenderer
|
1184
|
+
), fn && fn(scope), op = DIRTY) : op = CLEAN), intersection2?.(scope, op);
|
985
1185
|
};
|
986
1186
|
};
|
987
1187
|
function setConditionalRenderer(scope, nodeAccessor, newRenderer, createBranch2) {
|
988
|
-
let prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */] ||
|
989
|
-
|
990
|
-
|
991
|
-
scope,
|
992
|
-
prevBranch.b.parentNode
|
993
|
-
) : getEmptyBranch(scope[nodeAccessor]);
|
994
|
-
prevBranch !== newBranch && (insertBranchBefore(
|
995
|
-
newBranch,
|
996
|
-
prevBranch.b.parentNode,
|
997
|
-
prevBranch.b.nextSibling
|
998
|
-
), removeAndDestroyBranch(prevBranch), scope[nodeAccessor + "!" /* ConditionalScope */] = newRenderer && newBranch);
|
999
|
-
}
|
1000
|
-
function setConditionalRendererOnlyChild(scope, nodeAccessor, newRenderer, createBranch2) {
|
1001
|
-
let prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */], referenceNode = scope[nodeAccessor], newBranch = newRenderer && createBranch2(newRenderer, scope.$global, scope, referenceNode);
|
1002
|
-
referenceNode.textContent = "", newBranch && insertBranchBefore(newBranch, referenceNode, null), prevBranch && destroyBranch(prevBranch), scope[nodeAccessor + "!" /* ConditionalScope */] = newBranch;
|
1003
|
-
}
|
1004
|
-
var emptyMarkerMap = /* @__PURE__ */ new Map([
|
1005
|
-
[Symbol(), /* @__PURE__ */ getEmptyBranch(0)]
|
1006
|
-
]), emptyMarkerArray = [
|
1007
|
-
/* @__PURE__ */ getEmptyBranch(0)
|
1008
|
-
], emptyMap = /* @__PURE__ */ new Map(), emptyArray = [];
|
1188
|
+
let referenceNode = scope[nodeAccessor], prevBranch = scope[nodeAccessor + "!" /* ConditionalScope */], parentNode = referenceNode.nodeType > 1 /* Element */ ? (prevBranch?.a || referenceNode).parentNode : referenceNode, newBranch = scope[nodeAccessor + "!" /* ConditionalScope */] = newRenderer && createBranch2(newRenderer, scope.$global, scope, parentNode);
|
1189
|
+
referenceNode === parentNode ? (prevBranch && (destroyBranch(prevBranch), referenceNode.textContent = ""), newBranch && insertBranchBefore(newBranch, parentNode, null)) : prevBranch ? (newBranch ? insertBranchBefore(newBranch, parentNode, prevBranch.a) : parentNode.insertBefore(referenceNode, prevBranch.a), removeAndDestroyBranch(prevBranch)) : newBranch && (insertBranchBefore(newBranch, parentNode, referenceNode), referenceNode.remove());
|
1190
|
+
}
|
1009
1191
|
function loopOf(nodeAccessor, renderer) {
|
1010
1192
|
return loop(
|
1011
1193
|
nodeAccessor,
|
@@ -1035,24 +1217,27 @@ function loopTo(nodeAccessor, renderer) {
|
|
1035
1217
|
function loop(nodeAccessor, renderer, forEach) {
|
1036
1218
|
let loopScopeAccessor = nodeAccessor + "!" /* LoopScopeArray */, params = renderer.d;
|
1037
1219
|
return (scope, valueOrOp) => {
|
1038
|
-
if (valueOrOp
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1220
|
+
if (valueOrOp !== DIRTY)
|
1221
|
+
if (valueOrOp === MARK || valueOrOp === CLEAN) {
|
1222
|
+
if (params)
|
1223
|
+
for (let branch of scope[loopScopeAccessor] || scope[nodeAccessor + "(" /* LoopScopeMap */]?.values() || [])
|
1224
|
+
params(branch, valueOrOp);
|
1225
|
+
} else {
|
1226
|
+
let referenceNode = scope[nodeAccessor], oldMap = scope[nodeAccessor + "(" /* LoopScopeMap */], oldArray = oldMap ? scope[nodeAccessor + "!" /* LoopScopeArray */] || [
|
1227
|
+
...oldMap.values()
|
1228
|
+
] : [], parentNode = referenceNode.nodeType > 1 /* Element */ ? referenceNode.parentNode || oldArray[0].a.parentNode : referenceNode, newMap = scope[nodeAccessor + "(" /* LoopScopeMap */] = /* @__PURE__ */ new Map(), newArray = scope[nodeAccessor + "!" /* LoopScopeArray */] = [];
|
1229
|
+
forEach(valueOrOp, (key, args) => {
|
1230
|
+
let branch = oldMap?.get(key) || createBranchScopeWithRenderer(
|
1231
|
+
renderer,
|
1232
|
+
scope.$global,
|
1233
|
+
scope,
|
1234
|
+
parentNode
|
1235
|
+
);
|
1236
|
+
params?.(branch, args), newMap.set(key, branch), newArray.push(branch);
|
1237
|
+
});
|
1238
|
+
let afterReference = null;
|
1239
|
+
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);
|
1240
|
+
}
|
1056
1241
|
};
|
1057
1242
|
}
|
1058
1243
|
function bySecondArg(_item, index) {
|
@@ -1062,226 +1247,8 @@ function byFirstArg(name) {
|
|
1062
1247
|
return name;
|
1063
1248
|
}
|
1064
1249
|
function isDifferentRenderer(a, b) {
|
1065
|
-
return a !== b && (a?.
|
1066
|
-
}
|
1067
|
-
|
1068
|
-
// src/dom/schedule.ts
|
1069
|
-
var port2 = /* @__PURE__ */ (() => {
|
1070
|
-
let { port1, port2: port22 } = new MessageChannel();
|
1071
|
-
return port1.onmessage = () => {
|
1072
|
-
isScheduled = !1, run();
|
1073
|
-
}, port22;
|
1074
|
-
})(), isScheduled;
|
1075
|
-
function schedule() {
|
1076
|
-
isScheduled || (isScheduled = !0, queueMicrotask(flushAndWaitFrame));
|
1077
|
-
}
|
1078
|
-
function flushAndWaitFrame() {
|
1079
|
-
run(), requestAnimationFrame(triggerMacroTask);
|
1080
|
-
}
|
1081
|
-
function triggerMacroTask() {
|
1082
|
-
port2.postMessage(0);
|
1083
|
-
}
|
1084
|
-
|
1085
|
-
// src/dom/signals.ts
|
1086
|
-
var MARK = {}, CLEAN = {}, DIRTY = {};
|
1087
|
-
function state(valueAccessor, fn, getIntersection) {
|
1088
|
-
let valueSignal = value(valueAccessor, fn, getIntersection), markAccessor = valueAccessor + "#" /* Mark */, valueChangeAccessor = valueAccessor + "@" /* TagVariableChange */;
|
1089
|
-
return (scope, valueOrOp, valueChange) => (rendering ? valueSignal(
|
1090
|
-
scope,
|
1091
|
-
valueOrOp === MARK || valueOrOp === CLEAN || valueOrOp === DIRTY || (scope[valueChangeAccessor] = valueChange) || scope[markAccessor] === void 0 ? valueOrOp : CLEAN
|
1092
|
-
) : scope[valueChangeAccessor] ? scope[valueChangeAccessor](valueOrOp) : (schedule(), queueSource(scope, valueSignal, valueOrOp)), valueOrOp);
|
1093
|
-
}
|
1094
|
-
function value(valueAccessor, fn, getIntersection) {
|
1095
|
-
let markAccessor = valueAccessor + "#" /* Mark */, intersection2;
|
1096
|
-
return (scope, valueOrOp) => {
|
1097
|
-
if (valueOrOp === MARK)
|
1098
|
-
(scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK);
|
1099
|
-
else if (valueOrOp !== DIRTY) {
|
1100
|
-
let existing = scope[markAccessor] !== void 0;
|
1101
|
-
(scope[markAccessor] ||= 1) === 1 && (valueOrOp === CLEAN || existing && scope[valueAccessor] === valueOrOp ? getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : (scope[valueAccessor] = valueOrOp, fn && fn(scope, valueOrOp), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY))), scope[markAccessor]--;
|
1102
|
-
}
|
1103
|
-
};
|
1104
|
-
}
|
1105
|
-
var accessorId = 0;
|
1106
|
-
function intersection(count, fn, getIntersection) {
|
1107
|
-
let dirtyAccessor = "?" /* Dynamic */ + accessorId++, markAccessor = dirtyAccessor + "#" /* Mark */, intersection2;
|
1108
|
-
return (scope, op) => {
|
1109
|
-
op === MARK ? (scope[markAccessor] = (scope[markAccessor] ?? 0) + 1) === 1 && getIntersection && (intersection2 ||= getIntersection())(scope, MARK) : scope[markAccessor] === void 0 ? (scope[markAccessor] = count - 1, scope[dirtyAccessor] = !0) : --scope[markAccessor] === 0 ? op === DIRTY || scope[dirtyAccessor] ? (scope[dirtyAccessor] = !1, fn(scope), getIntersection && (intersection2 ||= getIntersection())(scope, DIRTY)) : getIntersection && (intersection2 ||= getIntersection())(scope, CLEAN) : scope[dirtyAccessor] ||= op === DIRTY;
|
1110
|
-
};
|
1111
|
-
}
|
1112
|
-
function loopClosure(valueAccessor, ownerLoopNodeAccessor, fn, getIntersection) {
|
1113
|
-
let childSignal = closure(valueAccessor, fn, getIntersection), loopScopeAccessor = ownerLoopNodeAccessor + "!" /* LoopScopeArray */, loopScopeMapAccessor = ownerLoopNodeAccessor + "(" /* LoopScopeMap */, ownerSignal = (ownerScope) => {
|
1114
|
-
let loopScopes = ownerScope[loopScopeAccessor] ?? ownerScope[loopScopeMapAccessor]?.values() ?? [];
|
1115
|
-
if (loopScopes !== emptyMarkerArray)
|
1116
|
-
for (let scope of loopScopes)
|
1117
|
-
scope.g || queueSource(scope, childSignal);
|
1118
|
-
};
|
1119
|
-
return ownerSignal._ = childSignal, ownerSignal;
|
1120
|
-
}
|
1121
|
-
function conditionalClosure(valueAccessor, ownerConditionalNodeAccessor, branch, fn, getIntersection) {
|
1122
|
-
let childSignal = closure(valueAccessor, fn, getIntersection), scopeAccessor = ownerConditionalNodeAccessor + "!" /* ConditionalScope */, branchAccessor = ownerConditionalNodeAccessor + "(" /* ConditionalRenderer */, ownerSignal = (scope) => {
|
1123
|
-
let ifScope = scope[scopeAccessor];
|
1124
|
-
ifScope && !ifScope.g && scope[branchAccessor] === branch && queueSource(ifScope, childSignal);
|
1125
|
-
};
|
1126
|
-
return ownerSignal._ = childSignal, ownerSignal;
|
1127
|
-
}
|
1128
|
-
function dynamicClosure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
1129
|
-
let subscribersAccessor = "?" /* Dynamic */ + accessorId++, childSignal = closure(
|
1130
|
-
valueAccessor,
|
1131
|
-
fn,
|
1132
|
-
getIntersection,
|
1133
|
-
getOwnerScope
|
1134
|
-
), ownerSignal = (ownerScope) => {
|
1135
|
-
let subscribers = ownerScope[subscribersAccessor];
|
1136
|
-
if (subscribers)
|
1137
|
-
for (let subscriber of subscribers)
|
1138
|
-
subscriber.g || queueSource(subscriber, childSignal);
|
1139
|
-
}, subscribe = (scope) => {
|
1140
|
-
let owner = getOwnerScope ? getOwnerScope(scope) : scope._, subscribers = owner[subscribersAccessor] ||= /* @__PURE__ */ new Set();
|
1141
|
-
subscribers.has(scope) || (subscribers.add(scope), getAbortSignal(scope, -1).addEventListener(
|
1142
|
-
"abort",
|
1143
|
-
() => owner[subscribersAccessor].delete(scope)
|
1144
|
-
));
|
1145
|
-
};
|
1146
|
-
return ownerSignal.H = subscribe, ownerSignal._ = (scope) => {
|
1147
|
-
childSignal(scope), subscribe(scope);
|
1148
|
-
}, ownerSignal;
|
1149
|
-
}
|
1150
|
-
function registerDynamicClosure(id, valueAccessor, fn, getIntersection, getOwnerScope) {
|
1151
|
-
let signal = dynamicClosure(
|
1152
|
-
valueAccessor,
|
1153
|
-
fn,
|
1154
|
-
getIntersection,
|
1155
|
-
getOwnerScope
|
1156
|
-
);
|
1157
|
-
return register(id, signal.H), signal;
|
1158
|
-
}
|
1159
|
-
function closure(valueAccessor, fn, getIntersection, getOwnerScope) {
|
1160
|
-
let intersection2;
|
1161
|
-
return (scope, op) => {
|
1162
|
-
op || fn && fn(
|
1163
|
-
scope,
|
1164
|
-
(getOwnerScope ? getOwnerScope(scope) : scope._)[valueAccessor]
|
1165
|
-
), getIntersection && (intersection2 ||= getIntersection())(scope, op ? MARK : DIRTY);
|
1166
|
-
};
|
1167
|
-
}
|
1168
|
-
function setTagVar(scope, childAccessor, tagVarSignal2) {
|
1169
|
-
scope[childAccessor]["/" /* TagVariable */] = (valueOrOp) => tagVarSignal2(scope, valueOrOp);
|
1250
|
+
return a !== b && (a?.A || 0) !== b?.A;
|
1170
1251
|
}
|
1171
|
-
var tagVarSignal = (scope, valueOrOp) => scope["/" /* TagVariable */]?.(valueOrOp);
|
1172
|
-
function setTagVarChange(scope, changeHandler) {
|
1173
|
-
scope["@" /* TagVariableChange */] = changeHandler;
|
1174
|
-
}
|
1175
|
-
var tagVarSignalChange = (scope, value2) => scope["@" /* TagVariableChange */]?.(value2);
|
1176
|
-
var tagIdsByGlobal = /* @__PURE__ */ new WeakMap();
|
1177
|
-
function nextTagId({ $global }) {
|
1178
|
-
let id = tagIdsByGlobal.get($global) || 0;
|
1179
|
-
return tagIdsByGlobal.set($global, id + 1), "c" + $global.runtimeId + $global.renderId + id.toString(36);
|
1180
|
-
}
|
1181
|
-
function inChild(childAccessor, signal) {
|
1182
|
-
return (scope, valueOrOp) => {
|
1183
|
-
signal(scope[childAccessor], valueOrOp);
|
1184
|
-
};
|
1185
|
-
}
|
1186
|
-
function intersections(signals) {
|
1187
|
-
return (scope, op) => {
|
1188
|
-
for (let signal of signals)
|
1189
|
-
signal(scope, op);
|
1190
|
-
};
|
1191
|
-
}
|
1192
|
-
function effect(id, fn) {
|
1193
|
-
return register(id, fn), (scope) => {
|
1194
|
-
queueEffect(scope, fn);
|
1195
|
-
};
|
1196
|
-
}
|
1197
|
-
|
1198
|
-
// src/dom/queue.ts
|
1199
|
-
var pendingRenders = [], pendingEffects = [], rendering = !1;
|
1200
|
-
function queueSource(scope, signal, value2) {
|
1201
|
-
let prevRendering = rendering;
|
1202
|
-
rendering = !0, signal(scope, MARK), rendering = prevRendering, queueRender(scope, signal, value2);
|
1203
|
-
}
|
1204
|
-
function queueRender(scope, signal, value2) {
|
1205
|
-
let i = pendingRenders.length, render = {
|
1206
|
-
z: scope,
|
1207
|
-
I: signal,
|
1208
|
-
J: value2,
|
1209
|
-
A: scope.c?.f || 0,
|
1210
|
-
B: i
|
1211
|
-
};
|
1212
|
-
for (pendingRenders.push(render); i; ) {
|
1213
|
-
let parentIndex = i - 1 >> 1, parent = pendingRenders[parentIndex];
|
1214
|
-
if (comparePendingRenders(render, parent) >= 0) break;
|
1215
|
-
pendingRenders[i] = parent, i = parentIndex;
|
1216
|
-
}
|
1217
|
-
pendingRenders[i] = render;
|
1218
|
-
}
|
1219
|
-
function queueEffect(scope, fn) {
|
1220
|
-
pendingEffects.push(scope, fn);
|
1221
|
-
}
|
1222
|
-
function run() {
|
1223
|
-
let effects = pendingEffects;
|
1224
|
-
try {
|
1225
|
-
rendering = !0, runRenders();
|
1226
|
-
} finally {
|
1227
|
-
pendingRenders = [], pendingEffects = [], rendering = !1;
|
1228
|
-
}
|
1229
|
-
runEffects(effects);
|
1230
|
-
}
|
1231
|
-
function prepareEffects(fn) {
|
1232
|
-
let prevRenders = pendingRenders, prevEffects = pendingEffects, preparedEffects = pendingEffects = [];
|
1233
|
-
pendingRenders = [];
|
1234
|
-
try {
|
1235
|
-
rendering = !0, fn(), runRenders();
|
1236
|
-
} finally {
|
1237
|
-
rendering = !1, pendingRenders = prevRenders, pendingEffects = prevEffects;
|
1238
|
-
}
|
1239
|
-
return preparedEffects;
|
1240
|
-
}
|
1241
|
-
function runEffects(effects) {
|
1242
|
-
for (let i = 0; i < effects.length; i += 2 /* Total */) {
|
1243
|
-
let scope = effects[i], fn = effects[i + 1];
|
1244
|
-
fn(scope, scope);
|
1245
|
-
}
|
1246
|
-
}
|
1247
|
-
function runRenders() {
|
1248
|
-
for (; pendingRenders.length; ) {
|
1249
|
-
let render = pendingRenders[0], next = pendingRenders.pop();
|
1250
|
-
if (render !== next) {
|
1251
|
-
let i = 0, mid = pendingRenders.length >> 1, item = pendingRenders[0] = next;
|
1252
|
-
for (; i < mid; ) {
|
1253
|
-
let bestChild = (i << 1) + 1, right = bestChild + 1;
|
1254
|
-
if (right < pendingRenders.length && comparePendingRenders(
|
1255
|
-
pendingRenders[right],
|
1256
|
-
pendingRenders[bestChild]
|
1257
|
-
) < 0 && (bestChild = right), comparePendingRenders(pendingRenders[bestChild], item) >= 0)
|
1258
|
-
break;
|
1259
|
-
pendingRenders[i] = pendingRenders[bestChild], i = bestChild;
|
1260
|
-
}
|
1261
|
-
pendingRenders[i] = item;
|
1262
|
-
}
|
1263
|
-
render.z.c?.F || render.I(render.z, render.J);
|
1264
|
-
}
|
1265
|
-
finishPendingScopes();
|
1266
|
-
}
|
1267
|
-
function comparePendingRenders(a, b) {
|
1268
|
-
return a.A - b.A || a.B - b.B;
|
1269
|
-
}
|
1270
|
-
|
1271
|
-
// src/dom/abort-signal.ts
|
1272
|
-
function resetAbortSignal(scope, id) {
|
1273
|
-
let ctrl = scope.h?.[id];
|
1274
|
-
ctrl && (queueEffect(ctrl, abort), scope.h[id] = void 0);
|
1275
|
-
}
|
1276
|
-
function getAbortSignal(scope, id) {
|
1277
|
-
return scope.c && (scope.c.G ||= /* @__PURE__ */ new Set()).add(scope), ((scope.h ||= {})[id] ||= new AbortController()).signal;
|
1278
|
-
}
|
1279
|
-
function abort(ctrl) {
|
1280
|
-
ctrl.abort();
|
1281
|
-
}
|
1282
|
-
|
1283
|
-
// src/common/compat-meta.ts
|
1284
|
-
var prefix = "$C_", RENDERER_REGISTER_ID = prefix + "r", SET_SCOPE_REGISTER_ID = prefix + "s", RENDER_BODY_ID = prefix + "b";
|
1285
1252
|
|
1286
1253
|
// src/dom/compat.ts
|
1287
1254
|
var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
@@ -1336,7 +1303,7 @@ var classIdToBranch = /* @__PURE__ */ new Map(), compat = {
|
|
1336
1303
|
normalizedInput[key === "renderBody" ? "content" : key] = input[key];
|
1337
1304
|
}
|
1338
1305
|
if (component.effects = prepareEffects(() => {
|
1339
|
-
branch ? (applyArgs(branch, MARK), existing = !0) : (branch = component.scope = createScope(out.global), branch._ = renderer.
|
1306
|
+
branch ? (applyArgs(branch, MARK), existing = !0) : (branch = component.scope = createScope(out.global), branch._ = renderer.x, initBranch(renderer, branch, document.body)), applyArgs(branch, args);
|
1340
1307
|
}), !existing)
|
1341
1308
|
return toInsertNode(branch.a, branch.b);
|
1342
1309
|
}
|