@vue/runtime-core 3.5.0-alpha.4 → 3.5.0-alpha.5
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/runtime-core.cjs.js +2721 -2571
- package/dist/runtime-core.cjs.prod.js +2129 -1993
- package/dist/runtime-core.d.ts +19 -2
- package/dist/runtime-core.esm-bundler.js +2737 -2591
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.0-alpha.
|
|
2
|
+
* @vue/runtime-core v3.5.0-alpha.5
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -422,11 +422,8 @@ const TeleportImpl = {
|
|
|
422
422
|
if (n1 == null) {
|
|
423
423
|
const placeholder = n2.el = createText("");
|
|
424
424
|
const mainAnchor = n2.anchor = createText("");
|
|
425
|
-
const targetStart = n2.targetStart = createText("");
|
|
426
|
-
const targetAnchor = n2.targetAnchor = createText("");
|
|
427
425
|
insert(placeholder, container, anchor);
|
|
428
426
|
insert(mainAnchor, container, anchor);
|
|
429
|
-
targetStart[TeleportEndKey] = targetAnchor;
|
|
430
427
|
const mount = (container2, anchor2) => {
|
|
431
428
|
if (shapeFlag & 16) {
|
|
432
429
|
mountChildren(
|
|
@@ -443,9 +440,8 @@ const TeleportImpl = {
|
|
|
443
440
|
};
|
|
444
441
|
const mountToTarget = () => {
|
|
445
442
|
const target = n2.target = resolveTarget(n2.props, querySelector);
|
|
443
|
+
const targetAnchor = prepareAnchor(target, n2, createText, insert);
|
|
446
444
|
if (target) {
|
|
447
|
-
insert(targetStart, target);
|
|
448
|
-
insert(targetAnchor, target);
|
|
449
445
|
if (namespace !== "svg" && isTargetSVG(target)) {
|
|
450
446
|
namespace = "svg";
|
|
451
447
|
} else if (namespace !== "mathml" && isTargetMathML(target)) {
|
|
@@ -604,7 +600,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
604
600
|
}
|
|
605
601
|
}
|
|
606
602
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
|
|
607
|
-
o: { nextSibling, parentNode, querySelector }
|
|
603
|
+
o: { nextSibling, parentNode, querySelector, insert, createText }
|
|
608
604
|
}, hydrateChildren) {
|
|
609
605
|
const target = vnode.target = resolveTarget(
|
|
610
606
|
vnode.props,
|
|
@@ -623,20 +619,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
623
619
|
slotScopeIds,
|
|
624
620
|
optimized
|
|
625
621
|
);
|
|
626
|
-
vnode.
|
|
622
|
+
vnode.targetStart = targetNode;
|
|
623
|
+
vnode.targetAnchor = targetNode && nextSibling(targetNode);
|
|
627
624
|
} else {
|
|
628
625
|
vnode.anchor = nextSibling(node);
|
|
629
626
|
let targetAnchor = targetNode;
|
|
630
627
|
while (targetAnchor) {
|
|
631
|
-
targetAnchor
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
628
|
+
if (targetAnchor && targetAnchor.nodeType === 8) {
|
|
629
|
+
if (targetAnchor.data === "teleport start anchor") {
|
|
630
|
+
vnode.targetStart = targetAnchor;
|
|
631
|
+
} else if (targetAnchor.data === "teleport anchor") {
|
|
632
|
+
vnode.targetAnchor = targetAnchor;
|
|
633
|
+
target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
634
|
+
break;
|
|
635
|
+
}
|
|
636
636
|
}
|
|
637
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
638
|
+
}
|
|
639
|
+
if (!vnode.targetAnchor) {
|
|
640
|
+
prepareAnchor(target, vnode, createText, insert);
|
|
637
641
|
}
|
|
638
642
|
hydrateChildren(
|
|
639
|
-
targetNode,
|
|
643
|
+
targetNode && nextSibling(targetNode),
|
|
640
644
|
vnode,
|
|
641
645
|
target,
|
|
642
646
|
parentComponent,
|
|
@@ -662,6 +666,16 @@ function updateCssVars(vnode) {
|
|
|
662
666
|
ctx.ut();
|
|
663
667
|
}
|
|
664
668
|
}
|
|
669
|
+
function prepareAnchor(target, vnode, createText, insert) {
|
|
670
|
+
const targetStart = vnode.targetStart = createText("");
|
|
671
|
+
const targetAnchor = vnode.targetAnchor = createText("");
|
|
672
|
+
targetStart[TeleportEndKey] = targetAnchor;
|
|
673
|
+
if (target) {
|
|
674
|
+
insert(targetStart, target);
|
|
675
|
+
insert(targetAnchor, target);
|
|
676
|
+
}
|
|
677
|
+
return targetAnchor;
|
|
678
|
+
}
|
|
665
679
|
|
|
666
680
|
const leaveCbKey = Symbol("_leaveCb");
|
|
667
681
|
const enterCbKey = Symbol("_enterCb");
|
|
@@ -1015,2160 +1029,2280 @@ function markAsyncBoundary(instance) {
|
|
|
1015
1029
|
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
1016
1030
|
}
|
|
1017
1031
|
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1032
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
1033
|
+
if (shared.isArray(rawRef)) {
|
|
1034
|
+
rawRef.forEach(
|
|
1035
|
+
(r, i) => setRef(
|
|
1036
|
+
r,
|
|
1037
|
+
oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
|
|
1038
|
+
parentSuspense,
|
|
1039
|
+
vnode,
|
|
1040
|
+
isUnmount
|
|
1041
|
+
)
|
|
1042
|
+
);
|
|
1043
|
+
return;
|
|
1024
1044
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
retries++;
|
|
1040
|
-
pendingRequest = null;
|
|
1041
|
-
return load();
|
|
1042
|
-
};
|
|
1043
|
-
const load = () => {
|
|
1044
|
-
let thisRequest;
|
|
1045
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
1046
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
1047
|
-
if (userOnError) {
|
|
1048
|
-
return new Promise((resolve, reject) => {
|
|
1049
|
-
const userRetry = () => resolve(retry());
|
|
1050
|
-
const userFail = () => reject(err);
|
|
1051
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
1052
|
-
});
|
|
1053
|
-
} else {
|
|
1054
|
-
throw err;
|
|
1055
|
-
}
|
|
1056
|
-
}).then((comp) => {
|
|
1057
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
1058
|
-
return pendingRequest;
|
|
1059
|
-
}
|
|
1060
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
1061
|
-
comp = comp.default;
|
|
1062
|
-
}
|
|
1063
|
-
resolvedComp = comp;
|
|
1064
|
-
return comp;
|
|
1065
|
-
}));
|
|
1066
|
-
};
|
|
1067
|
-
return defineComponent({
|
|
1068
|
-
name: "AsyncComponentWrapper",
|
|
1069
|
-
__asyncLoader: load,
|
|
1070
|
-
get __asyncResolved() {
|
|
1071
|
-
return resolvedComp;
|
|
1072
|
-
},
|
|
1073
|
-
setup() {
|
|
1074
|
-
const instance = currentInstance;
|
|
1075
|
-
markAsyncBoundary(instance);
|
|
1076
|
-
if (resolvedComp) {
|
|
1077
|
-
return () => createInnerComp(resolvedComp, instance);
|
|
1078
|
-
}
|
|
1079
|
-
const onError = (err) => {
|
|
1080
|
-
pendingRequest = null;
|
|
1081
|
-
handleError(
|
|
1082
|
-
err,
|
|
1083
|
-
instance,
|
|
1084
|
-
13,
|
|
1085
|
-
!errorComponent
|
|
1086
|
-
);
|
|
1087
|
-
};
|
|
1088
|
-
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
1089
|
-
return load().then((comp) => {
|
|
1090
|
-
return () => createInnerComp(comp, instance);
|
|
1091
|
-
}).catch((err) => {
|
|
1092
|
-
onError(err);
|
|
1093
|
-
return () => errorComponent ? createVNode(errorComponent, {
|
|
1094
|
-
error: err
|
|
1095
|
-
}) : null;
|
|
1096
|
-
});
|
|
1097
|
-
}
|
|
1098
|
-
const loaded = reactivity.ref(false);
|
|
1099
|
-
const error = reactivity.ref();
|
|
1100
|
-
const delayed = reactivity.ref(!!delay);
|
|
1101
|
-
if (delay) {
|
|
1102
|
-
setTimeout(() => {
|
|
1103
|
-
delayed.value = false;
|
|
1104
|
-
}, delay);
|
|
1045
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
1049
|
+
const value = isUnmount ? null : refValue;
|
|
1050
|
+
const { i: owner, r: ref } = rawRef;
|
|
1051
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
1052
|
+
const refs = owner.refs === shared.EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1053
|
+
const setupState = owner.setupState;
|
|
1054
|
+
if (oldRef != null && oldRef !== ref) {
|
|
1055
|
+
if (shared.isString(oldRef)) {
|
|
1056
|
+
refs[oldRef] = null;
|
|
1057
|
+
if (shared.hasOwn(setupState, oldRef)) {
|
|
1058
|
+
setupState[oldRef] = null;
|
|
1105
1059
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1060
|
+
} else if (reactivity.isRef(oldRef)) {
|
|
1061
|
+
oldRef.value = null;
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
if (shared.isFunction(ref)) {
|
|
1065
|
+
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
1066
|
+
} else {
|
|
1067
|
+
const _isString = shared.isString(ref);
|
|
1068
|
+
const _isRef = reactivity.isRef(ref);
|
|
1069
|
+
if (_isString || _isRef) {
|
|
1070
|
+
const doSet = () => {
|
|
1071
|
+
if (rawRef.f) {
|
|
1072
|
+
const existing = _isString ? shared.hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1073
|
+
if (isUnmount) {
|
|
1074
|
+
shared.isArray(existing) && shared.remove(existing, refValue);
|
|
1075
|
+
} else {
|
|
1076
|
+
if (!shared.isArray(existing)) {
|
|
1077
|
+
if (_isString) {
|
|
1078
|
+
refs[ref] = [refValue];
|
|
1079
|
+
if (shared.hasOwn(setupState, ref)) {
|
|
1080
|
+
setupState[ref] = refs[ref];
|
|
1081
|
+
}
|
|
1082
|
+
} else {
|
|
1083
|
+
ref.value = [refValue];
|
|
1084
|
+
if (rawRef.k) refs[rawRef.k] = ref.value;
|
|
1085
|
+
}
|
|
1086
|
+
} else if (!existing.includes(refValue)) {
|
|
1087
|
+
existing.push(refValue);
|
|
1088
|
+
}
|
|
1114
1089
|
}
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
error.value = err;
|
|
1125
|
-
});
|
|
1126
|
-
return () => {
|
|
1127
|
-
if (loaded.value && resolvedComp) {
|
|
1128
|
-
return createInnerComp(resolvedComp, instance);
|
|
1129
|
-
} else if (error.value && errorComponent) {
|
|
1130
|
-
return createVNode(errorComponent, {
|
|
1131
|
-
error: error.value
|
|
1132
|
-
});
|
|
1133
|
-
} else if (loadingComponent && !delayed.value) {
|
|
1134
|
-
return createVNode(loadingComponent);
|
|
1135
|
-
}
|
|
1090
|
+
} else if (_isString) {
|
|
1091
|
+
refs[ref] = value;
|
|
1092
|
+
if (shared.hasOwn(setupState, ref)) {
|
|
1093
|
+
setupState[ref] = value;
|
|
1094
|
+
}
|
|
1095
|
+
} else if (_isRef) {
|
|
1096
|
+
ref.value = value;
|
|
1097
|
+
if (rawRef.k) refs[rawRef.k] = value;
|
|
1098
|
+
} else ;
|
|
1136
1099
|
};
|
|
1100
|
+
if (value) {
|
|
1101
|
+
doSet.id = -1;
|
|
1102
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
1103
|
+
} else {
|
|
1104
|
+
doSet();
|
|
1105
|
+
}
|
|
1137
1106
|
}
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
function createInnerComp(comp, parent) {
|
|
1141
|
-
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
1142
|
-
const vnode = createVNode(comp, props, children);
|
|
1143
|
-
vnode.ref = ref2;
|
|
1144
|
-
vnode.ce = ce;
|
|
1145
|
-
delete parent.vnode.ce;
|
|
1146
|
-
return vnode;
|
|
1107
|
+
}
|
|
1147
1108
|
}
|
|
1148
1109
|
|
|
1149
|
-
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1110
|
+
let hasLoggedMismatchError = false;
|
|
1111
|
+
const logMismatchError = () => {
|
|
1112
|
+
if (hasLoggedMismatchError) {
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
console.error("Hydration completed but contains mismatches.");
|
|
1116
|
+
hasLoggedMismatchError = true;
|
|
1117
|
+
};
|
|
1118
|
+
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1119
|
+
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
1120
|
+
const getContainerType = (container) => {
|
|
1121
|
+
if (isSVGContainer(container)) return "svg";
|
|
1122
|
+
if (isMathMLContainer(container)) return "mathml";
|
|
1123
|
+
return void 0;
|
|
1124
|
+
};
|
|
1125
|
+
const isComment = (node) => node.nodeType === 8;
|
|
1126
|
+
function createHydrationFunctions(rendererInternals) {
|
|
1127
|
+
const {
|
|
1128
|
+
mt: mountComponent,
|
|
1129
|
+
p: patch,
|
|
1130
|
+
o: {
|
|
1131
|
+
patchProp,
|
|
1132
|
+
createText,
|
|
1133
|
+
nextSibling,
|
|
1134
|
+
parentNode,
|
|
1135
|
+
remove,
|
|
1136
|
+
insert,
|
|
1137
|
+
createComment
|
|
1169
1138
|
}
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
m: move,
|
|
1178
|
-
um: _unmount,
|
|
1179
|
-
o: { createElement }
|
|
1180
|
-
}
|
|
1181
|
-
} = sharedContext;
|
|
1182
|
-
const storageContainer = createElement("div");
|
|
1183
|
-
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
1184
|
-
const instance2 = vnode.component;
|
|
1185
|
-
move(vnode, container, anchor, 0, parentSuspense);
|
|
1186
|
-
patch(
|
|
1187
|
-
instance2.vnode,
|
|
1188
|
-
vnode,
|
|
1189
|
-
container,
|
|
1190
|
-
anchor,
|
|
1191
|
-
instance2,
|
|
1192
|
-
parentSuspense,
|
|
1193
|
-
namespace,
|
|
1194
|
-
vnode.slotScopeIds,
|
|
1195
|
-
optimized
|
|
1196
|
-
);
|
|
1197
|
-
queuePostRenderEffect(() => {
|
|
1198
|
-
instance2.isDeactivated = false;
|
|
1199
|
-
if (instance2.a) {
|
|
1200
|
-
shared.invokeArrayFns(instance2.a);
|
|
1201
|
-
}
|
|
1202
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
1203
|
-
if (vnodeHook) {
|
|
1204
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1205
|
-
}
|
|
1206
|
-
}, parentSuspense);
|
|
1207
|
-
};
|
|
1208
|
-
sharedContext.deactivate = (vnode) => {
|
|
1209
|
-
const instance2 = vnode.component;
|
|
1210
|
-
invalidateMount(instance2.m);
|
|
1211
|
-
invalidateMount(instance2.a);
|
|
1212
|
-
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
1213
|
-
queuePostRenderEffect(() => {
|
|
1214
|
-
if (instance2.da) {
|
|
1215
|
-
shared.invokeArrayFns(instance2.da);
|
|
1216
|
-
}
|
|
1217
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
1218
|
-
if (vnodeHook) {
|
|
1219
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1220
|
-
}
|
|
1221
|
-
instance2.isDeactivated = true;
|
|
1222
|
-
}, parentSuspense);
|
|
1223
|
-
};
|
|
1224
|
-
function unmount(vnode) {
|
|
1225
|
-
resetShapeFlag(vnode);
|
|
1226
|
-
_unmount(vnode, instance, parentSuspense, true);
|
|
1227
|
-
}
|
|
1228
|
-
function pruneCache(filter) {
|
|
1229
|
-
cache.forEach((vnode, key) => {
|
|
1230
|
-
const name = getComponentName(vnode.type);
|
|
1231
|
-
if (name && (!filter || !filter(name))) {
|
|
1232
|
-
pruneCacheEntry(key);
|
|
1233
|
-
}
|
|
1234
|
-
});
|
|
1235
|
-
}
|
|
1236
|
-
function pruneCacheEntry(key) {
|
|
1237
|
-
const cached = cache.get(key);
|
|
1238
|
-
if (!current || !isSameVNodeType(cached, current)) {
|
|
1239
|
-
unmount(cached);
|
|
1240
|
-
} else if (current) {
|
|
1241
|
-
resetShapeFlag(current);
|
|
1242
|
-
}
|
|
1243
|
-
cache.delete(key);
|
|
1244
|
-
keys.delete(key);
|
|
1139
|
+
} = rendererInternals;
|
|
1140
|
+
const hydrate = (vnode, container) => {
|
|
1141
|
+
if (!container.hasChildNodes()) {
|
|
1142
|
+
patch(null, vnode, container);
|
|
1143
|
+
flushPostFlushCbs();
|
|
1144
|
+
container._vnode = vnode;
|
|
1145
|
+
return;
|
|
1245
1146
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1147
|
+
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
1148
|
+
flushPostFlushCbs();
|
|
1149
|
+
container._vnode = vnode;
|
|
1150
|
+
};
|
|
1151
|
+
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1152
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
1153
|
+
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1154
|
+
const onMismatch = () => handleMismatch(
|
|
1155
|
+
node,
|
|
1156
|
+
vnode,
|
|
1157
|
+
parentComponent,
|
|
1158
|
+
parentSuspense,
|
|
1159
|
+
slotScopeIds,
|
|
1160
|
+
isFragmentStart
|
|
1254
1161
|
);
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1162
|
+
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
1163
|
+
let domType = node.nodeType;
|
|
1164
|
+
vnode.el = node;
|
|
1165
|
+
if (patchFlag === -2) {
|
|
1166
|
+
optimized = false;
|
|
1167
|
+
vnode.dynamicChildren = null;
|
|
1168
|
+
}
|
|
1169
|
+
let nextNode = null;
|
|
1170
|
+
switch (type) {
|
|
1171
|
+
case Text:
|
|
1172
|
+
if (domType !== 3) {
|
|
1173
|
+
if (vnode.children === "") {
|
|
1174
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1175
|
+
nextNode = node;
|
|
1176
|
+
} else {
|
|
1177
|
+
nextNode = onMismatch();
|
|
1178
|
+
}
|
|
1262
1179
|
} else {
|
|
1263
|
-
|
|
1180
|
+
if (node.data !== vnode.children) {
|
|
1181
|
+
logMismatchError();
|
|
1182
|
+
node.data = vnode.children;
|
|
1183
|
+
}
|
|
1184
|
+
nextNode = nextSibling(node);
|
|
1264
1185
|
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1186
|
+
break;
|
|
1187
|
+
case Comment:
|
|
1188
|
+
if (isTemplateNode(node)) {
|
|
1189
|
+
nextNode = nextSibling(node);
|
|
1190
|
+
replaceNode(
|
|
1191
|
+
vnode.el = node.content.firstChild,
|
|
1192
|
+
node,
|
|
1193
|
+
parentComponent
|
|
1194
|
+
);
|
|
1195
|
+
} else if (domType !== 8 || isFragmentStart) {
|
|
1196
|
+
nextNode = onMismatch();
|
|
1197
|
+
} else {
|
|
1198
|
+
nextNode = nextSibling(node);
|
|
1278
1199
|
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
if (!slots.default) {
|
|
1285
|
-
return null;
|
|
1286
|
-
}
|
|
1287
|
-
const children = slots.default();
|
|
1288
|
-
const rawVNode = children[0];
|
|
1289
|
-
if (children.length > 1) {
|
|
1290
|
-
current = null;
|
|
1291
|
-
return children;
|
|
1292
|
-
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
|
|
1293
|
-
current = null;
|
|
1294
|
-
return rawVNode;
|
|
1295
|
-
}
|
|
1296
|
-
let vnode = getInnerChild(rawVNode);
|
|
1297
|
-
const comp = vnode.type;
|
|
1298
|
-
const name = getComponentName(
|
|
1299
|
-
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
1300
|
-
);
|
|
1301
|
-
const { include, exclude, max } = props;
|
|
1302
|
-
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
|
|
1303
|
-
current = vnode;
|
|
1304
|
-
return rawVNode;
|
|
1305
|
-
}
|
|
1306
|
-
const key = vnode.key == null ? comp : vnode.key;
|
|
1307
|
-
const cachedVNode = cache.get(key);
|
|
1308
|
-
if (vnode.el) {
|
|
1309
|
-
vnode = cloneVNode(vnode);
|
|
1310
|
-
if (rawVNode.shapeFlag & 128) {
|
|
1311
|
-
rawVNode.ssContent = vnode;
|
|
1200
|
+
break;
|
|
1201
|
+
case Static:
|
|
1202
|
+
if (isFragmentStart) {
|
|
1203
|
+
node = nextSibling(node);
|
|
1204
|
+
domType = node.nodeType;
|
|
1312
1205
|
}
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1206
|
+
if (domType === 1 || domType === 3) {
|
|
1207
|
+
nextNode = node;
|
|
1208
|
+
const needToAdoptContent = !vnode.children.length;
|
|
1209
|
+
for (let i = 0; i < vnode.staticCount; i++) {
|
|
1210
|
+
if (needToAdoptContent)
|
|
1211
|
+
vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
|
|
1212
|
+
if (i === vnode.staticCount - 1) {
|
|
1213
|
+
vnode.anchor = nextNode;
|
|
1214
|
+
}
|
|
1215
|
+
nextNode = nextSibling(nextNode);
|
|
1216
|
+
}
|
|
1217
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
1218
|
+
} else {
|
|
1219
|
+
onMismatch();
|
|
1320
1220
|
}
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1221
|
+
break;
|
|
1222
|
+
case Fragment:
|
|
1223
|
+
if (!isFragmentStart) {
|
|
1224
|
+
nextNode = onMismatch();
|
|
1225
|
+
} else {
|
|
1226
|
+
nextNode = hydrateFragment(
|
|
1227
|
+
node,
|
|
1228
|
+
vnode,
|
|
1229
|
+
parentComponent,
|
|
1230
|
+
parentSuspense,
|
|
1231
|
+
slotScopeIds,
|
|
1232
|
+
optimized
|
|
1233
|
+
);
|
|
1328
1234
|
}
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1235
|
+
break;
|
|
1236
|
+
default:
|
|
1237
|
+
if (shapeFlag & 1) {
|
|
1238
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
1239
|
+
nextNode = onMismatch();
|
|
1240
|
+
} else {
|
|
1241
|
+
nextNode = hydrateElement(
|
|
1242
|
+
node,
|
|
1243
|
+
vnode,
|
|
1244
|
+
parentComponent,
|
|
1245
|
+
parentSuspense,
|
|
1246
|
+
slotScopeIds,
|
|
1247
|
+
optimized
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
} else if (shapeFlag & 6) {
|
|
1251
|
+
vnode.slotScopeIds = slotScopeIds;
|
|
1252
|
+
const container = parentNode(node);
|
|
1253
|
+
if (isFragmentStart) {
|
|
1254
|
+
nextNode = locateClosingAnchor(node);
|
|
1255
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
1256
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1257
|
+
} else {
|
|
1258
|
+
nextNode = nextSibling(node);
|
|
1259
|
+
}
|
|
1260
|
+
mountComponent(
|
|
1261
|
+
vnode,
|
|
1262
|
+
container,
|
|
1263
|
+
null,
|
|
1264
|
+
parentComponent,
|
|
1265
|
+
parentSuspense,
|
|
1266
|
+
getContainerType(container),
|
|
1267
|
+
optimized
|
|
1268
|
+
);
|
|
1269
|
+
if (isAsyncWrapper(vnode)) {
|
|
1270
|
+
let subTree;
|
|
1271
|
+
if (isFragmentStart) {
|
|
1272
|
+
subTree = createVNode(Fragment);
|
|
1273
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1274
|
+
} else {
|
|
1275
|
+
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1276
|
+
}
|
|
1277
|
+
subTree.el = node;
|
|
1278
|
+
vnode.component.subTree = subTree;
|
|
1279
|
+
}
|
|
1280
|
+
} else if (shapeFlag & 64) {
|
|
1281
|
+
if (domType !== 8) {
|
|
1282
|
+
nextNode = onMismatch();
|
|
1283
|
+
} else {
|
|
1284
|
+
nextNode = vnode.type.hydrate(
|
|
1285
|
+
node,
|
|
1286
|
+
vnode,
|
|
1287
|
+
parentComponent,
|
|
1288
|
+
parentSuspense,
|
|
1289
|
+
slotScopeIds,
|
|
1290
|
+
optimized,
|
|
1291
|
+
rendererInternals,
|
|
1292
|
+
hydrateChildren
|
|
1293
|
+
);
|
|
1294
|
+
}
|
|
1295
|
+
} else if (shapeFlag & 128) {
|
|
1296
|
+
nextNode = vnode.type.hydrate(
|
|
1297
|
+
node,
|
|
1298
|
+
vnode,
|
|
1299
|
+
parentComponent,
|
|
1300
|
+
parentSuspense,
|
|
1301
|
+
getContainerType(parentNode(node)),
|
|
1302
|
+
slotScopeIds,
|
|
1303
|
+
optimized,
|
|
1304
|
+
rendererInternals,
|
|
1305
|
+
hydrateNode
|
|
1306
|
+
);
|
|
1307
|
+
} else ;
|
|
1372
1308
|
}
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
1376
|
-
const injected = injectHook(
|
|
1377
|
-
type,
|
|
1378
|
-
hook,
|
|
1379
|
-
keepAliveRoot,
|
|
1380
|
-
true
|
|
1381
|
-
/* prepend */
|
|
1382
|
-
);
|
|
1383
|
-
onUnmounted(() => {
|
|
1384
|
-
shared.remove(keepAliveRoot[type], injected);
|
|
1385
|
-
}, target);
|
|
1386
|
-
}
|
|
1387
|
-
function resetShapeFlag(vnode) {
|
|
1388
|
-
vnode.shapeFlag &= ~256;
|
|
1389
|
-
vnode.shapeFlag &= ~512;
|
|
1390
|
-
}
|
|
1391
|
-
function getInnerChild(vnode) {
|
|
1392
|
-
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
1396
|
-
if (target) {
|
|
1397
|
-
const hooks = target[type] || (target[type] = []);
|
|
1398
|
-
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
1399
|
-
reactivity.pauseTracking();
|
|
1400
|
-
const reset = setCurrentInstance(target);
|
|
1401
|
-
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
1402
|
-
reset();
|
|
1403
|
-
reactivity.resetTracking();
|
|
1404
|
-
return res;
|
|
1405
|
-
});
|
|
1406
|
-
if (prepend) {
|
|
1407
|
-
hooks.unshift(wrappedHook);
|
|
1408
|
-
} else {
|
|
1409
|
-
hooks.push(wrappedHook);
|
|
1309
|
+
if (ref != null) {
|
|
1310
|
+
setRef(ref, null, parentSuspense, vnode);
|
|
1410
1311
|
}
|
|
1411
|
-
return
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
const
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
);
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1312
|
+
return nextNode;
|
|
1313
|
+
};
|
|
1314
|
+
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1315
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
1316
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
1317
|
+
const forcePatch = type === "input" || type === "option";
|
|
1318
|
+
if (forcePatch || patchFlag !== -1) {
|
|
1319
|
+
if (dirs) {
|
|
1320
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
1321
|
+
}
|
|
1322
|
+
let needCallTransitionHooks = false;
|
|
1323
|
+
if (isTemplateNode(el)) {
|
|
1324
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1325
|
+
const content = el.content.firstChild;
|
|
1326
|
+
if (needCallTransitionHooks) {
|
|
1327
|
+
transition.beforeEnter(content);
|
|
1328
|
+
}
|
|
1329
|
+
replaceNode(content, el, parentComponent);
|
|
1330
|
+
vnode.el = el = content;
|
|
1331
|
+
}
|
|
1332
|
+
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
1333
|
+
!(props && (props.innerHTML || props.textContent))) {
|
|
1334
|
+
let next = hydrateChildren(
|
|
1335
|
+
el.firstChild,
|
|
1336
|
+
vnode,
|
|
1337
|
+
el,
|
|
1338
|
+
parentComponent,
|
|
1339
|
+
parentSuspense,
|
|
1340
|
+
slotScopeIds,
|
|
1341
|
+
optimized
|
|
1342
|
+
);
|
|
1343
|
+
while (next) {
|
|
1344
|
+
if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
|
|
1345
|
+
logMismatchError();
|
|
1346
|
+
}
|
|
1347
|
+
const cur = next;
|
|
1348
|
+
next = next.nextSibling;
|
|
1349
|
+
remove(cur);
|
|
1350
|
+
}
|
|
1351
|
+
} else if (shapeFlag & 8) {
|
|
1352
|
+
if (el.textContent !== vnode.children) {
|
|
1353
|
+
if (!isMismatchAllowed(el, 0 /* TEXT */)) {
|
|
1354
|
+
logMismatchError();
|
|
1355
|
+
}
|
|
1356
|
+
el.textContent = vnode.children;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
if (props) {
|
|
1360
|
+
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
1361
|
+
for (const key in props) {
|
|
1362
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
1363
|
+
key[0] === ".") {
|
|
1364
|
+
patchProp(el, key, null, props[key], void 0, parentComponent);
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
} else if (props.onClick) {
|
|
1368
|
+
patchProp(
|
|
1369
|
+
el,
|
|
1370
|
+
"onClick",
|
|
1371
|
+
null,
|
|
1372
|
+
props.onClick,
|
|
1373
|
+
void 0,
|
|
1374
|
+
parentComponent
|
|
1375
|
+
);
|
|
1376
|
+
} else if (patchFlag & 4 && reactivity.isReactive(props.style)) {
|
|
1377
|
+
for (const key in props.style) props.style[key];
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
let vnodeHooks;
|
|
1381
|
+
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
1382
|
+
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1383
|
+
}
|
|
1384
|
+
if (dirs) {
|
|
1385
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1386
|
+
}
|
|
1387
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
1388
|
+
queueEffectWithSuspense(() => {
|
|
1389
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1390
|
+
needCallTransitionHooks && transition.enter(el);
|
|
1391
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
1392
|
+
}, parentSuspense);
|
|
1463
1393
|
}
|
|
1464
1394
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
ret = new Array(keys.length);
|
|
1513
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
1514
|
-
const key = keys[i];
|
|
1515
|
-
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
1395
|
+
return el.nextSibling;
|
|
1396
|
+
};
|
|
1397
|
+
const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1398
|
+
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
1399
|
+
const children = parentVNode.children;
|
|
1400
|
+
const l = children.length;
|
|
1401
|
+
for (let i = 0; i < l; i++) {
|
|
1402
|
+
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
1403
|
+
const isText = vnode.type === Text;
|
|
1404
|
+
if (node) {
|
|
1405
|
+
if (isText && !optimized) {
|
|
1406
|
+
let next = children[i + 1];
|
|
1407
|
+
if (next && (next = normalizeVNode(next)).type === Text) {
|
|
1408
|
+
insert(
|
|
1409
|
+
createText(
|
|
1410
|
+
node.data.slice(vnode.children.length)
|
|
1411
|
+
),
|
|
1412
|
+
container,
|
|
1413
|
+
nextSibling(node)
|
|
1414
|
+
);
|
|
1415
|
+
node.data = vnode.children;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
node = hydrateNode(
|
|
1419
|
+
node,
|
|
1420
|
+
vnode,
|
|
1421
|
+
parentComponent,
|
|
1422
|
+
parentSuspense,
|
|
1423
|
+
slotScopeIds,
|
|
1424
|
+
optimized
|
|
1425
|
+
);
|
|
1426
|
+
} else if (isText && !vnode.children) {
|
|
1427
|
+
insert(vnode.el = createText(""), container);
|
|
1428
|
+
} else {
|
|
1429
|
+
if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
|
|
1430
|
+
logMismatchError();
|
|
1431
|
+
}
|
|
1432
|
+
patch(
|
|
1433
|
+
null,
|
|
1434
|
+
vnode,
|
|
1435
|
+
container,
|
|
1436
|
+
null,
|
|
1437
|
+
parentComponent,
|
|
1438
|
+
parentSuspense,
|
|
1439
|
+
getContainerType(container),
|
|
1440
|
+
slotScopeIds
|
|
1441
|
+
);
|
|
1516
1442
|
}
|
|
1517
1443
|
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
return ret;
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
function createSlots(slots, dynamicSlots) {
|
|
1528
|
-
for (let i = 0; i < dynamicSlots.length; i++) {
|
|
1529
|
-
const slot = dynamicSlots[i];
|
|
1530
|
-
if (shared.isArray(slot)) {
|
|
1531
|
-
for (let j = 0; j < slot.length; j++) {
|
|
1532
|
-
slots[slot[j].name] = slot[j].fn;
|
|
1533
|
-
}
|
|
1534
|
-
} else if (slot) {
|
|
1535
|
-
slots[slot.name] = slot.key ? (...args) => {
|
|
1536
|
-
const res = slot.fn(...args);
|
|
1537
|
-
if (res) res.key = slot.key;
|
|
1538
|
-
return res;
|
|
1539
|
-
} : slot.fn;
|
|
1444
|
+
return node;
|
|
1445
|
+
};
|
|
1446
|
+
const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
1447
|
+
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
1448
|
+
if (fragmentSlotScopeIds) {
|
|
1449
|
+
slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
1540
1450
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
Fragment,
|
|
1558
|
-
{
|
|
1559
|
-
key: (props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
1560
|
-
// key attached in the `createSlots` helper, respect that
|
|
1561
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
1562
|
-
(!validSlotContent && fallback ? "_fb" : "")
|
|
1563
|
-
},
|
|
1564
|
-
validSlotContent || (fallback ? fallback() : []),
|
|
1565
|
-
validSlotContent && slots._ === 1 ? 64 : -2
|
|
1566
|
-
);
|
|
1567
|
-
if (!noSlotted && rendered.scopeId) {
|
|
1568
|
-
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
1569
|
-
}
|
|
1570
|
-
if (slot && slot._c) {
|
|
1571
|
-
slot._d = true;
|
|
1572
|
-
}
|
|
1573
|
-
return rendered;
|
|
1574
|
-
}
|
|
1575
|
-
function ensureValidVNode(vnodes) {
|
|
1576
|
-
return vnodes.some((child) => {
|
|
1577
|
-
if (!isVNode(child)) return true;
|
|
1578
|
-
if (child.type === Comment) return false;
|
|
1579
|
-
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
1580
|
-
return false;
|
|
1581
|
-
return true;
|
|
1582
|
-
}) ? vnodes : null;
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
1586
|
-
const ret = {};
|
|
1587
|
-
for (const key in obj) {
|
|
1588
|
-
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
1589
|
-
}
|
|
1590
|
-
return ret;
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
const getPublicInstance = (i) => {
|
|
1594
|
-
if (!i) return null;
|
|
1595
|
-
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
1596
|
-
return getPublicInstance(i.parent);
|
|
1597
|
-
};
|
|
1598
|
-
const publicPropertiesMap = (
|
|
1599
|
-
// Move PURE marker to new line to workaround compiler discarding it
|
|
1600
|
-
// due to type annotation
|
|
1601
|
-
/* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
|
|
1602
|
-
$: (i) => i,
|
|
1603
|
-
$el: (i) => i.vnode.el,
|
|
1604
|
-
$data: (i) => i.data,
|
|
1605
|
-
$props: (i) => i.props,
|
|
1606
|
-
$attrs: (i) => i.attrs,
|
|
1607
|
-
$slots: (i) => i.slots,
|
|
1608
|
-
$refs: (i) => i.refs,
|
|
1609
|
-
$parent: (i) => getPublicInstance(i.parent),
|
|
1610
|
-
$root: (i) => getPublicInstance(i.root),
|
|
1611
|
-
$emit: (i) => i.emit,
|
|
1612
|
-
$options: (i) => resolveMergedOptions(i) ,
|
|
1613
|
-
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
1614
|
-
queueJob(i.update);
|
|
1615
|
-
}),
|
|
1616
|
-
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
1617
|
-
$watch: (i) => instanceWatch.bind(i)
|
|
1618
|
-
})
|
|
1619
|
-
);
|
|
1620
|
-
const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
|
|
1621
|
-
const PublicInstanceProxyHandlers = {
|
|
1622
|
-
get({ _: instance }, key) {
|
|
1623
|
-
if (key === "__v_skip") {
|
|
1624
|
-
return true;
|
|
1451
|
+
const container = parentNode(node);
|
|
1452
|
+
const next = hydrateChildren(
|
|
1453
|
+
nextSibling(node),
|
|
1454
|
+
vnode,
|
|
1455
|
+
container,
|
|
1456
|
+
parentComponent,
|
|
1457
|
+
parentSuspense,
|
|
1458
|
+
slotScopeIds,
|
|
1459
|
+
optimized
|
|
1460
|
+
);
|
|
1461
|
+
if (next && isComment(next) && next.data === "]") {
|
|
1462
|
+
return nextSibling(vnode.anchor = next);
|
|
1463
|
+
} else {
|
|
1464
|
+
logMismatchError();
|
|
1465
|
+
insert(vnode.anchor = createComment(`]`), container, next);
|
|
1466
|
+
return next;
|
|
1625
1467
|
}
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
if (
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1468
|
+
};
|
|
1469
|
+
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
1470
|
+
if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
|
|
1471
|
+
logMismatchError();
|
|
1472
|
+
}
|
|
1473
|
+
vnode.el = null;
|
|
1474
|
+
if (isFragment) {
|
|
1475
|
+
const end = locateClosingAnchor(node);
|
|
1476
|
+
while (true) {
|
|
1477
|
+
const next2 = nextSibling(node);
|
|
1478
|
+
if (next2 && next2 !== end) {
|
|
1479
|
+
remove(next2);
|
|
1480
|
+
} else {
|
|
1481
|
+
break;
|
|
1640
1482
|
}
|
|
1641
|
-
} else if (hasSetupBinding(setupState, key)) {
|
|
1642
|
-
accessCache[key] = 1 /* SETUP */;
|
|
1643
|
-
return setupState[key];
|
|
1644
|
-
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
1645
|
-
accessCache[key] = 2 /* DATA */;
|
|
1646
|
-
return data[key];
|
|
1647
|
-
} else if (
|
|
1648
|
-
// only cache other properties when instance has declared (thus stable)
|
|
1649
|
-
// props
|
|
1650
|
-
(normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
|
|
1651
|
-
) {
|
|
1652
|
-
accessCache[key] = 3 /* PROPS */;
|
|
1653
|
-
return props[key];
|
|
1654
|
-
} else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
1655
|
-
accessCache[key] = 4 /* CONTEXT */;
|
|
1656
|
-
return ctx[key];
|
|
1657
|
-
} else if (shouldCacheAccess) {
|
|
1658
|
-
accessCache[key] = 0 /* OTHER */;
|
|
1659
1483
|
}
|
|
1660
1484
|
}
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
{
|
|
1681
|
-
|
|
1485
|
+
const next = nextSibling(node);
|
|
1486
|
+
const container = parentNode(node);
|
|
1487
|
+
remove(node);
|
|
1488
|
+
patch(
|
|
1489
|
+
null,
|
|
1490
|
+
vnode,
|
|
1491
|
+
container,
|
|
1492
|
+
next,
|
|
1493
|
+
parentComponent,
|
|
1494
|
+
parentSuspense,
|
|
1495
|
+
getContainerType(container),
|
|
1496
|
+
slotScopeIds
|
|
1497
|
+
);
|
|
1498
|
+
return next;
|
|
1499
|
+
};
|
|
1500
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
1501
|
+
let match = 0;
|
|
1502
|
+
while (node) {
|
|
1503
|
+
node = nextSibling(node);
|
|
1504
|
+
if (node && isComment(node)) {
|
|
1505
|
+
if (node.data === open) match++;
|
|
1506
|
+
if (node.data === close) {
|
|
1507
|
+
if (match === 0) {
|
|
1508
|
+
return nextSibling(node);
|
|
1509
|
+
} else {
|
|
1510
|
+
match--;
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1682
1513
|
}
|
|
1683
|
-
} else ;
|
|
1684
|
-
},
|
|
1685
|
-
set({ _: instance }, key, value) {
|
|
1686
|
-
const { data, setupState, ctx } = instance;
|
|
1687
|
-
if (hasSetupBinding(setupState, key)) {
|
|
1688
|
-
setupState[key] = value;
|
|
1689
|
-
return true;
|
|
1690
|
-
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
1691
|
-
data[key] = value;
|
|
1692
|
-
return true;
|
|
1693
|
-
} else if (shared.hasOwn(instance.props, key)) {
|
|
1694
|
-
return false;
|
|
1695
1514
|
}
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1515
|
+
return node;
|
|
1516
|
+
};
|
|
1517
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
1518
|
+
const parentNode2 = oldNode.parentNode;
|
|
1519
|
+
if (parentNode2) {
|
|
1520
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
1521
|
+
}
|
|
1522
|
+
let parent = parentComponent;
|
|
1523
|
+
while (parent) {
|
|
1524
|
+
if (parent.vnode.el === oldNode) {
|
|
1525
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
1701
1526
|
}
|
|
1527
|
+
parent = parent.parent;
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
const isTemplateNode = (node) => {
|
|
1531
|
+
return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
|
|
1532
|
+
};
|
|
1533
|
+
return [hydrate, hydrateNode];
|
|
1534
|
+
}
|
|
1535
|
+
const allowMismatchAttr = "data-allow-mismatch";
|
|
1536
|
+
const MismatchTypeString = {
|
|
1537
|
+
[0 /* TEXT */]: "text",
|
|
1538
|
+
[1 /* CHILDREN */]: "children",
|
|
1539
|
+
[2 /* CLASS */]: "class",
|
|
1540
|
+
[3 /* STYLE */]: "style",
|
|
1541
|
+
[4 /* ATTRIBUTE */]: "attribute"
|
|
1542
|
+
};
|
|
1543
|
+
function isMismatchAllowed(el, allowedType) {
|
|
1544
|
+
if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
|
|
1545
|
+
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
1546
|
+
el = el.parentElement;
|
|
1702
1547
|
}
|
|
1548
|
+
}
|
|
1549
|
+
const allowedAttr = el && el.getAttribute(allowMismatchAttr);
|
|
1550
|
+
if (allowedAttr == null) {
|
|
1551
|
+
return false;
|
|
1552
|
+
} else if (allowedAttr === "") {
|
|
1703
1553
|
return true;
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
let normalizedProps;
|
|
1709
|
-
return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
|
|
1710
|
-
},
|
|
1711
|
-
defineProperty(target, key, descriptor) {
|
|
1712
|
-
if (descriptor.get != null) {
|
|
1713
|
-
target._.accessCache[key] = 0;
|
|
1714
|
-
} else if (shared.hasOwn(descriptor, "value")) {
|
|
1715
|
-
this.set(target, key, descriptor.value, null);
|
|
1554
|
+
} else {
|
|
1555
|
+
const list = allowedAttr.split(",");
|
|
1556
|
+
if (allowedType === 0 /* TEXT */ && list.includes("children")) {
|
|
1557
|
+
return true;
|
|
1716
1558
|
}
|
|
1717
|
-
return
|
|
1559
|
+
return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
|
|
1718
1560
|
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
const hydrateOnIdle = () => (hydrate) => {
|
|
1564
|
+
const id = requestIdleCallback(hydrate);
|
|
1565
|
+
return () => cancelIdleCallback(id);
|
|
1719
1566
|
};
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1567
|
+
const hydrateOnVisible = (margin = 0) => (hydrate, forEach) => {
|
|
1568
|
+
const ob = new IntersectionObserver(
|
|
1569
|
+
(entries) => {
|
|
1570
|
+
for (const e of entries) {
|
|
1571
|
+
if (!e.isIntersecting) continue;
|
|
1572
|
+
ob.disconnect();
|
|
1573
|
+
hydrate();
|
|
1574
|
+
break;
|
|
1727
1575
|
}
|
|
1728
|
-
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
1729
1576
|
},
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
return has;
|
|
1577
|
+
{
|
|
1578
|
+
rootMargin: shared.isString(margin) ? margin : margin + "px"
|
|
1733
1579
|
}
|
|
1734
|
-
|
|
1735
|
-
);
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
}
|
|
1747
|
-
function defineSlots() {
|
|
1748
|
-
return null;
|
|
1749
|
-
}
|
|
1750
|
-
function defineModel() {
|
|
1751
|
-
}
|
|
1752
|
-
function withDefaults(props, defaults) {
|
|
1753
|
-
return null;
|
|
1754
|
-
}
|
|
1755
|
-
function useSlots() {
|
|
1756
|
-
return getContext().slots;
|
|
1757
|
-
}
|
|
1758
|
-
function useAttrs() {
|
|
1759
|
-
return getContext().attrs;
|
|
1760
|
-
}
|
|
1761
|
-
function getContext() {
|
|
1762
|
-
const i = getCurrentInstance();
|
|
1763
|
-
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
1764
|
-
}
|
|
1765
|
-
function normalizePropsOrEmits(props) {
|
|
1766
|
-
return shared.isArray(props) ? props.reduce(
|
|
1767
|
-
(normalized, p) => (normalized[p] = null, normalized),
|
|
1768
|
-
{}
|
|
1769
|
-
) : props;
|
|
1770
|
-
}
|
|
1771
|
-
function mergeDefaults(raw, defaults) {
|
|
1772
|
-
const props = normalizePropsOrEmits(raw);
|
|
1773
|
-
for (const key in defaults) {
|
|
1774
|
-
if (key.startsWith("__skip")) continue;
|
|
1775
|
-
let opt = props[key];
|
|
1776
|
-
if (opt) {
|
|
1777
|
-
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
1778
|
-
opt = props[key] = { type: opt, default: defaults[key] };
|
|
1779
|
-
} else {
|
|
1780
|
-
opt.default = defaults[key];
|
|
1781
|
-
}
|
|
1782
|
-
} else if (opt === null) {
|
|
1783
|
-
opt = props[key] = { default: defaults[key] };
|
|
1784
|
-
} else ;
|
|
1785
|
-
if (opt && defaults[`__skip_${key}`]) {
|
|
1786
|
-
opt.skipFactory = true;
|
|
1580
|
+
);
|
|
1581
|
+
forEach((el) => ob.observe(el));
|
|
1582
|
+
return () => ob.disconnect();
|
|
1583
|
+
};
|
|
1584
|
+
const hydrateOnMediaQuery = (query) => (hydrate) => {
|
|
1585
|
+
if (query) {
|
|
1586
|
+
const mql = matchMedia(query);
|
|
1587
|
+
if (mql.matches) {
|
|
1588
|
+
hydrate();
|
|
1589
|
+
} else {
|
|
1590
|
+
mql.addEventListener("change", hydrate, { once: true });
|
|
1591
|
+
return () => mql.removeEventListener("change", hydrate);
|
|
1787
1592
|
}
|
|
1788
1593
|
}
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
if (!excludedKeys.includes(key)) {
|
|
1800
|
-
Object.defineProperty(ret, key, {
|
|
1801
|
-
enumerable: true,
|
|
1802
|
-
get: () => props[key]
|
|
1803
|
-
});
|
|
1594
|
+
};
|
|
1595
|
+
const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
1596
|
+
if (shared.isString(interactions)) interactions = [interactions];
|
|
1597
|
+
let hasHydrated = false;
|
|
1598
|
+
const doHydrate = (e) => {
|
|
1599
|
+
if (!hasHydrated) {
|
|
1600
|
+
hasHydrated = true;
|
|
1601
|
+
teardown();
|
|
1602
|
+
hydrate();
|
|
1603
|
+
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
1804
1604
|
}
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
unsetCurrentInstance();
|
|
1812
|
-
if (shared.isPromise(awaitable)) {
|
|
1813
|
-
awaitable = awaitable.catch((e) => {
|
|
1814
|
-
setCurrentInstance(ctx);
|
|
1815
|
-
throw e;
|
|
1605
|
+
};
|
|
1606
|
+
const teardown = () => {
|
|
1607
|
+
forEach((el) => {
|
|
1608
|
+
for (const i of interactions) {
|
|
1609
|
+
el.removeEventListener(i, doHydrate);
|
|
1610
|
+
}
|
|
1816
1611
|
});
|
|
1612
|
+
};
|
|
1613
|
+
forEach((el) => {
|
|
1614
|
+
for (const i of interactions) {
|
|
1615
|
+
el.addEventListener(i, doHydrate, { once: true });
|
|
1616
|
+
}
|
|
1617
|
+
});
|
|
1618
|
+
return teardown;
|
|
1619
|
+
};
|
|
1620
|
+
function forEachElement(node, cb) {
|
|
1621
|
+
if (isComment(node) && node.data === "[") {
|
|
1622
|
+
let depth = 1;
|
|
1623
|
+
let next = node.nextSibling;
|
|
1624
|
+
while (next) {
|
|
1625
|
+
if (next.nodeType === 1) {
|
|
1626
|
+
cb(next);
|
|
1627
|
+
} else if (isComment(next)) {
|
|
1628
|
+
if (next.data === "]") {
|
|
1629
|
+
if (--depth === 0) break;
|
|
1630
|
+
} else if (next.data === "[") {
|
|
1631
|
+
depth++;
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
next = next.nextSibling;
|
|
1635
|
+
}
|
|
1636
|
+
} else {
|
|
1637
|
+
cb(node);
|
|
1817
1638
|
}
|
|
1818
|
-
return [awaitable, () => setCurrentInstance(ctx)];
|
|
1819
1639
|
}
|
|
1820
1640
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
if (options.beforeCreate) {
|
|
1828
|
-
callHook(options.beforeCreate, instance, "bc");
|
|
1641
|
+
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
1642
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
1643
|
+
// @__NO_SIDE_EFFECTS__
|
|
1644
|
+
function defineAsyncComponent(source) {
|
|
1645
|
+
if (shared.isFunction(source)) {
|
|
1646
|
+
source = { loader: source };
|
|
1829
1647
|
}
|
|
1830
1648
|
const {
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1649
|
+
loader,
|
|
1650
|
+
loadingComponent,
|
|
1651
|
+
errorComponent,
|
|
1652
|
+
delay = 200,
|
|
1653
|
+
hydrate: hydrateStrategy,
|
|
1654
|
+
timeout,
|
|
1655
|
+
// undefined = never times out
|
|
1656
|
+
suspensible = true,
|
|
1657
|
+
onError: userOnError
|
|
1658
|
+
} = source;
|
|
1659
|
+
let pendingRequest = null;
|
|
1660
|
+
let resolvedComp;
|
|
1661
|
+
let retries = 0;
|
|
1662
|
+
const retry = () => {
|
|
1663
|
+
retries++;
|
|
1664
|
+
pendingRequest = null;
|
|
1665
|
+
return load();
|
|
1666
|
+
};
|
|
1667
|
+
const load = () => {
|
|
1668
|
+
let thisRequest;
|
|
1669
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
1670
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
1671
|
+
if (userOnError) {
|
|
1672
|
+
return new Promise((resolve, reject) => {
|
|
1673
|
+
const userRetry = () => resolve(retry());
|
|
1674
|
+
const userFail = () => reject(err);
|
|
1675
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
1676
|
+
});
|
|
1677
|
+
} else {
|
|
1678
|
+
throw err;
|
|
1679
|
+
}
|
|
1680
|
+
}).then((comp) => {
|
|
1681
|
+
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
1682
|
+
return pendingRequest;
|
|
1683
|
+
}
|
|
1684
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
1685
|
+
comp = comp.default;
|
|
1686
|
+
}
|
|
1687
|
+
resolvedComp = comp;
|
|
1688
|
+
return comp;
|
|
1689
|
+
}));
|
|
1690
|
+
};
|
|
1691
|
+
return defineComponent({
|
|
1692
|
+
name: "AsyncComponentWrapper",
|
|
1693
|
+
__asyncLoader: load,
|
|
1694
|
+
__asyncHydrate(el, instance, hydrate) {
|
|
1695
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
1696
|
+
const teardown = hydrateStrategy(
|
|
1697
|
+
hydrate,
|
|
1698
|
+
(cb) => forEachElement(el, cb)
|
|
1699
|
+
);
|
|
1700
|
+
if (teardown) {
|
|
1701
|
+
(instance.bum || (instance.bum = [])).push(teardown);
|
|
1873
1702
|
}
|
|
1703
|
+
} : hydrate;
|
|
1704
|
+
if (resolvedComp) {
|
|
1705
|
+
doHydrate();
|
|
1706
|
+
} else {
|
|
1707
|
+
load().then(() => !instance.isUnmounted && doHydrate());
|
|
1708
|
+
}
|
|
1709
|
+
},
|
|
1710
|
+
get __asyncResolved() {
|
|
1711
|
+
return resolvedComp;
|
|
1712
|
+
},
|
|
1713
|
+
setup() {
|
|
1714
|
+
const instance = currentInstance;
|
|
1715
|
+
markAsyncBoundary(instance);
|
|
1716
|
+
if (resolvedComp) {
|
|
1717
|
+
return () => createInnerComp(resolvedComp, instance);
|
|
1718
|
+
}
|
|
1719
|
+
const onError = (err) => {
|
|
1720
|
+
pendingRequest = null;
|
|
1721
|
+
handleError(
|
|
1722
|
+
err,
|
|
1723
|
+
instance,
|
|
1724
|
+
13,
|
|
1725
|
+
!errorComponent
|
|
1726
|
+
);
|
|
1727
|
+
};
|
|
1728
|
+
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
1729
|
+
return load().then((comp) => {
|
|
1730
|
+
return () => createInnerComp(comp, instance);
|
|
1731
|
+
}).catch((err) => {
|
|
1732
|
+
onError(err);
|
|
1733
|
+
return () => errorComponent ? createVNode(errorComponent, {
|
|
1734
|
+
error: err
|
|
1735
|
+
}) : null;
|
|
1736
|
+
});
|
|
1874
1737
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1738
|
+
const loaded = reactivity.ref(false);
|
|
1739
|
+
const error = reactivity.ref();
|
|
1740
|
+
const delayed = reactivity.ref(!!delay);
|
|
1741
|
+
if (delay) {
|
|
1742
|
+
setTimeout(() => {
|
|
1743
|
+
delayed.value = false;
|
|
1744
|
+
}, delay);
|
|
1745
|
+
}
|
|
1746
|
+
if (timeout != null) {
|
|
1747
|
+
setTimeout(() => {
|
|
1748
|
+
if (!loaded.value && !error.value) {
|
|
1749
|
+
const err = new Error(
|
|
1750
|
+
`Async component timed out after ${timeout}ms.`
|
|
1751
|
+
);
|
|
1752
|
+
onError(err);
|
|
1753
|
+
error.value = err;
|
|
1754
|
+
}
|
|
1755
|
+
}, timeout);
|
|
1756
|
+
}
|
|
1757
|
+
load().then(() => {
|
|
1758
|
+
loaded.value = true;
|
|
1759
|
+
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
1760
|
+
queueJob(instance.parent.update);
|
|
1761
|
+
}
|
|
1762
|
+
}).catch((err) => {
|
|
1763
|
+
onError(err);
|
|
1764
|
+
error.value = err;
|
|
1898
1765
|
});
|
|
1766
|
+
return () => {
|
|
1767
|
+
if (loaded.value && resolvedComp) {
|
|
1768
|
+
return createInnerComp(resolvedComp, instance);
|
|
1769
|
+
} else if (error.value && errorComponent) {
|
|
1770
|
+
return createVNode(errorComponent, {
|
|
1771
|
+
error: error.value
|
|
1772
|
+
});
|
|
1773
|
+
} else if (loadingComponent && !delayed.value) {
|
|
1774
|
+
return createVNode(loadingComponent);
|
|
1775
|
+
}
|
|
1776
|
+
};
|
|
1899
1777
|
}
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1778
|
+
});
|
|
1779
|
+
}
|
|
1780
|
+
function createInnerComp(comp, parent) {
|
|
1781
|
+
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
1782
|
+
const vnode = createVNode(comp, props, children);
|
|
1783
|
+
vnode.ref = ref2;
|
|
1784
|
+
vnode.ce = ce;
|
|
1785
|
+
delete parent.vnode.ce;
|
|
1786
|
+
return vnode;
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
1790
|
+
const KeepAliveImpl = {
|
|
1791
|
+
name: `KeepAlive`,
|
|
1792
|
+
// Marker for special handling inside the renderer. We are not using a ===
|
|
1793
|
+
// check directly on KeepAlive in the renderer, because importing it directly
|
|
1794
|
+
// would prevent it from being tree-shaken.
|
|
1795
|
+
__isKeepAlive: true,
|
|
1796
|
+
props: {
|
|
1797
|
+
include: [String, RegExp, Array],
|
|
1798
|
+
exclude: [String, RegExp, Array],
|
|
1799
|
+
max: [String, Number]
|
|
1800
|
+
},
|
|
1801
|
+
setup(props, { slots }) {
|
|
1802
|
+
const instance = getCurrentInstance();
|
|
1803
|
+
const sharedContext = instance.ctx;
|
|
1804
|
+
if (!sharedContext.renderer) {
|
|
1805
|
+
return () => {
|
|
1806
|
+
const children = slots.default && slots.default();
|
|
1807
|
+
return children && children.length === 1 ? children[0] : children;
|
|
1808
|
+
};
|
|
1904
1809
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1810
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1811
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1812
|
+
let current = null;
|
|
1813
|
+
const parentSuspense = instance.suspense;
|
|
1814
|
+
const {
|
|
1815
|
+
renderer: {
|
|
1816
|
+
p: patch,
|
|
1817
|
+
m: move,
|
|
1818
|
+
um: _unmount,
|
|
1819
|
+
o: { createElement }
|
|
1820
|
+
}
|
|
1821
|
+
} = sharedContext;
|
|
1822
|
+
const storageContainer = createElement("div");
|
|
1823
|
+
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
1824
|
+
const instance2 = vnode.component;
|
|
1825
|
+
move(vnode, container, anchor, 0, parentSuspense);
|
|
1826
|
+
patch(
|
|
1827
|
+
instance2.vnode,
|
|
1828
|
+
vnode,
|
|
1829
|
+
container,
|
|
1830
|
+
anchor,
|
|
1831
|
+
instance2,
|
|
1832
|
+
parentSuspense,
|
|
1833
|
+
namespace,
|
|
1834
|
+
vnode.slotScopeIds,
|
|
1835
|
+
optimized
|
|
1836
|
+
);
|
|
1837
|
+
queuePostRenderEffect(() => {
|
|
1838
|
+
instance2.isDeactivated = false;
|
|
1839
|
+
if (instance2.a) {
|
|
1840
|
+
shared.invokeArrayFns(instance2.a);
|
|
1841
|
+
}
|
|
1842
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
1843
|
+
if (vnodeHook) {
|
|
1844
|
+
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1845
|
+
}
|
|
1846
|
+
}, parentSuspense);
|
|
1847
|
+
};
|
|
1848
|
+
sharedContext.deactivate = (vnode) => {
|
|
1849
|
+
const instance2 = vnode.component;
|
|
1850
|
+
invalidateMount(instance2.m);
|
|
1851
|
+
invalidateMount(instance2.a);
|
|
1852
|
+
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
1853
|
+
queuePostRenderEffect(() => {
|
|
1854
|
+
if (instance2.da) {
|
|
1855
|
+
shared.invokeArrayFns(instance2.da);
|
|
1856
|
+
}
|
|
1857
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
1858
|
+
if (vnodeHook) {
|
|
1859
|
+
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1860
|
+
}
|
|
1861
|
+
instance2.isDeactivated = true;
|
|
1862
|
+
}, parentSuspense);
|
|
1863
|
+
};
|
|
1864
|
+
function unmount(vnode) {
|
|
1865
|
+
resetShapeFlag(vnode);
|
|
1866
|
+
_unmount(vnode, instance, parentSuspense, true);
|
|
1920
1867
|
}
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
registerLifecycleHook(onDeactivated, deactivated);
|
|
1928
|
-
registerLifecycleHook(onErrorCaptured, errorCaptured);
|
|
1929
|
-
registerLifecycleHook(onRenderTracked, renderTracked);
|
|
1930
|
-
registerLifecycleHook(onRenderTriggered, renderTriggered);
|
|
1931
|
-
registerLifecycleHook(onBeforeUnmount, beforeUnmount);
|
|
1932
|
-
registerLifecycleHook(onUnmounted, unmounted);
|
|
1933
|
-
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
1934
|
-
if (shared.isArray(expose)) {
|
|
1935
|
-
if (expose.length) {
|
|
1936
|
-
const exposed = instance.exposed || (instance.exposed = {});
|
|
1937
|
-
expose.forEach((key) => {
|
|
1938
|
-
Object.defineProperty(exposed, key, {
|
|
1939
|
-
get: () => publicThis[key],
|
|
1940
|
-
set: (val) => publicThis[key] = val
|
|
1941
|
-
});
|
|
1868
|
+
function pruneCache(filter) {
|
|
1869
|
+
cache.forEach((vnode, key) => {
|
|
1870
|
+
const name = getComponentName(vnode.type);
|
|
1871
|
+
if (name && (!filter || !filter(name))) {
|
|
1872
|
+
pruneCacheEntry(key);
|
|
1873
|
+
}
|
|
1942
1874
|
});
|
|
1943
|
-
} else if (!instance.exposed) {
|
|
1944
|
-
instance.exposed = {};
|
|
1945
1875
|
}
|
|
1876
|
+
function pruneCacheEntry(key) {
|
|
1877
|
+
const cached = cache.get(key);
|
|
1878
|
+
if (!current || !isSameVNodeType(cached, current)) {
|
|
1879
|
+
unmount(cached);
|
|
1880
|
+
} else if (current) {
|
|
1881
|
+
resetShapeFlag(current);
|
|
1882
|
+
}
|
|
1883
|
+
cache.delete(key);
|
|
1884
|
+
keys.delete(key);
|
|
1885
|
+
}
|
|
1886
|
+
watch(
|
|
1887
|
+
() => [props.include, props.exclude],
|
|
1888
|
+
([include, exclude]) => {
|
|
1889
|
+
include && pruneCache((name) => matches(include, name));
|
|
1890
|
+
exclude && pruneCache((name) => !matches(exclude, name));
|
|
1891
|
+
},
|
|
1892
|
+
// prune post-render after `current` has been updated
|
|
1893
|
+
{ flush: "post", deep: true }
|
|
1894
|
+
);
|
|
1895
|
+
let pendingCacheKey = null;
|
|
1896
|
+
const cacheSubtree = () => {
|
|
1897
|
+
if (pendingCacheKey != null) {
|
|
1898
|
+
if (isSuspense(instance.subTree.type)) {
|
|
1899
|
+
queuePostRenderEffect(() => {
|
|
1900
|
+
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
1901
|
+
}, instance.subTree.suspense);
|
|
1902
|
+
} else {
|
|
1903
|
+
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
onMounted(cacheSubtree);
|
|
1908
|
+
onUpdated(cacheSubtree);
|
|
1909
|
+
onBeforeUnmount(() => {
|
|
1910
|
+
cache.forEach((cached) => {
|
|
1911
|
+
const { subTree, suspense } = instance;
|
|
1912
|
+
const vnode = getInnerChild(subTree);
|
|
1913
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
1914
|
+
resetShapeFlag(vnode);
|
|
1915
|
+
const da = vnode.component.da;
|
|
1916
|
+
da && queuePostRenderEffect(da, suspense);
|
|
1917
|
+
return;
|
|
1918
|
+
}
|
|
1919
|
+
unmount(cached);
|
|
1920
|
+
});
|
|
1921
|
+
});
|
|
1922
|
+
return () => {
|
|
1923
|
+
pendingCacheKey = null;
|
|
1924
|
+
if (!slots.default) {
|
|
1925
|
+
return null;
|
|
1926
|
+
}
|
|
1927
|
+
const children = slots.default();
|
|
1928
|
+
const rawVNode = children[0];
|
|
1929
|
+
if (children.length > 1) {
|
|
1930
|
+
current = null;
|
|
1931
|
+
return children;
|
|
1932
|
+
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
|
|
1933
|
+
current = null;
|
|
1934
|
+
return rawVNode;
|
|
1935
|
+
}
|
|
1936
|
+
let vnode = getInnerChild(rawVNode);
|
|
1937
|
+
const comp = vnode.type;
|
|
1938
|
+
const name = getComponentName(
|
|
1939
|
+
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
1940
|
+
);
|
|
1941
|
+
const { include, exclude, max } = props;
|
|
1942
|
+
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
|
|
1943
|
+
current = vnode;
|
|
1944
|
+
return rawVNode;
|
|
1945
|
+
}
|
|
1946
|
+
const key = vnode.key == null ? comp : vnode.key;
|
|
1947
|
+
const cachedVNode = cache.get(key);
|
|
1948
|
+
if (vnode.el) {
|
|
1949
|
+
vnode = cloneVNode(vnode);
|
|
1950
|
+
if (rawVNode.shapeFlag & 128) {
|
|
1951
|
+
rawVNode.ssContent = vnode;
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
pendingCacheKey = key;
|
|
1955
|
+
if (cachedVNode) {
|
|
1956
|
+
vnode.el = cachedVNode.el;
|
|
1957
|
+
vnode.component = cachedVNode.component;
|
|
1958
|
+
if (vnode.transition) {
|
|
1959
|
+
setTransitionHooks(vnode, vnode.transition);
|
|
1960
|
+
}
|
|
1961
|
+
vnode.shapeFlag |= 512;
|
|
1962
|
+
keys.delete(key);
|
|
1963
|
+
keys.add(key);
|
|
1964
|
+
} else {
|
|
1965
|
+
keys.add(key);
|
|
1966
|
+
if (max && keys.size > parseInt(max, 10)) {
|
|
1967
|
+
pruneCacheEntry(keys.values().next().value);
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
vnode.shapeFlag |= 256;
|
|
1971
|
+
current = vnode;
|
|
1972
|
+
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
1973
|
+
};
|
|
1946
1974
|
}
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
if (
|
|
1955
|
-
|
|
1956
|
-
markAsyncBoundary(instance);
|
|
1975
|
+
};
|
|
1976
|
+
const KeepAlive = KeepAliveImpl;
|
|
1977
|
+
function matches(pattern, name) {
|
|
1978
|
+
if (shared.isArray(pattern)) {
|
|
1979
|
+
return pattern.some((p) => matches(p, name));
|
|
1980
|
+
} else if (shared.isString(pattern)) {
|
|
1981
|
+
return pattern.split(",").includes(name);
|
|
1982
|
+
} else if (shared.isRegExp(pattern)) {
|
|
1983
|
+
return pattern.test(name);
|
|
1957
1984
|
}
|
|
1985
|
+
return false;
|
|
1958
1986
|
}
|
|
1959
|
-
function
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
true
|
|
1972
|
-
);
|
|
1973
|
-
} else {
|
|
1974
|
-
injected = inject(opt.from || key);
|
|
1987
|
+
function onActivated(hook, target) {
|
|
1988
|
+
registerKeepAliveHook(hook, "a", target);
|
|
1989
|
+
}
|
|
1990
|
+
function onDeactivated(hook, target) {
|
|
1991
|
+
registerKeepAliveHook(hook, "da", target);
|
|
1992
|
+
}
|
|
1993
|
+
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
1994
|
+
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
1995
|
+
let current = target;
|
|
1996
|
+
while (current) {
|
|
1997
|
+
if (current.isDeactivated) {
|
|
1998
|
+
return;
|
|
1975
1999
|
}
|
|
1976
|
-
|
|
1977
|
-
injected = inject(opt);
|
|
2000
|
+
current = current.parent;
|
|
1978
2001
|
}
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2002
|
+
return hook();
|
|
2003
|
+
});
|
|
2004
|
+
injectHook(type, wrappedHook, target);
|
|
2005
|
+
if (target) {
|
|
2006
|
+
let current = target.parent;
|
|
2007
|
+
while (current && current.parent) {
|
|
2008
|
+
if (isKeepAlive(current.parent.vnode)) {
|
|
2009
|
+
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2010
|
+
}
|
|
2011
|
+
current = current.parent;
|
|
1988
2012
|
}
|
|
1989
2013
|
}
|
|
1990
2014
|
}
|
|
1991
|
-
function
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2015
|
+
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
2016
|
+
const injected = injectHook(
|
|
2017
|
+
type,
|
|
2018
|
+
hook,
|
|
2019
|
+
keepAliveRoot,
|
|
2020
|
+
true
|
|
2021
|
+
/* prepend */
|
|
1996
2022
|
);
|
|
2023
|
+
onUnmounted(() => {
|
|
2024
|
+
shared.remove(keepAliveRoot[type], injected);
|
|
2025
|
+
}, target);
|
|
1997
2026
|
}
|
|
1998
|
-
function
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
const handler = ctx[raw];
|
|
2002
|
-
if (shared.isFunction(handler)) {
|
|
2003
|
-
watch(getter, handler);
|
|
2004
|
-
}
|
|
2005
|
-
} else if (shared.isFunction(raw)) {
|
|
2006
|
-
watch(getter, raw.bind(publicThis));
|
|
2007
|
-
} else if (shared.isObject(raw)) {
|
|
2008
|
-
if (shared.isArray(raw)) {
|
|
2009
|
-
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2010
|
-
} else {
|
|
2011
|
-
const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2012
|
-
if (shared.isFunction(handler)) {
|
|
2013
|
-
watch(getter, handler, raw);
|
|
2014
|
-
}
|
|
2015
|
-
}
|
|
2016
|
-
} else ;
|
|
2027
|
+
function resetShapeFlag(vnode) {
|
|
2028
|
+
vnode.shapeFlag &= ~256;
|
|
2029
|
+
vnode.shapeFlag &= ~512;
|
|
2017
2030
|
}
|
|
2018
|
-
function
|
|
2019
|
-
|
|
2020
|
-
const { mixins, extends: extendsOptions } = base;
|
|
2021
|
-
const {
|
|
2022
|
-
mixins: globalMixins,
|
|
2023
|
-
optionsCache: cache,
|
|
2024
|
-
config: { optionMergeStrategies }
|
|
2025
|
-
} = instance.appContext;
|
|
2026
|
-
const cached = cache.get(base);
|
|
2027
|
-
let resolved;
|
|
2028
|
-
if (cached) {
|
|
2029
|
-
resolved = cached;
|
|
2030
|
-
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
2031
|
-
{
|
|
2032
|
-
resolved = base;
|
|
2033
|
-
}
|
|
2034
|
-
} else {
|
|
2035
|
-
resolved = {};
|
|
2036
|
-
if (globalMixins.length) {
|
|
2037
|
-
globalMixins.forEach(
|
|
2038
|
-
(m) => mergeOptions(resolved, m, optionMergeStrategies, true)
|
|
2039
|
-
);
|
|
2040
|
-
}
|
|
2041
|
-
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2042
|
-
}
|
|
2043
|
-
if (shared.isObject(base)) {
|
|
2044
|
-
cache.set(base, resolved);
|
|
2045
|
-
}
|
|
2046
|
-
return resolved;
|
|
2031
|
+
function getInnerChild(vnode) {
|
|
2032
|
+
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
2047
2033
|
}
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
if (
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2034
|
+
|
|
2035
|
+
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
2036
|
+
if (target) {
|
|
2037
|
+
const hooks = target[type] || (target[type] = []);
|
|
2038
|
+
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
2039
|
+
reactivity.pauseTracking();
|
|
2040
|
+
const reset = setCurrentInstance(target);
|
|
2041
|
+
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
2042
|
+
reset();
|
|
2043
|
+
reactivity.resetTracking();
|
|
2044
|
+
return res;
|
|
2045
|
+
});
|
|
2046
|
+
if (prepend) {
|
|
2047
|
+
hooks.unshift(wrappedHook);
|
|
2048
|
+
} else {
|
|
2049
|
+
hooks.push(wrappedHook);
|
|
2062
2050
|
}
|
|
2051
|
+
return wrappedHook;
|
|
2063
2052
|
}
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
props: mergeEmitsOrPropsOptions,
|
|
2069
|
-
emits: mergeEmitsOrPropsOptions,
|
|
2070
|
-
// objects
|
|
2071
|
-
methods: mergeObjectOptions,
|
|
2072
|
-
computed: mergeObjectOptions,
|
|
2073
|
-
// lifecycle
|
|
2074
|
-
beforeCreate: mergeAsArray,
|
|
2075
|
-
created: mergeAsArray,
|
|
2076
|
-
beforeMount: mergeAsArray,
|
|
2077
|
-
mounted: mergeAsArray,
|
|
2078
|
-
beforeUpdate: mergeAsArray,
|
|
2079
|
-
updated: mergeAsArray,
|
|
2080
|
-
beforeDestroy: mergeAsArray,
|
|
2081
|
-
beforeUnmount: mergeAsArray,
|
|
2082
|
-
destroyed: mergeAsArray,
|
|
2083
|
-
unmounted: mergeAsArray,
|
|
2084
|
-
activated: mergeAsArray,
|
|
2085
|
-
deactivated: mergeAsArray,
|
|
2086
|
-
errorCaptured: mergeAsArray,
|
|
2087
|
-
serverPrefetch: mergeAsArray,
|
|
2088
|
-
// assets
|
|
2089
|
-
components: mergeObjectOptions,
|
|
2090
|
-
directives: mergeObjectOptions,
|
|
2091
|
-
// watch
|
|
2092
|
-
watch: mergeWatchOptions,
|
|
2093
|
-
// provide / inject
|
|
2094
|
-
provide: mergeDataFn,
|
|
2095
|
-
inject: mergeInject
|
|
2096
|
-
};
|
|
2097
|
-
function mergeDataFn(to, from) {
|
|
2098
|
-
if (!from) {
|
|
2099
|
-
return to;
|
|
2100
|
-
}
|
|
2101
|
-
if (!to) {
|
|
2102
|
-
return from;
|
|
2053
|
+
}
|
|
2054
|
+
const createHook = (lifecycle) => (hook, target = currentInstance) => {
|
|
2055
|
+
if (!isInSSRComponentSetup || lifecycle === "sp") {
|
|
2056
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
2103
2057
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2058
|
+
};
|
|
2059
|
+
const onBeforeMount = createHook("bm");
|
|
2060
|
+
const onMounted = createHook("m");
|
|
2061
|
+
const onBeforeUpdate = createHook("bu");
|
|
2062
|
+
const onUpdated = createHook("u");
|
|
2063
|
+
const onBeforeUnmount = createHook("bum");
|
|
2064
|
+
const onUnmounted = createHook("um");
|
|
2065
|
+
const onServerPrefetch = createHook("sp");
|
|
2066
|
+
const onRenderTriggered = createHook(
|
|
2067
|
+
"rtg"
|
|
2068
|
+
);
|
|
2069
|
+
const onRenderTracked = createHook(
|
|
2070
|
+
"rtc"
|
|
2071
|
+
);
|
|
2072
|
+
function onErrorCaptured(hook, target = currentInstance) {
|
|
2073
|
+
injectHook("ec", hook, target);
|
|
2110
2074
|
}
|
|
2111
|
-
|
|
2112
|
-
|
|
2075
|
+
|
|
2076
|
+
const COMPONENTS = "components";
|
|
2077
|
+
const DIRECTIVES = "directives";
|
|
2078
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
2079
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2113
2080
|
}
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
return res;
|
|
2081
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2082
|
+
function resolveDynamicComponent(component) {
|
|
2083
|
+
if (shared.isString(component)) {
|
|
2084
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
2085
|
+
} else {
|
|
2086
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
2121
2087
|
}
|
|
2122
|
-
return raw;
|
|
2123
|
-
}
|
|
2124
|
-
function mergeAsArray(to, from) {
|
|
2125
|
-
return to ? [...new Set([].concat(to, from))] : from;
|
|
2126
2088
|
}
|
|
2127
|
-
function
|
|
2128
|
-
return
|
|
2089
|
+
function resolveDirective(name) {
|
|
2090
|
+
return resolveAsset(DIRECTIVES, name);
|
|
2129
2091
|
}
|
|
2130
|
-
function
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2092
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
2093
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
2094
|
+
if (instance) {
|
|
2095
|
+
const Component = instance.type;
|
|
2096
|
+
if (type === COMPONENTS) {
|
|
2097
|
+
const selfName = getComponentName(
|
|
2098
|
+
Component,
|
|
2099
|
+
false
|
|
2100
|
+
);
|
|
2101
|
+
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
2102
|
+
return Component;
|
|
2103
|
+
}
|
|
2134
2104
|
}
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2105
|
+
const res = (
|
|
2106
|
+
// local registration
|
|
2107
|
+
// check instance[type] first which is resolved for options API
|
|
2108
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
2109
|
+
resolve(instance.appContext[type], name)
|
|
2139
2110
|
);
|
|
2140
|
-
|
|
2141
|
-
|
|
2111
|
+
if (!res && maybeSelfReference) {
|
|
2112
|
+
return Component;
|
|
2113
|
+
}
|
|
2114
|
+
return res;
|
|
2142
2115
|
}
|
|
2143
2116
|
}
|
|
2144
|
-
function
|
|
2145
|
-
|
|
2146
|
-
if (!from) return to;
|
|
2147
|
-
const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
|
|
2148
|
-
for (const key in from) {
|
|
2149
|
-
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2150
|
-
}
|
|
2151
|
-
return merged;
|
|
2117
|
+
function resolve(registry, name) {
|
|
2118
|
+
return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
|
|
2152
2119
|
}
|
|
2153
2120
|
|
|
2154
|
-
function
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
errorHandler: void 0,
|
|
2163
|
-
warnHandler: void 0,
|
|
2164
|
-
compilerOptions: {}
|
|
2165
|
-
},
|
|
2166
|
-
mixins: [],
|
|
2167
|
-
components: {},
|
|
2168
|
-
directives: {},
|
|
2169
|
-
provides: /* @__PURE__ */ Object.create(null),
|
|
2170
|
-
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
2171
|
-
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
2172
|
-
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
2173
|
-
};
|
|
2174
|
-
}
|
|
2175
|
-
let uid$1 = 0;
|
|
2176
|
-
function createAppAPI(render, hydrate) {
|
|
2177
|
-
return function createApp(rootComponent, rootProps = null) {
|
|
2178
|
-
if (!shared.isFunction(rootComponent)) {
|
|
2179
|
-
rootComponent = shared.extend({}, rootComponent);
|
|
2121
|
+
function renderList(source, renderItem, cache, index) {
|
|
2122
|
+
let ret;
|
|
2123
|
+
const cached = cache && cache[index];
|
|
2124
|
+
const sourceIsArray = shared.isArray(source);
|
|
2125
|
+
if (sourceIsArray || shared.isString(source)) {
|
|
2126
|
+
const sourceIsReactiveArray = sourceIsArray && reactivity.isReactive(source);
|
|
2127
|
+
if (sourceIsReactiveArray) {
|
|
2128
|
+
source = reactivity.shallowReadArray(source);
|
|
2180
2129
|
}
|
|
2181
|
-
|
|
2182
|
-
|
|
2130
|
+
ret = new Array(source.length);
|
|
2131
|
+
for (let i = 0, l = source.length; i < l; i++) {
|
|
2132
|
+
ret[i] = renderItem(
|
|
2133
|
+
sourceIsReactiveArray ? reactivity.toReactive(source[i]) : source[i],
|
|
2134
|
+
i,
|
|
2135
|
+
void 0,
|
|
2136
|
+
cached && cached[i]
|
|
2137
|
+
);
|
|
2183
2138
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
},
|
|
2211
|
-
mixin(mixin) {
|
|
2212
|
-
{
|
|
2213
|
-
if (!context.mixins.includes(mixin)) {
|
|
2214
|
-
context.mixins.push(mixin);
|
|
2215
|
-
}
|
|
2216
|
-
}
|
|
2217
|
-
return app;
|
|
2218
|
-
},
|
|
2219
|
-
component(name, component) {
|
|
2220
|
-
if (!component) {
|
|
2221
|
-
return context.components[name];
|
|
2222
|
-
}
|
|
2223
|
-
context.components[name] = component;
|
|
2224
|
-
return app;
|
|
2225
|
-
},
|
|
2226
|
-
directive(name, directive) {
|
|
2227
|
-
if (!directive) {
|
|
2228
|
-
return context.directives[name];
|
|
2229
|
-
}
|
|
2230
|
-
context.directives[name] = directive;
|
|
2231
|
-
return app;
|
|
2232
|
-
},
|
|
2233
|
-
mount(rootContainer, isHydrate, namespace) {
|
|
2234
|
-
if (!isMounted) {
|
|
2235
|
-
const vnode = createVNode(rootComponent, rootProps);
|
|
2236
|
-
vnode.appContext = context;
|
|
2237
|
-
if (namespace === true) {
|
|
2238
|
-
namespace = "svg";
|
|
2239
|
-
} else if (namespace === false) {
|
|
2240
|
-
namespace = void 0;
|
|
2241
|
-
}
|
|
2242
|
-
if (isHydrate && hydrate) {
|
|
2243
|
-
hydrate(vnode, rootContainer);
|
|
2244
|
-
} else {
|
|
2245
|
-
render(vnode, rootContainer, namespace);
|
|
2246
|
-
}
|
|
2247
|
-
isMounted = true;
|
|
2248
|
-
app._container = rootContainer;
|
|
2249
|
-
rootContainer.__vue_app__ = app;
|
|
2250
|
-
return getComponentPublicInstance(vnode.component);
|
|
2251
|
-
}
|
|
2252
|
-
},
|
|
2253
|
-
onUnmount(cleanupFn) {
|
|
2254
|
-
pluginCleanupFns.push(cleanupFn);
|
|
2255
|
-
},
|
|
2256
|
-
unmount() {
|
|
2257
|
-
if (isMounted) {
|
|
2258
|
-
callWithAsyncErrorHandling(
|
|
2259
|
-
pluginCleanupFns,
|
|
2260
|
-
app._instance,
|
|
2261
|
-
16
|
|
2262
|
-
);
|
|
2263
|
-
render(null, app._container);
|
|
2264
|
-
delete app._container.__vue_app__;
|
|
2265
|
-
}
|
|
2266
|
-
},
|
|
2267
|
-
provide(key, value) {
|
|
2268
|
-
context.provides[key] = value;
|
|
2269
|
-
return app;
|
|
2270
|
-
},
|
|
2271
|
-
runWithContext(fn) {
|
|
2272
|
-
const lastApp = currentApp;
|
|
2273
|
-
currentApp = app;
|
|
2274
|
-
try {
|
|
2275
|
-
return fn();
|
|
2276
|
-
} finally {
|
|
2277
|
-
currentApp = lastApp;
|
|
2278
|
-
}
|
|
2279
|
-
}
|
|
2280
|
-
};
|
|
2281
|
-
return app;
|
|
2282
|
-
};
|
|
2139
|
+
} else if (typeof source === "number") {
|
|
2140
|
+
ret = new Array(source);
|
|
2141
|
+
for (let i = 0; i < source; i++) {
|
|
2142
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2143
|
+
}
|
|
2144
|
+
} else if (shared.isObject(source)) {
|
|
2145
|
+
if (source[Symbol.iterator]) {
|
|
2146
|
+
ret = Array.from(
|
|
2147
|
+
source,
|
|
2148
|
+
(item, i) => renderItem(item, i, void 0, cached && cached[i])
|
|
2149
|
+
);
|
|
2150
|
+
} else {
|
|
2151
|
+
const keys = Object.keys(source);
|
|
2152
|
+
ret = new Array(keys.length);
|
|
2153
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
2154
|
+
const key = keys[i];
|
|
2155
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
} else {
|
|
2159
|
+
ret = [];
|
|
2160
|
+
}
|
|
2161
|
+
if (cache) {
|
|
2162
|
+
cache[index] = ret;
|
|
2163
|
+
}
|
|
2164
|
+
return ret;
|
|
2283
2165
|
}
|
|
2284
|
-
let currentApp = null;
|
|
2285
2166
|
|
|
2286
|
-
function
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2167
|
+
function createSlots(slots, dynamicSlots) {
|
|
2168
|
+
for (let i = 0; i < dynamicSlots.length; i++) {
|
|
2169
|
+
const slot = dynamicSlots[i];
|
|
2170
|
+
if (shared.isArray(slot)) {
|
|
2171
|
+
for (let j = 0; j < slot.length; j++) {
|
|
2172
|
+
slots[slot[j].name] = slot[j].fn;
|
|
2173
|
+
}
|
|
2174
|
+
} else if (slot) {
|
|
2175
|
+
slots[slot.name] = slot.key ? (...args) => {
|
|
2176
|
+
const res = slot.fn(...args);
|
|
2177
|
+
if (res) res.key = slot.key;
|
|
2178
|
+
return res;
|
|
2179
|
+
} : slot.fn;
|
|
2292
2180
|
}
|
|
2293
|
-
provides[key] = value;
|
|
2294
2181
|
}
|
|
2182
|
+
return slots;
|
|
2295
2183
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
if (
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2184
|
+
|
|
2185
|
+
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
2186
|
+
if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
|
|
2187
|
+
if (name !== "default") props.name = name;
|
|
2188
|
+
return createVNode("slot", props, fallback && fallback());
|
|
2189
|
+
}
|
|
2190
|
+
let slot = slots[name];
|
|
2191
|
+
if (slot && slot._c) {
|
|
2192
|
+
slot._d = false;
|
|
2193
|
+
}
|
|
2194
|
+
openBlock();
|
|
2195
|
+
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2196
|
+
const rendered = createBlock(
|
|
2197
|
+
Fragment,
|
|
2198
|
+
{
|
|
2199
|
+
key: (props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2200
|
+
// key attached in the `createSlots` helper, respect that
|
|
2201
|
+
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2202
|
+
(!validSlotContent && fallback ? "_fb" : "")
|
|
2203
|
+
},
|
|
2204
|
+
validSlotContent || (fallback ? fallback() : []),
|
|
2205
|
+
validSlotContent && slots._ === 1 ? 64 : -2
|
|
2206
|
+
);
|
|
2207
|
+
if (!noSlotted && rendered.scopeId) {
|
|
2208
|
+
rendered.slotScopeIds = [rendered.scopeId + "-s"];
|
|
2209
|
+
}
|
|
2210
|
+
if (slot && slot._c) {
|
|
2211
|
+
slot._d = true;
|
|
2305
2212
|
}
|
|
2213
|
+
return rendered;
|
|
2306
2214
|
}
|
|
2307
|
-
function
|
|
2308
|
-
return
|
|
2215
|
+
function ensureValidVNode(vnodes) {
|
|
2216
|
+
return vnodes.some((child) => {
|
|
2217
|
+
if (!isVNode(child)) return true;
|
|
2218
|
+
if (child.type === Comment) return false;
|
|
2219
|
+
if (child.type === Fragment && !ensureValidVNode(child.children))
|
|
2220
|
+
return false;
|
|
2221
|
+
return true;
|
|
2222
|
+
}) ? vnodes : null;
|
|
2309
2223
|
}
|
|
2310
2224
|
|
|
2311
|
-
|
|
2312
|
-
const
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2315
|
-
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
2316
|
-
const props = {};
|
|
2317
|
-
const attrs = createInternalObject();
|
|
2318
|
-
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
2319
|
-
setFullProps(instance, rawProps, props, attrs);
|
|
2320
|
-
for (const key in instance.propsOptions[0]) {
|
|
2321
|
-
if (!(key in props)) {
|
|
2322
|
-
props[key] = void 0;
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
if (isStateful) {
|
|
2326
|
-
instance.props = isSSR ? props : reactivity.shallowReactive(props);
|
|
2327
|
-
} else {
|
|
2328
|
-
if (!instance.type.props) {
|
|
2329
|
-
instance.props = attrs;
|
|
2330
|
-
} else {
|
|
2331
|
-
instance.props = props;
|
|
2332
|
-
}
|
|
2225
|
+
function toHandlers(obj, preserveCaseIfNecessary) {
|
|
2226
|
+
const ret = {};
|
|
2227
|
+
for (const key in obj) {
|
|
2228
|
+
ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : shared.toHandlerKey(key)] = obj[key];
|
|
2333
2229
|
}
|
|
2334
|
-
|
|
2230
|
+
return ret;
|
|
2335
2231
|
}
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
(
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2232
|
+
|
|
2233
|
+
const getPublicInstance = (i) => {
|
|
2234
|
+
if (!i) return null;
|
|
2235
|
+
if (isStatefulComponent(i)) return getComponentPublicInstance(i);
|
|
2236
|
+
return getPublicInstance(i.parent);
|
|
2237
|
+
};
|
|
2238
|
+
const publicPropertiesMap = (
|
|
2239
|
+
// Move PURE marker to new line to workaround compiler discarding it
|
|
2240
|
+
// due to type annotation
|
|
2241
|
+
/* @__PURE__ */ shared.extend(/* @__PURE__ */ Object.create(null), {
|
|
2242
|
+
$: (i) => i,
|
|
2243
|
+
$el: (i) => i.vnode.el,
|
|
2244
|
+
$data: (i) => i.data,
|
|
2245
|
+
$props: (i) => i.props,
|
|
2246
|
+
$attrs: (i) => i.attrs,
|
|
2247
|
+
$slots: (i) => i.slots,
|
|
2248
|
+
$refs: (i) => i.refs,
|
|
2249
|
+
$parent: (i) => getPublicInstance(i.parent),
|
|
2250
|
+
$root: (i) => getPublicInstance(i.root),
|
|
2251
|
+
$emit: (i) => i.emit,
|
|
2252
|
+
$options: (i) => resolveMergedOptions(i) ,
|
|
2253
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
2254
|
+
queueJob(i.update);
|
|
2255
|
+
}),
|
|
2256
|
+
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
2257
|
+
$watch: (i) => instanceWatch.bind(i)
|
|
2258
|
+
})
|
|
2259
|
+
);
|
|
2260
|
+
const hasSetupBinding = (state, key) => state !== shared.EMPTY_OBJ && !state.__isScriptSetup && shared.hasOwn(state, key);
|
|
2261
|
+
const PublicInstanceProxyHandlers = {
|
|
2262
|
+
get({ _: instance }, key) {
|
|
2263
|
+
if (key === "__v_skip") {
|
|
2264
|
+
return true;
|
|
2265
|
+
}
|
|
2266
|
+
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
2267
|
+
let normalizedProps;
|
|
2268
|
+
if (key[0] !== "$") {
|
|
2269
|
+
const n = accessCache[key];
|
|
2270
|
+
if (n !== void 0) {
|
|
2271
|
+
switch (n) {
|
|
2272
|
+
case 1 /* SETUP */:
|
|
2273
|
+
return setupState[key];
|
|
2274
|
+
case 2 /* DATA */:
|
|
2275
|
+
return data[key];
|
|
2276
|
+
case 4 /* CONTEXT */:
|
|
2277
|
+
return ctx[key];
|
|
2278
|
+
case 3 /* PROPS */:
|
|
2279
|
+
return props[key];
|
|
2381
2280
|
}
|
|
2281
|
+
} else if (hasSetupBinding(setupState, key)) {
|
|
2282
|
+
accessCache[key] = 1 /* SETUP */;
|
|
2283
|
+
return setupState[key];
|
|
2284
|
+
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
2285
|
+
accessCache[key] = 2 /* DATA */;
|
|
2286
|
+
return data[key];
|
|
2287
|
+
} else if (
|
|
2288
|
+
// only cache other properties when instance has declared (thus stable)
|
|
2289
|
+
// props
|
|
2290
|
+
(normalizedProps = instance.propsOptions[0]) && shared.hasOwn(normalizedProps, key)
|
|
2291
|
+
) {
|
|
2292
|
+
accessCache[key] = 3 /* PROPS */;
|
|
2293
|
+
return props[key];
|
|
2294
|
+
} else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
2295
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
2296
|
+
return ctx[key];
|
|
2297
|
+
} else if (shouldCacheAccess) {
|
|
2298
|
+
accessCache[key] = 0 /* OTHER */;
|
|
2382
2299
|
}
|
|
2383
2300
|
}
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
//
|
|
2393
|
-
(
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
);
|
|
2406
|
-
}
|
|
2407
|
-
} else {
|
|
2408
|
-
delete props[key];
|
|
2409
|
-
}
|
|
2301
|
+
const publicGetter = publicPropertiesMap[key];
|
|
2302
|
+
let cssModule, globalProperties;
|
|
2303
|
+
if (publicGetter) {
|
|
2304
|
+
if (key === "$attrs") {
|
|
2305
|
+
reactivity.track(instance.attrs, "get", "");
|
|
2306
|
+
}
|
|
2307
|
+
return publicGetter(instance);
|
|
2308
|
+
} else if (
|
|
2309
|
+
// css module (injected by vue-loader)
|
|
2310
|
+
(cssModule = type.__cssModules) && (cssModule = cssModule[key])
|
|
2311
|
+
) {
|
|
2312
|
+
return cssModule;
|
|
2313
|
+
} else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
2314
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
2315
|
+
return ctx[key];
|
|
2316
|
+
} else if (
|
|
2317
|
+
// global properties
|
|
2318
|
+
globalProperties = appContext.config.globalProperties, shared.hasOwn(globalProperties, key)
|
|
2319
|
+
) {
|
|
2320
|
+
{
|
|
2321
|
+
return globalProperties[key];
|
|
2410
2322
|
}
|
|
2323
|
+
} else ;
|
|
2324
|
+
},
|
|
2325
|
+
set({ _: instance }, key, value) {
|
|
2326
|
+
const { data, setupState, ctx } = instance;
|
|
2327
|
+
if (hasSetupBinding(setupState, key)) {
|
|
2328
|
+
setupState[key] = value;
|
|
2329
|
+
return true;
|
|
2330
|
+
} else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
2331
|
+
data[key] = value;
|
|
2332
|
+
return true;
|
|
2333
|
+
} else if (shared.hasOwn(instance.props, key)) {
|
|
2334
|
+
return false;
|
|
2411
2335
|
}
|
|
2412
|
-
if (
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
}
|
|
2336
|
+
if (key[0] === "$" && key.slice(1) in instance) {
|
|
2337
|
+
return false;
|
|
2338
|
+
} else {
|
|
2339
|
+
{
|
|
2340
|
+
ctx[key] = value;
|
|
2418
2341
|
}
|
|
2419
2342
|
}
|
|
2343
|
+
return true;
|
|
2344
|
+
},
|
|
2345
|
+
has({
|
|
2346
|
+
_: { data, setupState, accessCache, ctx, appContext, propsOptions }
|
|
2347
|
+
}, key) {
|
|
2348
|
+
let normalizedProps;
|
|
2349
|
+
return !!accessCache[key] || data !== shared.EMPTY_OBJ && shared.hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key) || shared.hasOwn(ctx, key) || shared.hasOwn(publicPropertiesMap, key) || shared.hasOwn(appContext.config.globalProperties, key);
|
|
2350
|
+
},
|
|
2351
|
+
defineProperty(target, key, descriptor) {
|
|
2352
|
+
if (descriptor.get != null) {
|
|
2353
|
+
target._.accessCache[key] = 0;
|
|
2354
|
+
} else if (shared.hasOwn(descriptor, "value")) {
|
|
2355
|
+
this.set(target, key, descriptor.value, null);
|
|
2356
|
+
}
|
|
2357
|
+
return Reflect.defineProperty(target, key, descriptor);
|
|
2420
2358
|
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2359
|
+
};
|
|
2360
|
+
const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ shared.extend(
|
|
2361
|
+
{},
|
|
2362
|
+
PublicInstanceProxyHandlers,
|
|
2363
|
+
{
|
|
2364
|
+
get(target, key) {
|
|
2365
|
+
if (key === Symbol.unscopables) {
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
return PublicInstanceProxyHandlers.get(target, key, target);
|
|
2369
|
+
},
|
|
2370
|
+
has(_, key) {
|
|
2371
|
+
const has = key[0] !== "_" && !shared.isGloballyAllowed(key);
|
|
2372
|
+
return has;
|
|
2373
|
+
}
|
|
2423
2374
|
}
|
|
2375
|
+
);
|
|
2376
|
+
|
|
2377
|
+
function defineProps() {
|
|
2378
|
+
return null;
|
|
2424
2379
|
}
|
|
2425
|
-
function
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2380
|
+
function defineEmits() {
|
|
2381
|
+
return null;
|
|
2382
|
+
}
|
|
2383
|
+
function defineExpose(exposed) {
|
|
2384
|
+
}
|
|
2385
|
+
function defineOptions(options) {
|
|
2386
|
+
}
|
|
2387
|
+
function defineSlots() {
|
|
2388
|
+
return null;
|
|
2389
|
+
}
|
|
2390
|
+
function defineModel() {
|
|
2391
|
+
}
|
|
2392
|
+
function withDefaults(props, defaults) {
|
|
2393
|
+
return null;
|
|
2394
|
+
}
|
|
2395
|
+
function useSlots() {
|
|
2396
|
+
return getContext().slots;
|
|
2397
|
+
}
|
|
2398
|
+
function useAttrs() {
|
|
2399
|
+
return getContext().attrs;
|
|
2400
|
+
}
|
|
2401
|
+
function getContext() {
|
|
2402
|
+
const i = getCurrentInstance();
|
|
2403
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
2404
|
+
}
|
|
2405
|
+
function normalizePropsOrEmits(props) {
|
|
2406
|
+
return shared.isArray(props) ? props.reduce(
|
|
2407
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
2408
|
+
{}
|
|
2409
|
+
) : props;
|
|
2410
|
+
}
|
|
2411
|
+
function mergeDefaults(raw, defaults) {
|
|
2412
|
+
const props = normalizePropsOrEmits(raw);
|
|
2413
|
+
for (const key in defaults) {
|
|
2414
|
+
if (key.startsWith("__skip")) continue;
|
|
2415
|
+
let opt = props[key];
|
|
2416
|
+
if (opt) {
|
|
2417
|
+
if (shared.isArray(opt) || shared.isFunction(opt)) {
|
|
2418
|
+
opt = props[key] = { type: opt, default: defaults[key] };
|
|
2419
|
+
} else {
|
|
2420
|
+
opt.default = defaults[key];
|
|
2447
2421
|
}
|
|
2422
|
+
} else if (opt === null) {
|
|
2423
|
+
opt = props[key] = { default: defaults[key] };
|
|
2424
|
+
} else ;
|
|
2425
|
+
if (opt && defaults[`__skip_${key}`]) {
|
|
2426
|
+
opt.skipFactory = true;
|
|
2448
2427
|
}
|
|
2449
2428
|
}
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2429
|
+
return props;
|
|
2430
|
+
}
|
|
2431
|
+
function mergeModels(a, b) {
|
|
2432
|
+
if (!a || !b) return a || b;
|
|
2433
|
+
if (shared.isArray(a) && shared.isArray(b)) return a.concat(b);
|
|
2434
|
+
return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
2435
|
+
}
|
|
2436
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
2437
|
+
const ret = {};
|
|
2438
|
+
for (const key in props) {
|
|
2439
|
+
if (!excludedKeys.includes(key)) {
|
|
2440
|
+
Object.defineProperty(ret, key, {
|
|
2441
|
+
enumerable: true,
|
|
2442
|
+
get: () => props[key]
|
|
2443
|
+
});
|
|
2463
2444
|
}
|
|
2464
2445
|
}
|
|
2465
|
-
return
|
|
2446
|
+
return ret;
|
|
2466
2447
|
}
|
|
2467
|
-
function
|
|
2468
|
-
const
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2448
|
+
function withAsyncContext(getAwaitable) {
|
|
2449
|
+
const ctx = getCurrentInstance();
|
|
2450
|
+
let awaitable = getAwaitable();
|
|
2451
|
+
unsetCurrentInstance();
|
|
2452
|
+
if (shared.isPromise(awaitable)) {
|
|
2453
|
+
awaitable = awaitable.catch((e) => {
|
|
2454
|
+
setCurrentInstance(ctx);
|
|
2455
|
+
throw e;
|
|
2456
|
+
});
|
|
2457
|
+
}
|
|
2458
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
let shouldCacheAccess = true;
|
|
2462
|
+
function applyOptions(instance) {
|
|
2463
|
+
const options = resolveMergedOptions(instance);
|
|
2464
|
+
const publicThis = instance.proxy;
|
|
2465
|
+
const ctx = instance.ctx;
|
|
2466
|
+
shouldCacheAccess = false;
|
|
2467
|
+
if (options.beforeCreate) {
|
|
2468
|
+
callHook(options.beforeCreate, instance, "bc");
|
|
2469
|
+
}
|
|
2470
|
+
const {
|
|
2471
|
+
// state
|
|
2472
|
+
data: dataOptions,
|
|
2473
|
+
computed: computedOptions,
|
|
2474
|
+
methods,
|
|
2475
|
+
watch: watchOptions,
|
|
2476
|
+
provide: provideOptions,
|
|
2477
|
+
inject: injectOptions,
|
|
2478
|
+
// lifecycle
|
|
2479
|
+
created,
|
|
2480
|
+
beforeMount,
|
|
2481
|
+
mounted,
|
|
2482
|
+
beforeUpdate,
|
|
2483
|
+
updated,
|
|
2484
|
+
activated,
|
|
2485
|
+
deactivated,
|
|
2486
|
+
beforeDestroy,
|
|
2487
|
+
beforeUnmount,
|
|
2488
|
+
destroyed,
|
|
2489
|
+
unmounted,
|
|
2490
|
+
render,
|
|
2491
|
+
renderTracked,
|
|
2492
|
+
renderTriggered,
|
|
2493
|
+
errorCaptured,
|
|
2494
|
+
serverPrefetch,
|
|
2495
|
+
// public API
|
|
2496
|
+
expose,
|
|
2497
|
+
inheritAttrs,
|
|
2498
|
+
// assets
|
|
2499
|
+
components,
|
|
2500
|
+
directives,
|
|
2501
|
+
filters
|
|
2502
|
+
} = options;
|
|
2503
|
+
const checkDuplicateProperties = null;
|
|
2504
|
+
if (injectOptions) {
|
|
2505
|
+
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
2506
|
+
}
|
|
2507
|
+
if (methods) {
|
|
2508
|
+
for (const key in methods) {
|
|
2509
|
+
const methodHandler = methods[key];
|
|
2510
|
+
if (shared.isFunction(methodHandler)) {
|
|
2511
|
+
{
|
|
2512
|
+
ctx[key] = methodHandler.bind(publicThis);
|
|
2513
|
+
}
|
|
2494
2514
|
}
|
|
2495
2515
|
}
|
|
2496
2516
|
}
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
2502
|
-
const cached = cache.get(comp);
|
|
2503
|
-
if (cached) {
|
|
2504
|
-
return cached;
|
|
2505
|
-
}
|
|
2506
|
-
const raw = comp.props;
|
|
2507
|
-
const normalized = {};
|
|
2508
|
-
const needCastKeys = [];
|
|
2509
|
-
let hasExtends = false;
|
|
2510
|
-
if (!shared.isFunction(comp)) {
|
|
2511
|
-
const extendProps = (raw2) => {
|
|
2512
|
-
hasExtends = true;
|
|
2513
|
-
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
2514
|
-
shared.extend(normalized, props);
|
|
2515
|
-
if (keys) needCastKeys.push(...keys);
|
|
2516
|
-
};
|
|
2517
|
-
if (!asMixin && appContext.mixins.length) {
|
|
2518
|
-
appContext.mixins.forEach(extendProps);
|
|
2519
|
-
}
|
|
2520
|
-
if (comp.extends) {
|
|
2521
|
-
extendProps(comp.extends);
|
|
2522
|
-
}
|
|
2523
|
-
if (comp.mixins) {
|
|
2524
|
-
comp.mixins.forEach(extendProps);
|
|
2517
|
+
if (dataOptions) {
|
|
2518
|
+
const data = dataOptions.call(publicThis, publicThis);
|
|
2519
|
+
if (!shared.isObject(data)) ; else {
|
|
2520
|
+
instance.data = reactivity.reactive(data);
|
|
2525
2521
|
}
|
|
2526
2522
|
}
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2523
|
+
shouldCacheAccess = true;
|
|
2524
|
+
if (computedOptions) {
|
|
2525
|
+
for (const key in computedOptions) {
|
|
2526
|
+
const opt = computedOptions[key];
|
|
2527
|
+
const get = shared.isFunction(opt) ? opt.bind(publicThis, publicThis) : shared.isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : shared.NOOP;
|
|
2528
|
+
const set = !shared.isFunction(opt) && shared.isFunction(opt.set) ? opt.set.bind(publicThis) : shared.NOOP;
|
|
2529
|
+
const c = computed({
|
|
2530
|
+
get,
|
|
2531
|
+
set
|
|
2532
|
+
});
|
|
2533
|
+
Object.defineProperty(ctx, key, {
|
|
2534
|
+
enumerable: true,
|
|
2535
|
+
configurable: true,
|
|
2536
|
+
get: () => c.value,
|
|
2537
|
+
set: (v) => c.value = v
|
|
2538
|
+
});
|
|
2530
2539
|
}
|
|
2531
|
-
return shared.EMPTY_ARR;
|
|
2532
2540
|
}
|
|
2533
|
-
if (
|
|
2534
|
-
for (
|
|
2535
|
-
|
|
2536
|
-
if (validatePropName(normalizedKey)) {
|
|
2537
|
-
normalized[normalizedKey] = shared.EMPTY_OBJ;
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
} else if (raw) {
|
|
2541
|
-
for (const key in raw) {
|
|
2542
|
-
const normalizedKey = shared.camelize(key);
|
|
2543
|
-
if (validatePropName(normalizedKey)) {
|
|
2544
|
-
const opt = raw[key];
|
|
2545
|
-
const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
|
|
2546
|
-
if (prop) {
|
|
2547
|
-
const booleanIndex = getTypeIndex(Boolean, prop.type);
|
|
2548
|
-
const stringIndex = getTypeIndex(String, prop.type);
|
|
2549
|
-
prop[0 /* shouldCast */] = booleanIndex > -1;
|
|
2550
|
-
prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
|
|
2551
|
-
if (booleanIndex > -1 || shared.hasOwn(prop, "default")) {
|
|
2552
|
-
needCastKeys.push(normalizedKey);
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2541
|
+
if (watchOptions) {
|
|
2542
|
+
for (const key in watchOptions) {
|
|
2543
|
+
createWatcher(watchOptions[key], ctx, publicThis, key);
|
|
2556
2544
|
}
|
|
2557
2545
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2546
|
+
if (provideOptions) {
|
|
2547
|
+
const provides = shared.isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
|
|
2548
|
+
Reflect.ownKeys(provides).forEach((key) => {
|
|
2549
|
+
provide(key, provides[key]);
|
|
2550
|
+
});
|
|
2561
2551
|
}
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
function validatePropName(key) {
|
|
2565
|
-
if (key[0] !== "$" && !shared.isReservedProp(key)) {
|
|
2566
|
-
return true;
|
|
2552
|
+
if (created) {
|
|
2553
|
+
callHook(created, instance, "c");
|
|
2567
2554
|
}
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2555
|
+
function registerLifecycleHook(register, hook) {
|
|
2556
|
+
if (shared.isArray(hook)) {
|
|
2557
|
+
hook.forEach((_hook) => register(_hook.bind(publicThis)));
|
|
2558
|
+
} else if (hook) {
|
|
2559
|
+
register(hook.bind(publicThis));
|
|
2560
|
+
}
|
|
2573
2561
|
}
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2562
|
+
registerLifecycleHook(onBeforeMount, beforeMount);
|
|
2563
|
+
registerLifecycleHook(onMounted, mounted);
|
|
2564
|
+
registerLifecycleHook(onBeforeUpdate, beforeUpdate);
|
|
2565
|
+
registerLifecycleHook(onUpdated, updated);
|
|
2566
|
+
registerLifecycleHook(onActivated, activated);
|
|
2567
|
+
registerLifecycleHook(onDeactivated, deactivated);
|
|
2568
|
+
registerLifecycleHook(onErrorCaptured, errorCaptured);
|
|
2569
|
+
registerLifecycleHook(onRenderTracked, renderTracked);
|
|
2570
|
+
registerLifecycleHook(onRenderTriggered, renderTriggered);
|
|
2571
|
+
registerLifecycleHook(onBeforeUnmount, beforeUnmount);
|
|
2572
|
+
registerLifecycleHook(onUnmounted, unmounted);
|
|
2573
|
+
registerLifecycleHook(onServerPrefetch, serverPrefetch);
|
|
2574
|
+
if (shared.isArray(expose)) {
|
|
2575
|
+
if (expose.length) {
|
|
2576
|
+
const exposed = instance.exposed || (instance.exposed = {});
|
|
2577
|
+
expose.forEach((key) => {
|
|
2578
|
+
Object.defineProperty(exposed, key, {
|
|
2579
|
+
get: () => publicThis[key],
|
|
2580
|
+
set: (val) => publicThis[key] = val
|
|
2581
|
+
});
|
|
2582
|
+
});
|
|
2583
|
+
} else if (!instance.exposed) {
|
|
2584
|
+
instance.exposed = {};
|
|
2585
|
+
}
|
|
2579
2586
|
}
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
function isSameType(a, b) {
|
|
2583
|
-
return getType(a) === getType(b);
|
|
2584
|
-
}
|
|
2585
|
-
function getTypeIndex(type, expectedTypes) {
|
|
2586
|
-
if (shared.isArray(expectedTypes)) {
|
|
2587
|
-
return expectedTypes.findIndex((t) => isSameType(t, type));
|
|
2588
|
-
} else if (shared.isFunction(expectedTypes)) {
|
|
2589
|
-
return isSameType(expectedTypes, type) ? 0 : -1;
|
|
2587
|
+
if (render && instance.render === shared.NOOP) {
|
|
2588
|
+
instance.render = render;
|
|
2590
2589
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
2595
|
-
const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
2596
|
-
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
2597
|
-
if (rawSlot._n) {
|
|
2598
|
-
return rawSlot;
|
|
2590
|
+
if (inheritAttrs != null) {
|
|
2591
|
+
instance.inheritAttrs = inheritAttrs;
|
|
2599
2592
|
}
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
normalized._c = false;
|
|
2605
|
-
return normalized;
|
|
2606
|
-
};
|
|
2607
|
-
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
2608
|
-
const ctx = rawSlots._ctx;
|
|
2609
|
-
for (const key in rawSlots) {
|
|
2610
|
-
if (isInternalKey(key)) continue;
|
|
2611
|
-
const value = rawSlots[key];
|
|
2612
|
-
if (shared.isFunction(value)) {
|
|
2613
|
-
slots[key] = normalizeSlot(key, value, ctx);
|
|
2614
|
-
} else if (value != null) {
|
|
2615
|
-
const normalized = normalizeSlotValue(value);
|
|
2616
|
-
slots[key] = () => normalized;
|
|
2617
|
-
}
|
|
2593
|
+
if (components) instance.components = components;
|
|
2594
|
+
if (directives) instance.directives = directives;
|
|
2595
|
+
if (serverPrefetch) {
|
|
2596
|
+
markAsyncBoundary(instance);
|
|
2618
2597
|
}
|
|
2619
|
-
}
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
};
|
|
2624
|
-
const assignSlots = (slots, children, optimized) => {
|
|
2625
|
-
for (const key in children) {
|
|
2626
|
-
if (optimized || key !== "_") {
|
|
2627
|
-
slots[key] = children[key];
|
|
2628
|
-
}
|
|
2598
|
+
}
|
|
2599
|
+
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
|
|
2600
|
+
if (shared.isArray(injectOptions)) {
|
|
2601
|
+
injectOptions = normalizeInject(injectOptions);
|
|
2629
2602
|
}
|
|
2630
|
-
|
|
2631
|
-
const
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2603
|
+
for (const key in injectOptions) {
|
|
2604
|
+
const opt = injectOptions[key];
|
|
2605
|
+
let injected;
|
|
2606
|
+
if (shared.isObject(opt)) {
|
|
2607
|
+
if ("default" in opt) {
|
|
2608
|
+
injected = inject(
|
|
2609
|
+
opt.from || key,
|
|
2610
|
+
opt.default,
|
|
2611
|
+
true
|
|
2612
|
+
);
|
|
2613
|
+
} else {
|
|
2614
|
+
injected = inject(opt.from || key);
|
|
2639
2615
|
}
|
|
2640
2616
|
} else {
|
|
2641
|
-
|
|
2617
|
+
injected = inject(opt);
|
|
2618
|
+
}
|
|
2619
|
+
if (reactivity.isRef(injected)) {
|
|
2620
|
+
Object.defineProperty(ctx, key, {
|
|
2621
|
+
enumerable: true,
|
|
2622
|
+
configurable: true,
|
|
2623
|
+
get: () => injected.value,
|
|
2624
|
+
set: (v) => injected.value = v
|
|
2625
|
+
});
|
|
2626
|
+
} else {
|
|
2627
|
+
ctx[key] = injected;
|
|
2642
2628
|
}
|
|
2643
|
-
} else if (children) {
|
|
2644
|
-
normalizeVNodeSlots(instance, children);
|
|
2645
2629
|
}
|
|
2646
|
-
}
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2630
|
+
}
|
|
2631
|
+
function callHook(hook, instance, type) {
|
|
2632
|
+
callWithAsyncErrorHandling(
|
|
2633
|
+
shared.isArray(hook) ? hook.map((h) => h.bind(instance.proxy)) : hook.bind(instance.proxy),
|
|
2634
|
+
instance,
|
|
2635
|
+
type
|
|
2636
|
+
);
|
|
2637
|
+
}
|
|
2638
|
+
function createWatcher(raw, ctx, publicThis, key) {
|
|
2639
|
+
const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
|
|
2640
|
+
if (shared.isString(raw)) {
|
|
2641
|
+
const handler = ctx[raw];
|
|
2642
|
+
if (shared.isFunction(handler)) {
|
|
2643
|
+
watch(getter, handler);
|
|
2644
|
+
}
|
|
2645
|
+
} else if (shared.isFunction(raw)) {
|
|
2646
|
+
watch(getter, raw.bind(publicThis));
|
|
2647
|
+
} else if (shared.isObject(raw)) {
|
|
2648
|
+
if (shared.isArray(raw)) {
|
|
2649
|
+
raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
|
|
2659
2650
|
} else {
|
|
2660
|
-
|
|
2661
|
-
|
|
2651
|
+
const handler = shared.isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
|
|
2652
|
+
if (shared.isFunction(handler)) {
|
|
2653
|
+
watch(getter, handler, raw);
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
} else ;
|
|
2657
|
+
}
|
|
2658
|
+
function resolveMergedOptions(instance) {
|
|
2659
|
+
const base = instance.type;
|
|
2660
|
+
const { mixins, extends: extendsOptions } = base;
|
|
2661
|
+
const {
|
|
2662
|
+
mixins: globalMixins,
|
|
2663
|
+
optionsCache: cache,
|
|
2664
|
+
config: { optionMergeStrategies }
|
|
2665
|
+
} = instance.appContext;
|
|
2666
|
+
const cached = cache.get(base);
|
|
2667
|
+
let resolved;
|
|
2668
|
+
if (cached) {
|
|
2669
|
+
resolved = cached;
|
|
2670
|
+
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
2671
|
+
{
|
|
2672
|
+
resolved = base;
|
|
2662
2673
|
}
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2674
|
+
} else {
|
|
2675
|
+
resolved = {};
|
|
2676
|
+
if (globalMixins.length) {
|
|
2677
|
+
globalMixins.forEach(
|
|
2678
|
+
(m) => mergeOptions(resolved, m, optionMergeStrategies, true)
|
|
2679
|
+
);
|
|
2680
|
+
}
|
|
2681
|
+
mergeOptions(resolved, base, optionMergeStrategies);
|
|
2667
2682
|
}
|
|
2668
|
-
if (
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2683
|
+
if (shared.isObject(base)) {
|
|
2684
|
+
cache.set(base, resolved);
|
|
2685
|
+
}
|
|
2686
|
+
return resolved;
|
|
2687
|
+
}
|
|
2688
|
+
function mergeOptions(to, from, strats, asMixin = false) {
|
|
2689
|
+
const { mixins, extends: extendsOptions } = from;
|
|
2690
|
+
if (extendsOptions) {
|
|
2691
|
+
mergeOptions(to, extendsOptions, strats, true);
|
|
2692
|
+
}
|
|
2693
|
+
if (mixins) {
|
|
2694
|
+
mixins.forEach(
|
|
2695
|
+
(m) => mergeOptions(to, m, strats, true)
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
for (const key in from) {
|
|
2699
|
+
if (asMixin && key === "expose") ; else {
|
|
2700
|
+
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
2701
|
+
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
2673
2702
|
}
|
|
2674
2703
|
}
|
|
2704
|
+
return to;
|
|
2705
|
+
}
|
|
2706
|
+
const internalOptionMergeStrats = {
|
|
2707
|
+
data: mergeDataFn,
|
|
2708
|
+
props: mergeEmitsOrPropsOptions,
|
|
2709
|
+
emits: mergeEmitsOrPropsOptions,
|
|
2710
|
+
// objects
|
|
2711
|
+
methods: mergeObjectOptions,
|
|
2712
|
+
computed: mergeObjectOptions,
|
|
2713
|
+
// lifecycle
|
|
2714
|
+
beforeCreate: mergeAsArray,
|
|
2715
|
+
created: mergeAsArray,
|
|
2716
|
+
beforeMount: mergeAsArray,
|
|
2717
|
+
mounted: mergeAsArray,
|
|
2718
|
+
beforeUpdate: mergeAsArray,
|
|
2719
|
+
updated: mergeAsArray,
|
|
2720
|
+
beforeDestroy: mergeAsArray,
|
|
2721
|
+
beforeUnmount: mergeAsArray,
|
|
2722
|
+
destroyed: mergeAsArray,
|
|
2723
|
+
unmounted: mergeAsArray,
|
|
2724
|
+
activated: mergeAsArray,
|
|
2725
|
+
deactivated: mergeAsArray,
|
|
2726
|
+
errorCaptured: mergeAsArray,
|
|
2727
|
+
serverPrefetch: mergeAsArray,
|
|
2728
|
+
// assets
|
|
2729
|
+
components: mergeObjectOptions,
|
|
2730
|
+
directives: mergeObjectOptions,
|
|
2731
|
+
// watch
|
|
2732
|
+
watch: mergeWatchOptions,
|
|
2733
|
+
// provide / inject
|
|
2734
|
+
provide: mergeDataFn,
|
|
2735
|
+
inject: mergeInject
|
|
2675
2736
|
};
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
rawRef.forEach(
|
|
2680
|
-
(r, i) => setRef(
|
|
2681
|
-
r,
|
|
2682
|
-
oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
|
|
2683
|
-
parentSuspense,
|
|
2684
|
-
vnode,
|
|
2685
|
-
isUnmount
|
|
2686
|
-
)
|
|
2687
|
-
);
|
|
2688
|
-
return;
|
|
2737
|
+
function mergeDataFn(to, from) {
|
|
2738
|
+
if (!from) {
|
|
2739
|
+
return to;
|
|
2689
2740
|
}
|
|
2690
|
-
if (
|
|
2691
|
-
return;
|
|
2741
|
+
if (!to) {
|
|
2742
|
+
return from;
|
|
2692
2743
|
}
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2744
|
+
return function mergedDataFn() {
|
|
2745
|
+
return (shared.extend)(
|
|
2746
|
+
shared.isFunction(to) ? to.call(this, this) : to,
|
|
2747
|
+
shared.isFunction(from) ? from.call(this, this) : from
|
|
2748
|
+
);
|
|
2749
|
+
};
|
|
2750
|
+
}
|
|
2751
|
+
function mergeInject(to, from) {
|
|
2752
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
2753
|
+
}
|
|
2754
|
+
function normalizeInject(raw) {
|
|
2755
|
+
if (shared.isArray(raw)) {
|
|
2756
|
+
const res = {};
|
|
2757
|
+
for (let i = 0; i < raw.length; i++) {
|
|
2758
|
+
res[raw[i]] = raw[i];
|
|
2707
2759
|
}
|
|
2760
|
+
return res;
|
|
2708
2761
|
}
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
if (!shared.isArray(existing)) {
|
|
2722
|
-
if (_isString) {
|
|
2723
|
-
refs[ref] = [refValue];
|
|
2724
|
-
if (shared.hasOwn(setupState, ref)) {
|
|
2725
|
-
setupState[ref] = refs[ref];
|
|
2726
|
-
}
|
|
2727
|
-
} else {
|
|
2728
|
-
ref.value = [refValue];
|
|
2729
|
-
if (rawRef.k) refs[rawRef.k] = ref.value;
|
|
2730
|
-
}
|
|
2731
|
-
} else if (!existing.includes(refValue)) {
|
|
2732
|
-
existing.push(refValue);
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
} else if (_isString) {
|
|
2736
|
-
refs[ref] = value;
|
|
2737
|
-
if (shared.hasOwn(setupState, ref)) {
|
|
2738
|
-
setupState[ref] = value;
|
|
2739
|
-
}
|
|
2740
|
-
} else if (_isRef) {
|
|
2741
|
-
ref.value = value;
|
|
2742
|
-
if (rawRef.k) refs[rawRef.k] = value;
|
|
2743
|
-
} else ;
|
|
2744
|
-
};
|
|
2745
|
-
if (value) {
|
|
2746
|
-
doSet.id = -1;
|
|
2747
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
2748
|
-
} else {
|
|
2749
|
-
doSet();
|
|
2750
|
-
}
|
|
2762
|
+
return raw;
|
|
2763
|
+
}
|
|
2764
|
+
function mergeAsArray(to, from) {
|
|
2765
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
2766
|
+
}
|
|
2767
|
+
function mergeObjectOptions(to, from) {
|
|
2768
|
+
return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
2769
|
+
}
|
|
2770
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
2771
|
+
if (to) {
|
|
2772
|
+
if (shared.isArray(to) && shared.isArray(from)) {
|
|
2773
|
+
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
2751
2774
|
}
|
|
2775
|
+
return shared.extend(
|
|
2776
|
+
/* @__PURE__ */ Object.create(null),
|
|
2777
|
+
normalizePropsOrEmits(to),
|
|
2778
|
+
normalizePropsOrEmits(from != null ? from : {})
|
|
2779
|
+
);
|
|
2780
|
+
} else {
|
|
2781
|
+
return from;
|
|
2752
2782
|
}
|
|
2753
2783
|
}
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2784
|
+
function mergeWatchOptions(to, from) {
|
|
2785
|
+
if (!to) return from;
|
|
2786
|
+
if (!from) return to;
|
|
2787
|
+
const merged = shared.extend(/* @__PURE__ */ Object.create(null), to);
|
|
2788
|
+
for (const key in from) {
|
|
2789
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
2759
2790
|
}
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
}
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
container._vnode = vnode;
|
|
2790
|
-
return;
|
|
2791
|
+
return merged;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
function createAppContext() {
|
|
2795
|
+
return {
|
|
2796
|
+
app: null,
|
|
2797
|
+
config: {
|
|
2798
|
+
isNativeTag: shared.NO,
|
|
2799
|
+
performance: false,
|
|
2800
|
+
globalProperties: {},
|
|
2801
|
+
optionMergeStrategies: {},
|
|
2802
|
+
errorHandler: void 0,
|
|
2803
|
+
warnHandler: void 0,
|
|
2804
|
+
compilerOptions: {}
|
|
2805
|
+
},
|
|
2806
|
+
mixins: [],
|
|
2807
|
+
components: {},
|
|
2808
|
+
directives: {},
|
|
2809
|
+
provides: /* @__PURE__ */ Object.create(null),
|
|
2810
|
+
optionsCache: /* @__PURE__ */ new WeakMap(),
|
|
2811
|
+
propsCache: /* @__PURE__ */ new WeakMap(),
|
|
2812
|
+
emitsCache: /* @__PURE__ */ new WeakMap()
|
|
2813
|
+
};
|
|
2814
|
+
}
|
|
2815
|
+
let uid$1 = 0;
|
|
2816
|
+
function createAppAPI(render, hydrate) {
|
|
2817
|
+
return function createApp(rootComponent, rootProps = null) {
|
|
2818
|
+
if (!shared.isFunction(rootComponent)) {
|
|
2819
|
+
rootComponent = shared.extend({}, rootComponent);
|
|
2791
2820
|
}
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
container._vnode = vnode;
|
|
2795
|
-
};
|
|
2796
|
-
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
2797
|
-
optimized = optimized || !!vnode.dynamicChildren;
|
|
2798
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
2799
|
-
const onMismatch = () => handleMismatch(
|
|
2800
|
-
node,
|
|
2801
|
-
vnode,
|
|
2802
|
-
parentComponent,
|
|
2803
|
-
parentSuspense,
|
|
2804
|
-
slotScopeIds,
|
|
2805
|
-
isFragmentStart
|
|
2806
|
-
);
|
|
2807
|
-
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
2808
|
-
let domType = node.nodeType;
|
|
2809
|
-
vnode.el = node;
|
|
2810
|
-
if (patchFlag === -2) {
|
|
2811
|
-
optimized = false;
|
|
2812
|
-
vnode.dynamicChildren = null;
|
|
2821
|
+
if (rootProps != null && !shared.isObject(rootProps)) {
|
|
2822
|
+
rootProps = null;
|
|
2813
2823
|
}
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2824
|
+
const context = createAppContext();
|
|
2825
|
+
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
2826
|
+
const pluginCleanupFns = [];
|
|
2827
|
+
let isMounted = false;
|
|
2828
|
+
const app = context.app = {
|
|
2829
|
+
_uid: uid$1++,
|
|
2830
|
+
_component: rootComponent,
|
|
2831
|
+
_props: rootProps,
|
|
2832
|
+
_container: null,
|
|
2833
|
+
_context: context,
|
|
2834
|
+
_instance: null,
|
|
2835
|
+
version,
|
|
2836
|
+
get config() {
|
|
2837
|
+
return context.config;
|
|
2838
|
+
},
|
|
2839
|
+
set config(v) {
|
|
2840
|
+
},
|
|
2841
|
+
use(plugin, ...options) {
|
|
2842
|
+
if (installedPlugins.has(plugin)) ; else if (plugin && shared.isFunction(plugin.install)) {
|
|
2843
|
+
installedPlugins.add(plugin);
|
|
2844
|
+
plugin.install(app, ...options);
|
|
2845
|
+
} else if (shared.isFunction(plugin)) {
|
|
2846
|
+
installedPlugins.add(plugin);
|
|
2847
|
+
plugin(app, ...options);
|
|
2848
|
+
} else ;
|
|
2849
|
+
return app;
|
|
2850
|
+
},
|
|
2851
|
+
mixin(mixin) {
|
|
2852
|
+
{
|
|
2853
|
+
if (!context.mixins.includes(mixin)) {
|
|
2854
|
+
context.mixins.push(mixin);
|
|
2828
2855
|
}
|
|
2829
|
-
nextNode = nextSibling(node);
|
|
2830
|
-
}
|
|
2831
|
-
break;
|
|
2832
|
-
case Comment:
|
|
2833
|
-
if (isTemplateNode(node)) {
|
|
2834
|
-
nextNode = nextSibling(node);
|
|
2835
|
-
replaceNode(
|
|
2836
|
-
vnode.el = node.content.firstChild,
|
|
2837
|
-
node,
|
|
2838
|
-
parentComponent
|
|
2839
|
-
);
|
|
2840
|
-
} else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
2841
|
-
nextNode = onMismatch();
|
|
2842
|
-
} else {
|
|
2843
|
-
nextNode = nextSibling(node);
|
|
2844
|
-
}
|
|
2845
|
-
break;
|
|
2846
|
-
case Static:
|
|
2847
|
-
if (isFragmentStart) {
|
|
2848
|
-
node = nextSibling(node);
|
|
2849
|
-
domType = node.nodeType;
|
|
2850
2856
|
}
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
vnode.children += nextNode.nodeType === 1 /* ELEMENT */ ? nextNode.outerHTML : nextNode.data;
|
|
2857
|
-
if (i === vnode.staticCount - 1) {
|
|
2858
|
-
vnode.anchor = nextNode;
|
|
2859
|
-
}
|
|
2860
|
-
nextNode = nextSibling(nextNode);
|
|
2861
|
-
}
|
|
2862
|
-
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
2863
|
-
} else {
|
|
2864
|
-
onMismatch();
|
|
2857
|
+
return app;
|
|
2858
|
+
},
|
|
2859
|
+
component(name, component) {
|
|
2860
|
+
if (!component) {
|
|
2861
|
+
return context.components[name];
|
|
2865
2862
|
}
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
node,
|
|
2873
|
-
vnode,
|
|
2874
|
-
parentComponent,
|
|
2875
|
-
parentSuspense,
|
|
2876
|
-
slotScopeIds,
|
|
2877
|
-
optimized
|
|
2878
|
-
);
|
|
2863
|
+
context.components[name] = component;
|
|
2864
|
+
return app;
|
|
2865
|
+
},
|
|
2866
|
+
directive(name, directive) {
|
|
2867
|
+
if (!directive) {
|
|
2868
|
+
return context.directives[name];
|
|
2879
2869
|
}
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
slotScopeIds,
|
|
2892
|
-
optimized
|
|
2893
|
-
);
|
|
2870
|
+
context.directives[name] = directive;
|
|
2871
|
+
return app;
|
|
2872
|
+
},
|
|
2873
|
+
mount(rootContainer, isHydrate, namespace) {
|
|
2874
|
+
if (!isMounted) {
|
|
2875
|
+
const vnode = createVNode(rootComponent, rootProps);
|
|
2876
|
+
vnode.appContext = context;
|
|
2877
|
+
if (namespace === true) {
|
|
2878
|
+
namespace = "svg";
|
|
2879
|
+
} else if (namespace === false) {
|
|
2880
|
+
namespace = void 0;
|
|
2894
2881
|
}
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
const container = parentNode(node);
|
|
2898
|
-
if (isFragmentStart) {
|
|
2899
|
-
nextNode = locateClosingAnchor(node);
|
|
2900
|
-
} else if (isComment(node) && node.data === "teleport start") {
|
|
2901
|
-
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
2882
|
+
if (isHydrate && hydrate) {
|
|
2883
|
+
hydrate(vnode, rootContainer);
|
|
2902
2884
|
} else {
|
|
2903
|
-
|
|
2885
|
+
render(vnode, rootContainer, namespace);
|
|
2904
2886
|
}
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2887
|
+
isMounted = true;
|
|
2888
|
+
app._container = rootContainer;
|
|
2889
|
+
rootContainer.__vue_app__ = app;
|
|
2890
|
+
return getComponentPublicInstance(vnode.component);
|
|
2891
|
+
}
|
|
2892
|
+
},
|
|
2893
|
+
onUnmount(cleanupFn) {
|
|
2894
|
+
pluginCleanupFns.push(cleanupFn);
|
|
2895
|
+
},
|
|
2896
|
+
unmount() {
|
|
2897
|
+
if (isMounted) {
|
|
2898
|
+
callWithAsyncErrorHandling(
|
|
2899
|
+
pluginCleanupFns,
|
|
2900
|
+
app._instance,
|
|
2901
|
+
16
|
|
2913
2902
|
);
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2903
|
+
render(null, app._container);
|
|
2904
|
+
delete app._container.__vue_app__;
|
|
2905
|
+
}
|
|
2906
|
+
},
|
|
2907
|
+
provide(key, value) {
|
|
2908
|
+
context.provides[key] = value;
|
|
2909
|
+
return app;
|
|
2910
|
+
},
|
|
2911
|
+
runWithContext(fn) {
|
|
2912
|
+
const lastApp = currentApp;
|
|
2913
|
+
currentApp = app;
|
|
2914
|
+
try {
|
|
2915
|
+
return fn();
|
|
2916
|
+
} finally {
|
|
2917
|
+
currentApp = lastApp;
|
|
2918
|
+
}
|
|
2919
|
+
}
|
|
2920
|
+
};
|
|
2921
|
+
return app;
|
|
2922
|
+
};
|
|
2923
|
+
}
|
|
2924
|
+
let currentApp = null;
|
|
2925
|
+
|
|
2926
|
+
function provide(key, value) {
|
|
2927
|
+
if (!currentInstance) ; else {
|
|
2928
|
+
let provides = currentInstance.provides;
|
|
2929
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
2930
|
+
if (parentProvides === provides) {
|
|
2931
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
2932
|
+
}
|
|
2933
|
+
provides[key] = value;
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
2937
|
+
const instance = currentInstance || currentRenderingInstance;
|
|
2938
|
+
if (instance || currentApp) {
|
|
2939
|
+
const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
|
|
2940
|
+
if (provides && key in provides) {
|
|
2941
|
+
return provides[key];
|
|
2942
|
+
} else if (arguments.length > 1) {
|
|
2943
|
+
return treatDefaultAsFactory && shared.isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
2944
|
+
} else ;
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
function hasInjectionContext() {
|
|
2948
|
+
return !!(currentInstance || currentRenderingInstance || currentApp);
|
|
2949
|
+
}
|
|
2950
|
+
|
|
2951
|
+
const internalObjectProto = {};
|
|
2952
|
+
const createInternalObject = () => Object.create(internalObjectProto);
|
|
2953
|
+
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
2954
|
+
|
|
2955
|
+
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
2956
|
+
const props = {};
|
|
2957
|
+
const attrs = createInternalObject();
|
|
2958
|
+
instance.propsDefaults = /* @__PURE__ */ Object.create(null);
|
|
2959
|
+
setFullProps(instance, rawProps, props, attrs);
|
|
2960
|
+
for (const key in instance.propsOptions[0]) {
|
|
2961
|
+
if (!(key in props)) {
|
|
2962
|
+
props[key] = void 0;
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
if (isStateful) {
|
|
2966
|
+
instance.props = isSSR ? props : reactivity.shallowReactive(props);
|
|
2967
|
+
} else {
|
|
2968
|
+
if (!instance.type.props) {
|
|
2969
|
+
instance.props = attrs;
|
|
2970
|
+
} else {
|
|
2971
|
+
instance.props = props;
|
|
2972
|
+
}
|
|
2973
|
+
}
|
|
2974
|
+
instance.attrs = attrs;
|
|
2975
|
+
}
|
|
2976
|
+
function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
2977
|
+
const {
|
|
2978
|
+
props,
|
|
2979
|
+
attrs,
|
|
2980
|
+
vnode: { patchFlag }
|
|
2981
|
+
} = instance;
|
|
2982
|
+
const rawCurrentProps = reactivity.toRaw(props);
|
|
2983
|
+
const [options] = instance.propsOptions;
|
|
2984
|
+
let hasAttrsChanged = false;
|
|
2985
|
+
if (
|
|
2986
|
+
// always force full diff in dev
|
|
2987
|
+
// - #1942 if hmr is enabled with sfc component
|
|
2988
|
+
// - vite#872 non-sfc component used by sfc component
|
|
2989
|
+
(optimized || patchFlag > 0) && !(patchFlag & 16)
|
|
2990
|
+
) {
|
|
2991
|
+
if (patchFlag & 8) {
|
|
2992
|
+
const propsToUpdate = instance.vnode.dynamicProps;
|
|
2993
|
+
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
2994
|
+
let key = propsToUpdate[i];
|
|
2995
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
2996
|
+
continue;
|
|
2997
|
+
}
|
|
2998
|
+
const value = rawProps[key];
|
|
2999
|
+
if (options) {
|
|
3000
|
+
if (shared.hasOwn(attrs, key)) {
|
|
3001
|
+
if (value !== attrs[key]) {
|
|
3002
|
+
attrs[key] = value;
|
|
3003
|
+
hasAttrsChanged = true;
|
|
2921
3004
|
}
|
|
2922
|
-
subTree.el = node;
|
|
2923
|
-
vnode.component.subTree = subTree;
|
|
2924
|
-
}
|
|
2925
|
-
} else if (shapeFlag & 64) {
|
|
2926
|
-
if (domType !== 8 /* COMMENT */) {
|
|
2927
|
-
nextNode = onMismatch();
|
|
2928
3005
|
} else {
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
hydrateChildren
|
|
3006
|
+
const camelizedKey = shared.camelize(key);
|
|
3007
|
+
props[camelizedKey] = resolvePropValue(
|
|
3008
|
+
options,
|
|
3009
|
+
rawCurrentProps,
|
|
3010
|
+
camelizedKey,
|
|
3011
|
+
value,
|
|
3012
|
+
instance,
|
|
3013
|
+
false
|
|
2938
3014
|
);
|
|
2939
3015
|
}
|
|
2940
|
-
} else
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
parentSuspense,
|
|
2946
|
-
getContainerType(parentNode(node)),
|
|
2947
|
-
slotScopeIds,
|
|
2948
|
-
optimized,
|
|
2949
|
-
rendererInternals,
|
|
2950
|
-
hydrateNode
|
|
2951
|
-
);
|
|
2952
|
-
} else ;
|
|
2953
|
-
}
|
|
2954
|
-
if (ref != null) {
|
|
2955
|
-
setRef(ref, null, parentSuspense, vnode);
|
|
2956
|
-
}
|
|
2957
|
-
return nextNode;
|
|
2958
|
-
};
|
|
2959
|
-
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2960
|
-
optimized = optimized || !!vnode.dynamicChildren;
|
|
2961
|
-
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
2962
|
-
const forcePatch = type === "input" || type === "option";
|
|
2963
|
-
if (forcePatch || patchFlag !== -1) {
|
|
2964
|
-
if (dirs) {
|
|
2965
|
-
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
2966
|
-
}
|
|
2967
|
-
let needCallTransitionHooks = false;
|
|
2968
|
-
if (isTemplateNode(el)) {
|
|
2969
|
-
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
2970
|
-
const content = el.content.firstChild;
|
|
2971
|
-
if (needCallTransitionHooks) {
|
|
2972
|
-
transition.beforeEnter(content);
|
|
2973
|
-
}
|
|
2974
|
-
replaceNode(content, el, parentComponent);
|
|
2975
|
-
vnode.el = el = content;
|
|
2976
|
-
}
|
|
2977
|
-
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
2978
|
-
!(props && (props.innerHTML || props.textContent))) {
|
|
2979
|
-
let next = hydrateChildren(
|
|
2980
|
-
el.firstChild,
|
|
2981
|
-
vnode,
|
|
2982
|
-
el,
|
|
2983
|
-
parentComponent,
|
|
2984
|
-
parentSuspense,
|
|
2985
|
-
slotScopeIds,
|
|
2986
|
-
optimized
|
|
2987
|
-
);
|
|
2988
|
-
while (next) {
|
|
2989
|
-
logMismatchError();
|
|
2990
|
-
const cur = next;
|
|
2991
|
-
next = next.nextSibling;
|
|
2992
|
-
remove(cur);
|
|
2993
|
-
}
|
|
2994
|
-
} else if (shapeFlag & 8) {
|
|
2995
|
-
if (el.textContent !== vnode.children) {
|
|
2996
|
-
logMismatchError();
|
|
2997
|
-
el.textContent = vnode.children;
|
|
3016
|
+
} else {
|
|
3017
|
+
if (value !== attrs[key]) {
|
|
3018
|
+
attrs[key] = value;
|
|
3019
|
+
hasAttrsChanged = true;
|
|
3020
|
+
}
|
|
2998
3021
|
}
|
|
2999
3022
|
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3023
|
+
}
|
|
3024
|
+
} else {
|
|
3025
|
+
if (setFullProps(instance, rawProps, props, attrs)) {
|
|
3026
|
+
hasAttrsChanged = true;
|
|
3027
|
+
}
|
|
3028
|
+
let kebabKey;
|
|
3029
|
+
for (const key in rawCurrentProps) {
|
|
3030
|
+
if (!rawProps || // for camelCase
|
|
3031
|
+
!shared.hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
|
|
3032
|
+
// and converted to camelCase (#955)
|
|
3033
|
+
((kebabKey = shared.hyphenate(key)) === key || !shared.hasOwn(rawProps, kebabKey))) {
|
|
3034
|
+
if (options) {
|
|
3035
|
+
if (rawPrevProps && // for camelCase
|
|
3036
|
+
(rawPrevProps[key] !== void 0 || // for kebab-case
|
|
3037
|
+
rawPrevProps[kebabKey] !== void 0)) {
|
|
3038
|
+
props[key] = resolvePropValue(
|
|
3039
|
+
options,
|
|
3040
|
+
rawCurrentProps,
|
|
3041
|
+
key,
|
|
3042
|
+
void 0,
|
|
3043
|
+
instance,
|
|
3044
|
+
true
|
|
3045
|
+
);
|
|
3007
3046
|
}
|
|
3008
|
-
} else
|
|
3009
|
-
|
|
3010
|
-
el,
|
|
3011
|
-
"onClick",
|
|
3012
|
-
null,
|
|
3013
|
-
props.onClick,
|
|
3014
|
-
void 0,
|
|
3015
|
-
parentComponent
|
|
3016
|
-
);
|
|
3017
|
-
} else if (patchFlag & 4 && reactivity.isReactive(props.style)) {
|
|
3018
|
-
for (const key in props.style) props.style[key];
|
|
3047
|
+
} else {
|
|
3048
|
+
delete props[key];
|
|
3019
3049
|
}
|
|
3020
3050
|
}
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3051
|
+
}
|
|
3052
|
+
if (attrs !== rawCurrentProps) {
|
|
3053
|
+
for (const key in attrs) {
|
|
3054
|
+
if (!rawProps || !shared.hasOwn(rawProps, key) && true) {
|
|
3055
|
+
delete attrs[key];
|
|
3056
|
+
hasAttrsChanged = true;
|
|
3057
|
+
}
|
|
3024
3058
|
}
|
|
3025
|
-
|
|
3026
|
-
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
if (hasAttrsChanged) {
|
|
3062
|
+
reactivity.trigger(instance.attrs, "set", "");
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
function setFullProps(instance, rawProps, props, attrs) {
|
|
3066
|
+
const [options, needCastKeys] = instance.propsOptions;
|
|
3067
|
+
let hasAttrsChanged = false;
|
|
3068
|
+
let rawCastValues;
|
|
3069
|
+
if (rawProps) {
|
|
3070
|
+
for (let key in rawProps) {
|
|
3071
|
+
if (shared.isReservedProp(key)) {
|
|
3072
|
+
continue;
|
|
3027
3073
|
}
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
}
|
|
3074
|
+
const value = rawProps[key];
|
|
3075
|
+
let camelKey;
|
|
3076
|
+
if (options && shared.hasOwn(options, camelKey = shared.camelize(key))) {
|
|
3077
|
+
if (!needCastKeys || !needCastKeys.includes(camelKey)) {
|
|
3078
|
+
props[camelKey] = value;
|
|
3079
|
+
} else {
|
|
3080
|
+
(rawCastValues || (rawCastValues = {}))[camelKey] = value;
|
|
3081
|
+
}
|
|
3082
|
+
} else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
3083
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
3084
|
+
attrs[key] = value;
|
|
3085
|
+
hasAttrsChanged = true;
|
|
3086
|
+
}
|
|
3034
3087
|
}
|
|
3035
3088
|
}
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3089
|
+
}
|
|
3090
|
+
if (needCastKeys) {
|
|
3091
|
+
const rawCurrentProps = reactivity.toRaw(props);
|
|
3092
|
+
const castValues = rawCastValues || shared.EMPTY_OBJ;
|
|
3093
|
+
for (let i = 0; i < needCastKeys.length; i++) {
|
|
3094
|
+
const key = needCastKeys[i];
|
|
3095
|
+
props[key] = resolvePropValue(
|
|
3096
|
+
options,
|
|
3097
|
+
rawCurrentProps,
|
|
3098
|
+
key,
|
|
3099
|
+
castValues[key],
|
|
3100
|
+
instance,
|
|
3101
|
+
!shared.hasOwn(castValues, key)
|
|
3102
|
+
);
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
return hasAttrsChanged;
|
|
3106
|
+
}
|
|
3107
|
+
function resolvePropValue(options, props, key, value, instance, isAbsent) {
|
|
3108
|
+
const opt = options[key];
|
|
3109
|
+
if (opt != null) {
|
|
3110
|
+
const hasDefault = shared.hasOwn(opt, "default");
|
|
3111
|
+
if (hasDefault && value === void 0) {
|
|
3112
|
+
const defaultValue = opt.default;
|
|
3113
|
+
if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
|
|
3114
|
+
const { propsDefaults } = instance;
|
|
3115
|
+
if (key in propsDefaults) {
|
|
3116
|
+
value = propsDefaults[key];
|
|
3117
|
+
} else {
|
|
3118
|
+
const reset = setCurrentInstance(instance);
|
|
3119
|
+
value = propsDefaults[key] = defaultValue.call(
|
|
3120
|
+
null,
|
|
3121
|
+
props
|
|
3122
|
+
);
|
|
3123
|
+
reset();
|
|
3058
3124
|
}
|
|
3059
|
-
node = hydrateNode(
|
|
3060
|
-
node,
|
|
3061
|
-
vnode,
|
|
3062
|
-
parentComponent,
|
|
3063
|
-
parentSuspense,
|
|
3064
|
-
slotScopeIds,
|
|
3065
|
-
optimized
|
|
3066
|
-
);
|
|
3067
|
-
} else if (isText && !vnode.children) {
|
|
3068
|
-
insert(vnode.el = createText(""), container);
|
|
3069
3125
|
} else {
|
|
3070
|
-
|
|
3071
|
-
patch(
|
|
3072
|
-
null,
|
|
3073
|
-
vnode,
|
|
3074
|
-
container,
|
|
3075
|
-
null,
|
|
3076
|
-
parentComponent,
|
|
3077
|
-
parentSuspense,
|
|
3078
|
-
getContainerType(container),
|
|
3079
|
-
slotScopeIds
|
|
3080
|
-
);
|
|
3126
|
+
value = defaultValue;
|
|
3081
3127
|
}
|
|
3082
3128
|
}
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3129
|
+
if (opt[0 /* shouldCast */]) {
|
|
3130
|
+
if (isAbsent && !hasDefault) {
|
|
3131
|
+
value = false;
|
|
3132
|
+
} else if (opt[1 /* shouldCastTrue */] && (value === "" || value === shared.hyphenate(key))) {
|
|
3133
|
+
value = true;
|
|
3134
|
+
}
|
|
3089
3135
|
}
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3136
|
+
}
|
|
3137
|
+
return value;
|
|
3138
|
+
}
|
|
3139
|
+
const mixinPropsCache = /* @__PURE__ */ new WeakMap();
|
|
3140
|
+
function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
3141
|
+
const cache = asMixin ? mixinPropsCache : appContext.propsCache;
|
|
3142
|
+
const cached = cache.get(comp);
|
|
3143
|
+
if (cached) {
|
|
3144
|
+
return cached;
|
|
3145
|
+
}
|
|
3146
|
+
const raw = comp.props;
|
|
3147
|
+
const normalized = {};
|
|
3148
|
+
const needCastKeys = [];
|
|
3149
|
+
let hasExtends = false;
|
|
3150
|
+
if (!shared.isFunction(comp)) {
|
|
3151
|
+
const extendProps = (raw2) => {
|
|
3152
|
+
hasExtends = true;
|
|
3153
|
+
const [props, keys] = normalizePropsOptions(raw2, appContext, true);
|
|
3154
|
+
shared.extend(normalized, props);
|
|
3155
|
+
if (keys) needCastKeys.push(...keys);
|
|
3156
|
+
};
|
|
3157
|
+
if (!asMixin && appContext.mixins.length) {
|
|
3158
|
+
appContext.mixins.forEach(extendProps);
|
|
3106
3159
|
}
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3160
|
+
if (comp.extends) {
|
|
3161
|
+
extendProps(comp.extends);
|
|
3162
|
+
}
|
|
3163
|
+
if (comp.mixins) {
|
|
3164
|
+
comp.mixins.forEach(extendProps);
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
if (!raw && !hasExtends) {
|
|
3168
|
+
if (shared.isObject(comp)) {
|
|
3169
|
+
cache.set(comp, shared.EMPTY_ARR);
|
|
3170
|
+
}
|
|
3171
|
+
return shared.EMPTY_ARR;
|
|
3172
|
+
}
|
|
3173
|
+
if (shared.isArray(raw)) {
|
|
3174
|
+
for (let i = 0; i < raw.length; i++) {
|
|
3175
|
+
const normalizedKey = shared.camelize(raw[i]);
|
|
3176
|
+
if (validatePropName(normalizedKey)) {
|
|
3177
|
+
normalized[normalizedKey] = shared.EMPTY_OBJ;
|
|
3120
3178
|
}
|
|
3121
3179
|
}
|
|
3122
|
-
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
if (node && isComment(node)) {
|
|
3142
|
-
if (node.data === open) match++;
|
|
3143
|
-
if (node.data === close) {
|
|
3144
|
-
if (match === 0) {
|
|
3145
|
-
return nextSibling(node);
|
|
3146
|
-
} else {
|
|
3147
|
-
match--;
|
|
3180
|
+
} else if (raw) {
|
|
3181
|
+
for (const key in raw) {
|
|
3182
|
+
const normalizedKey = shared.camelize(key);
|
|
3183
|
+
if (validatePropName(normalizedKey)) {
|
|
3184
|
+
const opt = raw[key];
|
|
3185
|
+
const prop = normalized[normalizedKey] = shared.isArray(opt) || shared.isFunction(opt) ? { type: opt } : shared.extend({}, opt);
|
|
3186
|
+
const propType = prop.type;
|
|
3187
|
+
let shouldCast = false;
|
|
3188
|
+
let shouldCastTrue = true;
|
|
3189
|
+
if (shared.isArray(propType)) {
|
|
3190
|
+
for (let index = 0; index < propType.length; ++index) {
|
|
3191
|
+
const type = propType[index];
|
|
3192
|
+
const typeName = shared.isFunction(type) && type.name;
|
|
3193
|
+
if (typeName === "Boolean") {
|
|
3194
|
+
shouldCast = true;
|
|
3195
|
+
break;
|
|
3196
|
+
} else if (typeName === "String") {
|
|
3197
|
+
shouldCastTrue = false;
|
|
3198
|
+
}
|
|
3148
3199
|
}
|
|
3200
|
+
} else {
|
|
3201
|
+
shouldCast = shared.isFunction(propType) && propType.name === "Boolean";
|
|
3202
|
+
}
|
|
3203
|
+
prop[0 /* shouldCast */] = shouldCast;
|
|
3204
|
+
prop[1 /* shouldCastTrue */] = shouldCastTrue;
|
|
3205
|
+
if (shouldCast || shared.hasOwn(prop, "default")) {
|
|
3206
|
+
needCastKeys.push(normalizedKey);
|
|
3149
3207
|
}
|
|
3150
3208
|
}
|
|
3151
3209
|
}
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3210
|
+
}
|
|
3211
|
+
const res = [normalized, needCastKeys];
|
|
3212
|
+
if (shared.isObject(comp)) {
|
|
3213
|
+
cache.set(comp, res);
|
|
3214
|
+
}
|
|
3215
|
+
return res;
|
|
3216
|
+
}
|
|
3217
|
+
function validatePropName(key) {
|
|
3218
|
+
if (key[0] !== "$" && !shared.isReservedProp(key)) {
|
|
3219
|
+
return true;
|
|
3220
|
+
}
|
|
3221
|
+
return false;
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
const isInternalKey = (key) => key[0] === "_" || key === "$stable";
|
|
3225
|
+
const normalizeSlotValue = (value) => shared.isArray(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
|
|
3226
|
+
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
3227
|
+
if (rawSlot._n) {
|
|
3228
|
+
return rawSlot;
|
|
3229
|
+
}
|
|
3230
|
+
const normalized = withCtx((...args) => {
|
|
3231
|
+
if (false) ;
|
|
3232
|
+
return normalizeSlotValue(rawSlot(...args));
|
|
3233
|
+
}, ctx);
|
|
3234
|
+
normalized._c = false;
|
|
3235
|
+
return normalized;
|
|
3236
|
+
};
|
|
3237
|
+
const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
3238
|
+
const ctx = rawSlots._ctx;
|
|
3239
|
+
for (const key in rawSlots) {
|
|
3240
|
+
if (isInternalKey(key)) continue;
|
|
3241
|
+
const value = rawSlots[key];
|
|
3242
|
+
if (shared.isFunction(value)) {
|
|
3243
|
+
slots[key] = normalizeSlot(key, value, ctx);
|
|
3244
|
+
} else if (value != null) {
|
|
3245
|
+
const normalized = normalizeSlotValue(value);
|
|
3246
|
+
slots[key] = () => normalized;
|
|
3158
3247
|
}
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3248
|
+
}
|
|
3249
|
+
};
|
|
3250
|
+
const normalizeVNodeSlots = (instance, children) => {
|
|
3251
|
+
const normalized = normalizeSlotValue(children);
|
|
3252
|
+
instance.slots.default = () => normalized;
|
|
3253
|
+
};
|
|
3254
|
+
const assignSlots = (slots, children, optimized) => {
|
|
3255
|
+
for (const key in children) {
|
|
3256
|
+
if (optimized || key !== "_") {
|
|
3257
|
+
slots[key] = children[key];
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
};
|
|
3261
|
+
const initSlots = (instance, children, optimized) => {
|
|
3262
|
+
const slots = instance.slots = createInternalObject();
|
|
3263
|
+
if (instance.vnode.shapeFlag & 32) {
|
|
3264
|
+
const type = children._;
|
|
3265
|
+
if (type) {
|
|
3266
|
+
assignSlots(slots, children, optimized);
|
|
3267
|
+
if (optimized) {
|
|
3268
|
+
shared.def(slots, "_", type, true);
|
|
3163
3269
|
}
|
|
3164
|
-
|
|
3270
|
+
} else {
|
|
3271
|
+
normalizeObjectSlots(children, slots);
|
|
3165
3272
|
}
|
|
3166
|
-
}
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
}
|
|
3273
|
+
} else if (children) {
|
|
3274
|
+
normalizeVNodeSlots(instance, children);
|
|
3275
|
+
}
|
|
3276
|
+
};
|
|
3277
|
+
const updateSlots = (instance, children, optimized) => {
|
|
3278
|
+
const { vnode, slots } = instance;
|
|
3279
|
+
let needDeletionCheck = true;
|
|
3280
|
+
let deletionComparisonTarget = shared.EMPTY_OBJ;
|
|
3281
|
+
if (vnode.shapeFlag & 32) {
|
|
3282
|
+
const type = children._;
|
|
3283
|
+
if (type) {
|
|
3284
|
+
if (optimized && type === 1) {
|
|
3285
|
+
needDeletionCheck = false;
|
|
3286
|
+
} else {
|
|
3287
|
+
assignSlots(slots, children, optimized);
|
|
3288
|
+
}
|
|
3289
|
+
} else {
|
|
3290
|
+
needDeletionCheck = !children.$stable;
|
|
3291
|
+
normalizeObjectSlots(children, slots);
|
|
3292
|
+
}
|
|
3293
|
+
deletionComparisonTarget = children;
|
|
3294
|
+
} else if (children) {
|
|
3295
|
+
normalizeVNodeSlots(instance, children);
|
|
3296
|
+
deletionComparisonTarget = { default: 1 };
|
|
3297
|
+
}
|
|
3298
|
+
if (needDeletionCheck) {
|
|
3299
|
+
for (const key in slots) {
|
|
3300
|
+
if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
|
|
3301
|
+
delete slots[key];
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
};
|
|
3172
3306
|
|
|
3173
3307
|
const queuePostRenderEffect = queueEffectWithSuspense ;
|
|
3174
3308
|
function createRenderer(options) {
|
|
@@ -3772,13 +3906,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3772
3906
|
null
|
|
3773
3907
|
);
|
|
3774
3908
|
};
|
|
3775
|
-
if (isAsyncWrapperVNode
|
|
3776
|
-
type.
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
// and it will never need to change.
|
|
3781
|
-
() => !instance.isUnmounted && hydrateSubTree()
|
|
3909
|
+
if (isAsyncWrapperVNode) {
|
|
3910
|
+
type.__asyncHydrate(
|
|
3911
|
+
el,
|
|
3912
|
+
instance,
|
|
3913
|
+
hydrateSubTree
|
|
3782
3914
|
);
|
|
3783
3915
|
} else {
|
|
3784
3916
|
hydrateSubTree();
|
|
@@ -6384,7 +6516,7 @@ function isMemoSame(cached, memo) {
|
|
|
6384
6516
|
return true;
|
|
6385
6517
|
}
|
|
6386
6518
|
|
|
6387
|
-
const version = "3.5.0-alpha.
|
|
6519
|
+
const version = "3.5.0-alpha.5";
|
|
6388
6520
|
const warn$1 = shared.NOOP;
|
|
6389
6521
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6390
6522
|
const devtools = void 0;
|
|
@@ -6483,6 +6615,10 @@ exports.guardReactiveProps = guardReactiveProps;
|
|
|
6483
6615
|
exports.h = h;
|
|
6484
6616
|
exports.handleError = handleError;
|
|
6485
6617
|
exports.hasInjectionContext = hasInjectionContext;
|
|
6618
|
+
exports.hydrateOnIdle = hydrateOnIdle;
|
|
6619
|
+
exports.hydrateOnInteraction = hydrateOnInteraction;
|
|
6620
|
+
exports.hydrateOnMediaQuery = hydrateOnMediaQuery;
|
|
6621
|
+
exports.hydrateOnVisible = hydrateOnVisible;
|
|
6486
6622
|
exports.initCustomFormatter = initCustomFormatter;
|
|
6487
6623
|
exports.inject = inject;
|
|
6488
6624
|
exports.isMemoSame = isMemoSame;
|