@stencil/core 4.22.3-dev.1733806913.ee4aa0b → 4.22.3-dev.1733893307.ec243c2

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.22.3-dev.1733806913.ee4aa0b | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.22.3-dev.1733893307.ec243c2 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -88,102 +88,20 @@ var unwrapErr = (result) => {
88
88
  };
89
89
 
90
90
  // src/runtime/connected-callback.ts
91
- import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
91
+ import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
92
92
 
93
93
  // src/runtime/client-hydrate.ts
94
- import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
94
+ import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
95
95
 
96
- // src/runtime/profile.ts
97
- import { BUILD } from "@stencil/core/internal/app-data";
98
- var i = 0;
99
- var createTime = (fnName, tagName = "") => {
100
- if (BUILD.profile && performance.mark) {
101
- const key = `st:${fnName}:${tagName}:${i++}`;
102
- performance.mark(key);
103
- return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
104
- } else {
105
- return () => {
106
- return;
107
- };
108
- }
109
- };
110
- var uniqueTime = (key, measureText) => {
111
- if (BUILD.profile && performance.mark) {
112
- if (performance.getEntriesByName(key, "mark").length === 0) {
113
- performance.mark(key);
114
- }
115
- return () => {
116
- if (performance.getEntriesByName(measureText, "measure").length === 0) {
117
- performance.measure(measureText, key);
118
- }
119
- };
120
- } else {
121
- return () => {
122
- return;
123
- };
124
- }
125
- };
126
- var inspect = (ref) => {
127
- const hostRef = getHostRef(ref);
128
- if (!hostRef) {
129
- return void 0;
130
- }
131
- const flags = hostRef.$flags$;
132
- const hostElement = hostRef.$hostElement$;
133
- return {
134
- renderCount: hostRef.$renderCount$,
135
- flags: {
136
- hasRendered: !!(flags & 2 /* hasRendered */),
137
- hasConnected: !!(flags & 1 /* hasConnected */),
138
- isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
139
- isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
140
- isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
141
- hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
142
- hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
143
- isWatchReady: !!(flags & 128 /* isWatchReady */),
144
- isListenReady: !!(flags & 256 /* isListenReady */),
145
- needsRerender: !!(flags & 512 /* needsRerender */)
146
- },
147
- instanceValues: hostRef.$instanceValues$,
148
- ancestorComponent: hostRef.$ancestorComponent$,
149
- hostElement,
150
- lazyInstance: hostRef.$lazyInstance$,
151
- vnode: hostRef.$vnode$,
152
- modeName: hostRef.$modeName$,
153
- onReadyPromise: hostRef.$onReadyPromise$,
154
- onReadyResolve: hostRef.$onReadyResolve$,
155
- onInstancePromise: hostRef.$onInstancePromise$,
156
- onInstanceResolve: hostRef.$onInstanceResolve$,
157
- onRenderResolve: hostRef.$onRenderResolve$,
158
- queuedListeners: hostRef.$queuedListeners$,
159
- rmListeners: hostRef.$rmListeners$,
160
- ["s-id"]: hostElement["s-id"],
161
- ["s-cr"]: hostElement["s-cr"],
162
- ["s-lr"]: hostElement["s-lr"],
163
- ["s-p"]: hostElement["s-p"],
164
- ["s-rc"]: hostElement["s-rc"],
165
- ["s-sc"]: hostElement["s-sc"]
166
- };
167
- };
168
- var installDevTools = () => {
169
- if (BUILD.devTools) {
170
- const stencil = win.stencil = win.stencil || {};
171
- const originalInspect = stencil.inspect;
172
- stencil.inspect = (ref) => {
173
- let result = inspect(ref);
174
- if (!result && typeof originalInspect === "function") {
175
- result = originalInspect(ref);
176
- }
177
- return result;
178
- };
179
- }
180
- };
96
+ // src/runtime/dom-extras.ts
97
+ import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
181
98
 
182
99
  // src/runtime/runtime-constants.ts
183
100
  var CONTENT_REF_ID = "r";
184
101
  var ORG_LOCATION_ID = "o";
185
102
  var SLOT_NODE_ID = "s";
186
103
  var TEXT_NODE_ID = "t";
104
+ var COMMENT_NODE_ID = "c";
187
105
  var HYDRATE_ID = "s-id";
188
106
  var HYDRATED_STYLE_ID = "sty-id";
189
107
  var HYDRATE_CHILD_ID = "c-id";
@@ -203,8 +121,11 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
203
121
  "formStateRestoreCallback"
204
122
  ];
205
123
 
124
+ // src/runtime/vdom/vdom-render.ts
125
+ import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
126
+
206
127
  // src/runtime/vdom/h.ts
