@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 Client Platform v4.35.3-dev.1752161791.11e6f9d | MIT Licensed | https://stenciljs.com
2
+ Stencil Client 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) => {
@@ -553,7 +553,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
553
553
  import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
554
554
 
555
555
  // src/runtime/client-hydrate.ts
556
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
556
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
557
557
 
558
558
  // src/runtime/dom-extras.ts
559
559
  import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
@@ -1052,6 +1052,9 @@ var validNodesPatches = [
1052
1052
  "parentNode"
1053
1053
  ];
1054
1054
  function patchHostOriginalAccessor(accessorName, node) {
1055
+ if (!globalThis.Node || !globalThis.Element) {
1056
+ return;
1057
+ }
1055
1058
  let accessor;
1056
1059
  if (validElementPatches.includes(accessorName)) {
1057
1060
  accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
@@ -1160,8 +1163,133 @@ var installDevTools = () => {
1160
1163
  }
1161
1164
  };
1162
1165
 
1163
- // src/runtime/vdom/h.ts
1166
+ // src/runtime/styles.ts
1164
1167
  import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
1168
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1169
+ var registerStyle = (scopeId2, cssText, allowCS) => {
1170
+ let style = styles.get(scopeId2);
1171
+ if (supportsConstructableStylesheets && allowCS) {
1172
+ style = style || new CSSStyleSheet();
1173
+ if (typeof style === "string") {
1174
+ style = cssText;
1175
+ } else {
1176
+ style.replaceSync(cssText);
1177
+ }
1178
+ } else {
1179
+ style = cssText;
1180
+ }
1181
+ styles.set(scopeId2, style);
1182
+ };
1183
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1184
+ var _a;
1185
+ const scopeId2 = getScopeId(cmpMeta, mode);
1186
+ const style = styles.get(scopeId2);
1187
+ if (!BUILD12.attachStyles || !win.document) {
1188
+ return scopeId2;
1189
+ }
1190
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1191
+ if (style) {
1192
+ if (typeof style === "string") {
1193
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1194
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1195
+ let styleElm;
1196
+ if (!appliedStyles) {
1197
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1198
+ }
1199
+ if (!appliedStyles.has(scopeId2)) {
1200
+ if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1201
+ styleElm.innerHTML = style;
1202
+ } else {
1203
+ styleElm = win.document.createElement("style");
1204
+ styleElm.innerHTML = style;
1205
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1206
+ if (nonce != null) {
1207
+ styleElm.setAttribute("nonce", nonce);
1208
+ }
1209
+ if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
1210
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1211
+ }
1212
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1213
+ if (styleContainerNode.nodeName === "HEAD") {
1214
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1215
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1216
+ styleContainerNode.insertBefore(
1217
+ styleElm,
1218
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1219
+ );
1220
+ } else if ("host" in styleContainerNode) {
1221
+ if (supportsConstructableStylesheets) {
1222
+ const stylesheet = new CSSStyleSheet();
1223
+ stylesheet.replaceSync(style);
1224
+ if (supportsMutableAdoptedStyleSheets) {
1225
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1226
+ } else {
1227
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1228
+ }
1229
+ } else {
1230
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1231
+ if (existingStyleContainer) {
1232
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1233
+ } else {
1234
+ styleContainerNode.prepend(styleElm);
1235
+ }
1236
+ }
1237
+ } else {
1238
+ styleContainerNode.append(styleElm);
1239
+ }
1240
+ }
1241
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1242
+ styleContainerNode.insertBefore(styleElm, null);
1243
+ }
1244
+ }
1245
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1246
+ styleElm.innerHTML += SLOT_FB_CSS;
1247
+ }
1248
+ if (appliedStyles) {
1249
+ appliedStyles.add(scopeId2);
1250
+ }
1251
+ }
1252
+ } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1253
+ if (supportsMutableAdoptedStyleSheets) {
1254
+ styleContainerNode.adoptedStyleSheets.push(style);
1255
+ } else {
1256
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1257
+ }
1258
+ }
1259
+ }
1260
+ return scopeId2;
1261
+ };
1262
+ var attachStyles = (hostRef) => {
1263
+ const cmpMeta = hostRef.$cmpMeta$;
1264
+ const elm = hostRef.$hostElement$;
1265
+ const flags = cmpMeta.$flags$;
1266
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1267
+ const scopeId2 = addStyle(
1268
+ BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1269
+ cmpMeta,
1270
+ hostRef.$modeName$
1271
+ );
1272
+ if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1273
+ elm["s-sc"] = scopeId2;
1274
+ elm.classList.add(scopeId2 + "-h");
1275
+ }
1276
+ endAttachStyles();
1277
+ };
1278
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1279
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1280
+ var hydrateScopedToShadow = () => {
1281
+ if (!win.document) {
1282
+ return;
1283
+ }
1284
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1285
+ let i2 = 0;
1286
+ for (; i2 < styles2.length; i2++) {
1287
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1288
+ }
1289
+ };
1290
+
1291
+ // src/runtime/vdom/h.ts
1292
+ import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
1165
1293
  var h = (nodeName, vnodeData, ...children) => {
1166
1294
  let child = null;
1167
1295
  let key = null;
@@ -1177,7 +1305,7 @@ var h = (nodeName, vnodeData, ...children) => {
1177
1305
  } else if (child != null && typeof child !== "boolean") {
1178
1306
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1179
1307
  child = String(child);
1180
- } else if (BUILD12.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1308
+ } else if (BUILD13.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1181
1309
  consoleDevError(`vNode passed as children has unexpected type.
1182
1310
  Make sure it's using the correct h() function.
1183
1311
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -1193,28 +1321,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1193
1321
  };
1194
1322
  walk(children);
1195
1323
  if (vnodeData) {
1196
- if (BUILD12.isDev && nodeName === "input") {
1324
+ if (BUILD13.isDev && nodeName === "input") {
1197
1325
  validateInputProperties(vnodeData);
1198
1326
  }
1199
- if (BUILD12.vdomKey && vnodeData.key) {
1327
+ if (BUILD13.vdomKey && vnodeData.key) {
1200
1328
  key = vnodeData.key;
1201
1329
  }
1202
- if (BUILD12.slotRelocation && vnodeData.name) {
1330
+ if (BUILD13.slotRelocation && vnodeData.name) {
1203
1331
  slotName = vnodeData.name;
1204
1332
  }
1205
- if (BUILD12.vdomClass) {
1333
+ if (BUILD13.vdomClass) {
1206
1334
  const classData = vnodeData.className || vnodeData.class;
1207
1335
  if (classData) {
1208
1336
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
1209
1337
  }
1210
1338
  }
1211
1339
  }
1212
- if (BUILD12.isDev && vNodeChildren.some(isHost)) {
1340
+ if (BUILD13.isDev && vNodeChildren.some(isHost)) {
1213
1341
  consoleDevError(`The <Host> must be the single root component. Make sure:
1214
1342
  - You are NOT using hostData() and <Host> in the same component.
1215
1343
  - <Host> is used once, and it's the single root component of the render() function.`);
1216
1344
  }
1217
- if (BUILD12.vdomFunctional && typeof nodeName === "function") {
1345
+ if (BUILD13.vdomFunctional && typeof nodeName === "function") {
1218
1346
  return nodeName(
1219
1347
  vnodeData === null ? {} : vnodeData,
1220
1348
  vNodeChildren,
@@ -1226,10 +1354,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1226
1354
  if (vNodeChildren.length > 0) {
1227
1355
  vnode.$children$ = vNodeChildren;
1228
1356
  }
1229
- if (BUILD12.vdomKey) {
1357
+ if (BUILD13.vdomKey) {
1230
1358
  vnode.$key$ = key;
1231
1359
  }
1232
- if (BUILD12.slotRelocation) {
1360
+ if (BUILD13.slotRelocation) {
1233
1361
  vnode.$name$ = slotName;
1234
1362
  }
1235
1363
  return vnode;
@@ -1242,13 +1370,13 @@ var newVNode = (tag, text) => {
1242
1370
  $elm$: null,
1243
1371
  $children$: null
1244
1372
  };
1245
- if (BUILD12.vdomAttribute) {
1373
+ if (BUILD13.vdomAttribute) {
1246
1374
  vnode.$attrs$ = null;
1247
1375
  }
1248
- if (BUILD12.vdomKey) {
1376
+ if (BUILD13.vdomKey) {
1249
1377
  vnode.$key$ = null;
1250
1378
  }
1251
- if (BUILD12.slotRelocation) {
1379
+ if (BUILD13.slotRelocation) {
1252
1380
  vnode.$name$ = null;
1253
1381
  }
1254
1382
  return vnode;
@@ -1302,18 +1430,18 @@ var validateInputProperties = (inputElm) => {
1302
1430
 
1303
1431
  // src/runtime/client-hydrate.ts
1304
1432
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1305
- var _a;
1433
+ var _a, _b, _c;
1306
1434
  const endHydrate = createTime("hydrateClient", tagName);
1307
1435
  const shadowRoot = hostElm.shadowRoot;
1308
1436
  const childRenderNodes = [];
1309
1437
  const slotNodes = [];
1310
1438
  const slottedNodes = [];
1311
- const shadowRootNodes = BUILD13.shadowDom && shadowRoot ? [] : null;
1439
+ const shadowRootNodes = BUILD14.shadowDom && shadowRoot ? [] : null;
1312
1440
  const vnode = newVNode(tagName, null);
1313
1441
  vnode.$elm$ = hostElm;
1314
1442
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1315
1443
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1316
- var _a2, _b;
1444
+ var _a2, _b2;
1317
1445
  if (!(memberFlags & 31 /* Prop */)) {
1318
1446
  return;
1319
1447
  }
@@ -1323,13 +1451,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1323
1451
  const attrPropVal = parsePropertyValue(
1324
1452
  attrVal,
1325
1453
  memberFlags,
1326
- BUILD13.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1454
+ BUILD14.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1327
1455
  );
1328
- (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1456
+ (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1329
1457
  }
1330
1458
  });
1331
1459
  let scopeId2;
1332
- if (BUILD13.scoped) {
1460
+ if (BUILD14.scoped) {
1333
1461
  const cmpMeta = hostRef.$cmpMeta$;
1334
1462
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1335
1463
  scopeId2 = hostElm["s-sc"];
@@ -1366,6 +1494,16 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1366
1494
  if (childRenderNode.$tag$ === "slot") {
1367
1495
  node["s-cr"] = hostElm["s-cr"];
1368
1496
  }
1497
+ } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
1498
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
1499
+ const scopeId3 = getScopeId(
1500
+ cmpMeta.$cmpMeta$,
1501
+ BUILD14.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1502
+ );
1503
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1504
+ if (styleSheet) {
1505
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1506
+ }
1369
1507
  }
1370
1508
  if (childRenderNode.$tag$ === "slot") {
1371
1509
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1381,7 +1519,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1381
1519
  }
1382
1520
  }
1383
1521
  if (orgLocationNode && orgLocationNode.isConnected) {
1384
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1522
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1385
1523
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1386
1524
  }
1387
1525
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1389,7 +1527,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1389
1527
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1390
1528
  }
1391
1529
  }
1392
- plt.$orgLocNodes$.delete(orgLocationId);
1530
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
1531
+ plt.$orgLocNodes$.delete(orgLocationId);
1532
+ }
1393
1533
  }
1394
1534
  const hosts = [];
1395
1535
  const snLen = slottedNodes.length;
@@ -1410,29 +1550,34 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1410
1550
  }
1411
1551
  if (!hosts[slottedItem.hostId]) continue;
1412
1552
  const hostEle = hosts[slottedItem.hostId];
1553
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1554
+ hostEle.appendChild(slottedItem.node);
1555
+ }
1413
1556
  if (!hostEle.shadowRoot || !shadowRoot) {
1414
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1415
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1416
- slottedItem.slot["s-cr"] = hostEle;
1417
- } else {
1418
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1557
+ if (!slottedItem.slot["s-cr"]) {
1558
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1559
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1560
+ slottedItem.slot["s-cr"] = hostEle;
1561
+ } else {
1562
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1563
+ }
1419
1564
  }
1420
1565
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1421
- if (BUILD13.experimentalSlotFixes) {
1566
+ if (((_c = slottedItem.node.parentElement) == null ? void 0 : _c.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
1567
+ slottedItem.node.removeAttribute("slot");
1568
+ }
1569
+ if (BUILD14.experimentalSlotFixes) {
1422
1570
  patchSlottedNode(slottedItem.node);
1423
1571
  }
1424
1572
  }
1425
- if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1426
- hostEle.appendChild(slottedItem.node);
1427
- }
1428
1573
  }
1429
1574
  }
1430
- if (BUILD13.scoped && scopeId2 && slotNodes.length) {
1575
+ if (BUILD14.scoped && scopeId2 && slotNodes.length) {
1431
1576
  slotNodes.forEach((slot) => {
1432
1577
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1433
1578
  });
1434
1579
  }
1435
- if (BUILD13.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1580
+ if (BUILD14.shadowDom && shadowRoot) {
1436
1581
  let rnIdex = 0;
1437
1582
  const rnLen = shadowRootNodes.length;
1438
1583
  if (rnLen) {
@@ -1443,14 +1588,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1443
1588
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1444
1589
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1445
1590
  node.removeAttribute("hidden");
1446
- } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1591
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1447
1592
  node.parentNode.removeChild(node);
1448
1593
  }
1449
1594
  }
1450
1595
  });
