@biggive/components 202501170933.0.0 → 202501211147.0.0
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/biggive/biggive.esm.js +1 -1
- package/dist/biggive/biggive.esm.js.map +1 -1
- package/dist/biggive/{p-f3843702.entry.js → p-08caba7b.entry.js} +2 -2
- package/dist/biggive/{p-972e8b70.entry.js → p-130c66ba.entry.js} +2 -2
- package/dist/biggive/{p-4d544ada.entry.js → p-1668ace9.entry.js} +2 -2
- package/dist/biggive/{p-62791aae.entry.js → p-1d9d1fb2.entry.js} +2 -2
- package/dist/biggive/p-22982c55.js +3 -0
- package/dist/biggive/p-22982c55.js.map +1 -0
- package/dist/biggive/{p-8c6c1385.entry.js → p-2baa279c.entry.js} +2 -2
- package/dist/biggive/{p-9f09fec7.entry.js → p-372349f5.entry.js} +2 -2
- package/dist/biggive/{p-f0b40214.entry.js → p-42a8df24.entry.js} +2 -2
- package/dist/biggive/{p-c964fd9f.entry.js → p-4e3802b0.entry.js} +2 -2
- package/dist/biggive/{p-05d6cfa4.entry.js → p-64677357.entry.js} +2 -2
- package/dist/biggive/{p-6684c3f7.entry.js → p-7c0358ab.entry.js} +2 -2
- package/dist/biggive/p-aefad0be.entry.js +2 -0
- package/dist/biggive/{p-257dc505.entry.js → p-c4222c1b.entry.js} +2 -2
- package/dist/biggive/{p-e2d84fe2.entry.js → p-d05e6bf8.entry.js} +2 -2
- package/dist/biggive/{p-f7a53e18.entry.js → p-d7f9d076.entry.js} +2 -2
- package/dist/biggive/{p-6eb68ed6.entry.js → p-f6ee342f.entry.js} +2 -2
- package/dist/biggive/{p-7459c28f.entry.js → p-ff8a3dc2.entry.js} +2 -2
- package/dist/cjs/biggive-accordion_38.cjs.entry.js +1 -1
- package/dist/cjs/biggive-article-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-basic-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-beneficiary-icon.cjs.entry.js +1 -1
- package/dist/cjs/biggive-biography-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-boxed-content.cjs.entry.js +1 -1
- package/dist/cjs/biggive-category-icon.cjs.entry.js +1 -1
- package/dist/cjs/biggive-container-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-cookie-banner.cjs.entry.js +1 -1
- package/dist/cjs/biggive-form.cjs.entry.js +1 -1
- package/dist/cjs/biggive-icon-group.cjs.entry.js +1 -1
- package/dist/cjs/biggive-image-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-nav-group.cjs.entry.js +1 -1
- package/dist/cjs/biggive-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/biggive-table.cjs.entry.js +1 -1
- package/dist/cjs/biggive-video.cjs.entry.js +1 -1
- package/dist/cjs/biggive.cjs.js +2 -2
- package/dist/cjs/biggive.cjs.js.map +1 -1
- package/dist/cjs/{index-e6b3a940.js → index-c57c3e85.js} +1152 -1111
- package/dist/cjs/index-c57c3e85.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/biggive-accordion_38.entry.js +1 -1
- package/dist/esm/biggive-article-card.entry.js +1 -1
- package/dist/esm/biggive-basic-card.entry.js +1 -1
- package/dist/esm/biggive-beneficiary-icon.entry.js +1 -1
- package/dist/esm/biggive-biography-card.entry.js +1 -1
- package/dist/esm/biggive-boxed-content.entry.js +1 -1
- package/dist/esm/biggive-category-icon.entry.js +1 -1
- package/dist/esm/biggive-container-card.entry.js +1 -1
- package/dist/esm/biggive-cookie-banner.entry.js +1 -1
- package/dist/esm/biggive-form.entry.js +1 -1
- package/dist/esm/biggive-icon-group.entry.js +1 -1
- package/dist/esm/biggive-image-card.entry.js +1 -1
- package/dist/esm/biggive-nav-group.entry.js +1 -1
- package/dist/esm/biggive-nav-item.entry.js +1 -1
- package/dist/esm/biggive-table.entry.js +1 -1
- package/dist/esm/biggive-video.entry.js +1 -1
- package/dist/esm/biggive.js +3 -3
- package/dist/esm/biggive.js.map +1 -1
- package/dist/esm/{index-501730c4.js → index-a7be7e08.js} +1152 -1111
- package/dist/esm/index-a7be7e08.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/hydrate/index.js +1016 -984
- package/hydrate/index.mjs +1016 -984
- package/package.json +2 -2
- package/dist/biggive/p-14df7401.entry.js +0 -2
- package/dist/biggive/p-e5a29e75.js +0 -3
- package/dist/biggive/p-e5a29e75.js.map +0 -1
- package/dist/cjs/index-e6b3a940.js.map +0 -1
- package/dist/esm/index-501730c4.js.map +0 -1
- /package/dist/biggive/{p-f3843702.entry.js.map → p-08caba7b.entry.js.map} +0 -0
- /package/dist/biggive/{p-972e8b70.entry.js.map → p-130c66ba.entry.js.map} +0 -0
- /package/dist/biggive/{p-4d544ada.entry.js.map → p-1668ace9.entry.js.map} +0 -0
- /package/dist/biggive/{p-62791aae.entry.js.map → p-1d9d1fb2.entry.js.map} +0 -0
- /package/dist/biggive/{p-8c6c1385.entry.js.map → p-2baa279c.entry.js.map} +0 -0
- /package/dist/biggive/{p-9f09fec7.entry.js.map → p-372349f5.entry.js.map} +0 -0
- /package/dist/biggive/{p-f0b40214.entry.js.map → p-42a8df24.entry.js.map} +0 -0
- /package/dist/biggive/{p-c964fd9f.entry.js.map → p-4e3802b0.entry.js.map} +0 -0
- /package/dist/biggive/{p-05d6cfa4.entry.js.map → p-64677357.entry.js.map} +0 -0
- /package/dist/biggive/{p-6684c3f7.entry.js.map → p-7c0358ab.entry.js.map} +0 -0
- /package/dist/biggive/{p-14df7401.entry.js.map → p-aefad0be.entry.js.map} +0 -0
- /package/dist/biggive/{p-257dc505.entry.js.map → p-c4222c1b.entry.js.map} +0 -0
- /package/dist/biggive/{p-e2d84fe2.entry.js.map → p-d05e6bf8.entry.js.map} +0 -0
- /package/dist/biggive/{p-f7a53e18.entry.js.map → p-d7f9d076.entry.js.map} +0 -0
- /package/dist/biggive/{p-6eb68ed6.entry.js.map → p-f6ee342f.entry.js.map} +0 -0
- /package/dist/biggive/{p-7459c28f.entry.js.map → p-ff8a3dc2.entry.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -131,7 +131,7 @@ const NAMESPACE = 'biggive';
|
|
|
131
131
|
const BUILD = /* biggive */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: false, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: true, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
132
132
|
|
|
133
133
|
/*
|
|
134
|
-
Stencil Hydrate Platform v4.
|
|
134
|
+
Stencil Hydrate Platform v4.24.0 | MIT Licensed | https://stenciljs.com
|
|
135
135
|
*/
|
|
136
136
|
var __defProp = Object.defineProperty;
|
|
137
137
|
var __export = (target, all) => {
|
|
@@ -224,6 +224,8 @@ var DEFAULT_DOC_DATA = {
|
|
|
224
224
|
staticComponents: /* @__PURE__ */ new Set()
|
|
225
225
|
};
|
|
226
226
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
227
|
+
|
|
228
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
227
229
|
var updateFallbackSlotVisibility = (elm) => {
|
|
228
230
|
const childNodes = elm.__childNodes || elm.childNodes;
|
|
229
231
|
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
@@ -244,20 +246,20 @@ var updateFallbackSlotVisibility = (elm) => {
|
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
248
|
};
|
|
247
|
-
|
|
249
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
248
250
|
let i2 = 0;
|
|
249
251
|
let slottedNodes = [];
|
|
250
252
|
let childNode;
|
|
251
253
|
for (; i2 < childNodes.length; i2++) {
|
|
252
254
|
childNode = childNodes[i2];
|
|
253
|
-
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (
|
|
255
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
|
|
254
256
|
slottedNodes.push(childNode);
|
|
255
257
|
if (typeof slotName !== "undefined") return slottedNodes;
|
|
256
258
|
}
|
|
257
259
|
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
258
260
|
}
|
|
259
261
|
return slottedNodes;
|
|
260
|
-
}
|
|
262
|
+
}
|
|
261
263
|
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
262
264
|
const childNodes = [];
|
|
263
265
|
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
@@ -313,6 +315,20 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
313
315
|
newChild["s-ol"] = slottedNodeLocation;
|
|
314
316
|
newChild["s-sh"] = slotNode["s-hn"];
|
|
315
317
|
};
|
|
318
|
+
var createTime = (fnName, tagName = "") => {
|
|
319
|
+
{
|
|
320
|
+
return () => {
|
|
321
|
+
return;
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
var uniqueTime = (key, measureText) => {
|
|
326
|
+
{
|
|
327
|
+
return () => {
|
|
328
|
+
return;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
};
|
|
316
332
|
var h = (nodeName, vnodeData, ...children) => {
|
|
317
333
|
let child = null;
|
|
318
334
|
let key = null;
|
|
@@ -424,1052 +440,1048 @@ var convertToPrivate = (node) => {
|
|
|
424
440
|
vnode.$name$ = node.vname;
|
|
425
441
|
return vnode;
|
|
426
442
|
};
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
443
|
+
|
|
444
|
+
// src/runtime/client-hydrate.ts
|
|
445
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
446
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
447
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
448
|
+
const childRenderNodes = [];
|
|
449
|
+
const slotNodes = [];
|
|
450
|
+
const slottedNodes = [];
|
|
451
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
452
|
+
const vnode = newVNode(tagName, null);
|
|
453
|
+
vnode.$elm$ = hostElm;
|
|
454
|
+
if (!plt.$orgLocNodes$) {
|
|
455
|
+
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
456
|
+
}
|
|
457
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
458
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
459
|
+
hostRef.$vnode$ = clientHydrate(
|
|
460
|
+
vnode,
|
|
461
|
+
childRenderNodes,
|
|
462
|
+
slotNodes,
|
|
463
|
+
shadowRootNodes,
|
|
464
|
+
hostElm,
|
|
465
|
+
hostElm,
|
|
466
|
+
hostId,
|
|
467
|
+
slottedNodes
|
|
468
|
+
);
|
|
469
|
+
let crIndex = 0;
|
|
470
|
+
const crLength = childRenderNodes.length;
|
|
471
|
+
let childRenderNode;
|
|
472
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
473
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
474
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
475
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
476
|
+
const node = childRenderNode.$elm$;
|
|
477
|
+
if (!shadowRoot) {
|
|
478
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
479
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
480
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
456
481
|
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
482
|
+
}
|
|
483
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
484
|
+
if (childRenderNode.$children$) {
|
|
485
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
486
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
487
|
+
childRenderNode.$children$.forEach((c) => {
|
|
488
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
489
|
+
});
|
|
462
490
|
}
|
|
491
|
+
} else {
|
|
492
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
463
493
|
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
|
|
494
|
+
}
|
|
495
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
496
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
497
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
467
498
|
}
|
|
468
|
-
|
|
469
|
-
if (
|
|
470
|
-
|
|
471
|
-
} else if (isMemberInElement(win, ln)) {
|
|
472
|
-
memberName = ln.slice(2);
|
|
473
|
-
} else {
|
|
474
|
-
memberName = ln[2] + memberName.slice(3);
|
|
499
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
500
|
+
if (!shadowRoot) {
|
|
501
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
475
502
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
503
|
+
}
|
|
504
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
505
|
+
}
|
|
506
|
+
const hosts = [];
|
|
507
|
+
const snLen = slottedNodes.length;
|
|
508
|
+
let snIndex = 0;
|
|
509
|
+
let slotGroup;
|
|
510
|
+
let snGroupIdx;
|
|
511
|
+
let snGroupLen;
|
|
512
|
+
let slottedItem;
|
|
513
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
514
|
+
slotGroup = slottedNodes[snIndex];
|
|
515
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
516
|
+
snGroupLen = slotGroup.length;
|
|
517
|
+
snGroupIdx = 0;
|
|
518
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
519
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
520
|
+
if (!hosts[slottedItem.hostId]) {
|
|
521
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
485
522
|
}
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
if (
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
} else if (oldValue == null || elm[memberName] != n) {
|
|
495
|
-
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
496
|
-
elm[memberName] = n;
|
|
497
|
-
} else {
|
|
498
|
-
elm.setAttribute(memberName, n);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
} else {
|
|
502
|
-
elm[memberName] = newValue;
|
|
503
|
-
}
|
|
504
|
-
} catch (e) {
|
|
523
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
524
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
525
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
526
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
527
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
528
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
529
|
+
} else {
|
|
530
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
505
531
|
}
|
|
532
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
506
533
|
}
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
{
|
|
510
|
-
elm.removeAttribute(memberName);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
514
|
-
newValue = newValue === true ? "" : newValue;
|
|
515
|
-
{
|
|
516
|
-
elm.setAttribute(memberName, newValue);
|
|
517
|
-
}
|
|
534
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
535
|
+
hostEle.appendChild(slottedItem.node);
|
|
518
536
|
}
|
|
519
537
|
}
|
|
520
538
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
527
|
-
if (!value) {
|
|
528
|
-
return [];
|
|
529
|
-
}
|
|
530
|
-
return value.split(parseClassListRegex);
|
|
531
|
-
};
|
|
532
|
-
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
533
|
-
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
534
|
-
|
|
535
|
-
// src/runtime/vdom/update-element.ts
|
|
536
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
537
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
538
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
539
|
-
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
540
|
-
{
|
|
541
|
-
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
542
|
-
if (!(memberName in newVnodeAttrs)) {
|
|
543
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
544
|
-
}
|
|
539
|
+
if (shadowRoot) {
|
|
540
|
+
let rnIdex = 0;
|
|
541
|
+
const rnLen = shadowRootNodes.length;
|
|
542
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
543
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
545
544
|
}
|
|
545
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
546
|
+
if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
|
|
547
|
+
node.parentNode.removeChild(node);
|
|
548
|
+
}
|
|
549
|
+
});
|
|
546
550
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
551
|
+
hostRef.$hostElement$ = hostElm;
|
|
552
|
+
endHydrate();
|
|
550
553
|
};
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
603
|
-
{
|
|
604
|
-
updateElement(null, newVNode2, isSvgMode);
|
|
605
|
-
}
|
|
606
|
-
if (newVNode2.$children$) {
|
|
607
|
-
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
608
|
-
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
609
|
-
if (childNode) {
|
|
610
|
-
elm.appendChild(childNode);
|
|
554
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
555
|
+
let childNodeType;
|
|
556
|
+
let childIdSplt;
|
|
557
|
+
let childVNode;
|
|
558
|
+
let i2;
|
|
559
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
560
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
561
|
+
if (childNodeType) {
|
|
562
|
+
childIdSplt = childNodeType.split(".");
|
|
563
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
564
|
+
childVNode = createSimpleVNode({
|
|
565
|
+
$flags$: 0,
|
|
566
|
+
$hostId$: childIdSplt[0],
|
|
567
|
+
$nodeId$: childIdSplt[1],
|
|
568
|
+
$depth$: childIdSplt[2],
|
|
569
|
+
$index$: childIdSplt[3],
|
|
570
|
+
$tag$: node.tagName.toLowerCase(),
|
|
571
|
+
$elm$: node,
|
|
572
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
573
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
574
|
+
$attrs$: { class: node.className || "" }
|
|
575
|
+
});
|
|
576
|
+
childRenderNodes.push(childVNode);
|
|
577
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
578
|
+
if (!parentVNode.$children$) {
|
|
579
|
+
parentVNode.$children$ = [];
|
|
580
|
+
}
|
|
581
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
582
|
+
if (typeof slotName === "string") {
|
|
583
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
584
|
+
addSlot(
|
|
585
|
+
slotName,
|
|
586
|
+
childIdSplt[2],
|
|
587
|
+
childVNode,
|
|
588
|
+
node,
|
|
589
|
+
parentVNode,
|
|
590
|
+
childRenderNodes,
|
|
591
|
+
slotNodes,
|
|
592
|
+
shadowRootNodes,
|
|
593
|
+
slottedNodes
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
597
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
598
|
+
}
|
|
599
|
+
if (childVNode.$index$ !== void 0) {
|
|
600
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
601
|
+
}
|
|
602
|
+
parentVNode = childVNode;
|
|
603
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
604
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
611
605
|
}
|
|
612
606
|
}
|
|
613
607
|
}
|
|
614
|
-
{
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
608
|
+
if (node.shadowRoot) {
|
|
609
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
610
|
+
clientHydrate(
|
|
611
|
+
parentVNode,
|
|
612
|
+
childRenderNodes,
|
|
613
|
+
slotNodes,
|
|
614
|
+
shadowRootNodes,
|
|
615
|
+
hostElm,
|
|
616
|
+
node.shadowRoot.childNodes[i2],
|
|
617
|
+
hostId,
|
|
618
|
+
slottedNodes
|
|
619
|
+
);
|
|
619
620
|
}
|
|
620
621
|
}
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
622
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
623
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
624
|
+
clientHydrate(
|
|
625
|
+
parentVNode,
|
|
626
|
+
childRenderNodes,
|
|
627
|
+
slotNodes,
|
|
628
|
+
shadowRootNodes,
|
|
629
|
+
hostElm,
|
|
630
|
+
nonShadowNodes[i2],
|
|
631
|
+
hostId,
|
|
632
|
+
slottedNodes
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
636
|
+
childIdSplt = node.nodeValue.split(".");
|
|
637
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
638
|
+
childNodeType = childIdSplt[0];
|
|
639
|
+
childVNode = createSimpleVNode({
|
|
640
|
+
$hostId$: childIdSplt[1],
|
|
641
|
+
$nodeId$: childIdSplt[2],
|
|
642
|
+
$depth$: childIdSplt[3],
|
|
643
|
+
$index$: childIdSplt[4] || "0",
|
|
644
|
+
$elm$: node,
|
|
645
|
+
$attrs$: null,
|
|
646
|
+
$children$: null,
|
|
647
|
+
$key$: null,
|
|
648
|
+
$name$: null,
|
|
649
|
+
$tag$: null,
|
|
650
|
+
$text$: null
|
|
651
|
+
});
|
|
652
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
653
|
+
childVNode.$elm$ = node.nextSibling;
|
|
654
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
655
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
656
|
+
childRenderNodes.push(childVNode);
|
|
657
|
+
node.remove();
|
|
658
|
+
if (hostId === childVNode.$hostId$) {
|
|
659
|
+
if (!parentVNode.$children$) {
|
|
660
|
+
parentVNode.$children$ = [];
|
|
661
|
+
}
|
|
662
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
663
|
+
}
|
|
664
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
665
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
669
|
+
childVNode.$elm$ = node.nextSibling;
|
|
670
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
671
|
+
childRenderNodes.push(childVNode);
|
|
672
|
+
node.remove();
|
|
673
|
+
}
|
|
674
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
675
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
676
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
677
|
+
addSlot(
|
|
678
|
+
slotName,
|
|
679
|
+
childIdSplt[2],
|
|
680
|
+
childVNode,
|
|
681
|
+
node,
|
|
682
|
+
parentVNode,
|
|
683
|
+
childRenderNodes,
|
|
684
|
+
slotNodes,
|
|
685
|
+
shadowRootNodes,
|
|
686
|
+
slottedNodes
|
|
687
|
+
);
|
|
688
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
689
|
+
if (shadowRootNodes) {
|
|
690
|
+
node.remove();
|
|
691
|
+
} else {
|
|
692
|
+
hostElm["s-cr"] = node;
|
|
693
|
+
node["s-cn"] = true;
|
|
694
|
+
}
|
|
633
695
|
}
|
|
634
696
|
}
|
|
635
697
|
}
|
|
698
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
699
|
+
const vnode = newVNode(null, node.textContent);
|
|
700
|
+
vnode.$elm$ = node;
|
|
701
|
+
vnode.$index$ = "0";
|
|
702
|
+
parentVNode.$children$ = [vnode];
|
|
636
703
|
}
|
|
637
|
-
return
|
|
704
|
+
return parentVNode;
|
|
638
705
|
};
|
|
639
|
-
var
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
while (node = node.nextSibling) {
|
|
645
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
646
|
-
oldSlotChildNodes.push(node);
|
|
647
|
-
}
|
|
706
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
707
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
708
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
709
|
+
if (componentId) {
|
|
710
|
+
orgLocNodes.set(componentId, node);
|
|
648
711
|
}
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
childNode["s-ol"].remove();
|
|
655
|
-
childNode["s-ol"] = void 0;
|
|
656
|
-
childNode["s-sh"] = void 0;
|
|
657
|
-
checkSlotRelocate = true;
|
|
712
|
+
let i2 = 0;
|
|
713
|
+
if (node.shadowRoot) {
|
|
714
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
715
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
716
|
+
}
|
|
658
717
|
}
|
|
659
|
-
|
|
660
|
-
|
|
718
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
719
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
720
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
661
721
|
}
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
669
|
-
containerElm = containerElm.shadowRoot;
|
|
670
|
-
}
|
|
671
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
672
|
-
if (vnodes[startIdx]) {
|
|
673
|
-
childNode = createElm(null, parentVNode, startIdx);
|
|
674
|
-
if (childNode) {
|
|
675
|
-
vnodes[startIdx].$elm$ = childNode;
|
|
676
|
-
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
677
|
-
}
|
|
722
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
723
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
724
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
725
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
726
|
+
node.nodeValue = "";
|
|
727
|
+
node["s-en"] = childIdSplt[3];
|
|
678
728
|
}
|
|
679
729
|
}
|
|
680
730
|
};
|
|
681
|
-
var
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
731
|
+
var createSimpleVNode = (vnode) => {
|
|
732
|
+
const defaultVNode = {
|
|
733
|
+
$flags$: 0,
|
|
734
|
+
$hostId$: null,
|
|
735
|
+
$nodeId$: null,
|
|
736
|
+
$depth$: null,
|
|
737
|
+
$index$: "0",
|
|
738
|
+
$elm$: null,
|
|
739
|
+
$attrs$: null,
|
|
740
|
+
$children$: null,
|
|
741
|
+
$key$: null,
|
|
742
|
+
$name$: null,
|
|
743
|
+
$tag$: null,
|
|
744
|
+
$text$: null
|
|
745
|
+
};
|
|
746
|
+
return { ...defaultVNode, ...vnode };
|
|
700
747
|
};
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
let elmToMove;
|
|
714
|
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
715
|
-
if (oldStartVnode == null) {
|
|
716
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
717
|
-
} else if (oldEndVnode == null) {
|
|
718
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
719
|
-
} else if (newStartVnode == null) {
|
|
720
|
-
newStartVnode = newCh[++newStartIdx];
|
|
721
|
-
} else if (newEndVnode == null) {
|
|
722
|
-
newEndVnode = newCh[--newEndIdx];
|
|
723
|
-
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
724
|
-
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
725
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
726
|
-
newStartVnode = newCh[++newStartIdx];
|
|
727
|
-
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
728
|
-
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
729
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
730
|
-
newEndVnode = newCh[--newEndIdx];
|
|
731
|
-
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
732
|
-
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
733
|
-
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
734
|
-
}
|
|
735
|
-
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
736
|
-
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
737
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
738
|
-
newEndVnode = newCh[--newEndIdx];
|
|
739
|
-
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
740
|
-
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
741
|
-
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
742
|
-
}
|
|
743
|
-
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
744
|
-
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
745
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
746
|
-
newStartVnode = newCh[++newStartIdx];
|
|
748
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
749
|
+
node["s-sr"] = true;
|
|
750
|
+
childVNode.$name$ = slotName || null;
|
|
751
|
+
childVNode.$tag$ = "slot";
|
|
752
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
753
|
+
if (shadowRootNodes) {
|
|
754
|
+
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
755
|
+
if (childVNode.$name$) {
|
|
756
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
757
|
+
}
|
|
758
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
759
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
747
760
|
} else {
|
|
748
|
-
|
|
749
|
-
{
|
|
750
|
-
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
751
|
-
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
752
|
-
idxInOld = i2;
|
|
753
|
-
break;
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
if (idxInOld >= 0) {
|
|
758
|
-
elmToMove = oldCh[idxInOld];
|
|
759
|
-
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
760
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
761
|
-
} else {
|
|
762
|
-
patch(elmToMove, newStartVnode, isInitialRender);
|
|
763
|
-
oldCh[idxInOld] = void 0;
|
|
764
|
-
node = elmToMove.$elm$;
|
|
765
|
-
}
|
|
766
|
-
newStartVnode = newCh[++newStartIdx];
|
|
767
|
-
} else {
|
|
768
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
769
|
-
newStartVnode = newCh[++newStartIdx];
|
|
770
|
-
}
|
|
771
|
-
if (node) {
|
|
772
|
-
{
|
|
773
|
-
insertBefore(
|
|
774
|
-
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
775
|
-
node,
|
|
776
|
-
referenceNode(oldStartVnode.$elm$)
|
|
777
|
-
);
|
|
778
|
-
}
|
|
779
|
-
}
|
|
761
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
780
762
|
}
|
|
763
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
764
|
+
node.remove();
|
|
765
|
+
if (childVNode.$depth$ === "0") {
|
|
766
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
767
|
+
}
|
|
768
|
+
} else {
|
|
769
|
+
const slot = childVNode.$elm$;
|
|
770
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
771
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
772
|
+
if (shouldMove) {
|
|
773
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
774
|
+
}
|
|
775
|
+
childRenderNodes.push(childVNode);
|
|
781
776
|
}
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
777
|
+
slotNodes.push(childVNode);
|
|
778
|
+
if (!parentVNode.$children$) {
|
|
779
|
+
parentVNode.$children$ = [];
|
|
780
|
+
}
|
|
781
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
782
|
+
}
|
|
783
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
784
|
+
let slottedNode = slotNode.nextSibling;
|
|
785
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
786
|
+
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
787
|
+
slottedNode["s-sn"] = slotName;
|
|
788
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
789
|
+
slottedNode = slottedNode.nextSibling;
|
|
793
790
|
}
|
|
794
791
|
};
|
|
795
|
-
var
|
|
796
|
-
if (
|
|
797
|
-
if (
|
|
798
|
-
return
|
|
792
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
793
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
794
|
+
if (propType & 4 /* Boolean */) {
|
|
795
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
799
796
|
}
|
|
800
|
-
if (
|
|
801
|
-
return
|
|
797
|
+
if (propType & 2 /* Number */) {
|
|
798
|
+
return parseFloat(propValue);
|
|
802
799
|
}
|
|
803
|
-
if (
|
|
804
|
-
|
|
800
|
+
if (propType & 1 /* String */) {
|
|
801
|
+
return String(propValue);
|
|
805
802
|
}
|
|
806
|
-
return
|
|
803
|
+
return propValue;
|
|
807
804
|
}
|
|
808
|
-
return
|
|
805
|
+
return propValue;
|
|
809
806
|
};
|
|
810
|
-
var
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
807
|
+
var getElement = (ref) => getHostRef(ref).$hostElement$ ;
|
|
808
|
+
|
|
809
|
+
// src/runtime/event-emitter.ts
|
|
810
|
+
var createEvent = (ref, name, flags) => {
|
|
811
|
+
const elm = getElement(ref);
|
|
812
|
+
return {
|
|
813
|
+
emit: (detail) => {
|
|
814
|
+
return emitEvent(elm, name, {
|
|
815
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
816
|
+
composed: !!(flags & 2 /* Composed */),
|
|
817
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
818
|
+
detail
|
|
819
|
+
});
|
|
821
820
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
var emitEvent = (elm, name, opts) => {
|
|
824
|
+
const ev = plt.ce(name, opts);
|
|
825
|
+
elm.dispatchEvent(ev);
|
|
826
|
+
return ev;
|
|
827
|
+
};
|
|
828
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
829
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
830
|
+
let style = styles.get(scopeId2);
|
|
831
|
+
{
|
|
832
|
+
style = cssText;
|
|
833
|
+
}
|
|
834
|
+
styles.set(scopeId2, style);
|
|
835
|
+
};
|
|
836
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
837
|
+
var _a;
|
|
838
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
839
|
+
const style = styles.get(scopeId2);
|
|
840
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
841
|
+
if (style) {
|
|
842
|
+
if (typeof style === "string") {
|
|
843
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
844
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
845
|
+
let styleElm;
|
|
846
|
+
if (!appliedStyles) {
|
|
847
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
825
848
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
849
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
850
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
851
|
+
styleElm.innerHTML = style;
|
|
852
|
+
} else {
|
|
853
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
854
|
+
styleElm.innerHTML = style;
|
|
855
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
856
|
+
if (nonce != null) {
|
|
857
|
+
styleElm.setAttribute("nonce", nonce);
|
|
858
|
+
}
|
|
859
|
+
if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
860
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
861
|
+
}
|
|
862
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
863
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
864
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
865
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
866
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
867
|
+
} else if ("host" in styleContainerNode) {
|
|
868
|
+
{
|
|
869
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
870
|
+
if (existingStyleContainer) {
|
|
871
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
872
|
+
} else {
|
|
873
|
+
styleContainerNode.prepend(styleElm);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
} else {
|
|
877
|
+
styleContainerNode.append(styleElm);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
881
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
885
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
886
|
+
}
|
|
887
|
+
if (appliedStyles) {
|
|
888
|
+
appliedStyles.add(scopeId2);
|
|
889
|
+
}
|
|
832
890
|
}
|
|
833
|
-
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
834
|
-
} else if (
|
|
835
|
-
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
836
|
-
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
837
|
-
) {
|
|
838
|
-
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
839
891
|
}
|
|
840
|
-
if (isSvgMode && tag === "svg") {
|
|
841
|
-
isSvgMode = false;
|
|
842
|
-
}
|
|
843
|
-
} else if ((defaultHolder = elm["s-cr"])) {
|
|
844
|
-
defaultHolder.parentNode.textContent = text;
|
|
845
|
-
} else if (oldVNode.$text$ !== text) {
|
|
846
|
-
elm.data = text;
|
|
847
892
|
}
|
|
893
|
+
return scopeId2;
|
|
848
894
|
};
|
|
849
|
-
var
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
895
|
+
var attachStyles = (hostRef) => {
|
|
896
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
897
|
+
const elm = hostRef.$hostElement$;
|
|
898
|
+
const flags = cmpMeta.$flags$;
|
|
899
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
900
|
+
const scopeId2 = addStyle(
|
|
901
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
902
|
+
cmpMeta);
|
|
903
|
+
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
904
|
+
elm["s-sc"] = scopeId2;
|
|
905
|
+
elm.classList.add(scopeId2 + "-h");
|
|
906
|
+
}
|
|
907
|
+
endAttachStyles();
|
|
908
|
+
};
|
|
909
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
910
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
911
|
+
if (oldValue !== newValue) {
|
|
912
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
913
|
+
let ln = memberName.toLowerCase();
|
|
914
|
+
if (memberName === "class") {
|
|
915
|
+
const classList = elm.classList;
|
|
916
|
+
const oldClasses = parseClassList(oldValue);
|
|
917
|
+
let newClasses = parseClassList(newValue);
|
|
918
|
+
if (elm["s-si"]) {
|
|
919
|
+
newClasses.push(elm["s-si"]);
|
|
920
|
+
oldClasses.forEach((c) => {
|
|
921
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
922
|
+
});
|
|
923
|
+
newClasses = [...new Set(newClasses)];
|
|
924
|
+
classList.add(...newClasses);
|
|
925
|
+
delete elm["s-si"];
|
|
926
|
+
} else {
|
|
927
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
928
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
929
|
+
}
|
|
930
|
+
} else if (memberName === "style") {
|
|
931
|
+
{
|
|
932
|
+
for (const prop in oldValue) {
|
|
933
|
+
if (!newValue || newValue[prop] == null) {
|
|
934
|
+
{
|
|
935
|
+
elm.style[prop] = "";
|
|
885
936
|
}
|
|
886
|
-
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
887
|
-
relocateNodes.push({
|
|
888
|
-
$nodeToRelocate$: node
|
|
889
|
-
});
|
|
890
937
|
}
|
|
891
938
|
}
|
|
892
939
|
}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}
|
|
899
|
-
var nullifyVNodeRefs = (vNode) => {
|
|
900
|
-
{
|
|
901
|
-
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
902
|
-
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
903
|
-
}
|
|
904
|
-
};
|
|
905
|
-
var insertBefore = (parent, newNode, reference) => {
|
|
906
|
-
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
907
|
-
return inserted;
|
|
908
|
-
};
|
|
909
|
-
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
910
|
-
var _c, _d;
|
|
911
|
-
const hostElm = hostRef.$hostElement$;
|
|
912
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
913
|
-
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
914
|
-
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
915
|
-
hostTagName = hostElm.tagName;
|
|
916
|
-
if (isInitialLoad && rootVnode.$attrs$) {
|
|
917
|
-
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
918
|
-
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
919
|
-
rootVnode.$attrs$[key] = hostElm[key];
|
|
940
|
+
for (const prop in newValue) {
|
|
941
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
942
|
+
{
|
|
943
|
+
elm.style[prop] = newValue[prop];
|
|
944
|
+
}
|
|
945
|
+
}
|
|
920
946
|
}
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
if (
|
|
940
|
-
|
|
941
|
-
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
942
|
-
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
947
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
948
|
+
if (newValue) {
|
|
949
|
+
newValue(elm);
|
|
950
|
+
}
|
|
951
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
952
|
+
if (memberName[2] === "-") {
|
|
953
|
+
memberName = memberName.slice(3);
|
|
954
|
+
} else if (isMemberInElement(win, ln)) {
|
|
955
|
+
memberName = ln.slice(2);
|
|
956
|
+
} else {
|
|
957
|
+
memberName = ln[2] + memberName.slice(3);
|
|
958
|
+
}
|
|
959
|
+
if (oldValue || newValue) {
|
|
960
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
961
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
962
|
+
if (oldValue) {
|
|
963
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
964
|
+
}
|
|
965
|
+
if (newValue) {
|
|
966
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
943
967
|
}
|
|
944
968
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
969
|
+
} else {
|
|
970
|
+
const isComplex = isComplexType(newValue);
|
|
971
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
972
|
+
try {
|
|
973
|
+
if (!elm.tagName.includes("-")) {
|
|
974
|
+
const n = newValue == null ? "" : newValue;
|
|
975
|
+
if (memberName === "list") {
|
|
976
|
+
isProp = false;
|
|
977
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
978
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
979
|
+
elm[memberName] = n;
|
|
980
|
+
} else {
|
|
981
|
+
elm.setAttribute(memberName, n);
|
|
959
982
|
}
|
|
960
983
|
}
|
|
984
|
+
} else if (elm[memberName] !== newValue) {
|
|
985
|
+
elm[memberName] = newValue;
|
|
961
986
|
}
|
|
962
|
-
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
987
|
+
} catch (e) {
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if (newValue == null || newValue === false) {
|
|
991
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
992
|
+
{
|
|
993
|
+
elm.removeAttribute(memberName);
|
|
969
994
|
}
|
|
970
995
|
}
|
|
996
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
997
|
+
newValue = newValue === true ? "" : newValue;
|
|
998
|
+
{
|
|
999
|
+
elm.setAttribute(memberName, newValue);
|
|
1000
|
+
}
|
|
971
1001
|
}
|
|
972
1002
|
}
|
|
973
|
-
if (checkSlotFallbackVisibility) {
|
|
974
|
-
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
975
|
-
}
|
|
976
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
977
|
-
relocateNodes.length = 0;
|
|
978
1003
|
}
|
|
979
|
-
contentRef = void 0;
|
|
980
1004
|
};
|
|
981
|
-
var
|
|
982
|
-
|
|
983
|
-
)
|
|
984
|
-
|
|
985
|
-
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
986
|
-
);
|
|
987
|
-
var createTime = (fnName, tagName = "") => {
|
|
988
|
-
{
|
|
989
|
-
return () => {
|
|
990
|
-
return;
|
|
991
|
-
};
|
|
1005
|
+
var parseClassListRegex = /\s/;
|
|
1006
|
+
var parseClassList = (value) => {
|
|
1007
|
+
if (typeof value === "object" && "baseVal" in value) {
|
|
1008
|
+
value = value.baseVal;
|
|
992
1009
|
}
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
{
|
|
996
|
-
return () => {
|
|
997
|
-
return;
|
|
998
|
-
};
|
|
1010
|
+
if (!value) {
|
|
1011
|
+
return [];
|
|
999
1012
|
}
|
|
1013
|
+
return value.split(parseClassListRegex);
|
|
1000
1014
|
};
|
|
1015
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
1016
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
1001
1017
|
|
|
1002
|
-
// src/runtime/
|
|
1003
|
-
var
|
|
1004
|
-
const
|
|
1005
|
-
const
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1018
|
+
// src/runtime/vdom/update-element.ts
|
|
1019
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
1020
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1021
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1022
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
1023
|
+
{
|
|
1024
|
+
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1025
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
1026
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1014
1029
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1030
|
+
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
1031
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
function sortedAttrNames(attrNames) {
|
|
1035
|
+
return attrNames.includes("ref") ? (
|
|
1036
|
+
// we need to sort these to ensure that `'ref'` is the last attr
|
|
1037
|
+
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
1038
|
+
) : (
|
|
1039
|
+
// no need to sort, return the original array
|
|
1040
|
+
attrNames
|
|
1026
1041
|
);
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1042
|
+
}
|
|
1043
|
+
var contentRef;
|
|
1044
|
+
var hostTagName;
|
|
1045
|
+
var useNativeShadowDom = false;
|
|
1046
|
+
var checkSlotFallbackVisibility = false;
|
|
1047
|
+
var checkSlotRelocate = false;
|
|
1048
|
+
var isSvgMode = false;
|
|
1049
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
1050
|
+
var _a;
|
|
1051
|
+
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
1052
|
+
let i2 = 0;
|
|
1053
|
+
let elm;
|
|
1054
|
+
let childNode;
|
|
1055
|
+
let oldVNode;
|
|
1056
|
+
if (!useNativeShadowDom) {
|
|
1057
|
+
checkSlotRelocate = true;
|
|
1058
|
+
if (newVNode2.$tag$ === "slot") {
|
|
1059
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
1060
|
+
// slot element has fallback content
|
|
1061
|
+
// still create an element that "mocks" the slot element
|
|
1062
|
+
2 /* isSlotFallback */
|
|
1063
|
+
) : (
|
|
1064
|
+
// slot element does not have fallback content
|
|
1065
|
+
// create an html comment we'll use to always reference
|
|
1066
|
+
// where actual slot content should sit next to
|
|
1067
|
+
1 /* isSlotReference */
|
|
1068
|
+
);
|
|
1040
1069
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1070
|
+
}
|
|
1071
|
+
if (newVNode2.$text$ !== null) {
|
|
1072
|
+
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1073
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
1074
|
+
elm = newVNode2.$elm$ = slotReferenceDebugNode(newVNode2) ;
|
|
1075
|
+
} else {
|
|
1076
|
+
if (!isSvgMode) {
|
|
1077
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1078
|
+
}
|
|
1079
|
+
elm = newVNode2.$elm$ = doc.createElementNS(
|
|
1080
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
1081
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1082
|
+
) ;
|
|
1083
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1084
|
+
isSvgMode = false;
|
|
1085
|
+
}
|
|
1086
|
+
{
|
|
1087
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
1088
|
+
}
|
|
1089
|
+
if (newVNode2.$children$) {
|
|
1090
|
+
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
1091
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
1092
|
+
if (childNode) {
|
|
1093
|
+
elm.appendChild(childNode);
|
|
1048
1094
|
}
|
|
1049
|
-
} else {
|
|
1050
|
-
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1051
1095
|
}
|
|
1052
1096
|
}
|
|
1053
|
-
|
|
1054
|
-
if (
|
|
1055
|
-
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
if (!shadowRoot) {
|
|
1059
|
-
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1097
|
+
{
|
|
1098
|
+
if (newVNode2.$tag$ === "svg") {
|
|
1099
|
+
isSvgMode = false;
|
|
1100
|
+
} else if (elm.tagName === "foreignObject") {
|
|
1101
|
+
isSvgMode = true;
|
|
1060
1102
|
}
|
|
1061
1103
|
}
|
|
1062
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1063
1104
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
snGroupIdx = 0;
|
|
1076
|
-
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
1077
|
-
slottedItem = slotGroup[snGroupIdx];
|
|
1078
|
-
if (!hosts[slottedItem.hostId]) {
|
|
1079
|
-
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
1080
|
-
}
|
|
1081
|
-
if (!hosts[slottedItem.hostId]) continue;
|
|
1082
|
-
const hostEle = hosts[slottedItem.hostId];
|
|
1083
|
-
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1084
|
-
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1085
|
-
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1086
|
-
slottedItem.slot["s-cr"] = hostEle;
|
|
1087
|
-
} else {
|
|
1088
|
-
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1105
|
+
elm["s-hn"] = hostTagName;
|
|
1106
|
+
{
|
|
1107
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1108
|
+
elm["s-sr"] = true;
|
|
1109
|
+
elm["s-cr"] = contentRef;
|
|
1110
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
1111
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1112
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1113
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1114
|
+
{
|
|
1115
|
+
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
1089
1116
|
}
|
|
1090
|
-
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1091
1117
|
}
|
|
1092
|
-
|
|
1093
|
-
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
return elm;
|
|
1121
|
+
};
|
|
1122
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1123
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1124
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1125
|
+
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
1126
|
+
let node = parentElm;
|
|
1127
|
+
while (node = node.nextSibling) {
|
|
1128
|
+
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
1129
|
+
oldSlotChildNodes.push(node);
|
|
1094
1130
|
}
|
|
1095
1131
|
}
|
|
1096
1132
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1133
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
1134
|
+
const childNode = oldSlotChildNodes[i2];
|
|
1135
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
1136
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
1137
|
+
childNode["s-ol"].remove();
|
|
1138
|
+
childNode["s-ol"] = void 0;
|
|
1139
|
+
childNode["s-sh"] = void 0;
|
|
1140
|
+
checkSlotRelocate = true;
|
|
1141
|
+
}
|
|
1142
|
+
if (recursive) {
|
|
1143
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
1102
1144
|
}
|
|
1103
|
-
Array.from(hostElm.childNodes).forEach((node) => {
|
|
1104
|
-
if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
|
|
1105
|
-
node.parentNode.removeChild(node);
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
1145
|
}
|
|
1109
|
-
|
|
1110
|
-
endHydrate();
|
|
1146
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1111
1147
|
};
|
|
1112
|
-
var
|
|
1113
|
-
let
|
|
1114
|
-
let
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
if (
|
|
1120
|
-
|
|
1121
|
-
if (
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
$hostId$: childIdSplt[0],
|
|
1125
|
-
$nodeId$: childIdSplt[1],
|
|
1126
|
-
$depth$: childIdSplt[2],
|
|
1127
|
-
$index$: childIdSplt[3],
|
|
1128
|
-
$tag$: node.tagName.toLowerCase(),
|
|
1129
|
-
$elm$: node,
|
|
1130
|
-
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1131
|
-
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1132
|
-
$attrs$: { class: node.className || "" }
|
|
1133
|
-
});
|
|
1134
|
-
childRenderNodes.push(childVNode);
|
|
1135
|
-
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1136
|
-
if (!parentVNode.$children$) {
|
|
1137
|
-
parentVNode.$children$ = [];
|
|
1138
|
-
}
|
|
1139
|
-
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1140
|
-
if (typeof slotName === "string") {
|
|
1141
|
-
if (childVNode.$tag$ === "slot-fb") {
|
|
1142
|
-
addSlot(
|
|
1143
|
-
slotName,
|
|
1144
|
-
childIdSplt[2],
|
|
1145
|
-
childVNode,
|
|
1146
|
-
node,
|
|
1147
|
-
parentVNode,
|
|
1148
|
-
childRenderNodes,
|
|
1149
|
-
slotNodes,
|
|
1150
|
-
shadowRootNodes,
|
|
1151
|
-
slottedNodes
|
|
1152
|
-
);
|
|
1153
|
-
}
|
|
1154
|
-
childVNode.$elm$["s-sn"] = slotName;
|
|
1155
|
-
childVNode.$elm$.removeAttribute("s-sn");
|
|
1156
|
-
}
|
|
1157
|
-
if (childVNode.$index$ !== void 0) {
|
|
1158
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1159
|
-
}
|
|
1160
|
-
parentVNode = childVNode;
|
|
1161
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1162
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
}
|
|
1166
|
-
if (node.shadowRoot) {
|
|
1167
|
-
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
1168
|
-
clientHydrate(
|
|
1169
|
-
parentVNode,
|
|
1170
|
-
childRenderNodes,
|
|
1171
|
-
slotNodes,
|
|
1172
|
-
shadowRootNodes,
|
|
1173
|
-
hostElm,
|
|
1174
|
-
node.shadowRoot.childNodes[i2],
|
|
1175
|
-
hostId,
|
|
1176
|
-
slottedNodes
|
|
1177
|
-
);
|
|
1148
|
+
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1149
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1150
|
+
let childNode;
|
|
1151
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1152
|
+
containerElm = containerElm.shadowRoot;
|
|
1153
|
+
}
|
|
1154
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
1155
|
+
if (vnodes[startIdx]) {
|
|
1156
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
1157
|
+
if (childNode) {
|
|
1158
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
1159
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
1178
1160
|
}
|
|
1179
1161
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
1196
|
-
childNodeType = childIdSplt[0];
|
|
1197
|
-
childVNode = createSimpleVNode({
|
|
1198
|
-
$hostId$: childIdSplt[1],
|
|
1199
|
-
$nodeId$: childIdSplt[2],
|
|
1200
|
-
$depth$: childIdSplt[3],
|
|
1201
|
-
$index$: childIdSplt[4] || "0",
|
|
1202
|
-
$elm$: node,
|
|
1203
|
-
$attrs$: null,
|
|
1204
|
-
$children$: null,
|
|
1205
|
-
$key$: null,
|
|
1206
|
-
$name$: null,
|
|
1207
|
-
$tag$: null,
|
|
1208
|
-
$text$: null
|
|
1209
|
-
});
|
|
1210
|
-
if (childNodeType === TEXT_NODE_ID) {
|
|
1211
|
-
childVNode.$elm$ = node.nextSibling;
|
|
1212
|
-
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
1213
|
-
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
1214
|
-
childRenderNodes.push(childVNode);
|
|
1215
|
-
node.remove();
|
|
1216
|
-
if (hostId === childVNode.$hostId$) {
|
|
1217
|
-
if (!parentVNode.$children$) {
|
|
1218
|
-
parentVNode.$children$ = [];
|
|
1219
|
-
}
|
|
1220
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
1165
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
1166
|
+
const vnode = vnodes[index];
|
|
1167
|
+
if (vnode) {
|
|
1168
|
+
const elm = vnode.$elm$;
|
|
1169
|
+
nullifyVNodeRefs(vnode);
|
|
1170
|
+
if (elm) {
|
|
1171
|
+
{
|
|
1172
|
+
checkSlotFallbackVisibility = true;
|
|
1173
|
+
if (elm["s-ol"]) {
|
|
1174
|
+
elm["s-ol"].remove();
|
|
1175
|
+
} else {
|
|
1176
|
+
putBackInOriginalLocation(elm, true);
|
|
1221
1177
|
}
|
|
1222
|
-
|
|
1223
|
-
|
|
1178
|
+
}
|
|
1179
|
+
elm.remove();
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
|
|
1185
|
+
let oldStartIdx = 0;
|
|
1186
|
+
let newStartIdx = 0;
|
|
1187
|
+
let idxInOld = 0;
|
|
1188
|
+
let i2 = 0;
|
|
1189
|
+
let oldEndIdx = oldCh.length - 1;
|
|
1190
|
+
let oldStartVnode = oldCh[0];
|
|
1191
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
1192
|
+
let newEndIdx = newCh.length - 1;
|
|
1193
|
+
let newStartVnode = newCh[0];
|
|
1194
|
+
let newEndVnode = newCh[newEndIdx];
|
|
1195
|
+
let node;
|
|
1196
|
+
let elmToMove;
|
|
1197
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
1198
|
+
if (oldStartVnode == null) {
|
|
1199
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1200
|
+
} else if (oldEndVnode == null) {
|
|
1201
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1202
|
+
} else if (newStartVnode == null) {
|
|
1203
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1204
|
+
} else if (newEndVnode == null) {
|
|
1205
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1206
|
+
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
1207
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
1208
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1209
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1210
|
+
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
1211
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
1212
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1213
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1214
|
+
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1215
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1216
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1217
|
+
}
|
|
1218
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
1219
|
+
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
1220
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1221
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1222
|
+
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1223
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1224
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1225
|
+
}
|
|
1226
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
1227
|
+
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
1228
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1229
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1230
|
+
} else {
|
|
1231
|
+
idxInOld = -1;
|
|
1232
|
+
{
|
|
1233
|
+
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1234
|
+
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1235
|
+
idxInOld = i2;
|
|
1236
|
+
break;
|
|
1224
1237
|
}
|
|
1225
1238
|
}
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
node
|
|
1239
|
+
}
|
|
1240
|
+
if (idxInOld >= 0) {
|
|
1241
|
+
elmToMove = oldCh[idxInOld];
|
|
1242
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1243
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
1244
|
+
} else {
|
|
1245
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1246
|
+
oldCh[idxInOld] = void 0;
|
|
1247
|
+
node = elmToMove.$elm$;
|
|
1231
1248
|
}
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1249
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1250
|
+
} else {
|
|
1251
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
1252
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1253
|
+
}
|
|
1254
|
+
if (node) {
|
|
1255
|
+
{
|
|
1256
|
+
insertBefore(
|
|
1257
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1239
1258
|
node,
|
|
1240
|
-
|
|
1241
|
-
childRenderNodes,
|
|
1242
|
-
slotNodes,
|
|
1243
|
-
shadowRootNodes,
|
|
1244
|
-
slottedNodes
|
|
1259
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1245
1260
|
);
|
|
1246
|
-
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1247
|
-
if (shadowRootNodes) {
|
|
1248
|
-
node.remove();
|
|
1249
|
-
} else {
|
|
1250
|
-
hostElm["s-cr"] = node;
|
|
1251
|
-
node["s-cn"] = true;
|
|
1252
|
-
}
|
|
1253
1261
|
}
|
|
1254
1262
|
}
|
|
1255
1263
|
}
|
|
1256
|
-
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1257
|
-
const vnode = newVNode(null, node.textContent);
|
|
1258
|
-
vnode.$elm$ = node;
|
|
1259
|
-
vnode.$index$ = "0";
|
|
1260
|
-
parentVNode.$children$ = [vnode];
|
|
1261
1264
|
}
|
|
1262
|
-
|
|
1265
|
+
if (oldStartIdx > oldEndIdx) {
|
|
1266
|
+
addVnodes(
|
|
1267
|
+
parentElm,
|
|
1268
|
+
newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
|
|
1269
|
+
newVNode2,
|
|
1270
|
+
newCh,
|
|
1271
|
+
newStartIdx,
|
|
1272
|
+
newEndIdx
|
|
1273
|
+
);
|
|
1274
|
+
} else if (newStartIdx > newEndIdx) {
|
|
1275
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1276
|
+
}
|
|
1263
1277
|
};
|
|
1264
|
-
var
|
|
1265
|
-
if (
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
orgLocNodes.set(componentId, node);
|
|
1269
|
-
}
|
|
1270
|
-
let i2 = 0;
|
|
1271
|
-
if (node.shadowRoot) {
|
|
1272
|
-
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
1273
|
-
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
1274
|
-
}
|
|
1278
|
+
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1279
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1280
|
+
if (leftVNode.$tag$ === "slot") {
|
|
1281
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
1275
1282
|
}
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
1283
|
+
if (!isInitialRender) {
|
|
1284
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
1279
1285
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
1283
|
-
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
1284
|
-
node.nodeValue = "";
|
|
1285
|
-
node["s-en"] = childIdSplt[3];
|
|
1286
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1287
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1286
1288
|
}
|
|
1289
|
+
return true;
|
|
1287
1290
|
}
|
|
1291
|
+
return false;
|
|
1288
1292
|
};
|
|
1289
|
-
var
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
$name$: null,
|
|
1301
|
-
$tag$: null,
|
|
1302
|
-
$text$: null
|
|
1303
|
-
};
|
|
1304
|
-
return { ...defaultVNode, ...vnode };
|
|
1305
|
-
};
|
|
1306
|
-
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1307
|
-
node["s-sr"] = true;
|
|
1308
|
-
childVNode.$name$ = slotName || null;
|
|
1309
|
-
childVNode.$tag$ = "slot";
|
|
1310
|
-
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1311
|
-
if (shadowRootNodes) {
|
|
1312
|
-
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1313
|
-
if (childVNode.$name$) {
|
|
1314
|
-
childVNode.$elm$.setAttribute("name", slotName);
|
|
1293
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
1294
|
+
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
1295
|
+
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1296
|
+
const oldChildren = oldVNode.$children$;
|
|
1297
|
+
const newChildren = newVNode2.$children$;
|
|
1298
|
+
const tag = newVNode2.$tag$;
|
|
1299
|
+
const text = newVNode2.$text$;
|
|
1300
|
+
let defaultHolder;
|
|
1301
|
+
if (text === null) {
|
|
1302
|
+
{
|
|
1303
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1315
1304
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1305
|
+
{
|
|
1306
|
+
if (tag === "slot" && !useNativeShadowDom) ; else {
|
|
1307
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1308
|
+
}
|
|
1320
1309
|
}
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
if (
|
|
1324
|
-
|
|
1310
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
1311
|
+
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1312
|
+
} else if (newChildren !== null) {
|
|
1313
|
+
if (oldVNode.$text$ !== null) {
|
|
1314
|
+
elm.textContent = "";
|
|
1315
|
+
}
|
|
1316
|
+
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1317
|
+
} else if (
|
|
1318
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1319
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1320
|
+
) {
|
|
1321
|
+
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1322
|
+
}
|
|
1323
|
+
if (isSvgMode && tag === "svg") {
|
|
1324
|
+
isSvgMode = false;
|
|
1325
|
+
}
|
|
1326
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1327
|
+
defaultHolder.parentNode.textContent = text;
|
|
1328
|
+
} else if (oldVNode.$text$ !== text) {
|
|
1329
|
+
elm.data = text;
|
|
1330
|
+
}
|
|
1331
|
+
};
|
|
1332
|
+
var relocateNodes = [];
|
|
1333
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1334
|
+
let node;
|
|
1335
|
+
let hostContentNodes;
|
|
1336
|
+
let j;
|
|
1337
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1338
|
+
for (const childNode of children) {
|
|
1339
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1340
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1341
|
+
const slotName = childNode["s-sn"];
|
|
1342
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1343
|
+
node = hostContentNodes[j];
|
|
1344
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) {
|
|
1345
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1346
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1347
|
+
checkSlotFallbackVisibility = true;
|
|
1348
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1349
|
+
if (relocateNodeData) {
|
|
1350
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1351
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1352
|
+
} else {
|
|
1353
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1354
|
+
relocateNodes.push({
|
|
1355
|
+
$slotRefNode$: childNode,
|
|
1356
|
+
$nodeToRelocate$: node
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
if (node["s-sr"]) {
|
|
1360
|
+
relocateNodes.map((relocateNode) => {
|
|
1361
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1362
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1363
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1364
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1370
|
+
relocateNodes.push({
|
|
1371
|
+
$nodeToRelocate$: node
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1325
1376
|
}
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1329
|
-
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1330
|
-
if (shouldMove) {
|
|
1331
|
-
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1377
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1378
|
+
markSlotContentForRelocation(childNode);
|
|
1332
1379
|
}
|
|
1333
|
-
childRenderNodes.push(childVNode);
|
|
1334
|
-
}
|
|
1335
|
-
slotNodes.push(childVNode);
|
|
1336
|
-
if (!parentVNode.$children$) {
|
|
1337
|
-
parentVNode.$children$ = [];
|
|
1338
1380
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
1345
|
-
slottedNode["s-sn"] = slotName;
|
|
1346
|
-
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1347
|
-
slottedNode = slottedNode.nextSibling;
|
|
1381
|
+
};
|
|
1382
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
1383
|
+
{
|
|
1384
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1385
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1348
1386
|
}
|
|
1349
1387
|
};
|
|
1350
|
-
var
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1354
|
-
}
|
|
1355
|
-
if (propType & 2 /* Number */) {
|
|
1356
|
-
return parseFloat(propValue);
|
|
1357
|
-
}
|
|
1358
|
-
if (propType & 1 /* String */) {
|
|
1359
|
-
return String(propValue);
|
|
1360
|
-
}
|
|
1361
|
-
return propValue;
|
|
1388
|
+
var insertBefore = (parent, newNode, reference) => {
|
|
1389
|
+
{
|
|
1390
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1362
1391
|
}
|
|
1363
|
-
return propValue;
|
|
1364
1392
|
};
|
|
1365
|
-
var
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
});
|
|
1393
|
+
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1394
|
+
var _c, _d;
|
|
1395
|
+
const hostElm = hostRef.$hostElement$;
|
|
1396
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1397
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1398
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1399
|
+
hostTagName = hostElm.tagName;
|
|
1400
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1401
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1402
|
+
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
1403
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
1404
|
+
}
|
|
1378
1405
|
}
|
|
1379
|
-
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
elm.
|
|
1384
|
-
|
|
1385
|
-
};
|
|
1386
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1387
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1388
|
-
let style = styles.get(scopeId2);
|
|
1406
|
+
}
|
|
1407
|
+
rootVnode.$tag$ = null;
|
|
1408
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1409
|
+
hostRef.$vnode$ = rootVnode;
|
|
1410
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1411
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1389
1412
|
{
|
|
1390
|
-
|
|
1413
|
+
contentRef = hostElm["s-cr"];
|
|
1414
|
+
checkSlotFallbackVisibility = false;
|
|
1391
1415
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
if (!appliedStyles) {
|
|
1405
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1416
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1417
|
+
{
|
|
1418
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1419
|
+
if (checkSlotRelocate) {
|
|
1420
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1421
|
+
for (const relocateData of relocateNodes) {
|
|
1422
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1423
|
+
if (!nodeToRelocate["s-ol"]) {
|
|
1424
|
+
const orgLocationNode = originalLocationDebugNode(nodeToRelocate) ;
|
|
1425
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1426
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1427
|
+
}
|
|
1406
1428
|
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
1424
|
-
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
1425
|
-
} else if ("host" in styleContainerNode) {
|
|
1426
|
-
{
|
|
1427
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
1428
|
-
if (existingStyleContainer) {
|
|
1429
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1430
|
-
} else {
|
|
1431
|
-
styleContainerNode.prepend(styleElm);
|
|
1432
|
-
}
|
|
1429
|
+
for (const relocateData of relocateNodes) {
|
|
1430
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1431
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1432
|
+
if (slotRefNode) {
|
|
1433
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1434
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1435
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1436
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1437
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1438
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1439
|
+
if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1440
|
+
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1441
|
+
}
|
|
1442
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1443
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1444
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1433
1445
|
}
|
|
1434
|
-
} else {
|
|
1435
|
-
styleContainerNode.append(styleElm);
|
|
1436
1446
|
}
|
|
1437
1447
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1448
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
|
|
1449
|
+
} else {
|
|
1450
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1451
|
+
if (isInitialLoad) {
|
|
1452
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
1453
|
+
}
|
|
1454
|
+
nodeToRelocate.hidden = true;
|
|
1440
1455
|
}
|
|
1441
1456
|
}
|
|
1442
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1443
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1444
|
-
}
|
|
1445
|
-
if (appliedStyles) {
|
|
1446
|
-
appliedStyles.add(scopeId2);
|
|
1447
|
-
}
|
|
1448
1457
|
}
|
|
1449
1458
|
}
|
|
1459
|
+
if (checkSlotFallbackVisibility) {
|
|
1460
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1461
|
+
}
|
|
1462
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1463
|
+
relocateNodes.length = 0;
|
|
1450
1464
|
}
|
|
1451
|
-
|
|
1452
|
-
};
|
|
1453
|
-
var attachStyles = (hostRef) => {
|
|
1454
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
1455
|
-
const elm = hostRef.$hostElement$;
|
|
1456
|
-
const flags = cmpMeta.$flags$;
|
|
1457
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1458
|
-
const scopeId2 = addStyle(
|
|
1459
|
-
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1460
|
-
cmpMeta);
|
|
1461
|
-
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1462
|
-
elm["s-sc"] = scopeId2;
|
|
1463
|
-
elm.classList.add(scopeId2 + "-h");
|
|
1464
|
-
}
|
|
1465
|
-
endAttachStyles();
|
|
1465
|
+
contentRef = void 0;
|
|
1466
1466
|
};
|
|
1467
|
-
var
|
|
1467
|
+
var slotReferenceDebugNode = (slotVNode) => doc.createComment(
|
|
1468
|
+
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1469
|
+
);
|
|
1470
|
+
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1471
|
+
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1472
|
+
);
|
|
1468
1473
|
|
|
1469
1474
|
// src/runtime/update-component.ts
|
|
1470
1475
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1471
1476
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1472
|
-
ancestorComponent["s-p"].push(
|
|
1477
|
+
const index = ancestorComponent["s-p"].push(
|
|
1478
|
+
new Promise(
|
|
1479
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
1480
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
1481
|
+
r();
|
|
1482
|
+
}
|
|
1483
|
+
)
|
|
1484
|
+
);
|
|
1473
1485
|
}
|
|
1474
1486
|
};
|
|
1475
1487
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -1698,62 +1710,69 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1698
1710
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1699
1711
|
members.map(([memberName, [memberFlags]]) => {
|
|
1700
1712
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1701
|
-
|
|
1713
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1714
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1715
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1716
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1702
1717
|
Object.defineProperty(prototype, memberName, {
|
|
1703
1718
|
get() {
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
},
|
|
1709
|
-
configurable: true,
|
|
1710
|
-
enumerable: true
|
|
1711
|
-
});
|
|
1712
|
-
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
1713
|
-
{
|
|
1714
|
-
Object.defineProperty(prototype, memberName, {
|
|
1715
|
-
get() {
|
|
1719
|
+
{
|
|
1720
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1721
|
+
return getValue(this, memberName);
|
|
1722
|
+
}
|
|
1716
1723
|
const ref = getHostRef(this);
|
|
1717
1724
|
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1718
1725
|
if (!instance) return;
|
|
1719
1726
|
return instance[memberName];
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1727
|
+
}
|
|
1728
|
+
},
|
|
1729
|
+
configurable: true,
|
|
1730
|
+
enumerable: true
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
Object.defineProperty(prototype, memberName, {
|
|
1734
|
+
set(newValue) {
|
|
1735
|
+
const ref = getHostRef(this);
|
|
1736
|
+
if (origSetter) {
|
|
1737
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1738
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1739
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1740
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1741
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1742
|
+
}
|
|
1743
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1744
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1745
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
{
|
|
1749
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1750
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1751
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1752
|
+
ref.$onReadyPromise$.then(() => {
|
|
1753
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1754
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1755
|
+
}
|
|
1756
|
+
});
|
|
1738
1757
|
}
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
1746
|
-
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1747
|
-
};
|
|
1748
|
-
if (ref.$lazyInstance$) {
|
|
1749
|
-
setterSetVal();
|
|
1750
|
-
} else {
|
|
1751
|
-
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
const setterSetVal = () => {
|
|
1761
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1762
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1763
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1752
1764
|
}
|
|
1765
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1766
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1767
|
+
};
|
|
1768
|
+
if (ref.$lazyInstance$) {
|
|
1769
|
+
setterSetVal();
|
|
1770
|
+
} else {
|
|
1771
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1753
1772
|
}
|
|
1754
|
-
}
|
|
1773
|
+
}
|
|
1755
1774
|
}
|
|
1756
|
-
}
|
|
1775
|
+
});
|
|
1757
1776
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
1758
1777
|
Object.defineProperty(prototype, memberName, {
|
|
1759
1778
|
value(...args) {
|
|
@@ -1794,8 +1813,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1794
1813
|
return;
|
|
1795
1814
|
}
|
|
1796
1815
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1797
|
-
|
|
1798
|
-
|
|
1816
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1817
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1818
|
+
this[propName] = newValue;
|
|
1799
1819
|
}
|
|
1800
1820
|
});
|
|
1801
1821
|
};
|
|
@@ -2096,7 +2116,8 @@ var hAsync = (nodeName, vnodeData, ...children) => {
|
|
|
2096
2116
|
}
|
|
2097
2117
|
return h(nodeName, vnodeData);
|
|
2098
2118
|
};
|
|
2099
|
-
function proxyHostElement(elm,
|
|
2119
|
+
function proxyHostElement(elm, cstr) {
|
|
2120
|
+
const cmpMeta = cstr.cmpMeta;
|
|
2100
2121
|
if (typeof elm.componentOnReady !== "function") {
|
|
2101
2122
|
elm.componentOnReady = componentOnReady;
|
|
2102
2123
|
}
|
|
@@ -2111,11 +2132,13 @@ function proxyHostElement(elm, cmpMeta) {
|
|
|
2111
2132
|
if (cmpMeta.$members$ != null) {
|
|
2112
2133
|
const hostRef = getHostRef(elm);
|
|
2113
2134
|
const members = Object.entries(cmpMeta.$members$);
|
|
2114
|
-
members.forEach(([memberName,
|
|
2135
|
+
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
2115
2136
|
var _a, _b;
|
|
2116
|
-
const memberFlags = m[0];
|
|
2117
2137
|
if (memberFlags & 31 /* Prop */) {
|
|
2118
|
-
|
|
2138
|
+
let getter2 = function() {
|
|
2139
|
+
return ![void 0, null].includes(parsedAttrValue) ? parsedAttrValue : origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
2140
|
+
};
|
|
2141
|
+
const attributeName = metaAttributeName || memberName;
|
|
2119
2142
|
let attrValue = elm.getAttribute(attributeName);
|
|
2120
2143
|
if ((attrValue == null ? void 0 : attrValue.startsWith("{")) && attrValue.endsWith("}") || (attrValue == null ? void 0 : attrValue.startsWith("[")) && attrValue.endsWith("]")) {
|
|
2121
2144
|
try {
|
|
@@ -2123,8 +2146,14 @@ function proxyHostElement(elm, cmpMeta) {
|
|
|
2123
2146
|
} catch (e) {
|
|
2124
2147
|
}
|
|
2125
2148
|
}
|
|
2149
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(cstr.prototype, memberName) || {};
|
|
2150
|
+
let parsedAttrValue;
|
|
2126
2151
|
if (attrValue != null) {
|
|
2127
|
-
|
|
2152
|
+
parsedAttrValue = parsePropertyValue(attrValue, memberFlags);
|
|
2153
|
+
if (origSetter) {
|
|
2154
|
+
origSetter.apply(elm, [parsedAttrValue]);
|
|
2155
|
+
parsedAttrValue = origGetter ? origGetter.apply(elm) : parsedAttrValue;
|
|
2156
|
+
}
|
|
2128
2157
|
(_a = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a.set(memberName, parsedAttrValue);
|
|
2129
2158
|
}
|
|
2130
2159
|
const ownValue = elm[memberName];
|
|
@@ -2133,15 +2162,18 @@ function proxyHostElement(elm, cmpMeta) {
|
|
|
2133
2162
|
delete elm[memberName];
|
|
2134
2163
|
}
|
|
2135
2164
|
Object.defineProperty(elm, memberName, {
|
|
2136
|
-
get
|
|
2137
|
-
return getValue(this, memberName);
|
|
2138
|
-
},
|
|
2165
|
+
get: getter2,
|
|
2139
2166
|
set(newValue) {
|
|
2140
2167
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2141
2168
|
},
|
|
2142
2169
|
configurable: true,
|
|
2143
2170
|
enumerable: true
|
|
2144
2171
|
});
|
|
2172
|
+
Object.defineProperty(cstr.prototype, memberName, {
|
|
2173
|
+
get: getter2,
|
|
2174
|
+
configurable: true,
|
|
2175
|
+
enumerable: true
|
|
2176
|
+
});
|
|
2145
2177
|
} else if (memberFlags & 64 /* Method */) {
|
|
2146
2178
|
Object.defineProperty(elm, memberName, {
|
|
2147
2179
|
value(...args) {
|
|
@@ -2216,7 +2248,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
|
|
|
2216
2248
|
createdElements.add(elm);
|
|
2217
2249
|
elm.connectedCallback = patchedConnectedCallback2;
|
|
2218
2250
|
registerHost(elm, Cstr.cmpMeta);
|
|
2219
|
-
proxyHostElement(elm, Cstr
|
|
2251
|
+
proxyHostElement(elm, Cstr);
|
|
2220
2252
|
}
|
|
2221
2253
|
}
|
|
2222
2254
|
}
|
|
@@ -6352,7 +6384,7 @@ var NAMESPACE = (
|
|
|
6352
6384
|
);
|
|
6353
6385
|
|
|
6354
6386
|
/*
|
|
6355
|
-
Stencil Hydrate Runner v4.
|
|
6387
|
+
Stencil Hydrate Runner v4.24.0 | MIT Licensed | https://stenciljs.com
|
|
6356
6388
|
*/
|
|
6357
6389
|
var __defProp = Object.defineProperty;
|
|
6358
6390
|
var __export = (target, all) => {
|
|
@@ -17322,7 +17354,7 @@ var MockNode2 = class {
|
|
|
17322
17354
|
}
|
|
17323
17355
|
remove() {
|
|
17324
17356
|
if (this.parentNode != null) {
|
|
17325
|
-
this.parentNode.removeChild(this);
|
|
17357
|
+
this.__parentNode ? this.__parentNode.removeChild(this) : this.parentNode.removeChild(this);
|
|
17326
17358
|
}
|
|
17327
17359
|
}
|
|
17328
17360
|
replaceChild(newChild, oldChild) {
|
|
@@ -20082,7 +20114,7 @@ function resetWindowDefaults(win2) {
|
|
|
20082
20114
|
win2.__clearTimeout = nativeClearTimeout;
|
|
20083
20115
|
win2.__setInterval = nativeSetInterval;
|
|
20084
20116
|
win2.__setTimeout = nativeSetTimeout;
|
|
20085
|
-
win2.__maxTimeout =
|
|
20117
|
+
win2.__maxTimeout = 6e4;
|
|
20086
20118
|
win2.__allowInterval = true;
|
|
20087
20119
|
win2.URL = nativeURL;
|
|
20088
20120
|
}
|
|
@@ -20573,11 +20605,11 @@ var unwrapErr = (result) => {
|
|
|
20573
20605
|
throw result.value;
|
|
20574
20606
|
}
|
|
20575
20607
|
};
|
|
20576
|
-
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
20577
|
-
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
20578
20608
|
|
|
20579
20609
|
// src/runtime/mode.ts
|
|
20580
20610
|
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
20611
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
20612
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
20581
20613
|
|
|
20582
20614
|
// src/compiler/html/canonical-link.ts
|
|
20583
20615
|
var updateCanonicalLink = (doc2, href) => {
|