@stencil/core 4.35.1-dev.1751432601.f018c73 → 4.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +7 -7
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/app-globals/package.json +1 -1
  14. package/internal/client/index.js +180 -216
  15. package/internal/client/package.json +1 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/hydrate/index.js +180 -216
  18. package/internal/hydrate/package.json +1 -1
  19. package/internal/hydrate/runner.js +13 -43
  20. package/internal/package.json +1 -1
  21. package/internal/stencil-public-compiler.d.ts +0 -1
  22. package/internal/stencil-public-runtime.d.ts +5 -5
  23. package/internal/testing/index.js +179 -213
  24. package/internal/testing/package.json +1 -1
  25. package/mock-doc/index.cjs +5 -35
  26. package/mock-doc/index.d.ts +0 -16
  27. package/mock-doc/index.js +5 -35
  28. package/mock-doc/package.json +1 -1
  29. package/package.json +1 -1
  30. package/screenshot/index.js +1 -1
  31. package/screenshot/package.json +1 -1
  32. package/screenshot/pixel-match.js +1 -1
  33. package/sys/node/index.js +26 -26
  34. package/sys/node/package.json +1 -1
  35. package/sys/node/worker.js +1 -1
  36. package/testing/index.js +5 -5
  37. package/testing/package.json +1 -1
  38. package/testing/puppeteer/puppeteer-browser.d.ts +5 -5
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.35.1-dev.1751432601.f018c73 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.35.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -507,25 +507,16 @@ function deserializeProperty(value) {
507
507
  // src/utils/shadow-root.ts
508
508
  import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
509
509
  import { globalStyles } from "@stencil/core/internal/app-globals";
510
-
511
- // src/utils/style.ts
512
- function createStyleSheetIfNeededAndSupported(styles2) {
513
- if (!styles2 || !supportsConstructableStylesheets) return void 0;
514
- const sheet = new CSSStyleSheet();
515
- sheet.replaceSync(styles2);
516
- return sheet;
517
- }
518
-
519
- // src/utils/shadow-root.ts
520
- var globalStyleSheet;
521
510
  function createShadowRoot(cmpMeta) {
522
- var _a;
523
511
  const shadowRoot = BUILD8.shadowDelegatesFocus ? this.attachShadow({
524
512
  mode: "open",
525
513
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
526
514
  }) : this.attachShadow({ mode: "open" });
527
- if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
528
- if (globalStyleSheet) shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
515
+ if (supportsConstructableStylesheets) {
516
+ const sheet = new CSSStyleSheet();
517
+ sheet.replaceSync(globalStyles);
518
+ shadowRoot.adoptedStyleSheets.push(sheet);
519
+ }
529
520
  }
530
521
 
531
522
  // src/utils/util.ts
@@ -546,7 +537,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
546
537
  import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
547
538
 
548
539
  // src/runtime/client-hydrate.ts
549
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
540
+ import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
550
541
 
551
542
  // src/runtime/dom-extras.ts
552
543
  import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
@@ -1153,125 +1144,8 @@ var installDevTools = () => {
1153
1144
  }
1154
1145
  };
1155
1146
 