1451
1596
  }
1452
1597
  }
1453
- plt.$orgLocNodes$.delete(hostElm["s-id"]);
1454
1598
  hostRef.$hostElement$ = hostElm;
1455
1599
  endHydrate();
1456
1600
  };
@@ -1482,7 +1626,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1482
1626
  if (!parentVNode.$children$) {
1483
1627
  parentVNode.$children$ = [];
1484
1628
  }
1485
- if (BUILD13.scoped && scopeId2) {
1629
+ if (BUILD14.scoped && scopeId2 && childIdSplt[0] === hostId) {
1486
1630
  node["s-si"] = scopeId2;
1487
1631
  childVNode.$attrs$.class += " " + scopeId2;
1488
1632
  }
@@ -1500,7 +1644,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1500
1644
  shadowRootNodes,
1501
1645
  slottedNodes
1502
1646
  );
1503
- if (BUILD13.scoped && scopeId2) {
1647
+ if (BUILD14.scoped && scopeId2) {
1504
1648
  node.classList.add(scopeId2);
1505
1649
  }
1506
1650
  }
@@ -1597,9 +1741,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1597
1741
  slottedNodes
1598
1742
  );
1599
1743
  } else if (childNodeType === CONTENT_REF_ID) {
1600
- if (BUILD13.shadowDom && shadowRootNodes) {
1744
+ if (BUILD14.shadowDom && shadowRootNodes) {
1601
1745
  node.remove();
1602
- } else if (BUILD13.slotRelocation) {
1746
+ } else if (BUILD14.slotRelocation) {
1603
1747
  hostElm["s-cr"] = node;
1604
1748
  node["s-cn"] = true;
1605
1749
  }
@@ -1612,7 +1756,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1612
1756
  vnode.$index$ = "0";
1613
1757
  parentVNode.$children$ = [vnode];
1614
1758
  } else {
1615
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1759
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1616
1760
  node.remove();
1617
1761
  }
1618
1762
  }
