@cabloy/vue-runtime-core 3.5.31 → 3.5.32
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 +1400 -1402
- package/dist/runtime-core.cjs.prod.js +1171 -1173
- package/dist/runtime-core.esm-bundler.js +1413 -1415
- package/package.json +1 -1
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { pauseTracking, resetTracking, isRef, toRaw, traverse,
|
|
6
|
+
import { pauseTracking, resetTracking, isRef, toRaw, traverse, isReactive, isShallow, shallowReadArray, toReactive, shallowRef, readonly, ref, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
|
-
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective,
|
|
8
|
+
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, remove, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isObject, hasOwn, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isSymbol, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
@@ -1474,1520 +1474,1518 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1474
1474
|
return ret;
|
|
1475
1475
|
}
|
|
1476
1476
|
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
}
|
|
1498
|
-
function markAsyncBoundary(instance) {
|
|
1499
|
-
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1502
|
-
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
1503
|
-
function useTemplateRef(key) {
|
|
1504
|
-
const i = getCurrentInstance();
|
|
1505
|
-
const r = shallowRef(null);
|
|
1506
|
-
if (i) {
|
|
1507
|
-
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
1508
|
-
let desc;
|
|
1509
|
-
if (!!(process.env.NODE_ENV !== "production") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
|
|
1510
|
-
warn$1(`useTemplateRef('${key}') already exists.`);
|
|
1511
|
-
} else {
|
|
1512
|
-
Object.defineProperty(refs, key, {
|
|
1513
|
-
enumerable: true,
|
|
1514
|
-
get: () => r.value,
|
|
1515
|
-
set: (val) => r.value = val
|
|
1516
|
-
});
|
|
1477
|
+
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
1478
|
+
const KeepAliveImpl = {
|
|
1479
|
+
name: `KeepAlive`,
|
|
1480
|
+
// Marker for special handling inside the renderer. We are not using a ===
|
|
1481
|
+
// check directly on KeepAlive in the renderer, because importing it directly
|
|
1482
|
+
// would prevent it from being tree-shaken.
|
|
1483
|
+
__isKeepAlive: true,
|
|
1484
|
+
props: {
|
|
1485
|
+
include: [String, RegExp, Array],
|
|
1486
|
+
exclude: [String, RegExp, Array],
|
|
1487
|
+
max: [String, Number]
|
|
1488
|
+
},
|
|
1489
|
+
setup(props, { slots }) {
|
|
1490
|
+
const instance = getCurrentInstance();
|
|
1491
|
+
const sharedContext = instance.ctx;
|
|
1492
|
+
if (!sharedContext.renderer) {
|
|
1493
|
+
return () => {
|
|
1494
|
+
const children = slots.default && slots.default();
|
|
1495
|
+
return children && children.length === 1 ? children[0] : children;
|
|
1496
|
+
};
|
|
1517
1497
|
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
)
|
|
1522
|
-
|
|
1523
|
-
const ret = !!(process.env.NODE_ENV !== "production") ? readonly(r) : r;
|
|
1524
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1525
|
-
knownTemplateRefs.add(ret);
|
|
1526
|
-
}
|
|
1527
|
-
return ret;
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
1531
|
-
if (isArray(rawRef)) {
|
|
1532
|
-
rawRef.forEach(
|
|
1533
|
-
(r, i) => setRef(
|
|
1534
|
-
r,
|
|
1535
|
-
oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
|
|
1536
|
-
parentSuspense,
|
|
1537
|
-
vnode,
|
|
1538
|
-
isUnmount
|
|
1539
|
-
)
|
|
1540
|
-
);
|
|
1541
|
-
return;
|
|
1542
|
-
}
|
|
1543
|
-
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1544
|
-
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
1545
|
-
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
1498
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1499
|
+
const keys = /* @__PURE__ */ new Set();
|
|
1500
|
+
let current = null;
|
|
1501
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
1502
|
+
instance.__v_cache = cache;
|
|
1546
1503
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
|
|
1555
|
-
);
|
|
1556
|
-
return;
|
|
1557
|
-
}
|
|
1558
|
-
const oldRef = oldRawRef && oldRawRef.r;
|
|
1559
|
-
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1560
|
-
const setupState = owner.setupState;
|
|
1561
|
-
const rawSetupState = toRaw(setupState);
|
|
1562
|
-
const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
|
|
1563
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1564
|
-
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
1565
|
-
warn$1(
|
|
1566
|
-
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1567
|
-
);
|
|
1504
|
+
const parentSuspense = instance.suspense;
|
|
1505
|
+
const {
|
|
1506
|
+
renderer: {
|
|
1507
|
+
p: patch,
|
|
1508
|
+
m: move,
|
|
1509
|
+
um: _unmount,
|
|
1510
|
+
o: { createElement }
|
|
1568
1511
|
}
|
|
1569
|
-
|
|
1570
|
-
|
|
1512
|
+
} = sharedContext;
|
|
1513
|
+
const storageContainer = createElement("div");
|
|
1514
|
+
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
1515
|
+
const instance2 = vnode.component;
|
|
1516
|
+
move(vnode, container, anchor, 0, parentSuspense);
|
|
1517
|
+
patch(
|
|
1518
|
+
instance2.vnode,
|
|
1519
|
+
vnode,
|
|
1520
|
+
container,
|
|
1521
|
+
anchor,
|
|
1522
|
+
instance2,
|
|
1523
|
+
parentSuspense,
|
|
1524
|
+
namespace,
|
|
1525
|
+
vnode.slotScopeIds,
|
|
1526
|
+
optimized
|
|
1527
|
+
);
|
|
1528
|
+
queuePostRenderEffect(() => {
|
|
1529
|
+
instance2.isDeactivated = false;
|
|
1530
|
+
if (instance2.a) {
|
|
1531
|
+
invokeArrayFns(instance2.a);
|
|
1532
|
+
}
|
|
1533
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
1534
|
+
if (vnodeHook) {
|
|
1535
|
+
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1536
|
+
}
|
|
1537
|
+
}, parentSuspense);
|
|
1538
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
1539
|
+
devtoolsComponentAdded(instance2);
|
|
1571
1540
|
}
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1541
|
+
};
|
|
1542
|
+
sharedContext.deactivate = (vnode) => {
|
|
1543
|
+
const instance2 = vnode.component;
|
|
1544
|
+
invalidateMount(instance2.m);
|
|
1545
|
+
invalidateMount(instance2.a);
|
|
1546
|
+
move(vnode, storageContainer, null, 1, parentSuspense);
|
|
1547
|
+
queuePostRenderEffect(() => {
|
|
1548
|
+
if (instance2.da) {
|
|
1549
|
+
invokeArrayFns(instance2.da);
|
|
1550
|
+
}
|
|
1551
|
+
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
1552
|
+
if (vnodeHook) {
|
|
1553
|
+
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
1554
|
+
}
|
|
1555
|
+
instance2.isDeactivated = true;
|
|
1556
|
+
}, parentSuspense);
|
|
1557
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
1558
|
+
devtoolsComponentAdded(instance2);
|
|
1580
1559
|
}
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1560
|
+
};
|
|
1561
|
+
function unmount(vnode) {
|
|
1562
|
+
resetShapeFlag(vnode);
|
|
1563
|
+
_unmount(vnode, instance, parentSuspense, true);
|
|
1583
1564
|
}
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
const _isRef = isRef(ref);
|
|
1590
|
-
if (_isString || _isRef) {
|
|
1591
|
-
const doSet = () => {
|
|
1592
|
-
if (rawRef.f) {
|
|
1593
|
-
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
1594
|
-
if (isUnmount) {
|
|
1595
|
-
isArray(existing) && remove(existing, refValue);
|
|
1596
|
-
} else {
|
|
1597
|
-
if (!isArray(existing)) {
|
|
1598
|
-
if (_isString) {
|
|
1599
|
-
refs[ref] = [refValue];
|
|
1600
|
-
if (canSetSetupRef(ref)) {
|
|
1601
|
-
setupState[ref] = refs[ref];
|
|
1602
|
-
}
|
|
1603
|
-
} else {
|
|
1604
|
-
ref.value = [refValue];
|
|
1605
|
-
if (rawRef.k) refs[rawRef.k] = ref.value;
|
|
1606
|
-
}
|
|
1607
|
-
} else if (!existing.includes(refValue)) {
|
|
1608
|
-
existing.push(refValue);
|
|
1609
|
-
}
|
|
1610
|
-
}
|
|
1611
|
-
} else if (_isString) {
|
|
1612
|
-
refs[ref] = value;
|
|
1613
|
-
if (canSetSetupRef(ref)) {
|
|
1614
|
-
setupState[ref] = value;
|
|
1615
|
-
}
|
|
1616
|
-
} else if (_isRef) {
|
|
1617
|
-
ref.value = value;
|
|
1618
|
-
if (rawRef.k) refs[rawRef.k] = value;
|
|
1619
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1620
|
-
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
1565
|
+
function pruneCache(filter) {
|
|
1566
|
+
cache.forEach((vnode, key) => {
|
|
1567
|
+
const name = vnode.key;
|
|
1568
|
+
if (name && !filter(name)) {
|
|
1569
|
+
pruneCacheEntry(key);
|
|
1621
1570
|
}
|
|
1622
|
-
};
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
function pruneCacheEntry(key) {
|
|
1574
|
+
const cached = cache.get(key);
|
|
1575
|
+
if (cached && (!current || !isSameVNodeType(cached, current))) {
|
|
1576
|
+
unmount(cached);
|
|
1577
|
+
} else if (current) {
|
|
1578
|
+
resetShapeFlag(current);
|
|
1628
1579
|
}
|
|
1629
|
-
|
|
1630
|
-
|
|
1580
|
+
cache.delete(key);
|
|
1581
|
+
keys.delete(key);
|
|
1631
1582
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
console.error("Hydration completed but contains mismatches.");
|
|
1641
|
-
hasLoggedMismatchError = true;
|
|
1642
|
-
};
|
|
1643
|
-
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
1644
|
-
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
1645
|
-
const getContainerType = (container) => {
|
|
1646
|
-
if (container.nodeType !== 1) return void 0;
|
|
1647
|
-
if (isSVGContainer(container)) return "svg";
|
|
1648
|
-
if (isMathMLContainer(container)) return "mathml";
|
|
1649
|
-
return void 0;
|
|
1650
|
-
};
|
|
1651
|
-
const isComment = (node) => node.nodeType === 8;
|
|
1652
|
-
function createHydrationFunctions(rendererInternals) {
|
|
1653
|
-
const {
|
|
1654
|
-
mt: mountComponent,
|
|
1655
|
-
p: patch,
|
|
1656
|
-
o: {
|
|
1657
|
-
patchProp,
|
|
1658
|
-
createText,
|
|
1659
|
-
nextSibling,
|
|
1660
|
-
parentNode,
|
|
1661
|
-
remove,
|
|
1662
|
-
insert,
|
|
1663
|
-
createComment
|
|
1664
|
-
}
|
|
1665
|
-
} = rendererInternals;
|
|
1666
|
-
const hydrate = (vnode, container) => {
|
|
1667
|
-
if (!container.hasChildNodes()) {
|
|
1668
|
-
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
1669
|
-
`Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
|
|
1670
|
-
);
|
|
1671
|
-
patch(null, vnode, container);
|
|
1672
|
-
flushPostFlushCbs();
|
|
1673
|
-
container._vnode = vnode;
|
|
1674
|
-
return;
|
|
1675
|
-
}
|
|
1676
|
-
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
1677
|
-
flushPostFlushCbs();
|
|
1678
|
-
container._vnode = vnode;
|
|
1679
|
-
};
|
|
1680
|
-
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
1681
|
-
optimized = optimized || !!vnode.dynamicChildren;
|
|
1682
|
-
const isFragmentStart = isComment(node) && node.data === "[";
|
|
1683
|
-
const onMismatch = () => handleMismatch(
|
|
1684
|
-
node,
|
|
1685
|
-
vnode,
|
|
1686
|
-
parentComponent,
|
|
1687
|
-
parentSuspense,
|
|
1688
|
-
slotScopeIds,
|
|
1689
|
-
isFragmentStart
|
|
1583
|
+
watch(
|
|
1584
|
+
() => [props.include, props.exclude],
|
|
1585
|
+
([include, exclude]) => {
|
|
1586
|
+
include && pruneCache((name) => matches(include, name));
|
|
1587
|
+
exclude && pruneCache((name) => !matches(exclude, name));
|
|
1588
|
+
},
|
|
1589
|
+
// prune post-render after `current` has been updated
|
|
1590
|
+
{ flush: "post", deep: true }
|
|
1690
1591
|
);
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
if (patchFlag === -2) {
|
|
1699
|
-
optimized = false;
|
|
1700
|
-
vnode.dynamicChildren = null;
|
|
1701
|
-
}
|
|
1702
|
-
let nextNode = null;
|
|
1703
|
-
switch (type) {
|
|
1704
|
-
case Text:
|
|
1705
|
-
if (domType !== 3) {
|
|
1706
|
-
if (vnode.children === "") {
|
|
1707
|
-
insert(vnode.el = createText(""), parentNode(node), node);
|
|
1708
|
-
nextNode = node;
|
|
1709
|
-
} else {
|
|
1710
|
-
nextNode = onMismatch();
|
|
1711
|
-
}
|
|
1592
|
+
let pendingCacheKey = null;
|
|
1593
|
+
const cacheSubtree = () => {
|
|
1594
|
+
if (pendingCacheKey != null) {
|
|
1595
|
+
if (isSuspense(instance.subTree.type)) {
|
|
1596
|
+
queuePostRenderEffect(() => {
|
|
1597
|
+
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
1598
|
+
}, instance.subTree.suspense);
|
|
1712
1599
|
} else {
|
|
1713
|
-
|
|
1714
|
-
node.data = vnode.children;
|
|
1715
|
-
}
|
|
1716
|
-
nextNode = nextSibling(node);
|
|
1600
|
+
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
1717
1601
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
onMounted(cacheSubtree);
|
|
1605
|
+
onUpdated(cacheSubtree);
|
|
1606
|
+
onBeforeUnmount(() => {
|
|
1607
|
+
cache.forEach((cached) => {
|
|
1608
|
+
const { subTree, suspense } = instance;
|
|
1609
|
+
const vnode = getInnerChild(subTree);
|
|
1610
|
+
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
1611
|
+
resetShapeFlag(vnode);
|
|
1612
|
+
const da = vnode.component.da;
|
|
1613
|
+
da && queuePostRenderEffect(da, suspense);
|
|
1614
|
+
return;
|
|
1731
1615
|
}
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1616
|
+
unmount(cached);
|
|
1617
|
+
});
|
|
1618
|
+
});
|
|
1619
|
+
return () => {
|
|
1620
|
+
pendingCacheKey = null;
|
|
1621
|
+
if (!slots.default) {
|
|
1622
|
+
return current = null;
|
|
1623
|
+
}
|
|
1624
|
+
const children = slots.default();
|
|
1625
|
+
const rawVNode = children[0];
|
|
1626
|
+
if (children.length > 1) {
|
|
1627
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1628
|
+
warn$1(`KeepAlive should contain exactly one component child.`);
|
|
1737
1629
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1630
|
+
current = null;
|
|
1631
|
+
return children;
|
|
1632
|
+
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
|
|
1633
|
+
current = null;
|
|
1634
|
+
return rawVNode;
|
|
1635
|
+
}
|
|
1636
|
+
let vnode = getInnerChild(rawVNode);
|
|
1637
|
+
if (vnode.type === Comment) {
|
|
1638
|
+
current = null;
|
|
1639
|
+
return vnode;
|
|
1640
|
+
}
|
|
1641
|
+
const comp = vnode.type;
|
|
1642
|
+
const name = vnode.key;
|
|
1643
|
+
const { include, exclude, max } = props;
|
|
1644
|
+
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
|
|
1645
|
+
vnode.shapeFlag &= ~256;
|
|
1646
|
+
current = vnode;
|
|
1647
|
+
return rawVNode;
|
|
1648
|
+
}
|
|
1649
|
+
const key = vnode.key == null ? comp : vnode.key;
|
|
1650
|
+
const cachedVNode = cache.get(key);
|
|
1651
|
+
if (vnode.el) {
|
|
1652
|
+
vnode = cloneVNode(vnode);
|
|
1653
|
+
if (rawVNode.shapeFlag & 128) {
|
|
1654
|
+
rawVNode.ssContent = vnode;
|
|
1752
1655
|
}
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
parentComponent,
|
|
1762
|
-
parentSuspense,
|
|
1763
|
-
slotScopeIds,
|
|
1764
|
-
optimized
|
|
1765
|
-
);
|
|
1656
|
+
}
|
|
1657
|
+
pendingCacheKey = key;
|
|
1658
|
+
if (cachedVNode) {
|
|
1659
|
+
vnode.el = cachedVNode.el;
|
|
1660
|
+
vnode.component = cachedVNode.component;
|
|
1661
|
+
vnode.component.zovaHostProviders = vnode.zovaHostProviders;
|
|
1662
|
+
if (vnode.transition) {
|
|
1663
|
+
setTransitionHooks(vnode, vnode.transition);
|
|
1766
1664
|
}
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
node,
|
|
1775
|
-
vnode,
|
|
1776
|
-
parentComponent,
|
|
1777
|
-
parentSuspense,
|
|
1778
|
-
slotScopeIds,
|
|
1779
|
-
optimized
|
|
1780
|
-
);
|
|
1781
|
-
}
|
|
1782
|
-
} else if (shapeFlag & 6) {
|
|
1783
|
-
vnode.slotScopeIds = slotScopeIds;
|
|
1784
|
-
const container = parentNode(node);
|
|
1785
|
-
if (isFragmentStart) {
|
|
1786
|
-
nextNode = locateClosingAnchor(node);
|
|
1787
|
-
} else if (isComment(node) && node.data === "teleport start") {
|
|
1788
|
-
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
1789
|
-
} else {
|
|
1790
|
-
nextNode = nextSibling(node);
|
|
1791
|
-
}
|
|
1792
|
-
mountComponent(
|
|
1793
|
-
vnode,
|
|
1794
|
-
container,
|
|
1795
|
-
null,
|
|
1796
|
-
parentComponent,
|
|
1797
|
-
parentSuspense,
|
|
1798
|
-
getContainerType(container),
|
|
1799
|
-
optimized
|
|
1800
|
-
);
|
|
1801
|
-
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
1802
|
-
let subTree;
|
|
1803
|
-
if (isFragmentStart) {
|
|
1804
|
-
subTree = createVNode(Fragment);
|
|
1805
|
-
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
1806
|
-
} else {
|
|
1807
|
-
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
1808
|
-
}
|
|
1809
|
-
subTree.el = node;
|
|
1810
|
-
vnode.component.subTree = subTree;
|
|
1811
|
-
}
|
|
1812
|
-
} else if (shapeFlag & 64) {
|
|
1813
|
-
if (domType !== 8) {
|
|
1814
|
-
nextNode = onMismatch();
|
|
1815
|
-
} else {
|
|
1816
|
-
nextNode = vnode.type.hydrate(
|
|
1817
|
-
node,
|
|
1818
|
-
vnode,
|
|
1819
|
-
parentComponent,
|
|
1820
|
-
parentSuspense,
|
|
1821
|
-
slotScopeIds,
|
|
1822
|
-
optimized,
|
|
1823
|
-
rendererInternals,
|
|
1824
|
-
hydrateChildren
|
|
1825
|
-
);
|
|
1826
|
-
}
|
|
1827
|
-
} else if (shapeFlag & 128) {
|
|
1828
|
-
nextNode = vnode.type.hydrate(
|
|
1829
|
-
node,
|
|
1830
|
-
vnode,
|
|
1831
|
-
parentComponent,
|
|
1832
|
-
parentSuspense,
|
|
1833
|
-
getContainerType(parentNode(node)),
|
|
1834
|
-
slotScopeIds,
|
|
1835
|
-
optimized,
|
|
1836
|
-
rendererInternals,
|
|
1837
|
-
hydrateNode
|
|
1838
|
-
);
|
|
1839
|
-
} else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
|
|
1840
|
-
warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
1665
|
+
vnode.shapeFlag |= 512;
|
|
1666
|
+
keys.delete(key);
|
|
1667
|
+
keys.add(key);
|
|
1668
|
+
} else {
|
|
1669
|
+
keys.add(key);
|
|
1670
|
+
if (max && keys.size > parseInt(max, 10)) {
|
|
1671
|
+
pruneCacheEntry(keys.values().next().value);
|
|
1841
1672
|
}
|
|
1673
|
+
}
|
|
1674
|
+
vnode.shapeFlag |= 256;
|
|
1675
|
+
current = vnode;
|
|
1676
|
+
return isSuspense(rawVNode.type) ? rawVNode : vnode;
|
|
1677
|
+
};
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
const KeepAlive = KeepAliveImpl;
|
|
1681
|
+
function matches(pattern, name) {
|
|
1682
|
+
if (isArray(pattern)) {
|
|
1683
|
+
return pattern.some((p) => matches(p, name));
|
|
1684
|
+
} else if (isString(pattern)) {
|
|
1685
|
+
return pattern.split(",").includes(name);
|
|
1686
|
+
} else if (isRegExp(pattern)) {
|
|
1687
|
+
pattern.lastIndex = 0;
|
|
1688
|
+
return pattern.test(name);
|
|
1689
|
+
}
|
|
1690
|
+
return false;
|
|
1691
|
+
}
|
|
1692
|
+
function onActivated(hook, target) {
|
|
1693
|
+
registerKeepAliveHook(hook, "a", target);
|
|
1694
|
+
}
|
|
1695
|
+
function onDeactivated(hook, target) {
|
|
1696
|
+
registerKeepAliveHook(hook, "da", target);
|
|
1697
|
+
}
|
|
1698
|
+
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
1699
|
+
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
1700
|
+
let current = target;
|
|
1701
|
+
while (current) {
|
|
1702
|
+
if (current.isDeactivated) {
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
current = current.parent;
|
|
1842
1706
|
}
|
|
1843
|
-
|
|
1844
|
-
|
|
1707
|
+
return hook();
|
|
1708
|
+
});
|
|
1709
|
+
injectHook(type, wrappedHook, target);
|
|
1710
|
+
if (target) {
|
|
1711
|
+
let current = target.parent;
|
|
1712
|
+
while (current && current.parent) {
|
|
1713
|
+
if (isKeepAlive(current.parent.vnode)) {
|
|
1714
|
+
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
1715
|
+
}
|
|
1716
|
+
current = current.parent;
|
|
1845
1717
|
}
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
1721
|
+
const injected = injectHook(
|
|
1722
|
+
type,
|
|
1723
|
+
hook,
|
|
1724
|
+
keepAliveRoot,
|
|
1725
|
+
true
|
|
1726
|
+
/* prepend */
|
|
1727
|
+
);
|
|
1728
|
+
onUnmounted(() => {
|
|
1729
|
+
remove(keepAliveRoot[type], injected);
|
|
1730
|
+
}, target);
|
|
1731
|
+
}
|
|
1732
|
+
function resetShapeFlag(vnode) {
|
|
1733
|
+
vnode.shapeFlag &= ~256;
|
|
1734
|
+
vnode.shapeFlag &= ~512;
|
|
1735
|
+
}
|
|
1736
|
+
function getInnerChild(vnode) {
|
|
1737
|
+
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
1741
|
+
if (target) {
|
|
1742
|
+
const hooks = target[type] || (target[type] = []);
|
|
1743
|
+
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
1744
|
+
pauseTracking();
|
|
1745
|
+
const reset = setCurrentInstance(target);
|
|
1746
|
+
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
1747
|
+
reset();
|
|
1748
|
+
resetTracking();
|
|
1749
|
+
return res;
|
|
1750
|
+
});
|
|
1751
|
+
if (prepend) {
|
|
1752
|
+
hooks.unshift(wrappedHook);
|
|
1753
|
+
} else {
|
|
1754
|
+
hooks.push(wrappedHook);
|
|
1852
1755
|
}
|
|
1756
|
+
return wrappedHook;
|
|
1757
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1758
|
+
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
1759
|
+
warn$1(
|
|
1760
|
+
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
1761
|
+
);
|
|
1853
1762
|
}
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1763
|
+
}
|
|
1764
|
+
const createHook = (lifecycle) => (hook, target = currentInstance) => {
|
|
1765
|
+
if (!isInSSRComponentSetup || lifecycle === "sp") {
|
|
1766
|
+
injectHook(lifecycle, (...args) => hook(...args), target);
|
|
1767
|
+
}
|
|
1768
|
+
if (lifecycle === "m" && target && target.isMounted) {
|
|
1769
|
+
hook();
|
|
1770
|
+
}
|
|
1771
|
+
};
|
|
1772
|
+
const onBeforeMount = createHook("bm");
|
|
1773
|
+
const onMounted = createHook("m");
|
|
1774
|
+
const onBeforeUpdate = createHook(
|
|
1775
|
+
"bu"
|
|
1776
|
+
);
|
|
1777
|
+
const onUpdated = createHook("u");
|
|
1778
|
+
const onBeforeUnmount = createHook(
|
|
1779
|
+
"bum"
|
|
1780
|
+
);
|
|
1781
|
+
const onUnmounted = createHook("um");
|
|
1782
|
+
const onServerPrefetch = createHook(
|
|
1783
|
+
"sp"
|
|
1784
|
+
);
|
|
1785
|
+
const onRenderTriggered = createHook("rtg");
|
|
1786
|
+
const onRenderTracked = createHook("rtc");
|
|
1787
|
+
function onErrorCaptured(hook, target = currentInstance) {
|
|
1788
|
+
injectHook("ec", hook, target);
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
const COMPONENTS = "components";
|
|
1792
|
+
const DIRECTIVES = "directives";
|
|
1793
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
1794
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
1795
|
+
}
|
|
1796
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
1797
|
+
function resolveDynamicComponent(component) {
|
|
1798
|
+
if (isString(component)) {
|
|
1799
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
1800
|
+
} else {
|
|
1801
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
function resolveDirective(name) {
|
|
1805
|
+
return resolveAsset(DIRECTIVES, name);
|
|
1806
|
+
}
|
|
1807
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
1808
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
1809
|
+
if (instance) {
|
|
1810
|
+
const Component = instance.type;
|
|
1811
|
+
if (type === COMPONENTS) {
|
|
1812
|
+
const selfName = getComponentName(
|
|
1813
|
+
Component,
|
|
1814
|
+
false
|
|
1815
|
+
);
|
|
1816
|
+
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
1817
|
+
return Component;
|
|
1861
1818
|
}
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1819
|
+
}
|
|
1820
|
+
const res = (
|
|
1821
|
+
// local registration
|
|
1822
|
+
// check instance[type] first which is resolved for options API
|
|
1823
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
1824
|
+
resolve(instance.appContext[type], name)
|
|
1825
|
+
);
|
|
1826
|
+
if (!res && maybeSelfReference) {
|
|
1827
|
+
return Component;
|
|
1828
|
+
}
|
|
1829
|
+
if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
|
|
1830
|
+
const extra = type === COMPONENTS ? `
|
|
1831
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
1832
|
+
warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
1833
|
+
}
|
|
1834
|
+
return res;
|
|
1835
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1836
|
+
warn$1(
|
|
1837
|
+
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
1838
|
+
);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
function resolve(registry, name) {
|
|
1842
|
+
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
function renderList(source, renderItem, cache, index) {
|
|
1846
|
+
let ret;
|
|
1847
|
+
const cached = cache && cache[index];
|
|
1848
|
+
const sourceIsArray = isArray(source);
|
|
1849
|
+
if (sourceIsArray || isString(source)) {
|
|
1850
|
+
const sourceIsReactiveArray = sourceIsArray && isReactive(source);
|
|
1851
|
+
let needsWrap = false;
|
|
1852
|
+
if (sourceIsReactiveArray) {
|
|
1853
|
+
needsWrap = !isShallow(source);
|
|
1854
|
+
source = shallowReadArray(source);
|
|
1855
|
+
}
|
|
1856
|
+
ret = new Array(source.length);
|
|
1857
|
+
for (let i = 0, l = source.length; i < l; i++) {
|
|
1858
|
+
ret[i] = renderItem(
|
|
1859
|
+
needsWrap ? toReactive(source[i]) : source[i],
|
|
1860
|
+
i,
|
|
1861
|
+
void 0,
|
|
1862
|
+
cached && cached[i]
|
|
1863
|
+
);
|
|
1864
|
+
}
|
|
1865
|
+
} else if (typeof source === "number") {
|
|
1866
|
+
if (!!(process.env.NODE_ENV !== "production") && !Number.isInteger(source)) {
|
|
1867
|
+
warn$1(`The v-for range expect an integer value but got ${source}.`);
|
|
1868
|
+
}
|
|
1869
|
+
ret = new Array(source);
|
|
1870
|
+
for (let i = 0; i < source; i++) {
|
|
1871
|
+
ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
1872
|
+
}
|
|
1873
|
+
} else if (isObject(source)) {
|
|
1874
|
+
if (source[Symbol.iterator]) {
|
|
1875
|
+
ret = Array.from(
|
|
1876
|
+
source,
|
|
1877
|
+
(item, i) => renderItem(item, i, void 0, cached && cached[i])
|
|
1878
|
+
);
|
|
1879
|
+
} else {
|
|
1880
|
+
const keys = Object.keys(source);
|
|
1881
|
+
ret = new Array(keys.length);
|
|
1882
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
1883
|
+
const key = keys[i];
|
|
1884
|
+
ret[i] = renderItem(source[key], key, i, cached && cached[i]);
|
|
1875
1885
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
+
}
|
|
1887
|
+
} else {
|
|
1888
|
+
ret = [];
|
|
1889
|
+
}
|
|
1890
|
+
if (cache) {
|
|
1891
|
+
cache[index] = ret;
|
|
1892
|
+
}
|
|
1893
|
+
return ret;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
function createSlots(slots, dynamicSlots) {
|
|
1897
|
+
for (let i = 0; i < dynamicSlots.length; i++) {
|
|
1898
|
+
const slot = dynamicSlots[i];
|
|
1899
|
+
if (isArray(slot)) {
|
|
1900
|
+
for (let j = 0; j < slot.length; j++) {
|
|
1901
|
+
slots[slot[j].name] = slot[j].fn;
|
|
1902
|
+
}
|
|
1903
|
+
} else if (slot) {
|
|
1904
|
+
slots[slot.name] = slot.key ? (...args) => {
|
|
1905
|
+
const res = slot.fn(...args);
|
|
1906
|
+
if (res) res.key = slot.key;
|
|
1907
|
+
return res;
|
|
1908
|
+
} : slot.fn;
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
return slots;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
1915
|
+
// @__NO_SIDE_EFFECTS__
|
|
1916
|
+
function defineComponent(options, extraOptions) {
|
|
1917
|
+
return isFunction(options) ? (
|
|
1918
|
+
// #8236: extend call and options.name access are considered side-effects
|
|
1919
|
+
// by Rollup, so we have to wrap it in a pure-annotated IIFE.
|
|
1920
|
+
/* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
|
|
1921
|
+
) : options;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
function useId() {
|
|
1925
|
+
const i = getCurrentInstance();
|
|
1926
|
+
if (i) {
|
|
1927
|
+
return (i.appContext.config.idPrefix || "v") + "-" + i.ids[0] + i.ids[1]++;
|
|
1928
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1929
|
+
warn$1(
|
|
1930
|
+
`useId() is called when there is no active component instance to be associated with.`
|
|
1931
|
+
);
|
|
1932
|
+
}
|
|
1933
|
+
return "";
|
|
1934
|
+
}
|
|
1935
|
+
function markAsyncBoundary(instance) {
|
|
1936
|
+
instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
1940
|
+
function useTemplateRef(key) {
|
|
1941
|
+
const i = getCurrentInstance();
|
|
1942
|
+
const r = shallowRef(null);
|
|
1943
|
+
if (i) {
|
|
1944
|
+
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
1945
|
+
let desc;
|
|
1946
|
+
if (!!(process.env.NODE_ENV !== "production") && (desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
|
|
1947
|
+
warn$1(`useTemplateRef('${key}') already exists.`);
|
|
1948
|
+
} else {
|
|
1949
|
+
Object.defineProperty(refs, key, {
|
|
1950
|
+
enumerable: true,
|
|
1951
|
+
get: () => r.value,
|
|
1952
|
+
set: (val) => r.value = val
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1956
|
+
warn$1(
|
|
1957
|
+
`useTemplateRef() is called when there is no active component instance to be associated with.`
|
|
1958
|
+
);
|
|
1959
|
+
}
|
|
1960
|
+
const ret = !!(process.env.NODE_ENV !== "production") ? readonly(r) : r;
|
|
1961
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1962
|
+
knownTemplateRefs.add(ret);
|
|
1963
|
+
}
|
|
1964
|
+
return ret;
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
1968
|
+
if (isArray(rawRef)) {
|
|
1969
|
+
rawRef.forEach(
|
|
1970
|
+
(r, i) => setRef(
|
|
1971
|
+
r,
|
|
1972
|
+
oldRawRef && (isArray(oldRawRef) ? oldRawRef[i] : oldRawRef),
|
|
1973
|
+
parentSuspense,
|
|
1974
|
+
vnode,
|
|
1975
|
+
isUnmount
|
|
1976
|
+
)
|
|
1977
|
+
);
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1981
|
+
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
1982
|
+
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
1983
|
+
}
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
1987
|
+
const value = isUnmount ? null : refValue;
|
|
1988
|
+
const { i: owner, r: ref } = rawRef;
|
|
1989
|
+
if (!!(process.env.NODE_ENV !== "production") && !owner) {
|
|
1990
|
+
warn$1(
|
|
1991
|
+
`Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.`
|
|
1992
|
+
);
|
|
1993
|
+
return;
|
|
1994
|
+
}
|
|
1995
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
1996
|
+
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
1997
|
+
const setupState = owner.setupState;
|
|
1998
|
+
const rawSetupState = toRaw(setupState);
|
|
1999
|
+
const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
|
|
2000
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
2001
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
2002
|
+
warn$1(
|
|
2003
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1886
2004
|
);
|
|
1887
|
-
let hasWarned = false;
|
|
1888
|
-
while (next) {
|
|
1889
|
-
if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
|
|
1890
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
1891
|
-
warn$1(
|
|
1892
|
-
`Hydration children mismatch on`,
|
|
1893
|
-
el,
|
|
1894
|
-
`
|
|
1895
|
-
Server rendered element contains more child nodes than client vdom.`
|
|
1896
|
-
);
|
|
1897
|
-
hasWarned = true;
|
|
1898
|
-
}
|
|
1899
|
-
logMismatchError();
|
|
1900
|
-
}
|
|
1901
|
-
const cur = next;
|
|
1902
|
-
next = next.nextSibling;
|
|
1903
|
-
remove(cur);
|
|
1904
|
-
}
|
|
1905
|
-
} else if (shapeFlag & 8) {
|
|
1906
|
-
let clientText = vnode.children;
|
|
1907
|
-
if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
|
|
1908
|
-
clientText = clientText.slice(1);
|
|
1909
|
-
}
|
|
1910
|
-
if (el.textContent !== clientText) {
|
|
1911
|
-
if (!isMismatchAllowed(el, 0 /* TEXT */)) {
|
|
1912
|
-
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
1913
|
-
`Hydration text content mismatch on`,
|
|
1914
|
-
el,
|
|
1915
|
-
`
|
|
1916
|
-
- rendered on server: ${el.textContent}
|
|
1917
|
-
- expected on client: ${vnode.children}`
|
|
1918
|
-
);
|
|
1919
|
-
logMismatchError();
|
|
1920
|
-
}
|
|
1921
|
-
el.textContent = vnode.children;
|
|
1922
|
-
}
|
|
1923
2005
|
}
|
|
1924
|
-
if (
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
2006
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
2007
|
+
return false;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
return hasOwn(rawSetupState, key);
|
|
2011
|
+
};
|
|
2012
|
+
if (oldRef != null && oldRef !== ref) {
|
|
2013
|
+
if (isString(oldRef)) {
|
|
2014
|
+
refs[oldRef] = null;
|
|
2015
|
+
if (canSetSetupRef(oldRef)) {
|
|
2016
|
+
setupState[oldRef] = null;
|
|
2017
|
+
}
|
|
2018
|
+
} else if (isRef(oldRef)) {
|
|
2019
|
+
oldRef.value = null;
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
if (isFunction(ref)) {
|
|
2023
|
+
callWithErrorHandling(ref, owner, 12, [value, refs]);
|
|
2024
|
+
} else {
|
|
2025
|
+
const _isString = isString(ref);
|
|
2026
|
+
const _isRef = isRef(ref);
|
|
2027
|
+
if (_isString || _isRef) {
|
|
2028
|
+
const doSet = () => {
|
|
2029
|
+
if (rawRef.f) {
|
|
2030
|
+
const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
|
|
2031
|
+
if (isUnmount) {
|
|
2032
|
+
isArray(existing) && remove(existing, refValue);
|
|
2033
|
+
} else {
|
|
2034
|
+
if (!isArray(existing)) {
|
|
2035
|
+
if (_isString) {
|
|
2036
|
+
refs[ref] = [refValue];
|
|
2037
|
+
if (canSetSetupRef(ref)) {
|
|
2038
|
+
setupState[ref] = refs[ref];
|
|
2039
|
+
}
|
|
1941
2040
|
} else {
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
}
|
|
1945
|
-
if (!ignore) {
|
|
1946
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
|
|
1947
|
-
// as it could have mutated the DOM in any possible way
|
|
1948
|
-
!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
|
|
1949
|
-
logMismatchError();
|
|
2041
|
+
ref.value = [refValue];
|
|
2042
|
+
if (rawRef.k) refs[rawRef.k] = ref.value;
|
|
1950
2043
|
}
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
key[0] === "." || isCustomElement) {
|
|
1954
|
-
patchProp(el, key, null, props[key], void 0, parentComponent);
|
|
2044
|
+
} else if (!existing.includes(refValue)) {
|
|
2045
|
+
existing.push(refValue);
|
|
1955
2046
|
}
|
|
1956
2047
|
}
|
|
1957
|
-
} else if (
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
for (const key in props.style) props.style[key];
|
|
2048
|
+
} else if (_isString) {
|
|
2049
|
+
refs[ref] = value;
|
|
2050
|
+
if (canSetSetupRef(ref)) {
|
|
2051
|
+
setupState[ref] = value;
|
|
2052
|
+
}
|
|
2053
|
+
} else if (_isRef) {
|
|
2054
|
+
ref.value = value;
|
|
2055
|
+
if (rawRef.k) refs[rawRef.k] = value;
|
|
2056
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2057
|
+
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
1968
2058
|
}
|
|
2059
|
+
};
|
|
2060
|
+
if (value) {
|
|
2061
|
+
doSet.id = -1;
|
|
2062
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
2063
|
+
} else {
|
|
2064
|
+
doSet();
|
|
1969
2065
|
}
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1973
|
-
}
|
|
1974
|
-
if (dirs) {
|
|
1975
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
1976
|
-
}
|
|
1977
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
1978
|
-
queueEffectWithSuspense(() => {
|
|
1979
|
-
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
1980
|
-
needCallTransitionHooks && transition.enter(el);
|
|
1981
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
1982
|
-
}, parentSuspense);
|
|
1983
|
-
}
|
|
2066
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2067
|
+
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
1984
2068
|
}
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
insert(vnode.el = createText(""), container);
|
|
2018
|
-
} else {
|
|
2019
|
-
if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
|
|
2020
|
-
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
2021
|
-
warn$1(
|
|
2022
|
-
`Hydration children mismatch on`,
|
|
2023
|
-
container,
|
|
2024
|
-
`
|
|
2025
|
-
Server rendered element contains fewer child nodes than client vdom.`
|
|
2026
|
-
);
|
|
2027
|
-
hasWarned = true;
|
|
2028
|
-
}
|
|
2029
|
-
logMismatchError();
|
|
2030
|
-
}
|
|
2031
|
-
patch(
|
|
2032
|
-
null,
|
|
2033
|
-
vnode,
|
|
2034
|
-
container,
|
|
2035
|
-
null,
|
|
2036
|
-
parentComponent,
|
|
2037
|
-
parentSuspense,
|
|
2038
|
-
getContainerType(container),
|
|
2039
|
-
slotScopeIds
|
|
2040
|
-
);
|
|
2041
|
-
}
|
|
2069
|
+
}
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
let hasLoggedMismatchError = false;
|
|
2073
|
+
const logMismatchError = () => {
|
|
2074
|
+
if (hasLoggedMismatchError) {
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
2077
|
+
console.error("Hydration completed but contains mismatches.");
|
|
2078
|
+
hasLoggedMismatchError = true;
|
|
2079
|
+
};
|
|
2080
|
+
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
2081
|
+
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
2082
|
+
const getContainerType = (container) => {
|
|
2083
|
+
if (container.nodeType !== 1) return void 0;
|
|
2084
|
+
if (isSVGContainer(container)) return "svg";
|
|
2085
|
+
if (isMathMLContainer(container)) return "mathml";
|
|
2086
|
+
return void 0;
|
|
2087
|
+
};
|
|
2088
|
+
const isComment = (node) => node.nodeType === 8;
|
|
2089
|
+
function createHydrationFunctions(rendererInternals) {
|
|
2090
|
+
const {
|
|
2091
|
+
mt: mountComponent,
|
|
2092
|
+
p: patch,
|
|
2093
|
+
o: {
|
|
2094
|
+
patchProp,
|
|
2095
|
+
createText,
|
|
2096
|
+
nextSibling,
|
|
2097
|
+
parentNode,
|
|
2098
|
+
remove,
|
|
2099
|
+
insert,
|
|
2100
|
+
createComment
|
|
2042
2101
|
}
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2102
|
+
} = rendererInternals;
|
|
2103
|
+
const hydrate = (vnode, container) => {
|
|
2104
|
+
if (!container.hasChildNodes()) {
|
|
2105
|
+
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
2106
|
+
`Attempting to hydrate existing markup but container is empty. Performing full mount instead.`
|
|
2107
|
+
);
|
|
2108
|
+
patch(null, vnode, container);
|
|
2109
|
+
flushPostFlushCbs();
|
|
2110
|
+
container._vnode = vnode;
|
|
2111
|
+
return;
|
|
2049
2112
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2113
|
+
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
2114
|
+
flushPostFlushCbs();
|
|
2115
|
+
container._vnode = vnode;
|
|
2116
|
+
};
|
|
2117
|
+
const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
|
|
2118
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
2119
|
+
const isFragmentStart = isComment(node) && node.data === "[";
|
|
2120
|
+
const onMismatch = () => handleMismatch(
|
|
2121
|
+
node,
|
|
2053
2122
|
vnode,
|
|
2054
|
-
container,
|
|
2055
2123
|
parentComponent,
|
|
2056
2124
|
parentSuspense,
|
|
2057
2125
|
slotScopeIds,
|
|
2058
|
-
|
|
2126
|
+
isFragmentStart
|
|
2059
2127
|
);
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2128
|
+
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
2129
|
+
let domType = node.nodeType;
|
|
2130
|
+
vnode.el = node;
|
|
2131
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2132
|
+
def(node, "__vnode", vnode, true);
|
|
2133
|
+
def(node, "__vueParentComponent", parentComponent, true);
|
|
2066
2134
|
}
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
2071
|
-
`Hydration node mismatch:
|
|
2072
|
-
- rendered on server:`,
|
|
2073
|
-
node,
|
|
2074
|
-
node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
|
|
2075
|
-
`
|
|
2076
|
-
- expected on client:`,
|
|
2077
|
-
vnode.type
|
|
2078
|
-
);
|
|
2079
|
-
logMismatchError();
|
|
2135
|
+
if (patchFlag === -2) {
|
|
2136
|
+
optimized = false;
|
|
2137
|
+
vnode.dynamicChildren = null;
|
|
2080
2138
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2139
|
+
let nextNode = null;
|
|
2140
|
+
switch (type) {
|
|
2141
|
+
case Text:
|
|
2142
|
+
if (domType !== 3) {
|
|
2143
|
+
if (vnode.children === "") {
|
|
2144
|
+
insert(vnode.el = createText(""), parentNode(node), node);
|
|
2145
|
+
nextNode = node;
|
|
2146
|
+
} else {
|
|
2147
|
+
nextNode = onMismatch();
|
|
2148
|
+
}
|
|
2088
2149
|
} else {
|
|
2089
|
-
|
|
2150
|
+
if (node.data !== vnode.children) {
|
|
2151
|
+
node.data = vnode.children;
|
|
2152
|
+
}
|
|
2153
|
+
nextNode = nextSibling(node);
|
|
2090
2154
|
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
} else {
|
|
2122
|
-
match--;
|
|
2155
|
+
break;
|
|
2156
|
+
case Comment:
|
|
2157
|
+
if (isTemplateNode(node)) {
|
|
2158
|
+
nextNode = nextSibling(node);
|
|
2159
|
+
replaceNode(
|
|
2160
|
+
vnode.el = node.content.firstChild,
|
|
2161
|
+
node,
|
|
2162
|
+
parentComponent
|
|
2163
|
+
);
|
|
2164
|
+
} else if (domType !== 8 || isFragmentStart) {
|
|
2165
|
+
nextNode = onMismatch();
|
|
2166
|
+
} else {
|
|
2167
|
+
nextNode = nextSibling(node);
|
|
2168
|
+
}
|
|
2169
|
+
break;
|
|
2170
|
+
case Static:
|
|
2171
|
+
if (isFragmentStart) {
|
|
2172
|
+
node = nextSibling(node);
|
|
2173
|
+
domType = node.nodeType;
|
|
2174
|
+
}
|
|
2175
|
+
if (domType === 1 || domType === 3) {
|
|
2176
|
+
nextNode = node;
|
|
2177
|
+
const needToAdoptContent = !vnode.children.length;
|
|
2178
|
+
for (let i = 0; i < vnode.staticCount; i++) {
|
|
2179
|
+
if (needToAdoptContent)
|
|
2180
|
+
vnode.children += nextNode.nodeType === 1 ? nextNode.outerHTML : nextNode.data;
|
|
2181
|
+
if (i === vnode.staticCount - 1) {
|
|
2182
|
+
vnode.anchor = nextNode;
|
|
2183
|
+
}
|
|
2184
|
+
nextNode = nextSibling(nextNode);
|
|
2123
2185
|
}
|
|
2186
|
+
return isFragmentStart ? nextSibling(nextNode) : nextNode;
|
|
2187
|
+
} else {
|
|
2188
|
+
onMismatch();
|
|
2124
2189
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
}
|
|
2139
|
-
parent = parent.parent;
|
|
2140
|
-
}
|
|
2141
|
-
};
|
|
2142
|
-
const isTemplateNode = (node) => {
|
|
2143
|
-
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
2144
|
-
};
|
|
2145
|
-
return [hydrate, hydrateNode];
|
|
2146
|
-
}
|
|
2147
|
-
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
2148
|
-
let mismatchType;
|
|
2149
|
-
let mismatchKey;
|
|
2150
|
-
let actual;
|
|
2151
|
-
let expected;
|
|
2152
|
-
if (key === "class") {
|
|
2153
|
-
actual = el.getAttribute("class");
|
|
2154
|
-
expected = normalizeClass(clientValue);
|
|
2155
|
-
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
2156
|
-
mismatchType = 2 /* CLASS */;
|
|
2157
|
-
mismatchKey = `class`;
|
|
2158
|
-
}
|
|
2159
|
-
} else if (key === "style") {
|
|
2160
|
-
actual = el.getAttribute("style") || "";
|
|
2161
|
-
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
2162
|
-
const actualMap = toStyleMap(actual);
|
|
2163
|
-
const expectedMap = toStyleMap(expected);
|
|
2164
|
-
if (vnode.dirs) {
|
|
2165
|
-
for (const { dir, value } of vnode.dirs) {
|
|
2166
|
-
if (dir.name === "show" && !value) {
|
|
2167
|
-
expectedMap.set("display", "none");
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
}
|
|
2171
|
-
if (instance) {
|
|
2172
|
-
resolveCssVars(instance, vnode, expectedMap);
|
|
2173
|
-
}
|
|
2174
|
-
if (!isMapEqual(actualMap, expectedMap)) {
|
|
2175
|
-
mismatchType = 3 /* STYLE */;
|
|
2176
|
-
mismatchKey = "style";
|
|
2177
|
-
}
|
|
2178
|
-
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
2179
|
-
if (isBooleanAttr(key)) {
|
|
2180
|
-
actual = el.hasAttribute(key);
|
|
2181
|
-
expected = includeBooleanAttr(clientValue);
|
|
2182
|
-
} else if (clientValue == null) {
|
|
2183
|
-
actual = el.hasAttribute(key);
|
|
2184
|
-
expected = false;
|
|
2185
|
-
} else {
|
|
2186
|
-
if (el.hasAttribute(key)) {
|
|
2187
|
-
actual = el.getAttribute(key);
|
|
2188
|
-
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
2189
|
-
actual = el.value;
|
|
2190
|
-
} else {
|
|
2191
|
-
actual = false;
|
|
2192
|
-
}
|
|
2193
|
-
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
2194
|
-
}
|
|
2195
|
-
if (actual !== expected) {
|
|
2196
|
-
mismatchType = 4 /* ATTRIBUTE */;
|
|
2197
|
-
mismatchKey = key;
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
|
|
2201
|
-
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
2202
|
-
const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
|
|
2203
|
-
const postSegment = `
|
|
2204
|
-
- rendered on server: ${format(actual)}
|
|
2205
|
-
- expected on client: ${format(expected)}
|
|
2206
|
-
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
2207
|
-
You should fix the source of the mismatch.`;
|
|
2208
|
-
{
|
|
2209
|
-
warn$1(preSegment, el, postSegment);
|
|
2210
|
-
}
|
|
2211
|
-
return true;
|
|
2212
|
-
}
|
|
2213
|
-
return false;
|
|
2214
|
-
}
|
|
2215
|
-
function toClassSet(str) {
|
|
2216
|
-
return new Set(str.trim().split(/\s+/));
|
|
2217
|
-
}
|
|
2218
|
-
function isSetEqual(a, b) {
|
|
2219
|
-
if (a.size !== b.size) {
|
|
2220
|
-
return false;
|
|
2221
|
-
}
|
|
2222
|
-
for (const s of a) {
|
|
2223
|
-
if (!b.has(s)) {
|
|
2224
|
-
return false;
|
|
2225
|
-
}
|
|
2226
|
-
}
|
|
2227
|
-
return true;
|
|
2228
|
-
}
|
|
2229
|
-
function toStyleMap(str) {
|
|
2230
|
-
const styleMap = /* @__PURE__ */ new Map();
|
|
2231
|
-
for (const item of str.split(";")) {
|
|
2232
|
-
let [key, value] = item.split(":");
|
|
2233
|
-
key = key.trim();
|
|
2234
|
-
value = value && value.trim();
|
|
2235
|
-
if (key && value) {
|
|
2236
|
-
styleMap.set(key, value);
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
return styleMap;
|
|
2240
|
-
}
|
|
2241
|
-
function isMapEqual(a, b) {
|
|
2242
|
-
if (a.size !== b.size) {
|
|
2243
|
-
return false;
|
|
2244
|
-
}
|
|
2245
|
-
for (const [key, value] of a) {
|
|
2246
|
-
if (value !== b.get(key)) {
|
|
2247
|
-
return false;
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
return true;
|
|
2251
|
-
}
|
|
2252
|
-
function resolveCssVars(instance, vnode, expectedMap) {
|
|
2253
|
-
const root = instance.subTree;
|
|
2254
|
-
if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
|
|
2255
|
-
const cssVars = instance.getCssVars();
|
|
2256
|
-
for (const key in cssVars) {
|
|
2257
|
-
expectedMap.set(
|
|
2258
|
-
`--${getEscapedCssVarName(key, false)}`,
|
|
2259
|
-
String(cssVars[key])
|
|
2260
|
-
);
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
if (vnode === root && instance.parent) {
|
|
2264
|
-
resolveCssVars(instance.parent, instance.vnode, expectedMap);
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
const allowMismatchAttr = "data-allow-mismatch";
|
|
2268
|
-
const MismatchTypeString = {
|
|
2269
|
-
[0 /* TEXT */]: "text",
|
|
2270
|
-
[1 /* CHILDREN */]: "children",
|
|
2271
|
-
[2 /* CLASS */]: "class",
|
|
2272
|
-
[3 /* STYLE */]: "style",
|
|
2273
|
-
[4 /* ATTRIBUTE */]: "attribute"
|
|
2274
|
-
};
|
|
2275
|
-
function isMismatchAllowed(el, allowedType) {
|
|
2276
|
-
if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
|
|
2277
|
-
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
2278
|
-
el = el.parentElement;
|
|
2279
|
-
}
|
|
2280
|
-
}
|
|
2281
|
-
const allowedAttr = el && el.getAttribute(allowMismatchAttr);
|
|
2282
|
-
if (allowedAttr == null) {
|
|
2283
|
-
return false;
|
|
2284
|
-
} else if (allowedAttr === "") {
|
|
2285
|
-
return true;
|
|
2286
|
-
} else {
|
|
2287
|
-
const list = allowedAttr.split(",");
|
|
2288
|
-
if (allowedType === 0 /* TEXT */ && list.includes("children")) {
|
|
2289
|
-
return true;
|
|
2290
|
-
}
|
|
2291
|
-
return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
|
-
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2296
|
-
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2297
|
-
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2298
|
-
const id = requestIdleCallback(hydrate, { timeout });
|
|
2299
|
-
return () => cancelIdleCallback(id);
|
|
2300
|
-
};
|
|
2301
|
-
function elementIsVisibleInViewport(el) {
|
|
2302
|
-
const { top, left, bottom, right } = el.getBoundingClientRect();
|
|
2303
|
-
const { innerHeight, innerWidth } = window;
|
|
2304
|
-
return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
|
|
2305
|
-
}
|
|
2306
|
-
const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
2307
|
-
const ob = new IntersectionObserver((entries) => {
|
|
2308
|
-
for (const e of entries) {
|
|
2309
|
-
if (!e.isIntersecting) continue;
|
|
2310
|
-
ob.disconnect();
|
|
2311
|
-
hydrate();
|
|
2312
|
-
break;
|
|
2313
|
-
}
|
|
2314
|
-
}, opts);
|
|
2315
|
-
forEach((el) => {
|
|
2316
|
-
if (!(el instanceof Element)) return;
|
|
2317
|
-
if (elementIsVisibleInViewport(el)) {
|
|
2318
|
-
hydrate();
|
|
2319
|
-
ob.disconnect();
|
|
2320
|
-
return false;
|
|
2321
|
-
}
|
|
2322
|
-
ob.observe(el);
|
|
2323
|
-
});
|
|
2324
|
-
return () => ob.disconnect();
|
|
2325
|
-
};
|
|
2326
|
-
const hydrateOnMediaQuery = (query) => (hydrate) => {
|
|
2327
|
-
if (query) {
|
|
2328
|
-
const mql = matchMedia(query);
|
|
2329
|
-
if (mql.matches) {
|
|
2330
|
-
hydrate();
|
|
2331
|
-
} else {
|
|
2332
|
-
mql.addEventListener("change", hydrate, { once: true });
|
|
2333
|
-
return () => mql.removeEventListener("change", hydrate);
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
};
|
|
2337
|
-
const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
2338
|
-
if (isString(interactions)) interactions = [interactions];
|
|
2339
|
-
let hasHydrated = false;
|
|
2340
|
-
const doHydrate = (e) => {
|
|
2341
|
-
if (!hasHydrated) {
|
|
2342
|
-
hasHydrated = true;
|
|
2343
|
-
teardown();
|
|
2344
|
-
hydrate();
|
|
2345
|
-
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
2346
|
-
}
|
|
2347
|
-
};
|
|
2348
|
-
const teardown = () => {
|
|
2349
|
-
forEach((el) => {
|
|
2350
|
-
for (const i of interactions) {
|
|
2351
|
-
el.removeEventListener(i, doHydrate);
|
|
2352
|
-
}
|
|
2353
|
-
});
|
|
2354
|
-
};
|
|
2355
|
-
forEach((el) => {
|
|
2356
|
-
for (const i of interactions) {
|
|
2357
|
-
el.addEventListener(i, doHydrate, { once: true });
|
|
2358
|
-
}
|
|
2359
|
-
});
|
|
2360
|
-
return teardown;
|
|
2361
|
-
};
|
|
2362
|
-
function forEachElement(node, cb) {
|
|
2363
|
-
if (isComment(node) && node.data === "[") {
|
|
2364
|
-
let depth = 1;
|
|
2365
|
-
let next = node.nextSibling;
|
|
2366
|
-
while (next) {
|
|
2367
|
-
if (next.nodeType === 1) {
|
|
2368
|
-
const result = cb(next);
|
|
2369
|
-
if (result === false) {
|
|
2370
|
-
break;
|
|
2371
|
-
}
|
|
2372
|
-
} else if (isComment(next)) {
|
|
2373
|
-
if (next.data === "]") {
|
|
2374
|
-
if (--depth === 0) break;
|
|
2375
|
-
} else if (next.data === "[") {
|
|
2376
|
-
depth++;
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
next = next.nextSibling;
|
|
2380
|
-
}
|
|
2381
|
-
} else {
|
|
2382
|
-
cb(node);
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
|
|
2386
|
-
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2387
|
-
function _getValidZova(instance) {
|
|
2388
|
-
while (instance) {
|
|
2389
|
-
if (instance.zova) return instance.zova;
|
|
2390
|
-
instance = instance.parent;
|
|
2391
|
-
}
|
|
2392
|
-
}
|
|
2393
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
2394
|
-
// @__NO_SIDE_EFFECTS__
|
|
2395
|
-
function defineAsyncComponent(source) {
|
|
2396
|
-
if (isFunction(source)) {
|
|
2397
|
-
source = { loader: source };
|
|
2398
|
-
}
|
|
2399
|
-
const {
|
|
2400
|
-
loader,
|
|
2401
|
-
loadingComponent,
|
|
2402
|
-
errorComponent,
|
|
2403
|
-
delay = 200,
|
|
2404
|
-
hydrate: hydrateStrategy,
|
|
2405
|
-
timeout,
|
|
2406
|
-
// undefined = never times out
|
|
2407
|
-
suspensible = true,
|
|
2408
|
-
onError: userOnError
|
|
2409
|
-
} = source;
|
|
2410
|
-
let pendingRequest = null;
|
|
2411
|
-
let resolvedComp;
|
|
2412
|
-
let retries = 0;
|
|
2413
|
-
const retry = () => {
|
|
2414
|
-
retries++;
|
|
2415
|
-
pendingRequest = null;
|
|
2416
|
-
return load();
|
|
2417
|
-
};
|
|
2418
|
-
const load = () => {
|
|
2419
|
-
let thisRequest;
|
|
2420
|
-
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
2421
|
-
err = err instanceof Error ? err : new Error(String(err));
|
|
2422
|
-
if (userOnError) {
|
|
2423
|
-
return new Promise((resolve, reject) => {
|
|
2424
|
-
const userRetry = () => resolve(retry());
|
|
2425
|
-
const userFail = () => reject(err);
|
|
2426
|
-
userOnError(err, userRetry, userFail, retries + 1);
|
|
2427
|
-
});
|
|
2428
|
-
} else {
|
|
2429
|
-
throw err;
|
|
2430
|
-
}
|
|
2431
|
-
}).then((comp) => {
|
|
2432
|
-
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
2433
|
-
return pendingRequest;
|
|
2434
|
-
}
|
|
2435
|
-
if (!!(process.env.NODE_ENV !== "production") && !comp) {
|
|
2436
|
-
warn$1(
|
|
2437
|
-
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
2438
|
-
);
|
|
2439
|
-
}
|
|
2440
|
-
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
2441
|
-
comp = comp.default;
|
|
2442
|
-
}
|
|
2443
|
-
if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
|
|
2444
|
-
throw new Error(`Invalid async component load result: ${comp}`);
|
|
2445
|
-
}
|
|
2446
|
-
resolvedComp = comp;
|
|
2447
|
-
return comp;
|
|
2448
|
-
}));
|
|
2449
|
-
};
|
|
2450
|
-
return defineComponent({
|
|
2451
|
-
name: "AsyncComponentWrapper",
|
|
2452
|
-
__asyncLoader: load,
|
|
2453
|
-
__asyncHydrate(el, instance, hydrate) {
|
|
2454
|
-
const doHydrate = hydrateStrategy ? () => {
|
|
2455
|
-
const teardown = hydrateStrategy(
|
|
2456
|
-
hydrate,
|
|
2457
|
-
(cb) => forEachElement(el, cb)
|
|
2458
|
-
);
|
|
2459
|
-
if (teardown) {
|
|
2460
|
-
(instance.bum || (instance.bum = [])).push(teardown);
|
|
2190
|
+
break;
|
|
2191
|
+
case Fragment:
|
|
2192
|
+
if (!isFragmentStart) {
|
|
2193
|
+
nextNode = onMismatch();
|
|
2194
|
+
} else {
|
|
2195
|
+
nextNode = hydrateFragment(
|
|
2196
|
+
node,
|
|
2197
|
+
vnode,
|
|
2198
|
+
parentComponent,
|
|
2199
|
+
parentSuspense,
|
|
2200
|
+
slotScopeIds,
|
|
2201
|
+
optimized
|
|
2202
|
+
);
|
|
2461
2203
|
}
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
return resolvedComp;
|
|
2476
|
-
},
|
|
2477
|
-
setup() {
|
|
2478
|
-
const instance = currentInstance;
|
|
2479
|
-
markAsyncBoundary(instance);
|
|
2480
|
-
if (resolvedComp) {
|
|
2481
|
-
return () => createInnerComp(resolvedComp, instance);
|
|
2482
|
-
}
|
|
2483
|
-
const onError = (err) => {
|
|
2484
|
-
pendingRequest = null;
|
|
2485
|
-
handleError(
|
|
2486
|
-
err,
|
|
2487
|
-
instance,
|
|
2488
|
-
13,
|
|
2489
|
-
!errorComponent
|
|
2490
|
-
);
|
|
2491
|
-
};
|
|
2492
|
-
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
2493
|
-
return load().then((comp) => {
|
|
2494
|
-
return () => createInnerComp(comp, instance);
|
|
2495
|
-
}).catch((err) => {
|
|
2496
|
-
onError(err);
|
|
2497
|
-
return () => errorComponent ? createVNode(errorComponent, {
|
|
2498
|
-
error: err
|
|
2499
|
-
}) : null;
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
const loaded = ref(false);
|
|
2503
|
-
const error = ref();
|
|
2504
|
-
const delayed = ref(!!delay);
|
|
2505
|
-
if (delay) {
|
|
2506
|
-
setTimeout(() => {
|
|
2507
|
-
delayed.value = false;
|
|
2508
|
-
}, delay);
|
|
2509
|
-
}
|
|
2510
|
-
if (timeout != null) {
|
|
2511
|
-
setTimeout(() => {
|
|
2512
|
-
if (!loaded.value && !error.value) {
|
|
2513
|
-
const err = new Error(
|
|
2514
|
-
`Async component timed out after ${timeout}ms.`
|
|
2204
|
+
break;
|
|
2205
|
+
default:
|
|
2206
|
+
if (shapeFlag & 1) {
|
|
2207
|
+
if ((domType !== 1 || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
2208
|
+
nextNode = onMismatch();
|
|
2209
|
+
} else {
|
|
2210
|
+
nextNode = hydrateElement(
|
|
2211
|
+
node,
|
|
2212
|
+
vnode,
|
|
2213
|
+
parentComponent,
|
|
2214
|
+
parentSuspense,
|
|
2215
|
+
slotScopeIds,
|
|
2216
|
+
optimized
|
|
2515
2217
|
);
|
|
2516
|
-
onError(err);
|
|
2517
|
-
error.value = err;
|
|
2518
2218
|
}
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
}
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
}
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2219
|
+
} else if (shapeFlag & 6) {
|
|
2220
|
+
vnode.slotScopeIds = slotScopeIds;
|
|
2221
|
+
const container = parentNode(node);
|
|
2222
|
+
if (isFragmentStart) {
|
|
2223
|
+
nextNode = locateClosingAnchor(node);
|
|
2224
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
2225
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
2226
|
+
} else {
|
|
2227
|
+
nextNode = nextSibling(node);
|
|
2228
|
+
}
|
|
2229
|
+
mountComponent(
|
|
2230
|
+
vnode,
|
|
2231
|
+
container,
|
|
2232
|
+
null,
|
|
2233
|
+
parentComponent,
|
|
2234
|
+
parentSuspense,
|
|
2235
|
+
getContainerType(container),
|
|
2236
|
+
optimized
|
|
2237
|
+
);
|
|
2238
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
2239
|
+
let subTree;
|
|
2240
|
+
if (isFragmentStart) {
|
|
2241
|
+
subTree = createVNode(Fragment);
|
|
2242
|
+
subTree.anchor = nextNode ? nextNode.previousSibling : container.lastChild;
|
|
2243
|
+
} else {
|
|
2244
|
+
subTree = node.nodeType === 3 ? createTextVNode("") : createVNode("div");
|
|
2245
|
+
}
|
|
2246
|
+
subTree.el = node;
|
|
2247
|
+
vnode.component.subTree = subTree;
|
|
2248
|
+
}
|
|
2249
|
+
} else if (shapeFlag & 64) {
|
|
2250
|
+
if (domType !== 8) {
|
|
2251
|
+
nextNode = onMismatch();
|
|
2252
|
+
} else {
|
|
2253
|
+
nextNode = vnode.type.hydrate(
|
|
2254
|
+
node,
|
|
2255
|
+
vnode,
|
|
2256
|
+
parentComponent,
|
|
2257
|
+
parentSuspense,
|
|
2258
|
+
slotScopeIds,
|
|
2259
|
+
optimized,
|
|
2260
|
+
rendererInternals,
|
|
2261
|
+
hydrateChildren
|
|
2262
|
+
);
|
|
2263
|
+
}
|
|
2264
|
+
} else if (shapeFlag & 128) {
|
|
2265
|
+
nextNode = vnode.type.hydrate(
|
|
2266
|
+
node,
|
|
2267
|
+
vnode,
|
|
2268
|
+
parentComponent,
|
|
2269
|
+
parentSuspense,
|
|
2270
|
+
getContainerType(parentNode(node)),
|
|
2271
|
+
slotScopeIds,
|
|
2272
|
+
optimized,
|
|
2273
|
+
rendererInternals,
|
|
2274
|
+
hydrateNode
|
|
2275
|
+
);
|
|
2276
|
+
} else if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) {
|
|
2277
|
+
warn$1("Invalid HostVNode type:", type, `(${typeof type})`);
|
|
2278
|
+
}
|
|
2574
2279
|
}
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
let current = null;
|
|
2578
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2579
|
-
instance.__v_cache = cache;
|
|
2280
|
+
if (ref != null) {
|
|
2281
|
+
setRef(ref, null, parentSuspense, vnode);
|
|
2580
2282
|
}
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2283
|
+
return nextNode;
|
|
2284
|
+
};
|
|
2285
|
+
function _getValidZova(instance) {
|
|
2286
|
+
while (instance) {
|
|
2287
|
+
if (instance.zova) return instance.zova;
|
|
2288
|
+
instance = instance.parent;
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2292
|
+
optimized = optimized || !!vnode.dynamicChildren;
|
|
2293
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
2294
|
+
const forcePatch = type === "input" || type === "option";
|
|
2295
|
+
if (!!(process.env.NODE_ENV !== "production") || forcePatch || patchFlag !== -1) {
|
|
2296
|
+
if (dirs) {
|
|
2297
|
+
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
2588
2298
|
}
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
instance2,
|
|
2600
|
-
parentSuspense,
|
|
2601
|
-
namespace,
|
|
2602
|
-
vnode.slotScopeIds,
|
|
2603
|
-
optimized
|
|
2604
|
-
);
|
|
2605
|
-
queuePostRenderEffect(() => {
|
|
2606
|
-
instance2.isDeactivated = false;
|
|
2607
|
-
if (instance2.a) {
|
|
2608
|
-
invokeArrayFns(instance2.a);
|
|
2609
|
-
}
|
|
2610
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
2611
|
-
if (vnodeHook) {
|
|
2612
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
2299
|
+
let needCallTransitionHooks = false;
|
|
2300
|
+
if (isTemplateNode(el)) {
|
|
2301
|
+
needCallTransitionHooks = needTransition(
|
|
2302
|
+
null,
|
|
2303
|
+
// no need check parentSuspense in hydration
|
|
2304
|
+
transition
|
|
2305
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
2306
|
+
const content = el.content.firstChild;
|
|
2307
|
+
if (needCallTransitionHooks) {
|
|
2308
|
+
transition.beforeEnter(content);
|
|
2613
2309
|
}
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
devtoolsComponentAdded(instance2);
|
|
2310
|
+
replaceNode(content, el, parentComponent);
|
|
2311
|
+
vnode.el = el = content;
|
|
2617
2312
|
}
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2313
|
+
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
2314
|
+
!(props && (props.innerHTML || props.textContent))) {
|
|
2315
|
+
let next = hydrateChildren(
|
|
2316
|
+
el.firstChild,
|
|
2317
|
+
vnode,
|
|
2318
|
+
el,
|
|
2319
|
+
parentComponent,
|
|
2320
|
+
parentSuspense,
|
|
2321
|
+
slotScopeIds,
|
|
2322
|
+
optimized
|
|
2323
|
+
);
|
|
2324
|
+
let hasWarned = false;
|
|
2325
|
+
while (next) {
|
|
2326
|
+
if (!isMismatchAllowed(el, 1 /* CHILDREN */)) {
|
|
2327
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
2328
|
+
warn$1(
|
|
2329
|
+
`Hydration children mismatch on`,
|
|
2330
|
+
el,
|
|
2331
|
+
`
|
|
2332
|
+
Server rendered element contains more child nodes than client vdom.`
|
|
2333
|
+
);
|
|
2334
|
+
hasWarned = true;
|
|
2335
|
+
}
|
|
2336
|
+
logMismatchError();
|
|
2337
|
+
}
|
|
2338
|
+
const cur = next;
|
|
2339
|
+
next = next.nextSibling;
|
|
2340
|
+
remove(cur);
|
|
2627
2341
|
}
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2342
|
+
} else if (shapeFlag & 8) {
|
|
2343
|
+
let clientText = vnode.children;
|
|
2344
|
+
if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
|
|
2345
|
+
clientText = clientText.slice(1);
|
|
2346
|
+
}
|
|
2347
|
+
if (el.textContent !== clientText) {
|
|
2348
|
+
if (!isMismatchAllowed(el, 0 /* TEXT */)) {
|
|
2349
|
+
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
2350
|
+
`Hydration text content mismatch on`,
|
|
2351
|
+
el,
|
|
2352
|
+
`
|
|
2353
|
+
- rendered on server: ${el.textContent}
|
|
2354
|
+
- expected on client: ${vnode.children}`
|
|
2355
|
+
);
|
|
2356
|
+
logMismatchError();
|
|
2357
|
+
}
|
|
2358
|
+
el.textContent = vnode.children;
|
|
2631
2359
|
}
|
|
2632
|
-
instance2.isDeactivated = true;
|
|
2633
|
-
}, parentSuspense);
|
|
2634
|
-
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
2635
|
-
devtoolsComponentAdded(instance2);
|
|
2636
2360
|
}
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2361
|
+
if (props) {
|
|
2362
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
2363
|
+
const isCustomElement = el.tagName.includes("-");
|
|
2364
|
+
for (const key in props) {
|
|
2365
|
+
let ignore;
|
|
2366
|
+
let clientValue = props[key];
|
|
2367
|
+
const zova = _getValidZova(parentComponent);
|
|
2368
|
+
if (zova) {
|
|
2369
|
+
const res = zova.meta.$ssr._hydratePropHasMismatch(
|
|
2370
|
+
el,
|
|
2371
|
+
key,
|
|
2372
|
+
clientValue,
|
|
2373
|
+
vnode,
|
|
2374
|
+
parentComponent
|
|
2375
|
+
);
|
|
2376
|
+
if (res.ignore) {
|
|
2377
|
+
ignore = true;
|
|
2378
|
+
} else {
|
|
2379
|
+
clientValue = res.clientValue;
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
if (!ignore) {
|
|
2383
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && // #11189 skip if this node has directives that have created hooks
|
|
2384
|
+
// as it could have mutated the DOM in any possible way
|
|
2385
|
+
!(dirs && dirs.some((d) => d.dir.created)) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
|
|
2386
|
+
logMismatchError();
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
2390
|
+
key[0] === "." || isCustomElement) {
|
|
2391
|
+
patchProp(el, key, null, props[key], void 0, parentComponent);
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
} else if (props.onClick) {
|
|
2395
|
+
patchProp(
|
|
2396
|
+
el,
|
|
2397
|
+
"onClick",
|
|
2398
|
+
null,
|
|
2399
|
+
props.onClick,
|
|
2400
|
+
void 0,
|
|
2401
|
+
parentComponent
|
|
2402
|
+
);
|
|
2403
|
+
} else if (patchFlag & 4 && isReactive(props.style)) {
|
|
2404
|
+
for (const key in props.style) props.style[key];
|
|
2647
2405
|
}
|
|
2648
|
-
}
|
|
2406
|
+
}
|
|
2407
|
+
let vnodeHooks;
|
|
2408
|
+
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
2409
|
+
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
2410
|
+
}
|
|
2411
|
+
if (dirs) {
|
|
2412
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
2413
|
+
}
|
|
2414
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
2415
|
+
queueEffectWithSuspense(() => {
|
|
2416
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
2417
|
+
needCallTransitionHooks && transition.enter(el);
|
|
2418
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
2419
|
+
}, parentSuspense);
|
|
2420
|
+
}
|
|
2649
2421
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2422
|
+
return el.nextSibling;
|
|
2423
|
+
};
|
|
2424
|
+
const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2425
|
+
optimized = optimized || !!parentVNode.dynamicChildren;
|
|
2426
|
+
const children = parentVNode.children;
|
|
2427
|
+
const l = children.length;
|
|
2428
|
+
let hasWarned = false;
|
|
2429
|
+
for (let i = 0; i < l; i++) {
|
|
2430
|
+
const vnode = optimized ? children[i] : children[i] = normalizeVNode(children[i]);
|
|
2431
|
+
const isText = vnode.type === Text;
|
|
2432
|
+
if (node) {
|
|
2433
|
+
if (isText && !optimized) {
|
|
2434
|
+
if (i + 1 < l && normalizeVNode(children[i + 1]).type === Text) {
|
|
2435
|
+
insert(
|
|
2436
|
+
createText(
|
|
2437
|
+
node.data.slice(vnode.children.length)
|
|
2438
|
+
),
|
|
2439
|
+
container,
|
|
2440
|
+
nextSibling(node)
|
|
2441
|
+
);
|
|
2442
|
+
node.data = vnode.children;
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
node = hydrateNode(
|
|
2446
|
+
node,
|
|
2447
|
+
vnode,
|
|
2448
|
+
parentComponent,
|
|
2449
|
+
parentSuspense,
|
|
2450
|
+
slotScopeIds,
|
|
2451
|
+
optimized
|
|
2452
|
+
);
|
|
2453
|
+
} else if (isText && !vnode.children) {
|
|
2454
|
+
insert(vnode.el = createText(""), container);
|
|
2455
|
+
} else {
|
|
2456
|
+
if (!isMismatchAllowed(container, 1 /* CHILDREN */)) {
|
|
2457
|
+
if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && !hasWarned) {
|
|
2458
|
+
warn$1(
|
|
2459
|
+
`Hydration children mismatch on`,
|
|
2460
|
+
container,
|
|
2461
|
+
`
|
|
2462
|
+
Server rendered element contains fewer child nodes than client vdom.`
|
|
2463
|
+
);
|
|
2464
|
+
hasWarned = true;
|
|
2465
|
+
}
|
|
2466
|
+
logMismatchError();
|
|
2467
|
+
}
|
|
2468
|
+
patch(
|
|
2469
|
+
null,
|
|
2470
|
+
vnode,
|
|
2471
|
+
container,
|
|
2472
|
+
null,
|
|
2473
|
+
parentComponent,
|
|
2474
|
+
parentSuspense,
|
|
2475
|
+
getContainerType(container),
|
|
2476
|
+
slotScopeIds
|
|
2477
|
+
);
|
|
2656
2478
|
}
|
|
2657
|
-
cache.delete(key);
|
|
2658
|
-
keys.delete(key);
|
|
2659
2479
|
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2480
|
+
return node;
|
|
2481
|
+
};
|
|
2482
|
+
const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
2483
|
+
const { slotScopeIds: fragmentSlotScopeIds } = vnode;
|
|
2484
|
+
if (fragmentSlotScopeIds) {
|
|
2485
|
+
slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
|
|
2486
|
+
}
|
|
2487
|
+
const container = parentNode(node);
|
|
2488
|
+
const next = hydrateChildren(
|
|
2489
|
+
nextSibling(node),
|
|
2490
|
+
vnode,
|
|
2491
|
+
container,
|
|
2492
|
+
parentComponent,
|
|
2493
|
+
parentSuspense,
|
|
2494
|
+
slotScopeIds,
|
|
2495
|
+
optimized
|
|
2668
2496
|
);
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2497
|
+
if (next && isComment(next) && next.data === "]") {
|
|
2498
|
+
return nextSibling(vnode.anchor = next);
|
|
2499
|
+
} else {
|
|
2500
|
+
logMismatchError();
|
|
2501
|
+
insert(vnode.anchor = createComment(`]`), container, next);
|
|
2502
|
+
return next;
|
|
2503
|
+
}
|
|
2504
|
+
};
|
|
2505
|
+
const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
|
|
2506
|
+
if (!isMismatchAllowed(node.parentElement, 1 /* CHILDREN */)) {
|
|
2507
|
+
(!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && warn$1(
|
|
2508
|
+
`Hydration node mismatch:
|
|
2509
|
+
- rendered on server:`,
|
|
2510
|
+
node,
|
|
2511
|
+
node.nodeType === 3 ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
|
|
2512
|
+
`
|
|
2513
|
+
- expected on client:`,
|
|
2514
|
+
vnode.type
|
|
2515
|
+
);
|
|
2516
|
+
logMismatchError();
|
|
2517
|
+
}
|
|
2518
|
+
vnode.el = null;
|
|
2519
|
+
if (isFragment) {
|
|
2520
|
+
const end = locateClosingAnchor(node);
|
|
2521
|
+
while (true) {
|
|
2522
|
+
const next2 = nextSibling(node);
|
|
2523
|
+
if (next2 && next2 !== end) {
|
|
2524
|
+
remove(next2);
|
|
2676
2525
|
} else {
|
|
2677
|
-
|
|
2678
|
-
}
|
|
2679
|
-
}
|
|
2680
|
-
};
|
|
2681
|
-
onMounted(cacheSubtree);
|
|
2682
|
-
onUpdated(cacheSubtree);
|
|
2683
|
-
onBeforeUnmount(() => {
|
|
2684
|
-
cache.forEach((cached) => {
|
|
2685
|
-
const { subTree, suspense } = instance;
|
|
2686
|
-
const vnode = getInnerChild(subTree);
|
|
2687
|
-
if (cached.type === vnode.type && cached.key === vnode.key) {
|
|
2688
|
-
resetShapeFlag(vnode);
|
|
2689
|
-
const da = vnode.component.da;
|
|
2690
|
-
da && queuePostRenderEffect(da, suspense);
|
|
2691
|
-
return;
|
|
2526
|
+
break;
|
|
2692
2527
|
}
|
|
2693
|
-
unmount(cached);
|
|
2694
|
-
});
|
|
2695
|
-
});
|
|
2696
|
-
return () => {
|
|
2697
|
-
pendingCacheKey = null;
|
|
2698
|
-
if (!slots.default) {
|
|
2699
|
-
return current = null;
|
|
2700
2528
|
}
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2529
|
+
}
|
|
2530
|
+
const next = nextSibling(node);
|
|
2531
|
+
const container = parentNode(node);
|
|
2532
|
+
remove(node);
|
|
2533
|
+
patch(
|
|
2534
|
+
null,
|
|
2535
|
+
vnode,
|
|
2536
|
+
container,
|
|
2537
|
+
next,
|
|
2538
|
+
parentComponent,
|
|
2539
|
+
parentSuspense,
|
|
2540
|
+
getContainerType(container),
|
|
2541
|
+
slotScopeIds
|
|
2542
|
+
);
|
|
2543
|
+
if (parentComponent) {
|
|
2544
|
+
parentComponent.vnode.el = vnode.el;
|
|
2545
|
+
updateHOCHostEl(parentComponent, vnode.el);
|
|
2546
|
+
}
|
|
2547
|
+
return next;
|
|
2548
|
+
};
|
|
2549
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
2550
|
+
let match = 0;
|
|
2551
|
+
while (node) {
|
|
2552
|
+
node = nextSibling(node);
|
|
2553
|
+
if (node && isComment(node)) {
|
|
2554
|
+
if (node.data === open) match++;
|
|
2555
|
+
if (node.data === close) {
|
|
2556
|
+
if (match === 0) {
|
|
2557
|
+
return nextSibling(node);
|
|
2558
|
+
} else {
|
|
2559
|
+
match--;
|
|
2560
|
+
}
|
|
2706
2561
|
}
|
|
2707
|
-
current = null;
|
|
2708
|
-
return children;
|
|
2709
|
-
} else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
|
|
2710
|
-
current = null;
|
|
2711
|
-
return rawVNode;
|
|
2712
|
-
}
|
|
2713
|
-
let vnode = getInnerChild(rawVNode);
|
|
2714
|
-
if (vnode.type === Comment) {
|
|
2715
|
-
current = null;
|
|
2716
|
-
return vnode;
|
|
2717
|
-
}
|
|
2718
|
-
const comp = vnode.type;
|
|
2719
|
-
const name = getComponentName(
|
|
2720
|
-
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
2721
|
-
);
|
|
2722
|
-
const { include, exclude, max } = props;
|
|
2723
|
-
if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
|
|
2724
|
-
vnode.shapeFlag &= ~256;
|
|
2725
|
-
current = vnode;
|
|
2726
|
-
return rawVNode;
|
|
2727
2562
|
}
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2563
|
+
}
|
|
2564
|
+
return node;
|
|
2565
|
+
};
|
|
2566
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
2567
|
+
const parentNode2 = oldNode.parentNode;
|
|
2568
|
+
if (parentNode2) {
|
|
2569
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
2570
|
+
}
|
|
2571
|
+
let parent = parentComponent;
|
|
2572
|
+
while (parent) {
|
|
2573
|
+
if (parent.vnode.el === oldNode) {
|
|
2574
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
2735
2575
|
}
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2576
|
+
parent = parent.parent;
|
|
2577
|
+
}
|
|
2578
|
+
};
|
|
2579
|
+
const isTemplateNode = (node) => {
|
|
2580
|
+
return node.nodeType === 1 && node.tagName === "TEMPLATE";
|
|
2581
|
+
};
|
|
2582
|
+
return [hydrate, hydrateNode];
|
|
2583
|
+
}
|
|
2584
|
+
function propHasMismatch(el, key, clientValue, vnode, instance) {
|
|
2585
|
+
let mismatchType;
|
|
2586
|
+
let mismatchKey;
|
|
2587
|
+
let actual;
|
|
2588
|
+
let expected;
|
|
2589
|
+
if (key === "class") {
|
|
2590
|
+
actual = el.getAttribute("class");
|
|
2591
|
+
expected = normalizeClass(clientValue);
|
|
2592
|
+
if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
|
|
2593
|
+
mismatchType = 2 /* CLASS */;
|
|
2594
|
+
mismatchKey = `class`;
|
|
2595
|
+
}
|
|
2596
|
+
} else if (key === "style") {
|
|
2597
|
+
actual = el.getAttribute("style") || "";
|
|
2598
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
2599
|
+
const actualMap = toStyleMap(actual);
|
|
2600
|
+
const expectedMap = toStyleMap(expected);
|
|
2601
|
+
if (vnode.dirs) {
|
|
2602
|
+
for (const { dir, value } of vnode.dirs) {
|
|
2603
|
+
if (dir.name === "show" && !value) {
|
|
2604
|
+
expectedMap.set("display", "none");
|
|
2751
2605
|
}
|
|
2752
2606
|
}
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
if (
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2775
|
-
registerKeepAliveHook(hook, "da", target);
|
|
2776
|
-
}
|
|
2777
|
-
function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
2778
|
-
const wrappedHook = hook.__wdc || (hook.__wdc = () => {
|
|
2779
|
-
let current = target;
|
|
2780
|
-
while (current) {
|
|
2781
|
-
if (current.isDeactivated) {
|
|
2782
|
-
return;
|
|
2607
|
+
}
|
|
2608
|
+
if (instance) {
|
|
2609
|
+
resolveCssVars(instance, vnode, expectedMap);
|
|
2610
|
+
}
|
|
2611
|
+
if (!isMapEqual(actualMap, expectedMap)) {
|
|
2612
|
+
mismatchType = 3 /* STYLE */;
|
|
2613
|
+
mismatchKey = "style";
|
|
2614
|
+
}
|
|
2615
|
+
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
2616
|
+
if (isBooleanAttr(key)) {
|
|
2617
|
+
actual = el.hasAttribute(key);
|
|
2618
|
+
expected = includeBooleanAttr(clientValue);
|
|
2619
|
+
} else if (clientValue == null) {
|
|
2620
|
+
actual = el.hasAttribute(key);
|
|
2621
|
+
expected = false;
|
|
2622
|
+
} else {
|
|
2623
|
+
if (el.hasAttribute(key)) {
|
|
2624
|
+
actual = el.getAttribute(key);
|
|
2625
|
+
} else if (key === "value" && el.tagName === "TEXTAREA") {
|
|
2626
|
+
actual = el.value;
|
|
2627
|
+
} else {
|
|
2628
|
+
actual = false;
|
|
2783
2629
|
}
|
|
2784
|
-
|
|
2630
|
+
expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
|
|
2785
2631
|
}
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
if (target) {
|
|
2790
|
-
let current = target.parent;
|
|
2791
|
-
while (current && current.parent) {
|
|
2792
|
-
if (isKeepAlive(current.parent.vnode)) {
|
|
2793
|
-
injectToKeepAliveRoot(wrappedHook, type, target, current);
|
|
2794
|
-
}
|
|
2795
|
-
current = current.parent;
|
|
2632
|
+
if (actual !== expected) {
|
|
2633
|
+
mismatchType = 4 /* ATTRIBUTE */;
|
|
2634
|
+
mismatchKey = key;
|
|
2796
2635
|
}
|
|
2797
2636
|
}
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
remove(keepAliveRoot[type], injected);
|
|
2809
|
-
}, target);
|
|
2810
|
-
}
|
|
2811
|
-
function resetShapeFlag(vnode) {
|
|
2812
|
-
vnode.shapeFlag &= ~256;
|
|
2813
|
-
vnode.shapeFlag &= ~512;
|
|
2814
|
-
}
|
|
2815
|
-
function getInnerChild(vnode) {
|
|
2816
|
-
return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
2820
|
-
if (target) {
|
|
2821
|
-
const hooks = target[type] || (target[type] = []);
|
|
2822
|
-
const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
|
|
2823
|
-
pauseTracking();
|
|
2824
|
-
const reset = setCurrentInstance(target);
|
|
2825
|
-
const res = callWithAsyncErrorHandling(hook, target, type, args);
|
|
2826
|
-
reset();
|
|
2827
|
-
resetTracking();
|
|
2828
|
-
return res;
|
|
2829
|
-
});
|
|
2830
|
-
if (prepend) {
|
|
2831
|
-
hooks.unshift(wrappedHook);
|
|
2832
|
-
} else {
|
|
2833
|
-
hooks.push(wrappedHook);
|
|
2637
|
+
if (mismatchType != null && !isMismatchAllowed(el, mismatchType)) {
|
|
2638
|
+
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
2639
|
+
const preSegment = `Hydration ${MismatchTypeString[mismatchType]} mismatch on`;
|
|
2640
|
+
const postSegment = `
|
|
2641
|
+
- rendered on server: ${format(actual)}
|
|
2642
|
+
- expected on client: ${format(expected)}
|
|
2643
|
+
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
2644
|
+
You should fix the source of the mismatch.`;
|
|
2645
|
+
{
|
|
2646
|
+
warn$1(preSegment, el, postSegment);
|
|
2834
2647
|
}
|
|
2835
|
-
return
|
|
2836
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2837
|
-
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
2838
|
-
warn$1(
|
|
2839
|
-
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
2840
|
-
);
|
|
2648
|
+
return true;
|
|
2841
2649
|
}
|
|
2650
|
+
return false;
|
|
2842
2651
|
}
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2652
|
+
function toClassSet(str) {
|
|
2653
|
+
return new Set(str.trim().split(/\s+/));
|
|
2654
|
+
}
|
|
2655
|
+
function isSetEqual(a, b) {
|
|
2656
|
+
if (a.size !== b.size) {
|
|
2657
|
+
return false;
|
|
2846
2658
|
}
|
|
2847
|
-
|
|
2848
|
-
|
|
2659
|
+
for (const s of a) {
|
|
2660
|
+
if (!b.has(s)) {
|
|
2661
|
+
return false;
|
|
2662
|
+
}
|
|
2849
2663
|
}
|
|
2850
|
-
|
|
2851
|
-
const onBeforeMount = createHook("bm");
|
|
2852
|
-
const onMounted = createHook("m");
|
|
2853
|
-
const onBeforeUpdate = createHook(
|
|
2854
|
-
"bu"
|
|
2855
|
-
);
|
|
2856
|
-
const onUpdated = createHook("u");
|
|
2857
|
-
const onBeforeUnmount = createHook(
|
|
2858
|
-
"bum"
|
|
2859
|
-
);
|
|
2860
|
-
const onUnmounted = createHook("um");
|
|
2861
|
-
const onServerPrefetch = createHook(
|
|
2862
|
-
"sp"
|
|
2863
|
-
);
|
|
2864
|
-
const onRenderTriggered = createHook("rtg");
|
|
2865
|
-
const onRenderTracked = createHook("rtc");
|
|
2866
|
-
function onErrorCaptured(hook, target = currentInstance) {
|
|
2867
|
-
injectHook("ec", hook, target);
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
const COMPONENTS = "components";
|
|
2871
|
-
const DIRECTIVES = "directives";
|
|
2872
|
-
function resolveComponent(name, maybeSelfReference) {
|
|
2873
|
-
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2664
|
+
return true;
|
|
2874
2665
|
}
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2666
|
+
function toStyleMap(str) {
|
|
2667
|
+
const styleMap = /* @__PURE__ */ new Map();
|
|
2668
|
+
for (const item of str.split(";")) {
|
|
2669
|
+
let [key, value] = item.split(":");
|
|
2670
|
+
key = key.trim();
|
|
2671
|
+
value = value && value.trim();
|
|
2672
|
+
if (key && value) {
|
|
2673
|
+
styleMap.set(key, value);
|
|
2674
|
+
}
|
|
2881
2675
|
}
|
|
2676
|
+
return styleMap;
|
|
2882
2677
|
}
|
|
2883
|
-
function
|
|
2884
|
-
|
|
2678
|
+
function isMapEqual(a, b) {
|
|
2679
|
+
if (a.size !== b.size) {
|
|
2680
|
+
return false;
|
|
2681
|
+
}
|
|
2682
|
+
for (const [key, value] of a) {
|
|
2683
|
+
if (value !== b.get(key)) {
|
|
2684
|
+
return false;
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
return true;
|
|
2885
2688
|
}
|
|
2886
|
-
function
|
|
2887
|
-
const
|
|
2888
|
-
if (instance) {
|
|
2889
|
-
const
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2689
|
+
function resolveCssVars(instance, vnode, expectedMap) {
|
|
2690
|
+
const root = instance.subTree;
|
|
2691
|
+
if (instance.getCssVars && (vnode === root || root && root.type === Fragment && root.children.includes(vnode))) {
|
|
2692
|
+
const cssVars = instance.getCssVars();
|
|
2693
|
+
for (const key in cssVars) {
|
|
2694
|
+
expectedMap.set(
|
|
2695
|
+
`--${getEscapedCssVarName(key, false)}`,
|
|
2696
|
+
String(cssVars[key])
|
|
2894
2697
|
);
|
|
2895
|
-
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
2896
|
-
return Component;
|
|
2897
|
-
}
|
|
2898
2698
|
}
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2699
|
+
}
|
|
2700
|
+
if (vnode === root && instance.parent) {
|
|
2701
|
+
resolveCssVars(instance.parent, instance.vnode, expectedMap);
|
|
2702
|
+
}
|
|
2703
|
+
}
|
|
2704
|
+
const allowMismatchAttr = "data-allow-mismatch";
|
|
2705
|
+
const MismatchTypeString = {
|
|
2706
|
+
[0 /* TEXT */]: "text",
|
|
2707
|
+
[1 /* CHILDREN */]: "children",
|
|
2708
|
+
[2 /* CLASS */]: "class",
|
|
2709
|
+
[3 /* STYLE */]: "style",
|
|
2710
|
+
[4 /* ATTRIBUTE */]: "attribute"
|
|
2711
|
+
};
|
|
2712
|
+
function isMismatchAllowed(el, allowedType) {
|
|
2713
|
+
if (allowedType === 0 /* TEXT */ || allowedType === 1 /* CHILDREN */) {
|
|
2714
|
+
while (el && !el.hasAttribute(allowMismatchAttr)) {
|
|
2715
|
+
el = el.parentElement;
|
|
2907
2716
|
}
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2717
|
+
}
|
|
2718
|
+
const allowedAttr = el && el.getAttribute(allowMismatchAttr);
|
|
2719
|
+
if (allowedAttr == null) {
|
|
2720
|
+
return false;
|
|
2721
|
+
} else if (allowedAttr === "") {
|
|
2722
|
+
return true;
|
|
2723
|
+
} else {
|
|
2724
|
+
const list = allowedAttr.split(",");
|
|
2725
|
+
if (allowedType === 0 /* TEXT */ && list.includes("children")) {
|
|
2726
|
+
return true;
|
|
2912
2727
|
}
|
|
2913
|
-
return
|
|
2914
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2915
|
-
warn$1(
|
|
2916
|
-
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
2917
|
-
);
|
|
2728
|
+
return allowedAttr.split(",").includes(MismatchTypeString[allowedType]);
|
|
2918
2729
|
}
|
|
2919
2730
|
}
|
|
2920
|
-
function resolve(registry, name) {
|
|
2921
|
-
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
2922
|
-
}
|
|
2923
2731
|
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
const
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2732
|
+
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2733
|
+
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2734
|
+
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2735
|
+
const id = requestIdleCallback(hydrate, { timeout });
|
|
2736
|
+
return () => cancelIdleCallback(id);
|
|
2737
|
+
};
|
|
2738
|
+
function elementIsVisibleInViewport(el) {
|
|
2739
|
+
const { top, left, bottom, right } = el.getBoundingClientRect();
|
|
2740
|
+
const { innerHeight, innerWidth } = window;
|
|
2741
|
+
return (top > 0 && top < innerHeight || bottom > 0 && bottom < innerHeight) && (left > 0 && left < innerWidth || right > 0 && right < innerWidth);
|
|
2742
|
+
}
|
|
2743
|
+
const hydrateOnVisible = (opts) => (hydrate, forEach) => {
|
|
2744
|
+
const ob = new IntersectionObserver((entries) => {
|
|
2745
|
+
for (const e of entries) {
|
|
2746
|
+
if (!e.isIntersecting) continue;
|
|
2747
|
+
ob.disconnect();
|
|
2748
|
+
hydrate();
|
|
2749
|
+
break;
|
|
2934
2750
|
}
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2751
|
+
}, opts);
|
|
2752
|
+
forEach((el) => {
|
|
2753
|
+
if (!(el instanceof Element)) return;
|
|
2754
|
+
if (elementIsVisibleInViewport(el)) {
|
|
2755
|
+
hydrate();
|
|
2756
|
+
ob.disconnect();
|
|
2757
|
+
return false;
|
|
2758
|
+
}
|
|
2759
|
+
ob.observe(el);
|
|
2760
|
+
});
|
|
2761
|
+
return () => ob.disconnect();
|
|
2762
|
+
};
|
|
2763
|
+
const hydrateOnMediaQuery = (query) => (hydrate) => {
|
|
2764
|
+
if (query) {
|
|
2765
|
+
const mql = matchMedia(query);
|
|
2766
|
+
if (mql.matches) {
|
|
2767
|
+
hydrate();
|
|
2768
|
+
} else {
|
|
2769
|
+
mql.addEventListener("change", hydrate, { once: true });
|
|
2770
|
+
return () => mql.removeEventListener("change", hydrate);
|
|
2943
2771
|
}
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2772
|
+
}
|
|
2773
|
+
};
|
|
2774
|
+
const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
|
|
2775
|
+
if (isString(interactions)) interactions = [interactions];
|
|
2776
|
+
let hasHydrated = false;
|
|
2777
|
+
const doHydrate = (e) => {
|
|
2778
|
+
if (!hasHydrated) {
|
|
2779
|
+
hasHydrated = true;
|
|
2780
|
+
teardown();
|
|
2781
|
+
hydrate();
|
|
2782
|
+
e.target.dispatchEvent(new e.constructor(e.type, e));
|
|
2947
2783
|
}
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2784
|
+
};
|
|
2785
|
+
const teardown = () => {
|
|
2786
|
+
forEach((el) => {
|
|
2787
|
+
for (const i of interactions) {
|
|
2788
|
+
el.removeEventListener(i, doHydrate);
|
|
2789
|
+
}
|
|
2790
|
+
});
|
|
2791
|
+
};
|
|
2792
|
+
forEach((el) => {
|
|
2793
|
+
for (const i of interactions) {
|
|
2794
|
+
el.addEventListener(i, doHydrate, { once: true });
|
|
2951
2795
|
}
|
|
2952
|
-
}
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2796
|
+
});
|
|
2797
|
+
return teardown;
|
|
2798
|
+
};
|
|
2799
|
+
function forEachElement(node, cb) {
|
|
2800
|
+
if (isComment(node) && node.data === "[") {
|
|
2801
|
+
let depth = 1;
|
|
2802
|
+
let next = node.nextSibling;
|
|
2803
|
+
while (next) {
|
|
2804
|
+
if (next.nodeType === 1) {
|
|
2805
|
+
const result = cb(next);
|
|
2806
|
+
if (result === false) {
|
|
2807
|
+
break;
|
|
2808
|
+
}
|
|
2809
|
+
} else if (isComment(next)) {
|
|
2810
|
+
if (next.data === "]") {
|
|
2811
|
+
if (--depth === 0) break;
|
|
2812
|
+
} else if (next.data === "[") {
|
|
2813
|
+
depth++;
|
|
2814
|
+
}
|
|
2964
2815
|
}
|
|
2816
|
+
next = next.nextSibling;
|
|
2965
2817
|
}
|
|
2966
2818
|
} else {
|
|
2967
|
-
|
|
2968
|
-
}
|
|
2969
|
-
if (cache) {
|
|
2970
|
-
cache[index] = ret;
|
|
2819
|
+
cb(node);
|
|
2971
2820
|
}
|
|
2972
|
-
return ret;
|
|
2973
2821
|
}
|
|
2974
2822
|
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
if (
|
|
2979
|
-
|
|
2980
|
-
|
|
2823
|
+
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
2824
|
+
function _getValidZova(instance) {
|
|
2825
|
+
while (instance) {
|
|
2826
|
+
if (instance.zova) return instance.zova;
|
|
2827
|
+
instance = instance.parent;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
/*! #__NO_SIDE_EFFECTS__ */
|
|
2831
|
+
// @__NO_SIDE_EFFECTS__
|
|
2832
|
+
function defineAsyncComponent(source) {
|
|
2833
|
+
if (isFunction(source)) {
|
|
2834
|
+
source = { loader: source };
|
|
2835
|
+
}
|
|
2836
|
+
const {
|
|
2837
|
+
loader,
|
|
2838
|
+
loadingComponent,
|
|
2839
|
+
errorComponent,
|
|
2840
|
+
delay = 200,
|
|
2841
|
+
hydrate: hydrateStrategy,
|
|
2842
|
+
timeout,
|
|
2843
|
+
// undefined = never times out
|
|
2844
|
+
suspensible = true,
|
|
2845
|
+
onError: userOnError
|
|
2846
|
+
} = source;
|
|
2847
|
+
let pendingRequest = null;
|
|
2848
|
+
let resolvedComp;
|
|
2849
|
+
let retries = 0;
|
|
2850
|
+
const retry = () => {
|
|
2851
|
+
retries++;
|
|
2852
|
+
pendingRequest = null;
|
|
2853
|
+
return load();
|
|
2854
|
+
};
|
|
2855
|
+
const load = () => {
|
|
2856
|
+
let thisRequest;
|
|
2857
|
+
return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
|
|
2858
|
+
err = err instanceof Error ? err : new Error(String(err));
|
|
2859
|
+
if (userOnError) {
|
|
2860
|
+
return new Promise((resolve, reject) => {
|
|
2861
|
+
const userRetry = () => resolve(retry());
|
|
2862
|
+
const userFail = () => reject(err);
|
|
2863
|
+
userOnError(err, userRetry, userFail, retries + 1);
|
|
2864
|
+
});
|
|
2865
|
+
} else {
|
|
2866
|
+
throw err;
|
|
2981
2867
|
}
|
|
2982
|
-
}
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2868
|
+
}).then((comp) => {
|
|
2869
|
+
if (thisRequest !== pendingRequest && pendingRequest) {
|
|
2870
|
+
return pendingRequest;
|
|
2871
|
+
}
|
|
2872
|
+
if (!!(process.env.NODE_ENV !== "production") && !comp) {
|
|
2873
|
+
warn$1(
|
|
2874
|
+
`Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
|
|
2875
|
+
);
|
|
2876
|
+
}
|
|
2877
|
+
if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
|
|
2878
|
+
comp = comp.default;
|
|
2879
|
+
}
|
|
2880
|
+
if (!!(process.env.NODE_ENV !== "production") && comp && !isObject(comp) && !isFunction(comp)) {
|
|
2881
|
+
throw new Error(`Invalid async component load result: ${comp}`);
|
|
2882
|
+
}
|
|
2883
|
+
resolvedComp = comp;
|
|
2884
|
+
return comp;
|
|
2885
|
+
}));
|
|
2886
|
+
};
|
|
2887
|
+
return defineComponent({
|
|
2888
|
+
name: "AsyncComponentWrapper",
|
|
2889
|
+
__asyncLoader: load,
|
|
2890
|
+
__asyncHydrate(el, instance, hydrate) {
|
|
2891
|
+
const doHydrate = hydrateStrategy ? () => {
|
|
2892
|
+
const teardown = hydrateStrategy(
|
|
2893
|
+
hydrate,
|
|
2894
|
+
(cb) => forEachElement(el, cb)
|
|
2895
|
+
);
|
|
2896
|
+
if (teardown) {
|
|
2897
|
+
(instance.bum || (instance.bum = [])).push(teardown);
|
|
2898
|
+
}
|
|
2899
|
+
} : hydrate;
|
|
2900
|
+
if (resolvedComp) {
|
|
2901
|
+
doHydrate();
|
|
2902
|
+
} else {
|
|
2903
|
+
const zova = _getValidZova(instance);
|
|
2904
|
+
zova.meta.$ssr._hydratingInc();
|
|
2905
|
+
load().then(() => {
|
|
2906
|
+
!instance.isUnmounted && doHydrate();
|
|
2907
|
+
zova.meta.$ssr._hydratingDec();
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
get __asyncResolved() {
|
|
2912
|
+
return resolvedComp;
|
|
2913
|
+
},
|
|
2914
|
+
setup() {
|
|
2915
|
+
const instance = currentInstance;
|
|
2916
|
+
markAsyncBoundary(instance);
|
|
2917
|
+
if (resolvedComp) {
|
|
2918
|
+
return () => createInnerComp(resolvedComp, instance);
|
|
2919
|
+
}
|
|
2920
|
+
const onError = (err) => {
|
|
2921
|
+
pendingRequest = null;
|
|
2922
|
+
handleError(
|
|
2923
|
+
err,
|
|
2924
|
+
instance,
|
|
2925
|
+
13,
|
|
2926
|
+
!errorComponent
|
|
2927
|
+
);
|
|
2928
|
+
};
|
|
2929
|
+
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
2930
|
+
return load().then((comp) => {
|
|
2931
|
+
return () => createInnerComp(comp, instance);
|
|
2932
|
+
}).catch((err) => {
|
|
2933
|
+
onError(err);
|
|
2934
|
+
return () => errorComponent ? createVNode(errorComponent, {
|
|
2935
|
+
error: err
|
|
2936
|
+
}) : null;
|
|
2937
|
+
});
|
|
2938
|
+
}
|
|
2939
|
+
const loaded = ref(false);
|
|
2940
|
+
const error = ref();
|
|
2941
|
+
const delayed = ref(!!delay);
|
|
2942
|
+
if (delay) {
|
|
2943
|
+
setTimeout(() => {
|
|
2944
|
+
delayed.value = false;
|
|
2945
|
+
}, delay);
|
|
2946
|
+
}
|
|
2947
|
+
if (timeout != null) {
|
|
2948
|
+
setTimeout(() => {
|
|
2949
|
+
if (!loaded.value && !error.value) {
|
|
2950
|
+
const err = new Error(
|
|
2951
|
+
`Async component timed out after ${timeout}ms.`
|
|
2952
|
+
);
|
|
2953
|
+
onError(err);
|
|
2954
|
+
error.value = err;
|
|
2955
|
+
}
|
|
2956
|
+
}, timeout);
|
|
2957
|
+
}
|
|
2958
|
+
load().then(() => {
|
|
2959
|
+
loaded.value = true;
|
|
2960
|
+
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
2961
|
+
instance.parent.update();
|
|
2962
|
+
}
|
|
2963
|
+
}).catch((err) => {
|
|
2964
|
+
onError(err);
|
|
2965
|
+
error.value = err;
|
|
2966
|
+
});
|
|
2967
|
+
return () => {
|
|
2968
|
+
if (loaded.value && resolvedComp) {
|
|
2969
|
+
return createInnerComp(resolvedComp, instance);
|
|
2970
|
+
} else if (error.value && errorComponent) {
|
|
2971
|
+
return createVNode(errorComponent, {
|
|
2972
|
+
error: error.value
|
|
2973
|
+
});
|
|
2974
|
+
} else if (loadingComponent && !delayed.value) {
|
|
2975
|
+
return createVNode(loadingComponent);
|
|
2976
|
+
}
|
|
2977
|
+
};
|
|
2988
2978
|
}
|
|
2989
|
-
}
|
|
2990
|
-
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
function createInnerComp(comp, parent) {
|
|
2982
|
+
const { ref: ref2, props, children, ce } = parent.vnode;
|
|
2983
|
+
const vnode = createVNode(comp, props, children);
|
|
2984
|
+
vnode.ref = ref2;
|
|
2985
|
+
vnode.ce = ce;
|
|
2986
|
+
delete parent.vnode.ce;
|
|
2987
|
+
vnode.zovaHostProviders = parent.vnode.zovaHostProviders;
|
|
2988
|
+
return vnode;
|
|
2991
2989
|
}
|
|
2992
2990
|
|
|
2993
2991
|
function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|