1156
- // src/runtime/styles.ts
1157
- import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
1158
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1159
- var registerStyle = (scopeId2, cssText, allowCS) => {
1160
- let style = styles.get(scopeId2);
1161
- if (supportsConstructableStylesheets && allowCS) {
1162
- style = style || new CSSStyleSheet();
1163
- if (typeof style === "string") {
1164
- style = cssText;
1165
- } else {
1166
- style.replaceSync(cssText);
1167
- }
1168
- } else {
1169
- style = cssText;
1170
- }
1171
- styles.set(scopeId2, style);
1172
- };
1173
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1174
- var _a;
1175
- const scopeId2 = getScopeId(cmpMeta, mode);
1176
- const style = styles.get(scopeId2);
1177
- if (!BUILD12.attachStyles || !win.document) {
1178
- return scopeId2;
1179
- }
1180
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
1181
- if (style) {
1182
- if (typeof style === "string") {
1183
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1184
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1185
- let styleElm;
1186
- if (!appliedStyles) {
1187
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1188
- }
1189
- if (!appliedStyles.has(scopeId2)) {
1190
- if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1191
- styleElm.innerHTML = style;
1192
- } else {
1193
- styleElm = win.document.createElement("style");
1194
- styleElm.innerHTML = style;
1195
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
1196
- if (nonce != null) {
1197
- styleElm.setAttribute("nonce", nonce);
1198
- }
1199
- if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
1200
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1201
- }
1202
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1203
- if (styleContainerNode.nodeName === "HEAD") {
1204
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1205
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1206
- styleContainerNode.insertBefore(
1207
- styleElm,
1208
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
1209
- );
1210
- } else if ("host" in styleContainerNode) {
1211
- if (supportsConstructableStylesheets) {
1212
- const stylesheet = new CSSStyleSheet();
1213
- stylesheet.replaceSync(style);
1214
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1215
- } else {
1216
- const existingStyleContainer = styleContainerNode.querySelector("style");
1217
- if (existingStyleContainer) {
1218
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1219
- } else {
1220
- styleContainerNode.prepend(styleElm);
1221
- }
1222
- }
1223
- } else {
1224
- styleContainerNode.append(styleElm);
1225
- }
1226
- }
1227
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1228
- styleContainerNode.insertBefore(styleElm, null);
1229
- }
1230
- }
1231
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1232
- styleElm.innerHTML += SLOT_FB_CSS;
1233
- }
1234
- if (appliedStyles) {
1235
- appliedStyles.add(scopeId2);
1236
- }
1237
- }
1238
- } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1239
- styleContainerNode.adoptedStyleSheets.push(style);
1240
- }
1241
- }
1242
- return scopeId2;
1243
- };
1244
- var attachStyles = (hostRef) => {
1245
- const cmpMeta = hostRef.$cmpMeta$;
1246
- const elm = hostRef.$hostElement$;
1247
- const flags = cmpMeta.$flags$;
1248
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1249
- const scopeId2 = addStyle(
1250
- BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1251
- cmpMeta,
1252
- hostRef.$modeName$
1253
- );
1254
- if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
1255
- elm["s-sc"] = scopeId2;
1256
- elm.classList.add(scopeId2 + "-h");
1257
- }
1258
- endAttachStyles();
1259
- };
1260
- var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1261
- var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
1262
- var hydrateScopedToShadow = () => {
1263
- if (!win.document) {
1264
- return;
1265
- }
1266
- const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1267
- let i2 = 0;
1268
- for (; i2 < styles2.length; i2++) {
1269
- registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
1270
- }
1271
- };
1272
-
1273
1147
  // src/runtime/vdom/h.ts
