@everymatrix/bonus-elevate-levels 1.53.0 → 1.53.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/bonus-elevate-levels/bonus-elevate-levels.esm.js +1 -1
  2. package/dist/bonus-elevate-levels/p-acf9e8e9.entry.js +1 -0
  3. package/dist/bonus-elevate-levels/p-e968fbf0.js +2 -0
  4. package/dist/cjs/bonus-elevate-levels.cjs.js +2 -2
  5. package/dist/cjs/bonus-elevate-levels_5.cjs.entry.js +40 -28
  6. package/dist/cjs/{index-477d45bd.js → index-a3684a30.js} +245 -141
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/collection-manifest.json +1 -1
  9. package/dist/collection/components/bonus-elevate-levels/bonus-elevate-levels.js +29 -6
  10. package/dist/collection/components/elevate-level-list/elevate-level-list.js +9 -8
  11. package/dist/collection/components/elevate-level-presentation/elevate-level-presentation.js +3 -4
  12. package/dist/collection/components/elevate-levels-data/elevate-levels-data.js +2 -3
  13. package/dist/esm/bonus-elevate-levels.js +3 -3
  14. package/dist/esm/bonus-elevate-levels_5.entry.js +40 -28
  15. package/dist/esm/{index-e50c1ed9.js → index-e72850a0.js} +245 -141
  16. package/dist/esm/loader.js +2 -2
  17. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.d.ts +2 -0
  18. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.dev.d.ts +2 -0
  19. package/package.json +1 -1
  20. package/dist/bonus-elevate-levels/p-9016df9e.js +0 -2
  21. package/dist/bonus-elevate-levels/p-f071199b.entry.js +0 -1
  22. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.d.ts +0 -2
  23. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/bonus-elevate-levels/.stencil/packages/stencil/bonus-elevate-levels/stencil.config.dev.d.ts +0 -2
@@ -1,17 +1,25 @@
1
1
  const NAMESPACE = 'bonus-elevate-levels';
2
- const BUILD = /* bonus-elevate-levels */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* bonus-elevate-levels */ { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
+
13
+ // src/utils/constants.ts
14
+ var SVG_NS = "http://www.w3.org/2000/svg";
15
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
16
+
17
+ // src/client/client-host-ref.ts
12
18
  var hostRefs = /* @__PURE__ */ new WeakMap();
13
19
  var getHostRef = (ref) => hostRefs.get(ref);
14
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
20
+ var registerInstance = (lazyInstance, hostRef) => {
21
+ hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
22
+ };
15
23
  var registerHost = (hostElement, cmpMeta) => {
16
24
  const hostRef = {
17
25
  $flags$: 0,
@@ -24,7 +32,8 @@ var registerHost = (hostElement, cmpMeta) => {
24
32
  hostElement["s-p"] = [];
25
33
  hostElement["s-rc"] = [];
26
34
  }
27
- return hostRefs.set(hostElement, hostRef);
35
+ const ref = hostRefs.set(hostElement, hostRef);
36
+ return ref;
28
37
  };
29
38
  var isMemberInElement = (elm, memberName) => memberName in elm;
30
39
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -61,16 +70,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
61
70
  /* webpackExclude: /\.system\.entry\.js$/ */
62
71
  /* webpackMode: "lazy" */
63
72
  `./${bundleId}.entry.js${""}`
64
- ).then((importedModule) => {
65
- {
66
- cmpModules.set(bundleId, importedModule);
73
+ ).then(
74
+ (importedModule) => {
75
+ {
76
+ cmpModules.set(bundleId, importedModule);
77
+ }
78
+ return importedModule[exportName];
79
+ },
80
+ (e) => {
81
+ consoleError(e, hostRef.$hostElement$);
67
82
  }
68
- return importedModule[exportName];
69
- }, consoleError);
83
+ );
70
84
  };
71
85
 
72
86
  // src/client/client-style.ts
