xv-webcomponents 1.24.13-qa.0 → 1.24.18-staging.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.
Files changed (72) hide show
  1. package/dist/cjs/{index-DpLAFt0R.js → index-CsKqwBc1.js} +644 -7
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/xv-accordion-v2_50.cjs.entry.js +59 -41
  4. package/dist/cjs/xv-footer-next.cjs.entry.js +122 -0
  5. package/dist/cjs/xv-header-next.cjs.entry.js +2 -2
  6. package/dist/cjs/xv-mega-menu-next.cjs.entry.js +7 -7
  7. package/dist/cjs/xv-webcomponents.cjs.js +2 -2
  8. package/dist/collection/collection-manifest.json +1 -0
  9. package/dist/collection/components/xv-data-table/xv-data-table-cell/xv-data-table-cell.css +2 -1
  10. package/dist/collection/components/xv-footer-next/xv-footer-next.css +486 -0
  11. package/dist/collection/components/xv-footer-next/xv-footer-next.js +167 -0
  12. package/dist/collection/components/xv-footer-next/xv-footer-next.model.js +17 -0
  13. package/dist/collection/components/xv-geo-map/xv-geo-map.js +41 -1
  14. package/dist/collection/components/xv-header/xv-header.js +1 -1
  15. package/dist/collection/components/xv-header-next/xv-header-next.js +1 -1
  16. package/dist/collection/components/xv-image-viewer/xv-image-viewer.js +1 -1
  17. package/dist/collection/components/xv-link/xv-link.js +1 -1
  18. package/dist/collection/components/xv-mega-menu/xv-mega-menu.css +42 -2
  19. package/dist/collection/components/xv-mega-menu/xv-mega-menu.js +6 -7
  20. package/dist/collection/components/xv-mega-menu-next/xv-mega-menu-next.css +42 -2
  21. package/dist/collection/components/xv-mega-menu-next/xv-mega-menu-next.js +20 -6
  22. package/dist/collection/components/xv-modal/xv-modal.js +1 -1
  23. package/dist/collection/components/xv-notification/xv-notification.js +1 -1
  24. package/dist/collection/components/xv-number-input/xv-number-input.js +2 -2
  25. package/dist/collection/components/xv-pagination/xv-pagination.js +1 -1
  26. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator-item/xv-progress-indicator-item.js +1 -1
  27. package/dist/collection/components/xv-progress-indicator/xv-progress-indicator.js +1 -1
  28. package/dist/collection/components/xv-radio/xv-radio.js +2 -2
  29. package/dist/collection/components/xv-slider/xv-slider.js +1 -1
  30. package/dist/collection/components/xv-table/xv-table-cell/xv-table-cell.js +1 -1
  31. package/dist/collection/components/xv-table/xv-table-expand/xv-table-expand.js +1 -1
  32. package/dist/collection/components/xv-table/xv-table-row/xv-table-row.js +1 -1
  33. package/dist/collection/components/xv-table/xv-table.js +1 -1
  34. package/dist/collection/components/xv-tabs/xv-tab/xv-tab.js +1 -1
  35. package/dist/collection/components/xv-tag/xv-tag.js +1 -1
  36. package/dist/collection/components/xv-tag-combobox/xv-tag-combobox.js +2 -2
  37. package/dist/collection/components/xv-text-input/xv-text-input.js +2 -2
  38. package/dist/collection/components/xv-textarea/xv-textarea.js +2 -2
  39. package/dist/collection/components/xv-tile/xv-tile.js +2 -2
  40. package/dist/collection/components/xv-toggle/xv-toggle.js +1 -1
  41. package/dist/collection/components/xv-toggle-tip/xv-toggle-tip.js +1 -1
  42. package/dist/collection/components/xv-tooltip/xv-tooltip.js +2 -2
  43. package/dist/esm/{index-CQm2sRKT.js → index-D0yFoU2h.js} +1 -1
  44. package/dist/esm/{index-DmxA2ysB.js → index-Owr_mJOX.js} +644 -7
  45. package/dist/esm/index.js +1 -1
  46. package/dist/esm/loader.js +3 -3
  47. package/dist/esm/xv-accordion-v2_50.entry.js +60 -42
  48. package/dist/esm/xv-footer-next.entry.js +120 -0
  49. package/dist/esm/xv-header-next.entry.js +3 -3
  50. package/dist/esm/xv-mega-menu-next.entry.js +8 -8
  51. package/dist/esm/xv-webcomponents.js +3 -3
  52. package/dist/types/components/xv-footer-next/xv-footer-next.d.ts +42 -0
  53. package/dist/types/components/xv-footer-next/xv-footer-next.model.d.ts +43 -0
  54. package/dist/types/components/xv-geo-map/xv-geo-map.d.ts +7 -0
  55. package/dist/types/components/xv-mega-menu-next/xv-mega-menu-next.d.ts +14 -0
  56. package/dist/types/components.d.ts +131 -0
  57. package/dist/xv-webcomponents/index.esm.js +1 -1
  58. package/dist/xv-webcomponents/p-3dd10203.entry.js +1 -0
  59. package/dist/xv-webcomponents/p-76cf729b.entry.js +8 -0
  60. package/dist/xv-webcomponents/{p-CQm2sRKT.js → p-D0yFoU2h.js} +1 -1
  61. package/dist/xv-webcomponents/p-Owr_mJOX.js +2 -0
  62. package/dist/xv-webcomponents/p-ec19bcc7.entry.js +1 -0
  63. package/dist/xv-webcomponents/{p-f46bb687.entry.js → p-fbd8ca68.entry.js} +1 -1
  64. package/dist/xv-webcomponents/xv-webcomponents.esm.js +1 -1
  65. package/hydrate/index.d.ts +287 -0
  66. package/hydrate/index.js +113808 -0
  67. package/hydrate/index.mjs +113798 -0
  68. package/hydrate/package.json +12 -0
  69. package/package.json +8 -2
  70. package/dist/xv-webcomponents/p-7832549c.entry.js +0 -8
  71. package/dist/xv-webcomponents/p-DmxA2ysB.js +0 -2
  72. package/dist/xv-webcomponents/p-fe9b38f8.entry.js +0 -1
