lwc 2.5.10 → 2.6.3

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 (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +674 -471
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +674 -471
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +647 -446
  5. package/dist/engine-dom/iife/es5/engine-dom.js +737 -433
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +704 -408
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +674 -471
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +647 -446
  11. package/dist/engine-dom/umd/es5/engine-dom.js +737 -433
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +704 -408
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +754 -549
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
  16. package/dist/engine-server/esm/es2017/engine-server.js +754 -549
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +135 -140
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +135 -140
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +135 -140
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +146 -137
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +146 -137
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +135 -140
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +135 -140
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +146 -137
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +146 -137
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +11 -11
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +11 -11
  36. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service.js +11 -11
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +11 -11
  41. package/package.json +8 -8
@@ -305,7 +305,7 @@
305
305
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
306
306
  return attributeName;
307
307
  }
308
- /** version: 2.5.10 */
308
+ /** version: 2.6.3 */
309
309
 
310
310
  /*
311
311
  * Copyright (c) 2018, salesforce.com, inc.
@@ -419,8 +419,6 @@
419
419
  ENABLE_NODE_LIST_PATCH: null,
420
420
  ENABLE_HTML_COLLECTIONS_PATCH: null,
421
421
  ENABLE_NODE_PATCH: null,
422
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
423
- ENABLE_MIXED_SHADOW_MODE: null,
424
422
  ENABLE_WIRE_SYNC_EMIT: null
425
423
  };
426
424
 
@@ -485,7 +483,7 @@
485
483
  setFeatureFlag(name, value);
486
484
  }
487
485
  }
488
- /** version: 2.5.10 */
486
+ /** version: 2.6.3 */
489
487
 
490
488
  /* proxy-compat-disable */
491
489
 
@@ -559,6 +557,249 @@
559
557
  }
560
558
 
561
559
  return styleMap;
560
+ } //
561
+ // Primitives
562
+ //
563
+
564
+
565
+ let ssr$1;
566
+
567
+ function setSsr(ssrImpl) {
568
+ ssr$1 = ssrImpl;
569
+ }
570
+
571
+ let isNativeShadowDefined$1;
572
+
573
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
574
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
575
+ }
576
+
577
+ let isSyntheticShadowDefined$1;
578
+
579
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
580
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
581
+ }
582
+
583
+ let HTMLElementExported$1;
584
+
585
+ function setHTMLElement(HTMLElementImpl) {
586
+ HTMLElementExported$1 = HTMLElementImpl;
587
+ }
588
+
589
+ let isHydrating$1;
590
+
591
+ function setIsHydrating$1(isHydratingImpl) {
592
+ isHydrating$1 = isHydratingImpl;
593
+ }
594
+
595
+ let insert$1;
596
+
597
+ function setInsert(insertImpl) {
598
+ insert$1 = insertImpl;
599
+ }
600
+
601
+ let remove$1;
602
+
603
+ function setRemove(removeImpl) {
604
+ remove$1 = removeImpl;
605
+ }
606
+
607
+ let createElement$2;
608
+
609
+ function setCreateElement(createElementImpl) {
610
+ createElement$2 = createElementImpl;
611
+ }
612
+
613
+ let createText$1;
614
+
615
+ function setCreateText(createTextImpl) {
616
+ createText$1 = createTextImpl;
617
+ }
618
+
619
+ let createComment$1;
620
+
621
+ function setCreateComment(createCommentImpl) {
622
+ createComment$1 = createCommentImpl;
623
+ }
624
+
625
+ let nextSibling$1;
626
+
627
+ function setNextSibling(nextSiblingImpl) {
628
+ nextSibling$1 = nextSiblingImpl;
629
+ }
630
+
631
+ let attachShadow$1;
632
+
633
+ function setAttachShadow(attachShadowImpl) {
634
+ attachShadow$1 = attachShadowImpl;
635
+ }
636
+
637
+ let getProperty$1;
638
+
639
+ function setGetProperty(getPropertyImpl) {
640
+ getProperty$1 = getPropertyImpl;
641
+ }
642
+
643
+ let setProperty$1;
644
+
645
+ function setSetProperty(setPropertyImpl) {
646
+ setProperty$1 = setPropertyImpl;
647
+ }
648
+
649
+ let setText$1;
650
+
651
+ function setSetText(setTextImpl) {
652
+ setText$1 = setTextImpl;
653
+ }
654
+
655
+ let getAttribute$1;
656
+
657
+ function setGetAttribute(getAttributeImpl) {
658
+ getAttribute$1 = getAttributeImpl;
659
+ }
660
+
661
+ let setAttribute$1;
662
+
663
+ function setSetAttribute(setAttributeImpl) {
664
+ setAttribute$1 = setAttributeImpl;
665
+ }
666
+
667
+ let removeAttribute$1;
668
+
669
+ function setRemoveAttribute(removeAttributeImpl) {
670
+ removeAttribute$1 = removeAttributeImpl;
671
+ }
672
+
673
+ let addEventListener$1;
674
+
675
+ function setAddEventListener(addEventListenerImpl) {
676
+ addEventListener$1 = addEventListenerImpl;
677
+ }
678
+
679
+ let removeEventListener$1;
680
+
681
+ function setRemoveEventListener(removeEventListenerImpl) {
682
+ removeEventListener$1 = removeEventListenerImpl;
683
+ }
684
+
685
+ let dispatchEvent$1;
686
+
687
+ function setDispatchEvent(dispatchEventImpl) {
688
+ dispatchEvent$1 = dispatchEventImpl;
689
+ }
690
+
691
+ let getClassList$1;
692
+
693
+ function setGetClassList(getClassListImpl) {
694
+ getClassList$1 = getClassListImpl;
695
+ }
696
+
697
+ let setCSSStyleProperty$1;
698
+
699
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
700
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
701
+ }
702
+
703
+ let getBoundingClientRect$1;
704
+
705
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
706
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
707
+ }
708
+
709
+ let querySelector$1;
710
+
711
+ function setQuerySelector(querySelectorImpl) {
712
+ querySelector$1 = querySelectorImpl;
713
+ }
714
+
715
+ let querySelectorAll$1;
716
+
717
+ function setQuerySelectorAll(querySelectorAllImpl) {
718
+ querySelectorAll$1 = querySelectorAllImpl;
719
+ }
720
+
721
+ let getElementsByTagName$1;
722
+
723
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
724
+ getElementsByTagName$1 = getElementsByTagNameImpl;
725
+ }
726
+
727
+ let getElementsByClassName$1;
728
+
729
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
730
+ getElementsByClassName$1 = getElementsByClassNameImpl;
731
+ }
732
+
733
+ let getChildren$1;
734
+
735
+ function setGetChildren(getChildrenImpl) {
736
+ getChildren$1 = getChildrenImpl;
737
+ }
738
+
739
+ let getChildNodes$1;
740
+
741
+ function setGetChildNodes(getChildNodesImpl) {
742
+ getChildNodes$1 = getChildNodesImpl;
743
+ }
744
+
745
+ let getFirstChild$1;
746
+
747
+ function setGetFirstChild(getFirstChildImpl) {
748
+ getFirstChild$1 = getFirstChildImpl;
749
+ }
750
+
751
+ let getFirstElementChild$1;
752
+
753
+ function setGetFirstElementChild(getFirstElementChildImpl) {
754
+ getFirstElementChild$1 = getFirstElementChildImpl;
755
+ }
756
+
757
+ let getLastChild$1;
758
+
759
+ function setGetLastChild(getLastChildImpl) {
760
+ getLastChild$1 = getLastChildImpl;
761
+ }
762
+
763
+ let getLastElementChild$1;
764
+
765
+ function setGetLastElementChild(getLastElementChildImpl) {
766
+ getLastElementChild$1 = getLastElementChildImpl;
767
+ }
768
+
769
+ let isConnected$1;
770
+
771
+ function setIsConnected(isConnectedImpl) {
772
+ isConnected$1 = isConnectedImpl;
773
+ }
774
+
775
+ let insertGlobalStylesheet$1;
776
+
777
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
778
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
779
+ }
780
+
781
+ let insertStylesheet$1;
782
+
783
+ function setInsertStylesheet(insertStylesheetImpl) {
784
+ insertStylesheet$1 = insertStylesheetImpl;
785
+ }
786
+
787
+ let assertInstanceOfHTMLElement$1;
788
+
789
+ function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
790
+ assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
791
+ }
792
+
793
+ let defineCustomElement$1;
794
+
795
+ function setDefineCustomElement(defineCustomElementImpl) {
796
+ defineCustomElement$1 = defineCustomElementImpl;
797
+ }
798
+
799
+ let getCustomElement$1;
800
+
801
+ function setGetCustomElement(getCustomElementImpl) {
802
+ getCustomElement$1 = getCustomElementImpl;
562
803
  }