207
- import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
128
+ import { BUILD } from "@stencil/core/internal/app-data";
208
129
  var h = (nodeName, vnodeData, ...children) => {
209
130
  let child = null;
210
131
  let key = null;
@@ -220,7 +141,7 @@ var h = (nodeName, vnodeData, ...children) => {
220
141
  } else if (child != null && typeof child !== "boolean") {
221
142
  if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
222
143
  child = String(child);
223
- } else if (BUILD2.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
144
+ } else if (BUILD.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
224
145
  consoleDevError(`vNode passed as children has unexpected type.
225
146
  Make sure it's using the correct h() function.
226
147
  Empty objects can also be the cause, look for JSX comments that became objects.`);
@@ -236,28 +157,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
236
157
  };
237
158
  walk(children);
238
159
  if (vnodeData) {
239
- if (BUILD2.isDev && nodeName === "input") {
160
+ if (BUILD.isDev && nodeName === "input") {
240
161
  validateInputProperties(vnodeData);
241
162
  }
242
- if (BUILD2.vdomKey && vnodeData.key) {
163
+ if (BUILD.vdomKey && vnodeData.key) {
243
164
  key = vnodeData.key;
244
165
  }
245
- if (BUILD2.slotRelocation && vnodeData.name) {
166
+ if (BUILD.slotRelocation && vnodeData.name) {
246
167
  slotName = vnodeData.name;
247
168
  }
248
- if (BUILD2.vdomClass) {
169
+ if (BUILD.vdomClass) {
249
170
  const classData = vnodeData.className || vnodeData.class;
250
171
  if (classData) {
251
172
  vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
252
173
  }
253
174
  }
254
175
  }
255
- if (BUILD2.isDev && vNodeChildren.some(isHost)) {
176
+ if (BUILD.isDev && vNodeChildren.some(isHost)) {
256
177
  consoleDevError(`The <Host> must be the single root component. Make sure:
257
178
  - You are NOT using hostData() and <Host> in the same component.
258
179
  - <Host> is used once, and it's the single root component of the render() function.`);
259
180
  }
260
- if (BUILD2.vdomFunctional && typeof nodeName === "function") {
181
+ if (BUILD.vdomFunctional && typeof nodeName === "function") {
261
182
  return nodeName(
262
183
  vnodeData === null ? {} : vnodeData,
263
184
  vNodeChildren,
@@ -269,10 +190,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
269
190
  if (vNodeChildren.length > 0) {
270
191
  vnode.$children$ = vNodeChildren;
271
192
  }
272
- if (BUILD2.vdomKey) {
193
+ if (BUILD.vdomKey) {
273
194
  vnode.$key$ = key;
274
195
  }
275
- if (BUILD2.slotRelocation) {
196
+ if (BUILD.slotRelocation) {
276
197
  vnode.$name$ = slotName;
277
198
  }
278
199
  return vnode;
@@ -285,13 +206,13 @@ var newVNode = (tag, text) => {
285
206
  $elm$: null,
286
207
  $children$: null
287
208
  };
288
- if (BUILD2.vdomAttribute) {
209
+ if (BUILD.vdomAttribute) {
289
210
  vnode.$attrs$ = null;
290
211
  }
291
- if (BUILD2.vdomKey) {
212
+ if (BUILD.vdomKey) {
292
213
  vnode.$key$ = null;
293
214
  }
294
- if (BUILD2.slotRelocation) {
215
+ if (BUILD.slotRelocation) {
295
216
  vnode.$name$ = null;
296
217
  }
297
218
  return vnode;
@@ -343,416 +264,51 @@ var validateInputProperties = (inputElm) => {
343
264
  }
344
265
  };
345
266
 
346
- // src/runtime/client-hydrate.ts
347
- var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
348
- const endHydrate = createTime("hydrateClient", tagName);
349
- const shadowRoot = hostElm.shadowRoot;
350
- const childRenderNodes = [];
351
- const slotNodes = [];
352
- const shadowRootNodes = BUILD3.shadowDom && shadowRoot ? [] : null;
353
- const vnode = hostRef.$vnode$ = newVNode(tagName, null);
354
- if (!plt.$orgLocNodes$) {
355
- initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
356
- }
357
- hostElm[HYDRATE_ID] = hostId;
358
- hostElm.removeAttribute(HYDRATE_ID);
359
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
360
- childRenderNodes.map((c) => {
361
- const orgLocationId = c.$hostId$ + "." + c.$nodeId$;
362
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
363
- const node = c.$elm$;
364
- if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") {
365
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
366
- }
367
- if (!shadowRoot) {
368
- node["s-hn"] = tagName;
369
- if (orgLocationNode) {
370
- node["s-ol"] = orgLocationNode;
371
- node["s-ol"]["s-nr"] = node;
372
- }
373
- }
374
- plt.$orgLocNodes$.delete(orgLocationId);
375
- });
376
- if (BUILD3.shadowDom && shadowRoot) {
377
- shadowRootNodes.map((shadowRootNode) => {
378
- if (shadowRootNode) {
379
- shadowRoot.appendChild(shadowRootNode);
380
- }
381
- });
382
- }
383
- endHydrate();
384
- };
385
- var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
386
- let childNodeType;
387
- let childIdSplt;
388
- let childVNode;
389
- let i2;
390
- if (node.nodeType === 1 /* ElementNode */) {
391
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
392
- if (childNodeType) {
393
- childIdSplt = childNodeType.split(".");
394
- if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
395
- childVNode = {
396
- $flags$: 0,
397
- $hostId$: childIdSplt[0],
398
- $nodeId$: childIdSplt[1],
399
- $depth$: childIdSplt[2],
400
- $index$: childIdSplt[3],
401
- $tag$: node.tagName.toLowerCase(),
402
- $elm$: node,
403
- $attrs$: null,
404
- $children$: null,
405
- $key$: null,
406
- $name$: null,
407
- $text$: null
408
- };
409
- childRenderNodes.push(childVNode);
410
- node.removeAttribute(HYDRATE_CHILD_ID);
411
- if (!parentVNode.$children$) {
412
- parentVNode.$children$ = [];
413
- }
414
- parentVNode.$children$[childVNode.$index$] = childVNode;
415
- parentVNode = childVNode;
416
- if (shadowRootNodes && childVNode.$depth$ === "0") {
417
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
418
- }
419
- }
420
- }
421
- if (node.shadowRoot) {
422
- for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
423
- clientHydrate(
424
- parentVNode,
425
- childRenderNodes,
426
- slotNodes,
427
- shadowRootNodes,
428
- hostElm,
429
- node.shadowRoot.childNodes[i2],
430
- hostId
431
- );
267
+ // src/runtime/vdom/update-element.ts
268
+ import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
269
+
270
+ // src/runtime/vdom/set-accessor.ts
271
+ import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
272
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
273
+ if (oldValue !== newValue) {
274
+ let isProp = isMemberInElement(elm, memberName);
275
+ let ln = memberName.toLowerCase();
276
+ if (BUILD2.vdomClass && memberName === "class") {
277
+ const classList = elm.classList;
278
+ const oldClasses = parseClassList(oldValue);
279
+ const newClasses = parseClassList(newValue);
280
+ if (elm["s-si"] && newClasses.indexOf(elm["s-si"]) < 0) {
281
+ newClasses.push(elm["s-si"]);
432
282
  }
433
- }
434
- for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
435
- clientHydrate(
436
- parentVNode,
437
- childRenderNodes,
438
- slotNodes,
439
- shadowRootNodes,
440
- hostElm,
441
- node.childNodes[i2],
442
- hostId
443
- );
444
- }
445
- } else if (node.nodeType === 8 /* CommentNode */) {
446
- childIdSplt = node.nodeValue.split(".");
447
- if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
448
- childNodeType = childIdSplt[0];
449
- childVNode = {
450
- $flags$: 0,
451
- $hostId$: childIdSplt[1],
452
- $nodeId$: childIdSplt[2],
453
- $depth$: childIdSplt[3],
454
- $index$: childIdSplt[4],
455
- $elm$: node,
456
- $attrs$: null,
457
- $children$: null,
458
- $key$: null,
459
- $name$: null,
460
- $tag$: null,
461
- $text$: null
462
- };
463
- if (childNodeType === TEXT_NODE_ID) {
464
- childVNode.$elm$ = node.nextSibling;
465
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
466
- childVNode.$text$ = childVNode.$elm$.textContent;
467
- childRenderNodes.push(childVNode);
468
- node.remove();
469
- if (!parentVNode.$children$) {
470
- parentVNode.$children$ = [];
471
- }
472
- parentVNode.$children$[childVNode.$index$] = childVNode;
473
- if (shadowRootNodes && childVNode.$depth$ === "0") {
474
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
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) {
287
+ for (const prop in oldValue) {
288
+ if (!newValue || newValue[prop] == null) {
289
+ if (!BUILD2.hydrateServerSide && prop.includes("-")) {
290
+ elm.style.removeProperty(prop);
291
+ } else {
292
+ elm.style[prop] = "";
293
+ }
475
294
  }
476
295
  }
477
- } else if (childVNode.$hostId$ === hostId) {
478
- if (childNodeType === SLOT_NODE_ID) {
479
- childVNode.$tag$ = "slot";
480
- if (childIdSplt[5]) {
481
- node["s-sn"] = childVNode.$name$ = childIdSplt[5];
296
+ }
297
+ for (const prop in newValue) {
298
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
299
+ if (!BUILD2.hydrateServerSide && prop.includes("-")) {
300
+ elm.style.setProperty(prop, newValue[prop]);
482
301
  } else {
483
- node["s-sn"] = "";
484
- }
485
- node["s-sr"] = true;
486
- if (BUILD3.shadowDom && shadowRootNodes) {
487
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
488
- if (childVNode.$name$) {
489
- childVNode.$elm$.setAttribute("name", childVNode.$name$);
490
- }
491
- node.parentNode.insertBefore(childVNode.$elm$, node);
492
- node.remove();
493
- if (childVNode.$depth$ === "0") {
494
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
495
- }
496
- }
497
- slotNodes.push(childVNode);
498
- if (!parentVNode.$children$) {
499
- parentVNode.$children$ = [];
500
- }
501
- parentVNode.$children$[childVNode.$index$] = childVNode;
502
- } else if (childNodeType === CONTENT_REF_ID) {
503
- if (BUILD3.shadowDom && shadowRootNodes) {
504
- node.remove();
505
- } else if (BUILD3.slotRelocation) {
506
- hostElm["s-cr"] = node;
507
- node["s-cn"] = true;
302
+ elm.style[prop] = newValue[prop];
508
303
  }
509
304
  }
510
305
  }
511
- }
512
- } else if (parentVNode && parentVNode.$tag$ === "style") {
513
- const vnode = newVNode(null, node.textContent);
514
- vnode.$elm$ = node;
515
- vnode.$index$ = "0";
516
- parentVNode.$children$ = [vnode];
517
- }
518
- };
519
- var initializeDocumentHydrate = (node, orgLocNodes) => {
520
- if (node.nodeType === 1 /* ElementNode */) {
521
- let i2 = 0;
522
- if (node.shadowRoot) {
523
- for (; i2 < node.shadowRoot.childNodes.length; i2++) {
524
- initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
306
+ } else if (BUILD2.vdomKey && memberName === "key") {
307
+ } else if (BUILD2.vdomRef && memberName === "ref") {
308
+ if (newValue) {
309
+ newValue(elm);
525
310
  }
526
- }
527
- for (i2 = 0; i2 < node.childNodes.length; i2++) {
528
- initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
529
- }
530
- } else if (node.nodeType === 8 /* CommentNode */) {
531
- const childIdSplt = node.nodeValue.split(".");
532
- if (childIdSplt[0] === ORG_LOCATION_ID) {
533
- orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
534
- node.nodeValue = "";
535
- node["s-en"] = childIdSplt[3];
536
- }
537
- }
538
- };
539
-
540
- // src/runtime/initialize-component.ts
541
- import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
542
-
543
- // src/runtime/mode.ts
544
- var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
545
- var setMode = (handler) => modeResolutionChain.push(handler);
546
- var getMode = (ref) => getHostRef(ref).$modeName$;
547
-
548
- // src/runtime/proxy-component.ts
549
- import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
550
-
551
- // src/runtime/set-value.ts
552
- import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
553
-
554
- // src/runtime/parse-property-value.ts
555
- import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
556
- var parsePropertyValue = (propValue, propType) => {
557
- if (propValue != null && !isComplexType(propValue)) {
558
- if (BUILD4.propBoolean && propType & 4 /* Boolean */) {
559
- return propValue === "false" ? false : propValue === "" || !!propValue;
560
- }
561
- if (BUILD4.propNumber && propType & 2 /* Number */) {
562
- return parseFloat(propValue);
563
- }
564
- if (BUILD4.propString && propType & 1 /* String */) {
565
- return String(propValue);
566
- }
567
- return propValue;
568
- }
569
- return propValue;
570
- };
571
-
572
- // src/runtime/update-component.ts
573
- import { BUILD as BUILD11, NAMESPACE } from "@stencil/core/internal/app-data";
574
-
575
- // src/runtime/event-emitter.ts
576
- import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
577
-
578
- // src/runtime/element.ts
579
- import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
580
- var getElement = (ref) => BUILD5.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
581
-
582
- // src/runtime/event-emitter.ts
583
- var createEvent = (ref, name, flags) => {
584
- const elm = getElement(ref);
585
- return {
586
- emit: (detail) => {
587
- if (BUILD6.isDev && !elm.isConnected) {
588
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
589
- }
590
- return emitEvent(elm, name, {
591
- bubbles: !!(flags & 4 /* Bubbles */),
592
- composed: !!(flags & 2 /* Composed */),
593
- cancelable: !!(flags & 1 /* Cancellable */),
594
- detail
595
- });
596
- }
597
- };
598
- };
599
- var emitEvent = (elm, name, opts) => {
600
- const ev = plt.ce(name, opts);
601
- elm.dispatchEvent(ev);
602
- return ev;
603
- };
604
-
605
- // src/runtime/styles.ts
606
- import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
607
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
608
- var registerStyle = (scopeId2, cssText, allowCS) => {
609
- let style = styles.get(scopeId2);
610
- if (supportsConstructableStylesheets && allowCS) {
611
- style = style || new CSSStyleSheet();
612
- if (typeof style === "string") {
613
- style = cssText;
614
- } else {
615
- style.replaceSync(cssText);
616
- }
617
- } else {
618
- style = cssText;
619
- }
620
- styles.set(scopeId2, style);
621
- };
622
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
623
- var _a;
624
- const scopeId2 = getScopeId(cmpMeta, mode);
625
- const style = styles.get(scopeId2);
626
- if (!BUILD7.attachStyles) {
627
- return scopeId2;
628
- }
629
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
630
- if (style) {
631
- if (typeof style === "string") {
632
- styleContainerNode = styleContainerNode.head || styleContainerNode;
633
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
634
- let styleElm;
635
- if (!appliedStyles) {
636
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
637
- }
638
- if (!appliedStyles.has(scopeId2)) {
639
- if (BUILD7.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
640
- styleElm.innerHTML = style;
641
- } else {
642
- styleElm = doc.createElement("style");
643
- styleElm.innerHTML = style;
644
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
645
- if (nonce != null) {
646
- styleElm.setAttribute("nonce", nonce);
647
- }
648
- if ((BUILD7.hydrateServerSide || BUILD7.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
649
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
650
- }
651
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
652
- if (styleContainerNode.nodeName === "HEAD") {
653
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
654
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
655
- styleContainerNode.insertBefore(styleElm, referenceNode2);
656
- } else if ("host" in styleContainerNode) {
657
- if (supportsConstructableStylesheets) {
658
- const stylesheet = new CSSStyleSheet();
659
- stylesheet.replaceSync(style);
660
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
661
- } else {
662
- const existingStyleContainer = styleContainerNode.querySelector("style");
663
- if (existingStyleContainer) {
664
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
665
- } else {
666
- styleContainerNode.prepend(styleElm);
667
- }
668
- }
669
- } else {
670
- styleContainerNode.append(styleElm);
671
- }
672
- }
673
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
674
- styleContainerNode.insertBefore(styleElm, null);
675
- }
676
- }
677
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
678
- styleElm.innerHTML += SLOT_FB_CSS;
679
- }
680
- if (appliedStyles) {
681
- appliedStyles.add(scopeId2);
682
- }
683
- }
684
- } else if (BUILD7.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
685
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
686
- }
687
- }
688
- return scopeId2;
689
- };
690
- var attachStyles = (hostRef) => {
691
- const cmpMeta = hostRef.$cmpMeta$;
692
- const elm = hostRef.$hostElement$;
693
- const flags = cmpMeta.$flags$;
694
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
695
- const scopeId2 = addStyle(
696
- BUILD7.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
697
- cmpMeta,
698
- hostRef.$modeName$
699
- );
700
- if ((BUILD7.shadowDom || BUILD7.scoped) && BUILD7.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
701
- elm["s-sc"] = scopeId2;
702
- elm.classList.add(scopeId2 + "-h");
703
- if (BUILD7.scoped && flags & 2 /* scopedCssEncapsulation */) {
704
- elm.classList.add(scopeId2 + "-s");
705
- }
706
- }
707
- endAttachStyles();
708
- };
709
- var getScopeId = (cmp, mode) => "sc-" + (BUILD7.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
710
-
711
- // src/runtime/vdom/vdom-render.ts
712
- import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
713
-
714
- // src/runtime/vdom/update-element.ts
715
- import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
716
-
717
- // src/runtime/vdom/set-accessor.ts
718
- import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
719
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
720
- if (oldValue !== newValue) {
721
- let isProp = isMemberInElement(elm, memberName);
722
- let ln = memberName.toLowerCase();
723
- if (BUILD8.vdomClass && memberName === "class") {
724
- const classList = elm.classList;
725
- const oldClasses = parseClassList(oldValue);
726
- const newClasses = parseClassList(newValue);
727
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
728
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
729
- } else if (BUILD8.vdomStyle && memberName === "style") {
730
- if (BUILD8.updatable) {
731
- for (const prop in oldValue) {
732
- if (!newValue || newValue[prop] == null) {
733
- if (!BUILD8.hydrateServerSide && prop.includes("-")) {
734
- elm.style.removeProperty(prop);
735
- } else {
736
- elm.style[prop] = "";
737
- }
738
- }
739
- }
740
- }
741
- for (const prop in newValue) {
742
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
743
- if (!BUILD8.hydrateServerSide && prop.includes("-")) {
744
- elm.style.setProperty(prop, newValue[prop]);
745
- } else {
746
- elm.style[prop] = newValue[prop];
747
- }
748
- }
749
- }
750
- } else if (BUILD8.vdomKey && memberName === "key") {
751
- } else if (BUILD8.vdomRef && memberName === "ref") {
752
- if (newValue) {
753
- newValue(elm);
754
- }
755
- } else if (BUILD8.vdomListener && (BUILD8.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
311
+ } else if (BUILD2.vdomListener && (BUILD2.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
756
312
  if (memberName[2] === "-") {
757
313
  memberName = memberName.slice(3);
758
314
  } else if (isMemberInElement(win, ln)) {
@@ -770,7 +326,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
770
326
  plt.ael(elm, memberName, newValue, capture);
771
327
  }
772
328
  }
773
- } else if (BUILD8.vdomPropOrAttr) {
329
+ } else if (BUILD2.vdomPropOrAttr) {
774
330
  const isComplex = isComplexType(newValue);
775
331
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
776
332
  try {
@@ -792,7 +348,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
792
348
  }
793
349
  }
794
350
  let xlink = false;
795
- if (BUILD8.vdomXlink) {
351
+ if (BUILD2.vdomXlink) {
796
352
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
797
353
  memberName = ln;
798
354
  xlink = true;
@@ -800,7 +356,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
800
356
  }
801
357
  if (newValue == null || newValue === false) {
802
358
  if (newValue !== false || elm.getAttribute(memberName) === "") {
803
- if (BUILD8.vdomXlink && xlink) {
359
+ if (BUILD2.vdomXlink && xlink) {
804
360
  elm.removeAttributeNS(XLINK_NS, memberName);
805
361
  } else {
806
362
  elm.removeAttribute(memberName);
@@ -808,7 +364,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
808
364
  }
809
365
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
810
366
  newValue = newValue === true ? "" : newValue;
811
- if (BUILD8.vdomXlink && xlink) {
367
+ if (BUILD2.vdomXlink && xlink) {
812
368
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
813
369
  } else {
814
370
  elm.setAttribute(memberName, newValue);
@@ -827,7 +383,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
827
383
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
828
384
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
829
385
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
830
- if (BUILD9.updatable) {
386
+ if (BUILD3.updatable) {
831
387
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
832
388
  if (!(memberName in newVnodeAttrs)) {
833
389
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -863,7 +419,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
863
419
  let elm;
864
420
  let childNode;
865
421
  let oldVNode;
866
- if (BUILD10.slotRelocation && !useNativeShadowDom) {
422
+ if (BUILD4.slotRelocation && !useNativeShadowDom) {
867
423
  checkSlotRelocate = true;
868
424
  if (newVNode2.$tag$ === "slot") {
869
425
  if (scopeId) {
@@ -881,37 +437,37 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
881
437
  );
882
438
  }
883
439
  }
884
- if (BUILD10.isDev && newVNode2.$elm$) {
440
+ if (BUILD4.isDev && newVNode2.$elm$) {
885
441
  consoleDevError(
886
442
  `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`
887
443
  );
888
444
  }
889
- if (BUILD10.vdomText && newVNode2.$text$ !== null) {
445
+ if (BUILD4.vdomText && newVNode2.$text$ !== null) {
890
446
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
891
- } else if (BUILD10.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
892
- elm = newVNode2.$elm$ = BUILD10.isDebug || BUILD10.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
447
+ } else if (BUILD4.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
448
+ elm = newVNode2.$elm$ = BUILD4.isDebug || BUILD4.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
893
449
  } else {
894
- if (BUILD10.svg && !isSvgMode) {
450
+ if (BUILD4.svg && !isSvgMode) {
895
451
  isSvgMode = newVNode2.$tag$ === "svg";
896
452
  }
897
- elm = newVNode2.$elm$ = BUILD10.svg ? doc.createElementNS(
453
+ elm = newVNode2.$elm$ = BUILD4.svg ? doc.createElementNS(
898
454
  isSvgMode ? SVG_NS : HTML_NS,
899
- !useNativeShadowDom && BUILD10.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
455
+ !useNativeShadowDom && BUILD4.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
900
456
  ) : doc.createElement(
901
- !useNativeShadowDom && BUILD10.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
457
+ !useNativeShadowDom && BUILD4.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
902
458
  );
903
- if (BUILD10.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
459
+ if (BUILD4.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
904
460
  isSvgMode = false;
905
461
  }
906
- if (BUILD10.vdomAttribute) {
462
+ if (BUILD4.vdomAttribute) {
907
463
  updateElement(null, newVNode2, isSvgMode);
908
464
  }
909
465
  const rootNode = elm.getRootNode();
910
466
  const isElementWithinShadowRoot = !rootNode.querySelector("body");
911
- if (!isElementWithinShadowRoot && BUILD10.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
467
+ if (!isElementWithinShadowRoot && BUILD4.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
912
468
  elm.classList.add(elm["s-si"] = scopeId);
913
469
  }
914
- if (BUILD10.scoped) {
470
+ if (BUILD4.scoped) {
915
471
  updateElementScopeIds(elm, parentElm);
916
472
  }
917
473
  if (newVNode2.$children$) {
@@ -922,7 +478,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
922
478
  }
923
479
  }
924
480
  }
925
- if (BUILD10.svg) {
481
+ if (BUILD4.svg) {
926
482
  if (newVNode2.$tag$ === "svg") {
927
483
  isSvgMode = false;
928
484
  } else if (elm.tagName === "foreignObject") {
@@ -931,7 +487,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
931
487
  }
932
488
  }
933
489
  elm["s-hn"] = hostTagName;
934
- if (BUILD10.slotRelocation) {
490
+ if (BUILD4.slotRelocation) {
935
491
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
936
492
  elm["s-sr"] = true;
937
493
  elm["s-cr"] = contentRef;
@@ -939,7 +495,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
939
495
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
940
496
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
941
497
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
942
- if (BUILD10.experimentalSlotFixes) {
498
+ if (BUILD4.experimentalSlotFixes) {
943
499
  relocateToHostRoot(oldParentVNode.$elm$);
944
500
  } else {
945
501
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
@@ -972,7 +528,7 @@ var relocateToHostRoot = (parentElm) => {
972
528
  var putBackInOriginalLocation = (parentElm, recursive) => {
973
529
  plt.$flags$ |= 1 /* isTmpDisconnected */;
974
530
  const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
975
- if (parentElm["s-sr"] && BUILD10.experimentalSlotFixes) {
531
+ if (parentElm["s-sr"] && BUILD4.experimentalSlotFixes) {
976
532
  let node = parentElm;
977
533
  while (node = node.nextSibling) {
978
534
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -996,9 +552,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
996
552
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
997
553
  };
998
554
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
999
- let containerElm = BUILD10.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
555
+ let containerElm = BUILD4.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
1000
556
  let childNode;
1001
- if (BUILD10.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
557
+ if (BUILD4.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1002
558
  containerElm = containerElm.shadowRoot;
1003
559
  }
1004
560
  for (; startIdx <= endIdx; ++startIdx) {
@@ -1006,7 +562,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1006
562
  childNode = createElm(null, parentVNode, startIdx, parentElm);
1007
563
  if (childNode) {
1008
564
  vnodes[startIdx].$elm$ = childNode;
1009
- insertBefore(containerElm, childNode, BUILD10.slotRelocation ? referenceNode(before) : before);
565
+ insertBefore(containerElm, childNode, BUILD4.slotRelocation ? referenceNode(before) : before);
1010
566
  }
1011
567
  }
1012
568
  }
@@ -1018,7 +574,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
1018
574
  const elm = vnode.$elm$;
1019
575
  nullifyVNodeRefs(vnode);
1020
576
  if (elm) {
1021
- if (BUILD10.slotRelocation) {
577
+ if (BUILD4.slotRelocation) {
1022
578
  checkSlotFallbackVisibility = true;
1023
579
  if (elm["s-ol"]) {
1024
580
  elm["s-ol"].remove();
@@ -1062,7 +618,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1062
618
  oldEndVnode = oldCh[--oldEndIdx];
1063
619
  newEndVnode = newCh[--newEndIdx];
1064
620
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1065
- if (BUILD10.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
621
+ if (BUILD4.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1066
622
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1067
623
  }
1068
624
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -1070,7 +626,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1070
626
  oldStartVnode = oldCh[++oldStartIdx];
1071
627
  newEndVnode = newCh[--newEndIdx];
1072
628
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1073
- if (BUILD10.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
629
+ if (BUILD4.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1074
630
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1075
631
  }
1076
632
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -1079,7 +635,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1079
635
  newStartVnode = newCh[++newStartIdx];
1080
636
  } else {
1081
637
  idxInOld = -1;
1082
- if (BUILD10.vdomKey) {
638
+ if (BUILD4.vdomKey) {
1083
639
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1084
640
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1085
641
  idxInOld = i2;
@@ -1087,7 +643,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1087
643
  }
1088
644
  }
1089
645
  }
1090
- if (BUILD10.vdomKey && idxInOld >= 0) {
646
+ if (BUILD4.vdomKey && idxInOld >= 0) {
1091
647
  elmToMove = oldCh[idxInOld];
1092
648
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1093
649
  node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
@@ -1102,7 +658,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1102
658
  newStartVnode = newCh[++newStartIdx];
1103
659
  }
1104
660
  if (node) {
1105
- if (BUILD10.slotRelocation) {
661
+ if (BUILD4.slotRelocation) {
1106
662
  insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
1107
663
  } else {
1108
664
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
@@ -1119,13 +675,13 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1119
675
  newStartIdx,
1120
676
  newEndIdx
1121
677
  );
1122
- } else if (BUILD10.updatable && newStartIdx > newEndIdx) {
678
+ } else if (BUILD4.updatable && newStartIdx > newEndIdx) {
1123
679
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1124
680
  }
1125
681
  };
1126
682
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1127
683
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1128
- if (BUILD10.slotRelocation && leftVNode.$tag$ === "slot") {
684
+ if (BUILD4.slotRelocation && leftVNode.$tag$ === "slot") {
1129
685
  if (
1130
686
  // The component gets hydrated and no VDOM has been initialized.
1131
687
  // Here the comparison can't happen as $name$ property is not set for `leftNode`.
@@ -1137,7 +693,7 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1137
693
  }
1138
694
  return leftVNode.$name$ === rightVNode.$name$;
1139
695
  }
1140
- if (BUILD10.vdomKey && !isInitialRender) {
696
+ if (BUILD4.vdomKey && !isInitialRender) {
1141
697
  return leftVNode.$key$ === rightVNode.$key$;
1142
698
  }
1143
699
  return true;
@@ -1155,13 +711,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1155
711
  const tag = newVNode2.$tag$;
1156
712
  const text = newVNode2.$text$;
1157
713
  let defaultHolder;
1158
- if (!BUILD10.vdomText || text === null) {
1159
- if (BUILD10.svg) {
714
+ if (!BUILD4.vdomText || text === null) {
715
+ if (BUILD4.svg) {
1160
716
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1161
717
  }
1162
- if (BUILD10.vdomAttribute || BUILD10.reflect) {
1163
- if (BUILD10.slot && tag === "slot" && !useNativeShadowDom) {
1164
- if (BUILD10.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
718
+ if (BUILD4.vdomAttribute || BUILD4.reflect) {
719
+ if (BUILD4.slot && tag === "slot" && !useNativeShadowDom) {
720
+ if (BUILD4.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1165
721
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
1166
722
  relocateToHostRoot(newVNode2.$elm$.parentElement);
1167
723
  }
@@ -1169,25 +725,25 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1169
725
  updateElement(oldVNode, newVNode2, isSvgMode);
1170
726
  }
1171
727
  }
1172
- if (BUILD10.updatable && oldChildren !== null && newChildren !== null) {
728
+ if (BUILD4.updatable && oldChildren !== null && newChildren !== null) {
1173
729
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1174
730
  } else if (newChildren !== null) {
1175
- if (BUILD10.updatable && BUILD10.vdomText && oldVNode.$text$ !== null) {
731
+ if (BUILD4.updatable && BUILD4.vdomText && oldVNode.$text$ !== null) {
1176
732
  elm.textContent = "";
1177
733
  }
1178
734
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1179
735
  } else if (
1180
736
  // don't do this on initial render as it can cause non-hydrated content to be removed
1181
- !isInitialRender && BUILD10.updatable && oldChildren !== null
737
+ !isInitialRender && BUILD4.updatable && oldChildren !== null
1182
738
  ) {
1183
739
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1184
740
  }
1185
- if (BUILD10.svg && isSvgMode && tag === "svg") {
741
+ if (BUILD4.svg && isSvgMode && tag === "svg") {
1186
742
  isSvgMode = false;
1187
743
  }
1188
- } else if (BUILD10.vdomText && BUILD10.slotRelocation && (defaultHolder = elm["s-cr"])) {
744
+ } else if (BUILD4.vdomText && BUILD4.slotRelocation && (defaultHolder = elm["s-cr"])) {
1189
745
  defaultHolder.parentNode.textContent = text;
1190
- } else if (BUILD10.vdomText && oldVNode.$text$ !== text) {
746
+ } else if (BUILD4.vdomText && oldVNode.$text$ !== text) {
1191
747
  elm.data = text;
1192
748
  }
1193
749
  };
@@ -1205,7 +761,7 @@ var updateFallbackSlotVisibility = (elm) => {
1205
761
  childNode.hidden = true;
1206
762
  break;
1207
763
  }
1208
- } else {
764
+ } else if (slotName === siblingNode["s-sn"]) {
1209
765
  if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
1210
766
  childNode.hidden = true;
1211
767
  break;
@@ -1230,7 +786,7 @@ var markSlotContentForRelocation = (elm) => {
1230
786
  const slotName = childNode["s-sn"];
1231
787
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1232
788
  node = hostContentNodes[j];
1233
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD10.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
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"])) {
1234
790
  if (isNodeLocatedInSlot(node, slotName)) {
1235
791
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1236
792
  checkSlotFallbackVisibility = true;
@@ -1284,14 +840,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1284
840
  return slotName === "";
1285
841
  };
1286
842
  var nullifyVNodeRefs = (vNode) => {
1287
- if (BUILD10.vdomRef) {
843
+ if (BUILD4.vdomRef) {
1288
844
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1289
845
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1290
846
  }
1291
847
  };
1292
848
  var insertBefore = (parent, newNode, reference) => {
1293
849
  const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1294
- if (BUILD10.scoped) {
850
+ if (BUILD4.scoped) {
1295
851
  updateElementScopeIds(newNode, parent);
1296
852
  }
1297
853
  return inserted;
@@ -1329,7 +885,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1329
885
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1330
886
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1331
887
  hostTagName = hostElm.tagName;
1332
- if (BUILD10.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
888
+ if (BUILD4.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1333
889
  throw new Error(`The <Host> must be the single root component.
1334
890
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1335
891
 
@@ -1343,7 +899,7 @@ render() {
1343
899
  }
1344
900
  `);
1345
901
  }
1346
- if (BUILD10.reflect && cmpMeta.$attrsToReflect$) {
902
+ if (BUILD4.reflect && cmpMeta.$attrsToReflect$) {
1347
903
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1348
904
  cmpMeta.$attrsToReflect$.map(
1349
905
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -1359,24 +915,24 @@ render() {
1359
915
  rootVnode.$tag$ = null;
1360
916
  rootVnode.$flags$ |= 4 /* isHost */;
1361
917
  hostRef.$vnode$ = rootVnode;
1362
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD10.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1363
- if (BUILD10.scoped || BUILD10.shadowDom) {
918
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD4.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
919
+ if (BUILD4.scoped || BUILD4.shadowDom) {
1364
920
  scopeId = hostElm["s-sc"];
1365
921
  }
1366
922
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1367
- if (BUILD10.slotRelocation) {
923
+ if (BUILD4.slotRelocation) {
1368
924
  contentRef = hostElm["s-cr"];
1369
925
  checkSlotFallbackVisibility = false;
1370
926
  }
1371
927
  patch(oldVNode, rootVnode, isInitialLoad);
1372
- if (BUILD10.slotRelocation) {
928
+ if (BUILD4.slotRelocation) {
1373
929
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1374
930
  if (checkSlotRelocate) {
1375
931
  markSlotContentForRelocation(rootVnode.$elm$);
1376
932
  for (const relocateData of relocateNodes) {
1377
933
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1378
934
  if (!nodeToRelocate["s-ol"]) {
1379
- const orgLocationNode = BUILD10.isDebug || BUILD10.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
935
+ const orgLocationNode = BUILD4.isDebug || BUILD4.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1380
936
  orgLocationNode["s-nr"] = nodeToRelocate;
1381
937
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1382
938
  }
@@ -1387,7 +943,7 @@ render() {
1387
943
  if (slotRefNode) {
1388
944
  const parentNodeRef = slotRefNode.parentNode;
1389
945
  let insertBeforeNode = slotRefNode.nextSibling;
1390
- if (!BUILD10.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
946
+ if (!BUILD4.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1391
947
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1392
948
  while (orgLocationNode) {
1393
949
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -1406,7 +962,7 @@ render() {
1406
962
  }
1407
963
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
1408
964
  if (nodeToRelocate !== insertBeforeNode) {
1409
- if (!BUILD10.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
965
+ if (!BUILD4.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1410
966
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1411
967
  }
1412
968
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
@@ -1432,7 +988,7 @@ render() {
1432
988
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
1433
989
  relocateNodes.length = 0;
1434
990
  }
1435
- if (BUILD10.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
991
+ if (BUILD4.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1436
992
  const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
1437
993
  for (const childNode of children) {
1438
994
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
@@ -1443,37 +999,926 @@ render() {
1443
999
  }
1444
1000
  }
1445
1001
  }
1446
- contentRef = void 0;
1002
+ contentRef = void 0;
1003
+ };
1004
+ var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1005
+ `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1006
+ );
1007
+ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1008
+ `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1009
+ );
1010
+
1011
+ // src/runtime/dom-extras.ts
1012
+ var patchPseudoShadowDom = (hostElementPrototype) => {
1013
+ patchCloneNode(hostElementPrototype);
1014
+ patchSlotAppendChild(hostElementPrototype);
1015
+ patchSlotAppend(hostElementPrototype);
1016
+ patchSlotPrepend(hostElementPrototype);
1017
+ patchSlotInsertAdjacentElement(hostElementPrototype);
1018
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
1019
+ patchSlotInsertAdjacentText(hostElementPrototype);
1020
+ patchTextContent(hostElementPrototype);
1021
+ patchChildSlotNodes(hostElementPrototype);
1022
+ patchSlotRemoveChild(hostElementPrototype);
1023
+ };
1024
+ var patchCloneNode = (HostElementPrototype) => {
1025
+ const orgCloneNode = HostElementPrototype.cloneNode;
1026
+ HostElementPrototype.cloneNode = function(deep) {
1027
+ const srcNode = this;
1028
+ const isShadowDom = BUILD5.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1029
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
1030
+ if (BUILD5.slot && !isShadowDom && deep) {
1031
+ let i2 = 0;
1032
+ let slotted, nonStencilNode;
1033
+ const stencilPrivates = [
1034
+ "s-id",
1035
+ "s-cr",
1036
+ "s-lr",
1037
+ "s-rc",
1038
+ "s-sc",
1039
+ "s-p",
1040
+ "s-cn",
1041
+ "s-sr",
1042
+ "s-sn",
1043
+ "s-hn",
1044
+ "s-ol",
1045
+ "s-nr",
1046
+ "s-si",
1047
+ "s-rf",
1048
+ "s-scs"
1049
+ ];
1050
+ const childNodes = this.__childNodes || this.childNodes;
1051
+ for (; i2 < childNodes.length; i2++) {
1052
+ slotted = childNodes[i2]["s-nr"];
1053
+ nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
1054
+ if (slotted) {
1055
+ if (BUILD5.appendChildSlotFix && clonedNode.__appendChild) {
1056
+ clonedNode.__appendChild(slotted.cloneNode(true));
1057
+ } else {
1058
+ clonedNode.appendChild(slotted.cloneNode(true));
1059
+ }
1060
+ }
1061
+ if (nonStencilNode) {
1062
+ clonedNode.appendChild(childNodes[i2].cloneNode(true));
1063
+ }
1064
+ }
1065
+ }
1066
+ return clonedNode;
1067
+ };
1068
+ };
1069
+ var patchSlotAppendChild = (HostElementPrototype) => {
1070
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
1071
+ HostElementPrototype.appendChild = function(newChild) {
1072
+ const slotName = newChild["s-sn"] = getSlotName(newChild);
1073
+ const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
1074
+ if (slotNode) {
1075
+ addSlotRelocateNode(newChild, slotNode);
1076
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
1077
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
1078
+ const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
1079
+ updateFallbackSlotVisibility(this);
1080
+ return insertedNode;
1081
+ }
1082
+ return this.__appendChild(newChild);
1083
+ };
1084
+ };
1085
+ var patchSlotRemoveChild = (ElementPrototype) => {
1086
+ ElementPrototype.__removeChild = ElementPrototype.removeChild;
1087
+ ElementPrototype.removeChild = function(toRemove) {
1088
+ if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
1089
+ const childNodes = this.__childNodes || this.childNodes;
1090
+ const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
1091
+ if (slotNode && toRemove.isConnected) {
1092
+ toRemove.remove();
1093
+ updateFallbackSlotVisibility(this);
1094
+ return;
1095
+ }
1096
+ }
1097
+ return this.__removeChild(toRemove);
1098
+ };
1099
+ };
1100
+ var patchSlotPrepend = (HostElementPrototype) => {
1101
+ HostElementPrototype.__prepend = HostElementPrototype.prepend;
1102
+ HostElementPrototype.prepend = function(...newChildren) {
1103
+ newChildren.forEach((newChild) => {
1104
+ if (typeof newChild === "string") {
1105
+ newChild = this.ownerDocument.createTextNode(newChild);
1106
+ }
1107
+ const slotName = newChild["s-sn"] = getSlotName(newChild);
1108
+ const childNodes = this.__childNodes || this.childNodes;
1109
+ const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
1110
+ if (slotNode) {
1111
+ addSlotRelocateNode(newChild, slotNode, true);
1112
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
1113
+ const appendAfter = slotChildNodes[0];
1114
+ return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
1115
+ }
1116
+ if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
1117
+ newChild.hidden = true;
1118
+ }
1119
+ return HostElementPrototype.__prepend(newChild);
1120
+ });
1121
+ };
1122
+ };
1123
+ var patchSlotAppend = (HostElementPrototype) => {
1124
+ HostElementPrototype.__append = HostElementPrototype.append;
1125
+ HostElementPrototype.append = function(...newChildren) {
1126
+ newChildren.forEach((newChild) => {
1127
+ if (typeof newChild === "string") {
1128
+ newChild = this.ownerDocument.createTextNode(newChild);
1129
+ }
1130
+ this.appendChild(newChild);
1131
+ });
1132
+ };
1133
+ };
1134
+ var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
1135
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
1136
+ HostElementPrototype.insertAdjacentHTML = function(position, text) {
1137
+ if (position !== "afterbegin" && position !== "beforeend") {
1138
+ return originalInsertAdjacentHtml.call(this, position, text);
1139
+ }
1140
+ const container = this.ownerDocument.createElement("_");
1141
+ let node;
1142
+ container.innerHTML = text;
1143
+ if (position === "afterbegin") {
1144
+ while (node = container.firstChild) {
1145
+ this.prepend(node);
1146
+ }
1147
+ } else if (position === "beforeend") {
1148
+ while (node = container.firstChild) {
1149
+ this.append(node);
1150
+ }
1151
+ }
1152
+ };
1153
+ };
1154
+ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
1155
+ HostElementPrototype.insertAdjacentText = function(position, text) {
1156
+ this.insertAdjacentHTML(position, text);
1157
+ };
1158
+ };
1159
+ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
1160
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
1161
+ HostElementPrototype.insertAdjacentElement = function(position, element) {
1162
+ if (position !== "afterbegin" && position !== "beforeend") {
1163
+ return originalInsertAdjacentElement.call(this, position, element);
1164
+ }
1165
+ if (position === "afterbegin") {
1166
+ this.prepend(element);
1167
+ return element;
1168
+ } else if (position === "beforeend") {
1169
+ this.append(element);
1170
+ return element;
1171
+ }
1172
+ return element;
1173
+ };
1174
+ };
1175
+ 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);
1181
+ Object.defineProperty(hostElementPrototype, "textContent", {
1182
+ get: function() {
1183
+ let text = "";
1184
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
1185
+ childNodes.forEach((node) => text += node.textContent || "");
1186
+ return text;
1187
+ },
1188
+ set: function(value) {
1189
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
1190
+ childNodes.forEach((node) => {
1191
+ if (node["s-ol"]) node["s-ol"].remove();
1192
+ node.remove();
1193
+ });
1194
+ this.insertAdjacentHTML("beforeend", value);
1195
+ }
1196
+ });
1197
+ };
1198
+ var patchChildSlotNodes = (elm) => {
1199
+ class FakeNodeList extends Array {
1200
+ item(n) {
1201
+ return this[n];
1202
+ }
1203
+ }
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);
1214
+ Object.defineProperty(elm, "children", {
1215
+ get() {
1216
+ return this.childNodes.filter((n) => n.nodeType === 1);
1217
+ }
1218
+ });
1219
+ Object.defineProperty(elm, "childElementCount", {
1220
+ get() {
1221
+ return this.children.length;
1222
+ }
1223
+ });
1224
+ if (!childNodesFn) return;
1225
+ Object.defineProperty(elm, "childNodes", {
1226
+ get() {
1227
+ var _a, _b;
1228
+ if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
1229
+ const result = new FakeNodeList();
1230
+ const nodes = getSlottedChildNodes(this.__childNodes);
1231
+ result.push(...nodes);
1232
+ return result;
1233
+ }
1234
+ return FakeNodeList.from(this.__childNodes);
1235
+ }
1236
+ });
1237
+ };
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;
1245
+ }
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));
1263
+ }
1264
+ } else {
1265
+ appendMethod.call(parent, slottedNodeLocation);
1266
+ }
1267
+ newChild["s-ol"] = slottedNodeLocation;
1268
+ newChild["s-sh"] = slotNode["s-hn"];
1269
+ };
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);
1276
+ }
1277
+ }
1278
+ return result;
1279
+ };
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;
1288
+ }
1289
+ childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
1290
+ if (childNode) {
1291
+ return childNode;
1292
+ }
1293
+ }
1294
+ return null;
1295
+ };
1296
+ var getHostSlotChildNodes = (n, slotName) => {
1297
+ const childNodes = [n];
1298
+ while ((n = n.nextSibling) && n["s-sn"] === slotName) {
1299
+ childNodes.push(n);
1300
+ }
1301
+ return childNodes;
1302
+ };
1303
+
1304
+ // src/runtime/profile.ts
1305
+ import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
1306
+ var i = 0;
1307
+ var createTime = (fnName, tagName = "") => {
1308
+ if (BUILD6.profile && performance.mark) {
1309
+ const key = `st:${fnName}:${tagName}:${i++}`;
1310
+ performance.mark(key);
1311
+ return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
1312
+ } else {
1313
+ return () => {
1314
+ return;
1315
+ };
1316
+ }
1317
+ };
1318
+ var uniqueTime = (key, measureText) => {
1319
+ if (BUILD6.profile && performance.mark) {
1320
+ if (performance.getEntriesByName(key, "mark").length === 0) {
1321
+ performance.mark(key);
1322
+ }
1323
+ return () => {
1324
+ if (performance.getEntriesByName(measureText, "measure").length === 0) {
1325
+ performance.measure(measureText, key);
1326
+ }
1327
+ };
1328
+ } else {
1329
+ return () => {
1330
+ return;
1331
+ };
1332
+ }
1333
+ };
1334
+ var inspect = (ref) => {
1335
+ const hostRef = getHostRef(ref);
1336
+ if (!hostRef) {
1337
+ return void 0;
1338
+ }
1339
+ const flags = hostRef.$flags$;
1340
+ const hostElement = hostRef.$hostElement$;
1341
+ return {
1342
+ renderCount: hostRef.$renderCount$,
1343
+ flags: {
1344
+ hasRendered: !!(flags & 2 /* hasRendered */),
1345
+ hasConnected: !!(flags & 1 /* hasConnected */),
1346
+ isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
1347
+ isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
1348
+ isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
1349
+ hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
1350
+ hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
1351
+ isWatchReady: !!(flags & 128 /* isWatchReady */),
1352
+ isListenReady: !!(flags & 256 /* isListenReady */),
1353
+ needsRerender: !!(flags & 512 /* needsRerender */)
1354
+ },
1355
+ instanceValues: hostRef.$instanceValues$,
1356
+ ancestorComponent: hostRef.$ancestorComponent$,
1357
+ hostElement,
1358
+ lazyInstance: hostRef.$lazyInstance$,
1359
+ vnode: hostRef.$vnode$,
1360
+ modeName: hostRef.$modeName$,
1361
+ onReadyPromise: hostRef.$onReadyPromise$,
1362
+ onReadyResolve: hostRef.$onReadyResolve$,
1363
+ onInstancePromise: hostRef.$onInstancePromise$,
1364
+ onInstanceResolve: hostRef.$onInstanceResolve$,
1365
+ onRenderResolve: hostRef.$onRenderResolve$,
1366
+ queuedListeners: hostRef.$queuedListeners$,
1367
+ rmListeners: hostRef.$rmListeners$,
1368
+ ["s-id"]: hostElement["s-id"],
1369
+ ["s-cr"]: hostElement["s-cr"],
1370
+ ["s-lr"]: hostElement["s-lr"],
1371
+ ["s-p"]: hostElement["s-p"],
1372
+ ["s-rc"]: hostElement["s-rc"],
1373
+ ["s-sc"]: hostElement["s-sc"]
1374
+ };
1375
+ };
1376
+ var installDevTools = () => {
1377
+ if (BUILD6.devTools) {
1378
+ const stencil = win.stencil = win.stencil || {};
1379
+ const originalInspect = stencil.inspect;
1380
+ stencil.inspect = (ref) => {
1381
+ let result = inspect(ref);
1382
+ if (!result && typeof originalInspect === "function") {
1383
+ result = originalInspect(ref);
1384
+ }
1385
+ return result;
1386
+ };
1387
+ }
1388
+ };
1389
+
1390
+ // src/runtime/client-hydrate.ts
1391
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1392
+ const endHydrate = createTime("hydrateClient", tagName);
1393
+ const shadowRoot = hostElm.shadowRoot;
1394
+ const childRenderNodes = [];
1395
+ const slotNodes = [];
1396
+ const slottedNodes = [];
1397
+ const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
1398
+ const vnode = newVNode(tagName, null);
1399
+ vnode.$elm$ = hostElm;
1400
+ if (!plt.$orgLocNodes$) {
1401
+ initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1402
+ }
1403
+ hostElm[HYDRATE_ID] = hostId;
1404
+ hostElm.removeAttribute(HYDRATE_ID);
1405
+ hostRef.$vnode$ = clientHydrate(
1406
+ vnode,
1407
+ childRenderNodes,
1408
+ slotNodes,
1409
+ shadowRootNodes,
1410
+ hostElm,
1411
+ hostElm,
1412
+ hostId,
1413
+ slottedNodes
1414
+ );
1415
+ let crIndex = 0;
1416
+ const crLength = childRenderNodes.length;
1417
+ let childRenderNode;
1418
+ for (crIndex; crIndex < crLength; crIndex++) {
1419
+ childRenderNode = childRenderNodes[crIndex];
1420
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
1421
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1422
+ const node = childRenderNode.$elm$;
1423
+ if (!shadowRoot) {
1424
+ node["s-hn"] = tagName.toUpperCase();
1425
+ if (childRenderNode.$tag$ === "slot") {
1426
+ node["s-cr"] = hostElm["s-cr"];
1427
+ }
1428
+ }
1429
+ if (orgLocationNode && orgLocationNode.isConnected) {
1430
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
1431
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1432
+ }
1433
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
1434
+ if (!shadowRoot) {
1435
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1436
+ }
1437
+ }
1438
+ plt.$orgLocNodes$.delete(orgLocationId);
1439
+ }
1440
+ const hosts = [];
1441
+ let snIndex = 0;
1442
+ const snLen = slottedNodes.length;
1443
+ let slotGroup;
1444
+ let snGroupIdx;
1445
+ let snGroupLen;
1446
+ let slottedItem;
1447
+ for (snIndex; snIndex < snLen; snIndex++) {
1448
+ slotGroup = slottedNodes[snIndex];
1449
+ if (!slotGroup || !slotGroup.length) continue;
1450
+ snGroupLen = slotGroup.length;
1451
+ snGroupIdx = 0;
1452
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
1453
+ slottedItem = slotGroup[snGroupIdx];
1454
+ if (!hosts[slottedItem.hostId]) {
1455
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
1456
+ }
1457
+ if (!hosts[slottedItem.hostId]) continue;
1458
+ const hostEle = hosts[slottedItem.hostId];
1459
+ if (!hostEle.shadowRoot || !shadowRoot) {
1460
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1461
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1462
+ slottedItem.slot["s-cr"] = hostEle;
1463
+ } else {
1464
+ const hostChildren = hostEle.__childNodes || hostEle.childNodes;
1465
+ slottedItem.slot["s-cr"] = hostChildren[0];
1466
+ }
1467
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1468
+ }
1469
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1470
+ hostEle.appendChild(slottedItem.node);
1471
+ }
1472
+ }
1473
+ }
1474
+ if (BUILD7.shadowDom && shadowRoot) {
1475
+ let rnIdex = 0;
1476
+ const rnLen = shadowRootNodes.length;
1477
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
1478
+ shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1479
+ }
1480
+ Array.from(hostElm.childNodes).forEach((node) => {
1481
+ if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
1482
+ node.parentNode.removeChild(node);
1483
+ }
1484
+ });
1485
+ }
1486
+ hostRef.$hostElement$ = hostElm;
1487
+ endHydrate();
1488
+ };
1489
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
1490
+ let childNodeType;
1491
+ let childIdSplt;
1492
+ let childVNode;
1493
+ let i2;
1494
+ const scopeId2 = hostElm["s-sc"];
1495
+ if (node.nodeType === 1 /* ElementNode */) {
1496
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1497
+ if (childNodeType) {
1498
+ childIdSplt = childNodeType.split(".");
1499
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
1500
+ childVNode = createSimpleVNode({
1501
+ $flags$: 0,
1502
+ $hostId$: childIdSplt[0],
1503
+ $nodeId$: childIdSplt[1],
1504
+ $depth$: childIdSplt[2],
1505
+ $index$: childIdSplt[3],
1506
+ $tag$: node.tagName.toLowerCase(),
1507
+ $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 }
1511
+ });
1512
+ childRenderNodes.push(childVNode);
1513
+ node.removeAttribute(HYDRATE_CHILD_ID);
1514
+ if (!parentVNode.$children$) {
1515
+ parentVNode.$children$ = [];
1516
+ }
1517
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
1518
+ if (typeof slotName === "string") {
1519
+ if (childVNode.$tag$ === "slot-fb") {
1520
+ addSlot(
1521
+ slotName,
1522
+ childIdSplt[2],
1523
+ childVNode,
1524
+ node,
1525
+ parentVNode,
1526
+ childRenderNodes,
1527
+ slotNodes,
1528
+ shadowRootNodes,
1529
+ slottedNodes
1530
+ );
1531
+ }
1532
+ childVNode.$elm$["s-sn"] = slotName;
1533
+ childVNode.$elm$.removeAttribute("s-sn");
1534
+ }
1535
+ if (childVNode.$index$ !== void 0) {
1536
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1537
+ }
1538
+ if (scopeId2) node["s-si"] = scopeId2;
1539
+ parentVNode = childVNode;
1540
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1541
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1542
+ }
1543
+ }
1544
+ }
1545
+ if (node.shadowRoot) {
1546
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
1547
+ clientHydrate(
1548
+ parentVNode,
1549
+ childRenderNodes,
1550
+ slotNodes,
1551
+ shadowRootNodes,
1552
+ hostElm,
1553
+ node.shadowRoot.childNodes[i2],
1554
+ hostId,
1555
+ slottedNodes
1556
+ );
1557
+ }
1558
+ }
1559
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1560
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
1561
+ clientHydrate(
1562
+ parentVNode,
1563
+ childRenderNodes,
1564
+ slotNodes,
1565
+ shadowRootNodes,
1566
+ hostElm,
1567
+ nonShadowNodes[i2],
1568
+ hostId,
1569
+ slottedNodes
1570
+ );
1571
+ }
1572
+ } else if (node.nodeType === 8 /* CommentNode */) {
1573
+ childIdSplt = node.nodeValue.split(".");
1574
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
1575
+ childNodeType = childIdSplt[0];
1576
+ childVNode = createSimpleVNode({
1577
+ $hostId$: childIdSplt[1],
1578
+ $nodeId$: childIdSplt[2],
1579
+ $depth$: childIdSplt[3],
1580
+ $index$: childIdSplt[4] || "0",
1581
+ $elm$: node,
1582
+ $attrs$: null,
1583
+ $children$: null,
1584
+ $key$: null,
1585
+ $name$: null,
1586
+ $tag$: null,
1587
+ $text$: null
1588
+ });
1589
+ if (childNodeType === TEXT_NODE_ID) {
1590
+ childVNode.$elm$ = node.nextSibling;
1591
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1592
+ childVNode.$text$ = childVNode.$elm$.textContent;
1593
+ childRenderNodes.push(childVNode);
1594
+ node.remove();
1595
+ if (hostId === childVNode.$hostId$) {
1596
+ if (!parentVNode.$children$) {
1597
+ parentVNode.$children$ = [];
1598
+ }
1599
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1600
+ }
1601
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1602
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1603
+ }
1604
+ }
1605
+ } else if (childNodeType === COMMENT_NODE_ID) {
1606
+ childVNode.$elm$ = node.nextSibling;
1607
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
1608
+ childRenderNodes.push(childVNode);
1609
+ node.remove();
1610
+ }
1611
+ } else if (childVNode.$hostId$ === hostId) {
1612
+ if (childNodeType === SLOT_NODE_ID) {
1613
+ childVNode.$tag$ = "slot";
1614
+ const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
1615
+ addSlot(
1616
+ slotName,
1617
+ childIdSplt[2],
1618
+ childVNode,
1619
+ node,
1620
+ parentVNode,
1621
+ childRenderNodes,
1622
+ slotNodes,
1623
+ shadowRootNodes,
1624
+ slottedNodes
1625
+ );
1626
+ } else if (childNodeType === CONTENT_REF_ID) {
1627
+ if (BUILD7.shadowDom && shadowRootNodes) {
1628
+ node.remove();
1629
+ } else if (BUILD7.slotRelocation) {
1630
+ hostElm["s-cr"] = node;
1631
+ node["s-cn"] = true;
1632
+ }
1633
+ }
1634
+ }
1635
+ }
1636
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
1637
+ const vnode = newVNode(null, node.textContent);
1638
+ vnode.$elm$ = node;
1639
+ vnode.$index$ = "0";
1640
+ parentVNode.$children$ = [vnode];
1641
+ }
1642
+ return parentVNode;
1643
+ };
1644
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
1645
+ if (node.nodeType === 1 /* ElementNode */) {
1646
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
1647
+ if (componentId) {
1648
+ orgLocNodes.set(componentId, node);
1649
+ }
1650
+ let i2 = 0;
1651
+ if (node.shadowRoot) {
1652
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
1653
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
1654
+ }
1655
+ }
1656
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1657
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
1658
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
1659
+ }
1660
+ } else if (node.nodeType === 8 /* CommentNode */) {
1661
+ const childIdSplt = node.nodeValue.split(".");
1662
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
1663
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
1664
+ node.nodeValue = "";
1665
+ node["s-en"] = childIdSplt[3];
1666
+ }
1667
+ }
1668
+ };
1669
+ var createSimpleVNode = (vnode) => {
1670
+ const defaultVNode = {
1671
+ $flags$: 0,
1672
+ $hostId$: null,
1673
+ $nodeId$: null,
1674
+ $depth$: null,
1675
+ $index$: "0",
1676
+ $elm$: null,
1677
+ $attrs$: null,
1678
+ $children$: null,
1679
+ $key$: null,
1680
+ $name$: null,
1681
+ $tag$: null,
1682
+ $text$: null
1683
+ };
1684
+ return { ...defaultVNode, ...vnode };
1685
+ };
1686
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1687
+ node["s-sr"] = true;
1688
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1689
+ if (BUILD7.shadowDom && shadowRootNodes) {
1690
+ const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1691
+ if (childVNode.$name$) {
1692
+ childVNode.$elm$.setAttribute("name", slotName);
1693
+ }
1694
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1695
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1696
+ } else {
1697
+ node.parentNode.insertBefore(childVNode.$elm$, node);
1698
+ }
1699
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1700
+ node.remove();
1701
+ if (childVNode.$depth$ === "0") {
1702
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1703
+ }
1704
+ } else {
1705
+ const slot = childVNode.$elm$;
1706
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
1707
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
1708
+ if (shouldMove) {
1709
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1710
+ }
1711
+ childRenderNodes.push(childVNode);
1712
+ }
1713
+ slotNodes.push(childVNode);
1714
+ if (!parentVNode.$children$) {
1715
+ parentVNode.$children$ = [];
1716
+ }
1717
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1718
+ }
1719
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1720
+ let slottedNode = slotNode.nextSibling;
1721
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1722
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
1723
+ slottedNode["s-sn"] = slotName;
1724
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1725
+ slottedNode = slottedNode.nextSibling;
1726
+ }
1727
+ };
1728
+
1729
+ // src/runtime/initialize-component.ts
1730
+ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
1731
+
1732
+ // src/runtime/mode.ts
1733
+ var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
1734
+ var setMode = (handler) => modeResolutionChain.push(handler);
1735
+ var getMode = (ref) => getHostRef(ref).$modeName$;
1736
+
1737
+ // src/runtime/proxy-component.ts
1738
+ import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
1739
+
1740
+ // src/runtime/set-value.ts
1741
+ import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
1742
+
1743
+ // src/runtime/parse-property-value.ts
1744
+ import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
1745
+ var parsePropertyValue = (propValue, propType) => {
1746
+ if (propValue != null && !isComplexType(propValue)) {
1747
+ if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
1748
+ return propValue === "false" ? false : propValue === "" || !!propValue;
1749
+ }
1750
+ if (BUILD8.propNumber && propType & 2 /* Number */) {
1751
+ return parseFloat(propValue);
1752
+ }
1753
+ if (BUILD8.propString && propType & 1 /* String */) {
1754
+ return String(propValue);
1755
+ }
1756
+ return propValue;
1757
+ }
1758
+ return propValue;
1759
+ };
1760
+
1761
+ // src/runtime/update-component.ts
1762
+ import { BUILD as BUILD12, NAMESPACE } from "@stencil/core/internal/app-data";
1763
+
1764
+ // src/runtime/event-emitter.ts
1765
+ import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
1766
+
1767
+ // 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;
1770
+
1771
+ // src/runtime/event-emitter.ts
1772
+ var createEvent = (ref, name, flags) => {
1773
+ const elm = getElement(ref);
1774
+ return {
1775
+ emit: (detail) => {
1776
+ if (BUILD10.isDev && !elm.isConnected) {
1777
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1778
+ }
1779
+ return emitEvent(elm, name, {
1780
+ bubbles: !!(flags & 4 /* Bubbles */),
1781
+ composed: !!(flags & 2 /* Composed */),
1782
+ cancelable: !!(flags & 1 /* Cancellable */),
1783
+ detail
1784
+ });
1785
+ }
1786
+ };
1787
+ };
1788
+ var emitEvent = (elm, name, opts) => {
1789
+ const ev = plt.ce(name, opts);
1790
+ elm.dispatchEvent(ev);
1791
+ return ev;
1792
+ };
1793
+
1794
+ // src/runtime/styles.ts
1795
+ import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
1796
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1797
+ var registerStyle = (scopeId2, cssText, allowCS) => {
1798
+ let style = styles.get(scopeId2);
1799
+ if (supportsConstructableStylesheets && allowCS) {
1800
+ style = style || new CSSStyleSheet();
1801
+ if (typeof style === "string") {
1802
+ style = cssText;
1803
+ } else {
1804
+ style.replaceSync(cssText);
1805
+ }
1806
+ } else {
1807
+ style = cssText;
1808
+ }
1809
+ styles.set(scopeId2, style);
1810
+ };
1811
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1812
+ var _a;
1813
+ const scopeId2 = getScopeId(cmpMeta, mode);
1814
+ const style = styles.get(scopeId2);
1815
+ if (!BUILD11.attachStyles) {
1816
+ return scopeId2;
1817
+ }
1818
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
1819
+ if (style) {
1820
+ if (typeof style === "string") {
1821
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1822
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1823
+ let styleElm;
1824
+ if (!appliedStyles) {
1825
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1826
+ }
1827
+ if (!appliedStyles.has(scopeId2)) {
1828
+ if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1829
+ styleElm.innerHTML = style;
1830
+ } else {
1831
+ styleElm = doc.createElement("style");
1832
+ styleElm.innerHTML = style;
1833
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1834
+ if (nonce != null) {
1835
+ styleElm.setAttribute("nonce", nonce);
1836
+ }
1837
+ if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1838
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1839
+ }
1840
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1841
+ if (styleContainerNode.nodeName === "HEAD") {
1842
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1843
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1844
+ styleContainerNode.insertBefore(styleElm, referenceNode2);
1845
+ } else if ("host" in styleContainerNode) {
1846
+ if (supportsConstructableStylesheets) {
1847
+ const stylesheet = new CSSStyleSheet();
1848
+ stylesheet.replaceSync(style);
1849
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1850
+ } else {
1851
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1852
+ if (existingStyleContainer) {
1853
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1854
+ } else {
1855
+ styleContainerNode.prepend(styleElm);
1856
+ }
1857
+ }
1858
+ } else {
1859
+ styleContainerNode.append(styleElm);
1860
+ }
1861
+ }
1862
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
1863
+ styleContainerNode.insertBefore(styleElm, null);
1864
+ }
1865
+ }
1866
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1867
+ styleElm.innerHTML += SLOT_FB_CSS;
1868
+ }
1869
+ if (appliedStyles) {
1870
+ appliedStyles.add(scopeId2);
1871
+ }
1872
+ }
1873
+ } else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1874
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1875
+ }
1876
+ }
1877
+ return scopeId2;
1878
+ };
1879
+ var attachStyles = (hostRef) => {
1880
+ const cmpMeta = hostRef.$cmpMeta$;
1881
+ const elm = hostRef.$hostElement$;
1882
+ const flags = cmpMeta.$flags$;
1883
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1884
+ const scopeId2 = addStyle(
1885
+ BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1886
+ cmpMeta,
1887
+ hostRef.$modeName$
1888
+ );
1889
+ if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
1890
+ elm["s-sc"] = scopeId2;
1891
+ elm.classList.add(scopeId2 + "-h");
1892
+ if (BUILD11.scoped && flags & 2 /* scopedCssEncapsulation */) {
1893
+ elm.classList.add(scopeId2 + "-s");
1894
+ }
1895
+ }
1896
+ endAttachStyles();
1447
1897
  };
1448
- var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1449
- `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1450
- );
1451
- var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1452
- `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1453
- );
1898
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1454
1899
 
1455
1900
  // src/runtime/update-component.ts
1456
1901
  var attachToAncestor = (hostRef, ancestorComponent) => {
1457
- if (BUILD11.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1902
+ if (BUILD12.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1458
1903
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1459
1904
  }
1460
1905
  };
1461
1906
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1462
- if (BUILD11.taskQueue && BUILD11.updatable) {
1907
+ if (BUILD12.taskQueue && BUILD12.updatable) {
1463
1908
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1464
1909
  }
1465
- if (BUILD11.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1910
+ if (BUILD12.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1466
1911
  hostRef.$flags$ |= 512 /* needsRerender */;
1467
1912
  return;
1468
1913
  }
1469
1914
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1470
1915
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1471
- return BUILD11.taskQueue ? writeTask(dispatch) : dispatch();
1916
+ return BUILD12.taskQueue ? writeTask(dispatch) : dispatch();
1472
1917
  };
1473
1918
  var dispatchHooks = (hostRef, isInitialLoad) => {
1474
1919
  const elm = hostRef.$hostElement$;
1475
1920
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1476
- const instance = BUILD11.lazyLoad ? hostRef.$lazyInstance$ : elm;
1921
+ const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
1477
1922
  if (!instance) {
1478
1923
  throw new Error(
1479
1924
  `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`
@@ -1481,7 +1926,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1481
1926
  }
1482
1927
  let maybePromise;
1483
1928
  if (isInitialLoad) {
1484
- if (BUILD11.lazyLoad && BUILD11.hostListener) {
1929
+ if (BUILD12.lazyLoad && BUILD12.hostListener) {
1485
1930
  hostRef.$flags$ |= 256 /* isListenReady */;
1486
1931
  if (hostRef.$queuedListeners$) {
1487
1932
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1489,17 +1934,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1489
1934
  }
1490
1935
  }
1491
1936
  emitLifecycleEvent(elm, "componentWillLoad");
1492
- if (BUILD11.cmpWillLoad) {
1937
+ if (BUILD12.cmpWillLoad) {
1493
1938
  maybePromise = safeCall(instance, "componentWillLoad");
1494
1939
  }
1495
1940
  } else {
1496
1941
  emitLifecycleEvent(elm, "componentWillUpdate");
1497
- if (BUILD11.cmpWillUpdate) {
1942
+ if (BUILD12.cmpWillUpdate) {
1498
1943
  maybePromise = safeCall(instance, "componentWillUpdate");
1499
1944
  }
1500
1945
  }
1501
1946
  emitLifecycleEvent(elm, "componentWillRender");
1502
- if (BUILD11.cmpWillRender) {
1947
+ if (BUILD12.cmpWillRender) {
1503
1948
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1504
1949
  }
1505
1950
  endSchedule();
@@ -1515,23 +1960,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1515
1960
  const elm = hostRef.$hostElement$;
1516
1961
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1517
1962
  const rc = elm["s-rc"];
1518
- if (BUILD11.style && isInitialLoad) {
1963
+ if (BUILD12.style && isInitialLoad) {
1519
1964
  attachStyles(hostRef);
1520
1965
  }
1521
1966
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1522
- if (BUILD11.isDev) {
1967
+ if (BUILD12.isDev) {
1523
1968
  hostRef.$flags$ |= 1024 /* devOnRender */;
1524
1969
  }
1525
- if (BUILD11.hydrateServerSide) {
1970
+ if (BUILD12.hydrateServerSide) {
1526
1971
  await callRender(hostRef, instance, elm, isInitialLoad);
1527
1972
  } else {
1528
1973
  callRender(hostRef, instance, elm, isInitialLoad);
1529
1974
  }
1530
- if (BUILD11.isDev) {
1975
+ if (BUILD12.isDev) {
1531
1976
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1532
1977
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1533
1978
  }
1534
- if (BUILD11.hydrateServerSide) {
1979
+ if (BUILD12.hydrateServerSide) {
1535
1980
  try {
1536
1981
  serverSideConnected(elm);
1537
1982
  if (isInitialLoad) {
@@ -1545,13 +1990,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1545
1990
  consoleError(e, elm);
1546
1991
  }
1547
1992
  }
1548
- if (BUILD11.asyncLoading && rc) {
1993
+ if (BUILD12.asyncLoading && rc) {
1549
1994
  rc.map((cb) => cb());
1550
1995
  elm["s-rc"] = void 0;
1551
1996
  }
1552
1997
  endRender();
1553
1998
  endUpdate();
1554
- if (BUILD11.asyncLoading) {
1999
+ if (BUILD12.asyncLoading) {
1555
2000
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1556
2001
  const postUpdate = () => postUpdateComponent(hostRef);
1557
2002
  if (childrenPromises.length === 0) {
@@ -1567,10 +2012,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1567
2012
  };
1568
2013
  var renderingRef = null;
1569
2014
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
1570
- const allRenderFn = BUILD11.allRenderFn ? true : false;
1571
- const lazyLoad = BUILD11.lazyLoad ? true : false;
1572
- const taskQueue = BUILD11.taskQueue ? true : false;
1573
- const updatable = BUILD11.updatable ? true : false;
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;
1574
2019
  try {
1575
2020
  renderingRef = instance;
1576
2021
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -1580,9 +2025,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
1580
2025
  if (updatable || lazyLoad) {
1581
2026
  hostRef.$flags$ |= 2 /* hasRendered */;
1582
2027
  }
1583
- if (BUILD11.hasRenderFn || BUILD11.reflect) {
1584
- if (BUILD11.vdomRender || BUILD11.reflect) {
1585
- if (BUILD11.hydrateServerSide) {
2028
+ if (BUILD12.hasRenderFn || BUILD12.reflect) {
2029
+ if (BUILD12.vdomRender || BUILD12.reflect) {
2030
+ if (BUILD12.hydrateServerSide) {
1586
2031
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
1587
2032
  } else {
1588
2033
  renderVdom(hostRef, instance, isInitialLoad);
@@ -1607,57 +2052,57 @@ var postUpdateComponent = (hostRef) => {
1607
2052
  const tagName = hostRef.$cmpMeta$.$tagName$;
1608
2053
  const elm = hostRef.$hostElement$;
1609
2054
  const endPostUpdate = createTime("postUpdate", tagName);
1610
- const instance = BUILD11.lazyLoad ? hostRef.$lazyInstance$ : elm;
2055
+ const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
1611
2056
  const ancestorComponent = hostRef.$ancestorComponent$;
1612
- if (BUILD11.cmpDidRender) {
1613
- if (BUILD11.isDev) {
2057
+ if (BUILD12.cmpDidRender) {
2058
+ if (BUILD12.isDev) {
1614
2059
  hostRef.$flags$ |= 1024 /* devOnRender */;
1615
2060
  }
1616
2061
  safeCall(instance, "componentDidRender");
1617
- if (BUILD11.isDev) {
2062
+ if (BUILD12.isDev) {
1618
2063
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1619
2064
  }
1620
2065
  }
1621
2066
  emitLifecycleEvent(elm, "componentDidRender");
1622
2067
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1623
2068
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1624
- if (BUILD11.asyncLoading && BUILD11.cssAnnotations) {
2069
+ if (BUILD12.asyncLoading && BUILD12.cssAnnotations) {
1625
2070
  addHydratedFlag(elm);
1626
2071
  }
1627
- if (BUILD11.cmpDidLoad) {
1628
- if (BUILD11.isDev) {
2072
+ if (BUILD12.cmpDidLoad) {
2073
+ if (BUILD12.isDev) {
1629
2074
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
1630
2075
  }
1631
2076
  safeCall(instance, "componentDidLoad");
1632
- if (BUILD11.isDev) {
2077
+ if (BUILD12.isDev) {
1633
2078
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
1634
2079
  }
1635
2080
  }
1636
2081
  emitLifecycleEvent(elm, "componentDidLoad");
1637
2082
  endPostUpdate();
1638
- if (BUILD11.asyncLoading) {
2083
+ if (BUILD12.asyncLoading) {
1639
2084
  hostRef.$onReadyResolve$(elm);
1640
2085
  if (!ancestorComponent) {
1641
2086
  appDidLoad(tagName);
1642
2087
  }
1643
2088
  }
1644
2089
  } else {
1645
- if (BUILD11.cmpDidUpdate) {
1646
- if (BUILD11.isDev) {
2090
+ if (BUILD12.cmpDidUpdate) {
2091
+ if (BUILD12.isDev) {
1647
2092
  hostRef.$flags$ |= 1024 /* devOnRender */;
1648
2093
  }
1649
2094
  safeCall(instance, "componentDidUpdate");
1650
- if (BUILD11.isDev) {
2095
+ if (BUILD12.isDev) {
1651
2096
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1652
2097
  }
1653
2098
  }
1654
2099
  emitLifecycleEvent(elm, "componentDidUpdate");
1655
2100
  endPostUpdate();
1656
2101
  }
1657
- if (BUILD11.method && BUILD11.lazyLoad) {
2102
+ if (BUILD12.method && BUILD12.lazyLoad) {
1658
2103
  hostRef.$onInstanceResolve$(elm);
1659
2104
  }
1660
- if (BUILD11.asyncLoading) {
2105
+ if (BUILD12.asyncLoading) {
1661
2106
  if (hostRef.$onRenderResolve$) {
1662
2107
  hostRef.$onRenderResolve$();
1663
2108
  hostRef.$onRenderResolve$ = void 0;
@@ -1669,7 +2114,7 @@ var postUpdateComponent = (hostRef) => {
1669
2114
  }
1670
2115
  };
1671
2116
  var forceUpdate = (ref) => {
1672
- if (BUILD11.updatable && (Build.isBrowser || Build.isTesting)) {
2117
+ if (BUILD12.updatable && (Build.isBrowser || Build.isTesting)) {
1673
2118
  const hostRef = getHostRef(ref);
1674
2119
  const isConnected = hostRef.$hostElement$.isConnected;
1675
2120
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -1680,14 +2125,14 @@ var forceUpdate = (ref) => {
1680
2125
  return false;
1681
2126
  };
1682
2127
  var appDidLoad = (who) => {
1683
- if (BUILD11.cssAnnotations) {
2128
+ if (BUILD12.cssAnnotations) {
1684
2129
  addHydratedFlag(doc.documentElement);
1685
2130
  }
1686
- if (BUILD11.asyncQueue) {
2131
+ if (BUILD12.asyncQueue) {
1687
2132
  plt.$flags$ |= 2 /* appLoaded */;
1688
2133
  }
1689
2134
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1690
- if (BUILD11.profile && performance.measure) {
2135
+ if (BUILD12.profile && performance.measure) {
1691
2136
  performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
1692
2137
  }
1693
2138
  };
@@ -1702,7 +2147,7 @@ var safeCall = (instance, method, arg) => {
1702
2147
  return void 0;
1703
2148
  };
1704
2149
  var emitLifecycleEvent = (elm, lifecycleName) => {
1705
- if (BUILD11.lifecycleDOMEvents) {
2150
+ if (BUILD12.lifecycleDOMEvents) {
1706
2151
  emitEvent(elm, "stencil_" + lifecycleName, {
1707
2152
  bubbles: true,
1708
2153
  composed: true,
@@ -1714,7 +2159,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
1714
2159
  };
1715
2160
  var addHydratedFlag = (elm) => {
1716
2161
  var _a, _b;
1717
- return BUILD11.hydratedClass ? elm.classList.add((_a = BUILD11.hydratedSelectorName) != null ? _a : "hydrated") : BUILD11.hydratedAttribute ? elm.setAttribute((_b = BUILD11.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
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;
1718
2163
  };
1719
2164
  var serverSideConnected = (elm) => {
1720
2165
  const children = elm.children;
@@ -1733,21 +2178,21 @@ var serverSideConnected = (elm) => {
1733
2178
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1734
2179
  var setValue = (ref, propName, newVal, cmpMeta) => {
1735
2180
  const hostRef = getHostRef(ref);
1736
- if (BUILD12.lazyLoad && !hostRef) {
2181
+ if (BUILD13.lazyLoad && !hostRef) {
1737
2182
  throw new Error(
1738
2183
  `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).`
1739
2184
  );
1740
2185
  }
1741
- const elm = BUILD12.lazyLoad ? hostRef.$hostElement$ : ref;
2186
+ const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : ref;
1742
2187
  const oldVal = hostRef.$instanceValues$.get(propName);
1743
2188
  const flags = hostRef.$flags$;
1744
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
2189
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1745
2190
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1746
2191
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1747
2192
  const didValueChange = newVal !== oldVal && !areBothNaN;
1748
- if ((!BUILD12.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2193
+ if ((!BUILD13.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1749
2194
  hostRef.$instanceValues$.set(propName, newVal);
1750
- if (BUILD12.isDev) {
2195
+ if (BUILD13.isDev) {
1751
2196
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
1752
2197
  consoleDevWarn(
1753
2198
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -1770,8 +2215,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1770
2215
  );
1771
2216
  }
1772
2217
  }
1773
- if (!BUILD12.lazyLoad || instance) {
1774
- if (BUILD12.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2218
+ if (!BUILD13.lazyLoad || instance) {
2219
+ if (BUILD13.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1775
2220
  const watchMethods = cmpMeta.$watchers$[propName];
1776
2221
  if (watchMethods) {
1777
2222
  watchMethods.map((watchMethodName) => {
@@ -1783,8 +2228,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1783
2228
  });
1784
2229
  }
1785
2230
  }
1786
- if (BUILD12.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1787
- if (BUILD12.cmpShouldUpdate && instance.componentShouldUpdate) {
2231
+ if (BUILD13.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2232
+ if (BUILD13.cmpShouldUpdate && instance.componentShouldUpdate) {
1788
2233
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1789
2234
  return;
1790
2235
  }
@@ -1799,40 +2244,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1799
2244
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1800
2245
  var _a, _b;
1801
2246
  const prototype = Cstr.prototype;
1802
- if (BUILD13.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2247
+ if (BUILD14.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1803
2248
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
1804
2249
  const originalFormAssociatedCallback = prototype[cbName];
1805
2250
  Object.defineProperty(prototype, cbName, {
1806
2251
  value(...args) {
1807
2252
  const hostRef = getHostRef(this);
1808
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : this;
2253
+ const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : this;
1809
2254
  if (!instance) {
1810
2255
  hostRef.$onReadyPromise$.then((asyncInstance) => {
1811
2256
  const cb = asyncInstance[cbName];
1812
2257
  typeof cb === "function" && cb.call(asyncInstance, ...args);
1813
2258
  });
1814
2259
  } else {
1815
- const cb = BUILD13.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2260
+ const cb = BUILD14.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
1816
2261
  typeof cb === "function" && cb.call(instance, ...args);
1817
2262
  }
1818
2263
  }
1819
2264
  });
1820
2265
  });
1821
2266
  }
1822
- if (BUILD13.member && cmpMeta.$members$ || BUILD13.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
1823
- if (BUILD13.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2267
+ if (BUILD14.member && cmpMeta.$members$ || BUILD14.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2268
+ if (BUILD14.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
1824
2269
  cmpMeta.$watchers$ = Cstr.watchers;
1825
2270
  }
1826
2271
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1827
2272
  members.map(([memberName, [memberFlags]]) => {
1828
- if ((BUILD13.prop || BUILD13.state) && (memberFlags & 31 /* Prop */ || (!BUILD13.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2273
+ if ((BUILD14.prop || BUILD14.state) && (memberFlags & 31 /* Prop */ || (!BUILD14.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1829
2274
  if ((memberFlags & 2048 /* Getter */) === 0) {
1830
2275
  Object.defineProperty(prototype, memberName, {
1831
2276
  get() {
1832
2277
  return getValue(this, memberName);
1833
2278
  },
1834
2279
  set(newValue) {
1835
- if (BUILD13.isDev) {
2280
+ if (BUILD14.isDev) {
1836
2281
  const ref = getHostRef(this);
1837
2282
  if (
1838
2283
  // we are proxying the instance (not element)
@@ -1853,11 +2298,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1853
2298
  enumerable: true
1854
2299
  });
1855
2300
  } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
1856
- if (BUILD13.lazyLoad) {
2301
+ if (BUILD14.lazyLoad) {
1857
2302
  Object.defineProperty(prototype, memberName, {
1858
2303
  get() {
1859
2304
  const ref = getHostRef(this);
1860
- const instance = BUILD13.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2305
+ const instance = BUILD14.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
1861
2306
  if (!instance) return;
1862
2307
  return instance[memberName];
1863
2308
  },
@@ -1897,7 +2342,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1897
2342
  });
1898
2343
  }
1899
2344
  }
1900
- } else if (BUILD13.lazyLoad && BUILD13.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2345
+ } else if (BUILD14.lazyLoad && BUILD14.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1901
2346
  Object.defineProperty(prototype, memberName, {
1902
2347
  value(...args) {
1903
2348
  var _a2;
@@ -1910,7 +2355,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1910
2355
  });
1911
2356
  }
1912
2357
  });
1913
- if (BUILD13.observeAttribute && (!BUILD13.lazyLoad || flags & 1 /* isElementConstructor */)) {
2358
+ if (BUILD14.observeAttribute && (!BUILD14.lazyLoad || flags & 1 /* isElementConstructor */)) {
1914
2359
  const attrNameToPropName = /* @__PURE__ */ new Map();
1915
2360
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
1916
2361
  plt.jmp(() => {
@@ -1926,8 +2371,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1926
2371
  const hostRef = getHostRef(this);
1927
2372
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1928
2373
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1929
- const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : this;
1930
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
2374
+ const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : this;
2375
+ const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
1931
2376
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1932
2377
  entry == null ? void 0 : entry.forEach((callbackName) => {
1933
2378
  if (instance[callbackName] != null) {
@@ -1950,7 +2395,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
1950
2395
  var _a2;
1951
2396
  const attrName = m[1] || propName;
1952
2397
  attrNameToPropName.set(attrName, propName);
1953
- if (BUILD13.reflect && m[0] & 512 /* ReflectAttr */) {
2398
+ if (BUILD14.reflect && m[0] & 512 /* ReflectAttr */) {
1954
2399
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
1955
2400
  }
1956
2401
  return attrName;
@@ -1968,7 +2413,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1968
2413
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1969
2414
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1970
2415
  const bundleId = cmpMeta.$lazyBundleId$;
1971
- if ((BUILD14.lazyLoad || BUILD14.hydrateClientSide) && bundleId) {
2416
+ if ((BUILD15.lazyLoad || BUILD15.hydrateClientSide) && bundleId) {
1972
2417
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
1973
2418
  if (CstrImport && "then" in CstrImport) {
1974
2419
  const endLoad = uniqueTime(
@@ -1983,442 +2428,174 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1983
2428
  if (!Cstr) {
1984
2429
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1985
2430
  }
1986
- if (BUILD14.member && !Cstr.isProxied) {
1987
- if (BUILD14.watchCallback) {
2431
+ if (BUILD15.member && !Cstr.isProxied) {
2432
+ if (BUILD15.watchCallback) {
1988
2433
  cmpMeta.$watchers$ = Cstr.watchers;
1989
2434
  }
1990
2435
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1991
2436
  Cstr.isProxied = true;
1992
2437
  }
1993
2438
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1994
- if (BUILD14.member) {
1995
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1996
- }
1997
- try {
1998
- new Cstr(hostRef);
1999
- } catch (e) {
2000
- consoleError(e);
2001
- }
2002
- if (BUILD14.member) {
2003
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
2004
- }
2005
- if (BUILD14.watchCallback) {
2006
- hostRef.$flags$ |= 128 /* isWatchReady */;
2007
- }
2008
- endNewInstance();
2009
- fireConnectedCallback(hostRef.$lazyInstance$);
2010
- } else {
2011
- Cstr = elm.constructor;
2012
- const cmpTag = elm.localName;
2013
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2014
- }
2015
- if (BUILD14.style && Cstr && Cstr.style) {
2016
- let style;
2017
- if (typeof Cstr.style === "string") {
2018
- style = Cstr.style;
2019
- } else if (BUILD14.mode && typeof Cstr.style !== "string") {
2020
- hostRef.$modeName$ = computeMode(elm);
2021
- if (hostRef.$modeName$) {
2022
- style = Cstr.style[hostRef.$modeName$];
2023
- }
2024
- if (BUILD14.hydrateServerSide && hostRef.$modeName$) {
2025
- elm.setAttribute("s-mode", hostRef.$modeName$);
2026
- }
2027
- }
2028
- const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
2029
- if (!styles.has(scopeId2)) {
2030
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
2031
- if (!BUILD14.hydrateServerSide && BUILD14.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2032
- BUILD14.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2033
- style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
2034
- }
2035
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
2036
- endRegisterStyles();
2037
- }
2038
- }
2039
- }
2040
- const ancestorComponent = hostRef.$ancestorComponent$;
2041
- const schedule = () => scheduleUpdate(hostRef, true);
2042
- if (BUILD14.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2043
- ancestorComponent["s-rc"].push(schedule);
2044
- } else {
2045
- schedule();
2046
- }
2047
- };
2048
- var fireConnectedCallback = (instance) => {
2049
- if (BUILD14.lazyLoad && BUILD14.connectedCallback) {
2050
- safeCall(instance, "connectedCallback");
2051
- }
2052
- };
2053
-
2054
- // src/runtime/connected-callback.ts
2055
- var connectedCallback = (elm) => {
2056
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2057
- const hostRef = getHostRef(elm);
2058
- const cmpMeta = hostRef.$cmpMeta$;
2059
- const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2060
- if (BUILD15.hostListenerTargetParent) {
2061
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2062
- }
2063
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2064
- hostRef.$flags$ |= 1 /* hasConnected */;
2065
- let hostId;
2066
- if (BUILD15.hydrateClientSide) {
2067
- hostId = elm.getAttribute(HYDRATE_ID);
2068
- if (hostId) {
2069
- if (BUILD15.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2070
- const scopeId2 = BUILD15.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2071
- elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2072
- }
2073
- initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2074
- }
2075
- }
2076
- if (BUILD15.slotRelocation && !hostId) {
2077
- if (BUILD15.hydrateServerSide || (BUILD15.slot || BUILD15.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2078
- cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2079
- setContentReference(elm);
2080
- }
2081
- }
2082
- if (BUILD15.asyncLoading) {
2083
- let ancestorComponent = elm;
2084
- while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2085
- if (BUILD15.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2086
- attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2087
- break;
2088
- }
2089
- }
2090
- }
2091
- if (BUILD15.prop && !BUILD15.hydrateServerSide && cmpMeta.$members$) {
2092
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2093
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2094
- const value = elm[memberName];
2095
- delete elm[memberName];
2096
- elm[memberName] = value;
2097
- }
2098
- });
2099
- }
2100
- if (BUILD15.initializeNextTick) {
2101
- nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2102
- } else {
2103
- initializeComponent(elm, hostRef, cmpMeta);
2104
- }
2105
- } else {
2106
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2107
- if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2108
- fireConnectedCallback(hostRef.$lazyInstance$);
2109
- } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2110
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2111
- }
2112
- }
2113
- endConnected();
2114
- }
2115
- };
2116
- var setContentReference = (elm) => {
2117
- const contentRefElm = elm["s-cr"] = doc.createComment(
2118
- BUILD15.isDebug ? `content-ref (host=${elm.localName})` : ""
2119
- );
2120
- contentRefElm["s-cn"] = true;
2121
- insertBefore(elm, contentRefElm, elm.firstChild);
2122
- };
2123
-
2124
- // src/runtime/disconnected-callback.ts
2125
- import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
2126
- var disconnectInstance = (instance) => {
2127
- if (BUILD16.lazyLoad && BUILD16.disconnectedCallback) {
2128
- safeCall(instance, "disconnectedCallback");
2129
- }
2130
- if (BUILD16.cmpDidUnload) {
2131
- safeCall(instance, "componentDidUnload");
2132
- }
2133
- };
2134
- var disconnectedCallback = async (elm) => {
2135
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2136
- const hostRef = getHostRef(elm);
2137
- if (BUILD16.hostListener) {
2138
- if (hostRef.$rmListeners$) {
2139
- hostRef.$rmListeners$.map((rmListener) => rmListener());
2140
- hostRef.$rmListeners$ = void 0;
2141
- }
2142
- }
2143
- if (!BUILD16.lazyLoad) {
2144
- disconnectInstance(elm);
2145
- } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2146
- disconnectInstance(hostRef.$lazyInstance$);
2147
- } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2148
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2149
- }
2150
- }
2151
- };
2152
-
2153
- // src/runtime/dom-extras.ts
2154
- import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2155
- var patchPseudoShadowDom = (hostElementPrototype) => {
2156
- patchCloneNode(hostElementPrototype);
2157
- patchSlotAppendChild(hostElementPrototype);
2158
- patchSlotAppend(hostElementPrototype);
2159
- patchSlotPrepend(hostElementPrototype);
2160
- patchSlotInsertAdjacentElement(hostElementPrototype);
2161
- patchSlotInsertAdjacentHTML(hostElementPrototype);
2162
- patchSlotInsertAdjacentText(hostElementPrototype);
2163
- patchTextContent(hostElementPrototype);
2164
- patchChildSlotNodes(hostElementPrototype);
2165
- patchSlotRemoveChild(hostElementPrototype);
2166
- };
2167
- var patchCloneNode = (HostElementPrototype) => {
2168
- const orgCloneNode = HostElementPrototype.cloneNode;
2169
- HostElementPrototype.cloneNode = function(deep) {
2170
- const srcNode = this;
2171
- const isShadowDom = BUILD17.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2172
- const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2173
- if (BUILD17.slot && !isShadowDom && deep) {
2174
- let i2 = 0;
2175
- let slotted, nonStencilNode;
2176
- const stencilPrivates = [
2177
- "s-id",
2178
- "s-cr",
2179
- "s-lr",
2180
- "s-rc",
2181
- "s-sc",
2182
- "s-p",
2183
- "s-cn",
2184
- "s-sr",
2185
- "s-sn",
2186
- "s-hn",
2187
- "s-ol",
2188
- "s-nr",
2189
- "s-si",
2190
- "s-rf",
2191
- "s-scs"
2192
- ];
2193
- const childNodes = this.__childNodes || this.childNodes;
2194
- for (; i2 < childNodes.length; i2++) {
2195
- slotted = childNodes[i2]["s-nr"];
2196
- nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
2197
- if (slotted) {
2198
- if (BUILD17.appendChildSlotFix && clonedNode.__appendChild) {
2199
- clonedNode.__appendChild(slotted.cloneNode(true));
2200
- } else {
2201
- clonedNode.appendChild(slotted.cloneNode(true));
2202
- }
2203
- }
2204
- if (nonStencilNode) {
2205
- clonedNode.appendChild(childNodes[i2].cloneNode(true));
2206
- }
2207
- }
2208
- }
2209
- return clonedNode;
2210
- };
2211
- };
2212
- var patchSlotAppendChild = (HostElementPrototype) => {
2213
- HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2214
- HostElementPrototype.appendChild = function(newChild) {
2215
- const slotName = newChild["s-sn"] = getSlotName(newChild);
2216
- const slotNode = getHostSlotNode(this.__childNodes || this.childNodes, slotName, this.tagName);
2217
- if (slotNode) {
2218
- addSlotRelocateNode(newChild, slotNode);
2219
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2220
- const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2221
- const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
2222
- updateFallbackSlotVisibility(this);
2223
- return insertedNode;
2224
- }
2225
- return this.__appendChild(newChild);
2226
- };
2227
- };
2228
- var patchSlotRemoveChild = (ElementPrototype) => {
2229
- ElementPrototype.__removeChild = ElementPrototype.removeChild;
2230
- ElementPrototype.removeChild = function(toRemove) {
2231
- if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
2232
- const childNodes = this.__childNodes || this.childNodes;
2233
- const slotNode = getHostSlotNode(childNodes, toRemove["s-sn"], this.tagName);
2234
- if (slotNode && toRemove.isConnected) {
2235
- toRemove.remove();
2236
- updateFallbackSlotVisibility(this);
2237
- return;
2238
- }
2239
- }
2240
- return this.__removeChild(toRemove);
2241
- };
2242
- };
2243
- var patchSlotPrepend = (HostElementPrototype) => {
2244
- HostElementPrototype.__prepend = HostElementPrototype.prepend;
2245
- HostElementPrototype.prepend = function(...newChildren) {
2246
- newChildren.forEach((newChild) => {
2247
- if (typeof newChild === "string") {
2248
- newChild = this.ownerDocument.createTextNode(newChild);
2249
- }
2250
- const slotName = newChild["s-sn"] = getSlotName(newChild);
2251
- const childNodes = this.__childNodes || this.childNodes;
2252
- const slotNode = getHostSlotNode(childNodes, slotName, this.tagName);
2253
- if (slotNode) {
2254
- addSlotRelocateNode(newChild, slotNode, true);
2255
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2256
- const appendAfter = slotChildNodes[0];
2257
- return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
2439
+ if (BUILD15.member) {
2440
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
2258
2441
  }
2259
- if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
2260
- newChild.hidden = true;
2442
+ try {
2443
+ new Cstr(hostRef);
2444
+ } catch (e) {
2445
+ consoleError(e);
2261
2446
  }
2262
- return HostElementPrototype.__prepend(newChild);
2263
- });
2264
- };
2265
- };
2266
- var patchSlotAppend = (HostElementPrototype) => {
2267
- HostElementPrototype.__append = HostElementPrototype.append;
2268
- HostElementPrototype.append = function(...newChildren) {
2269
- newChildren.forEach((newChild) => {
2270
- if (typeof newChild === "string") {
2271
- newChild = this.ownerDocument.createTextNode(newChild);
2447
+ if (BUILD15.member) {
2448
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
2272
2449
  }
2273
- this.appendChild(newChild);
2274
- });
2275
- };
2276
- };
2277
- var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2278
- const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2279
- HostElementPrototype.insertAdjacentHTML = function(position, text) {
2280
- if (position !== "afterbegin" && position !== "beforeend") {
2281
- return originalInsertAdjacentHtml.call(this, position, text);
2450
+ if (BUILD15.watchCallback) {
2451
+ hostRef.$flags$ |= 128 /* isWatchReady */;
2452
+ }
2453
+ endNewInstance();
2454
+ fireConnectedCallback(hostRef.$lazyInstance$);
2455
+ } else {
2456
+ Cstr = elm.constructor;
2457
+ const cmpTag = elm.localName;
2458
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
2282
2459
  }
2283
- const container = this.ownerDocument.createElement("_");
2284
- let node;
2285
- container.innerHTML = text;
2286
- if (position === "afterbegin") {
2287
- while (node = container.firstChild) {
2288
- this.prepend(node);
2460
+ if (BUILD15.style && Cstr && Cstr.style) {
2461
+ let style;
2462
+ if (typeof Cstr.style === "string") {
2463
+ style = Cstr.style;
2464
+ } else if (BUILD15.mode && typeof Cstr.style !== "string") {
2465
+ hostRef.$modeName$ = computeMode(elm);
2466
+ if (hostRef.$modeName$) {
2467
+ style = Cstr.style[hostRef.$modeName$];
2468
+ }
2469
+ if (BUILD15.hydrateServerSide && hostRef.$modeName$) {
2470
+ elm.setAttribute("s-mode", hostRef.$modeName$);
2471
+ }
2289
2472
  }
2290
- } else if (position === "beforeend") {
2291
- while (node = container.firstChild) {
2292
- this.append(node);
2473
+ const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
2474
+ if (!styles.has(scopeId2)) {
2475
+ 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 */) {
2478
+ style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
2479
+ }
2480
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
2481
+ endRegisterStyles();
2293
2482
  }
2294
2483
  }
2295
- };
2296
- };
2297
- var patchSlotInsertAdjacentText = (HostElementPrototype) => {
2298
- HostElementPrototype.insertAdjacentText = function(position, text) {
2299
- this.insertAdjacentHTML(position, text);
2300
- };
2301
- };
2302
- var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2303
- const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2304
- HostElementPrototype.insertAdjacentElement = function(position, element) {
2305
- if (position !== "afterbegin" && position !== "beforeend") {
2306
- return originalInsertAdjacentElement.call(this, position, element);
2307
- }
2308
- if (position === "afterbegin") {
2309
- this.prepend(element);
2310
- return element;
2311
- } else if (position === "beforeend") {
2312
- this.append(element);
2313
- return element;
2314
- }
2315
- return element;
2316
- };
2317
- };
2318
- var patchTextContent = (hostElementPrototype) => {
2319
- let descriptor = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2320
- if (!descriptor) {
2321
- descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
2322
2484
  }
2323
- if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2324
- Object.defineProperty(hostElementPrototype, "textContent", {
2325
- get: function() {
2326
- let text = "";
2327
- const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
2328
- childNodes.forEach((node) => text += node.textContent || "");
2329
- return text;
2330
- },
2331
- set: function(value) {
2332
- const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
2333
- childNodes.forEach((node) => {
2334
- if (node["s-ol"]) node["s-ol"].remove();
2335
- node.remove();
2336
- });
2337
- this.insertAdjacentHTML("beforeend", value);
2338
- }
2339
- });
2340
- };
2341
- var patchChildSlotNodes = (elm) => {
2342
- class FakeNodeList extends Array {
2343
- item(n) {
2344
- return this[n];
2345
- }
2485
+ const ancestorComponent = hostRef.$ancestorComponent$;
2486
+ const schedule = () => scheduleUpdate(hostRef, true);
2487
+ if (BUILD15.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2488
+ ancestorComponent["s-rc"].push(schedule);
2489
+ } else {
2490
+ schedule();
2346
2491
  }
2347
- let childNodesFn = globalThis.Node && Object.getOwnPropertyDescriptor(Node.prototype, "childNodes");
2348
- if (!childNodesFn) {
2349
- childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
2492
+ };
2493
+ var fireConnectedCallback = (instance) => {
2494
+ if (BUILD15.lazyLoad && BUILD15.connectedCallback) {
2495
+ safeCall(instance, "connectedCallback");
2350
2496
  }
2351
- if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
2352
- Object.defineProperty(elm, "children", {
2353
- get() {
2354
- return this.childNodes.filter((n) => n.nodeType === 1);
2355
- }
2356
- });
2357
- Object.defineProperty(elm, "childElementCount", {
2358
- get() {
2359
- return this.children.length;
2497
+ };
2498
+
2499
+ // src/runtime/connected-callback.ts
2500
+ var connectedCallback = (elm) => {
2501
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2502
+ const hostRef = getHostRef(elm);
2503
+ const cmpMeta = hostRef.$cmpMeta$;
2504
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2505
+ if (BUILD16.hostListenerTargetParent) {
2506
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2360
2507
  }
2361
- });
2362
- if (!childNodesFn) return;
2363
- Object.defineProperty(elm, "childNodes", {
2364
- get() {
2365
- var _a, _b;
2366
- if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
2367
- const result = new FakeNodeList();
2368
- const nodes = getSlottedChildNodes(this.__childNodes);
2369
- result.push(...nodes);
2370
- return result;
2508
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2509
+ hostRef.$flags$ |= 1 /* hasConnected */;
2510
+ let hostId;
2511
+ if (BUILD16.hydrateClientSide) {
2512
+ hostId = elm.getAttribute(HYDRATE_ID);
2513
+ 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);
2516
+ 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);
2519
+ elm["s-sc"] = scopeId2;
2520
+ }
2521
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2522
+ }
2523
+ }
2524
+ if (BUILD16.slotRelocation && !hostId) {
2525
+ if (BUILD16.hydrateServerSide || (BUILD16.slot || BUILD16.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2526
+ cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2527
+ setContentReference(elm);
2528
+ }
2529
+ }
2530
+ if (BUILD16.asyncLoading) {
2531
+ let ancestorComponent = elm;
2532
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2533
+ if (BUILD16.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2534
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2535
+ break;
2536
+ }
2537
+ }
2538
+ }
2539
+ if (BUILD16.prop && !BUILD16.hydrateServerSide && cmpMeta.$members$) {
2540
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2541
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2542
+ const value = elm[memberName];
2543
+ delete elm[memberName];
2544
+ elm[memberName] = value;
2545
+ }
2546
+ });
2547
+ }
2548
+ if (BUILD16.initializeNextTick) {
2549
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2550
+ } else {
2551
+ initializeComponent(elm, hostRef, cmpMeta);
2552
+ }
2553
+ } else {
2554
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2555
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2556
+ fireConnectedCallback(hostRef.$lazyInstance$);
2557
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2558
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2371
2559
  }
2372
- return FakeNodeList.from(this.__childNodes);
2373
2560
  }
2374
- });
2375
- };
2376
- var addSlotRelocateNode = (newChild, slotNode, prepend) => {
2377
- let slottedNodeLocation;
2378
- if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
2379
- slottedNodeLocation = newChild["s-ol"];
2380
- } else {
2381
- slottedNodeLocation = document.createTextNode("");
2382
- slottedNodeLocation["s-nr"] = newChild;
2561
+ endConnected();
2383
2562
  }
2384
- const parent = slotNode["s-cr"].parentNode;
2385
- const appendMethod = prepend ? parent.__prepend : parent.__appendChild;
2386
- newChild["s-ol"] = slottedNodeLocation;
2387
- newChild["s-sh"] = slotNode["s-hn"];
2388
- appendMethod.call(parent, slottedNodeLocation);
2389
2563
  };
2390
- var getSlottedChildNodes = (childNodes) => {
2391
- const result = [];
2392
- for (let i2 = 0; i2 < childNodes.length; i2++) {
2393
- const slottedNode = childNodes[i2]["s-nr"];
2394
- if (slottedNode && slottedNode.isConnected) {
2395
- result.push(slottedNode);
2396
- }
2564
+ var setContentReference = (elm) => {
2565
+ const contentRefElm = elm["s-cr"] = doc.createComment(
2566
+ BUILD16.isDebug ? `content-ref (host=${elm.localName})` : ""
2567
+ );
2568
+ contentRefElm["s-cn"] = true;
2569
+ insertBefore(elm, contentRefElm, elm.firstChild);
2570
+ };
2571
+
2572
+ // src/runtime/disconnected-callback.ts
2573
+ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
2574
+ var disconnectInstance = (instance) => {
2575
+ if (BUILD17.lazyLoad && BUILD17.disconnectedCallback) {
2576
+ safeCall(instance, "disconnectedCallback");
2577
+ }
2578
+ if (BUILD17.cmpDidUnload) {
2579
+ safeCall(instance, "componentDidUnload");
2397
2580
  }
2398
- return result;
2399
2581
  };
2400
- var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
2401
- var getHostSlotNode = (childNodes, slotName, hostName) => {
2402
- let i2 = 0;
2403
- let childNode;
2404
- for (; i2 < childNodes.length; i2++) {
2405
- childNode = childNodes[i2];
2406
- if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
2407
- return childNode;
2582
+ var disconnectedCallback = async (elm) => {
2583
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2584
+ const hostRef = getHostRef(elm);
2585
+ if (BUILD17.hostListener) {
2586
+ if (hostRef.$rmListeners$) {
2587
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2588
+ hostRef.$rmListeners$ = void 0;
2589
+ }
2408
2590
  }
2409
- childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
2410
- if (childNode) {
2411
- return childNode;
2591
+ if (!BUILD17.lazyLoad) {
2592
+ disconnectInstance(elm);
2593
+ } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2594
+ disconnectInstance(hostRef.$lazyInstance$);
2595
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
2596
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2412
2597
  }
2413
2598
  }
2414
- return null;
2415
- };
2416
- var getHostSlotChildNodes = (n, slotName) => {
2417
- const childNodes = [n];
2418
- while ((n = n.nextSibling) && n["s-sn"] === slotName) {
2419
- childNodes.push(n);
2420
- }
2421
- return childNodes;
2422
2599
  };
2423
2600
 
2424
2601
  // src/runtime/bootstrap-custom-element.ts
@@ -2796,6 +2973,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
2796
2973
  childId = `${hostId}.${nodeId}`;
2797
2974
  if (nodeRef.nodeType === 1 /* ElementNode */) {
2798
2975
  nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
2976
+ if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
2977
+ nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
2978
+ }
2799
2979
  } else if (nodeRef.nodeType === 3 /* TextNode */) {
2800
2980
  if (hostId === 0) {
2801
2981
  const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
@@ -2807,6 +2987,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
2807
2987
  const commentBeforeTextNode = doc2.createComment(childId);
2808
2988
  commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
2809
2989
  insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
2990
+ } else if (nodeRef.nodeType === 8 /* CommentNode */) {
2991
+ const commentBeforeTextNode = doc2.createComment(childId);
2992
+ commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
2993
+ nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
2810
2994
  }
2811
2995
  }
2812
2996
  let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
@@ -2887,6 +3071,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
2887
3071
  childElm["s-node-id"] = nodeId;
2888
3072
  if (childElm.nodeType === 1 /* ElementNode */) {
2889
3073
  childElm.setAttribute(HYDRATE_CHILD_ID, childId);
3074
+ if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
3075
+ childElm.setAttribute("s-sn", childElm["s-sn"]);
3076
+ }
2890
3077
  } else if (childElm.nodeType === 3 /* TextNode */) {
2891
3078
  const parentNode = childElm.parentNode;
2892
3079
  const nodeName = parentNode == null ? void 0 : parentNode.nodeName;