@@ -259,6 +259,30 @@ var require_brace_expansion = __commonJS({
259
259
  // src/utils/constants.ts
260
260
  var SVG_NS = "http://www.w3.org/2000/svg";
261
261
  var HTML_NS = "http://www.w3.org/1999/xhtml";
262
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
263
+ PrimitiveType2["Undefined"] = "undefined";
264
+ PrimitiveType2["Null"] = "null";
265
+ PrimitiveType2["String"] = "string";
266
+ PrimitiveType2["Number"] = "number";
267
+ PrimitiveType2["SpecialNumber"] = "number";
268
+ PrimitiveType2["Boolean"] = "boolean";
269
+ PrimitiveType2["BigInt"] = "bigint";
270
+ return PrimitiveType2;
271
+ })(PrimitiveType || {});
272
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
273
+ NonPrimitiveType2["Array"] = "array";
274
+ NonPrimitiveType2["Date"] = "date";
275
+ NonPrimitiveType2["Map"] = "map";
276
+ NonPrimitiveType2["Object"] = "object";
277
+ NonPrimitiveType2["RegularExpression"] = "regexp";
278
+ NonPrimitiveType2["Set"] = "set";
279
+ NonPrimitiveType2["Channel"] = "channel";
280
+ NonPrimitiveType2["Symbol"] = "symbol";
281
+ return NonPrimitiveType2;
282
+ })(NonPrimitiveType || {});
283
+ var TYPE_CONSTANT = "type";
284
+ var VALUE_CONSTANT = "value";
285
+ var SERIALIZED_PREFIX = "serialized:";
262
286
  var reWireGetterSetter = (instance, hostRef) => {
263
287
  var _a;
264
288
  const cmpMeta = hostRef.$cmpMeta$;
@@ -367,6 +391,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
367
391
 
368
392
  // src/client/client-style.ts
369
393
  var styles = /* @__PURE__ */ new Map();
394
+
395
+ // src/runtime/runtime-constants.ts
396
+ var CONTENT_REF_ID = "r";
397
+ var ORG_LOCATION_ID = "o";
398
+ var SLOT_NODE_ID = "s";
399
+ var TEXT_NODE_ID = "t";
400
+ var COMMENT_NODE_ID = "c";
401
+ var HYDRATE_ID = "s-id";
402
+ var HYDRATED_STYLE_ID = "sty-id";
403
+ var HYDRATE_CHILD_ID = "c-id";
370
404
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
371
405
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
372
406
  var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
@@ -1822,6 +1856,101 @@ var escapeRegExpSpecialCharacters = (text) => {
1822
1856
  return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1823
1857
  };
1824
1858
 
1859
+ // src/utils/remote-value.ts
1860
+ var RemoteValue = class _RemoteValue {
1861
+ /**
1862
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
1863
+ *
1864
+ * @param serialized The serialized LocalValue object
1865
+ * @returns The original JavaScript value/object
1866
+ */
1867
+ static fromLocalValue(serialized) {
1868
+ const type = serialized[TYPE_CONSTANT];
1869
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
1870
+ switch (type) {
1871
+ case "string" /* String */:
1872
+ return value;
1873
+ case "boolean" /* Boolean */:
1874
+ return value;
1875
+ case "bigint" /* BigInt */:
1876
+ return BigInt(value);
1877
+ case "undefined" /* Undefined */:
1878
+ return void 0;
1879
+ case "null" /* Null */:
1880
+ return null;
1881
+ case "number" /* Number */:
1882
+ if (value === "NaN") return NaN;
1883
+ if (value === "-0") return -0;
1884
+ if (value === "Infinity") return Infinity;
1885
+ if (value === "-Infinity") return -Infinity;
1886
+ return value;
1887
+ case "array" /* Array */:
1888
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
1889
+ case "date" /* Date */:
1890
+ return new Date(value);
1891
+ case "map" /* Map */:
1892
+ const map2 = /* @__PURE__ */ new Map();
1893
+ for (const [key, val] of value) {
1894
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
1895
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
1896
+ map2.set(deserializedKey, deserializedValue);
1897
+ }
1898
+ return map2;
1899
+ case "object" /* Object */:
1900
+ const obj = {};
1901
+ for (const [key, val] of value) {
1902
+ obj[key] = _RemoteValue.fromLocalValue(val);
1903
+ }
1904
+ return obj;
1905
+ case "regexp" /* RegularExpression */:
1906
+ const { pattern, flags } = value;
1907
+ return new RegExp(pattern, flags);
1908
+ case "set" /* Set */:
1909
+ const set = /* @__PURE__ */ new Set();
1910
+ for (const item of value) {
1911
+ set.add(_RemoteValue.fromLocalValue(item));
1912
+ }
1913
+ return set;
1914
+ case "symbol" /* Symbol */:
1915
+ return Symbol(value);
1916
+ default:
1917
+ throw new Error(`Unsupported type: ${type}`);
1918
+ }
1919
+ }
1920
+ /**
1921
+ * Utility method to deserialize multiple LocalValues at once
1922
+ *
1923
+ * @param serializedValues Array of serialized LocalValue objects
1924
+ * @returns Array of deserialized JavaScript values
1925
+ */
1926
+ static fromLocalValueArray(serializedValues) {
1927
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
1928
+ }
1929
+ /**
1930
+ * Verifies if the given object matches the structure of a serialized LocalValue
1931
+ *
1932
+ * @param obj Object to verify
1933
+ * @returns boolean indicating if the object has LocalValue structure
1934
+ */
1935
+ static isLocalValueObject(obj) {
1936
+ if (typeof obj !== "object" || obj === null) {
1937
+ return false;
1938
+ }
1939
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
1940
+ return false;
1941
+ }
1942
+ const type = obj[TYPE_CONSTANT];
1943
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
1944
+ if (!hasTypeProperty) {
1945
+ return false;
1946
+ }
1947
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
1948
+ return obj.hasOwnProperty(VALUE_CONSTANT);
1949
+ }
1950
+ return true;
1951
+ }
1952
+ };
1953
+
1825
1954
  // src/utils/result.ts