73
87
  var styles = /* @__PURE__ */ new Map();
88
+ var HYDRATED_STYLE_ID = "sty-id";
74
89
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
75
90
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
76
91
  var win = typeof window !== "undefined" ? window : {};
@@ -144,14 +159,6 @@ var flush = () => {
144
159
  };
145
160
  var nextTick = (cb) => promiseResolve().then(cb);
146
161
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
147
-
148
- // src/utils/constants.ts
149
- var EMPTY_OBJ = {};
150
- var SVG_NS = "http://www.w3.org/2000/svg";
151
- var HTML_NS = "http://www.w3.org/1999/xhtml";
152
-
153
- // src/utils/helpers.ts
154
- var isDef = (v) => v != null;
155
162
  var isComplexType = (o) => {
156
163
  o = typeof o;
157
164
  return o === "object" || o === "function";
@@ -211,6 +218,63 @@ var unwrapErr = (result) => {
211
218
  throw result.value;
212
219
  }
213
220
  };
221
+ var updateFallbackSlotVisibility = (elm) => {
222
+ const childNodes = elm.__childNodes || elm.childNodes;
223
+ if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
224
+ getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
225
+ var _a;
226
+ if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
227
+ if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
228
+ slotNode.hidden = true;
229
+ } else {
230
+ slotNode.hidden = false;
231
+ }
232
+ }
233
+ });
234
+ }
235
+ for (const childNode of childNodes) {
236
+ if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
237
+ updateFallbackSlotVisibility(childNode);
238
+ }
239
+ }
240
+ };
241
+ function getHostSlotNodes(childNodes, hostName, slotName) {
242
+ let i2 = 0;
243
+ let slottedNodes = [];
244
+ let childNode;
245
+ for (; i2 < childNodes.length; i2++) {
246
+ childNode = childNodes[i2];
247
+ if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
248
+ slottedNodes.push(childNode);
249
+ if (typeof slotName !== "undefined") return slottedNodes;
250
+ }
251
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
252
+ }
253
+ return slottedNodes;
254
+ }
255
+ var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
256
+ const childNodes = [];
257
+ if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
258
+ while ((node = node.nextSibling) && node["s-sn"] === slotName) {
259
+ childNodes.push(node);
260
+ }
261
+ return childNodes;
262
+ };
263
+ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
264
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
265
+ if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
266
+ return true;
267
+ }
268
+ if (nodeToRelocate.getAttribute("slot") === slotName) {
269
+ return true;
270
+ }
271
+ return false;
272
+ }
273
+ if (nodeToRelocate["s-sn"] === slotName) {
274
+ return true;
275
+ }
276
+ return slotName === "";
277
+ };
214
278
  var createTime = (fnName, tagName = "") => {
215
279
  {
216
280
  return () => {
@@ -362,7 +426,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
362
426
  }
363
427
  if (!appliedStyles.has(scopeId2)) {
364
428
  {
365
- styleElm = doc.createElement("style");
429
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
366
430
  styleElm.innerHTML = style;
367
431
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
368
432
  if (nonce != null) {
@@ -372,7 +436,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
372
436
  if (styleContainerNode.nodeName === "HEAD") {
373
437
  const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
374
438
  const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
375
- styleContainerNode.insertBefore(styleElm, referenceNode2);
439
+ styleContainerNode.insertBefore(
440
+ styleElm,
441
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
442
+ );
376
443
  } else if ("host" in styleContainerNode) {
377
444
  if (supportsConstructableStylesheets) {
378
445
  const stylesheet = new CSSStyleSheet();
@@ -422,16 +489,18 @@ var attachStyles = (hostRef) => {
422
489
  endAttachStyles();
423
490
  };
424
491
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
425
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
492
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
426
493
  if (oldValue !== newValue) {
427
494
  let isProp = isMemberInElement(elm, memberName);
428
495
  let ln = memberName.toLowerCase();
429
496
  if (memberName === "class") {
430
497
  const classList = elm.classList;
431
498
  const oldClasses = parseClassList(oldValue);
432
- const newClasses = parseClassList(newValue);
433
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
434
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
499
+ let newClasses = parseClassList(newValue);
500
+ {
501
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
502
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
503
+ }
435
504
  } else if (memberName === "style") {
436
505
  {
437
506
  for (const prop in oldValue) {
@@ -490,7 +559,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
490
559
  elm.setAttribute(memberName, n);
491
560
  }
492
561
  }
493
- } else {
562
+ } else if (elm[memberName] !== newValue) {
494
563
  elm[memberName] = newValue;
495
564
  }
496
565
  } catch (e) {
@@ -512,24 +581,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
512
581
  }
513
582
  };
514
583
  var parseClassListRegex = /\s/;
515
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
584
+ var parseClassList = (value) => {
585
+ if (typeof value === "object" && value && "baseVal" in value) {
586
+ value = value.baseVal;
587
+ }
588
+ if (!value || typeof value !== "string") {
589
+ return [];
590
+ }
591
+ return value.split(parseClassListRegex);
592
+ };
516
593
  var CAPTURE_EVENT_SUFFIX = "Capture";
517
594
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
518
595
 
519
596
  // src/runtime/vdom/update-element.ts
520
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
597
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
521
598
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
522
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
523
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
599
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
600
+ const newVnodeAttrs = newVnode.$attrs$ || {};
524
601
  {
525
602
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
526
603
  if (!(memberName in newVnodeAttrs)) {
527
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
604
+ setAccessor(
605
+ elm,
606
+ memberName,
607
+ oldVnodeAttrs[memberName],
608
+ void 0,
609
+ isSvgMode2,
610
+ newVnode.$flags$);
528
611
  }
529
612
  }
530
613
  }
531
614
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
532
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
615
+ setAccessor(
616
+ elm,
617
+ memberName,
618
+ oldVnodeAttrs[memberName],
619
+ newVnodeAttrs[memberName],
620
+ isSvgMode2,
621
+ newVnode.$flags$);
533
622
  }
534
623
  };
535
624
  function sortedAttrNames(attrNames) {
@@ -541,16 +630,13 @@ function sortedAttrNames(attrNames) {
541
630
  attrNames
542
631
  );
543
632
  }
544
-
545
- // src/runtime/vdom/vdom-render.ts
546
- var scopeId;
547
633
  var contentRef;
548
634
  var hostTagName;
549
635
  var useNativeShadowDom = false;
550
636
  var checkSlotFallbackVisibility = false;
551
637
  var checkSlotRelocate = false;
552
638
  var isSvgMode = false;
553
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
639
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
554
640
  var _a;
555
641
  const newVNode2 = newParentVNode.$children$[childIndex];
556
642
  let i2 = 0;
@@ -560,9 +646,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
560
646
  if (!useNativeShadowDom) {
561
647
  checkSlotRelocate = true;
562
648
  if (newVNode2.$tag$ === "slot") {
563
- if (scopeId) {
564
- parentElm.classList.add(scopeId + "-s");
565
- }
566
649
  newVNode2.$flags$ |= newVNode2.$children$ ? (
567
650
  // slot element has fallback content
568
651
  // still create an element that "mocks" the slot element
@@ -593,14 +676,9 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
593
676
  {
594
677
  updateElement(null, newVNode2, isSvgMode);
595
678
  }
596
- const rootNode = elm.getRootNode();
597
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
598
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
599
- elm.classList.add(elm["s-si"] = scopeId);
600
- }
601
679
  if (newVNode2.$children$) {
602
680
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
603
- childNode = createElm(oldParentVNode, newVNode2, i2, elm);
681
+ childNode = createElm(oldParentVNode, newVNode2, i2);
604
682
  if (childNode) {
605
683
  elm.appendChild(childNode);
606
684
  }
@@ -633,7 +711,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
633
711
  };
634
712
  var putBackInOriginalLocation = (parentElm, recursive) => {
635
713
  plt.$flags$ |= 1 /* isTmpDisconnected */;
636
- const oldSlotChildNodes = Array.from(parentElm.childNodes);
714
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
637
715
  if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
638
716
  let node = parentElm;
639
717
  while (node = node.nextSibling) {
@@ -645,7 +723,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
645
723
  for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
646
724
  const childNode = oldSlotChildNodes[i2];
647
725
  if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
648
- insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode));
726
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
649
727
  childNode["s-ol"].remove();
650
728
  childNode["s-ol"] = void 0;
651
729
  childNode["s-sh"] = void 0;
@@ -665,7 +743,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
665
743
  }
666
744
  for (; startIdx <= endIdx; ++startIdx) {
667
745
  if (vnodes[startIdx]) {
668
- childNode = createElm(null, parentVNode, startIdx, parentElm);
746
+ childNode = createElm(null, parentVNode, startIdx);
669
747
  if (childNode) {
670
748
  vnodes[startIdx].$elm$ = childNode;
671
749
  insertBefore(containerElm, childNode, referenceNode(before) );
@@ -752,7 +830,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
752
830
  if (idxInOld >= 0) {
753
831
  elmToMove = oldCh[idxInOld];
754
832
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
755
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
833
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
756
834
  } else {
757
835
  patch(elmToMove, newStartVnode, isInitialRender);
758
836
  oldCh[idxInOld] = void 0;
@@ -760,12 +838,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
760
838
  }
761
839
  newStartVnode = newCh[++newStartIdx];
762
840
  } else {
763
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
841
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
764
842
  newStartVnode = newCh[++newStartIdx];
765
843
  }
766
844
  if (node) {
767
845
  {
768
- insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
846
+ insertBefore(
847
+ referenceNode(oldStartVnode.$elm$).parentNode,
848
+ node,
849
+ referenceNode(oldStartVnode.$elm$)
850
+ );
769
851
  }
770
852
  }
771
853
  }
@@ -786,28 +868,19 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
786
868
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
787
869
  if (leftVNode.$tag$ === rightVNode.$tag$) {
788
870
  if (leftVNode.$tag$ === "slot") {
789
- if (
790
- // The component gets hydrated and no VDOM has been initialized.
791
- // Here the comparison can't happen as $name$ property is not set for `leftNode`.
792
- "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
793
- // hydration comments to be removed
794
- leftVNode.$elm$.nodeType !== 8
795
- ) {
796
- return false;
797
- }
798
871
  return leftVNode.$name$ === rightVNode.$name$;
799
872
  }
800
873
  if (!isInitialRender) {
801
874
  return leftVNode.$key$ === rightVNode.$key$;
802
875
  }
876
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
877
+ leftVNode.$key$ = rightVNode.$key$;
878
+ }
803
879
  return true;
804
880
  }
805
881
  return false;
806
882
  };
807
- var referenceNode = (node) => {
808
- return node && node["s-ol"] || node;
809
- };
810
- var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
883
+ var referenceNode = (node) => node && node["s-ol"] || node;
811
884
  var patch = (oldVNode, newVNode2, isInitialRender = false) => {
812
885
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
813
886
  const oldChildren = oldVNode.$children$;
@@ -846,41 +919,15 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
846
919
  elm.data = text;
847
920
  }
848
921
  };
849
- var updateFallbackSlotVisibility = (elm) => {
850
- const childNodes = elm.childNodes;
851
- for (const childNode of childNodes) {
852
- if (childNode.nodeType === 1 /* ElementNode */) {
853
- if (childNode["s-sr"]) {
854
- const slotName = childNode["s-sn"];
855
- childNode.hidden = false;
856
- for (const siblingNode of childNodes) {
857
- if (siblingNode !== childNode) {
858
- if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
859
- if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
860
- childNode.hidden = true;
861
- break;
862
- }
863
- } else {
864
- if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
865
- childNode.hidden = true;
866
- break;
867
- }
868
- }
869
- }
870
- }
871
- }
872
- updateFallbackSlotVisibility(childNode);
873
- }
874
- }
875
- };
876
922
  var relocateNodes = [];