563
804
  /*
564
805
  * Copyright (c) 2019, salesforce.com, inc.
@@ -812,9 +1053,6 @@
812
1053
  elm,
813
1054
  data: {
814
1055
  on
815
- },
816
- owner: {
817
- renderer
818
1056
  }
819
1057
  } = vnode;
820
1058
 
@@ -827,7 +1065,7 @@
827
1065
  let name;
828
1066
 
829
1067
  for (name in on) {
830
- renderer.addEventListener(elm, name, listener);
1068
+ addEventListener$1(elm, name, listener);
831
1069
  }
832
1070
  }
833
1071
 
@@ -969,9 +1207,6 @@
969
1207
  const {
970
1208
  data: {
971
1209
  attrs
972
- },
973
- owner: {
974
- renderer
975
1210
  }
976
1211
  } = vnode;
977
1212
 
@@ -994,10 +1229,6 @@
994
1229
  }
995
1230
 
996
1231
  const elm = vnode.elm;
997
- const {
998
- setAttribute,
999
- removeAttribute
1000
- } = renderer;
1001
1232
  let key;
1002
1233
  oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
1003
1234
  // this routine is only useful for data-* attributes in all kind of elements
@@ -1012,14 +1243,14 @@
1012
1243
 
1013
1244
  if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
1014
1245
  // Assume xml namespace
1015
- setAttribute(elm, key, cur, xmlNS);
1246
+ setAttribute$1(elm, key, cur, xmlNS);
1016
1247
  } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
1017
1248
  // Assume xlink namespace
1018
- setAttribute(elm, key, cur, xlinkNS);
1019
- } else if (isNull(cur)) {
1020
- removeAttribute(elm, key);
1249
+ setAttribute$1(elm, key, cur, xlinkNS);
1250
+ } else if (isNull(cur) || isUndefined$1(cur)) {
1251
+ removeAttribute$1(elm, key);
1021
1252
  } else {
1022
- setAttribute(elm, key, cur);
1253
+ setAttribute$1(elm, key, cur);
1023
1254
  }
1024
1255
 
1025
1256
  lockAttribute();
@@ -1067,17 +1298,14 @@
1067
1298
  const isFirstPatch = isUndefined$1(oldProps);
1068
1299
  const {
1069
1300
  elm,
1070
- sel,
1071
- owner: {
1072
- renderer
1073
- }
1301
+ sel
1074
1302
  } = vnode;
1075
1303
 
1076
1304
  for (const key in props) {
1077
1305
  const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
1078
1306
 
1079
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1080
- renderer.setProperty(elm, key, cur);
1307
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
1308
+ setProperty$1(elm, key, cur);
1081
1309
  }
1082
1310
  }
1083
1311
  }
@@ -1146,9 +1374,6 @@
1146
1374
  elm,
1147
1375
  data: {
1148
1376
  className: newClass
1149
- },
1150
- owner: {
1151
- renderer
1152
1377
  }
1153
1378
  } = vnode;
1154
1379
  const {
@@ -1161,7 +1386,7 @@
1161
1386
  return;
1162
1387
  }
1163
1388
 
1164
- const classList = renderer.getClassList(elm);
1389
+ const classList = getClassList$1(elm);
1165
1390
  const newClassMap = getMapFromClassName(newClass);
1166
1391
  const oldClassMap = getMapFromClassName(oldClass);
1167
1392
  let name;
@@ -1199,24 +1424,17 @@
1199
1424
  elm,
1200
1425
  data: {
1201
1426
  style: newStyle
1202
- },
1203
- owner: {
1204
- renderer
1205
1427
  }
1206
1428
  } = vnode;
1207
- const {
1208
- setAttribute,
1209
- removeAttribute
1210
- } = renderer;
1211
1429
 
1212
1430
  if (oldVnode.data.style === newStyle) {
1213
1431
  return;
1214
1432
  }
1215
1433
 
1216
1434
  if (!isString(newStyle) || newStyle === '') {
1217
- removeAttribute(elm, 'style');
1435
+ removeAttribute$1(elm, 'style');
1218
1436
  } else {
1219
- setAttribute(elm, 'style', newStyle);
1437
+ setAttribute$1(elm, 'style', newStyle);
1220
1438
  }
1221
1439
  }
1222
1440
 
@@ -1241,9 +1459,6 @@
1241
1459
  elm,
1242
1460
  data: {
1243
1461
  classMap
1244
- },
1245
- owner: {
1246
- renderer
1247
1462
  }
1248
1463
  } = vnode;
1249
1464
 
@@ -1251,7 +1466,7 @@
1251
1466
  return;
1252
1467
  }
1253
1468
 
1254
- const classList = renderer.getClassList(elm);
1469
+ const classList = getClassList$1(elm);
1255
1470
 
1256
1471
  for (const name in classMap) {
1257
1472
  classList.add(name);
@@ -1275,9 +1490,6 @@
1275
1490
  elm,
1276
1491
  data: {
1277
1492
  styleDecls
1278
- },
1279
- owner: {
1280
- renderer
1281
1493
  }
1282
1494
  } = vnode;
1283
1495
 
@@ -1287,7 +1499,7 @@
1287
1499
 
1288
1500
  for (let i = 0; i < styleDecls.length; i++) {
1289
1501
  const [prop, value, important] = styleDecls[i];
1290
- renderer.setCSSStyleProperty(elm, prop, value, important);
1502
+ setCSSStyleProperty$1(elm, prop, value, important);
1291
1503
  }
1292
1504
  }
1293
1505
 
@@ -1301,15 +1513,6 @@
1301
1513
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1302
1514
  */
1303
1515
 
1304
- /**
1305
- @license
1306
- Copyright (c) 2015 Simon Friis Vindum.
1307
- This code may only be used under the MIT License found at
1308
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1309
- Code distributed by Snabbdom as part of the Snabbdom project at
1310
- https://github.com/snabbdom/snabbdom/
1311
- */
1312
-
1313
1516
  function isUndef(s) {
1314
1517
  return s === undefined;
1315
1518
  }
@@ -1397,7 +1600,7 @@
1397
1600
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1398
1601
  // Vnode moved right
1399
1602
  patchVnode(oldStartVnode, newEndVnode);
1400
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1603
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1401
1604
  oldStartVnode = oldCh[++oldStartIdx];
1402
1605
  newEndVnode = newCh[--newEndIdx];
1403
1606
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1879,7 +2082,7 @@
1879
2082
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1880
2083
  }
1881
2084
  /*
1882
- * Copyright (c) 2020, salesforce.com, inc.
2085
+ * Copyright (c) 2018, salesforce.com, inc.
1883
2086
  * All rights reserved.
1884
2087
  * SPDX-License-Identifier: MIT
1885
2088
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -1932,6 +2135,7 @@
1932
2135
  isArray
1933
2136
  } = Array;
1934
2137
  const {
2138
+ prototype: ObjectDotPrototype,
1935
2139
  getPrototypeOf,
1936
2140
  create: ObjectCreate,
1937
2141
  defineProperty: ObjectDefineProperty,
@@ -2581,8 +2785,6 @@
2581
2785
  init();
2582
2786
  }
2583
2787
 
2584
- const ObjectDotPrototype = Object.prototype;
2585
-
2586
2788
  function defaultValueIsObservable(value) {
2587
2789
  // intentionally checking for null
2588
2790
  if (value === null) {
@@ -2610,99 +2812,85 @@
2610
2812
  /* do nothing */
2611
2813
  };
2612
2814
 
2613
- const defaultValueDistortion = value => value;
2614
-
2615
2815
  function createShadowTarget(value) {
2616
2816
  return isArray(value) ? [] : {};
2617
2817
  }
2618
2818
 
