@stencil/core 4.35.1-dev.1750655001.8b007e9 → 4.35.1-dev.1750741417.3f80413

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.35.1-dev.1750655001.8b007e9 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.35.1-dev.1750741417.3f80413 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.35.1-dev.1750655001.8b007e9 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.35.1-dev.1750741417.3f80413 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -278,7 +278,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
278
278
  import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
279
279
 
280
280
  // src/runtime/client-hydrate.ts
281
- import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
281
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
282
282
 
283
283
  // src/runtime/dom-extras.ts
284
284
  import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
@@ -912,8 +912,125 @@ var installDevTools = () => {
912
912
  }
913
913
  };
914
914
 
915
- // src/runtime/vdom/h.ts
915
+ // src/runtime/styles.ts
916
916
  import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
917
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
918
+ var registerStyle = (scopeId2, cssText, allowCS) => {
919
+ let style = styles.get(scopeId2);
920
+ if (supportsConstructableStylesheets && allowCS) {
921
+ style = style || new CSSStyleSheet();
922
+ if (typeof style === "string") {
923
+ style = cssText;
924
+ } else {
925
+ style.replaceSync(cssText);
926
+ }
927
+ } else {
928
+ style = cssText;
929
+ }
930
+ styles.set(scopeId2, style);
931
+ };
932
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
933
+ var _a;
934
+ const scopeId2 = getScopeId(cmpMeta, mode);
935
+ const style = styles.get(scopeId2);
936
+ if (!BUILD6.attachStyles || !win.document) {
937
+ return scopeId2;
938
+ }
939
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
940
+ if (style) {
941
+ if (typeof style === "string") {
942
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
943
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
944
+ let styleElm;
945
+ if (!appliedStyles) {
946
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
947
+ }
948
+ if (!appliedStyles.has(scopeId2)) {
949
+ if (BUILD6.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
950
+ styleElm.innerHTML = style;
951
+ } else {
952
+ styleElm = win.document.createElement("style");
953
+ styleElm.innerHTML = style;
954
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
955
+ if (nonce != null) {
956
+ styleElm.setAttribute("nonce", nonce);
957
+ }
958
+ if ((BUILD6.hydrateServerSide || BUILD6.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
959
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
960
+ }
961
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
962
+ if (styleContainerNode.nodeName === "HEAD") {
963
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
964
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
965
+ styleContainerNode.insertBefore(
966
+ styleElm,
967
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
968
+ );
969
+ } else if ("host" in styleContainerNode) {
970
+ if (supportsConstructableStylesheets) {
971
+ const stylesheet = new CSSStyleSheet();
972
+ stylesheet.replaceSync(style);
973
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
974
+ } else {
975
+ const existingStyleContainer = styleContainerNode.querySelector("style");
976
+ if (existingStyleContainer) {
977
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
978
+ } else {
979
+ styleContainerNode.prepend(styleElm);
980
+ }
981
+ }
982
+ } else {
983
+ styleContainerNode.append(styleElm);
984
+ }
985
+ }
986
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
987
+ styleContainerNode.insertBefore(styleElm, null);
988
+ }
989
+ }
990
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
991
+ styleElm.innerHTML += SLOT_FB_CSS;
992
+ }
993
+ if (appliedStyles) {
994
+ appliedStyles.add(scopeId2);
995
+ }
996
+ }
997
+ } else if (BUILD6.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
998
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
999
+ }
1000
+ }
1001
+ return scopeId2;
1002
+ };
1003
+ var attachStyles = (hostRef) => {
1004
+ const cmpMeta = hostRef.$cmpMeta$;
1005
+ const elm = hostRef.$hostElement$;
1006
+ const flags = cmpMeta.$flags$;
1007
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1008
+ const scopeId2 = addStyle(
1009
+ BUILD6.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1010
+ cmpMeta,
1011
+ hostRef.$modeName$
1012
+ );
1013
+ if ((BUILD6.shadowDom || BUILD6.scoped) && BUILD6.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1014
+ elm["s-sc"] = scopeId2;
1015
+ elm.classList.add(scopeId2 + "-h");
1016
+ }
1017
+ endAttachStyles();
1018
+ };
1019
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD6.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1020
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1021
+ var hydrateScopedToShadow = () => {
1022
+ if (!win.document) {
1023
+ return;
1024
+ }
1025
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1026
+ let i2 = 0;
1027
+ for (; i2 < styles2.length; i2++) {
1028
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1029
+ }
1030
+ };
1031
+
1032
+ // src/runtime/vdom/h.ts
1033
+ import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
917
1034
  var h = (nodeName, vnodeData, ...children) => {
918
1035
  let child = null;
919
1036
  let key = null;
@@ -929,7 +1046,7 @@ var h = (nodeName, vnodeData, ...children) => {
929
1046
  } else if (child != null && typeof child !== "boolean") {
930
1047
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
931
1048
  child = String(child);
932
- } else if (BUILD6.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1049
+ } else if (BUILD7.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
933
1050
  consoleDevError(`vNode passed as children has unexpected type.
934
1051
  Make sure it's using the correct h() function.
935
1052
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -945,28 +1062,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
945
1062
  };
946
1063
  walk(children);
947
1064
  if (vnodeData) {
948
- if (BUILD6.isDev && nodeName === "input") {
1065
+ if (BUILD7.isDev && nodeName === "input") {
949
1066
  validateInputProperties(vnodeData);
950
1067
  }
951
- if (BUILD6.vdomKey && vnodeData.key) {
1068
+ if (BUILD7.vdomKey && vnodeData.key) {
952
1069
  key = vnodeData.key;
953
1070
  }
954
- if (BUILD6.slotRelocation && vnodeData.name) {
1071
+ if (BUILD7.slotRelocation && vnodeData.name) {
955
1072
  slotName = vnodeData.name;
956
1073
  }
957
- if (BUILD6.vdomClass) {
1074
+ if (BUILD7.vdomClass) {
958
1075
  const classData = vnodeData.className || vnodeData.class;
959
1076
  if (classData) {
960
1077
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
961
1078
  }
962
1079
  }
963
1080
  }
964
- if (BUILD6.isDev && vNodeChildren.some(isHost)) {
1081
+ if (BUILD7.isDev && vNodeChildren.some(isHost)) {
965
1082
  consoleDevError(`The <Host> must be the single root component. Make sure:
966
1083
  - You are NOT using hostData() and <Host> in the same component.
967
1084
  - <Host> is used once, and it's the single root component of the render() function.`);
968
1085
  }
969
- if (BUILD6.vdomFunctional && typeof nodeName === "function") {
1086
+ if (BUILD7.vdomFunctional && typeof nodeName === "function") {
970
1087
  return nodeName(
971
1088
  vnodeData === null ? {} : vnodeData,
972
1089
  vNodeChildren,
@@ -978,10 +1095,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
978
1095
  if (vNodeChildren.length > 0) {
979
1096
  vnode.$children$ = vNodeChildren;
980
1097
  }
981
- if (BUILD6.vdomKey) {
1098
+ if (BUILD7.vdomKey) {
982
1099
  vnode.$key$ = key;
983
1100
  }
984
- if (BUILD6.slotRelocation) {
1101
+ if (BUILD7.slotRelocation) {
985
1102
  vnode.$name$ = slotName;
986
1103
  }
987
1104
  return vnode;
@@ -994,13 +1111,13 @@ var newVNode = (tag, text) => {
994
1111
  $elm$: null,
995
1112
  $children$: null
996
1113
  };
997
- if (BUILD6.vdomAttribute) {
1114
+ if (BUILD7.vdomAttribute) {
998
1115
  vnode.$attrs$ = null;
999
1116
  }
1000
- if (BUILD6.vdomKey) {
1117
+ if (BUILD7.vdomKey) {
1001
1118
  vnode.$key$ = null;
1002
1119
  }
1003
- if (BUILD6.slotRelocation) {
1120
+ if (BUILD7.slotRelocation) {
1004
1121
  vnode.$name$ = null;
1005
1122
  }
1006
1123
  return vnode;
@@ -1054,18 +1171,18 @@ var validateInputProperties = (inputElm) => {
1054
1171
 
1055
1172
  // src/runtime/client-hydrate.ts
1056
1173
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1057
- var _a;
1174
+ var _a, _b;
1058
1175
  const endHydrate = createTime("hydrateClient", tagName);
1059
1176
  const shadowRoot = hostElm.shadowRoot;
1060
1177
  const childRenderNodes = [];
1061
1178
  const slotNodes = [];
1062
1179
  const slottedNodes = [];
1063
- const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
1180
+ const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
1064
1181
  const vnode = newVNode(tagName, null);
1065
1182
  vnode.$elm$ = hostElm;
1066
1183
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1067
1184
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1068
- var _a2, _b;
1185
+ var _a2, _b2;
1069
1186
  if (!(memberFlags & 31 /* Prop */)) {
1070
1187
  return;
1071
1188
  }
@@ -1075,13 +1192,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1075
1192
  const attrPropVal = parsePropertyValue(
1076
1193
  attrVal,
1077
1194
  memberFlags,
1078
- BUILD7.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1195
+ BUILD8.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1079
1196
  );
1080
- (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1197
+ (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1081
1198
  }
1082
1199
  });
1083
1200
  let scopeId2;
1084
- if (BUILD7.scoped) {
1201
+ if (BUILD8.scoped) {
1085
1202
  const cmpMeta = hostRef.$cmpMeta$;
1086
1203
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1087
1204
  scopeId2 = hostElm["s-sc"];
@@ -1118,6 +1235,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1118
1235
  if (childRenderNode.$tag$ === "slot") {
1119
1236
  node["s-cr"] = hostElm["s-cr"];
1120
1237
  }
1238
+ } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
1239
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1240
+ const scopeId3 = getScopeId(
1241
+ cmpMeta.$cmpMeta$,
1242
+ BUILD8.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1243
+ );
1244
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1245
+ if (styleSheet) {
1246
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1247
+ }
1121
1248
  }
1122
1249
  if (childRenderNode.$tag$ === "slot") {
1123
1250
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1133,7 +1260,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1133
1260
  }
1134
1261
  }
1135
1262
  if (orgLocationNode && orgLocationNode.isConnected) {
1136
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1263
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1137
1264
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1138
1265
  }
1139
1266
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1141,7 +1268,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1141
1268
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1142
1269
  }
1143
1270
  }
1144
- plt.$orgLocNodes$.delete(orgLocationId);
1271
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1272
+ plt.$orgLocNodes$.delete(orgLocationId);
1273
+ }
1145
1274
  }
1146
1275
  const hosts = [];
1147
1276
  const snLen = slottedNodes.length;
@@ -1163,14 +1292,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1163
1292
  if (!hosts[slottedItem.hostId]) continue;
1164
1293
  const hostEle = hosts[slottedItem.hostId];
1165
1294
  if (!hostEle.shadowRoot || !shadowRoot) {
1166
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1167
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1168
- slottedItem.slot["s-cr"] = hostEle;
1169
- } else {
1170
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1295
+ if (!slottedItem.slot["s-cr"]) {
1296
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1297
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1298
+ slottedItem.slot["s-cr"] = hostEle;
1299
+ } else {
1300
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1301
+ }
1171
1302
  }
1172
1303
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1173
- if (BUILD7.experimentalSlotFixes) {
1304
+ if (BUILD8.experimentalSlotFixes) {
1174
1305
  patchSlottedNode(slottedItem.node);
1175
1306
  }
1176
1307
  }
@@ -1179,12 +1310,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1179
1310
  }
1180
1311
  }
1181
1312
  }
1182
- if (BUILD7.scoped && scopeId2 && slotNodes.length) {
1313
+ if (BUILD8.scoped && scopeId2 && slotNodes.length) {
1183
1314
  slotNodes.forEach((slot) => {
1184
1315
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1185
1316
  });
1186
1317
  }
1187
- if (BUILD7.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1318
+ if (BUILD8.shadowDom && shadowRoot) {
1188
1319
  let rnIdex = 0;
1189
1320
  const rnLen = shadowRootNodes.length;
1190
1321
  if (rnLen) {
@@ -1195,14 +1326,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1195
1326
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1196
1327
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1197
1328
  node.removeAttribute("hidden");
1198
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1329
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1199
1330
  node.parentNode.removeChild(node);
1200
1331
  }
1201
1332
  }
1202
1333
  });
1203
1334
  }
1204
1335
  }
