@stencil/core 4.23.0 → 4.23.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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.23.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.23.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  };
9
9
 
10
10
  // src/hydrate/platform/index.ts
11
- import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
11
+ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
12
12
 
13
13
  // src/runtime/asset-path.ts
14
14
  var getAssetPath = (path) => {
@@ -18,7 +18,7 @@ var getAssetPath = (path) => {
18
18
  var setAssetPath = (path) => plt.$resourcesUrl$ = path;
19
19
 
20
20
  // src/runtime/bootstrap-custom-element.ts
21
- import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
21
+ import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
22
22
 
23
23
  // src/utils/constants.ts
24
24
  var EMPTY_OBJ = {};
@@ -26,7 +26,7 @@ var SVG_NS = "http://www.w3.org/2000/svg";
26
26
  var HTML_NS = "http://www.w3.org/1999/xhtml";
27
27
 
28
28
  // src/utils/helpers.ts
29
- var isDef = (v) => v != null;
29
+ var isDef = (v) => v != null && v !== void 0;
30
30
  var isComplexType = (o) => {
31
31
  o = typeof o;
32
32
  return o === "object" || o === "function";
@@ -88,13 +88,13 @@ var unwrapErr = (result) => {
88
88
  };
89
89
 
90
90
  // src/runtime/connected-callback.ts
91
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
91
+ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
92
92
 
93
93
  // src/runtime/client-hydrate.ts
94
- import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
94
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
95
95
 
96
96
  // src/runtime/dom-extras.ts
97
- import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
97
+ import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
98
98
 
99
99
  // src/runtime/runtime-constants.ts
100
100
  var CONTENT_REF_ID = "r";
@@ -121,11 +121,114 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
121
121
  "formStateRestoreCallback"
122
122
  ];
123
123
 
124
+ // src/runtime/slot-polyfill-utils.ts
125
+ import { BUILD } from "@stencil/core/internal/app-data";
126
+ var updateFallbackSlotVisibility = (elm) => {
127
+ const childNodes = elm.__childNodes || elm.childNodes;
128
+ if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
129
+ getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
130
+ var _a;
131
+ if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
132
+ if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
133
+ slotNode.hidden = true;
134
+ } else {
135
+ slotNode.hidden = false;
136
+ }
137
+ }
138
+ });
139
+ }
140
+ for (const childNode of childNodes) {
141
+ if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
142
+ updateFallbackSlotVisibility(childNode);
143
+ }
144
+ }
145
+ };
146
+ var getSlottedChildNodes = (childNodes) => {
147
+ const result = [];
148
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
149
+ const slottedNode = childNodes[i2]["s-nr"];
150
+ if (slottedNode && slottedNode.isConnected) {
151
+ result.push(slottedNode);
152
+ }
153
+ }
154
+ return result;
155
+ };
156
+ var getHostSlotNodes = (childNodes, hostName, slotName) => {
157
+ let i2 = 0;
158
+ let slottedNodes = [];
159
+ let childNode;
160
+ for (; i2 < childNodes.length; i2++) {
161
+ childNode = childNodes[i2];
162
+ if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
163
+ slottedNodes.push(childNode);
164
+ if (typeof slotName !== "undefined") return slottedNodes;
165
+ }
166
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
167
+ }
168
+ return slottedNodes;
169
+ };
170
+ var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
171
+ const childNodes = [];
172
+ if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
173
+ while ((node = node.nextSibling) && node["s-sn"] === slotName) {
174
+ childNodes.push(node);
175
+ }
176
+ return childNodes;
177
+ };
178
+ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
179
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
180
+ if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
181
+ return true;
182
+ }
183
+ if (nodeToRelocate.getAttribute("slot") === slotName) {
184
+ return true;
185
+ }
186
+ return false;
187
+ }
188
+ if (nodeToRelocate["s-sn"] === slotName) {
189
+ return true;
190
+ }
191
+ return slotName === "";
192
+ };
193
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
194
+ let slottedNodeLocation;
195
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
196
+ slottedNodeLocation = newChild["s-ol"];
197
+ } else {
198
+ slottedNodeLocation = document.createTextNode("");
199
+ slottedNodeLocation["s-nr"] = newChild;
200
+ }
201
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
202
+ const parent = slotNode["s-cr"].parentNode;
203
+ const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
204
+ if (typeof position !== "undefined") {
205
+ if (BUILD.hydrateClientSide) {
206
+ slottedNodeLocation["s-oo"] = position;
207
+ const childNodes = parent.__childNodes || parent.childNodes;
208
+ const slotRelocateNodes = [slottedNodeLocation];
209
+ childNodes.forEach((n) => {
210
+ if (n["s-nr"]) slotRelocateNodes.push(n);
211
+ });
212
+ slotRelocateNodes.sort((a, b) => {
213
+ if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
214
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
215
+ return 0;
216
+ });
217
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
218
+ }
219
+ } else {
220
+ appendMethod.call(parent, slottedNodeLocation);
221
+ }
222
+ newChild["s-ol"] = slottedNodeLocation;
223
+ newChild["s-sh"] = slotNode["s-hn"];
224
+ };
225
+ var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
226
+
124
227
  // src/runtime/vdom/vdom-render.ts
125
- import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
228
+ import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
126
229
 
127
230
  // src/runtime/vdom/h.ts
