@stencil/core 4.35.3-dev.1752161791.11e6f9d → 4.35.3-dev.1752253566.6106c70

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 Hydrate Platform v4.35.3-dev.1752161791.11e6f9d | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.35.3-dev.1752253566.6106c70 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -293,7 +293,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
293
293
  import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
294
294
 
295
295
  // src/runtime/client-hydrate.ts
296
- import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
296
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
297
297
 
298
298
  // src/runtime/dom-extras.ts
299
299
  import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
@@ -819,6 +819,9 @@ var validNodesPatches = [
819
819
  "parentNode"
820
820
  ];
821
821
  function patchHostOriginalAccessor(accessorName, node) {
822
+ if (!globalThis.Node || !globalThis.Element) {
823
+ return;
824
+ }
822
825
  let accessor;
823
826
  if (validElementPatches.includes(accessorName)) {
824
827
  accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
@@ -927,8 +930,133 @@ var installDevTools = () => {
927
930
  }
928
931
  };
929
932
 
930
- // src/runtime/vdom/h.ts
933
+ // src/runtime/styles.ts
931
934
  import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
935
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
936
+ var registerStyle = (scopeId2, cssText, allowCS) => {
937
+ let style = styles.get(scopeId2);
938
+ if (supportsConstructableStylesheets && allowCS) {
939
+ style = style || new CSSStyleSheet();
940
+ if (typeof style === "string") {
941
+ style = cssText;
942
+ } else {
943
+ style.replaceSync(cssText);
944
+ }
945
+ } else {
946
+ style = cssText;
947
+ }
948
+ styles.set(scopeId2, style);
949
+ };
950
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
951
+ var _a;
952
+ const scopeId2 = getScopeId(cmpMeta, mode);
953
+ const style = styles.get(scopeId2);
954
+ if (!BUILD6.attachStyles || !win.document) {
955
+ return scopeId2;
956
+ }
957
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
958
+ if (style) {
959
+ if (typeof style === "string") {
960
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
961
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
962
+ let styleElm;
963
+ if (!appliedStyles) {
964
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
965
+ }
966
+ if (!appliedStyles.has(scopeId2)) {
967
+ if (BUILD6.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
968
+ styleElm.innerHTML = style;
969
+ } else {
970
+ styleElm = win.document.createElement("style");
971
+ styleElm.innerHTML = style;
972
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
973
+ if (nonce != null) {
974
+ styleElm.setAttribute("nonce", nonce);
975
+ }
976
+ if ((BUILD6.hydrateServerSide || BUILD6.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
977
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
978
+ }
979
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
980
+ if (styleContainerNode.nodeName === "HEAD") {
981
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
982
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
983
+ styleContainerNode.insertBefore(
984
+ styleElm,
985
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
986
+ );
987
+ } else if ("host" in styleContainerNode) {
988
+ if (supportsConstructableStylesheets) {
989
+ const stylesheet = new CSSStyleSheet();
990
+ stylesheet.replaceSync(style);
991
+ if (supportsMutableAdoptedStyleSheets) {
992
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
993
+ } else {
994
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
995
+ }
996
+ } else {
997
+ const existingStyleContainer = styleContainerNode.querySelector("style");
998
+ if (existingStyleContainer) {
999
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1000
+ } else {
1001
+ styleContainerNode.prepend(styleElm);
1002
+ }
1003
+ }
1004
+ } else {
1005
+ styleContainerNode.append(styleElm);
1006
+ }
1007
+ }
1008
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1009
+ styleContainerNode.insertBefore(styleElm, null);
1010
+ }
1011
+ }
1012
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1013
+ styleElm.innerHTML += SLOT_FB_CSS;
1014
+ }
1015
+ if (appliedStyles) {
1016
+ appliedStyles.add(scopeId2);
1017
+ }
1018
+ }
1019
+ } else if (BUILD6.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1020
+ if (supportsMutableAdoptedStyleSheets) {
1021
+ styleContainerNode.adoptedStyleSheets.push(style);
1022
+ } else {
1023
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1024
+ }
1025
+ }
1026
+ }
1027
+ return scopeId2;
1028
+ };
1029
+ var attachStyles = (hostRef) => {
1030
+ const cmpMeta = hostRef.$cmpMeta$;
1031
+ const elm = hostRef.$hostElement$;
1032
+ const flags = cmpMeta.$flags$;
1033
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1034
+ const scopeId2 = addStyle(
1035
+ BUILD6.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1036
+ cmpMeta,
1037
+ hostRef.$modeName$
1038
+ );
1039
+ if ((BUILD6.shadowDom || BUILD6.scoped) && BUILD6.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1040
+ elm["s-sc"] = scopeId2;
1041
+ elm.classList.add(scopeId2 + "-h");
1042
+ }
1043
+ endAttachStyles();
1044
+ };
1045
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD6.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1046
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1047
+ var hydrateScopedToShadow = () => {
1048
+ if (!win.document) {
1049
+ return;
1050
+ }
1051
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1052
+ let i2 = 0;
1053
+ for (; i2 < styles2.length; i2++) {
1054
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1055
+ }
1056
+ };
1057
+
1058
+ // src/runtime/vdom/h.ts
1059
+ import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
932
1060
  var h = (nodeName, vnodeData, ...children) => {
933
1061
  let child = null;
934
1062
  let key = null;
@@ -944,7 +1072,7 @@ var h = (nodeName, vnodeData, ...children) => {
944
1072
  } else if (child != null && typeof child !== "boolean") {
945
1073
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
946
1074
  child = String(child);
947
- } else if (BUILD6.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1075
+ } else if (BUILD7.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
948
1076
  consoleDevError(`vNode passed as children has unexpected type.
949
1077
  Make sure it's using the correct h() function.
950
1078
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -960,28 +1088,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
960
1088
  };
961
1089
  walk(children);
962
1090
  if (vnodeData) {
963
- if (BUILD6.isDev && nodeName === "input") {
1091
+ if (BUILD7.isDev && nodeName === "input") {
964
1092
  validateInputProperties(vnodeData);
965
1093
  }
966
- if (BUILD6.vdomKey && vnodeData.key) {
1094
+ if (BUILD7.vdomKey && vnodeData.key) {
967
1095
  key = vnodeData.key;
968
1096
  }
969
- if (BUILD6.slotRelocation && vnodeData.name) {
1097
+ if (BUILD7.slotRelocation && vnodeData.name) {
970
1098
  slotName = vnodeData.name;
971
1099
  }
972
- if (BUILD6.vdomClass) {
1100
+ if (BUILD7.vdomClass) {
973
1101
  const classData = vnodeData.className || vnodeData.class;
974
1102
  if (classData) {
975
1103
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
976
1104
  }
977
1105
  }
978
1106
  }
979
- if (BUILD6.isDev && vNodeChildren.some(isHost)) {
1107
+ if (BUILD7.isDev && vNodeChildren.some(isHost)) {
980
1108
  consoleDevError(`The <Host> must be the single root component. Make sure:
981
1109
  - You are NOT using hostData() and <Host> in the same component.
982
1110
  - <Host> is used once, and it's the single root component of the render() function.`);
983
1111
  }
984
- if (BUILD6.vdomFunctional && typeof nodeName === "function") {
1112
+ if (BUILD7.vdomFunctional && typeof nodeName === "function") {
985
1113
  return nodeName(
986
1114
  vnodeData === null ? {} : vnodeData,
987
1115
  vNodeChildren,
@@ -993,10 +1121,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
993
1121
  if (vNodeChildren.length > 0) {
994
1122
  vnode.$children$ = vNodeChildren;
995
1123
  }
996
- if (BUILD6.vdomKey) {
1124
+ if (BUILD7.vdomKey) {
997
1125
  vnode.$key$ = key;
998
1126
  }
999
- if (BUILD6.slotRelocation) {
1127
+ if (BUILD7.slotRelocation) {
1000
1128
  vnode.$name$ = slotName;
1001
1129
  }
1002
1130
  return vnode;
@@ -1009,13 +1137,13 @@ var newVNode = (tag, text) => {
1009
1137
  $elm$: null,
1010
1138
  $children$: null
1011
1139
  };
1012
- if (BUILD6.vdomAttribute) {
1140
+ if (BUILD7.vdomAttribute) {
1013
1141
  vnode.$attrs$ = null;
1014
1142
  }
1015
- if (BUILD6.vdomKey) {
1143
+ if (BUILD7.vdomKey) {
1016
1144
  vnode.$key$ = null;
1017
1145
  }
1018
- if (BUILD6.slotRelocation) {
1146
+ if (BUILD7.slotRelocation) {
1019
1147
  vnode.$name$ = null;
1020
1148
  }
1021
1149
  return vnode;
@@ -1069,18 +1197,18 @@ var validateInputProperties = (inputElm) => {
1069
1197
 
1070
1198
  // src/runtime/client-hydrate.ts
1071
1199
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1072
- var _a;
1200
+ var _a, _b, _c;
1073
1201
  const endHydrate = createTime("hydrateClient", tagName);
1074
1202
  const shadowRoot = hostElm.shadowRoot;
1075
1203
  const childRenderNodes = [];
1076
1204
  const slotNodes = [];
1077
1205
  const slottedNodes = [];
1078
- const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
1206
+ const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
1079
1207
  const vnode = newVNode(tagName, null);
1080
1208
  vnode.$elm$ = hostElm;
1081
1209
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1082
1210
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1083
- var _a2, _b;
1211
+ var _a2, _b2;
1084
1212
  if (!(memberFlags & 31 /* Prop */)) {
1085
1213
  return;
1086
1214
  }
@@ -1090,13 +1218,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1090
1218
  const attrPropVal = parsePropertyValue(
1091
1219
  attrVal,
1092
1220
  memberFlags,
1093
- BUILD7.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1221
+ BUILD8.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1094
1222
  );
1095
- (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1223
+ (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1096
1224
  }
1097
1225
  });
1098
1226
  let scopeId2;
1099
- if (BUILD7.scoped) {
1227
+ if (BUILD8.scoped) {
1100
1228
  const cmpMeta = hostRef.$cmpMeta$;
1101
1229
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1102
1230
  scopeId2 = hostElm["s-sc"];
@@ -1133,6 +1261,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1133
1261
  if (childRenderNode.$tag$ === "slot") {
1134
1262
  node["s-cr"] = hostElm["s-cr"];
1135
1263
  }
1264
+ } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
1265
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1266
+ const scopeId3 = getScopeId(
1267
+ cmpMeta.$cmpMeta$,
1268
+ BUILD8.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1269
+ );
1270
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1271
+ if (styleSheet) {
1272
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1273
+ }
1136
1274
  }
1137
1275
  if (childRenderNode.$tag$ === "slot") {
1138
1276
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1148,7 +1286,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1148
1286
  }
1149
1287
  }
1150
1288
  if (orgLocationNode && orgLocationNode.isConnected) {
1151
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1289
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1152
1290
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1153
1291
  }
1154
1292
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1156,7 +1294,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1156
1294
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1157
1295
  }
1158
1296
  }
1159
- plt.$orgLocNodes$.delete(orgLocationId);
1297
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1298
+ plt.$orgLocNodes$.delete(orgLocationId);
1299
+ }
1160
1300
  }
1161
1301
  const hosts = [];
1162
1302
  const snLen = slottedNodes.length;
@@ -1177,29 +1317,34 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1177
1317
  }
1178
1318
  if (!hosts[slottedItem.hostId]) continue;
1179
1319
  const hostEle = hosts[slottedItem.hostId];
1320
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1321
+ hostEle.appendChild(slottedItem.node);
1322
+ }
1180
1323
  if (!hostEle.shadowRoot || !shadowRoot) {
1181
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1182
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1183
- slottedItem.slot["s-cr"] = hostEle;
1184
- } else {
1185
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1324
+ if (!slottedItem.slot["s-cr"]) {
1325
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1326
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1327
+ slottedItem.slot["s-cr"] = hostEle;
1328
+ } else {
1329
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1330
+ }
1186
1331
  }
1187
1332
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1188
- if (BUILD7.experimentalSlotFixes) {
1333
+ if (((_c = slottedItem.node.parentElement) == null ? void 0 : _c.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
1334
+ slottedItem.node.removeAttribute("slot");
1335
+ }
1336
+ if (BUILD8.experimentalSlotFixes) {
1189
1337
  patchSlottedNode(slottedItem.node);
1190
1338
  }
1191
1339
  }
1192
- if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1193
- hostEle.appendChild(slottedItem.node);
1194
- }
1195
1340
  }
1196
1341
  }
1197
- if (BUILD7.scoped && scopeId2 && slotNodes.length) {
1342
+ if (BUILD8.scoped && scopeId2 && slotNodes.length) {
1198
1343
  slotNodes.forEach((slot) => {
1199
1344
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1200
1345
  });
1201
1346
  }
1202
- if (BUILD7.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1347
+ if (BUILD8.shadowDom && shadowRoot) {
1203
1348
  let rnIdex = 0;
1204
1349
  const rnLen = shadowRootNodes.length;
1205
1350
  if (rnLen) {
@@ -1210,14 +1355,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1210
1355
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1211
1356
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1212
1357
  node.removeAttribute("hidden");
1213
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1358
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1214
1359
  node.parentNode.removeChild(node);
1215
1360
  }
1216
1361
  }
1217
1362
  });
1218
1363
  }