@@ -1665,15 +1809,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1665
1809
  childVNode.$name$ = slotName || null;
1666
1810
  childVNode.$tag$ = "slot";
1667
1811
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1668
- if (BUILD13.shadowDom && shadowRootNodes && win.document) {
1812
+ if (BUILD14.shadowDom && shadowRootNodes && win.document) {
1669
1813
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1670
1814
  if (childVNode.$name$) {
1671
1815
  childVNode.$elm$.setAttribute("name", slotName);
1672
1816
  }
1673
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1674
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1817
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1818
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1675
1819
  } else {
1676
- node.parentNode.insertBefore(slot, node);
1820
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1677
1821
  }
1678
1822
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1679
1823
  node.remove();
@@ -1697,13 +1841,17 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1697
1841
  parentVNode.$children$[childVNode.$index$] = childVNode;
1698
1842
  }
1699
1843
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1844
+ var _a, _b;
1700
1845
  let slottedNode = slotNode.nextSibling;
1701
1846
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1702
- 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 */))) {
1703
- slottedNode["s-sn"] = slotName;
1704
- slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1705
- slottedNode = slottedNode.nextSibling;
1706
- }
1847
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
1848
+ do {
1849
+ 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 */))) {
1850
+ slottedNode["s-sn"] = slotName;
1851
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1852
+ }
1853
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
1854
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
1707
1855
  };