877
923
  var markSlotContentForRelocation = (elm) => {
878
924
  let node;
879
925
  let hostContentNodes;
880
926
  let j;
881
- for (const childNode of elm.childNodes) {
927
+ const children = elm.__childNodes || elm.childNodes;
928
+ for (const childNode of children) {
882
929
  if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
883
- hostContentNodes = node.parentNode.childNodes;
930
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
884
931
  const slotName = childNode["s-sn"];
885
932
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
886
933
  node = hostContentNodes[j];
@@ -922,21 +969,6 @@ var markSlotContentForRelocation = (elm) => {
922
969
  }
923
970
  }
924
971
  };
925
- var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
926
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
927
- if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
928
- return true;
929
- }
930
- if (nodeToRelocate.getAttribute("slot") === slotName) {
931
- return true;
932
- }
933
- return false;
934
- }
935
- if (nodeToRelocate["s-sn"] === slotName) {
936
- return true;
937
- }
938
- return slotName === "";
939
- };
940
972
  var nullifyVNodeRefs = (vNode) => {
941
973
  {
942
974
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
@@ -944,8 +976,9 @@ var nullifyVNodeRefs = (vNode) => {
944
976
  }
945
977
  };
946
978
  var insertBefore = (parent, newNode, reference) => {
947
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
948
- return inserted;
979
+ {
980
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
981
+ }
949
982
  };
950
983
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
951
984
  var _a, _b, _c, _d;
@@ -971,9 +1004,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
971
1004
  rootVnode.$flags$ |= 4 /* isHost */;
972
1005
  hostRef.$vnode$ = rootVnode;
973
1006
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
974
- {
975
- scopeId = hostElm["s-sc"];
976
- }
977
1007
  useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
978
1008
  {
979
1009
  contentRef = hostElm["s-cr"];
@@ -1002,7 +1032,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1002
1032
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1003
1033
  while (orgLocationNode) {
1004
1034
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
1005
- if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) {
1035
+ if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
1006
1036
  refNode = refNode.nextSibling;
1007
1037
  while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
1008
1038
  refNode = refNode == null ? void 0 : refNode.nextSibling;
@@ -1015,13 +1045,15 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1015
1045
  orgLocationNode = orgLocationNode.previousSibling;
1016
1046
  }
1017
1047
  }
1018
- if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
1048
+ const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
1049
+ const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
1050
+ if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
1019
1051
  if (nodeToRelocate !== insertBeforeNode) {
1020
1052
  if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1021
1053
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1022
1054
  }
1023
1055
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
1024
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1056
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
1025
1057
  nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
1026
1058
  }