1826
1955
  var result_exports = {};
1827
1956
  __export(result_exports, {
@@ -1871,6 +2000,14 @@ var unwrapErr = (result) => {
1871
2000
  }
1872
2001
  };
1873
2002
 
2003
+ // src/utils/serialize.ts
2004
+ function deserializeProperty(value) {
2005
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
2006
+ return value;
2007
+ }
2008
+ return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
2009
+ }
2010
+
1874
2011
  // src/utils/style.ts
1875
2012
  function createStyleSheetIfNeededAndSupported(styles2) {
1876
2013
  if (!supportsConstructableStylesheets) return void 0;
@@ -1966,6 +2103,34 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1966
2103
  }
1967
2104
  return slotName === "";
1968
2105
  };
2106
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
2107
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
2108
+ return;
2109
+ }
2110
+ const slottedNodeLocation = document.createTextNode("");
2111
+ slottedNodeLocation["s-nr"] = newChild;
2112
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
2113
+ const parent = slotNode["s-cr"].parentNode;
2114
+ const appendMethod = internalCall(parent, "appendChild");
2115
+ if (typeof position !== "undefined") {
2116
+ slottedNodeLocation["s-oo"] = position;
2117
+ const childNodes = internalCall(parent, "childNodes");
2118
+ const slotRelocateNodes = [slottedNodeLocation];
2119
+ childNodes.forEach((n) => {
2120
+ if (n["s-nr"]) slotRelocateNodes.push(n);
2121
+ });
2122
+ slotRelocateNodes.sort((a, b) => {
2123
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
2124
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
2125
+ return 0;
2126
+ });
2127
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
2128
+ } else {
2129
+ appendMethod.call(parent, slottedNodeLocation);
2130
+ }
2131
+ newChild["s-ol"] = slottedNodeLocation;
2132
+ newChild["s-sh"] = slotNode["s-hn"];
2133
+ };
1969
2134
  var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