1708
1856
  var findCorrespondingNode = (node, type) => {
1709
1857
  let sibling = node;
@@ -2134,31 +2282,31 @@ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
2134
2282
  import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
2135
2283
 
2136
2284
  // src/runtime/parse-property-value.ts
2137
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
2285
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
2138
2286
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2139
- if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2287
+ if ((BUILD15.hydrateClientSide || BUILD15.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2140
2288
  try {
2141
2289
  propValue = JSON.parse(propValue);
2142
2290
  return propValue;
2143
2291
  } catch (e) {
2144
2292
  }
2145
2293
  }
2146
- if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2294
+ if ((BUILD15.hydrateClientSide || BUILD15.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2147
2295
  propValue = deserializeProperty(propValue);
2148
2296
  return propValue;
2149
2297
  }
2150
2298
  if (propValue != null && !isComplexType(propValue)) {
2151
- if (BUILD14.propBoolean && propType & 4 /* Boolean */) {
2152
- if (BUILD14.formAssociated && isFormAssociated && typeof propValue === "string") {
2299
+ if (BUILD15.propBoolean && propType & 4 /* Boolean */) {
2300
+ if (BUILD15.formAssociated && isFormAssociated && typeof propValue === "string") {
2153
2301
  return propValue === "" || !!propValue;
2154
2302
  } else {
2155
2303
  return propValue === "false" ? false : propValue === "" || !!propValue;
2156
2304
  }
2157
2305
  }
2158
- if (BUILD14.propNumber && propType & 2 /* Number */) {
2306
+ if (BUILD15.propNumber && propType & 2 /* Number */) {
2159
2307
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
2160
2308
  }
2161
- if (BUILD14.propString && propType & 1 /* String */) {
2309
+ if (BUILD15.propString && propType & 1 /* String */) {
2162
2310
  return String(propValue);
2163
2311
  }
2164
2312
  return propValue;
@@ -2170,18 +2318,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2170
2318
  import { BUILD as BUILD21, NAMESPACE } from "@stencil/core/internal/app-data";
2171
2319
 
2172
2320
  // src/runtime/event-emitter.ts
2173
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2321
+ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2174
2322
 
2175
2323
  // src/runtime/element.ts
2176
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
2177
- var getElement = (ref) => BUILD15.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2324
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2325
+ var getElement = (ref) => BUILD16.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2178
2326
 
2179
2327
  // src/runtime/event-emitter.ts
2180
2328
  var createEvent = (ref, name, flags) => {
2181
2329
  const elm = getElement(ref);
2182
2330
  return {
2183
2331
  emit: (detail) => {
2184
- if (BUILD16.isDev && !elm.isConnected) {
2332
+ if (BUILD17.isDev && !elm.isConnected) {
2185
2333
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2186
2334
  }
2187
2335
  return emitEvent(elm, name, {
@@ -2199,131 +2347,6 @@ var emitEvent = (elm, name, opts) => {
2199
2347
  return ev;
2200
2348
  };
2201
2349
 
2202
- // src/runtime/styles.ts
2203
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2204
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2205
- var registerStyle = (scopeId2, cssText, allowCS) => {
2206
- let style = styles.get(scopeId2);
2207
- if (supportsConstructableStylesheets && allowCS) {
2208
- style = style || new CSSStyleSheet();
2209
- if (typeof style === "string") {
2210
- style = cssText;
2211
- } else {
2212
- style.replaceSync(cssText);
2213
- }
2214
- } else {
2215
- style = cssText;
2216
- }
2217
- styles.set(scopeId2, style);
2218
- };
2219
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
2220
- var _a;
2221
- const scopeId2 = getScopeId(cmpMeta, mode);
2222
- const style = styles.get(scopeId2);
2223
- if (!BUILD17.attachStyles || !win.document) {
2224
- return scopeId2;
2225
- }
2226
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
2227
- if (style) {
2228
- if (typeof style === "string") {
2229
- styleContainerNode = styleContainerNode.head || styleContainerNode;
2230
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2231
- let styleElm;
2232
- if (!appliedStyles) {
2233
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2234
- }
2235
- if (!appliedStyles.has(scopeId2)) {
2236
- if (BUILD17.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2237
- styleElm.innerHTML = style;
2238
- } else {
2239
- styleElm = win.document.createElement("style");
2240
- styleElm.innerHTML = style;
2241
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2242
- if (nonce != null) {
2243
- styleElm.setAttribute("nonce", nonce);
2244
- }
2245
- if ((BUILD17.hydrateServerSide || BUILD17.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2246
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2247
- }
2248
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2249
- if (styleContainerNode.nodeName === "HEAD") {
2250
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2251
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2252
- styleContainerNode.insertBefore(
2253
- styleElm,
2254
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2255
- );
2256
- } else if ("host" in styleContainerNode) {
2257
- if (supportsConstructableStylesheets) {
2258
- const stylesheet = new CSSStyleSheet();
2259
- stylesheet.replaceSync(style);
2260
- if (supportsMutableAdoptedStyleSheets) {
2261
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
2262
- } else {
2263
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2264
- }
2265
- } else {
2266
- const existingStyleContainer = styleContainerNode.querySelector("style");
2267
- if (existingStyleContainer) {
2268
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2269
- } else {
2270
- styleContainerNode.prepend(styleElm);
2271
- }
2272
- }
2273
- } else {
2274
- styleContainerNode.append(styleElm);
2275
- }
2276
- }
2277
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2278
- styleContainerNode.insertBefore(styleElm, null);
2279
- }
2280
- }
2281
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2282
- styleElm.innerHTML += SLOT_FB_CSS;
2283
- }
2284
- if (appliedStyles) {
2285
- appliedStyles.add(scopeId2);
2286
- }
2287
- }
2288
- } else if (BUILD17.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2289
- if (supportsMutableAdoptedStyleSheets) {
2290
- styleContainerNode.adoptedStyleSheets.push(style);
2291
- } else {
2292
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2293
- }
2294
- }
2295
- }
2296
- return scopeId2;
2297
- };
2298
- var attachStyles = (hostRef) => {
2299
- const cmpMeta = hostRef.$cmpMeta$;
2300
- const elm = hostRef.$hostElement$;
2301
- const flags = cmpMeta.$flags$;
2302
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2303
- const scopeId2 = addStyle(
2304
- BUILD17.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2305
- cmpMeta,
2306
- hostRef.$modeName$
2307
- );
2308
- if ((BUILD17.shadowDom || BUILD17.scoped) && BUILD17.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2309
- elm["s-sc"] = scopeId2;
2310
- elm.classList.add(scopeId2 + "-h");
2311
- }
2312
- endAttachStyles();
2313
- };
2314
- var getScopeId = (cmp, mode) => "sc-" + (BUILD17.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2315
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2316
- var hydrateScopedToShadow = () => {
2317
- if (!win.document) {
2318
- return;
2319
- }
2320
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2321
- let i2 = 0;
2322
- for (; i2 < styles2.length; i2++) {
2323
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2324
- }
2325
- };
2326
-
2327
2350
  // src/runtime/vdom/vdom-render.ts
2328
2351
  import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
2329
2352
 
@@ -2342,12 +2365,13 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2342
2365
  const classList = elm.classList;
2343
2366
  const oldClasses = parseClassList(oldValue);
2344
2367
  let newClasses = parseClassList(newValue);
2345
- if (BUILD18.hydrateClientSide && elm["s-si"] && initialRender) {
2346
- newClasses.push(elm["s-si"]);
2368
+ if (BUILD18.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2369
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
2370
+ newClasses.push(scopeId2);
2347
2371
  oldClasses.forEach((c) => {
2348
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
2372
+ if (c.startsWith(scopeId2)) newClasses.push(c);
2349
2373
  });
2350
- newClasses = [...new Set(newClasses)];
2374
+ newClasses = [...new Set(newClasses)].filter((c) => c);
2351
2375
  classList.add(...newClasses);
2352
2376
  } else {
2353
2377
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -3098,6 +3122,12 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
3098
3122
  }
3099
3123
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
3100
3124
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
3125
+ if (isInitialLoad) {
3126
+ queueMicrotask(() => {
3127
+ dispatch();
3128
+ });
3129
+ return;
3130
+ }
3101
3131
  return BUILD21.taskQueue ? writeTask(dispatch) : dispatch();
3102
3132
  };
3103
3133
  var dispatchHooks = (hostRef, isInitialLoad) => {
@@ -3298,10 +3328,16 @@ var forceUpdate = (ref) => {
3298
3328
  return false;
3299
3329
  };
3300
3330
  var appDidLoad = (who) => {
3331
+ var _a;
3301
3332
  if (BUILD21.asyncQueue) {
3302
3333
  plt.$flags$ |= 2 /* appLoaded */;
3303
3334
  }
3304
3335
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3336
+ if (BUILD21.hydrateClientSide) {
3337
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3338
+ plt.$orgLocNodes$.clear();
3339
+ }
3340
+ }
3305
3341
  if (BUILD21.profile && performance.measure) {
3306
3342
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3307
3343
  }
@@ -3733,6 +3769,11 @@ var connectedCallback = (elm) => {
3733
3769
  if (BUILD25.hydrateServerSide || (BUILD25.slot || BUILD25.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3734
3770
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3735
3771
  setContentReference(elm);
3772
+ } else if (BUILD25.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3773
+ const commendPlaceholder = elm.firstChild;
3774
+ if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3775
+ elm.removeChild(commendPlaceholder);
3776
+ }
3736
3777
  }
3737
3778
  }
3738
3779
  if (BUILD25.asyncLoading) {
@@ -3837,7 +3878,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
3837
3878
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3838
3879
  }
3839
3880
  if (BUILD27.experimentalSlotFixes) {
3840
- if (BUILD27.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
3881
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
3841
3882
  patchPseudoShadowDom(Cstr.prototype);
3842
3883
  }
3843
3884
  } else {
@@ -4054,7 +4095,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4054
4095
  }
4055
4096
  };
4056
4097
  if (BUILD28.experimentalSlotFixes) {
4057
- if (BUILD28.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4098
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
4058
4099
  patchPseudoShadowDom(HostElement.prototype);
4059
4100
  }
4060
4101
  } else {