1205
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
1206
1336
  hostRef.$hostElement$ = hostElm;
1207
1337
  endHydrate();
1208
1338
  };
@@ -1234,7 +1364,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1234
1364
  if (!parentVNode.$children$) {
1235
1365
  parentVNode.$children$ = [];
1236
1366
  }
1237
- if (BUILD7.scoped && scopeId2) {
1367
+ if (BUILD8.scoped && scopeId2 && childIdSplt[0] === hostId) {
1238
1368
  node["s-si"] = scopeId2;
1239
1369
  childVNode.$attrs$.class += " " + scopeId2;
1240
1370
  }
@@ -1252,7 +1382,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1252
1382
  shadowRootNodes,
1253
1383
  slottedNodes
1254
1384
  );
1255
- if (BUILD7.scoped && scopeId2) {
1385
+ if (BUILD8.scoped && scopeId2) {
1256
1386
  node.classList.add(scopeId2);
1257
1387
  }
1258
1388
  }
@@ -1349,9 +1479,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1349
1479
  slottedNodes
1350
1480
  );
1351
1481
  } else if (childNodeType === CONTENT_REF_ID) {
1352
- if (BUILD7.shadowDom && shadowRootNodes) {
1482
+ if (BUILD8.shadowDom && shadowRootNodes) {
1353
1483
  node.remove();
1354
- } else if (BUILD7.slotRelocation) {
1484
+ } else if (BUILD8.slotRelocation) {
1355
1485
  hostElm["s-cr"] = node;
1356
1486
  node["s-cn"] = true;
1357
1487
  }
@@ -1364,7 +1494,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1364
1494
  vnode.$index$ = "0";
1365
1495
  parentVNode.$children$ = [vnode];
1366
1496
  } else {
1367
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1497
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1368
1498
  node.remove();
1369
1499
  }
1370
1500
  }