1970
2135
  function patchSlotNode(node) {
1971
2136
  if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
@@ -2049,7 +2214,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2049
2214
  if (!appliedStyles) {
2050
2215
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2051
2216
  }
2052
- if (!appliedStyles.has(scopeId2)) {
2217
+ const existingStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
2218
+ if (existingStyleElm) {
2219
+ existingStyleElm.innerHTML = style;
2220
+ } else if (!appliedStyles.has(scopeId2)) {
2053
2221
  styleElm = win.document.createElement("style");
2054
2222
  styleElm.innerHTML = style;
2055
2223
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -2138,6 +2306,17 @@ var attachStyles = (hostRef) => {
2138
2306
  endAttachStyles();
2139
2307
  };
2140
2308
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
2309
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2310
+ var hydrateScopedToShadow = () => {
2311
+ if (!win.document) {
2312
+ return;
2313
+ }
2314
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2315
+ let i2 = 0;
2316
+ for (; i2 < styles2.length; i2++) {
2317
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2318
+ }
2319
+ };
2141
2320
  var h = (nodeName, vnodeData, ...children) => {
2142
2321
  if (typeof nodeName === "string") {
2143
2322
  nodeName = transformTag(nodeName);
@@ -2252,6 +2431,420 @@ var convertToPrivate = (node) => {
2252
2431
  vnode.$name$ = node.vname;
2253
2432
  return vnode;
2254
2433
  };
2434
+
2435
+ // src/runtime/client-hydrate.ts
2436
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
2437
+ var _a, _b, _c, _d;
2438
+ const endHydrate = createTime("hydrateClient", tagName);
2439
+ const shadowRoot = hostElm.shadowRoot;
2440
+ const childRenderNodes = [];
2441
+ const slotNodes = [];
2442
+ const slottedNodes = [];
2443
+ const shadowRootNodes = shadowRoot ? [] : null;
2444
+ const vnode = newVNode(tagName, null);
2445
+ vnode.$elm$ = hostElm;
2446
+ let scopeId2;
2447
+ {
2448
+ const cmpMeta = hostRef.$cmpMeta$;
2449
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
2450
+ scopeId2 = hostElm["s-sc"];
2451
+ hostElm.classList.add(scopeId2 + "-h");
2452
+ } else if (hostElm["s-sc"]) {
2453
+ delete hostElm["s-sc"];
2454
+ }
2455
+ }
2456
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
2457
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
2458
+ }
2459
+ hostElm[HYDRATE_ID] = hostId;
2460
+ hostElm.removeAttribute(HYDRATE_ID);
2461
+ hostRef.$vnode$ = clientHydrate(
2462
+ vnode,
2463
+ childRenderNodes,
2464
+ slotNodes,
2465
+ shadowRootNodes,
2466
+ hostElm,
2467
+ hostElm,
2468
+ hostId,
2469
+ slottedNodes
2470
+ );
2471
+ let crIndex = 0;
2472
+ const crLength = childRenderNodes.length;
2473
+ let childRenderNode;
2474
+ for (crIndex; crIndex < crLength; crIndex++) {
2475
+ childRenderNode = childRenderNodes[crIndex];
2476
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
2477
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
2478
+ const node = childRenderNode.$elm$;
2479
+ if (!shadowRoot) {
2480
+ node["s-hn"] = transformTag(tagName).toUpperCase();
2481
+ if (childRenderNode.$tag$ === "slot") {
2482
+ node["s-cr"] = hostElm["s-cr"];
2483
+ }
2484
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
2485
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
2486
+ if (cmpMeta) {
2487
+ const scopeId3 = getScopeId(
2488
+ cmpMeta.$cmpMeta$);
2489
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
2490
+ if (styleSheet) {
2491
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
2492
+ }
2493
+ }
2494
+ }
2495
+ if (childRenderNode.$tag$ === "slot") {
2496
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
2497
+ if (childRenderNode.$children$) {
2498
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
2499
+ if (!childRenderNode.$elm$.childNodes.length) {
2500
+ childRenderNode.$children$.forEach((c) => {
2501
+ childRenderNode.$elm$.appendChild(c.$elm$);
2502
+ });
2503
+ }
2504
+ } else {
2505
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
2506
+ }
2507
+ }
2508
+ if (orgLocationNode && orgLocationNode.isConnected) {
2509
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
2510
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
2511
+ }
2512
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
2513
+ if (!shadowRoot) {
2514
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
2515
+ }
2516
+ }
2517
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
2518
+ plt.$orgLocNodes$.delete(orgLocationId);
2519
+ }
2520
+ }
2521
+ const hosts = [];
2522
+ const snLen = slottedNodes.length;
2523
+ let snIndex = 0;
2524
+ let slotGroup;
2525
+ let snGroupIdx;
2526
+ let snGroupLen;
2527
+ let slottedItem;
2528
+ let currentPos = 0;
2529
+ for (snIndex; snIndex < snLen; snIndex++) {
2530
+ slotGroup = slottedNodes[snIndex];
2531
+ if (!slotGroup || !slotGroup.length) continue;
2532
+ snGroupLen = slotGroup.length;
2533
+ snGroupIdx = 0;
2534
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
2535
+ slottedItem = slotGroup[snGroupIdx];
2536
+ if (!hosts[slottedItem.hostId]) {
2537
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
2538
+ }
2539
+ if (!hosts[slottedItem.hostId]) continue;
2540
+ const hostEle = hosts[slottedItem.hostId];
2541
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
2542
+ hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
2543
+ }
2544
+ if (!hostEle.shadowRoot || !shadowRoot) {
2545
+ if (!slottedItem.slot["s-cr"]) {
2546
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
2547
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
2548
+ slottedItem.slot["s-cr"] = hostEle;
2549
+ } else {
2550
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
2551
+ }
2552
+ }
2553
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
2554
+ if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
2555
+ slottedItem.node.removeAttribute("slot");
2556
+ }
2557
+ }
2558
+ currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
2559
+ }
2560
+ }
2561
+ if (scopeId2 && slotNodes.length) {
2562
+ slotNodes.forEach((slot) => {
2563
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
2564
+ });
2565
+ }
2566
+ if (shadowRoot) {
2567
+ let rnIdex = 0;
2568
+ const rnLen = shadowRootNodes.length;
2569
+ if (rnLen) {
2570
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
2571
+ const node = shadowRootNodes[rnIdex];
2572
+ if (node) {
2573
+ shadowRoot.appendChild(node);
2574
+ }
2575
+ }
2576
+ Array.from(hostElm.childNodes).forEach((node) => {
2577
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
2578
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
2579
+ node.removeAttribute("hidden");
2580
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
2581
+ node.parentNode.removeChild(node);
2582
+ }
2583
+ }
2584
+ });
2585
+ }
2586
+ }
2587
+ hostRef.$hostElement$ = hostElm;
2588
+ endHydrate();
2589
+ };
2590
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
2591
+ let childNodeType;
2592
+ let childIdSplt;
2593
+ let childVNode;
2594
+ let i2;
2595
+ const scopeId2 = hostElm["s-sc"];
2596
+ if (node.nodeType === 1 /* ElementNode */) {
2597
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
2598
+ if (childNodeType) {
2599
+ childIdSplt = childNodeType.split(".");
2600
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
2601
+ childVNode = createSimpleVNode({
2602
+ $flags$: 0,
2603
+ $hostId$: childIdSplt[0],
2604
+ $nodeId$: childIdSplt[1],
2605
+ $depth$: childIdSplt[2],
2606
+ $index$: childIdSplt[3],
2607
+ $tag$: node.tagName.toLowerCase(),
2608
+ $elm$: node,
2609
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
2610
+ // won't try to reconcile them. Classes set on the node will be blown away.
2611
+ $attrs$: { class: node.className || "" }
2612
+ });
2613
+ childRenderNodes.push(childVNode);
2614
+ node.removeAttribute(HYDRATE_CHILD_ID);
2615
+ if (!parentVNode.$children$) {
2616
+ parentVNode.$children$ = [];
2617
+ }
2618
+ if (scopeId2 && childIdSplt[0] === hostId) {
2619
+ node["s-si"] = scopeId2;
2620
+ childVNode.$attrs$.class += " " + scopeId2;
2621
+ }
2622
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
2623
+ if (typeof slotName === "string") {
2624
+ if (childVNode.$tag$ === "slot-fb") {
2625
+ addSlot(
2626
+ slotName,
2627
+ childIdSplt[2],
2628
+ childVNode,
2629
+ node,
2630
+ parentVNode,
2631
+ childRenderNodes,
2632
+ slotNodes,
2633
+ shadowRootNodes,
2634
+ slottedNodes
2635
+ );
2636
+ if (scopeId2) {
2637
+ node.classList.add(scopeId2);
2638
+ }
2639
+ }
2640
+ childVNode.$elm$["s-sn"] = slotName;
2641
+ childVNode.$elm$.removeAttribute("s-sn");
2642
+ }
2643
+ if (childVNode.$index$ !== void 0) {
2644
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2645
+ }
2646
+ parentVNode = childVNode;
2647
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
2648
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2649
+ }
2650
+ }
2651
+ }
2652
+ if (node.shadowRoot) {
2653
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
2654
+ clientHydrate(
2655
+ parentVNode,
2656
+ childRenderNodes,
2657
+ slotNodes,
2658
+ shadowRootNodes,
2659
+ hostElm,
2660
+ node.shadowRoot.childNodes[i2],
2661
+ hostId,
2662
+ slottedNodes
2663
+ );
2664
+ }
2665
+ }
2666
+ const nonShadowNodes = node.__childNodes || node.childNodes;
2667
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
2668
+ clientHydrate(
2669
+ parentVNode,
2670
+ childRenderNodes,
2671
+ slotNodes,
2672
+ shadowRootNodes,
2673
+ hostElm,
2674
+ nonShadowNodes[i2],
2675
+ hostId,
2676
+ slottedNodes
2677
+ );
2678
+ }
2679
+ } else if (node.nodeType === 8 /* CommentNode */) {
2680
+ childIdSplt = node.nodeValue.split(".");
2681
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
2682
+ childNodeType = childIdSplt[0];
2683
+ childVNode = createSimpleVNode({
2684
+ $hostId$: childIdSplt[1],
2685
+ $nodeId$: childIdSplt[2],
2686
+ $depth$: childIdSplt[3],
2687
+ $index$: childIdSplt[4] || "0",
2688
+ $elm$: node,
2689
+ $attrs$: null,
2690
+ $children$: null,
2691
+ $key$: null,
2692
+ $name$: null,
2693
+ $tag$: null,
2694
+ $text$: null
2695
+ });
2696
+ if (childNodeType === TEXT_NODE_ID) {
2697
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
2698
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
2699
+ childVNode.$text$ = childVNode.$elm$.textContent;
2700
+ childRenderNodes.push(childVNode);
2701
+ node.remove();
2702
+ if (hostId === childVNode.$hostId$) {
2703
+ if (!parentVNode.$children$) {
2704
+ parentVNode.$children$ = [];
2705
+ }
2706
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2707
+ }
2708
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
2709
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2710
+ }
2711
+ }
2712
+ } else if (childNodeType === COMMENT_NODE_ID) {
2713
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
2714
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
2715
+ childRenderNodes.push(childVNode);
2716
+ node.remove();
2717
+ }
2718
+ } else if (childVNode.$hostId$ === hostId) {
2719
+ if (childNodeType === SLOT_NODE_ID) {
2720
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
2721
+ addSlot(
2722
+ slotName,
2723
+ childIdSplt[2],
2724
+ childVNode,
2725
+ node,
2726
+ parentVNode,
2727
+ childRenderNodes,
2728
+ slotNodes,
2729
+ shadowRootNodes,
2730
+ slottedNodes
2731
+ );
2732
+ } else if (childNodeType === CONTENT_REF_ID) {
2733
+ if (shadowRootNodes) {
2734
+ node.remove();
2735
+ } else {
2736
+ hostElm["s-cr"] = node;
2737
+ node["s-cn"] = true;
2738
+ }
2739
+ }
2740
+ }
2741
+ }
2742
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
2743
+ const vnode = newVNode(null, node.textContent);
2744
+ vnode.$elm$ = node;
2745
+ vnode.$index$ = "0";
2746
+ parentVNode.$children$ = [vnode];
2747
+ }
2748
+ return parentVNode;
2749
+ };
2750
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
2751
+ if (node.nodeType === 1 /* ElementNode */) {
2752
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
2753
+ if (componentId) {
2754
+ orgLocNodes.set(componentId, node);
2755
+ }
2756
+ let i2 = 0;
2757
+ if (node.shadowRoot) {
2758
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
2759
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
2760
+ }
2761
+ }
2762
+ const nonShadowNodes = node.__childNodes || node.childNodes;
2763
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
2764
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
2765
+ }
2766
+ } else if (node.nodeType === 8 /* CommentNode */) {
2767
+ const childIdSplt = node.nodeValue.split(".");
2768
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
2769
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
2770
+ node.nodeValue = "";
2771
+ node["s-en"] = childIdSplt[3];
2772
+ }
2773
+ }
2774
+ };
2775
+ var createSimpleVNode = (vnode) => {
2776
+ const defaultVNode = {
2777
+ $flags$: 0,
2778
+ $hostId$: null,
2779
+ $nodeId$: null,
2780
+ $depth$: null,
2781
+ $index$: "0",
2782
+ $elm$: null,
2783
+ $attrs$: null,
2784
+ $children$: null,
2785
+ $key$: null,
2786
+ $name$: null,
2787
+ $tag$: null,
2788
+ $text$: null
2789
+ };
2790
+ return { ...defaultVNode, ...vnode };
2791
+ };
2792
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
2793
+ node["s-sr"] = true;
2794
+ childVNode.$name$ = slotName || null;
2795
+ childVNode.$tag$ = "slot";
2796
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
2797
+ if (shadowRootNodes && win.document) {
2798
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
2799
+ if (childVNode.$name$) {
2800
+ childVNode.$elm$.setAttribute("name", slotName);
2801
+ }
2802
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
2803
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
2804
+ } else {
2805
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
2806
+ }
2807
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
2808
+ node.remove();
2809
+ if (childVNode.$depth$ === "0") {
2810
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
2811
+ }
2812
+ } else {
2813
+ const slot = childVNode.$elm$;
2814
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
2815
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
2816
+ patchSlotNode(node);
2817
+ if (shouldMove) {
2818
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
2819
+ }
2820
+ }
2821
+ childRenderNodes.push(childVNode);
2822
+ slotNodes.push(childVNode);
2823
+ if (!parentVNode.$children$) {
2824
+ parentVNode.$children$ = [];
2825
+ }
2826
+ parentVNode.$children$[childVNode.$index$] = childVNode;
2827
+ }
2828
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
2829
+ var _a, _b;
2830
+ let slottedNode = slotNode.nextSibling;
2831
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
2832
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
2833
+ do {
2834
+ if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
2835
+ slottedNode["s-sn"] = slotName;
2836
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
2837
+ }
2838
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
2839
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
2840
+ };
2841
+ var findCorrespondingNode = (node, type) => {
2842
+ let sibling = node;
2843
+ do {
2844
+ sibling = sibling.nextSibling;
2845
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
2846
+ return sibling;
2847
+ };
2255
2848
  var createSupportsRuleRe = (selector) => {
2256
2849
  const safeSelector2 = escapeRegExpSpecialCharacters(selector);
2257
2850
  return new RegExp(
@@ -2265,6 +2858,10 @@ createSupportsRuleRe("::slotted");
2265
2858
  createSupportsRuleRe(":host");
2266
2859
  createSupportsRuleRe(":host-context");
2267
2860
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2861
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2862
+ propValue = deserializeProperty(propValue);
2863
+ return propValue;
2864
+ }
2268
2865
  if (propValue != null && !isComplexType(propValue)) {
2269
2866
  if (propType & 4 /* Boolean */) {
2270
2867
  if (isFormAssociated && typeof propValue === "string") {
@@ -2317,7 +2914,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2317
2914
  const classList = elm.classList;
2318
2915
  const oldClasses = parseClassList(oldValue);
2319
2916
  let newClasses = parseClassList(newValue);
2320
- {
2917
+ if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
2918
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2919
+ newClasses.push(scopeId2);
2920
+ oldClasses.forEach((c) => {
2921
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2922
+ });
2923
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2924
+ classList.add(...newClasses);
2925
+ } else {
2321
2926
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
2322
2927
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
2323
2928
  }
@@ -2426,7 +3031,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2426
3031
  oldVnodeAttrs[memberName],
2427
3032
  void 0,
2428
3033
  isSvgMode2,
2429
- newVnode.$flags$);
3034
+ newVnode.$flags$,
3035
+ isInitialRender
3036
+ );
2430
3037
  }
2431
3038
  }
2432
3039
  }