1219
1364
  }
1220
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
1221
1365
  hostRef.$hostElement$ = hostElm;
1222
1366
  endHydrate();
1223
1367
  };
@@ -1249,7 +1393,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1249
1393
  if (!parentVNode.$children$) {
1250
1394
  parentVNode.$children$ = [];
1251
1395
  }
1252
- if (BUILD7.scoped && scopeId2) {
1396
+ if (BUILD8.scoped && scopeId2 && childIdSplt[0] === hostId) {
1253
1397
  node["s-si"] = scopeId2;
1254
1398
  childVNode.$attrs$.class += " " + scopeId2;
1255
1399
  }
@@ -1267,7 +1411,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1267
1411
  shadowRootNodes,
1268
1412
  slottedNodes
1269
1413
  );
1270
- if (BUILD7.scoped && scopeId2) {
1414
+ if (BUILD8.scoped && scopeId2) {
1271
1415
  node.classList.add(scopeId2);
1272
1416
  }
1273
1417
  }
@@ -1364,9 +1508,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1364
1508
  slottedNodes
1365
1509
  );
1366
1510
  } else if (childNodeType === CONTENT_REF_ID) {
1367
- if (BUILD7.shadowDom && shadowRootNodes) {
1511
+ if (BUILD8.shadowDom && shadowRootNodes) {
1368
1512
  node.remove();
1369
- } else if (BUILD7.slotRelocation) {
1513
+ } else if (BUILD8.slotRelocation) {
1370
1514
  hostElm["s-cr"] = node;
1371
1515
  node["s-cn"] = true;
1372
1516
  }
@@ -1379,7 +1523,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1379
1523
  vnode.$index$ = "0";
1380
1524
  parentVNode.$children$ = [vnode];
1381
1525
  } else {
1382
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1526
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1383
1527
  node.remove();
1384
1528
  }
1385
1529
  }