1274
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
1148
+ import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
1275
1149
  var h = (nodeName, vnodeData, ...children) => {
1276
1150
  let child = null;
1277
1151
  let key = null;
@@ -1287,7 +1161,7 @@ var h = (nodeName, vnodeData, ...children) => {
1287
1161
  } else if (child != null && typeof child !== "boolean") {
1288
1162
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
1289
1163
  child = String(child);
1290
- } else if (BUILD13.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1164
+ } else if (BUILD12.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
1291
1165
  consoleDevError(`vNode passed as children has unexpected type.
1292
1166
  Make sure it's using the correct h() function.
1293
1167
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -1303,28 +1177,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1303
1177
  };
1304
1178
  walk(children);
1305
1179
  if (vnodeData) {
1306
- if (BUILD13.isDev && nodeName === "input") {
1180
+ if (BUILD12.isDev && nodeName === "input") {
1307
1181
  validateInputProperties(vnodeData);
1308
1182
  }
1309
- if (BUILD13.vdomKey && vnodeData.key) {
1183
+ if (BUILD12.vdomKey && vnodeData.key) {
1310
1184
  key = vnodeData.key;
1311
1185
  }
1312
- if (BUILD13.slotRelocation && vnodeData.name) {
1186
+ if (BUILD12.slotRelocation && vnodeData.name) {
1313
1187
  slotName = vnodeData.name;
1314
1188
  }
1315
- if (BUILD13.vdomClass) {
1189
+ if (BUILD12.vdomClass) {
1316
1190
  const classData = vnodeData.className || vnodeData.class;
1317
1191
  if (classData) {
1318
1192
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
1319
1193
  }
1320
1194
  }
1321
1195
  }
1322
- if (BUILD13.isDev && vNodeChildren.some(isHost)) {
1196
+ if (BUILD12.isDev && vNodeChildren.some(isHost)) {
1323
1197
  consoleDevError(`The <Host> must be the single root component. Make sure:
1324
1198
  - You are NOT using hostData() and <Host> in the same component.
1325
1199
  - <Host> is used once, and it's the single root component of the render() function.`);
1326
1200
  }
1327
- if (BUILD13.vdomFunctional && typeof nodeName === "function") {
1201
+ if (BUILD12.vdomFunctional && typeof nodeName === "function") {
1328
1202
  return nodeName(
1329
1203
  vnodeData === null ? {} : vnodeData,
1330
1204
  vNodeChildren,
@@ -1336,10 +1210,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
1336
1210
  if (vNodeChildren.length > 0) {
1337
1211
  vnode.$children$ = vNodeChildren;
1338
1212
  }
1339
- if (BUILD13.vdomKey) {
1213
+ if (BUILD12.vdomKey) {
1340
1214
  vnode.$key$ = key;
1341
1215
  }
1342
- if (BUILD13.slotRelocation) {
1216
+ if (BUILD12.slotRelocation) {
1343
1217
  vnode.$name$ = slotName;
1344
1218
  }
1345
1219
  return vnode;
@@ -1352,13 +1226,13 @@ var newVNode = (tag, text) => {
1352
1226
  $elm$: null,
1353
1227
  $children$: null
1354
1228
  };
1355
- if (BUILD13.vdomAttribute) {
1229
+ if (BUILD12.vdomAttribute) {
1356
1230
  vnode.$attrs$ = null;
1357
1231
  }
1358
- if (BUILD13.vdomKey) {
1232
+ if (BUILD12.vdomKey) {
1359
1233
  vnode.$key$ = null;
1360
1234
  }
1361
- if (BUILD13.slotRelocation) {
1235
+ if (BUILD12.slotRelocation) {
1362
1236
  vnode.$name$ = null;
1363
1237
  }
1364
1238
  return vnode;
@@ -1412,18 +1286,18 @@ var validateInputProperties = (inputElm) => {
1412
1286
 
1413
1287
  // src/runtime/client-hydrate.ts
1414
1288
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1415
- var _a, _b;
1289
+ var _a;
1416
1290
  const endHydrate = createTime("hydrateClient", tagName);
1417
1291
  const shadowRoot = hostElm.shadowRoot;
1418
1292
  const childRenderNodes = [];
1419
1293
  const slotNodes = [];
1420
1294
  const slottedNodes = [];
1421
- const shadowRootNodes = BUILD14.shadowDom && shadowRoot ? [] : null;
1295
+ const shadowRootNodes = BUILD13.shadowDom && shadowRoot ? [] : null;
1422
1296
  const vnode = newVNode(tagName, null);
1423
1297
  vnode.$elm$ = hostElm;
1424
1298
  const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
1425
1299
  members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
1426
- var _a2, _b2;
1300
+ var _a2, _b;
1427
1301
  if (!(memberFlags & 31 /* Prop */)) {
1428
1302
  return;
1429
1303
  }
@@ -1433,13 +1307,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1433
1307
  const attrPropVal = parsePropertyValue(
1434
1308
  attrVal,
1435
1309
  memberFlags,
1436
- BUILD14.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1310
+ BUILD13.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
1437
1311
  );
1438
- (_b2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b2.set(memberName, attrPropVal);
1312
+ (_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
1439
1313
  }
1440
1314
  });
1441
1315
  let scopeId2;
1442
- if (BUILD14.scoped) {
1316
+ if (BUILD13.scoped) {
1443
1317
  const cmpMeta = hostRef.$cmpMeta$;
1444
1318
  if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1445
1319
  scopeId2 = hostElm["s-sc"];
@@ -1476,16 +1350,6 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1476
1350
  if (childRenderNode.$tag$ === "slot") {
1477
1351
  node["s-cr"] = hostElm["s-cr"];
1478
1352
  }
1479
- } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
1480
- const cmpMeta = getHostRef(childRenderNode.$elm$);
1481
- const scopeId3 = getScopeId(
1482
- cmpMeta.$cmpMeta$,
1483
- BUILD14.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1484
- );
1485
- const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1486
- if (styleSheet) {
1487
- hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1488
- }
1489
1353
  }
1490
1354
  if (childRenderNode.$tag$ === "slot") {
1491
1355
  childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
@@ -1501,7 +1365,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1501
1365
  }
1502
1366
  }
1503
1367
  if (orgLocationNode && orgLocationNode.isConnected) {
1504
- if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
1368
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
1505
1369
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1506
1370
  }
1507
1371
  orgLocationNode.parentNode.removeChild(orgLocationNode);
@@ -1509,9 +1373,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1509
1373
  node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1510
1374
  }
1511
1375
  }
1512
- if (orgLocationNode && !orgLocationNode["s-id"]) {
1513
- plt.$orgLocNodes$.delete(orgLocationId);
1514
- }
1376
+ plt.$orgLocNodes$.delete(orgLocationId);
1515
1377
  }
1516
1378
  const hosts = [];
1517
1379
  const snLen = slottedNodes.length;
@@ -1533,16 +1395,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1533
1395
  if (!hosts[slottedItem.hostId]) continue;
1534
1396
  const hostEle = hosts[slottedItem.hostId];
1535
1397
  if (!hostEle.shadowRoot || !shadowRoot) {
1536
- if (!slottedItem.slot["s-cr"]) {
1537
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1538
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1539
- slottedItem.slot["s-cr"] = hostEle;
1540
- } else {
1541
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1542
- }
1398
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1399
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1400
+ slottedItem.slot["s-cr"] = hostEle;
1401
+ } else {
1402
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1543
1403
  }
1544
1404
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1545
- if (BUILD14.experimentalSlotFixes) {
1405
+ if (BUILD13.experimentalSlotFixes) {
1546
1406
  patchSlottedNode(slottedItem.node);
1547
1407
  }
1548
1408
  }
@@ -1551,12 +1411,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1551
1411
  }
1552
1412
  }
1553
1413
  }
1554
- if (BUILD14.scoped && scopeId2 && slotNodes.length) {
1414
+ if (BUILD13.scoped && scopeId2 && slotNodes.length) {
1555
1415
  slotNodes.forEach((slot) => {
1556
1416
  slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1557
1417
  });
1558
1418
  }
1559
- if (BUILD14.shadowDom && shadowRoot) {
1419
+ if (BUILD13.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
1560
1420
  let rnIdex = 0;
1561
1421
  const rnLen = shadowRootNodes.length;
1562
1422
  if (rnLen) {
@@ -1567,13 +1427,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1567
1427
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
1568
1428
  if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
1569
1429
  node.removeAttribute("hidden");
1570
- } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1430
+ } else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1571
1431
  node.parentNode.removeChild(node);
1572
1432
  }
1573
1433
  }
1574
1434
  });
1575
1435
  }