@@ -2437,7 +3044,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2437
3044
  oldVnodeAttrs[memberName],
2438
3045
  newVnodeAttrs[memberName],
2439
3046
  isSvgMode2,
2440
- newVnode.$flags$);
3047
+ newVnode.$flags$,
3048
+ isInitialRender
3049
+ );
2441
3050
  }
2442
3051
  };
2443
3052
  function sortedAttrNames(attrNames) {
@@ -2727,7 +3336,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2727
3336
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
2728
3337
  }
2729
3338
  {
2730
- updateElement(oldVNode, newVNode2, isSvgMode);
3339
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
2731
3340
  }
2732
3341
  if (oldChildren !== null && newChildren !== null) {
2733
3342
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -2741,7 +3350,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2741
3350
  !isInitialRender && BUILD.updatable && oldChildren !== null
2742
3351
  ) {
2743
3352
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2744
- } else ;
3353
+ } else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
3354
+ newVNode2.$children$ = oldChildren;
3355
+ }
2745
3356
  if (isSvgMode && tag === "svg") {
2746
3357
  isSvgMode = false;
2747
3358
  }
@@ -3095,7 +3706,13 @@ var postUpdateComponent = (hostRef) => {
3095
3706
  }
3096
3707
  };
3097
3708
  var appDidLoad = (who) => {
3709
+ var _a;
3098
3710
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3711
+ {
3712
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3713
+ plt.$orgLocNodes$.clear();
3714
+ }
3715
+ }
3099
3716
  };