1027
1059
  }
@@ -1049,7 +1081,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1049
1081
  // src/runtime/update-component.ts
1050
1082
  var attachToAncestor = (hostRef, ancestorComponent) => {
1051
1083
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1052
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1084
+ const index = ancestorComponent["s-p"].push(
1085
+ new Promise(
1086
+ (r) => hostRef.$onRenderResolve$ = () => {
1087
+ ancestorComponent["s-p"].splice(index - 1, 1);
1088
+ r();
1089
+ }
1090
+ )
1091
+ );
1053
1092
  }
1054
1093
  };
1055
1094
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -1078,16 +1117,16 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1078
1117
  {
1079
1118
  hostRef.$flags$ |= 256 /* isListenReady */;
1080
1119
  if (hostRef.$queuedListeners$) {
1081
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1120
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
1082
1121
  hostRef.$queuedListeners$ = void 0;
1083
1122
  }
1084
1123
  }
1085
1124
  {
1086
- maybePromise = safeCall(instance, "componentWillLoad");
1125
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
1087
1126
  }
1088
1127
  }
1089
1128
  {
1090
- maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1129
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
1091
1130
  }
1092
1131
  endSchedule();
1093
1132
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
@@ -1155,7 +1194,7 @@ var postUpdateComponent = (hostRef) => {
1155
1194
  const instance = hostRef.$lazyInstance$ ;
1156
1195
  const ancestorComponent = hostRef.$ancestorComponent$;
1157
1196
  {
1158
- safeCall(instance, "componentDidRender");
1197
+ safeCall(instance, "componentDidRender", void 0, elm);
1159
1198
  }
1160
1199
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1161
1200
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -1189,12 +1228,12 @@ var appDidLoad = (who) => {
1189
1228
  }
1190
1229
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1191
1230
  };