2619
- class ReactiveMembrane {
2620
- constructor(options) {
2621
- this.valueDistortion = defaultValueDistortion;
2622
- this.valueMutated = defaultValueMutated;
2623
- this.valueObserved = defaultValueObserved;
2624
- this.valueIsObservable = defaultValueIsObservable;
2819
+ class ObservableMembrane {
2820
+ constructor(options = {}) {
2625
2821
  this.readOnlyObjectGraph = new WeakMap();
2626
2822
  this.reactiveObjectGraph = new WeakMap();
2627
-
2628
- if (!isUndefined(options)) {
2629
- const {
2630
- valueDistortion,
2631
- valueMutated,
2632
- valueObserved,
2633
- valueIsObservable,
2634
- tagPropertyKey
2635
- } = options;
2636
- this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
2637
- this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2638
- this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2639
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2640
- this.tagPropertyKey = tagPropertyKey;
2641
- }
2823
+ const {
2824
+ valueMutated,
2825
+ valueObserved,
2826
+ valueIsObservable,
2827
+ tagPropertyKey
2828
+ } = options;
2829
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2830
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2831
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2832
+ this.tagPropertyKey = tagPropertyKey;
2642
2833
  }
2643
2834
 
2644
2835
  getProxy(value) {
2645
2836
  const unwrappedValue = unwrap$1(value);
2646
- const distorted = this.valueDistortion(unwrappedValue);
2647
2837
 
2648
- if (this.valueIsObservable(distorted)) {
2649
- if (this.readOnlyObjectGraph.get(distorted) === value) {
2650
- // when trying to extract the writable version of a readonly
2651
- // we return the readonly.
2838
+ if (this.valueIsObservable(unwrappedValue)) {
2839
+ // When trying to extract the writable version of a readonly we return the readonly.
2840
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2652
2841
  return value;
2653
2842
  }
2654
2843
 
2655
- return this.getReactiveHandler(unwrappedValue, distorted);
2844
+ return this.getReactiveHandler(unwrappedValue);
2656
2845
  }
2657
2846
 
2658
- return distorted;
2847
+ return unwrappedValue;
2659
2848
  }
2660
2849
 
2661
2850
  getReadOnlyProxy(value) {
2662
2851
  value = unwrap$1(value);
2663
- const distorted = this.valueDistortion(value);
2664
2852
 
2665
- if (this.valueIsObservable(distorted)) {
2666
- return this.getReadOnlyHandler(value, distorted);
2853
+ if (this.valueIsObservable(value)) {
2854
+ return this.getReadOnlyHandler(value);
2667
2855
  }
2668
2856
 
2669
- return distorted;
2857
+ return value;
2670
2858
  }
2671
2859
 
2672
2860
  unwrapProxy(p) {
2673
2861
  return unwrap$1(p);
2674
2862
  }
2675
2863
 
2676
- getReactiveHandler(value, distortedValue) {
2677
- let proxy = this.reactiveObjectGraph.get(distortedValue);
2864
+ getReactiveHandler(value) {
2865
+ let proxy = this.reactiveObjectGraph.get(value);
2678
2866
 
2679
2867
  if (isUndefined(proxy)) {
2680
2868
  // caching the proxy after the first time it is accessed
2681
- const handler = new ReactiveProxyHandler(this, distortedValue);
2682
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2869
+ const handler = new ReactiveProxyHandler(this, value);
2870
+ proxy = new Proxy(createShadowTarget(value), handler);
2683
2871
  registerProxy(proxy, value);
2684
- this.reactiveObjectGraph.set(distortedValue, proxy);
2872
+ this.reactiveObjectGraph.set(value, proxy);
2685
2873
  }
2686
2874
 
2687
2875
  return proxy;
2688
2876
  }
2689
2877
 
2690
- getReadOnlyHandler(value, distortedValue) {
2691
- let proxy = this.readOnlyObjectGraph.get(distortedValue);
2878
+ getReadOnlyHandler(value) {
2879
+ let proxy = this.readOnlyObjectGraph.get(value);
2692
2880
 
2693
2881
  if (isUndefined(proxy)) {
2694
2882
  // caching the proxy after the first time it is accessed
2695
- const handler = new ReadOnlyHandler(this, distortedValue);
2696
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2883
+ const handler = new ReadOnlyHandler(this, value);
2884
+ proxy = new Proxy(createShadowTarget(value), handler);
2697
2885
  registerProxy(proxy, value);
2698
- this.readOnlyObjectGraph.set(distortedValue, proxy);
2886
+ this.readOnlyObjectGraph.set(value, proxy);
2699
2887
  }
2700
2888
 
2701
2889
  return proxy;
2702
2890
  }
2703
2891
 
2704
2892
  }
2705
- /** version: 1.1.5 */
2893
+ /** version: 2.0.0 */
2706
2894
 
2707
2895
  /*
2708
2896
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2713,15 +2901,9 @@
2713
2901
 
2714
2902
 
2715
2903
  const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2716
-
2717
- function valueDistortion(value) {
2718
- return value;
2719
- }
2720
-
2721
- const reactiveMembrane = new ReactiveMembrane({
2904
+ const reactiveMembrane = new ObservableMembrane({
2722
2905
  valueObserved,
2723
2906
  valueMutated,
2724
- valueDistortion,
2725
2907
  tagPropertyKey: lockerLivePropertyKey
2726
2908
  });
2727
2909
  /**
@@ -2730,16 +2912,9 @@
2730
2912
  * change or being removed.
2731
2913
  */
2732
2914
 
2733
- const unwrap = function (value) {
2734
- const unwrapped = reactiveMembrane.unwrapProxy(value);
2735
-
2736
- if (unwrapped !== value) {
2737
- // if value is a proxy, unwrap to access original value and apply distortion
2738
- return valueDistortion(unwrapped);
2739
- }
2740
-
2741
- return value;
2742
- };
2915
+ function unwrap(value) {
2916
+ return reactiveMembrane.unwrapProxy(value);
2917
+ }
2743
2918
  /*
2744
2919
  * Copyright (c) 2018, salesforce.com, inc.
2745
2920
  * All rights reserved.
@@ -2827,9 +3002,7 @@
2827
3002
 
2828
3003
 
2829
3004
  const LightningElement = function () {
2830
- var _a; // This should be as performant as possible, while any initialization should be done lazily
2831
-
2832
-
3005
+ // This should be as performant as possible, while any initialization should be done lazily
2833
3006
  if (isNull(vmBeingConstructed)) {
2834
3007
  throw new ReferenceError('Illegal constructor');
2835
3008
  }
@@ -2837,15 +3010,14 @@
2837
3010
  const vm = vmBeingConstructed;
2838
3011
  const {
2839
3012
  def,
2840
- elm,
2841
- renderer
3013
+ elm
2842
3014
  } = vm;
2843
3015
  const {
2844
3016
  bridge
2845
3017
  } = def;
2846
3018
 
2847
3019
  if (process.env.NODE_ENV !== 'production') {
2848
- (_a = renderer.assertInstanceOfHTMLElement) === null || _a === void 0 ? void 0 : _a.call(renderer, vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
3020
+ assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2849
3021
  }
2850
3022
 
2851
3023
  const component = this;
@@ -2875,7 +3047,7 @@
2875
3047
  if (vm.renderMode === 1
2876
3048
  /* Shadow */
2877
3049
  ) {
2878
- attachShadow(vm);
3050
+ doAttachShadow(vm);
2879
3051
  } // Adding extra guard rails in DEV mode.
2880
3052
 
2881
3053
 
@@ -2887,17 +3059,16 @@
2887
3059
  return this;
2888
3060
  };
2889
3061
 
2890
- function attachShadow(vm) {
3062
+ function doAttachShadow(vm) {
2891
3063
  const {
2892
3064
  elm,
2893
3065
  mode,
2894
- renderer,
2895
3066
  shadowMode,
2896
3067
  def: {
2897
3068
  ctor
2898
3069
  }
2899
3070
  } = vm;
2900
- const cmpRoot = renderer.attachShadow(elm, {
3071
+ const cmpRoot = attachShadow$1(elm, {
2901
3072
  [KEY__SYNTHETIC_MODE]: shadowMode === 1
2902
3073
  /* Synthetic */
2903
3074
  ,
@@ -2924,21 +3095,15 @@
2924
3095
 
2925
3096
  dispatchEvent(event) {
2926
3097
  const {
2927
- elm,
2928
- renderer: {
2929
- dispatchEvent
2930
- }
3098
+ elm
2931
3099
  } = getAssociatedVM(this);
2932
- return dispatchEvent(elm, event);
3100
+ return dispatchEvent$1(elm, event);
2933
3101
  },
2934
3102
 
2935
3103
  addEventListener(type, listener, options) {
2936
3104
  const vm = getAssociatedVM(this);
2937
3105
  const {
2938
- elm,
2939
- renderer: {
2940
- addEventListener
2941
- }
3106
+ elm
2942
3107
  } = vm;
2943
3108
 
2944
3109
  if (process.env.NODE_ENV !== 'production') {
@@ -2949,92 +3114,68 @@
2949
3114
  }
2950
3115
 
2951
3116
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2952
- addEventListener(elm, type, wrappedListener, options);
3117
+ addEventListener$1(elm, type, wrappedListener, options);
2953
3118
  },
2954
3119
 
2955
3120
  removeEventListener(type, listener, options) {
2956
3121
  const vm = getAssociatedVM(this);
2957
3122
  const {
2958
- elm,
2959
- renderer: {
2960
- removeEventListener
2961
- }
3123
+ elm
2962
3124
  } = vm;
2963
3125
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2964
- removeEventListener(elm, type, wrappedListener, options);
3126
+ removeEventListener$1(elm, type, wrappedListener, options);
2965
3127
  },
2966
3128
 
2967
3129
  hasAttribute(name) {
2968
3130
  const {
2969
- elm,
2970
- renderer: {
2971
- getAttribute
2972
- }
3131
+ elm
2973
3132
  } = getAssociatedVM(this);
2974
- return !isNull(getAttribute(elm, name));
3133
+ return !isNull(getAttribute$1(elm, name));
2975
3134
  },
2976
3135
 
2977
3136
  hasAttributeNS(namespace, name) {
2978
3137
  const {
2979
- elm,
2980
- renderer: {
2981
- getAttribute
2982
- }
3138
+ elm
2983
3139
  } = getAssociatedVM(this);
2984
- return !isNull(getAttribute(elm, name, namespace));
3140
+ return !isNull(getAttribute$1(elm, name, namespace));
2985
3141
  },
2986
3142
 
2987
3143
  removeAttribute(name) {
2988
3144
  const {
2989
- elm,
2990
- renderer: {
2991
- removeAttribute
2992
- }
3145
+ elm
2993
3146
  } = getAssociatedVM(this);
2994
3147
  unlockAttribute(elm, name);
2995
- removeAttribute(elm, name);
3148
+ removeAttribute$1(elm, name);
2996
3149
  lockAttribute();
2997
3150
  },
2998
3151
 
2999
3152
  removeAttributeNS(namespace, name) {
3000
3153
  const {
3001
- elm,
3002
- renderer: {
3003
- removeAttribute
3004
- }
3154
+ elm
3005
3155
  } = getAssociatedVM(this);
3006
3156
  unlockAttribute(elm, name);
3007
- removeAttribute(elm, name, namespace);
3157
+ removeAttribute$1(elm, name, namespace);
3008
3158
  lockAttribute();
3009
3159
  },
3010
3160
 
3011
3161
  getAttribute(name) {
3012
3162
  const {
3013
- elm,
3014
- renderer: {
3015
- getAttribute
3016
- }
3163
+ elm
3017
3164
  } = getAssociatedVM(this);
3018
- return getAttribute(elm, name);
3165
+ return getAttribute$1(elm, name);
3019
3166
  },
3020
3167
 
3021
3168
  getAttributeNS(namespace, name) {
3022
3169
  const {
3023
- elm,
3024
- renderer: {
3025
- getAttribute
3026
- }
3170
+ elm
3027
3171
  } = getAssociatedVM(this);
3028
- return getAttribute(elm, name, namespace);
3172
+ return getAttribute$1(elm, name, namespace);
3029
3173
  },
3030
3174
 
3031
3175
  setAttribute(name, value) {
3032
3176
  const vm = getAssociatedVM(this);
3033
3177
  const {
3034
- elm,
3035
- renderer: {
3036
- setAttribute
3037
- }
3178
+ elm
3038
3179
  } = vm;
3039
3180
 
3040
3181
  if (process.env.NODE_ENV !== 'production') {
@@ -3042,17 +3183,14 @@
3042
3183
  }
3043
3184
 
3044
3185
  unlockAttribute(elm, name);
3045
- setAttribute(elm, name, value);
3186
+ setAttribute$1(elm, name, value);
3046
3187
  lockAttribute();
3047
3188
  },
3048
3189
 
3049
3190
  setAttributeNS(namespace, name, value) {
3050
3191
  const vm = getAssociatedVM(this);
3051
3192
  const {
3052
- elm,
3053
- renderer: {
3054
- setAttribute
3055
- }
3193
+ elm
3056
3194
  } = vm;
3057
3195
 
3058
3196
  if (process.env.NODE_ENV !== 'production') {
@@ -3060,43 +3198,34 @@
3060
3198
  }
3061
3199
 
3062
3200
  unlockAttribute(elm, name);
3063
- setAttribute(elm, name, value, namespace);
3201
+ setAttribute$1(elm, name, value, namespace);
3064
3202
  lockAttribute();
3065
3203
  },
3066
3204
 
3067
3205
  getBoundingClientRect() {
3068
3206
  const vm = getAssociatedVM(this);
3069
3207
  const {
3070
- elm,
3071
- renderer: {
3072
- getBoundingClientRect
3073
- }
3208
+ elm
3074
3209
  } = vm;
3075
3210
 
3076
3211
  if (process.env.NODE_ENV !== 'production') {
3077
3212
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
3078
3213
  }
3079
3214
 
3080
- return getBoundingClientRect(elm);
3215
+ return getBoundingClientRect$1(elm);
3081
3216
  },
3082
3217
 
3083
3218
  get isConnected() {
3084
3219
  const {
3085
- elm,
3086
- renderer: {
3087
- isConnected
3088
- }
3220
+ elm
3089
3221
  } = getAssociatedVM(this);
3090
- return isConnected(elm);
3222
+ return isConnected$1(elm);
3091
3223
  },
3092
3224
 
3093
3225
  get classList() {
3094
3226
  const vm = getAssociatedVM(this);
3095
3227
  const {
3096
- elm,
3097
- renderer: {
3098
- getClassList
3099
- }
3228
+ elm
3100
3229
  } = vm;
3101
3230
 
3102
3231
  if (process.env.NODE_ENV !== 'production') {
@@ -3105,7 +3234,7 @@
3105
3234
  assert.isFalse(isBeingConstructed(vm), `Failed to construct ${vm}: The result must not have attributes. Adding or tampering with classname in constructor is not allowed in a web component, use connectedCallback() instead.`);
3106
3235
  }
3107
3236
 
3108
- return getClassList(elm);
3237
+ return getClassList$1(elm);
3109
3238
  },
3110
3239
 
3111
3240
  get template() {
@@ -3139,23 +3268,48 @@
3139
3268
  }
3140
3269
 
3141
3270
  };
3142
- const queryAndChildGetterDescriptors = create(null);
3143
- const childGetters = [['children', 'getChildren'], ['childNodes', 'getChildNodes'], ['firstChild', 'getFirstChild'], ['firstElementChild', 'getFirstElementChild'], ['lastChild', 'getLastChild'], ['lastElementChild', 'getLastElementChild']]; // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
3271
+ const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
3272
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
3273
+ // object representing the renderer, with a lot of methods we don't actually need.
3274
+
3275
+ const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
3276
+
3277
+ function getChildGetter(methodName) {
3278
+ switch (methodName) {
3279
+ case 'children':
3280
+ return getChildren$1;
3281
+
3282
+ case 'childNodes':
3283
+ return getChildNodes$1;
3284
+
3285
+ case 'firstChild':
3286
+ return getFirstChild$1;
3287
+
3288
+ case 'firstElementChild':
3289
+ return getFirstElementChild$1;
3290
+
3291
+ case 'lastChild':
3292
+ return getLastChild$1;
3293
+
3294
+ case 'lastElementChild':
3295
+ return getLastElementChild$1;
3296
+ }
3297
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
3298
+
3144
3299
 
3145
- for (const [elementProp, rendererMethod] of childGetters) {
3146
- queryAndChildGetterDescriptors[elementProp] = {
3300
+ for (const childGetter of childGetters) {
3301
+ queryAndChildGetterDescriptors[childGetter] = {
3147
3302
  get() {
3148
3303
  const vm = getAssociatedVM(this);
3149
3304
  const {
3150
- elm,
3151
- renderer
3305
+ elm
3152
3306
  } = vm;
3153
3307
 
3154
3308
  if (process.env.NODE_ENV !== 'production') {
3155
- warnIfInvokedDuringConstruction(vm, elementProp);
3309
+ warnIfInvokedDuringConstruction(vm, childGetter);
3156
3310
  }
3157
3311
 
3158
- return renderer[rendererMethod](elm);
3312
+ return getChildGetter(childGetter)(elm);
3159
3313
  },
3160
3314
 
3161
3315
  configurable: true,
@@ -3163,22 +3317,38 @@
3163
3317
  };
3164
3318
  }
3165
3319
 
3166
- const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
3320
+ const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
3321
+
3322
+ function getQueryMethod(methodName) {
3323
+ switch (methodName) {
3324
+ case 'getElementsByClassName':
3325
+ return getElementsByClassName$1;
3326
+
3327
+ case 'getElementsByTagName':
3328
+ return getElementsByTagName$1;
3329
+
3330
+ case 'querySelector':
3331
+ return querySelector$1;
3332
+
3333
+ case 'querySelectorAll':
3334
+ return querySelectorAll$1;
3335
+ }
3336
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
3337
+
3167
3338
 
3168
3339
  for (const queryMethod of queryMethods) {
3169
3340
  queryAndChildGetterDescriptors[queryMethod] = {
3170
3341
  value(arg) {
3171
3342
  const vm = getAssociatedVM(this);
3172
3343
  const {
3173
- elm,
3174
- renderer
3344
+ elm
3175
3345
  } = vm;
3176
3346
 
3177
3347
  if (process.env.NODE_ENV !== 'production') {
3178
3348
  warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
3179
3349
  }
3180
3350
 
3181
- return renderer[queryMethod](elm, arg);
3351
+ return getQueryMethod(queryMethod)(elm, arg);
3182
3352
  },
3183
3353
 
3184
3354
  configurable: true,
@@ -4334,10 +4504,6 @@
4334
4504
 
4335
4505
  assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
4336
4506
 
4337
- if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
4338
- assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
4339
- }
4340
-
4341
4507
  if (!isUndefined$1(ctorShadowSupportMode)) {
4342
4508
  assert.invariant(ctorShadowSupportMode === "any"
4343
4509
  /* Any */
@@ -4581,17 +4747,14 @@
4581
4747
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
4582
4748
 
4583
4749
  if (!isUndefined$1(token) && context.hasScopedStyles) {
4584
- owner.renderer.getClassList(elm).add(token);
4750
+ getClassList$1(elm).add(token);
4585
4751
  }
4586
4752
  }
4587
4753
 
4588
4754
  function updateNodeHook(oldVnode, vnode) {
4589
4755
  const {
4590
4756
  elm,
4591
- text,
4592
- owner: {
4593
- renderer
4594
- }
4757
+ text
4595
4758
  } = vnode;
4596
4759
 
4597
4760
  if (oldVnode.text !== text) {
@@ -4599,7 +4762,7 @@
4599
4762
  unlockDomMutation();
4600
4763
  }
4601
4764
 
4602
- renderer.setText(elm, text);
4765
+ setText$1(elm, text);
4603
4766
 
4604
4767
  if (process.env.NODE_ENV !== 'production') {
4605
4768
  lockDomMutation();
@@ -4608,15 +4771,11 @@
4608
4771
  }
4609
4772
 
4610
4773
  function insertNodeHook(vnode, parentNode, referenceNode) {
4611
- const {
4612
- renderer
4613
- } = vnode.owner;
4614
-
4615
4774
  if (process.env.NODE_ENV !== 'production') {
4616
4775
  unlockDomMutation();
4617
4776
  }
4618
4777
 
4619
- renderer.insert(vnode.elm, parentNode, referenceNode);
4778
+ insert$1(vnode.elm, parentNode, referenceNode);
4620
4779
 
4621
4780
  if (process.env.NODE_ENV !== 'production') {
4622
4781
  lockDomMutation();
@@ -4624,15 +4783,11 @@
4624
4783
  }
4625
4784
 
4626
4785
  function removeNodeHook(vnode, parentNode) {
4627
- const {
4628
- renderer
4629
- } = vnode.owner;
4630
-
4631
4786
  if (process.env.NODE_ENV !== 'production') {
4632
4787
  unlockDomMutation();
4633
4788
  }
4634
4789
 
4635
- renderer.remove(vnode.elm, parentNode);
4790
+ remove$1(vnode.elm, parentNode);
4636
4791
 
4637
4792
  if (process.env.NODE_ENV !== 'production') {
4638
4793
  lockDomMutation();
@@ -4724,13 +4879,15 @@
4724
4879
 
4725
4880
  function updateChildrenHook(oldVnode, vnode) {
4726
4881
  const {
4727
- children,
4728
- owner
4882
+ elm,
4883
+ children
4729
4884
  } = vnode;
4730
- const fn = hasDynamicChildren(children) ? updateDynamicChildren : updateStaticChildren;
4731
- runWithBoundaryProtection(owner, owner.owner, noop, () => {
4732
- fn(vnode.elm, oldVnode.children, children);
4733
- }, noop);
4885
+
4886
+ if (hasDynamicChildren(children)) {
4887
+ updateDynamicChildren(elm, oldVnode.children, children);
4888
+ } else {
4889
+ updateStaticChildren(elm, oldVnode.children, children);
4890
+ }
4734
4891
  }
4735
4892
 
4736
4893
  function allocateChildrenHook(vnode, vm) {
@@ -4796,8 +4953,7 @@
4796
4953
  createVM(elm, def, {
4797
4954
  mode,
4798
4955
  owner,
4799
- tagName: sel,
4800
- renderer: owner.renderer
4956
+ tagName: sel
4801
4957
  });
4802
4958
 
4803
4959
  if (process.env.NODE_ENV !== 'production') {
@@ -4843,16 +4999,13 @@
4843
4999
  const {
4844
5000
  data: {
4845
5001
  attrs = {}
4846
- },
4847
- owner: {
4848
- renderer
4849
5002
  }
4850
5003
  } = vnode;
4851
5004
  let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
4852
5005
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
4853
5006
 
4854
5007
  for (const [attrName, attrValue] of Object.entries(attrs)) {
4855
- const elmAttrValue = renderer.getAttribute(elm, attrName);
5008
+ const elmAttrValue = getAttribute$1(elm, attrName);
4856
5009
 
4857
5010
  if (String(attrValue) !== elmAttrValue) {
4858
5011
  logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
@@ -4868,9 +5021,6 @@
4868
5021
  data: {
4869
5022
  className,
4870
5023
  classMap
4871
- },
4872
- owner: {
4873
- renderer
4874
5024
  }
4875
5025
  } = vnode;
4876
5026
  let nodesAreCompatible = true;
@@ -4882,7 +5032,7 @@
4882
5032
  vnodeClassName = className;
4883
5033
  } else if (!isUndefined$1(classMap)) {
4884
5034
  // classMap is used when class is set to static value.
4885
- const classList = renderer.getClassList(elm);
5035
+ const classList = getClassList$1(elm);
4886
5036
  let computedClassName = ''; // all classes from the vnode should be in the element.classList
4887
5037
 
4888
5038
  for (const name in classMap) {
@@ -4912,12 +5062,9 @@
4912
5062
  data: {
4913
5063
  style,
4914
5064
  styleDecls
4915
- },
4916
- owner: {
4917
- renderer
4918
5065
  }
4919
5066
  } = vnode;
4920
- const elmStyle = renderer.getAttribute(elm, 'style') || '';
5067
+ const elmStyle = getAttribute$1(elm, 'style') || '';
4921
5068
  let vnodeStyle;
4922
5069
  let nodesAreCompatible = true;
4923
5070
 
@@ -5054,12 +5201,12 @@
5054
5201
  */
5055
5202
 
5056
5203
 
5057
- function getUpgradableConstructor(tagName, renderer) {
5204
+ function getUpgradableConstructor(tagName) {
5058
5205
  // Should never get a tag with upper case letter at this point, the compiler should
5059
5206
  // produce only tags with lowercase letters
5060
5207
  // But, for backwards compatibility, we will lower case the tagName
5061
5208
  tagName = tagName.toLowerCase();
5062
- let CE = renderer.getCustomElement(tagName);
5209
+ let CE = getCustomElement$1(tagName);
5063
5210
 
5064
5211
  if (!isUndefined$1(CE)) {
5065
5212
  return CE;
@@ -5070,7 +5217,7 @@
5070
5217
  */
5071
5218
 
5072
5219
 
5073
- CE = class LWCUpgradableElement extends renderer.HTMLElement {
5220
+ CE = class LWCUpgradableElement extends HTMLElementExported$1 {
5074
5221
  constructor(upgradeCallback) {
5075
5222
  super();
5076
5223
 
@@ -5080,7 +5227,7 @@
5080
5227
  }
5081
5228
 
5082
5229
  };
5083
- renderer.defineCustomElement(tagName, CE);
5230
+ defineCustomElement$1(tagName, CE);
5084
5231
  return CE;
5085
5232
  }
5086
5233
  /*
@@ -5098,10 +5245,7 @@
5098
5245
  const {
5099
5246
  owner
5100
5247
  } = vnode;
5101
- const {
5102
- renderer
5103
- } = owner;
5104
- const elm = renderer.createText(vnode.text);
5248
+ const elm = createText$1(vnode.text);
5105
5249
  linkNodeToShadow(elm, owner);
5106
5250
  vnode.elm = elm;
5107
5251
  },
@@ -5135,10 +5279,7 @@
5135
5279
  owner,
5136
5280
  text
5137
5281
  } = vnode;
5138
- const {
5139
- renderer
5140
- } = owner;
5141
- const elm = renderer.createComment(text);
5282
+ const elm = createComment$1(text);
5142
5283
  linkNodeToShadow(elm, owner);
5143
5284
  vnode.elm = elm;
5144
5285
  },
@@ -5180,11 +5321,8 @@
5180
5321
  svg
5181
5322
  }
5182
5323
  } = vnode;
5183
- const {
5184
- renderer
5185
- } = owner;
5186
5324
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
5187
- const elm = renderer.createElement(sel, namespace);
5325
+ const elm = createElement$2(sel, namespace);
5188
5326
  linkNodeToShadow(elm, owner);
5189
5327
  fallbackElmHook(elm, vnode);
5190
5328
  vnode.elm = elm;
@@ -5244,10 +5382,7 @@
5244
5382
  sel,
5245
5383
  owner
5246
5384
  } = vnode;
5247
- const {
5248
- renderer
5249
- } = owner;
5250
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5385
+ const UpgradableConstructor = getUpgradableConstructor(sel);
5251
5386
  /**
5252
5387
  * Note: if the upgradable constructor does not expect, or throw when we new it
5253
5388
  * with a callback as the first argument, we could implement a more advanced
@@ -5340,8 +5475,7 @@
5340
5475
  createVM(elm, def, {
5341
5476
  mode,
5342
5477
  owner,
5343
- tagName: sel,
5344
- renderer: owner.renderer
5478
+ tagName: sel
5345
5479
  });
5346
5480
  vnode.elm = elm;
5347
5481
  const vm = getAssociatedVM(elm);
@@ -5370,12 +5504,11 @@
5370
5504
 
5371
5505
  function linkNodeToShadow(elm, owner) {
5372
5506
  const {
5373
- renderer,
5374
5507
  renderMode,
5375
5508
  shadowMode
5376
5509
  } = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
5377
5510
 
5378
- if (renderer.isSyntheticShadowDefined) {
5511
+ if (isSyntheticShadowDefined$1) {
5379
5512
  if (shadowMode === 1
5380
5513
  /* Synthetic */
5381
5514
  || renderMode === 0
@@ -5907,7 +6040,6 @@
5907
6040
  const {
5908
6041
  elm,
5909
6042
  context,
5910
- renderer,
5911
6043
  renderMode,
5912
6044
  shadowMode
5913
6045
  } = vm;
@@ -5934,11 +6066,11 @@
5934
6066
  } = context;
5935
6067
 
5936
6068
  if (oldHasTokenInClass) {
5937
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
6069
+ getClassList$1(elm).remove(makeHostToken(oldToken));
5938
6070
  }
5939
6071
 
5940
6072
  if (oldHasTokenInAttribute) {
5941
- renderer.removeAttribute(elm, makeHostToken(oldToken));
6073
+ removeAttribute$1(elm, makeHostToken(oldToken));
5942
6074
  } // Apply the new template styling token to the host element, if the new template has any
5943
6075
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
5944
6076
 
@@ -5950,12 +6082,12 @@
5950
6082
 
5951
6083
  if (!isUndefined$1(newToken)) {
5952
6084
  if (hasScopedStyles) {
5953
- renderer.getClassList(elm).add(makeHostToken(newToken));
6085
+ getClassList$1(elm).add(makeHostToken(newToken));
5954
6086
  newHasTokenInClass = true;
5955
6087
  }
5956
6088
 
5957
6089
  if (isSyntheticShadow) {
5958
- renderer.setAttribute(elm, makeHostToken(newToken), '');
6090
+ setAttribute$1(elm, makeHostToken(newToken), '');
5959
6091
  newHasTokenInAttribute = true;
5960
6092
  }
5961
6093
  } // Update the styling tokens present on the context object.
@@ -5968,6 +6100,7 @@
5968
6100
 
5969
6101
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5970
6102
  const content = [];
6103
+ let root;
5971
6104
 
5972
6105
  for (let i = 0; i < stylesheets.length; i++) {
5973
6106
  let stylesheet = stylesheets[i];
@@ -5980,23 +6113,46 @@
5980
6113
  // the component instance might be attempting to use an old version of
5981
6114
  // the stylesheet, while internally, we have a replacement for it.
5982
6115
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5983
- } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5984
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
6116
+ }
5985
6117
 
6118
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
6119
+
6120
+ const scopeToken = isScopedCss || vm.shadowMode === 1
6121
+ /* Synthetic */
6122
+ && vm.renderMode === 1
6123
+ /* Shadow */
6124
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
6125
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5986
6126
 
5987
- const isScopedCss = stylesheet[KEY__SCOPED_CSS];
5988
6127
  const useActualHostSelector = vm.renderMode === 0
5989
6128
  /* Light */
5990
6129
  ? !isScopedCss : vm.shadowMode === 0
5991
6130
  /* Native */
5992
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
6131
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
6132
+ // we use an attribute selector on the host to simulate :dir().
5993
6133
 
5994
- const scopeToken = isScopedCss || vm.shadowMode === 1
5995
- /* Synthetic */
5996
- && vm.renderMode === 1
6134
+ let useNativeDirPseudoclass;
6135
+
6136
+ if (vm.renderMode === 1
5997
6137
  /* Shadow */
5998
- ? stylesheetToken : undefined;
5999
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
6138
+ ) {
6139
+ useNativeDirPseudoclass = vm.shadowMode === 0
6140
+ /* Native */
6141
+ ;
6142
+ } else {
6143
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
6144
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
6145
+ if (isUndefined$1(root)) {
6146
+ // Only calculate the root once as necessary
6147
+ root = getNearestShadowComponent(vm);
6148
+ }
6149
+
6150
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
6151
+ /* Native */
6152
+ ;
6153
+ }
6154
+
6155
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
6000
6156
  }
6001
6157
  }
6002
6158
 
@@ -6020,14 +6176,12 @@
6020
6176
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
6021
6177
 
6022
6178
 
6023
- function getNearestNativeShadowComponent(vm) {
6179
+ function getNearestShadowComponent(vm) {
6024
6180
  let owner = vm;
6025
6181
 
6026
6182
  while (!isNull(owner)) {
6027
6183
  if (owner.renderMode === 1
6028
6184
  /* Shadow */
6029
- && owner.shadowMode === 0
6030
- /* Native */
6031
6185
  ) {
6032
6186
  return owner;
6033
6187
  }
@@ -6038,9 +6192,22 @@
6038
6192
  return owner;
6039
6193
  }
6040
6194
 
6195
+ function getNearestNativeShadowComponent(vm) {
6196
+ const owner = getNearestShadowComponent(vm);
6197
+
6198
+ if (!isNull(owner) && owner.shadowMode === 1
6199
+ /* Synthetic */
6200
+ ) {
6201
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
6202
+ // synthetic, we know we won't find a native component if we go any further.
6203
+ return null;
6204
+ }
6205
+
6206
+ return owner;
6207
+ }
6208
+
6041
6209
  function createStylesheet(vm, stylesheets) {
6042
6210
  const {
6043
- renderer,
6044
6211
  renderMode,
6045
6212
  shadowMode
6046
6213
  } = vm;
@@ -6051,9 +6218,9 @@
6051
6218
  /* Synthetic */
6052
6219
  ) {
6053
6220
  for (let i = 0; i < stylesheets.length; i++) {
6054
- renderer.insertGlobalStylesheet(stylesheets[i]);
6221
+ insertGlobalStylesheet$1(stylesheets[i]);
6055
6222
  }
6056
- } else if (renderer.ssr || renderer.isHydrating()) {
6223
+ } else if (ssr$1 || isHydrating$1()) {
6057
6224
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
6058
6225
  // This works in the client, because the stylesheets are created, and cached in the VM
6059
6226
  // the first time the VM renders.
@@ -6067,10 +6234,10 @@
6067
6234
 
6068
6235
  for (let i = 0; i < stylesheets.length; i++) {
6069
6236
  if (isGlobal) {
6070
- renderer.insertGlobalStylesheet(stylesheets[i]);
6237
+ insertGlobalStylesheet$1(stylesheets[i]);
6071
6238
  } else {
6072
6239
  // local level
6073
- renderer.insertStylesheet(stylesheets[i], root.cmpRoot);
6240
+ insertStylesheet$1(stylesheets[i], root.cmpRoot);
6074
6241
  }
6075
6242
  }
6076
6243
  }
@@ -6155,7 +6322,7 @@
6155
6322
  if (isProfilerEnabled) {
6156
6323
  currentDispatcher(opId, 0
6157
6324
  /* Start */
6158
- , vm.tagName, vm.idx);
6325
+ , vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6159
6326
  }
6160
6327
  }
6161
6328
 
@@ -6169,7 +6336,7 @@
6169
6336
  if (isProfilerEnabled) {
6170
6337
  currentDispatcher(opId, 1
6171
6338
  /* Stop */
6172
- , vm.tagName, vm.idx);
6339
+ , vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6173
6340
  }
6174
6341
  }
6175
6342
 
@@ -6183,7 +6350,7 @@
6183
6350
  if (isProfilerEnabled) {
6184
6351
  currentDispatcher(opId, 0
6185
6352
  /* Start */
6186
- , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
6353
+ , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
6187
6354
  }
6188
6355
  }
6189
6356
 
@@ -6197,7 +6364,7 @@
6197
6364
  if (isProfilerEnabled) {
6198
6365
  currentDispatcher(opId, 1
6199
6366
  /* Stop */
6200
- , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
6367
+ , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
6201
6368
  }
6202
6369
  }
6203
6370
  /*
@@ -6762,7 +6929,6 @@
6762
6929
  const {
6763
6930
  mode,
6764
6931
  owner,
6765
- renderer,
6766
6932
  tagName
6767
6933
  } = options;
6768
6934
  const vm = {
@@ -6777,7 +6943,6 @@
6777
6943
  tagName,
6778
6944
  mode,
6779
6945
  owner,
6780
- renderer,
6781
6946
  children: EmptyArray,
6782
6947
  aChildren: EmptyArray,
6783
6948
  velements: EmptyArray,
@@ -6832,16 +6997,11 @@
6832
6997
 
6833
6998
  function computeShadowMode(vm) {
6834
6999
  const {
6835
- def,
6836
- renderer
7000
+ def
6837
7001
  } = vm;
6838
- const {
6839
- isNativeShadowDefined,
6840
- isSyntheticShadowDefined
6841
- } = renderer;
6842
7002
  let shadowMode;
6843
7003
 
6844
- if (isSyntheticShadowDefined) {
7004
+ if (isSyntheticShadowDefined$1) {
6845
7005
  if (def.renderMode === 0
6846
7006
  /* Light */
6847
7007
  ) {
@@ -6850,7 +7010,7 @@
6850
7010
  shadowMode = 0
6851
7011
  /* Native */
6852
7012
  ;
6853
- } else if (isNativeShadowDefined) {
7013
+ } else if (isNativeShadowDefined$1) {
6854
7014
  if (def.shadowSupportMode === "any"
6855
7015
  /* Any */
6856
7016
  ) {
@@ -6990,13 +7150,12 @@
6990
7150
 
6991
7151
  function runRenderedCallback(vm) {
6992
7152
  const {
6993
- renderer,
6994
7153
  def: {
6995
7154
  renderedCallback
6996
7155
  }
6997
7156
  } = vm;
6998
7157
 
6999
- if (isTrue(renderer.ssr)) {
7158
+ if (isTrue(ssr$1)) {
7000
7159
  return;
7001
7160
  }
7002
7161
 
@@ -7222,8 +7381,7 @@
7222
7381
 
7223
7382
  function resetComponentRoot(vm) {
7224
7383
  const {
7225
- children,
7226
- renderer
7384
+ children
7227
7385
  } = vm;
7228
7386
  const rootNode = getRenderRoot(vm);
7229
7387
 
@@ -7231,7 +7389,7 @@
7231
7389
  const child = children[i];
7232
7390
 
7233
7391
  if (!isNull(child) && !isUndefined$1(child.elm)) {
7234
- renderer.remove(child.elm, rootNode);
7392
+ remove$1(child.elm, rootNode);
7235
7393
  }
7236
7394
  }
7237
7395
 
@@ -7241,7 +7399,7 @@
7241
7399
  }
7242
7400
 
7243
7401
  function scheduleRehydration(vm) {
7244
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
7402
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
7245
7403
  return;
7246
7404
  }
7247
7405
 
@@ -7486,7 +7644,6 @@
7486
7644
 
7487
7645
  const {
7488
7646
  elm,
7489
- renderer,
7490
7647
  context: {
7491
7648
  wiredConnecting,
7492
7649
  wiredDisconnecting
@@ -7513,7 +7670,7 @@
7513
7670
  }
7514
7671
 
7515
7672
  });
7516
- renderer.dispatchEvent(elm, contextRegistrationEvent);
7673
+ dispatchEvent$1(elm, contextRegistrationEvent);
7517
7674
  });
7518
7675
  }
7519
7676
 
@@ -7778,7 +7935,7 @@
7778
7935
  hooksAreSet = true;
7779
7936
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7780
7937
  }
7781
- /* version: 2.5.10 */
7938
+ /* version: 2.6.3 */
7782
7939
 
7783
7940
  /*
7784
7941
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7807,7 +7964,9 @@
7807
7964
  const styleElements = create(null);
7808
7965
  const styleSheets = create(null);
7809
7966
  const nodesToStyleSheets = new WeakMap();
7810
- let getCustomElement, defineCustomElement, HTMLElementConstructor;
7967
+ let getCustomElement;
7968
+ let defineCustomElement;
7969
+ let HTMLElementConstructor;
7811
7970
 
7812
7971
  function isCustomElementRegistryAvailable() {
7813
7972
  if (typeof customElements === 'undefined') {
@@ -7922,188 +8081,231 @@
7922
8081
  HTMLElementConstructor.prototype = HTMLElement.prototype;
7923
8082
  }
7924
8083
 
7925
- let isHydrating = false;
8084
+ let hydrating = false;
7926
8085
 
7927
- function setIsHydrating(v) {
7928
- isHydrating = v;
8086
+ function setIsHydrating(value) {
8087
+ hydrating = value;
7929
8088
  }
7930
8089
 
7931
- const renderer = {
7932
- ssr: false,
8090
+ const ssr = false;
7933
8091
 
7934
- isHydrating() {
7935
- return isHydrating;
7936
- },
8092
+ function isHydrating() {
8093
+ return hydrating;
8094
+ }
7937
8095
 
7938
- isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
7939
- isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
8096
+ const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
8097
+ const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
7940
8098
 
7941
- createElement(tagName, namespace) {
7942
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
7943
- },
8099
+ function createElement$1(tagName, namespace) {
8100
+ return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8101
+ }
7944
8102
 
7945
- createText(content) {
7946
- return document.createTextNode(content);
7947
- },
8103
+ function createText(content) {
8104
+ return document.createTextNode(content);
8105
+ }
7948
8106
 
7949
- createComment(content) {
7950
- return document.createComment(content);
7951
- },
8107
+ function createComment(content) {
8108
+ return document.createComment(content);
8109
+ }
7952
8110
 
7953
- insert(node, parent, anchor) {
7954
- parent.insertBefore(node, anchor);
7955
- },
8111
+ function insert(node, parent, anchor) {
8112
+ parent.insertBefore(node, anchor);
8113
+ }
7956
8114
 
7957
- remove(node, parent) {
7958
- parent.removeChild(node);
7959
- },
8115
+ function remove(node, parent) {
8116
+ parent.removeChild(node);
8117
+ }
7960
8118
 
7961
- nextSibling(node) {
7962
- return node.nextSibling;
7963
- },
8119
+ function nextSibling(node) {
8120
+ return node.nextSibling;
8121
+ }
7964
8122
 
7965
- attachShadow(element, options) {
7966
- if (isHydrating) {
7967
- return element.shadowRoot;
7968
- }
8123
+ function attachShadow(element, options) {
8124
+ if (hydrating) {
8125
+ return element.shadowRoot;
8126
+ }
7969
8127
 
7970
- return element.attachShadow(options);
7971
- },
8128
+ return element.attachShadow(options);
8129
+ }
7972
8130
 
7973
- setText(node, content) {
7974
- node.nodeValue = content;
7975
- },
8131
+ function setText(node, content) {
8132
+ node.nodeValue = content;
8133
+ }
7976
8134
 
7977
- getProperty(node, key) {
7978
- return node[key];
7979
- },
8135
+ function getProperty(node, key) {
8136
+ return node[key];
8137
+ }
7980
8138
 
7981
- setProperty(node, key, value) {
7982
- if (process.env.NODE_ENV !== 'production') {
7983
- if (node instanceof Element && !(key in node)) {
7984
- // TODO [#1297]: Move this validation to the compiler
7985
- assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7986
- }
8139
+ function setProperty(node, key, value) {
8140
+ if (process.env.NODE_ENV !== 'production') {
8141
+ if (node instanceof Element && !(key in node)) {
8142
+ // TODO [#1297]: Move this validation to the compiler
8143
+ assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
7987
8144
  }
8145
+ }
7988
8146
 
7989
- node[key] = value;
7990
- },
8147
+ node[key] = value;
8148
+ }
7991
8149
 
7992
- getAttribute(element, name, namespace) {
7993
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
7994
- },
8150
+ function getAttribute(element, name, namespace) {
8151
+ return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8152
+ }
7995
8153
 
7996
- setAttribute(element, name, value, namespace) {
7997
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
7998
- },
8154
+ function setAttribute(element, name, value, namespace) {
8155
+ return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8156
+ }
7999
8157
 
8000
- removeAttribute(element, name, namespace) {
8001
- if (isUndefined$1(namespace)) {
8002
- element.removeAttribute(name);
8003
- } else {
8004
- element.removeAttributeNS(namespace, name);
8005
- }
8006
- },
8158
+ function removeAttribute(element, name, namespace) {
8159
+ if (isUndefined$1(namespace)) {
8160
+ element.removeAttribute(name);
8161
+ } else {
8162
+ element.removeAttributeNS(namespace, name);
8163
+ }
8164
+ }
8007
8165
 
8008
- addEventListener(target, type, callback, options) {
8009
- target.addEventListener(type, callback, options);
8010
- },
8166
+ function addEventListener(target, type, callback, options) {
8167
+ target.addEventListener(type, callback, options);
8168
+ }
8011
8169
 
8012
- removeEventListener(target, type, callback, options) {
8013
- target.removeEventListener(type, callback, options);
8014
- },
8170
+ function removeEventListener(target, type, callback, options) {
8171
+ target.removeEventListener(type, callback, options);
8172
+ }
8015
8173
 
8016
- dispatchEvent(target, event) {
8017
- return target.dispatchEvent(event);
8018
- },
8174
+ function dispatchEvent(target, event) {
8175
+ return target.dispatchEvent(event);
8176
+ }
8019
8177
 
8020
- getClassList(element) {
8021
- return element.classList;
8022
- },
8178
+ function getClassList(element) {
8179
+ return element.classList;
8180
+ }
8023
8181
 
8024
- setCSSStyleProperty(element, name, value, important) {
8025
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8026
- // represent elements in the engine?
8027
- element.style.setProperty(name, value, important ? 'important' : '');
8028
- },
8182
+ function setCSSStyleProperty(element, name, value, important) {
8183
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8184
+ // represent elements in the engine?
8185
+ element.style.setProperty(name, value, important ? 'important' : '');
8186
+ }
8029
8187
 
8030
- getBoundingClientRect(element) {
8031
- return element.getBoundingClientRect();
8032
- },
8188
+ function getBoundingClientRect(element) {
8189
+ return element.getBoundingClientRect();
8190
+ }
8033
8191
 
8034
- querySelector(element, selectors) {
8035
- return element.querySelector(selectors);
8036
- },
8192
+ function querySelector(element, selectors) {
8193
+ return element.querySelector(selectors);
8194
+ }
8037
8195
 
8038
- querySelectorAll(element, selectors) {
8039
- return element.querySelectorAll(selectors);
8040
- },
8196
+ function querySelectorAll(element, selectors) {
8197
+ return element.querySelectorAll(selectors);
8198
+ }
8041
8199
 
8042
- getElementsByTagName(element, tagNameOrWildCard) {
8043
- return element.getElementsByTagName(tagNameOrWildCard);
8044
- },
8200
+ function getElementsByTagName(element, tagNameOrWildCard) {
8201
+ return element.getElementsByTagName(tagNameOrWildCard);
8202
+ }
8045
8203
 
8046
- getElementsByClassName(element, names) {
8047
- return element.getElementsByClassName(names);
8048
- },
8204
+ function getElementsByClassName(element, names) {
8205
+ return element.getElementsByClassName(names);
8206
+ }
8049
8207
 
8050
- getChildren(element) {
8051
- return element.children;
8052
- },
8208
+ function getChildren(element) {
8209
+ return element.children;
8210
+ }
8053
8211
 
8054
- getChildNodes(element) {
8055
- return element.childNodes;
8056
- },
8212
+ function getChildNodes(element) {
8213
+ return element.childNodes;
8214
+ }
8057
8215
 
8058
- getFirstChild(element) {
8059
- return element.firstChild;
8060
- },
8216
+ function getFirstChild(element) {
8217
+ return element.firstChild;
8218
+ }
8061
8219
 
8062
- getFirstElementChild(element) {
8063
- return element.firstElementChild;
8064
- },
8220
+ function getFirstElementChild(element) {
8221
+ return element.firstElementChild;
8222
+ }
8065
8223
 
8066
- getLastChild(element) {
8067
- return element.lastChild;
8068
- },
8224
+ function getLastChild(element) {
8225
+ return element.lastChild;
8226
+ }
8069
8227
 
8070
- getLastElementChild(element) {
8071
- return element.lastElementChild;
8072
- },
8228
+ function getLastElementChild(element) {
8229
+ return element.lastElementChild;
8230
+ }
8073
8231
 
8074
- isConnected(node) {
8075
- return node.isConnected;
8076
- },
8232
+ function isConnected(node) {
8233
+ return node.isConnected;
8234
+ }
8077
8235
 
8078
- insertGlobalStylesheet(content) {
8079
- if (!isUndefined$1(globalStylesheets[content])) {
8080
- return;
8081
- }
8236
+ function insertGlobalStylesheet(content) {
8237
+ if (!isUndefined$1(globalStylesheets[content])) {
8238
+ return;
8239
+ }
8082
8240
 
8083
- globalStylesheets[content] = true;
8084
- const elm = document.createElement('style');
8085
- elm.type = 'text/css';
8086
- elm.textContent = content;
8087
- globalStylesheetsParentElement.appendChild(elm);
8088
- },
8241
+ globalStylesheets[content] = true;
8242
+ const elm = document.createElement('style');
8243
+ elm.type = 'text/css';
8244
+ elm.textContent = content;
8245
+ globalStylesheetsParentElement.appendChild(elm);
8246
+ }
8089
8247
 
8090
- insertStylesheet(content, target) {
8091
- if (supportsConstructableStyleSheets) {
8092
- insertConstructableStyleSheet(content, target);
8093
- } else {
8094
- // Fall back to <style> element
8095
- insertStyleElement(content, target);
8096
- }
8097
- },
8248
+ function insertStylesheet(content, target) {
8249
+ if (supportsConstructableStyleSheets) {
8250
+ insertConstructableStyleSheet(content, target);
8251
+ } else {
8252
+ // Fall back to <style> element
8253
+ insertStyleElement(content, target);
8254
+ }
8255
+ }
8098
8256
 
8099
- assertInstanceOfHTMLElement(elm, msg) {
8100
- assert.invariant(elm instanceof HTMLElement, msg);
8101
- },
8257
+ function assertInstanceOfHTMLElement(elm, msg) {
8258
+ assert.invariant(elm instanceof HTMLElement, msg);
8259
+ }
8102
8260
 
8103
- defineCustomElement,
8104
- getCustomElement,
8105
- HTMLElement: HTMLElementConstructor
8106
- };
8261
+ const HTMLElementExported = HTMLElementConstructor;
8262
+ /*
8263
+ * Copyright (c) 2020, salesforce.com, inc.
8264
+ * All rights reserved.
8265
+ * SPDX-License-Identifier: MIT
8266
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8267
+ */
8268
+
8269
+ setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
8270
+ setAttachShadow(attachShadow);
8271
+ setCreateComment(createComment);
8272
+ setCreateElement(createElement$1);
8273
+ setCreateText(createText);
8274
+ setDefineCustomElement(defineCustomElement);
8275
+ setDispatchEvent(dispatchEvent);
8276
+ setGetAttribute(getAttribute);
8277
+ setGetBoundingClientRect(getBoundingClientRect);
8278
+ setGetChildNodes(getChildNodes);
8279
+ setGetChildren(getChildren);
8280
+ setGetClassList(getClassList);
8281
+ setGetCustomElement(getCustomElement);
8282
+ setGetElementsByClassName(getElementsByClassName);
8283
+ setGetElementsByTagName(getElementsByTagName);
8284
+ setGetFirstChild(getFirstChild);
8285
+ setGetFirstElementChild(getFirstElementChild);
8286
+ setGetLastChild(getLastChild);
8287
+ setGetLastElementChild(getLastElementChild);
8288
+ setGetProperty(getProperty);
8289
+ setHTMLElement(HTMLElementExported);
8290
+ setInsert(insert);
8291
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
8292
+ setInsertStylesheet(insertStylesheet);
8293
+ setIsConnected(isConnected);
8294
+ setIsHydrating$1(isHydrating);
8295
+ setIsNativeShadowDefined(isNativeShadowDefined);
8296
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
8297
+ setNextSibling(nextSibling);
8298
+ setQuerySelector(querySelector);
8299
+ setQuerySelectorAll(querySelectorAll);
8300
+ setRemove(remove);
8301
+ setRemoveAttribute(removeAttribute);
8302
+ setRemoveEventListener(removeEventListener);
8303
+ setSetAttribute(setAttribute);
8304
+ setSetCSSStyleProperty(setCSSStyleProperty);
8305
+ setSetProperty(setProperty);
8306
+ setSetText(setText);
8307
+ setSsr(ssr);
8308
+ setAddEventListener(addEventListener);
8107
8309
  /*
8108
8310
  * Copyright (c) 2018, salesforce.com, inc.
8109
8311
  * All rights reserved.
@@ -8186,7 +8388,7 @@
8186
8388
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
8187
8389
  }
8188
8390
 
8189
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
8391
+ const UpgradableConstructor = getUpgradableConstructor(sel);
8190
8392
  let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
8191
8393
 
8192
8394
  /**
@@ -8201,8 +8403,7 @@
8201
8403
  createVM(elm, def, {
8202
8404
  tagName: sel,
8203
8405
  mode: options.mode !== 'closed' ? 'open' : 'closed',
8204
- owner: null,
8205
- renderer
8406
+ owner: null
8206
8407
  });
8207
8408
  ConnectingSlot.set(elm, connectRootElement);
8208
8409
  DisconnectingSlot.set(elm, disconnectRootElement);
@@ -8225,6 +8426,10 @@
8225
8426
 
8226
8427
 
8227
8428
  function hydrateComponent(element, Ctor, props = {}) {
8429
+ if (!(element instanceof Element)) {
8430
+ throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
8431
+ }
8432
+
8228
8433
  if (!isFunction$1(Ctor)) {
8229
8434
  throw new TypeError(`"hydrateComponent" expects a valid component constructor as the second parameter but instead received ${Ctor}.`);
8230
8435
  }
@@ -8242,7 +8447,6 @@
8242
8447
  createVM(element, def, {
8243
8448
  mode: 'open',
8244
8449
  owner: null,
8245
- renderer,
8246
8450
  tagName: element.tagName.toLowerCase()
8247
8451
  });
8248
8452
 
@@ -8313,8 +8517,7 @@
8313
8517
  createVM(this, def, {
8314
8518
  mode: 'open',
8315
8519
  owner: null,
8316
- tagName: this.tagName,
8317
- renderer
8520
+ tagName: this.tagName
8318
8521
  });
8319
8522
  }
8320
8523
 
@@ -8381,7 +8584,7 @@
8381
8584
  return false;
8382
8585
  }
8383
8586
 
8384
- if (renderer.isSyntheticShadowDefined) {
8587
+ if (isSyntheticShadowDefined) {
8385
8588
  // TODO [#1252]: old behavior that is still used by some pieces of the platform,
8386
8589
  // specifically, nodes inserted manually on places where `lwc:dom="manual"` directive is not
8387
8590
  // used, will be considered global elements.
@@ -8434,7 +8637,7 @@
8434
8637
  });
8435
8638
  freeze(LightningElement);
8436
8639
  seal(LightningElement.prototype);
8437
- /* version: 2.5.10 */
8640
+ /* version: 2.6.3 */
8438
8641
 
8439
8642
  exports.LightningElement = LightningElement;
8440
8643
  exports.__unstable__ProfilerControl = profilerControl;