3100
3717
  var safeCall = (instance, method, arg, elm) => {
3101
3718
  if (instance && instance[method]) {
@@ -3441,7 +4058,21 @@ var connectedCallback = (elm) => {
3441
4058
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
3442
4059
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
3443
4060
  hostRef.$flags$ |= 1 /* hasConnected */;
4061
+ let hostId;
3444
4062
  {
4063
+ hostId = elm.getAttribute(HYDRATE_ID);
4064
+ if (hostId) {
4065
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4066
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
4067
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
4068
+ } else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4069
+ const scopeId2 = getScopeId(cmpMeta);
4070
+ elm["s-sc"] = scopeId2;
4071
+ }
4072
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
4073
+ }
4074
+ }
4075
+ if (!hostId) {
3445
4076
  if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3446
4077
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3447
4078
  setContentReference(elm);
@@ -3450,7 +4081,7 @@ var connectedCallback = (elm) => {
3450
4081
  {
3451
4082
  let ancestorComponent = elm;
3452
4083
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
3453
- if (ancestorComponent["s-p"]) {
4084
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
3454
4085
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
3455
4086
  break;
3456
4087
  }
@@ -3536,6 +4167,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3536
4167
  let isBootstrapping = true;
3537
4168
  Object.assign(plt, options);
3538
4169
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
4170
+ {
4171
+ plt.$flags$ |= 2 /* appLoaded */;
4172
+ }
4173
+ {
4174
+ hydrateScopedToShadow();
4175
+ }
3539
4176
  let hasSlotRelocation = false;
3540
4177
  lazyBundles.map((lazyBundle) => {
3541
4178
  lazyBundle[1].map((compactMeta) => {