@@ -1417,15 +1547,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1417
1547
  childVNode.$name$ = slotName || null;
1418
1548
  childVNode.$tag$ = "slot";
1419
1549
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1420
- if (BUILD7.shadowDom && shadowRootNodes && win.document) {
1550
+ if (BUILD8.shadowDom && shadowRootNodes && win.document) {
1421
1551
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1422
1552
  if (childVNode.$name$) {
1423
1553
  childVNode.$elm$.setAttribute("name", slotName);
1424
1554
  }
1425
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1426
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1555
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1556
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1427
1557
  } else {
1428
- node.parentNode.insertBefore(slot, node);
1558
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1429
1559
  }
1430
1560
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1431
1561
  node.remove();
@@ -1451,7 +1581,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1451
1581
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1452
1582
  let slottedNode = slotNode.nextSibling;
1453
1583
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1454
- 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 */))) {
1584
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */ || slottedNode.tagName === "SLOT"))) {
1455
1585
  slottedNode["s-sn"] = slotName;
1456
1586
  slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1457
1587
  slottedNode = slottedNode.nextSibling;
@@ -1886,31 +2016,31 @@ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
1886
2016
  import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
1887
2017
 
1888
2018
  // src/runtime/parse-property-value.ts
1889
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
2019
+ import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1890
2020
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1891
- if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2021
+ if ((BUILD9.hydrateClientSide || BUILD9.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
1892
2022
  try {
1893
2023
  propValue = JSON.parse(propValue);
1894
2024
  return propValue;
1895
2025
  } catch (e) {
1896
2026
  }
1897
2027
  }
1898
- if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2028
+ if ((BUILD9.hydrateClientSide || BUILD9.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1899
2029
  propValue = deserializeProperty(propValue);
1900
2030
  return propValue;
1901
2031
  }
1902
2032
  if (propValue != null && !isComplexType(propValue)) {
1903
- if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
1904
- if (BUILD8.formAssociated && isFormAssociated && typeof propValue === "string") {
2033
+ if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
2034
+ if (BUILD9.formAssociated && isFormAssociated && typeof propValue === "string") {
1905
2035
  return propValue === "" || !!propValue;
1906
2036
  } else {
1907
2037
  return propValue === "false" ? false : propValue === "" || !!propValue;
1908
2038
  }
1909
2039
  }
1910
- if (BUILD8.propNumber && propType & 2 /* Number */) {
2040
+ if (BUILD9.propNumber && propType & 2 /* Number */) {
1911
2041
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
1912
2042
  }
1913
- if (BUILD8.propString && propType & 1 /* String */) {
2043
+ if (BUILD9.propString && propType & 1 /* String */) {
1914
2044
  return String(propValue);
1915
2045
  }
1916
2046
  return propValue;
@@ -1922,18 +2052,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1922
2052
  import { BUILD as BUILD15, NAMESPACE } from "@stencil/core/internal/app-data";
1923
2053
 
1924
2054
  // src/runtime/event-emitter.ts
1925
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
2055
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1926
2056
 
1927
2057
  // src/runtime/element.ts
1928
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1929
- var getElement = (ref) => BUILD9.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2058
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
2059
+ var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1930
2060
 
1931
2061
  // src/runtime/event-emitter.ts
1932
2062
  var createEvent = (ref, name, flags) => {
1933
2063
  const elm = getElement(ref);
1934
2064
  return {
1935
2065
  emit: (detail) => {
1936
- if (BUILD10.isDev && !elm.isConnected) {
2066
+ if (BUILD11.isDev && !elm.isConnected) {
1937
2067
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1938
2068
  }
1939
2069
  return emitEvent(elm, name, {
@@ -1951,123 +2081,6 @@ var emitEvent = (elm, name, opts) => {
1951
2081
  return ev;
1952
2082
  };
1953
2083
 
1954
- // src/runtime/styles.ts
1955
- import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1956
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1957
- var registerStyle = (scopeId2, cssText, allowCS) => {
1958
- let style = styles.get(scopeId2);
1959
- if (supportsConstructableStylesheets && allowCS) {
1960
- style = style || new CSSStyleSheet();
1961
- if (typeof style === "string") {
1962
- style = cssText;
1963
- } else {
1964
- style.replaceSync(cssText);
1965
- }
1966
- } else {
1967
- style = cssText;
1968
- }
1969
- styles.set(scopeId2, style);
1970
- };
1971
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1972
- var _a;
1973
- const scopeId2 = getScopeId(cmpMeta, mode);
1974
- const style = styles.get(scopeId2);
1975
- if (!BUILD11.attachStyles || !win.document) {
1976
- return scopeId2;
1977
- }
1978
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1979
- if (style) {
1980
- if (typeof style === "string") {
1981
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1982
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1983
- let styleElm;
1984
- if (!appliedStyles) {
1985
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1986
- }
1987
- if (!appliedStyles.has(scopeId2)) {
1988
- if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1989
- styleElm.innerHTML = style;
1990
- } else {
1991
- styleElm = win.document.createElement("style");
1992
- styleElm.innerHTML = style;
1993
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1994
- if (nonce != null) {
1995
- styleElm.setAttribute("nonce", nonce);
1996
- }
1997
- if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
1998
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1999
- }
2000
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2001
- if (styleContainerNode.nodeName === "HEAD") {
2002
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2003
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2004
- styleContainerNode.insertBefore(
2005
- styleElm,
2006
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2007
- );
2008
- } else if ("host" in styleContainerNode) {
2009
- if (supportsConstructableStylesheets) {
2010
- const stylesheet = new CSSStyleSheet();
2011
- stylesheet.replaceSync(style);
2012
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2013
- } else {
2014
- const existingStyleContainer = styleContainerNode.querySelector("style");
2015
- if (existingStyleContainer) {
2016
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2017
- } else {
2018
- styleContainerNode.prepend(styleElm);
2019
- }
2020
- }
2021
- } else {
2022
- styleContainerNode.append(styleElm);
2023
- }
2024
- }
2025
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2026
- styleContainerNode.insertBefore(styleElm, null);
2027
- }
2028
- }
2029
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2030
- styleElm.innerHTML += SLOT_FB_CSS;
2031
- }
2032
- if (appliedStyles) {
2033
- appliedStyles.add(scopeId2);
2034
- }
2035
- }
2036
- } else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2037
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2038
- }
2039
- }
2040
- return scopeId2;
2041
- };
2042
- var attachStyles = (hostRef) => {
2043
- const cmpMeta = hostRef.$cmpMeta$;
2044
- const elm = hostRef.$hostElement$;
2045
- const flags = cmpMeta.$flags$;
2046
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2047
- const scopeId2 = addStyle(
2048
- BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2049
- cmpMeta,
2050
- hostRef.$modeName$
2051
- );
2052
- if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2053
- elm["s-sc"] = scopeId2;
2054
- elm.classList.add(scopeId2 + "-h");
2055
- }
2056
- endAttachStyles();
2057
- };
2058
- var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2059
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2060
- var hydrateScopedToShadow = () => {
2061
- if (!win.document) {
2062
- return;
2063
- }
2064
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2065
- let i2 = 0;
2066
- for (; i2 < styles2.length; i2++) {
2067
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2068
- }
2069
- };
2070
-
2071
2084
  // src/runtime/vdom/vdom-render.ts
2072
2085
  import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
2073
2086
 
@@ -2086,12 +2099,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2086
2099
  const classList = elm.classList;
2087
2100
  const oldClasses = parseClassList(oldValue);
2088
2101
  let newClasses = parseClassList(newValue);
2089
- if (BUILD12.hydrateClientSide && elm["s-si"] && initialRender) {
2090
- newClasses.push(elm["s-si"]);
2102
+ if (BUILD12.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2103
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2104
+ newClasses.push(scopeId2);
2091
2105
  oldClasses.forEach((c) => {
2092
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
2106
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2093
2107
  });
2094
- newClasses = [...new Set(newClasses)];
2108
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2095
2109
  classList.add(...newClasses);
2096
2110
  } else {
2097
2111
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -3040,10 +3054,16 @@ var forceUpdate = (ref) => {
3040
3054
  return false;
3041
3055
  };
3042
3056
  var appDidLoad = (who) => {
3057
+ var _a;
3043
3058
  if (BUILD15.asyncQueue) {
3044
3059
  plt.$flags$ |= 2 /* appLoaded */;
3045
3060
  }
3046
3061
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3062
+ if (BUILD15.hydrateClientSide) {
3063
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3064
+ plt.$orgLocNodes$.clear();
3065
+ }
3066
+ }
3047
3067
  if (BUILD15.profile && performance.measure) {
3048
3068
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3049
3069
  }
@@ -3475,6 +3495,11 @@ var connectedCallback = (elm) => {
3475
3495
  if (BUILD19.hydrateServerSide || (BUILD19.slot || BUILD19.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3476
3496
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3477
3497
  setContentReference(elm);
3498
+ } else if (BUILD19.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3499
+ const commendPlaceholder = elm.firstChild;
3500
+ if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3501
+ elm.removeChild(commendPlaceholder);
3502
+ }
3478
3503
  }
3479
3504
  }
3480
3505
  if (BUILD19.asyncLoading) {
@@ -3579,7 +3604,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
3579
3604
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3580
3605
  }
3581
3606
  if (BUILD21.experimentalSlotFixes) {
3582
- if (BUILD21.slot && cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
3607
+ if (BUILD21.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3583
3608
  patchPseudoShadowDom(Cstr.prototype);
3584
3609
  }
3585
3610
  } else {
@@ -3796,7 +3821,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3796
3821
  }
3797
3822
  };
3798
3823
  if (BUILD22.experimentalSlotFixes) {
3799
- if (BUILD22.slot && cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
3824
+ if (BUILD22.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3800
3825
  patchPseudoShadowDom(HostElement.prototype);
3801
3826
  }
3802
3827
  } else {