128
- import { BUILD } from "@stencil/core/internal/app-data";
231
+ import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
129
232
  var h = (nodeName, vnodeData, ...children) => {
130
233
  let child = null;
131
234
  let key = null;
@@ -141,7 +244,7 @@ var h = (nodeName, vnodeData, ...children) => {
141
244
  } else if (child != null && typeof child !== "boolean") {
142
245
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
143
246
  child = String(child);
144
- } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
247
+ } else if (BUILD2.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
145
248
  consoleDevError(`vNode passed as children has unexpected type.
146
249
  Make sure it's using the correct h() function.
147
250
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -157,28 +260,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
157
260
  };
158
261
  walk(children);
159
262
  if (vnodeData) {
160
- if (BUILD.isDev && nodeName === "input") {
263
+ if (BUILD2.isDev && nodeName === "input") {
161
264
  validateInputProperties(vnodeData);
162
265
  }
163
- if (BUILD.vdomKey && vnodeData.key) {
266
+ if (BUILD2.vdomKey && vnodeData.key) {
164
267
  key = vnodeData.key;
165
268
  }
166
- if (BUILD.slotRelocation && vnodeData.name) {
269
+ if (BUILD2.slotRelocation && vnodeData.name) {
167
270
  slotName = vnodeData.name;
168
271
  }
169
- if (BUILD.vdomClass) {
272
+ if (BUILD2.vdomClass) {
170
273
  const classData = vnodeData.className || vnodeData.class;
171
274
  if (classData) {
172
275
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
173
276
  }
174
277
  }
175
278
  }
176
- if (BUILD.isDev && vNodeChildren.some(isHost)) {
279
+ if (BUILD2.isDev && vNodeChildren.some(isHost)) {
177
280
  consoleDevError(`The <Host> must be the single root component. Make sure:
178
281
  - You are NOT using hostData() and <Host> in the same component.
179
282
  - <Host> is used once, and it's the single root component of the render() function.`);
180
283
  }
181
- if (BUILD.vdomFunctional && typeof nodeName === "function") {
284
+ if (BUILD2.vdomFunctional && typeof nodeName === "function") {
182
285
  return nodeName(
183
286
  vnodeData === null ? {} : vnodeData,
184
287
  vNodeChildren,
@@ -190,10 +293,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
190
293
  if (vNodeChildren.length > 0) {
191
294
  vnode.$children$ = vNodeChildren;
192
295
  }
193
- if (BUILD.vdomKey) {
296
+ if (BUILD2.vdomKey) {
194
297
  vnode.$key$ = key;
195
298
  }
196
- if (BUILD.slotRelocation) {
299
+ if (BUILD2.slotRelocation) {
197
300
  vnode.$name$ = slotName;
198
301
  }
199
302
  return vnode;
@@ -206,13 +309,13 @@ var newVNode = (tag, text) => {
206
309
  $elm$: null,
207
310
  $children$: null
208
311
  };
209
- if (BUILD.vdomAttribute) {
312
+ if (BUILD2.vdomAttribute) {
210
313
  vnode.$attrs$ = null;
211
314
  }
212
- if (BUILD.vdomKey) {
315
+ if (BUILD2.vdomKey) {
213
316
  vnode.$key$ = null;
214
317
  }
215
- if (BUILD.slotRelocation) {
318
+ if (BUILD2.slotRelocation) {
216
319
  vnode.$name$ = null;
217
320
  }
218
321
  return vnode;
@@ -265,28 +368,35 @@ var validateInputProperties = (inputElm) => {
265
368
  };
266
369
 
267
370
  // src/runtime/vdom/update-element.ts
268
- import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
371
+ import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
269
372
 
270
373
  // src/runtime/vdom/set-accessor.ts
271
- import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
374
+ import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
272
375
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
273
376
  if (oldValue !== newValue) {
274
377
  let isProp = isMemberInElement(elm, memberName);
275
378
  let ln = memberName.toLowerCase();
276
- if (BUILD2.vdomClass && memberName === "class") {
379
+ if (BUILD3.vdomClass && memberName === "class") {
277
380
  const classList = elm.classList;
278
381
  const oldClasses = parseClassList(oldValue);
279
- const newClasses = parseClassList(newValue);
280
- if (elm["s-si"] && newClasses.indexOf(elm["s-si"]) < 0) {
382
+ let newClasses = parseClassList(newValue);
383
+ if (elm["s-si"]) {
281
384
  newClasses.push(elm["s-si"]);
385
+ oldClasses.forEach((c) => {
386
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
387
+ });
388
+ newClasses = [...new Set(newClasses)];
389
+ classList.add(...newClasses);
390
+ delete elm["s-si"];
391
+ } else {
392
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
393
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
282
394
  }
283
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
284
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
285
- } else if (BUILD2.vdomStyle && memberName === "style") {
286
- if (BUILD2.updatable) {
395
+ } else if (BUILD3.vdomStyle && memberName === "style") {
396
+ if (BUILD3.updatable) {
287
397
  for (const prop in oldValue) {
288
398
  if (!newValue || newValue[prop] == null) {
289
- if (!BUILD2.hydrateServerSide && prop.includes("-")) {
399
+ if (!BUILD3.hydrateServerSide && prop.includes("-")) {
290
400
  elm.style.removeProperty(prop);
291
401
  } else {
292
402
  elm.style[prop] = "";
@@ -296,19 +406,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
296
406
  }
297
407
  for (const prop in newValue) {
298
408
  if (!oldValue || newValue[prop] !== oldValue[prop]) {
299
- if (!BUILD2.hydrateServerSide && prop.includes("-")) {
409
+ if (!BUILD3.hydrateServerSide && prop.includes("-")) {
300
410
  elm.style.setProperty(prop, newValue[prop]);
301
411
  } else {
302
412
  elm.style[prop] = newValue[prop];
303
413
  }
304
414
  }
305
415
  }
306
- } else if (BUILD2.vdomKey && memberName === "key") {
307
- } else if (BUILD2.vdomRef && memberName === "ref") {
416
+ } else if (BUILD3.vdomKey && memberName === "key") {
417
+ } else if (BUILD3.vdomRef && memberName === "ref") {
308
418
  if (newValue) {
309
419
  newValue(elm);
310
420
  }
311
- } else if (BUILD2.vdomListener && (BUILD2.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
421
+ } else if (BUILD3.vdomListener && (BUILD3.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
312
422
  if (memberName[2] === "-") {
313
423
  memberName = memberName.slice(3);
314
424
  } else if (isMemberInElement(win, ln)) {
@@ -326,7 +436,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
326
436
  plt.ael(elm, memberName, newValue, capture);
327
437
  }
328
438
  }
329
- } else if (BUILD2.vdomPropOrAttr) {
439
+ } else if (BUILD3.vdomPropOrAttr) {
330
440
  const isComplex = isComplexType(newValue);
331
441
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
332
442
  try {
@@ -348,7 +458,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
348
458
  }
349
459
  }
350
460
  let xlink = false;
351
- if (BUILD2.vdomXlink) {
461
+ if (BUILD3.vdomXlink) {
352
462
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
353
463
  memberName = ln;
354
464
  xlink = true;
@@ -356,7 +466,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
356
466
  }
357
467
  if (newValue == null || newValue === false) {
358
468
  if (newValue !== false || elm.getAttribute(memberName) === "") {
359
- if (BUILD2.vdomXlink && xlink) {
469
+ if (BUILD3.vdomXlink && xlink) {
360
470
  elm.removeAttributeNS(XLINK_NS, memberName);
361
471
  } else {
362
472
  elm.removeAttribute(memberName);
@@ -364,7 +474,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
364
474
  }
365
475
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
366
476
  newValue = newValue === true ? "" : newValue;
367
- if (BUILD2.vdomXlink && xlink) {
477
+ if (BUILD3.vdomXlink && xlink) {
368
478
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
369
479
  } else {
370
480
  elm.setAttribute(memberName, newValue);
@@ -374,7 +484,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
374
484
  }
375
485
  };
376
486
  var parseClassListRegex = /\s/;
377
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
487
+ var parseClassList = (value) => {
488
+ if (typeof value === "object" && "baseVal" in value) {
489
+ value = value.baseVal;
490
+ }
491
+ if (!value) {
492
+ return [];
493
+ }
494
+ return value.split(parseClassListRegex);
495
+ };
378
496
  var CAPTURE_EVENT_SUFFIX = "Capture";
379
497
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
380
498
 
@@ -383,7 +501,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
383
501
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
384
502
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
385
503
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
386
- if (BUILD3.updatable) {
504
+ if (BUILD4.updatable) {
387
505
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
388
506
  if (!(memberName in newVnodeAttrs)) {
389
507
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -412,19 +530,16 @@ var useNativeShadowDom = false;
412
530
  var checkSlotFallbackVisibility = false;
413
531
  var checkSlotRelocate = false;
414
532
  var isSvgMode = false;
415
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
533
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
416
534
  var _a;
417
535
  const newVNode2 = newParentVNode.$children$[childIndex];
418
536
  let i2 = 0;
419
537
  let elm;
420
538
  let childNode;
421
539
  let oldVNode;
422
- if (BUILD4.slotRelocation && !useNativeShadowDom) {
540
+ if (BUILD5.slotRelocation && !useNativeShadowDom) {
423
541
  checkSlotRelocate = true;
424
542
  if (newVNode2.$tag$ === "slot") {
425
- if (scopeId) {
426
- parentElm.classList.add(scopeId + "-s");
427
- }
428
543
  newVNode2.$flags$ |= newVNode2.$children$ ? (
429
544
  // slot element has fallback content
430
545
  // still create an element that "mocks" the slot element
@@ -437,48 +552,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
437
552
  );
438
553
  }
439
554
  }
440
- if (BUILD4.isDev && newVNode2.$elm$) {
555
+ if (BUILD5.isDev && newVNode2.$elm$) {
441
556
  consoleDevError(
442
557
  `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
443
558
  );
444
559
  }
445
- if (BUILD4.vdomText && newVNode2.$text$ !== null) {
560
+ if (BUILD5.vdomText && newVNode2.$text$ !== null) {
446
561
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
447
- } else if (BUILD4.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
448
- elm = newVNode2.$elm$ = BUILD4.isDebug || BUILD4.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
562
+ } else if (BUILD5.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
563
+ elm = newVNode2.$elm$ = BUILD5.isDebug || BUILD5.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
449
564
  } else {
450
- if (BUILD4.svg && !isSvgMode) {
565
+ if (BUILD5.svg && !isSvgMode) {
451
566
  isSvgMode = newVNode2.$tag$ === "svg";
452
567
  }
453
- elm = newVNode2.$elm$ = BUILD4.svg ? doc.createElementNS(
568
+ elm = newVNode2.$elm$ = BUILD5.svg ? doc.createElementNS(
454
569
  isSvgMode ? SVG_NS : HTML_NS,
455
- !useNativeShadowDom && BUILD4.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
570
+ !useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
456
571
  ) : doc.createElement(
457
- !useNativeShadowDom && BUILD4.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
572
+ !useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
458
573
  );
459
- if (BUILD4.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
574
+ if (BUILD5.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
460
575
  isSvgMode = false;
461
576
  }
462
- if (BUILD4.vdomAttribute) {
577
+ if (BUILD5.vdomAttribute) {
463
578
  updateElement(null, newVNode2, isSvgMode);
464
579
  }
465
- const rootNode = elm.getRootNode();
466
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
467
- if (!isElementWithinShadowRoot && BUILD4.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
580
+ if (BUILD5.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
468
581
  elm.classList.add(elm["s-si"] = scopeId);
469
582
  }
470
- if (BUILD4.scoped) {
471
- updateElementScopeIds(elm, parentElm);
472
- }
473
583
  if (newVNode2.$children$) {
474
584
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
475
- childNode = createElm(oldParentVNode, newVNode2, i2, elm);
585
+ childNode = createElm(oldParentVNode, newVNode2, i2);
476
586
  if (childNode) {
477
587
  elm.appendChild(childNode);
478
588
  }
479
589
  }
480
590
  }
481
- if (BUILD4.svg) {
591
+ if (BUILD5.svg) {
482
592
  if (newVNode2.$tag$ === "svg") {
483
593
  isSvgMode = false;
484
594
  } else if (elm.tagName === "foreignObject") {
@@ -487,7 +597,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
487
597
  }
488
598
  }
489
599
  elm["s-hn"] = hostTagName;
490
- if (BUILD4.slotRelocation) {
600
+ if (BUILD5.slotRelocation) {
491
601
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
492
602
  elm["s-sr"] = true;
493
603
  elm["s-cr"] = contentRef;
@@ -495,12 +605,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
495
605
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
496
606
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
497
607
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
498
- if (BUILD4.experimentalSlotFixes) {
608
+ if (BUILD5.experimentalSlotFixes) {
499
609
  relocateToHostRoot(oldParentVNode.$elm$);
500
610
  } else {
501
611
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
502
612
  }
503
613
  }
614
+ if (BUILD5.scoped) {
615
+ addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
616
+ }
504
617
  }
505
618
  }
506
619
  return elm;
@@ -528,7 +641,7 @@ var relocateToHostRoot = (parentElm) => {
528
641
  var putBackInOriginalLocation = (parentElm, recursive) => {
529
642
  plt.$flags$ |= 1 /* isTmpDisconnected */;
530
643
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
531
- if (parentElm["s-sr"] && BUILD4.experimentalSlotFixes) {
644
+ if (parentElm["s-sr"] && BUILD5.experimentalSlotFixes) {
532
645
  let node = parentElm;
533
646
  while (node = node.nextSibling) {
534
647
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -539,7 +652,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
539
652
  for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
540
653
  const childNode = oldSlotChildNodes[i2];
541
654
  if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
542
- insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode));
655
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
543
656
  childNode["s-ol"].remove();
544
657
  childNode["s-ol"] = void 0;
545
658
  childNode["s-sh"] = void 0;
@@ -552,17 +665,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
552
665
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
553
666
  };
554
667
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
555
- let containerElm = BUILD4.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
668
+ let containerElm = BUILD5.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
556
669
  let childNode;
557
- if (BUILD4.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
670
+ if (BUILD5.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
558
671
  containerElm = containerElm.shadowRoot;
559
672
  }
560
673
  for (; startIdx <= endIdx; ++startIdx) {
561
674
  if (vnodes[startIdx]) {
562
- childNode = createElm(null, parentVNode, startIdx, parentElm);
675
+ childNode = createElm(null, parentVNode, startIdx);
563
676
  if (childNode) {
564
677
  vnodes[startIdx].$elm$ = childNode;
565
- insertBefore(containerElm, childNode, BUILD4.slotRelocation ? referenceNode(before) : before);
678
+ insertBefore(containerElm, childNode, BUILD5.slotRelocation ? referenceNode(before) : before);
566
679
  }
567
680
  }
568
681
  }
@@ -574,7 +687,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
574
687
  const elm = vnode.$elm$;
575
688
  nullifyVNodeRefs(vnode);
576
689
  if (elm) {
577
- if (BUILD4.slotRelocation) {
690
+ if (BUILD5.slotRelocation) {
578
691
  checkSlotFallbackVisibility = true;
579
692
  if (elm["s-ol"]) {
580
693
  elm["s-ol"].remove();
@@ -618,7 +731,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
618
731
  oldEndVnode = oldCh[--oldEndIdx];
619
732
  newEndVnode = newCh[--newEndIdx];
620
733
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
621
- if (BUILD4.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
734
+ if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
622
735
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
623
736
  }
624
737
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -626,7 +739,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
626
739
  oldStartVnode = oldCh[++oldStartIdx];
627
740
  newEndVnode = newCh[--newEndIdx];
628
741
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
629
- if (BUILD4.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
742
+ if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
630
743
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
631
744
  }
632
745
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -635,7 +748,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
635
748
  newStartVnode = newCh[++newStartIdx];
636
749
  } else {
637
750
  idxInOld = -1;
638
- if (BUILD4.vdomKey) {
751
+ if (BUILD5.vdomKey) {
639
752
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
640
753
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
641
754
  idxInOld = i2;
@@ -643,10 +756,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
643
756
  }
644
757
  }
645
758
  }
646
- if (BUILD4.vdomKey && idxInOld >= 0) {
759
+ if (BUILD5.vdomKey && idxInOld >= 0) {
647
760
  elmToMove = oldCh[idxInOld];
648
761
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
649
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
762
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
650
763
  } else {
651
764
  patch(elmToMove, newStartVnode, isInitialRender);
652
765
  oldCh[idxInOld] = void 0;
@@ -654,12 +767,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
654
767
  }
655
768
  newStartVnode = newCh[++newStartIdx];
656
769
  } else {
657
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
770
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
658
771
  newStartVnode = newCh[++newStartIdx];
659
772
  }
660
773
  if (node) {
661
- if (BUILD4.slotRelocation) {
662
- insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
774
+ if (BUILD5.slotRelocation) {
775
+ insertBefore(
776
+ referenceNode(oldStartVnode.$elm$).parentNode,
777
+ node,
778
+ referenceNode(oldStartVnode.$elm$)
779
+ );
663
780
  } else {
664
781
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
665
782
  }
@@ -675,35 +792,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
675
792
  newStartIdx,
676
793
  newEndIdx
677
794
  );
678
- } else if (BUILD4.updatable && newStartIdx > newEndIdx) {
795
+ } else if (BUILD5.updatable && newStartIdx > newEndIdx) {
679
796
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
680
797
  }
681
798
  };
682
799
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
683
800
  if (leftVNode.$tag$ === rightVNode.$tag$) {
684
- if (BUILD4.slotRelocation && leftVNode.$tag$ === "slot") {
685
- if (
686
- // The component gets hydrated and no VDOM has been initialized.
687
- // Here the comparison can't happen as $name$ property is not set for `leftNode`.
688
- "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
689
- // hydration comments to be removed
690
- leftVNode.$elm$.nodeType !== 8
691
- ) {
692
- return false;
693
- }
801
+ if (BUILD5.slotRelocation && leftVNode.$tag$ === "slot") {
694
802
  return leftVNode.$name$ === rightVNode.$name$;
695
803
  }
696
- if (BUILD4.vdomKey && !isInitialRender) {
804
+ if (BUILD5.vdomKey && !isInitialRender) {
697
805
  return leftVNode.$key$ === rightVNode.$key$;
698
806
  }
807
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
808
+ leftVNode.$key$ = rightVNode.$key$;
809
+ }
699
810
  return true;
700
811
  }
701
812
  return false;
702
813
  };
703
- var referenceNode = (node) => {
704
- return node && node["s-ol"] || node;
705
- };
706
- var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
814
+ var referenceNode = (node) => node && node["s-ol"] || node;
707
815
  var patch = (oldVNode, newVNode2, isInitialRender = false) => {
708
816
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
709
817
  const oldChildren = oldVNode.$children$;
@@ -711,13 +819,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
711
819
  const tag = newVNode2.$tag$;
712
820
  const text = newVNode2.$text$;
713
821
  let defaultHolder;
714
- if (!BUILD4.vdomText || text === null) {
715
- if (BUILD4.svg) {
822
+ if (!BUILD5.vdomText || text === null) {
823
+ if (BUILD5.svg) {
716
824
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
717
825
  }
718
- if (BUILD4.vdomAttribute || BUILD4.reflect) {
719
- if (BUILD4.slot && tag === "slot" && !useNativeShadowDom) {
720
- if (BUILD4.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
826
+ if (BUILD5.vdomAttribute || BUILD5.reflect) {
827
+ if (BUILD5.slot && tag === "slot" && !useNativeShadowDom) {
828
+ if (BUILD5.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
721
829
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
722
830
  relocateToHostRoot(newVNode2.$elm$.parentElement);
723
831
  }
@@ -725,55 +833,28 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
725
833
  updateElement(oldVNode, newVNode2, isSvgMode);
726
834
  }
727
835
  }
728
- if (BUILD4.updatable && oldChildren !== null && newChildren !== null) {
836
+ if (BUILD5.updatable && oldChildren !== null && newChildren !== null) {
729
837
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
730
838
  } else if (newChildren !== null) {
731
- if (BUILD4.updatable && BUILD4.vdomText && oldVNode.$text$ !== null) {
839
+ if (BUILD5.updatable && BUILD5.vdomText && oldVNode.$text$ !== null) {
732
840
  elm.textContent = "";
733
841
  }
734
842
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
735
843
  } else if (
736
844
  // don't do this on initial render as it can cause non-hydrated content to be removed
737
- !isInitialRender && BUILD4.updatable && oldChildren !== null
845
+ !isInitialRender && BUILD5.updatable && oldChildren !== null
738
846
  ) {
739
847
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
740
848
  }
741
- if (BUILD4.svg && isSvgMode && tag === "svg") {
849
+ if (BUILD5.svg && isSvgMode && tag === "svg") {
742
850
  isSvgMode = false;
743
851
  }
744
- } else if (BUILD4.vdomText && BUILD4.slotRelocation && (defaultHolder = elm["s-cr"])) {
852
+ } else if (BUILD5.vdomText && BUILD5.slotRelocation && (defaultHolder = elm["s-cr"])) {
745
853
  defaultHolder.parentNode.textContent = text;
746
- } else if (BUILD4.vdomText && oldVNode.$text$ !== text) {
854
+ } else if (BUILD5.vdomText && oldVNode.$text$ !== text) {
747
855
  elm.data = text;
748
856
  }
749
857
  };
750
- var updateFallbackSlotVisibility = (elm) => {
751
- const childNodes = elm.__childNodes || elm.childNodes;
752
- for (const childNode of childNodes) {
753
- if (childNode.nodeType === 1 /* ElementNode */) {
754
- if (childNode["s-sr"]) {
755
- const slotName = childNode["s-sn"];
756
- childNode.hidden = false;
757
- for (const siblingNode of childNodes) {
758
- if (siblingNode !== childNode) {
759
- if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
760
- if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
761
- childNode.hidden = true;
762
- break;
763
- }
764
- } else if (slotName === siblingNode["s-sn"]) {
765
- if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
766
- childNode.hidden = true;
767
- break;
768
- }
769
- }
770
- }
771
- }
772
- }
773
- updateFallbackSlotVisibility(childNode);
774
- }
775
- }
776
- };
777
858
  var relocateNodes = [];
778
859
  var markSlotContentForRelocation = (elm) => {
779
860
  let node;
@@ -786,7 +867,7 @@ var markSlotContentForRelocation = (elm) => {
786
867
  const slotName = childNode["s-sn"];
787
868
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
788
869
  node = hostContentNodes[j];
789
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD4.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
870
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD5.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
790
871
  if (isNodeLocatedInSlot(node, slotName)) {
791
872
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
792
873
  checkSlotFallbackVisibility = true;
@@ -824,60 +905,40 @@ var markSlotContentForRelocation = (elm) => {
824
905
  }
825
906
  }
826
907
  };
827
- var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
828
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
829
- if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
830
- return true;
831
- }
832
- if (nodeToRelocate.getAttribute("slot") === slotName) {
833
- return true;
834
- }
835
- return false;
836
- }
837
- if (nodeToRelocate["s-sn"] === slotName) {
838
- return true;
839
- }
840
- return slotName === "";
841
- };
842
908
  var nullifyVNodeRefs = (vNode) => {
843
- if (BUILD4.vdomRef) {
909
+ if (BUILD5.vdomRef) {
844
910
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
845
911
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
846
912
  }
847
913
  };
848
914
  var insertBefore = (parent, newNode, reference) => {
849
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
850
- if (BUILD4.scoped) {
851
- updateElementScopeIds(newNode, parent);
915
+ if (BUILD5.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
916
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
852
917
  }
918
+ const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
853
919
  return inserted;
854
920
  };
855
- var findScopeIds = (element) => {
856
- const scopeIds = [];
857
- if (element) {
858
- scopeIds.push(
859
- ...element["s-scs"] || [],
860
- element["s-si"],
861
- element["s-sc"],
862
- ...findScopeIds(element.parentElement)
863
- );
864
- }
865
- return scopeIds;
866
- };
867
- var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
921
+ function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
868
922
  var _a;
869
- if (element && parent && element.nodeType === 1 /* ElementNode */) {
870
- const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
871
- if (scopeIds.size) {
872
- (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
873
- if (element["s-ol"] || iterateChildNodes) {
874
- for (const childNode of Array.from(element.__childNodes || element.childNodes)) {
875
- updateElementScopeIds(childNode, element, true);
923
+ let scopeId2;
924
+ if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
925
+ const scopeName = slotNode["s-sn"];
926
+ const hostName = slotNode["s-hn"];
927
+ (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
928
+ if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
929
+ let child = (oldParent.__childNodes || oldParent.childNodes)[0];
930
+ let found = false;
931
+ while (child) {
932
+ if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
933
+ found = true;
934
+ break;
876
935
  }
936
+ child = child.nextSibling;
877
937
  }
938
+ if (!found) oldParent.classList.remove(scopeId2 + "-s");
878
939
  }
879
940
  }
880
- };
941
+ }
881
942
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
882
943
  var _a, _b, _c, _d, _e;
883
944
  const hostElm = hostRef.$hostElement$;
@@ -885,7 +946,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
885
946
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
886
947
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
887
948
  hostTagName = hostElm.tagName;
888
- if (BUILD4.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
949
+ if (BUILD5.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
889
950
  throw new Error(`The <Host> must be the single root component.
890
951
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
891
952
 
@@ -899,7 +960,7 @@ render() {
899
960
  }
900
961
  `);
901
962
  }
902
- if (BUILD4.reflect && cmpMeta.$attrsToReflect$) {
963
+ if (BUILD5.reflect && cmpMeta.$attrsToReflect$) {
903
964
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
904
965
  cmpMeta.$attrsToReflect$.map(
905
966
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -915,24 +976,24 @@ render() {
915
976
  rootVnode.$tag$ = null;
916
977
  rootVnode.$flags$ |= 4 /* isHost */;
917
978
  hostRef.$vnode$ = rootVnode;
918
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD4.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
919
- if (BUILD4.scoped || BUILD4.shadowDom) {
979
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD5.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
980
+ if (BUILD5.scoped || BUILD5.shadowDom) {
920
981
  scopeId = hostElm["s-sc"];
921
982
  }
922
983
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
923
- if (BUILD4.slotRelocation) {
984
+ if (BUILD5.slotRelocation) {
924
985
  contentRef = hostElm["s-cr"];
925
986
  checkSlotFallbackVisibility = false;
926
987
  }
927
988
  patch(oldVNode, rootVnode, isInitialLoad);
928
- if (BUILD4.slotRelocation) {
989
+ if (BUILD5.slotRelocation) {
929
990
  plt.$flags$ |= 1 /* isTmpDisconnected */;
930
991
  if (checkSlotRelocate) {
931
992
  markSlotContentForRelocation(rootVnode.$elm$);
932
993
  for (const relocateData of relocateNodes) {
933
994
  const nodeToRelocate = relocateData.$nodeToRelocate$;
934
995
  if (!nodeToRelocate["s-ol"]) {
935
- const orgLocationNode = BUILD4.isDebug || BUILD4.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
996
+ const orgLocationNode = BUILD5.isDebug || BUILD5.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
936
997
  orgLocationNode["s-nr"] = nodeToRelocate;
937
998
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
938
999
  }
@@ -943,7 +1004,7 @@ render() {
943
1004
  if (slotRefNode) {
944
1005
  const parentNodeRef = slotRefNode.parentNode;
945
1006
  let insertBeforeNode = slotRefNode.nextSibling;
946
- if (!BUILD4.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1007
+ if (!BUILD5.hydrateServerSide && (!BUILD5.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
947
1008
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
948
1009
  while (orgLocationNode) {
949
1010
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -962,11 +1023,11 @@ render() {
962
1023
  }
963
1024
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
964
1025
  if (nodeToRelocate !== insertBeforeNode) {
965
- if (!BUILD4.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1026
+ if (!BUILD5.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
966
1027
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
967
1028
  }
968
1029
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
969
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1030
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
970
1031
  nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
971
1032
  }
972
1033
  }
@@ -988,7 +1049,7 @@ render() {
988
1049
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
989
1050
  relocateNodes.length = 0;
990
1051
  }
991
- if (BUILD4.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1052
+ if (BUILD5.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
992
1053
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
993
1054
  for (const childNode of children) {
994
1055
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
@@ -1025,9 +1086,9 @@ var patchCloneNode = (HostElementPrototype) => {
1025
1086
  const orgCloneNode = HostElementPrototype.cloneNode;
1026
1087
  HostElementPrototype.cloneNode = function(deep) {
1027
1088
  const srcNode = this;
1028
- const isShadowDom = BUILD5.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1089
+ const isShadowDom = BUILD6.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1029
1090
  const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
1030
- if (BUILD5.slot && !isShadowDom && deep) {
1091
+ if (BUILD6.slot && !isShadowDom && deep) {
1031
1092
  let i2 = 0;
1032
1093
  let slotted, nonStencilNode;
1033
1094
  const stencilPrivates = [
@@ -1052,7 +1113,7 @@ var patchCloneNode = (HostElementPrototype) => {
1052
1113
  slotted = childNodes[i2]["s-nr"];
1053
1114
  nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
1054
1115
  if (slotted) {
1055
- if (BUILD5.appendChildSlotFix && clonedNode.__appendChild) {
1116
+ if (BUILD6.appendChildSlotFix && clonedNode.__appendChild) {
1056
1117
  clonedNode.__appendChild(slotted.cloneNode(true));
1057
1118
  } else {
1058
1119
  clonedNode.appendChild(slotted.cloneNode(true));
@@ -1070,7 +1131,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
1070
1131
  HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
1071
1132
  HostElementPrototype.appendChild = function(newChild) {
1072
1133
  const slotName = newChild["s-sn"] = getSlotName(newChild);
1073
- const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
1134
+ const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
1074
1135
  if (slotNode) {
1075
1136
  addSlotRelocateNode(newChild, slotNode);
1076
1137
  const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
@@ -1087,7 +1148,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
1087
1148
  ElementPrototype.removeChild = function(toRemove) {
1088
1149
  if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
1089
1150
  const childNodes = this.__childNodes || this.childNodes;
1090
- const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
1151
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
1091
1152
  if (slotNode && toRemove.isConnected) {
1092
1153
  toRemove.remove();
1093
1154
  updateFallbackSlotVisibility(this);
@@ -1106,7 +1167,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
1106
1167
  }
1107
1168
  const slotName = newChild["s-sn"] = getSlotName(newChild);
1108
1169
  const childNodes = this.__childNodes || this.childNodes;
1109
- const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
1170
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
1110
1171
  if (slotNode) {
1111
1172
  addSlotRelocateNode(newChild, slotNode, true);
1112
1173
  const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
@@ -1173,11 +1234,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
1173
1234
  };
1174
1235
  };
1175
1236
  var patchTextContent = (hostElementPrototype) => {
1176
- let descriptor = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
1177
- if (!descriptor) {
1178
- descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
1179
- }
1180
- if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
1237
+ patchHostOriginalAccessor("textContent", hostElementPrototype);
1181
1238
  Object.defineProperty(hostElementPrototype, "textContent", {
1182
1239
  get: function() {
1183
1240
  let text = "";
@@ -1201,16 +1258,7 @@ var patchChildSlotNodes = (elm) => {
1201
1258
  return this[n];
1202
1259
  }
1203
1260
  }
1204
- let childNodesFn = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
1205
- if (!childNodesFn) {
1206
- childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
1207
- }
1208
- if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
1209
- let childrenFn = Object.getOwnPropertyDescriptor(Element.prototype, "children");
1210
- if (!childrenFn) {
1211
- childrenFn = Object.getOwnPropertyDescriptor(elm, "children");
1212
- }
1213
- if (childrenFn) Object.defineProperty(elm, "__children", childrenFn);
1261
+ patchHostOriginalAccessor("children", elm);
1214
1262
  Object.defineProperty(elm, "children", {
1215
1263
  get() {
1216
1264
  return this.childNodes.filter((n) => n.nodeType === 1);
@@ -1221,7 +1269,19 @@ var patchChildSlotNodes = (elm) => {
1221
1269
  return this.children.length;
1222
1270
  }
1223
1271
  });
1224
- if (!childNodesFn) return;
1272
+ patchHostOriginalAccessor("firstChild", elm);
1273
+ Object.defineProperty(elm, "firstChild", {
1274
+ get() {
1275
+ return this.childNodes[0];
1276
+ }
1277
+ });
1278
+ patchHostOriginalAccessor("lastChild", elm);
1279
+ Object.defineProperty(elm, "lastChild", {
1280
+ get() {
1281
+ return this.childNodes[this.childNodes.length - 1];
1282
+ }
1283
+ });
1284
+ patchHostOriginalAccessor("childNodes", elm);
1225
1285
  Object.defineProperty(elm, "childNodes", {
1226
1286
  get() {
1227
1287
  var _a, _b;
@@ -1235,77 +1295,102 @@ var patchChildSlotNodes = (elm) => {
1235
1295
  }
1236
1296
  });
1237
1297
  };
1238
- var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
1239
- let slottedNodeLocation;
1240
- if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
1241
- slottedNodeLocation = newChild["s-ol"];
1242
- } else {
1243
- slottedNodeLocation = document.createTextNode("");
1244
- slottedNodeLocation["s-nr"] = newChild;
1298
+ var patchNextPrev = (node) => {
1299
+ if (!node || node.__nextSibling || !globalThis.Node) return;
1300
+ patchNextSibling(node);
1301
+ patchPreviousSibling(node);
1302
+ if (node.nodeType === Node.ELEMENT_NODE) {
1303
+ patchNextElementSibling(node);
1304
+ patchPreviousElementSibling(node);
1245
1305
  }
1246
- if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
1247
- const parent = slotNode["s-cr"].parentNode;
1248
- const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
1249
- if (typeof position !== "undefined") {
1250
- if (BUILD5.hydrateClientSide) {
1251
- slottedNodeLocation["s-oo"] = position;
1252
- const childNodes = parent.__childNodes || parent.childNodes;
1253
- const slotRelocateNodes = [slottedNodeLocation];
1254
- childNodes.forEach((n) => {
1255
- if (n["s-nr"]) slotRelocateNodes.push(n);
1256
- });
1257
- slotRelocateNodes.sort((a, b) => {
1258
- if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
1259
- else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
1260
- return 0;
1261
- });
1262
- slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
1306
+ };
1307
+ var patchNextSibling = (node) => {
1308
+ if (!node || node.__nextSibling) return;
1309
+ patchHostOriginalAccessor("nextSibling", node);
1310
+ Object.defineProperty(node, "nextSibling", {
1311
+ get: function() {
1312
+ var _a;
1313
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
1314
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1315
+ if (parentNodes && index > -1) {
1316
+ return parentNodes[index + 1];
1317
+ }
1318
+ return this.__nextSibling;
1263
1319
  }
1264
- } else {
1265
- appendMethod.call(parent, slottedNodeLocation);
1266
- }
1267
- newChild["s-ol"] = slottedNodeLocation;
1268
- newChild["s-sh"] = slotNode["s-hn"];
1320
+ });
1269
1321
  };
1270
- var getSlottedChildNodes = (childNodes) => {
1271
- const result = [];
1272
- for (let i2 = 0; i2 < childNodes.length; i2++) {
1273
- const slottedNode = childNodes[i2]["s-nr"];
1274
- if (slottedNode && slottedNode.isConnected) {
1275
- result.push(slottedNode);
1322
+ var patchNextElementSibling = (element) => {
1323
+ if (!element || element.__nextElementSibling) return;
1324
+ patchHostOriginalAccessor("nextElementSibling", element);
1325
+ Object.defineProperty(element, "nextElementSibling", {
1326
+ get: function() {
1327
+ var _a;
1328
+ const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
1329
+ const index = parentEles == null ? void 0 : parentEles.indexOf(this);
1330
+ if (parentEles && index > -1) {
1331
+ return parentEles[index + 1];
1332
+ }
1333
+ return this.__nextElementSibling;
1276
1334
  }
1277
- }
1278
- return result;
1335
+ });
1279
1336
  };
1280
- var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
1281
- var getHostSlotNode = (childNodes, slotName, hostName) => {
1282
- let i2 = 0;
1283
- let childNode;
1284
- for (; i2 < childNodes.length; i2++) {
1285
- childNode = childNodes[i2];
1286
- if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
1287
- return childNode;
1337
+ var patchPreviousSibling = (node) => {
1338
+ if (!node || node.__previousSibling) return;
1339
+ patchHostOriginalAccessor("previousSibling", node);
1340
+ Object.defineProperty(node, "previousSibling", {
1341
+ get: function() {
1342
+ var _a;
1343
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
1344
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1345
+ if (parentNodes && index > -1) {
1346
+ return parentNodes[index - 1];
1347
+ }
1348
+ return this.__previousSibling;
1288
1349
  }
1289
- childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
1290
- if (childNode) {
1291
- return childNode;
1350
+ });
1351
+ };
1352
+ var patchPreviousElementSibling = (element) => {
1353
+ if (!element || element.__previousElementSibling) return;
1354
+ patchHostOriginalAccessor("previousElementSibling", element);
1355
+ Object.defineProperty(element, "previousElementSibling", {
1356
+ get: function() {
1357
+ var _a;
1358
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
1359
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1360
+ if (parentNodes && index > -1) {
1361
+ return parentNodes[index - 1];
1362
+ }
1363
+ return this.__previousElementSibling;
1292
1364
  }
1293
- }
1294
- return null;
1365
+ });
1295
1366
  };
1296
- var getHostSlotChildNodes = (n, slotName) => {
1297
- const childNodes = [n];
1298
- while ((n = n.nextSibling) && n["s-sn"] === slotName) {
1299
- childNodes.push(n);
1367
+ var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
1368
+ var validNodesPatches = [
1369
+ "childNodes",
1370
+ "firstChild",
1371
+ "lastChild",
1372
+ "nextSibling",
1373
+ "previousSibling",
1374
+ "textContent"
1375
+ ];
1376
+ function patchHostOriginalAccessor(accessorName, node) {
1377
+ let accessor;
1378
+ if (validElementPatches.includes(accessorName)) {
1379
+ accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
1380
+ } else if (validNodesPatches.includes(accessorName)) {
1381
+ accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
1300
1382
  }
1301
- return childNodes;
1302
- };
1383
+ if (!accessor) {
1384
+ accessor = Object.getOwnPropertyDescriptor(node, accessorName);
1385
+ }
1386
+ if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
1387
+ }
1303
1388
 
1304
1389
  // src/runtime/profile.ts
1305
- import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
1390
+ import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
1306
1391
  var i = 0;
1307
1392
  var createTime = (fnName, tagName = "") => {
1308
- if (BUILD6.profile && performance.mark) {
1393
+ if (BUILD7.profile && performance.mark) {
1309
1394
  const key = `st:${fnName}:${tagName}:${i++}`;
1310
1395
  performance.mark(key);
1311
1396
  return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
@@ -1316,7 +1401,7 @@ var createTime = (fnName, tagName = "") => {
1316
1401
  }
1317
1402
  };
1318
1403
  var uniqueTime = (key, measureText) => {
1319
- if (BUILD6.profile && performance.mark) {
1404
+ if (BUILD7.profile && performance.mark) {
1320
1405
  if (performance.getEntriesByName(key, "mark").length === 0) {
1321
1406
  performance.mark(key);
1322
1407
  }
@@ -1374,7 +1459,7 @@ var inspect = (ref) => {
1374
1459
  };
1375
1460
  };
1376
1461
  var installDevTools = () => {
1377
- if (BUILD6.devTools) {
1462
+ if (BUILD7.devTools) {
1378
1463
  const stencil = win.stencil = win.stencil || {};
1379
1464
  const originalInspect = stencil.inspect;
1380
1465
  stencil.inspect = (ref) => {
@@ -1394,9 +1479,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1394
1479
  const childRenderNodes = [];
1395
1480
  const slotNodes = [];
1396
1481
  const slottedNodes = [];
1397
- const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
1482
+ const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
1398
1483
  const vnode = newVNode(tagName, null);
1399
1484
  vnode.$elm$ = hostElm;
1485
+ let scopeId2;
1486
+ if (BUILD8.scoped) {
1487
+ const cmpMeta = hostRef.$cmpMeta$;
1488
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1489
+ scopeId2 = hostElm["s-sc"];
1490
+ hostElm.classList.add(scopeId2 + "-h");
1491
+ } else if (hostElm["s-sc"]) {
1492
+ delete hostElm["s-sc"];
1493
+ }
1494
+ }
1400
1495
  if (!plt.$orgLocNodes$) {
1401
1496
  initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1402
1497
  }
@@ -1426,6 +1521,18 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1426
1521
  node["s-cr"] = hostElm["s-cr"];
1427
1522
  }
1428
1523
  }
1524
+ if (childRenderNode.$tag$ === "slot") {
1525
+ if (childRenderNode.$children$) {
1526
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
1527
+ if (!childRenderNode.$elm$.childNodes.length) {
1528
+ childRenderNode.$children$.forEach((c) => {
1529
+ childRenderNode.$elm$.appendChild(c.$elm$);
1530
+ });
1531
+ }
1532
+ } else {
1533
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
1534
+ }
1535
+ }
1429
1536
  if (orgLocationNode && orgLocationNode.isConnected) {
1430
1537
  if (shadowRoot && orgLocationNode["s-en"] === "") {
1431
1538
  orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
@@ -1438,8 +1545,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1438
1545
  plt.$orgLocNodes$.delete(orgLocationId);
1439
1546
  }
1440
1547
  const hosts = [];
1441
- let snIndex = 0;
1442
1548
  const snLen = slottedNodes.length;
1549
+ let snIndex = 0;
1443
1550
  let slotGroup;
1444
1551
  let snGroupIdx;
1445
1552
  let snGroupLen;
@@ -1461,17 +1568,24 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1461
1568
  if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1462
1569
  slottedItem.slot["s-cr"] = hostEle;
1463
1570
  } else {
1464
- const hostChildren = hostEle.__childNodes || hostEle.childNodes;
1465
- slottedItem.slot["s-cr"] = hostChildren[0];
1571
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1466
1572
  }
1467
1573
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1574
+ if (BUILD8.experimentalSlotFixes) {
1575
+ patchNextPrev(slottedItem.node);
1576
+ }
1468
1577
  }
1469
1578
  if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1470
1579
  hostEle.appendChild(slottedItem.node);
1471
1580
  }
1472
1581
  }
1473
1582
  }
1474
- if (BUILD7.shadowDom && shadowRoot) {
1583
+ if (BUILD8.scoped && scopeId2 && slotNodes.length) {
1584
+ slotNodes.forEach((slot) => {
1585
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1586
+ });
1587
+ }
1588
+ if (BUILD8.shadowDom && shadowRoot) {
1475
1589
  let rnIdex = 0;
1476
1590
  const rnLen = shadowRootNodes.length;
1477
1591
  for (rnIdex; rnIdex < rnLen; rnIdex++) {
@@ -1505,15 +1619,19 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1505
1619
  $index$: childIdSplt[3],
1506
1620
  $tag$: node.tagName.toLowerCase(),
1507
1621
  $elm$: node,
1508
- // If we don't add the initial classes to the VNode, the first `vdom-render.ts` reconciliation will fail:
1509
- // client side changes before componentDidLoad will be ignored, `set-accessor.ts` will just take the element's initial classes
1510
- $attrs$: { class: node.className }
1622
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
1623
+ // won't try to reconcile them. Classes set on the node will be blown away.
1624
+ $attrs$: { class: node.className || "" }
1511
1625
  });
1512
1626
  childRenderNodes.push(childVNode);
1513
1627
  node.removeAttribute(HYDRATE_CHILD_ID);
1514
1628
  if (!parentVNode.$children$) {
1515
1629
  parentVNode.$children$ = [];
1516
1630
  }
1631
+ if (BUILD8.scoped && scopeId2) {
1632
+ node["s-si"] = scopeId2;
1633
+ childVNode.$attrs$.class += " " + scopeId2;
1634
+ }
1517
1635
  const slotName = childVNode.$elm$.getAttribute("s-sn");
1518
1636
  if (typeof slotName === "string") {
1519
1637
  if (childVNode.$tag$ === "slot-fb") {
@@ -1528,6 +1646,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1528
1646
  shadowRootNodes,
1529
1647
  slottedNodes
1530
1648
  );
1649
+ if (BUILD8.scoped && scopeId2) {
1650
+ node.classList.add(scopeId2);
1651
+ }
1531
1652
  }
1532
1653
  childVNode.$elm$["s-sn"] = slotName;
1533
1654
  childVNode.$elm$.removeAttribute("s-sn");
@@ -1535,7 +1656,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1535
1656
  if (childVNode.$index$ !== void 0) {
1536
1657
  parentVNode.$children$[childVNode.$index$] = childVNode;
1537
1658
  }
1538
- if (scopeId2) node["s-si"] = scopeId2;
1539
1659
  parentVNode = childVNode;
1540
1660
  if (shadowRootNodes && childVNode.$depth$ === "0") {
1541
1661
  shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
@@ -1610,8 +1730,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1610
1730
  }
1611
1731
  } else if (childVNode.$hostId$ === hostId) {
1612
1732
  if (childNodeType === SLOT_NODE_ID) {
1613
- childVNode.$tag$ = "slot";
1614
- const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
1733
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
1615
1734
  addSlot(
1616
1735
  slotName,
1617
1736
  childIdSplt[2],
@@ -1624,9 +1743,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
1624
1743
  slottedNodes
1625
1744
  );
1626
1745
  } else if (childNodeType === CONTENT_REF_ID) {
1627
- if (BUILD7.shadowDom && shadowRootNodes) {
1746
+ if (BUILD8.shadowDom && shadowRootNodes) {
1628
1747
  node.remove();
1629
- } else if (BUILD7.slotRelocation) {
1748
+ } else if (BUILD8.slotRelocation) {
1630
1749
  hostElm["s-cr"] = node;
1631
1750
  node["s-cn"] = true;
1632
1751
  }
@@ -1685,8 +1804,10 @@ var createSimpleVNode = (vnode) => {
1685
1804
  };
1686
1805
  function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1687
1806
  node["s-sr"] = true;
1807
+ childVNode.$name$ = slotName || null;
1808
+ childVNode.$tag$ = "slot";
1688
1809
  const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1689
- if (BUILD7.shadowDom && shadowRootNodes) {
1810
+ if (BUILD8.shadowDom && shadowRootNodes) {
1690
1811
  const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1691
1812
  if (childVNode.$name$) {
1692
1813
  childVNode.$elm$.setAttribute("name", slotName);
@@ -1727,7 +1848,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
1727
1848
  };
1728
1849
 
1729
1850
  // src/runtime/initialize-component.ts
1730
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
1851
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
1731
1852
 
1732
1853
  // src/runtime/mode.ts
1733
1854
  var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
@@ -1735,22 +1856,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
1735
1856
  var getMode = (ref) => getHostRef(ref).$modeName$;
1736
1857
 
1737
1858
  // src/runtime/proxy-component.ts
1738
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
1859
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
1739
1860
 
1740
1861
  // src/runtime/set-value.ts
1741
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
1862
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
1742
1863
 
1743
1864
  // src/runtime/parse-property-value.ts
1744
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
1865
+ import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1745
1866
  var parsePropertyValue = (propValue, propType) => {
1746
1867
  if (propValue != null && !isComplexType(propValue)) {
1747
- if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
1868
+ if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
1748
1869
  return propValue === "false" ? false : propValue === "" || !!propValue;
1749
1870
  }
1750
- if (BUILD8.propNumber && propType & 2 /* Number */) {
1871
+ if (BUILD9.propNumber && propType & 2 /* Number */) {
1751
1872
  return parseFloat(propValue);
1752
1873
  }
1753
- if (BUILD8.propString && propType & 1 /* String */) {
1874
+ if (BUILD9.propString && propType & 1 /* String */) {
1754
1875
  return String(propValue);
1755
1876
  }
1756
1877
  return propValue;
@@ -1759,21 +1880,21 @@ var parsePropertyValue = (propValue, propType) => {
1759
1880
  };
1760
1881
 
1761
1882
  // src/runtime/update-component.ts
1762
- import { BUILD as BUILD12, NAMESPACE } from "@stencil/core/internal/app-data";
1883
+ import { BUILD as BUILD13, NAMESPACE } from "@stencil/core/internal/app-data";
1763
1884
 
1764
1885
  // src/runtime/event-emitter.ts
1765
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
1886
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1766
1887
 
1767
1888
  // src/runtime/element.ts
1768
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
1769
- var getElement = (ref) => BUILD9.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1889
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
1890
+ var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1770
1891
 
1771
1892
  // src/runtime/event-emitter.ts
1772
1893
  var createEvent = (ref, name, flags) => {
1773
1894
  const elm = getElement(ref);
1774
1895
  return {
1775
1896
  emit: (detail) => {
1776
- if (BUILD10.isDev && !elm.isConnected) {
1897
+ if (BUILD11.isDev && !elm.isConnected) {
1777
1898
  consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1778
1899
  }
1779
1900
  return emitEvent(elm, name, {
@@ -1792,7 +1913,7 @@ var emitEvent = (elm, name, opts) => {
1792
1913
  };
1793
1914
 
1794
1915
  // src/runtime/styles.ts
1795
- import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1916
+ import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
1796
1917
  var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1797
1918
  var registerStyle = (scopeId2, cssText, allowCS) => {
1798
1919
  let style = styles.get(scopeId2);
@@ -1812,7 +1933,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1812
1933
  var _a;
1813
1934
  const scopeId2 = getScopeId(cmpMeta, mode);
1814
1935
  const style = styles.get(scopeId2);
1815
- if (!BUILD11.attachStyles) {
1936
+ if (!BUILD12.attachStyles) {
1816
1937
  return scopeId2;
1817
1938
  }
1818
1939
  styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
@@ -1825,16 +1946,16 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1825
1946
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1826
1947
  }
1827
1948
  if (!appliedStyles.has(scopeId2)) {
1828
- if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1949
+ if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1829
1950
  styleElm.innerHTML = style;
1830
1951
  } else {
1831
- styleElm = doc.createElement("style");
1952
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
1832
1953
  styleElm.innerHTML = style;
1833
1954
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1834
1955
  if (nonce != null) {
1835
1956
  styleElm.setAttribute("nonce", nonce);
1836
1957
  }
1837
- if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1958
+ if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1838
1959
  styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1839
1960
  }
1840
1961
  if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
@@ -1870,7 +1991,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1870
1991
  appliedStyles.add(scopeId2);
1871
1992
  }
1872
1993
  }
1873
- } else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1994
+ } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1874
1995
  styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1875
1996
  }
1876
1997
  }
@@ -1882,43 +2003,40 @@ var attachStyles = (hostRef) => {
1882
2003
  const flags = cmpMeta.$flags$;
1883
2004
  const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1884
2005
  const scopeId2 = addStyle(
1885
- BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2006
+ BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1886
2007
  cmpMeta,
1887
2008
  hostRef.$modeName$
1888
2009
  );
1889
- if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
2010
+ if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
1890
2011
  elm["s-sc"] = scopeId2;
1891
2012
  elm.classList.add(scopeId2 + "-h");
1892
- if (BUILD11.scoped && flags & 2 /* scopedCssEncapsulation */) {
1893
- elm.classList.add(scopeId2 + "-s");
1894
- }
1895
2013
  }
1896
2014
  endAttachStyles();
1897
2015
  };
1898
- var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
2016
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1899
2017
 
1900
2018
  // src/runtime/update-component.ts
1901
2019
  var attachToAncestor = (hostRef, ancestorComponent) => {
1902
- if (BUILD12.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2020
+ if (BUILD13.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1903
2021
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1904
2022
  }
1905
2023
  };
1906
2024
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1907
- if (BUILD12.taskQueue && BUILD12.updatable) {
2025
+ if (BUILD13.taskQueue && BUILD13.updatable) {
1908
2026
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1909
2027
  }
1910
- if (BUILD12.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2028
+ if (BUILD13.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1911
2029
  hostRef.$flags$ |= 512 /* needsRerender */;
1912
2030
  return;
1913
2031
  }
1914
2032
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1915
2033
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1916
- return BUILD12.taskQueue ? writeTask(dispatch) : dispatch();
2034
+ return BUILD13.taskQueue ? writeTask(dispatch) : dispatch();
1917
2035
  };
1918
2036
  var dispatchHooks = (hostRef, isInitialLoad) => {
1919
2037
  const elm = hostRef.$hostElement$;
1920
2038
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1921
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
2039
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1922
2040
  if (!instance) {
1923
2041
  throw new Error(
1924
2042
  `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
@@ -1926,7 +2044,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1926
2044
  }
1927
2045
  let maybePromise;
1928
2046
  if (isInitialLoad) {
1929
- if (BUILD12.lazyLoad && BUILD12.hostListener) {
2047
+ if (BUILD13.lazyLoad && BUILD13.hostListener) {
1930
2048
  hostRef.$flags$ |= 256 /* isListenReady */;
1931
2049
  if (hostRef.$queuedListeners$) {
1932
2050
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1934,17 +2052,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1934
2052
  }
1935
2053
  }
1936
2054
  emitLifecycleEvent(elm, "componentWillLoad");
1937
- if (BUILD12.cmpWillLoad) {
2055
+ if (BUILD13.cmpWillLoad) {
1938
2056
  maybePromise = safeCall(instance, "componentWillLoad");
1939
2057
  }
1940
2058
  } else {
1941
2059
  emitLifecycleEvent(elm, "componentWillUpdate");
1942
- if (BUILD12.cmpWillUpdate) {
2060
+ if (BUILD13.cmpWillUpdate) {
1943
2061
  maybePromise = safeCall(instance, "componentWillUpdate");
1944
2062
  }
1945
2063
  }
1946
2064
  emitLifecycleEvent(elm, "componentWillRender");
1947
- if (BUILD12.cmpWillRender) {
2065
+ if (BUILD13.cmpWillRender) {
1948
2066
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1949
2067
  }
1950
2068
  endSchedule();
@@ -1960,23 +2078,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1960
2078
  const elm = hostRef.$hostElement$;
1961
2079
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1962
2080
  const rc = elm["s-rc"];
1963
- if (BUILD12.style && isInitialLoad) {
2081
+ if (BUILD13.style && isInitialLoad) {
1964
2082
  attachStyles(hostRef);
1965
2083
  }
1966
2084
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1967
- if (BUILD12.isDev) {
2085
+ if (BUILD13.isDev) {
1968
2086
  hostRef.$flags$ |= 1024 /* devOnRender */;
1969
2087
  }
1970
- if (BUILD12.hydrateServerSide) {
2088
+ if (BUILD13.hydrateServerSide) {
1971
2089
  await callRender(hostRef, instance, elm, isInitialLoad);
1972
2090
  } else {
1973
2091
  callRender(hostRef, instance, elm, isInitialLoad);
1974
2092
  }
1975
- if (BUILD12.isDev) {
2093
+ if (BUILD13.isDev) {
1976
2094
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1977
2095
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1978
2096
  }
1979
- if (BUILD12.hydrateServerSide) {
2097
+ if (BUILD13.hydrateServerSide) {
1980
2098
  try {
1981
2099
  serverSideConnected(elm);
1982
2100
  if (isInitialLoad) {
@@ -1990,13 +2108,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1990
2108
  consoleError(e, elm);
1991
2109
  }
1992
2110
  }
1993
- if (BUILD12.asyncLoading && rc) {
2111
+ if (BUILD13.asyncLoading && rc) {
1994
2112
  rc.map((cb) => cb());
1995
2113
  elm["s-rc"] = void 0;
1996
2114
  }
1997
2115
  endRender();
1998
2116
  endUpdate();
1999
- if (BUILD12.asyncLoading) {
2117
+ if (BUILD13.asyncLoading) {
2000
2118
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
2001
2119
  const postUpdate = () => postUpdateComponent(hostRef);
2002
2120
  if (childrenPromises.length === 0) {
@@ -2012,10 +2130,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
2012
2130
  };
2013
2131
  var renderingRef = null;
2014
2132
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
2015
- const allRenderFn = BUILD12.allRenderFn ? true : false;
2016
- const lazyLoad = BUILD12.lazyLoad ? true : false;
2017
- const taskQueue = BUILD12.taskQueue ? true : false;
2018
- const updatable = BUILD12.updatable ? true : false;
2133
+ const allRenderFn = BUILD13.allRenderFn ? true : false;
2134
+ const lazyLoad = BUILD13.lazyLoad ? true : false;
2135
+ const taskQueue = BUILD13.taskQueue ? true : false;
2136
+ const updatable = BUILD13.updatable ? true : false;
2019
2137
  try {
2020
2138
  renderingRef = instance;
2021
2139
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -2025,9 +2143,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
2025
2143
  if (updatable || lazyLoad) {
2026
2144
  hostRef.$flags$ |= 2 /* hasRendered */;
2027
2145
  }
2028
- if (BUILD12.hasRenderFn || BUILD12.reflect) {
2029
- if (BUILD12.vdomRender || BUILD12.reflect) {
2030
- if (BUILD12.hydrateServerSide) {
2146
+ if (BUILD13.hasRenderFn || BUILD13.reflect) {
2147
+ if (BUILD13.vdomRender || BUILD13.reflect) {
2148
+ if (BUILD13.hydrateServerSide) {
2031
2149
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
2032
2150
  } else {
2033
2151
  renderVdom(hostRef, instance, isInitialLoad);
@@ -2052,57 +2170,57 @@ var postUpdateComponent = (hostRef) => {
2052
2170
  const tagName = hostRef.$cmpMeta$.$tagName$;
2053
2171
  const elm = hostRef.$hostElement$;
2054
2172
  const endPostUpdate = createTime("postUpdate", tagName);
2055
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
2173
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
2056
2174
  const ancestorComponent = hostRef.$ancestorComponent$;
2057
- if (BUILD12.cmpDidRender) {
2058
- if (BUILD12.isDev) {
2175
+ if (BUILD13.cmpDidRender) {
2176
+ if (BUILD13.isDev) {
2059
2177
  hostRef.$flags$ |= 1024 /* devOnRender */;
2060
2178
  }
2061
2179
  safeCall(instance, "componentDidRender");
2062
- if (BUILD12.isDev) {
2180
+ if (BUILD13.isDev) {
2063
2181
  hostRef.$flags$ &= ~1024 /* devOnRender */;
2064
2182
  }
2065
2183
  }
2066
2184
  emitLifecycleEvent(elm, "componentDidRender");
2067
2185
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
2068
2186
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
2069
- if (BUILD12.asyncLoading && BUILD12.cssAnnotations) {
2187
+ if (BUILD13.asyncLoading && BUILD13.cssAnnotations) {
2070
2188
  addHydratedFlag(elm);
2071
2189
  }
2072
- if (BUILD12.cmpDidLoad) {
2073
- if (BUILD12.isDev) {
2190
+ if (BUILD13.cmpDidLoad) {
2191
+ if (BUILD13.isDev) {
2074
2192
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
2075
2193
  }
2076
2194
  safeCall(instance, "componentDidLoad");
2077
- if (BUILD12.isDev) {
2195
+ if (BUILD13.isDev) {
2078
2196
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
2079
2197
  }
2080
2198
  }
2081
2199
  emitLifecycleEvent(elm, "componentDidLoad");
2082
2200
  endPostUpdate();
2083
- if (BUILD12.asyncLoading) {
2201
+ if (BUILD13.asyncLoading) {
2084
2202
  hostRef.$onReadyResolve$(elm);
2085
2203
  if (!ancestorComponent) {
2086
2204
  appDidLoad(tagName);
2087
2205
  }
2088
2206
  }
2089
2207
  } else {
2090
- if (BUILD12.cmpDidUpdate) {
2091
- if (BUILD12.isDev) {
2208
+ if (BUILD13.cmpDidUpdate) {
2209
+ if (BUILD13.isDev) {
2092
2210
  hostRef.$flags$ |= 1024 /* devOnRender */;
2093
2211
  }
2094
2212
  safeCall(instance, "componentDidUpdate");
2095
- if (BUILD12.isDev) {
2213
+ if (BUILD13.isDev) {
2096
2214
  hostRef.$flags$ &= ~1024 /* devOnRender */;
2097
2215
  }
2098
2216
  }
2099
2217
  emitLifecycleEvent(elm, "componentDidUpdate");
2100
2218
  endPostUpdate();
2101
2219
  }
2102
- if (BUILD12.method && BUILD12.lazyLoad) {
2220
+ if (BUILD13.method && BUILD13.lazyLoad) {
2103
2221
  hostRef.$onInstanceResolve$(elm);
2104
2222
  }
2105
- if (BUILD12.asyncLoading) {
2223
+ if (BUILD13.asyncLoading) {
2106
2224
  if (hostRef.$onRenderResolve$) {
2107
2225
  hostRef.$onRenderResolve$();
2108
2226
  hostRef.$onRenderResolve$ = void 0;
@@ -2114,7 +2232,7 @@ var postUpdateComponent = (hostRef) => {
2114
2232
  }
2115
2233
  };
2116
2234
  var forceUpdate = (ref) => {
2117
- if (BUILD12.updatable && (Build.isBrowser || Build.isTesting)) {
2235
+ if (BUILD13.updatable && (Build.isBrowser || Build.isTesting)) {
2118
2236
  const hostRef = getHostRef(ref);
2119
2237
  const isConnected = hostRef.$hostElement$.isConnected;
2120
2238
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -2125,14 +2243,14 @@ var forceUpdate = (ref) => {
2125
2243
  return false;
2126
2244
  };
2127
2245
  var appDidLoad = (who) => {
2128
- if (BUILD12.cssAnnotations) {
2246
+ if (BUILD13.cssAnnotations) {
2129
2247
  addHydratedFlag(doc.documentElement);
2130
2248
  }
2131
- if (BUILD12.asyncQueue) {
2249
+ if (BUILD13.asyncQueue) {
2132
2250
  plt.$flags$ |= 2 /* appLoaded */;
2133
2251
  }
2134
2252
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
2135
- if (BUILD12.profile && performance.measure) {
2253
+ if (BUILD13.profile && performance.measure) {
2136
2254
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
2137
2255
  }
2138
2256
  };
@@ -2147,7 +2265,7 @@ var safeCall = (instance, method, arg) => {
2147
2265
  return void 0;
2148
2266
  };
2149
2267
  var emitLifecycleEvent = (elm, lifecycleName) => {
2150
- if (BUILD12.lifecycleDOMEvents) {
2268
+ if (BUILD13.lifecycleDOMEvents) {
2151
2269
  emitEvent(elm, "stencil_" + lifecycleName, {
2152
2270
  bubbles: true,
2153
2271
  composed: true,
@@ -2159,7 +2277,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
2159
2277
  };
2160
2278
  var addHydratedFlag = (elm) => {
2161
2279
  var _a, _b;
2162
- return BUILD12.hydratedClass ? elm.classList.add((_a = BUILD12.hydratedSelectorName) != null ? _a : "hydrated") : BUILD12.hydratedAttribute ? elm.setAttribute((_b = BUILD12.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2280
+ return BUILD13.hydratedClass ? elm.classList.add((_a = BUILD13.hydratedSelectorName) != null ? _a : "hydrated") : BUILD13.hydratedAttribute ? elm.setAttribute((_b = BUILD13.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2163
2281
  };
2164
2282
  var serverSideConnected = (elm) => {
2165
2283
  const children = elm.children;
@@ -2178,21 +2296,21 @@ var serverSideConnected = (elm) => {
2178
2296
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2179
2297
  var setValue = (ref, propName, newVal, cmpMeta) => {
2180
2298
  const hostRef = getHostRef(ref);
2181
- if (BUILD13.lazyLoad && !hostRef) {
2299
+ if (BUILD14.lazyLoad && !hostRef) {
2182
2300
  throw new Error(
2183
2301
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`
2184
2302
  );
2185
2303
  }
2186
- const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : ref;
2304
+ const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : ref;
2187
2305
  const oldVal = hostRef.$instanceValues$.get(propName);
2188
2306
  const flags = hostRef.$flags$;
2189
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
2307
+ const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
2190
2308
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2191
2309
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2192
2310
  const didValueChange = newVal !== oldVal && !areBothNaN;
2193
- if ((!BUILD13.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2311
+ if ((!BUILD14.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2194
2312
  hostRef.$instanceValues$.set(propName, newVal);
2195
- if (BUILD13.isDev) {
2313
+ if (BUILD14.isDev) {
2196
2314
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
2197
2315
  consoleDevWarn(
2198
2316
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -2215,8 +2333,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2215
2333
  );
2216
2334
  }
2217
2335
  }
2218
- if (!BUILD13.lazyLoad || instance) {
2219
- if (BUILD13.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2336
+ if (!BUILD14.lazyLoad || instance) {
2337
+ if (BUILD14.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2220
2338
  const watchMethods = cmpMeta.$watchers$[propName];
2221
2339
  if (watchMethods) {
2222
2340
  watchMethods.map((watchMethodName) => {
@@ -2228,8 +2346,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2228
2346
  });
2229
2347
  }
2230
2348
  }
2231
- if (BUILD13.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2232
- if (BUILD13.cmpShouldUpdate && instance.componentShouldUpdate) {
2349
+ if (BUILD14.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2350
+ if (BUILD14.cmpShouldUpdate && instance.componentShouldUpdate) {
2233
2351
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2234
2352
  return;
2235
2353
  }
@@ -2244,40 +2362,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
2244
2362
  var proxyComponent = (Cstr, cmpMeta, flags) => {
2245
2363
  var _a, _b;
2246
2364
  const prototype = Cstr.prototype;
2247
- if (BUILD14.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2365
+ if (BUILD15.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2248
2366
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
2249
2367
  const originalFormAssociatedCallback = prototype[cbName];
2250
2368
  Object.defineProperty(prototype, cbName, {
2251
2369
  value(...args) {
2252
2370
  const hostRef = getHostRef(this);
2253
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : this;
2371
+ const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : this;
2254
2372
  if (!instance) {
2255
2373
  hostRef.$onReadyPromise$.then((asyncInstance) => {
2256
2374
  const cb = asyncInstance[cbName];
2257
2375
  typeof cb === "function" && cb.call(asyncInstance, ...args);
2258
2376
  });
2259
2377
  } else {
2260
- const cb = BUILD14.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2378
+ const cb = BUILD15.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2261
2379
  typeof cb === "function" && cb.call(instance, ...args);
2262
2380
  }
2263
2381
  }
2264
2382
  });
2265
2383
  });
2266
2384
  }
2267
- if (BUILD14.member && cmpMeta.$members$ || BUILD14.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2268
- if (BUILD14.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2385
+ if (BUILD15.member && cmpMeta.$members$ || BUILD15.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2386
+ if (BUILD15.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2269
2387
  cmpMeta.$watchers$ = Cstr.watchers;
2270
2388
  }
2271
2389
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
2272
2390
  members.map(([memberName, [memberFlags]]) => {
2273
- if ((BUILD14.prop || BUILD14.state) && (memberFlags & 31 /* Prop */ || (!BUILD14.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2391
+ if ((BUILD15.prop || BUILD15.state) && (memberFlags & 31 /* Prop */ || (!BUILD15.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2274
2392
  if ((memberFlags & 2048 /* Getter */) === 0) {
2275
2393
  Object.defineProperty(prototype, memberName, {
2276
2394
  get() {
2277
2395
  return getValue(this, memberName);
2278
2396
  },
2279
2397
  set(newValue) {
2280
- if (BUILD14.isDev) {
2398
+ if (BUILD15.isDev) {
2281
2399
  const ref = getHostRef(this);
2282
2400
  if (
2283
2401
  // we are proxying the instance (not element)
@@ -2298,11 +2416,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2298
2416
  enumerable: true
2299
2417
  });
2300
2418
  } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
2301
- if (BUILD14.lazyLoad) {
2419
+ if (BUILD15.lazyLoad) {
2302
2420
  Object.defineProperty(prototype, memberName, {
2303
2421
  get() {
2304
2422
  const ref = getHostRef(this);
2305
- const instance = BUILD14.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2423
+ const instance = BUILD15.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2306
2424
  if (!instance) return;
2307
2425
  return instance[memberName];
2308
2426
  },
@@ -2342,7 +2460,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2342
2460
  });
2343
2461
  }
2344
2462
  }
2345
- } else if (BUILD14.lazyLoad && BUILD14.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2463
+ } else if (BUILD15.lazyLoad && BUILD15.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2346
2464
  Object.defineProperty(prototype, memberName, {
2347
2465
  value(...args) {
2348
2466
  var _a2;
@@ -2355,13 +2473,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2355
2473
  });
2356
2474
  }
2357
2475
  });
2358
- if (BUILD14.observeAttribute && (!BUILD14.lazyLoad || flags & 1 /* isElementConstructor */)) {
2476
+ if (BUILD15.observeAttribute && (!BUILD15.lazyLoad || flags & 1 /* isElementConstructor */)) {
2359
2477
  const attrNameToPropName = /* @__PURE__ */ new Map();
2360
2478
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
2361
2479
  plt.jmp(() => {
2362
2480
  var _a2;
2363
2481
  const propName = attrNameToPropName.get(attrName);
2364
- if (this.hasOwnProperty(propName)) {
2482
+ if (this.hasOwnProperty(propName) && BUILD15.lazyLoad) {
2365
2483
  newValue = this[propName];
2366
2484
  delete this[propName];
2367
2485
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -2371,8 +2489,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2371
2489
  const hostRef = getHostRef(this);
2372
2490
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
2373
2491
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
2374
- const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
2375
- const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
2492
+ const elm = BUILD15.lazyLoad ? hostRef.$hostElement$ : this;
2493
+ const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : elm;
2376
2494
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
2377
2495
  entry == null ? void 0 : entry.forEach((callbackName) => {
2378
2496
  if (instance[callbackName] != null) {
@@ -2395,7 +2513,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
2395
2513
  var _a2;
2396
2514
  const attrName = m[1] || propName;
2397
2515
  attrNameToPropName.set(attrName, propName);
2398
- if (BUILD14.reflect && m[0] & 512 /* ReflectAttr */) {
2516
+ if (BUILD15.reflect && m[0] & 512 /* ReflectAttr */) {
2399
2517
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
2400
2518
  }
2401
2519
  return attrName;
@@ -2413,7 +2531,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2413
2531
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
2414
2532
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
2415
2533
  const bundleId = cmpMeta.$lazyBundleId$;
2416
- if ((BUILD15.lazyLoad || BUILD15.hydrateClientSide) && bundleId) {
2534
+ if ((BUILD16.lazyLoad || BUILD16.hydrateClientSide) && bundleId) {
2417
2535
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
2418
2536
  if (CstrImport && "then" in CstrImport) {
2419
2537
  const endLoad = uniqueTime(
@@ -2428,15 +2546,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2428
2546
  if (!Cstr) {
2429
2547
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2430
2548
  }
2431
- if (BUILD15.member && !Cstr.isProxied) {
2432
- if (BUILD15.watchCallback) {
2549
+ if (BUILD16.member && !Cstr.isProxied) {
2550
+ if (BUILD16.watchCallback) {
2433
2551
  cmpMeta.$watchers$ = Cstr.watchers;
2434
2552
  }
2435
2553
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
2436
2554
  Cstr.isProxied = true;
2437
2555
  }
2438
2556
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
2439
- if (BUILD15.member) {
2557
+ if (BUILD16.member) {
2440
2558
  hostRef.$flags$ |= 8 /* isConstructingInstance */;
2441
2559
  }
2442
2560
  try {
@@ -2444,10 +2562,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2444
2562
  } catch (e) {
2445
2563
  consoleError(e);
2446
2564
  }
2447
- if (BUILD15.member) {
2565
+ if (BUILD16.member) {
2448
2566
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
2449
2567
  }
2450
- if (BUILD15.watchCallback) {
2568
+ if (BUILD16.watchCallback) {
2451
2569
  hostRef.$flags$ |= 128 /* isWatchReady */;
2452
2570
  }
2453
2571
  endNewInstance();
@@ -2457,24 +2575,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2457
2575
  const cmpTag = elm.localName;
2458
2576
  customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2459
2577
  }
2460
- if (BUILD15.style && Cstr && Cstr.style) {
2578
+ if (BUILD16.style && Cstr && Cstr.style) {
2461
2579
  let style;
2462
2580
  if (typeof Cstr.style === "string") {
2463
2581
  style = Cstr.style;
2464
- } else if (BUILD15.mode && typeof Cstr.style !== "string") {
2582
+ } else if (BUILD16.mode && typeof Cstr.style !== "string") {
2465
2583
  hostRef.$modeName$ = computeMode(elm);
2466
2584
  if (hostRef.$modeName$) {
2467
2585
  style = Cstr.style[hostRef.$modeName$];
2468
2586
  }
2469
- if (BUILD15.hydrateServerSide && hostRef.$modeName$) {
2587
+ if (BUILD16.hydrateServerSide && hostRef.$modeName$) {
2470
2588
  elm.setAttribute("s-mode", hostRef.$modeName$);
2471
2589
  }
2472
2590
  }
2473
2591
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
2474
2592
  if (!styles.has(scopeId2)) {
2475
2593
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2476
- if (!BUILD15.hydrateServerSide && BUILD15.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2477
- BUILD15.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2594
+ if (!BUILD16.hydrateServerSide && BUILD16.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2595
+ BUILD16.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2478
2596
  style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
2479
2597
  }
2480
2598
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
@@ -2484,14 +2602,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2484
2602
  }
2485
2603
  const ancestorComponent = hostRef.$ancestorComponent$;
2486
2604
  const schedule = () => scheduleUpdate(hostRef, true);
2487
- if (BUILD15.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2605
+ if (BUILD16.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2488
2606
  ancestorComponent["s-rc"].push(schedule);
2489
2607
  } else {
2490
2608
  schedule();
2491
2609
  }
2492
2610
  };
2493
2611
  var fireConnectedCallback = (instance) => {
2494
- if (BUILD15.lazyLoad && BUILD15.connectedCallback) {
2612
+ if (BUILD16.lazyLoad && BUILD16.connectedCallback) {
2495
2613
  safeCall(instance, "connectedCallback");
2496
2614
  }
2497
2615
  };
@@ -2502,41 +2620,41 @@ var connectedCallback = (elm) => {
2502
2620
  const hostRef = getHostRef(elm);
2503
2621
  const cmpMeta = hostRef.$cmpMeta$;
2504
2622
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2505
- if (BUILD16.hostListenerTargetParent) {
2623
+ if (BUILD17.hostListenerTargetParent) {
2506
2624
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2507
2625
  }
2508
2626
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2509
2627
  hostRef.$flags$ |= 1 /* hasConnected */;
2510
2628
  let hostId;
2511
- if (BUILD16.hydrateClientSide) {
2629
+ if (BUILD17.hydrateClientSide) {
2512
2630
  hostId = elm.getAttribute(HYDRATE_ID);
2513
2631
  if (hostId) {
2514
- if (BUILD16.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2515
- const scopeId2 = BUILD16.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2632
+ if (BUILD17.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2633
+ const scopeId2 = BUILD17.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2516
2634
  elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2517
- } else if (BUILD16.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2518
- const scopeId2 = getScopeId(cmpMeta, BUILD16.mode ? elm.getAttribute("s-mode") : void 0);
2635
+ } else if (BUILD17.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2636
+ const scopeId2 = getScopeId(cmpMeta, BUILD17.mode ? elm.getAttribute("s-mode") : void 0);
2519
2637
  elm["s-sc"] = scopeId2;
2520
2638
  }
2521
2639
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2522
2640
  }
2523
2641
  }
2524
- if (BUILD16.slotRelocation && !hostId) {
2525
- if (BUILD16.hydrateServerSide || (BUILD16.slot || BUILD16.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2642
+ if (BUILD17.slotRelocation && !hostId) {
2643
+ if (BUILD17.hydrateServerSide || (BUILD17.slot || BUILD17.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2526
2644
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2527
2645
  setContentReference(elm);
2528
2646
  }
2529
2647
  }
2530
- if (BUILD16.asyncLoading) {
2648
+ if (BUILD17.asyncLoading) {
2531
2649
  let ancestorComponent = elm;
2532
2650
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2533
- if (BUILD16.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2651
+ if (BUILD17.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2534
2652
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2535
2653
  break;
2536
2654
  }
2537
2655
  }
2538
2656
  }
2539
- if (BUILD16.prop && !BUILD16.hydrateServerSide && cmpMeta.$members$) {
2657
+ if (BUILD17.prop && !BUILD17.hydrateServerSide && cmpMeta.$members$) {
2540
2658
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2541
2659
  if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2542
2660
  const value = elm[memberName];
@@ -2545,7 +2663,7 @@ var connectedCallback = (elm) => {
2545
2663
  }
2546
2664
  });
2547
2665
  }
2548
- if (BUILD16.initializeNextTick) {
2666
+ if (BUILD17.initializeNextTick) {
2549
2667
  nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2550
2668
  } else {
2551
2669
  initializeComponent(elm, hostRef, cmpMeta);
@@ -2563,32 +2681,32 @@ var connectedCallback = (elm) => {
2563
2681
  };
2564
2682
  var setContentReference = (elm) => {
2565
2683
  const contentRefElm = elm["s-cr"] = doc.createComment(
2566
- BUILD16.isDebug ? `content-ref (host=${elm.localName})` : ""
2684
+ BUILD17.isDebug ? `content-ref (host=${elm.localName})` : ""
2567
2685
  );
2568
2686
  contentRefElm["s-cn"] = true;
2569
2687
  insertBefore(elm, contentRefElm, elm.firstChild);
2570
2688
  };
2571
2689
 
2572
2690
  // src/runtime/disconnected-callback.ts
2573
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2691
+ import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
2574
2692
  var disconnectInstance = (instance) => {
2575
- if (BUILD17.lazyLoad && BUILD17.disconnectedCallback) {
2693
+ if (BUILD18.lazyLoad && BUILD18.disconnectedCallback) {
2576
2694
  safeCall(instance, "disconnectedCallback");
2577
2695
  }
2578
- if (BUILD17.cmpDidUnload) {
2696
+ if (BUILD18.cmpDidUnload) {
2579
2697
  safeCall(instance, "componentDidUnload");
2580
2698
  }
2581
2699
  };
2582
2700
  var disconnectedCallback = async (elm) => {
2583
2701
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2584
2702
  const hostRef = getHostRef(elm);
2585
- if (BUILD17.hostListener) {
2703
+ if (BUILD18.hostListener) {
2586
2704
  if (hostRef.$rmListeners$) {
2587
2705
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2588
2706
  hostRef.$rmListeners$ = void 0;
2589
2707
  }
2590
2708
  }
2591
- if (!BUILD17.lazyLoad) {
2709
+ if (!BUILD18.lazyLoad) {
2592
2710
  disconnectInstance(elm);
2593
2711
  } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2594
2712
  disconnectInstance(hostRef.$lazyInstance$);
@@ -2607,36 +2725,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2607
2725
  $flags$: compactMeta[0],
2608
2726
  $tagName$: compactMeta[1]
2609
2727
  };
2610
- if (BUILD18.member) {
2728
+ if (BUILD19.member) {
2611
2729
  cmpMeta.$members$ = compactMeta[2];
2612
2730
  }
2613
- if (BUILD18.hostListener) {
2731
+ if (BUILD19.hostListener) {
2614
2732
  cmpMeta.$listeners$ = compactMeta[3];
2615
2733
  }
2616
- if (BUILD18.watchCallback) {
2734
+ if (BUILD19.watchCallback) {
2617
2735
  cmpMeta.$watchers$ = Cstr.$watchers$;
2618
2736
  }
2619
- if (BUILD18.reflect) {
2737
+ if (BUILD19.reflect) {
2620
2738
  cmpMeta.$attrsToReflect$ = [];
2621
2739
  }
2622
- if (BUILD18.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2740
+ if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2623
2741
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2624
2742
  }
2625
- if (BUILD18.experimentalSlotFixes) {
2626
- if (BUILD18.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2743
+ if (BUILD19.experimentalSlotFixes) {
2744
+ if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2627
2745
  patchPseudoShadowDom(Cstr.prototype);
2628
2746
  }
2629
2747
  } else {
2630
- if (BUILD18.slotChildNodesFix) {
2748
+ if (BUILD19.slotChildNodesFix) {
2631
2749
  patchChildSlotNodes(Cstr.prototype);
2632
2750
  }
2633
- if (BUILD18.cloneNodeFix) {
2751
+ if (BUILD19.cloneNodeFix) {
2634
2752
  patchCloneNode(Cstr.prototype);
2635
2753
  }
2636
- if (BUILD18.appendChildSlotFix) {
2754
+ if (BUILD19.appendChildSlotFix) {
2637
2755
  patchSlotAppendChild(Cstr.prototype);
2638
2756
  }
2639
- if (BUILD18.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2757
+ if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2640
2758
  patchTextContent(Cstr.prototype);
2641
2759
  }
2642
2760
  }
@@ -2654,20 +2772,20 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2654
2772
  this.__hasHostListenerAttached = true;
2655
2773
  }
2656
2774
  connectedCallback(this);
2657
- if (BUILD18.connectedCallback && originalConnectedCallback) {
2775
+ if (BUILD19.connectedCallback && originalConnectedCallback) {
2658
2776
  originalConnectedCallback.call(this);
2659
2777
  }
2660
2778
  },
2661
2779
  disconnectedCallback() {
2662
2780
  disconnectedCallback(this);
2663
- if (BUILD18.disconnectedCallback && originalDisconnectedCallback) {
2781
+ if (BUILD19.disconnectedCallback && originalDisconnectedCallback) {
2664
2782
  originalDisconnectedCallback.call(this);
2665
2783
  }
2666
2784
  },
2667
2785
  __attachShadow() {
2668
2786
  if (supportsShadow) {
2669
2787
  if (!this.shadowRoot) {
2670
- if (BUILD18.shadowDelegatesFocus) {
2788
+ if (BUILD19.shadowDelegatesFocus) {
2671
2789
  this.attachShadow({
2672
2790
  mode: "open",
2673
2791
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -2691,7 +2809,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2691
2809
  return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2692
2810
  };
2693
2811
  var forceModeUpdate = (elm) => {
2694
- if (BUILD18.style && BUILD18.mode && !BUILD18.lazyLoad) {
2812
+ if (BUILD19.style && BUILD19.mode && !BUILD19.lazyLoad) {
2695
2813
  const mode = computeMode(elm);
2696
2814
  const hostRef = getHostRef(elm);
2697
2815
  if (hostRef.$modeName$ !== mode) {
@@ -2714,7 +2832,7 @@ var forceModeUpdate = (elm) => {
2714
2832
  };
2715
2833
 
2716
2834
  // src/runtime/bootstrap-lazy.ts
2717
- import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
2835
+ import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
2718
2836
 
2719
2837
  // src/runtime/hmr-component.ts
2720
2838
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
@@ -2726,7 +2844,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
2726
2844
  // src/runtime/bootstrap-lazy.ts
2727
2845
  var bootstrapLazy = (lazyBundles, options = {}) => {
2728
2846
  var _a;
2729
- if (BUILD19.profile && performance.mark) {
2847
+ if (BUILD20.profile && performance.mark) {
2730
2848
  performance.mark("st:app:start");
2731
2849
  }
2732
2850
  installDevTools();
@@ -2742,12 +2860,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2742
2860
  let isBootstrapping = true;
2743
2861
  Object.assign(plt, options);
2744
2862
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
2745
- if (BUILD19.asyncQueue) {
2863
+ if (BUILD20.asyncQueue) {
2746
2864
  if (options.syncQueue) {
2747
2865
  plt.$flags$ |= 4 /* queueSync */;
2748
2866
  }
2749
2867
  }
2750
- if (BUILD19.hydrateClientSide) {
2868
+ if (BUILD20.hydrateClientSide) {
2751
2869
  plt.$flags$ |= 2 /* appLoaded */;
2752
2870
  }
2753
2871
  let hasSlotRelocation = false;
@@ -2763,22 +2881,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2763
2881
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2764
2882
  hasSlotRelocation = true;
2765
2883
  }
2766
- if (BUILD19.member) {
2884
+ if (BUILD20.member) {
2767
2885
  cmpMeta.$members$ = compactMeta[2];
2768
2886
  }
2769
- if (BUILD19.hostListener) {
2887
+ if (BUILD20.hostListener) {
2770
2888
  cmpMeta.$listeners$ = compactMeta[3];
2771
2889
  }
2772
- if (BUILD19.reflect) {
2890
+ if (BUILD20.reflect) {
2773
2891
  cmpMeta.$attrsToReflect$ = [];
2774
2892
  }
2775
- if (BUILD19.watchCallback) {
2893
+ if (BUILD20.watchCallback) {
2776
2894
  cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
2777
2895
  }
2778
- if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2896
+ if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2779
2897
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2780
2898
  }
2781
- const tagName = BUILD19.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2899
+ const tagName = BUILD20.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2782
2900
  const HostElement = class extends HTMLElement {
2783
2901
  // StencilLazyHost
2784
2902
  constructor(self) {
@@ -2786,10 +2904,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2786
2904
  this.hasRegisteredEventListeners = false;
2787
2905
  self = this;
2788
2906
  registerHost(self, cmpMeta);
2789
- if (BUILD19.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2907
+ if (BUILD20.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2790
2908
  if (supportsShadow) {
2791
2909
  if (!self.shadowRoot) {
2792
- if (BUILD19.shadowDelegatesFocus) {
2910
+ if (BUILD20.shadowDelegatesFocus) {
2793
2911
  self.attachShadow({
2794
2912
  mode: "open",
2795
2913
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -2804,7 +2922,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2804
2922
  );
2805
2923
  }
2806
2924
  }
2807
- } else if (!BUILD19.hydrateServerSide && !("shadowRoot" in self)) {
2925
+ } else if (!BUILD20.hydrateServerSide && !("shadowRoot" in self)) {
2808
2926
  self.shadowRoot = self;
2809
2927
  }
2810
2928
  }
@@ -2832,28 +2950,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2832
2950
  return getHostRef(this).$onReadyPromise$;
2833
2951
  }
2834
2952
  };
2835
- if (BUILD19.experimentalSlotFixes) {
2836
- if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2953
+ if (BUILD20.experimentalSlotFixes) {
2954
+ if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2837
2955
  patchPseudoShadowDom(HostElement.prototype);
2838
2956
  }
2839
2957
  } else {
2840
- if (BUILD19.slotChildNodesFix) {
2958
+ if (BUILD20.slotChildNodesFix) {
2841
2959
  patchChildSlotNodes(HostElement.prototype);
2842
2960
  }
2843
- if (BUILD19.cloneNodeFix) {
2961
+ if (BUILD20.cloneNodeFix) {
2844
2962
  patchCloneNode(HostElement.prototype);
2845
2963
  }
2846
- if (BUILD19.appendChildSlotFix) {
2964
+ if (BUILD20.appendChildSlotFix) {
2847
2965
  patchSlotAppendChild(HostElement.prototype);
2848
2966
  }
2849
- if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2967
+ if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2850
2968
  patchTextContent(HostElement.prototype);
2851
2969
  }
2852
2970
  }
2853
- if (BUILD19.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2971
+ if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2854
2972
  HostElement.formAssociated = true;
2855
2973
  }
2856
- if (BUILD19.hotModuleReplacement) {
2974
+ if (BUILD20.hotModuleReplacement) {
2857
2975
  HostElement.prototype["s-hmr"] = function(hmrVersionId) {
2858
2976
  hmrStart(this, cmpMeta, hmrVersionId);
2859
2977
  };
@@ -2872,7 +2990,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2872
2990
  if (hasSlotRelocation) {
2873
2991
  dataStyles.textContent += SLOT_FB_CSS;
2874
2992
  }
2875
- if (BUILD19.invisiblePrehydration && (BUILD19.hydratedClass || BUILD19.hydratedAttribute)) {
2993
+ if (BUILD20.invisiblePrehydration && (BUILD20.hydratedClass || BUILD20.hydratedAttribute)) {
2876
2994
  dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
2877
2995
  }
2878
2996
  if (dataStyles.innerHTML.length) {
@@ -2888,7 +3006,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2888
3006
  if (deferredConnectedCallbacks.length) {
2889
3007
  deferredConnectedCallbacks.map((host) => host.connectedCallback());
2890
3008
  } else {
2891
- if (BUILD19.profile) {
3009
+ if (BUILD20.profile) {
2892
3010
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
2893
3011
  } else {
2894
3012
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
@@ -2901,10 +3019,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2901
3019
  var Fragment = (_, children) => children;
2902
3020
 
2903
3021
  // src/runtime/host-listener.ts
2904
- import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
3022
+ import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
2905
3023
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2906
- if (BUILD20.hostListener && listeners) {
2907
- if (BUILD20.hostListenerTargetParent) {
3024
+ if (BUILD21.hostListener && listeners) {
3025
+ if (BUILD21.hostListenerTargetParent) {
2908
3026
  if (attachParentListeners) {
2909
3027
  listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
2910
3028
  } else {
@@ -2912,7 +3030,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2912
3030
  }
2913
3031
  }
2914
3032
  listeners.map(([flags, name, method]) => {
2915
- const target = BUILD20.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
3033
+ const target = BUILD21.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2916
3034
  const handler = hostListenerProxy(hostRef, method);
2917
3035
  const opts = hostListenerOpts(flags);
2918
3036
  plt.ael(target, name, handler, opts);
@@ -2923,7 +3041,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2923
3041
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2924
3042
  var _a;
2925
3043
  try {
2926
- if (BUILD20.lazyLoad) {
3044
+ if (BUILD21.lazyLoad) {
2927
3045
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2928
3046
  (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2929
3047
  } else {
@@ -2937,10 +3055,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2937
3055
  }
2938
3056
  };
2939
3057
  var getHostListenerTarget = (elm, flags) => {
2940
- if (BUILD20.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2941
- if (BUILD20.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2942
- if (BUILD20.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2943
- if (BUILD20.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
3058
+ if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
3059
+ if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
3060
+ if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
3061
+ if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2944
3062
  return elm.parentElement;
2945
3063
  return elm;
2946
3064
  };
@@ -3118,7 +3236,7 @@ var hAsync = (nodeName, vnodeData, ...children) => {
3118
3236
  import { globalScripts } from "@stencil/core/internal/app-globals";
3119
3237
 
3120
3238
  // src/hydrate/platform/proxy-host-element.ts
3121
- import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
3239
+ import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
3122
3240
  function proxyHostElement(elm, cmpMeta) {
3123
3241
  if (typeof elm.componentOnReady !== "function") {
3124
3242
  elm.componentOnReady = componentOnReady;
@@ -3127,7 +3245,7 @@ function proxyHostElement(elm, cmpMeta) {
3127
3245
  elm.forceUpdate = forceUpdate2;
3128
3246
  }
3129
3247
  if (!elm.shadowRoot && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
3130
- if (BUILD21.shadowDelegatesFocus) {
3248
+ if (BUILD22.shadowDelegatesFocus) {
3131
3249
  elm.attachShadow({
3132
3250
  mode: "open",
3133
3251
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -3441,7 +3559,7 @@ function waitingOnElementsMsg(waitingElements) {
3441
3559
  }
3442
3560
 
3443
3561
  // src/hydrate/platform/index.ts
3444
- import { BUILD as BUILD23, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
3562
+ import { BUILD as BUILD24, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
3445
3563
  var customError;
3446
3564
  var cmpModules = /* @__PURE__ */ new Map();
3447
3565
  var getModule = (tagName) => {
@@ -3527,7 +3645,7 @@ var plt = {
3527
3645
  var setPlatformHelpers = (helpers) => {
3528
3646
  Object.assign(plt, helpers);
3529
3647
  };
3530
- var supportsShadow = BUILD22.shadowDom;
3648
+ var supportsShadow = BUILD23.shadowDom;
3531
3649
  var supportsListenerOptions = false;
3532
3650
  var supportsConstructableStylesheets = false;
3533
3651
  var hostRefs = /* @__PURE__ */ new WeakMap();
@@ -3556,7 +3674,7 @@ var Build = {
3556
3674
  var styles = /* @__PURE__ */ new Map();
3557
3675
  var modeResolutionChain = [];
3558
3676
  export {
3559
- BUILD23 as BUILD,
3677
+ BUILD24 as BUILD,
3560
3678
  Build,
3561
3679
  Env,
3562
3680
  Fragment,