1576
1436
  }
1437
+ plt.$orgLocNodes$.delete(hostElm["s-id"]);
1577
1438
  hostRef.$hostElement$ = hostElm;
1578
1439
  endHydrate();
1579
1440
  };
@@ -1605,7 +1466,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1605
1466
  if (!parentVNode.$children$) {
1606
1467
  parentVNode.$children$ = [];
1607
1468
  }
1608
- if (BUILD14.scoped && scopeId2 && childIdSplt[0] === hostId) {
1469
+ if (BUILD13.scoped && scopeId2) {
1609
1470
  node["s-si"] = scopeId2;
1610
1471
  childVNode.$attrs$.class += " " + scopeId2;
1611
1472
  }
@@ -1623,7 +1484,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1623
1484
  shadowRootNodes,
1624
1485
  slottedNodes
1625
1486
  );
1626
- if (BUILD14.scoped && scopeId2) {
1487
+ if (BUILD13.scoped && scopeId2) {
1627
1488
  node.classList.add(scopeId2);
1628
1489
  }
1629
1490
  }
@@ -1720,9 +1581,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1720
1581
  slottedNodes
1721
1582
  );
1722
1583
  } else if (childNodeType === CONTENT_REF_ID) {
1723
- if (BUILD14.shadowDom && shadowRootNodes) {
1584
+ if (BUILD13.shadowDom && shadowRootNodes) {
1724
1585
  node.remove();
1725
- } else if (BUILD14.slotRelocation) {
1586
+ } else if (BUILD13.slotRelocation) {
1726
1587
  hostElm["s-cr"] = node;
1727
1588
  node["s-cn"] = true;
1728
1589
  }
@@ -1735,7 +1596,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1735
1596
  vnode.$index$ = "0";
1736
1597
  parentVNode.$children$ = [vnode];
1737
1598
  } else {
1738
- if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim() && !node["s-nr"]) {
1599
+ if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
1739
1600
  node.remove();
1740
1601
  }
1741
1602
  }