1192
- var safeCall = (instance, method, arg) => {
1231
+ var safeCall = (instance, method, arg, elm) => {
1193
1232
  if (instance && instance[method]) {
1194
1233
  try {
1195
1234
  return instance[method](arg);
1196
1235
  } catch (e) {
1197
- consoleError(e);
1236
+ consoleError(e, elm);
1198
1237
  }
1199
1238
  }
1200
1239
  return void 0;
@@ -1253,15 +1292,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1253
1292
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1254
1293
  members.map(([memberName, [memberFlags]]) => {
1255
1294
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1295
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
1296
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
1297
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
1298
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
1299
+ Object.defineProperty(prototype, memberName, {
1300
+ get() {
1301
+ {
1302
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
1303
+ return getValue(this, memberName);
1304
+ }
1305
+ const ref = getHostRef(this);
1306
+ const instance = ref ? ref.$lazyInstance$ : prototype;
1307
+ if (!instance) return;
1308
+ return instance[memberName];
1309
+ }
1310
+ },
1311
+ configurable: true,
1312
+ enumerable: true
1313
+ });
1314
+ }
1256
1315
  Object.defineProperty(prototype, memberName, {
1257
- get() {
1258
- return getValue(this, memberName);
1259
- },
1260
1316
  set(newValue) {
1261
- setValue(this, memberName, newValue, cmpMeta);
1262
- },
1263
- configurable: true,
1264
- enumerable: true
1317
+ const ref = getHostRef(this);
1318
+ if (origSetter) {
1319
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1320
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1321
+ newValue = ref.$instanceValues$.get(memberName);
1322
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1323
+ ref.$instanceValues$.set(memberName, currentValue);
1324
+ }
1325
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1326
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1327
+ setValue(this, memberName, newValue, cmpMeta);
1328
+ return;
1329
+ }
1330
+ {
1331
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1332
+ setValue(this, memberName, newValue, cmpMeta);
1333
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1334
+ ref.$onReadyPromise$.then(() => {
1335
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1336
+ ref.$lazyInstance$[memberName] = newValue;
1337
+ }
1338
+ });
1339
+ }
1340
+ return;
1341
+ }
1342
+ const setterSetVal = () => {
1343
+ const currentValue = ref.$lazyInstance$[memberName];
1344
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
1345
+ ref.$instanceValues$.set(memberName, currentValue);
1346
+ }
1347
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1348
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1349
+ };
1350
+ if (ref.$lazyInstance$) {
1351
+ setterSetVal();
1352
+ } else {
1353
+ ref.$onReadyPromise$.then(() => setterSetVal());
1354
+ }
1355
+ }
1356
+ }
1265
1357
  });