@@ -1432,15 +1576,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1432
1576
  childVNode.$name$ = slotName || null;
1433
1577
  childVNode.$tag$ = "slot";
1434
1578
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1435
- if (BUILD7.shadowDom && shadowRootNodes && win.document) {
1579
+ if (BUILD8.shadowDom && shadowRootNodes && win.document) {
1436
1580
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1437
1581
  if (childVNode.$name$) {
1438
1582
  childVNode.$elm$.setAttribute("name", slotName);
1439
1583
  }
1440
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1441
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1584
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1585
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1442
1586
  } else {
1443
- node.parentNode.insertBefore(slot, node);
1587
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1444
1588
  }
1445
1589
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1446
1590
  node.remove();
@@ -1464,13 +1608,17 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1464
1608
  parentVNode.$children$[childVNode.$index$] = childVNode;
1465
1609
  }
1466
1610
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1611
+ var _a, _b;
1467
1612
  let slottedNode = slotNode.nextSibling;
1468
1613
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1469
- 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 */))) {
1470
- slottedNode["s-sn"] = slotName;
1471
- slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1472
- slottedNode = slottedNode.nextSibling;
1473
- }
1614
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
1615
+ do {
1616
+ 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 */))) {
1617
+ slottedNode["s-sn"] = slotName;
1618
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1619
+ }
1620
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
1621
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
1474
1622
  };