@@ -1788,15 +1649,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1788
1649
  childVNode.$name$ = slotName || null;
1789
1650
  childVNode.$tag$ = "slot";
1790
1651
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1791
- if (BUILD14.shadowDom && shadowRootNodes && win.document) {
1652
+ if (BUILD13.shadowDom && shadowRootNodes && win.document) {
1792
1653
  const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
1793
1654
  if (childVNode.$name$) {
1794
1655
  childVNode.$elm$.setAttribute("name", slotName);
1795
1656
  }
1796
- if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
1797
- internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
1657
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1658
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1798
1659
  } else {
1799
- internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
1660
+ node.parentNode.insertBefore(slot, node);
1800
1661
  }
1801
1662
  addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1802
1663
  node.remove();
@@ -1822,7 +1683,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1822
1683
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1823
1684
  let slottedNode = slotNode.nextSibling;
1824
1685
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1825
- 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"))) {
1686
+ 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 */))) {
1826
1687
  slottedNode["s-sn"] = slotName;
1827
1688
  slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1828
1689
  slottedNode = slottedNode.nextSibling;
@@ -2257,31 +2118,31 @@ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
2257
2118
  import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
2258
2119
 
2259
2120
  // src/runtime/parse-property-value.ts
2260
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
2121
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
2261
2122
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2262
- if ((BUILD15.hydrateClientSide || BUILD15.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2123
+ if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
2263
2124
  try {
2264
2125
  propValue = JSON.parse(propValue);
2265
2126
  return propValue;
2266
2127
  } catch (e) {
2267
2128
  }
2268
2129
  }
2269
- if ((BUILD15.hydrateClientSide || BUILD15.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2130
+ if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
2270
2131
  propValue = deserializeProperty(propValue);
2271
2132
  return propValue;
2272
2133
  }
2273
2134
  if (propValue != null && !isComplexType(propValue)) {
2274
- if (BUILD15.propBoolean && propType & 4 /* Boolean */) {
2275
- if (BUILD15.formAssociated && isFormAssociated && typeof propValue === "string") {
2135
+ if (BUILD14.propBoolean && propType & 4 /* Boolean */) {
2136
+ if (BUILD14.formAssociated && isFormAssociated && typeof propValue === "string") {
2276
2137
  return propValue === "" || !!propValue;
2277
2138
  } else {
2278
2139
  return propValue === "false" ? false : propValue === "" || !!propValue;
2279
2140
  }
2280
2141
  }
2281
- if (BUILD15.propNumber && propType & 2 /* Number */) {
2142
+ if (BUILD14.propNumber && propType & 2 /* Number */) {
2282
2143
  return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
2283
2144
  }
2284
- if (BUILD15.propString && propType & 1 /* String */) {
2145
+ if (BUILD14.propString && propType & 1 /* String */) {
2285
2146
  return String(propValue);
2286
2147
  }
2287
2148
  return propValue;
@@ -2293,18 +2154,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2293
2154
  import { BUILD as BUILD21, NAMESPACE } from "@stencil/core/internal/app-data";
2294
2155
 
2295
2156
  // src/runtime/event-emitter.ts
2296
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2157
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2297
2158
 
2298
2159
  // src/runtime/element.ts
2299
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2300
- var getElement = (ref) => BUILD16.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2160
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
2161
+ var getElement = (ref) => BUILD15.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2301
2162
 
2302
2163
  // src/runtime/event-emitter.ts
2303
2164
  var createEvent = (ref, name, flags) => {
2304
2165
  const elm = getElement(ref);
2305
2166
  return {
2306
2167
  emit: (detail) => {
2307
- if (BUILD17.isDev && !elm.isConnected) {
2168
+ if (BUILD16.isDev && !elm.isConnected) {
2308
2169
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2309
2170
  }
2310
2171
  return emitEvent(elm, name, {
@@ -2322,6 +2183,123 @@ var emitEvent = (elm, name, opts) => {
2322
2183
  return ev;
2323
2184
  };
2324
2185
 
2186
+ // src/runtime/styles.ts
2187
+ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2188
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2189
+ var registerStyle = (scopeId2, cssText, allowCS) => {
2190
+ let style = styles.get(scopeId2);
2191
+ if (supportsConstructableStylesheets && allowCS) {
2192
+ style = style || new CSSStyleSheet();
2193
+ if (typeof style === "string") {
2194
+ style = cssText;
2195
+ } else {
2196
+ style.replaceSync(cssText);
2197
+ }
2198
+ } else {
2199
+ style = cssText;
2200
+ }
2201
+ styles.set(scopeId2, style);
2202
+ };
2203
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2204
+ var _a;
2205
+ const scopeId2 = getScopeId(cmpMeta, mode);
2206
+ const style = styles.get(scopeId2);
2207
+ if (!BUILD17.attachStyles || !win.document) {
2208
+ return scopeId2;
2209
+ }
2210
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
2211
+ if (style) {
2212
+ if (typeof style === "string") {
2213
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
2214
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2215
+ let styleElm;
2216
+ if (!appliedStyles) {
2217
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2218
+ }
2219
+ if (!appliedStyles.has(scopeId2)) {
2220
+ if (BUILD17.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
2221
+ styleElm.innerHTML = style;
2222
+ } else {
2223
+ styleElm = win.document.createElement("style");
2224
+ styleElm.innerHTML = style;
2225
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2226
+ if (nonce != null) {
2227
+ styleElm.setAttribute("nonce", nonce);
2228
+ }
2229
+ if ((BUILD17.hydrateServerSide || BUILD17.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
2230
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
2231
+ }
2232
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2233
+ if (styleContainerNode.nodeName === "HEAD") {
2234
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2235
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2236
+ styleContainerNode.insertBefore(
2237
+ styleElm,
2238
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2239
+ );
2240
+ } else if ("host" in styleContainerNode) {
2241
+ if (supportsConstructableStylesheets) {
2242
+ const stylesheet = new CSSStyleSheet();
2243
+ stylesheet.replaceSync(style);
2244
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2245
+ } else {
2246
+ const existingStyleContainer = styleContainerNode.querySelector("style");
2247
+ if (existingStyleContainer) {
2248
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2249
+ } else {
2250
+ styleContainerNode.prepend(styleElm);
2251
+ }
2252
+ }
2253
+ } else {
2254
+ styleContainerNode.append(styleElm);
2255
+ }
2256
+ }
2257
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2258
+ styleContainerNode.insertBefore(styleElm, null);
2259
+ }
2260
+ }
2261
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2262
+ styleElm.innerHTML += SLOT_FB_CSS;
2263
+ }
2264
+ if (appliedStyles) {
2265
+ appliedStyles.add(scopeId2);
2266
+ }
2267
+ }
2268
+ } else if (BUILD17.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
2269
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
2270
+ }
2271
+ }
2272
+ return scopeId2;
2273
+ };
2274
+ var attachStyles = (hostRef) => {
2275
+ const cmpMeta = hostRef.$cmpMeta$;
2276
+ const elm = hostRef.$hostElement$;
2277
+ const flags = cmpMeta.$flags$;
2278
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2279
+ const scopeId2 = addStyle(
2280
+ BUILD17.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2281
+ cmpMeta,
2282
+ hostRef.$modeName$
2283
+ );
2284
+ if ((BUILD17.shadowDom || BUILD17.scoped) && BUILD17.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
2285
+ elm["s-sc"] = scopeId2;
2286
+ elm.classList.add(scopeId2 + "-h");
2287
+ }
2288
+ endAttachStyles();
2289
+ };
2290
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD17.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2291
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
2292
+ var hydrateScopedToShadow = () => {
2293
+ if (!win.document) {
2294
+ return;
2295
+ }
2296
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
2297
+ let i2 = 0;
2298
+ for (; i2 < styles2.length; i2++) {
2299
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
2300
+ }
2301
+ };
2302
+
2325
2303
  // src/runtime/vdom/vdom-render.ts
2326
2304
  import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
2327
2305
 
@@ -2340,13 +2318,12 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2340
2318
  const classList = elm.classList;
2341
2319
  const oldClasses = parseClassList(oldValue);
2342
2320
  let newClasses = parseClassList(newValue);
2343
- if (BUILD18.hydrateClientSide && (elm["s-si"] || elm["s-sc"]) && initialRender) {
2344
- const scopeId2 = elm["s-sc"] || elm["s-si"];
2345
- newClasses.push(scopeId2);
2321
+ if (BUILD18.hydrateClientSide && elm["s-si"] && initialRender) {
2322
+ newClasses.push(elm["s-si"]);
2346
2323
  oldClasses.forEach((c) => {
2347
- if (c.startsWith(scopeId2)) newClasses.push(c);
2324
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
2348
2325
  });
2349
- newClasses = [...new Set(newClasses)].filter((c) => c);
2326
+ newClasses = [...new Set(newClasses)];
2350
2327
  classList.add(...newClasses);
2351
2328
  } else {
2352
2329
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
@@ -2828,8 +2805,6 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
2828
2805
  !isInitialRender && BUILD20.updatable && oldChildren !== null
2829
2806
  ) {
2830
2807
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
2831
- } else if (BUILD20.hydrateClientSide && isInitialRender && BUILD20.updatable && oldChildren !== null && newChildren === null) {
2832
- newVNode2.$children$ = oldChildren;
2833
2808
  }
2834
2809
  if (BUILD20.svg && isSvgMode && tag === "svg") {
2835
2810
  isSvgMode = false;
@@ -3297,16 +3272,10 @@ var forceUpdate = (ref) => {
3297
3272
  return false;
3298
3273
  };
3299
3274
  var appDidLoad = (who) => {
3300
- var _a;
3301
3275
  if (BUILD21.asyncQueue) {
3302
3276
  plt.$flags$ |= 2 /* appLoaded */;
3303
3277
  }
3304
3278
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3305
- if (BUILD21.hydrateClientSide) {
3306
- if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
3307
- plt.$orgLocNodes$.clear();
3308
- }
3309
- }
3310
3279
  if (BUILD21.profile && performance.measure) {
3311
3280
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
3312
3281
  }
@@ -3738,11 +3707,6 @@ var connectedCallback = (elm) => {
3738
3707
  if (BUILD25.hydrateServerSide || (BUILD25.slot || BUILD25.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3739
3708
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3740
3709
  setContentReference(elm);
3741
- } else if (BUILD25.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3742
- const commendPlaceholder = elm.firstChild;
3743
- if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3744
- elm.removeChild(commendPlaceholder);
3745
- }
3746
3710
  }
3747
3711
  }
3748
3712
  if (BUILD25.asyncLoading) {