1266
1358
  }
1267
1359
  });
@@ -1271,7 +1363,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1271
1363
  plt.jmp(() => {
1272
1364
  var _a2;
1273
1365
  const propName = attrNameToPropName.get(attrName);
1274
- if (this.hasOwnProperty(propName)) {
1366
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
1275
1367
  newValue = this[propName];
1276
1368
  delete this[propName];
1277
1369
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -1291,7 +1383,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1291
1383
  }
1292
1384
  return;
1293
1385
  }
1294
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1386
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1387
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1388
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1389
+ this[propName] = newValue;
1390
+ }
1295
1391
  });
1296
1392
  };
1297
1393
  Cstr.observedAttributes = Array.from(
@@ -1318,9 +1414,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1318
1414
  let Cstr;
1319
1415
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1320
1416
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1321
- const bundleId = cmpMeta.$lazyBundleId$;
1322
- if (bundleId) {
1323
- const CstrImport = loadModule(cmpMeta);
1417
+ {
1418
+ const CstrImport = loadModule(cmpMeta, hostRef);
1324
1419
  if (CstrImport && "then" in CstrImport) {
1325
1420
  const endLoad = uniqueTime();
1326
1421
  Cstr = await CstrImport;
@@ -1345,7 +1440,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1345
1440
  try {
1346
1441
  new Cstr(hostRef);
1347
1442
  } catch (e) {
1348
- consoleError(e);
1443
+ consoleError(e, elm);
1349
1444
  }
1350
1445
  {
1351
1446
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -1354,10 +1449,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1354
1449
  hostRef.$flags$ |= 128 /* isWatchReady */;
1355
1450
  }
1356
1451
  endNewInstance();
1357
- } else {
1358
- Cstr = elm.constructor;
1359
- const cmpTag = elm.localName;
1360
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1361
1452
  }
1362
1453
  if (Cstr && Cstr.style) {
1363
1454
  let style;
@@ -1380,7 +1471,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1380
1471
  schedule();
1381
1472
  }
1382
1473
  };
1383
- var fireConnectedCallback = (instance) => {
1474
+ var fireConnectedCallback = (instance, elm) => {
1384
1475
  };
1385
1476
 
1386
1477
  // src/runtime/connected-callback.ts
@@ -1434,7 +1525,7 @@ var setContentReference = (elm) => {
1434
1525
  contentRefElm["s-cn"] = true;
1435
1526
  insertBefore(elm, contentRefElm, elm.firstChild);
1436
1527
  };
1437
- var disconnectInstance = (instance) => {
1528
+ var disconnectInstance = (instance, elm) => {
1438
1529
  };
1439
1530
  var disconnectedCallback = async (elm) => {
1440
1531
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
@@ -1449,6 +1540,12 @@ var disconnectedCallback = async (elm) => {
1449
1540
  hostRef.$onReadyPromise$.then(() => disconnectInstance());
1450
1541
  }
1451
1542
  }
1543
+ if (rootAppliedStyles.has(elm)) {
1544
+ rootAppliedStyles.delete(elm);
1545
+ }
1546
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1547
+ rootAppliedStyles.delete(elm.shadowRoot);
1548
+ }
1452
1549
  };
1453
1550
 
1454
1551
  // src/runtime/bootstrap-lazy.ts
@@ -1533,6 +1630,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1533
1630
  }
1534
1631
  disconnectedCallback() {
1535
1632
  plt.jmp(() => disconnectedCallback(this));
1633
+ plt.raf(() => {
1634
+ var _a3;
1635
+ const hostRef = getHostRef(this);
1636
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1637
+ delete hostRef.$vnode$.$elm$;
1638
+ }
1639
+ });
1536
1640
  }
1537
1641
  componentOnReady() {
1538
1642
  return getHostRef(this).$onReadyPromise$;
@@ -1596,7 +1700,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1596
1700
  }
1597
1701
  }
1598
1702
  } catch (e) {
1599
- consoleError(e);
1703
+ consoleError(e, hostRef.$hostElement$);
1600
1704
  }
1601
1705
  };
1602
1706
  var getHostListenerTarget = (elm, flags) => {