1475
1623
  var findCorrespondingNode = (node, type) => {
1476
1624
  let sibling = node;
@@ -1901,31 +2049,31 @@ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
1901
2049
  import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
1902
2050
 
1903
2051
  // src/runtime/parse-property-value.ts
1904
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
2052
+ import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1905
2053
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1906
- if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2054
+ if ((BUILD9.hydrateClientSide || BUILD9.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
1907
2055
  try {
1908
2056
  propValue = JSON.parse(propValue);
1909
2057
  return propValue;
1910
2058
  } catch (e) {
1911
2059
  }
1912
2060
  }
1913
- if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2061
+ if ((BUILD9.hydrateClientSide || BUILD9.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1914
2062
  propValue = deserializeProperty(propValue);
1915
2063
  return propValue;
1916
2064
  }
1917
2065
  if (propValue != null && !isComplexType(propValue)) {
1918
- if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
1919
- if (BUILD8.formAssociated && isFormAssociated && typeof propValue === "string") {
2066
+ if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
2067
+ if (BUILD9.formAssociated && isFormAssociated && typeof propValue === "string") {
1920
2068
  return propValue === "" || !!propValue;
1921
2069
  } else {
1922
2070
  return propValue === "false" ? false : propValue === "" || !!propValue;
1923
2071
  }
1924
2072
  }
1925
- if (BUILD8.propNumber && propType & 2 /* Number */) {
2073
+ if (BUILD9.propNumber && propType & 2 /* Number */) {
1926
2074
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
1927
2075
  }
1928
- if (BUILD8.propString && propType & 1 /* String */) {
2076
+ if (BUILD9.propString && propType & 1 /* String */) {
1929
2077
  return String(propValue);
1930
2078
  }
1931
2079
  return propValue;
@@ -1937,18 +2085,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1937
2085
  import { BUILD as BUILD15, NAMESPACE } from "@stencil/core/internal/app-data";
1938
2086
 
1939
2087
  // src/runtime/event-emitter.ts
1940
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
2088
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1941
2089
 
1942
2090
  // src/runtime/element.ts
1943
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1944
- var getElement = (ref) => BUILD9.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2091
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
2092
+ var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1945
2093
 
1946
2094
  // src/runtime/event-emitter.ts
1947
2095
  var createEvent = (ref, name, flags) => {
1948
2096
  const elm = getElement(ref);
1949
2097
  return {
1950
2098
  emit: (detail) => {
1951
- if (BUILD10.isDev && !elm.isConnected) {
2099
+ if (BUILD11.isDev && !elm.isConnected) {
1952
2100
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1953
2101
  }
1954
2102
  return emitEvent(elm, name, {
@@ -1966,131 +2114,6 @@ var emitEvent = (elm, name, opts) => {
1966
2114
  return ev;
1967
2115
  };
1968
2116
 
1969
- // src/runtime/styles.ts
1970
- import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1971
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1972
- var registerStyle = (scopeId2, cssText, allowCS) => {
1973
- let style = styles.get(scopeId2);
1974
- if (supportsConstructableStylesheets && allowCS) {
1975
- style = style || new CSSStyleSheet();
1976
- if (typeof style === "string") {
1977
- style = cssText;
1978
- } else {
1979
- style.replaceSync(cssText);
1980
- }
1981
- } else {
1982
- style = cssText;
1983
- }
1984
- styles.set(scopeId2, style);
1985
- };
1986
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1987
- var _a;
1988
- const scopeId2 = getScopeId(cmpMeta, mode);
1989
- const style = styles.get(scopeId2);
1990
- if (!BUILD11.attachStyles || !win.document) {
1991
- return scopeId2;
1992
- }
1993
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1994
- if (style) {
1995
- if (typeof style === "string") {
1996
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1997
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1998
- let styleElm;
1999
- if (!appliedStyles) {
2000
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2001
- }
2002
- if (!appliedStyles.has(scopeId2)) {
2003
- if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2004
- styleElm.innerHTML = style;
2005
- } else {
2006
- styleElm = win.document.createElement("style");
2007
- styleElm.innerHTML = style;
2008
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2009
- if (nonce != null) {
2010
- styleElm.setAttribute("nonce", nonce);
2011
- }
2012
- if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2013
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2014
- }
2015
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2016
- if (styleContainerNode.nodeName === "HEAD") {
2017
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2018
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2019
- styleContainerNode.insertBefore(
2020
- styleElm,
2021
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2022
- );
2023
- } else if ("host" in styleContainerNode) {
2024
- if (supportsConstructableStylesheets) {
2025
- const stylesheet = new CSSStyleSheet();
2026
- stylesheet.replaceSync(style);
2027
- if (supportsMutableAdoptedStyleSheets) {
2028
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
2029
- } else {
2030
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2031
- }
2032
- } else {
2033
- const existingStyleContainer = styleContainerNode.querySelector("style");
2034
- if (existingStyleContainer) {
2035
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2036
- } else {
2037
- styleContainerNode.prepend(styleElm);
2038
- }
2039
- }
2040
- } else {
2041
- styleContainerNode.append(styleElm);
2042
- }
2043
- }
2044
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2045
- styleContainerNode.insertBefore(styleElm, null);
2046
- }
2047
- }
2048
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2049
- styleElm.innerHTML += SLOT_FB_CSS;
2050
- }
2051
- if (appliedStyles) {
2052
- appliedStyles.add(scopeId2);
2053
- }
2054
- }
2055
- } else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2056
- if (supportsMutableAdoptedStyleSheets) {
2057
- styleContainerNode.adoptedStyleSheets.push(style);
2058
- } else {
2059
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2060
- }
2061
- }
2062
- }
2063
- return scopeId2;
2064
- };
2065
- var attachStyles = (hostRef) => {
2066
- const cmpMeta = hostRef.$cmpMeta$;
2067
- const elm = hostRef.$hostElement$;
2068
- const flags = cmpMeta.$flags$;
2069
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2070
- const scopeId2 = addStyle(
2071
- BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2072
- cmpMeta,
2073
- hostRef.$modeName$
2074
- );
2075
- if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2076
- elm["s-sc"] = scopeId2;
2077
- elm.classList.add(scopeId2 + "-h");
2078
- }
2079
- endAttachStyles();
2080
- };
2081
- var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2082
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2083
- var hydrateScopedToShadow = () => {
2084
- if (!win.document) {
2085
- return;
2086
- }
2087
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2088
- let i2 = 0;
2089
- for (; i2 < styles2.length; i2++) {
2090
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2091
- }
2092
- };
2093
-
2094
2117
  // src/runtime/vdom/vdom-render.ts
2095
2118
  import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
2096
2119
 
@@ -2109,12 +2132,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2109
2132
  const classList = elm.classList;
2110
2133
  const oldClasses = parseClassList(oldValue);
2111
2134
  let newClasses = parseClassList(newValue);
2112
- if (BUILD12.hydrateClientSide && elm["s-si"] && initialRender) {
2113
- newClasses.push(elm["s-si"]);
2135
+ if (BUILD12.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2136
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2137
+ newClasses.push(scopeId2);
2114
2138
  oldClasses.forEach((c) => {
2115
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
2139
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2116
2140
  });
2117
- newClasses = [...new Set(newClasses)];
2141
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2118
2142
  classList.add(...newClasses);
2119
2143
  } else {
2120
2144
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -2865,6 +2889,12 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
2865
2889
  }
2866
2890
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
2867
2891
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
2892
+ if (isInitialLoad) {
2893
+ queueMicrotask(() => {
2894
+ dispatch();
2895
+ });
2896
+ return;
2897
+ }
2868
2898
  return BUILD15.taskQueue ? writeTask(dispatch) : dispatch();
2869
2899
  };
2870
2900
  var dispatchHooks = (hostRef, isInitialLoad) => {
@@ -3065,10 +3095,16 @@ var forceUpdate = (ref) => {
3065
3095
  return false;
3066
3096
  };
3067
3097
  var appDidLoad = (who) => {
3098
+ var _a;
3068
3099
  if (BUILD15.asyncQueue) {
3069
3100
  plt.$flags$ |= 2 /* appLoaded */;
3070
3101
  }
3071
3102
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3103
+ if (BUILD15.hydrateClientSide) {
3104
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3105
+ plt.$orgLocNodes$.clear();
3106
+ }
3107
+ }
3072
3108
  if (BUILD15.profile && performance.measure) {
3073
3109
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3074
3110
  }
@@ -3500,6 +3536,11 @@ var connectedCallback = (elm) => {
3500
3536
  if (BUILD19.hydrateServerSide || (BUILD19.slot || BUILD19.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3501
3537
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3502
3538
  setContentReference(elm);
3539
+ } else if (BUILD19.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3540
+ const commendPlaceholder = elm.firstChild;
3541
+ if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3542
+ elm.removeChild(commendPlaceholder);
3543
+ }
3503
3544
  }
3504
3545
  }
3505
3546
  if (BUILD19.asyncLoading) {
@@ -3604,7 +3645,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
3604
3645
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3605
3646
  }
3606
3647
  if (BUILD21.experimentalSlotFixes) {
3607
- if (BUILD21.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3648
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
3608
3649
  patchPseudoShadowDom(Cstr.prototype);
3609
3650
  }
3610
3651
  } else {
@@ -3821,7 +3862,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
3821
3862
  }
3822
3863
  };
3823
3864
  if (BUILD22.experimentalSlotFixes) {
3824
- if (BUILD22.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3865
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
3825
3866
  patchPseudoShadowDom(HostElement.prototype);
3826
3867
  }
3827
3868
  } else {