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
@@ -339,7 +339,7 @@ function htmlPropertyToAttribute(propName) {
339
339
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
340
340
  return attributeName;
341
341
  }
342
- /** version: 2.5.10 */
342
+ /** version: 2.6.3 */
343
343
 
344
344
  /*
345
345
  * Copyright (c) 2020, salesforce.com, inc.
@@ -352,25 +352,28 @@ function htmlPropertyToAttribute(propName) {
352
352
  * The following constructor might be used in either the constructor or the connectedCallback. In
353
353
  * order to ensure that the component evaluates, we attach those mock constructors to the global
354
354
  * object.
355
+ * Also note that Event is defined in Node 16+, but CustomEvent is not, so they have to be
356
+ * polyfilled separately.
355
357
  */
356
358
 
357
359
 
358
- if (typeof Event !== 'function' && typeof CustomEvent !== 'function') {
360
+ if (typeof Event !== 'function') {
359
361
  class Event {}
360
362
 
363
+ defineProperty(_globalThis, 'Event', {
364
+ value: Event,
365
+ configurable: true,
366
+ writable: true
367
+ });
368
+ }
369
+
370
+ if (typeof CustomEvent !== 'function') {
361
371
  class CustomEvent extends Event {}
362
372
 
363
- defineProperties(_globalThis, {
364
- Event: {
365
- value: Event,
366
- configurable: true,
367
- writable: true
368
- },
369
- CustomEvent: {
370
- value: CustomEvent,
371
- configurable: true,
372
- writable: true
373
- }
373
+ defineProperty(_globalThis, 'CustomEvent', {
374
+ value: CustomEvent,
375
+ configurable: true,
376
+ writable: true
374
377
  });
375
378
  }
376
379
  /**
@@ -394,8 +397,6 @@ const features = {
394
397
  ENABLE_NODE_LIST_PATCH: null,
395
398
  ENABLE_HTML_COLLECTIONS_PATCH: null,
396
399
  ENABLE_NODE_PATCH: null,
397
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
398
- ENABLE_MIXED_SHADOW_MODE: null,
399
400
  ENABLE_WIRE_SYNC_EMIT: null
400
401
  };
401
402
 
@@ -460,7 +461,7 @@ function setFeatureFlagForTest(name, value) {
460
461
  setFeatureFlag(name, value);
461
462
  }
462
463
  }
463
- /** version: 2.5.10 */
464
+ /** version: 2.6.3 */
464
465
 
465
466
  /* proxy-compat-disable */
466
467
 
@@ -534,6 +535,249 @@ function parseStyleText(cssText) {
534
535
  }
535
536
 
536
537
  return styleMap;
538
+ } //
539
+ // Primitives
540
+ //
541
+
542
+
543
+ let ssr$1;
544
+
545
+ function setSsr(ssrImpl) {
546
+ ssr$1 = ssrImpl;
547
+ }
548
+
549
+ let isNativeShadowDefined$1;
550
+
551
+ function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
552
+ isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
553
+ }
554
+
555
+ let isSyntheticShadowDefined$1;
556
+
557
+ function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
558
+ isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
559
+ }
560
+
561
+ let HTMLElementExported$1;
562
+
563
+ function setHTMLElement(HTMLElementImpl) {
564
+ HTMLElementExported$1 = HTMLElementImpl;
565
+ }
566
+
567
+ let isHydrating$1;
568
+
569
+ function setIsHydrating(isHydratingImpl) {
570
+ isHydrating$1 = isHydratingImpl;
571
+ }
572
+
573
+ let insert$1;
574
+
575
+ function setInsert(insertImpl) {
576
+ insert$1 = insertImpl;
577
+ }
578
+
579
+ let remove$1;
580
+
581
+ function setRemove(removeImpl) {
582
+ remove$1 = removeImpl;
583
+ }
584
+
585
+ let createElement$1;
586
+
587
+ function setCreateElement(createElementImpl) {
588
+ createElement$1 = createElementImpl;
589
+ }
590
+
591
+ let createText$1;
592
+
593
+ function setCreateText(createTextImpl) {
594
+ createText$1 = createTextImpl;
595
+ }
596
+
597
+ let createComment$1;
598
+
599
+ function setCreateComment(createCommentImpl) {
600
+ createComment$1 = createCommentImpl;
601
+ }
602
+
603
+ let nextSibling$1;
604
+
605
+ function setNextSibling(nextSiblingImpl) {
606
+ nextSibling$1 = nextSiblingImpl;
607
+ }
608
+
609
+ let attachShadow$1;
610
+
611
+ function setAttachShadow(attachShadowImpl) {
612
+ attachShadow$1 = attachShadowImpl;
613
+ }
614
+
615
+ let getProperty$1;
616
+
617
+ function setGetProperty(getPropertyImpl) {
618
+ getProperty$1 = getPropertyImpl;
619
+ }
620
+
621
+ let setProperty$1;
622
+
623
+ function setSetProperty(setPropertyImpl) {
624
+ setProperty$1 = setPropertyImpl;
625
+ }
626
+
627
+ let setText$1;
628
+
629
+ function setSetText(setTextImpl) {
630
+ setText$1 = setTextImpl;
631
+ }
632
+
633
+ let getAttribute$1;
634
+
635
+ function setGetAttribute(getAttributeImpl) {
636
+ getAttribute$1 = getAttributeImpl;
637
+ }
638
+
639
+ let setAttribute$1;
640
+
641
+ function setSetAttribute(setAttributeImpl) {
642
+ setAttribute$1 = setAttributeImpl;
643
+ }
644
+
645
+ let removeAttribute$1;
646
+
647
+ function setRemoveAttribute(removeAttributeImpl) {
648
+ removeAttribute$1 = removeAttributeImpl;
649
+ }
650
+
651
+ let addEventListener$1;
652
+
653
+ function setAddEventListener(addEventListenerImpl) {
654
+ addEventListener$1 = addEventListenerImpl;
655
+ }
656
+
657
+ let removeEventListener$1;
658
+
659
+ function setRemoveEventListener(removeEventListenerImpl) {
660
+ removeEventListener$1 = removeEventListenerImpl;
661
+ }
662
+
663
+ let dispatchEvent$1;
664
+
665
+ function setDispatchEvent(dispatchEventImpl) {
666
+ dispatchEvent$1 = dispatchEventImpl;
667
+ }
668
+
669
+ let getClassList$1;
670
+
671
+ function setGetClassList(getClassListImpl) {
672
+ getClassList$1 = getClassListImpl;
673
+ }
674
+
675
+ let setCSSStyleProperty$1;
676
+
677
+ function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
678
+ setCSSStyleProperty$1 = setCSSStylePropertyImpl;
679
+ }
680
+
681
+ let getBoundingClientRect$1;
682
+
683
+ function setGetBoundingClientRect(getBoundingClientRectImpl) {
684
+ getBoundingClientRect$1 = getBoundingClientRectImpl;
685
+ }
686
+
687
+ let querySelector$1;
688
+
689
+ function setQuerySelector(querySelectorImpl) {
690
+ querySelector$1 = querySelectorImpl;
691
+ }
692
+
693
+ let querySelectorAll$1;
694
+
695
+ function setQuerySelectorAll(querySelectorAllImpl) {
696
+ querySelectorAll$1 = querySelectorAllImpl;
697
+ }
698
+
699
+ let getElementsByTagName$1;
700
+
701
+ function setGetElementsByTagName(getElementsByTagNameImpl) {
702
+ getElementsByTagName$1 = getElementsByTagNameImpl;
703
+ }
704
+
705
+ let getElementsByClassName$1;
706
+
707
+ function setGetElementsByClassName(getElementsByClassNameImpl) {
708
+ getElementsByClassName$1 = getElementsByClassNameImpl;
709
+ }
710
+
711
+ let getChildren$1;
712
+
713
+ function setGetChildren(getChildrenImpl) {
714
+ getChildren$1 = getChildrenImpl;
715
+ }
716
+
717
+ let getChildNodes$1;
718
+
719
+ function setGetChildNodes(getChildNodesImpl) {
720
+ getChildNodes$1 = getChildNodesImpl;
721
+ }
722
+
723
+ let getFirstChild$1;
724
+
725
+ function setGetFirstChild(getFirstChildImpl) {
726
+ getFirstChild$1 = getFirstChildImpl;
727
+ }
728
+
729
+ let getFirstElementChild$1;
730
+
731
+ function setGetFirstElementChild(getFirstElementChildImpl) {
732
+ getFirstElementChild$1 = getFirstElementChildImpl;
733
+ }
734
+
735
+ let getLastChild$1;
736
+
737
+ function setGetLastChild(getLastChildImpl) {
738
+ getLastChild$1 = getLastChildImpl;
739
+ }
740
+
741
+ let getLastElementChild$1;
742
+
743
+ function setGetLastElementChild(getLastElementChildImpl) {
744
+ getLastElementChild$1 = getLastElementChildImpl;
745
+ }
746
+
747
+ let isConnected$1;
748
+
749
+ function setIsConnected(isConnectedImpl) {
750
+ isConnected$1 = isConnectedImpl;
751
+ }
752
+
753
+ let insertGlobalStylesheet$1;
754
+
755
+ function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
756
+ insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
757
+ }
758
+
759
+ let insertStylesheet$1;
760
+
761
+ function setInsertStylesheet(insertStylesheetImpl) {
762
+ insertStylesheet$1 = insertStylesheetImpl;
763
+ }
764
+
765
+ let assertInstanceOfHTMLElement$1;
766
+
767
+ function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
768
+ assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
769
+ }
770
+
771
+ let defineCustomElement$1;
772
+
773
+ function setDefineCustomElement(defineCustomElementImpl) {
774
+ defineCustomElement$1 = defineCustomElementImpl;
775
+ }
776
+
777
+ let getCustomElement$1;
778
+
779
+ function setGetCustomElement(getCustomElementImpl) {
780
+ getCustomElement$1 = getCustomElementImpl;
537
781
  }
538
782
  /*
539
783
  * Copyright (c) 2019, salesforce.com, inc.
@@ -787,9 +1031,6 @@ function createAllEventListeners(vnode) {
787
1031
  elm,
788
1032
  data: {
789
1033
  on
790
- },
791
- owner: {
792
- renderer
793
1034
  }
794
1035
  } = vnode;
795
1036
 
@@ -802,7 +1043,7 @@ function createAllEventListeners(vnode) {
802
1043
  let name;
803
1044
 
804
1045
  for (name in on) {
805
- renderer.addEventListener(elm, name, listener);
1046
+ addEventListener$1(elm, name, listener);
806
1047
  }
807
1048
  }
808
1049
 
@@ -944,9 +1185,6 @@ function updateAttrs(oldVnode, vnode) {
944
1185
  const {
945
1186
  data: {
946
1187
  attrs
947
- },
948
- owner: {
949
- renderer
950
1188
  }
951
1189
  } = vnode;
952
1190
 
@@ -969,10 +1207,6 @@ function updateAttrs(oldVnode, vnode) {
969
1207
  }
970
1208
 
971
1209
  const elm = vnode.elm;
972
- const {
973
- setAttribute,
974
- removeAttribute
975
- } = renderer;
976
1210
  let key;
977
1211
  oldAttrs = isUndefined$1(oldAttrs) ? EmptyObject : oldAttrs; // update modified attributes, add new attributes
978
1212
  // this routine is only useful for data-* attributes in all kind of elements
@@ -987,14 +1221,14 @@ function updateAttrs(oldVnode, vnode) {
987
1221
 
988
1222
  if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
989
1223
  // Assume xml namespace
990
- setAttribute(elm, key, cur, xmlNS);
1224
+ setAttribute$1(elm, key, cur, xmlNS);
991
1225
  } else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
992
1226
  // Assume xlink namespace
993
- setAttribute(elm, key, cur, xlinkNS);
994
- } else if (isNull(cur)) {
995
- removeAttribute(elm, key);
1227
+ setAttribute$1(elm, key, cur, xlinkNS);
1228
+ } else if (isNull(cur) || isUndefined$1(cur)) {
1229
+ removeAttribute$1(elm, key);
996
1230
  } else {
997
- setAttribute(elm, key, cur);
1231
+ setAttribute$1(elm, key, cur);
998
1232
  }
999
1233
 
1000
1234
  lockAttribute();
@@ -1042,17 +1276,14 @@ function update(oldVnode, vnode) {
1042
1276
  const isFirstPatch = isUndefined$1(oldProps);
1043
1277
  const {
1044
1278
  elm,
1045
- sel,
1046
- owner: {
1047
- renderer
1048
- }
1279
+ sel
1049
1280
  } = vnode;
1050
1281
 
1051
1282
  for (const key in props) {
1052
1283
  const cur = props[key]; // if it is the first time this element is patched, or the current value is different to the previous value...
1053
1284
 
1054
- if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? renderer.getProperty(elm, key) : oldProps[key])) {
1055
- renderer.setProperty(elm, key, cur);
1285
+ if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
1286
+ setProperty$1(elm, key, cur);
1056
1287
  }
1057
1288
  }
1058
1289
  }
@@ -1121,9 +1352,6 @@ function updateClassAttribute(oldVnode, vnode) {
1121
1352
  elm,
1122
1353
  data: {
1123
1354
  className: newClass
1124
- },
1125
- owner: {
1126
- renderer
1127
1355
  }
1128
1356
  } = vnode;
1129
1357
  const {
@@ -1136,7 +1364,7 @@ function updateClassAttribute(oldVnode, vnode) {
1136
1364
  return;
1137
1365
  }
1138
1366
 
1139
- const classList = renderer.getClassList(elm);
1367
+ const classList = getClassList$1(elm);
1140
1368
  const newClassMap = getMapFromClassName(newClass);
1141
1369
  const oldClassMap = getMapFromClassName(oldClass);
1142
1370
  let name;
@@ -1174,24 +1402,17 @@ function updateStyleAttribute(oldVnode, vnode) {
1174
1402
  elm,
1175
1403
  data: {
1176
1404
  style: newStyle
1177
- },
1178
- owner: {
1179
- renderer
1180
1405
  }
1181
1406
  } = vnode;
1182
- const {
1183
- setAttribute,
1184
- removeAttribute
1185
- } = renderer;
1186
1407
 
1187
1408
  if (oldVnode.data.style === newStyle) {
1188
1409
  return;
1189
1410
  }
1190
1411
 
1191
1412
  if (!isString(newStyle) || newStyle === '') {
1192
- removeAttribute(elm, 'style');
1413
+ removeAttribute$1(elm, 'style');
1193
1414
  } else {
1194
- setAttribute(elm, 'style', newStyle);
1415
+ setAttribute$1(elm, 'style', newStyle);
1195
1416
  }
1196
1417
  }
1197
1418
 
@@ -1216,9 +1437,6 @@ function createClassAttribute(vnode) {
1216
1437
  elm,
1217
1438
  data: {
1218
1439
  classMap
1219
- },
1220
- owner: {
1221
- renderer
1222
1440
  }
1223
1441
  } = vnode;
1224
1442
 
@@ -1226,7 +1444,7 @@ function createClassAttribute(vnode) {
1226
1444
  return;
1227
1445
  }
1228
1446
 
1229
- const classList = renderer.getClassList(elm);
1447
+ const classList = getClassList$1(elm);
1230
1448
 
1231
1449
  for (const name in classMap) {
1232
1450
  classList.add(name);
@@ -1250,9 +1468,6 @@ function createStyleAttribute(vnode) {
1250
1468
  elm,
1251
1469
  data: {
1252
1470
  styleDecls
1253
- },
1254
- owner: {
1255
- renderer
1256
1471
  }
1257
1472
  } = vnode;
1258
1473
 
@@ -1262,7 +1477,7 @@ function createStyleAttribute(vnode) {
1262
1477
 
1263
1478
  for (let i = 0; i < styleDecls.length; i++) {
1264
1479
  const [prop, value, important] = styleDecls[i];
1265
- renderer.setCSSStyleProperty(elm, prop, value, important);
1480
+ setCSSStyleProperty$1(elm, prop, value, important);
1266
1481
  }
1267
1482
  }
1268
1483
 
@@ -1276,15 +1491,6 @@ var modStaticStyle = {
1276
1491
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1277
1492
  */
1278
1493
 
1279
- /**
1280
- @license
1281
- Copyright (c) 2015 Simon Friis Vindum.
1282
- This code may only be used under the MIT License found at
1283
- https://github.com/snabbdom/snabbdom/blob/master/LICENSE
1284
- Code distributed by Snabbdom as part of the Snabbdom project at
1285
- https://github.com/snabbdom/snabbdom/
1286
- */
1287
-
1288
1494
  function isUndef(s) {
1289
1495
  return s === undefined;
1290
1496
  }
@@ -1372,7 +1578,7 @@ function updateDynamicChildren(parentElm, oldCh, newCh) {
1372
1578
  } else if (sameVnode(oldStartVnode, newEndVnode)) {
1373
1579
  // Vnode moved right
1374
1580
  patchVnode(oldStartVnode, newEndVnode);
1375
- newEndVnode.hook.move(oldStartVnode, parentElm, oldEndVnode.owner.renderer.nextSibling(oldEndVnode.elm));
1581
+ newEndVnode.hook.move(oldStartVnode, parentElm, nextSibling$1(oldEndVnode.elm));
1376
1582
  oldStartVnode = oldCh[++oldStartIdx];
1377
1583
  newEndVnode = newCh[--newEndIdx];
1378
1584
  } else if (sameVnode(oldEndVnode, newStartVnode)) {
@@ -1854,7 +2060,7 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
1854
2060
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1855
2061
  }
1856
2062
  /*
1857
- * Copyright (c) 2020, salesforce.com, inc.
2063
+ * Copyright (c) 2018, salesforce.com, inc.
1858
2064
  * All rights reserved.
1859
2065
  * SPDX-License-Identifier: MIT
1860
2066
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -1907,6 +2113,7 @@ const {
1907
2113
  isArray
1908
2114
  } = Array;
1909
2115
  const {
2116
+ prototype: ObjectDotPrototype,
1910
2117
  getPrototypeOf,
1911
2118
  create: ObjectCreate,
1912
2119
  defineProperty: ObjectDefineProperty,
@@ -2556,8 +2763,6 @@ if (process.env.NODE_ENV !== 'production') {
2556
2763
  init();
2557
2764
  }
2558
2765
 
2559
- const ObjectDotPrototype = Object.prototype;
2560
-
2561
2766
  function defaultValueIsObservable(value) {
2562
2767
  // intentionally checking for null
2563
2768
  if (value === null) {
@@ -2585,99 +2790,85 @@ const defaultValueMutated = (obj, key) => {
2585
2790
  /* do nothing */
2586
2791
  };
2587
2792
 
2588
- const defaultValueDistortion = value => value;
2589
-
2590
2793
  function createShadowTarget(value) {
2591
2794
  return isArray(value) ? [] : {};
2592
2795
  }
2593
2796
 
2594
- class ReactiveMembrane {
2595
- constructor(options) {
2596
- this.valueDistortion = defaultValueDistortion;
2597
- this.valueMutated = defaultValueMutated;
2598
- this.valueObserved = defaultValueObserved;
2599
- this.valueIsObservable = defaultValueIsObservable;
2797
+ class ObservableMembrane {
2798
+ constructor(options = {}) {
2600
2799
  this.readOnlyObjectGraph = new WeakMap();
2601
2800
  this.reactiveObjectGraph = new WeakMap();
2602
-
2603
- if (!isUndefined(options)) {
2604
- const {
2605
- valueDistortion,
2606
- valueMutated,
2607
- valueObserved,
2608
- valueIsObservable,
2609
- tagPropertyKey
2610
- } = options;
2611
- this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
2612
- this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2613
- this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2614
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2615
- this.tagPropertyKey = tagPropertyKey;
2616
- }
2801
+ const {
2802
+ valueMutated,
2803
+ valueObserved,
2804
+ valueIsObservable,
2805
+ tagPropertyKey
2806
+ } = options;
2807
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2808
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2809
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2810
+ this.tagPropertyKey = tagPropertyKey;
2617
2811
  }
2618
2812
 
2619
2813
  getProxy(value) {
2620
2814
  const unwrappedValue = unwrap$1(value);
2621
- const distorted = this.valueDistortion(unwrappedValue);
2622
2815
 
2623
- if (this.valueIsObservable(distorted)) {
2624
- if (this.readOnlyObjectGraph.get(distorted) === value) {
2625
- // when trying to extract the writable version of a readonly
2626
- // we return the readonly.
2816
+ if (this.valueIsObservable(unwrappedValue)) {
2817
+ // When trying to extract the writable version of a readonly we return the readonly.
2818
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2627
2819
  return value;
2628
2820
  }
2629
2821
 
2630
- return this.getReactiveHandler(unwrappedValue, distorted);
2822
+ return this.getReactiveHandler(unwrappedValue);
2631
2823
  }
2632
2824
 
2633
- return distorted;
2825
+ return unwrappedValue;
2634
2826
  }
2635
2827
 
2636
2828
  getReadOnlyProxy(value) {
2637
2829
  value = unwrap$1(value);
2638
- const distorted = this.valueDistortion(value);
2639
2830
 
2640
- if (this.valueIsObservable(distorted)) {
2641
- return this.getReadOnlyHandler(value, distorted);
2831
+ if (this.valueIsObservable(value)) {
2832
+ return this.getReadOnlyHandler(value);
2642
2833
  }
2643
2834
 
2644
- return distorted;
2835
+ return value;
2645
2836
  }
2646
2837
 
2647
2838
  unwrapProxy(p) {
2648
2839
  return unwrap$1(p);
2649
2840
  }
2650
2841
 
2651
- getReactiveHandler(value, distortedValue) {
2652
- let proxy = this.reactiveObjectGraph.get(distortedValue);
2842
+ getReactiveHandler(value) {
2843
+ let proxy = this.reactiveObjectGraph.get(value);
2653
2844
 
2654
2845
  if (isUndefined(proxy)) {
2655
2846
  // caching the proxy after the first time it is accessed
2656
- const handler = new ReactiveProxyHandler(this, distortedValue);
2657
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2847
+ const handler = new ReactiveProxyHandler(this, value);
2848
+ proxy = new Proxy(createShadowTarget(value), handler);
2658
2849
  registerProxy(proxy, value);
2659
- this.reactiveObjectGraph.set(distortedValue, proxy);
2850
+ this.reactiveObjectGraph.set(value, proxy);
2660
2851
  }
2661
2852
 
2662
2853
  return proxy;
2663
2854
  }
2664
2855
 
2665
- getReadOnlyHandler(value, distortedValue) {
2666
- let proxy = this.readOnlyObjectGraph.get(distortedValue);
2856
+ getReadOnlyHandler(value) {
2857
+ let proxy = this.readOnlyObjectGraph.get(value);
2667
2858
 
2668
2859
  if (isUndefined(proxy)) {
2669
2860
  // caching the proxy after the first time it is accessed
2670
- const handler = new ReadOnlyHandler(this, distortedValue);
2671
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2861
+ const handler = new ReadOnlyHandler(this, value);
2862
+ proxy = new Proxy(createShadowTarget(value), handler);
2672
2863
  registerProxy(proxy, value);
2673
- this.readOnlyObjectGraph.set(distortedValue, proxy);
2864
+ this.readOnlyObjectGraph.set(value, proxy);
2674
2865
  }
2675
2866
 
2676
2867
  return proxy;
2677
2868
  }
2678
2869
 
2679
2870
  }
2680
- /** version: 1.1.5 */
2871
+ /** version: 2.0.0 */
2681
2872
 
2682
2873
  /*
2683
2874
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2688,15 +2879,9 @@ class ReactiveMembrane {
2688
2879
 
2689
2880
 
2690
2881
  const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2691
-
2692
- function valueDistortion(value) {
2693
- return value;
2694
- }
2695
-
2696
- const reactiveMembrane = new ReactiveMembrane({
2882
+ const reactiveMembrane = new ObservableMembrane({
2697
2883
  valueObserved,
2698
2884
  valueMutated,
2699
- valueDistortion,
2700
2885
  tagPropertyKey: lockerLivePropertyKey
2701
2886
  });
2702
2887
  /**
@@ -2705,16 +2890,9 @@ const reactiveMembrane = new ReactiveMembrane({
2705
2890
  * change or being removed.
2706
2891
  */
2707
2892
 
2708
- const unwrap = function (value) {
2709
- const unwrapped = reactiveMembrane.unwrapProxy(value);
2710
-
2711
- if (unwrapped !== value) {
2712
- // if value is a proxy, unwrap to access original value and apply distortion
2713
- return valueDistortion(unwrapped);
2714
- }
2715
-
2716
- return value;
2717
- };
2893
+ function unwrap(value) {
2894
+ return reactiveMembrane.unwrapProxy(value);
2895
+ }
2718
2896
  /*
2719
2897
  * Copyright (c) 2018, salesforce.com, inc.
2720
2898
  * All rights reserved.
@@ -2802,9 +2980,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
2802
2980
 
2803
2981
 
2804
2982
  const LightningElement = function () {
2805
- var _a; // This should be as performant as possible, while any initialization should be done lazily
2806
-
2807
-
2983
+ // This should be as performant as possible, while any initialization should be done lazily
2808
2984
  if (isNull(vmBeingConstructed)) {
2809
2985
  throw new ReferenceError('Illegal constructor');
2810
2986
  }
@@ -2812,15 +2988,14 @@ const LightningElement = function () {
2812
2988
  const vm = vmBeingConstructed;
2813
2989
  const {
2814
2990
  def,
2815
- elm,
2816
- renderer
2991
+ elm
2817
2992
  } = vm;
2818
2993
  const {
2819
2994
  bridge
2820
2995
  } = def;
2821
2996
 
2822
2997
  if (process.env.NODE_ENV !== 'production') {
2823
- (_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}.`);
2998
+ assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2824
2999
  }
2825
3000
 
2826
3001
  const component = this;
@@ -2850,7 +3025,7 @@ const LightningElement = function () {
2850
3025
  if (vm.renderMode === 1
2851
3026
  /* Shadow */
2852
3027
  ) {
2853
- attachShadow(vm);
3028
+ doAttachShadow(vm);
2854
3029
  } // Adding extra guard rails in DEV mode.
2855
3030
 
2856
3031
 
@@ -2862,17 +3037,16 @@ const LightningElement = function () {
2862
3037
  return this;
2863
3038
  };
2864
3039
 
2865
- function attachShadow(vm) {
3040
+ function doAttachShadow(vm) {
2866
3041
  const {
2867
3042
  elm,
2868
3043
  mode,
2869
- renderer,
2870
3044
  shadowMode,
2871
3045
  def: {
2872
3046
  ctor
2873
3047
  }
2874
3048
  } = vm;
2875
- const cmpRoot = renderer.attachShadow(elm, {
3049
+ const cmpRoot = attachShadow$1(elm, {
2876
3050
  [KEY__SYNTHETIC_MODE]: shadowMode === 1
2877
3051
  /* Synthetic */
2878
3052
  ,
@@ -2899,21 +3073,15 @@ LightningElement.prototype = {
2899
3073
 
2900
3074
  dispatchEvent(event) {
2901
3075
  const {
2902
- elm,
2903
- renderer: {
2904
- dispatchEvent
2905
- }
3076
+ elm
2906
3077
  } = getAssociatedVM(this);
2907
- return dispatchEvent(elm, event);
3078
+ return dispatchEvent$1(elm, event);
2908
3079
  },
2909
3080
 
2910
3081
  addEventListener(type, listener, options) {
2911
3082
  const vm = getAssociatedVM(this);
2912
3083
  const {
2913
- elm,
2914
- renderer: {
2915
- addEventListener
2916
- }
3084
+ elm
2917
3085
  } = vm;
2918
3086
 
2919
3087
  if (process.env.NODE_ENV !== 'production') {
@@ -2924,92 +3092,68 @@ LightningElement.prototype = {
2924
3092
  }
2925
3093
 
2926
3094
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2927
- addEventListener(elm, type, wrappedListener, options);
3095
+ addEventListener$1(elm, type, wrappedListener, options);
2928
3096
  },
2929
3097
 
2930
3098
  removeEventListener(type, listener, options) {
2931
3099
  const vm = getAssociatedVM(this);
2932
3100
  const {
2933
- elm,
2934
- renderer: {
2935
- removeEventListener
2936
- }
3101
+ elm
2937
3102
  } = vm;
2938
3103
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2939
- removeEventListener(elm, type, wrappedListener, options);
3104
+ removeEventListener$1(elm, type, wrappedListener, options);
2940
3105
  },
2941
3106
 
2942
3107
  hasAttribute(name) {
2943
3108
  const {
2944
- elm,
2945
- renderer: {
2946
- getAttribute
2947
- }
3109
+ elm
2948
3110
  } = getAssociatedVM(this);
2949
- return !isNull(getAttribute(elm, name));
3111
+ return !isNull(getAttribute$1(elm, name));
2950
3112
  },
2951
3113
 
2952
3114
  hasAttributeNS(namespace, name) {
2953
3115
  const {
2954
- elm,
2955
- renderer: {
2956
- getAttribute
2957
- }
3116
+ elm
2958
3117
  } = getAssociatedVM(this);
2959
- return !isNull(getAttribute(elm, name, namespace));
3118
+ return !isNull(getAttribute$1(elm, name, namespace));
2960
3119
  },
2961
3120
 
2962
3121
  removeAttribute(name) {
2963
3122
  const {
2964
- elm,
2965
- renderer: {
2966
- removeAttribute
2967
- }
3123
+ elm
2968
3124
  } = getAssociatedVM(this);
2969
3125
  unlockAttribute(elm, name);
2970
- removeAttribute(elm, name);
3126
+ removeAttribute$1(elm, name);
2971
3127
  lockAttribute();
2972
3128
  },
2973
3129
 
2974
3130
  removeAttributeNS(namespace, name) {
2975
3131
  const {
2976
- elm,
2977
- renderer: {
2978
- removeAttribute
2979
- }
3132
+ elm
2980
3133
  } = getAssociatedVM(this);
2981
3134
  unlockAttribute(elm, name);
2982
- removeAttribute(elm, name, namespace);
3135
+ removeAttribute$1(elm, name, namespace);
2983
3136
  lockAttribute();
2984
3137
  },
2985
3138
 
2986
3139
  getAttribute(name) {
2987
3140
  const {
2988
- elm,
2989
- renderer: {
2990
- getAttribute
2991
- }
3141
+ elm
2992
3142
  } = getAssociatedVM(this);
2993
- return getAttribute(elm, name);
3143
+ return getAttribute$1(elm, name);
2994
3144
  },
2995
3145
 
2996
3146
  getAttributeNS(namespace, name) {
2997
3147
  const {
2998
- elm,
2999
- renderer: {
3000
- getAttribute
3001
- }
3148
+ elm
3002
3149
  } = getAssociatedVM(this);
3003
- return getAttribute(elm, name, namespace);
3150
+ return getAttribute$1(elm, name, namespace);
3004
3151
  },
3005
3152
 
3006
3153
  setAttribute(name, value) {
3007
3154
  const vm = getAssociatedVM(this);
3008
3155
  const {
3009
- elm,
3010
- renderer: {
3011
- setAttribute
3012
- }
3156
+ elm
3013
3157
  } = vm;
3014
3158
 
3015
3159
  if (process.env.NODE_ENV !== 'production') {
@@ -3017,17 +3161,14 @@ LightningElement.prototype = {
3017
3161
  }
3018
3162
 
3019
3163
  unlockAttribute(elm, name);
3020
- setAttribute(elm, name, value);
3164
+ setAttribute$1(elm, name, value);
3021
3165
  lockAttribute();
3022
3166
  },
3023
3167
 
3024
3168
  setAttributeNS(namespace, name, value) {
3025
3169
  const vm = getAssociatedVM(this);
3026
3170
  const {
3027
- elm,
3028
- renderer: {
3029
- setAttribute
3030
- }
3171
+ elm
3031
3172
  } = vm;
3032
3173
 
3033
3174
  if (process.env.NODE_ENV !== 'production') {
@@ -3035,43 +3176,34 @@ LightningElement.prototype = {
3035
3176
  }
3036
3177
 
3037
3178
  unlockAttribute(elm, name);
3038
- setAttribute(elm, name, value, namespace);
3179
+ setAttribute$1(elm, name, value, namespace);
3039
3180
  lockAttribute();
3040
3181
  },
3041
3182
 
3042
3183
  getBoundingClientRect() {
3043
3184
  const vm = getAssociatedVM(this);
3044
3185
  const {
3045
- elm,
3046
- renderer: {
3047
- getBoundingClientRect
3048
- }
3186
+ elm
3049
3187
  } = vm;
3050
3188
 
3051
3189
  if (process.env.NODE_ENV !== 'production') {
3052
3190
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
3053
3191
  }
3054
3192
 
3055
- return getBoundingClientRect(elm);
3193
+ return getBoundingClientRect$1(elm);
3056
3194
  },
3057
3195
 
3058
3196
  get isConnected() {
3059
3197
  const {
3060
- elm,
3061
- renderer: {
3062
- isConnected
3063
- }
3198
+ elm
3064
3199
  } = getAssociatedVM(this);
3065
- return isConnected(elm);
3200
+ return isConnected$1(elm);
3066
3201
  },
3067
3202
 
3068
3203
  get classList() {
3069
3204
  const vm = getAssociatedVM(this);
3070
3205
  const {
3071
- elm,
3072
- renderer: {
3073
- getClassList
3074
- }
3206
+ elm
3075
3207
  } = vm;
3076
3208
 
3077
3209
  if (process.env.NODE_ENV !== 'production') {
@@ -3080,7 +3212,7 @@ LightningElement.prototype = {
3080
3212
  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.`);
3081
3213
  }
3082
3214
 
3083
- return getClassList(elm);
3215
+ return getClassList$1(elm);
3084
3216
  },
3085
3217
 
3086
3218
  get template() {
@@ -3114,23 +3246,48 @@ LightningElement.prototype = {
3114
3246
  }
3115
3247
 
3116
3248
  };
3117
- const queryAndChildGetterDescriptors = create(null);
3118
- 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
3249
+ const queryAndChildGetterDescriptors = create(null); // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
3250
+ // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
3251
+ // object representing the renderer, with a lot of methods we don't actually need.
3252
+
3253
+ const childGetters = ['children', 'childNodes', 'firstChild', 'firstElementChild', 'lastChild', 'lastElementChild'];
3254
+
3255
+ function getChildGetter(methodName) {
3256
+ switch (methodName) {
3257
+ case 'children':
3258
+ return getChildren$1;
3259
+
3260
+ case 'childNodes':
3261
+ return getChildNodes$1;
3262
+
3263
+ case 'firstChild':
3264
+ return getFirstChild$1;
3265
+
3266
+ case 'firstElementChild':
3267
+ return getFirstElementChild$1;
3268
+
3269
+ case 'lastChild':
3270
+ return getLastChild$1;
3119
3271
 
3120
- for (const [elementProp, rendererMethod] of childGetters) {
3121
- queryAndChildGetterDescriptors[elementProp] = {
3272
+ case 'lastElementChild':
3273
+ return getLastElementChild$1;
3274
+ }
3275
+ } // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
3276
+
3277
+
3278
+ for (const childGetter of childGetters) {
3279
+ queryAndChildGetterDescriptors[childGetter] = {
3122
3280
  get() {
3123
3281
  const vm = getAssociatedVM(this);
3124
3282
  const {
3125
- elm,
3126
- renderer
3283
+ elm
3127
3284
  } = vm;
3128
3285
 
3129
3286
  if (process.env.NODE_ENV !== 'production') {
3130
- warnIfInvokedDuringConstruction(vm, elementProp);
3287
+ warnIfInvokedDuringConstruction(vm, childGetter);
3131
3288
  }
3132
3289
 
3133
- return renderer[rendererMethod](elm);
3290
+ return getChildGetter(childGetter)(elm);
3134
3291
  },
3135
3292
 
3136
3293
  configurable: true,
@@ -3138,22 +3295,38 @@ for (const [elementProp, rendererMethod] of childGetters) {
3138
3295
  };
3139
3296
  }
3140
3297
 
3141
- const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll']; // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
3298
+ const queryMethods = ['getElementsByClassName', 'getElementsByTagName', 'querySelector', 'querySelectorAll'];
3299
+
3300
+ function getQueryMethod(methodName) {
3301
+ switch (methodName) {
3302
+ case 'getElementsByClassName':
3303
+ return getElementsByClassName$1;
3304
+
3305
+ case 'getElementsByTagName':
3306
+ return getElementsByTagName$1;
3307
+
3308
+ case 'querySelector':
3309
+ return querySelector$1;
3310
+
3311
+ case 'querySelectorAll':
3312
+ return querySelectorAll$1;
3313
+ }
3314
+ } // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
3315
+
3142
3316
 
3143
3317
  for (const queryMethod of queryMethods) {
3144
3318
  queryAndChildGetterDescriptors[queryMethod] = {
3145
3319
  value(arg) {
3146
3320
  const vm = getAssociatedVM(this);
3147
3321
  const {
3148
- elm,
3149
- renderer
3322
+ elm
3150
3323
  } = vm;
3151
3324
 
3152
3325
  if (process.env.NODE_ENV !== 'production') {
3153
3326
  warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
3154
3327
  }
3155
3328
 
3156
- return renderer[queryMethod](elm, arg);
3329
+ return getQueryMethod(queryMethod)(elm, arg);
3157
3330
  },
3158
3331
 
3159
3332
  configurable: true,
@@ -4189,10 +4362,6 @@ function createComponentDef(Ctor) {
4189
4362
 
4190
4363
  assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
4191
4364
 
4192
- if (!runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
4193
- assert.isFalse('shadowSupportMode' in Ctor, `${ctorName || 'Anonymous class'} is an invalid LWC component. The shadowSupportMode static property is not available in this environment.`);
4194
- }
4195
-
4196
4365
  if (!isUndefined$1(ctorShadowSupportMode)) {
4197
4366
  assert.invariant(ctorShadowSupportMode === "any"
4198
4367
  /* Any */
@@ -4436,17 +4605,14 @@ function setScopeTokenClassIfNecessary(elm, owner) {
4436
4605
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
4437
4606
 
4438
4607
  if (!isUndefined$1(token) && context.hasScopedStyles) {
4439
- owner.renderer.getClassList(elm).add(token);
4608
+ getClassList$1(elm).add(token);
4440
4609
  }
4441
4610
  }
4442
4611
 
4443
4612
  function updateNodeHook(oldVnode, vnode) {
4444
4613
  const {
4445
4614
  elm,
4446
- text,
4447
- owner: {
4448
- renderer
4449
- }
4615
+ text
4450
4616
  } = vnode;
4451
4617
 
4452
4618
  if (oldVnode.text !== text) {
@@ -4454,7 +4620,7 @@ function updateNodeHook(oldVnode, vnode) {
4454
4620
  unlockDomMutation();
4455
4621
  }
4456
4622
 
4457
- renderer.setText(elm, text);
4623
+ setText$1(elm, text);
4458
4624
 
4459
4625
  if (process.env.NODE_ENV !== 'production') {
4460
4626
  lockDomMutation();
@@ -4463,15 +4629,11 @@ function updateNodeHook(oldVnode, vnode) {
4463
4629
  }
4464
4630
 
4465
4631
  function insertNodeHook(vnode, parentNode, referenceNode) {
4466
- const {
4467
- renderer
4468
- } = vnode.owner;
4469
-
4470
4632
  if (process.env.NODE_ENV !== 'production') {
4471
4633
  unlockDomMutation();
4472
4634
  }
4473
4635
 
4474
- renderer.insert(vnode.elm, parentNode, referenceNode);
4636
+ insert$1(vnode.elm, parentNode, referenceNode);
4475
4637
 
4476
4638
  if (process.env.NODE_ENV !== 'production') {
4477
4639
  lockDomMutation();
@@ -4479,15 +4641,11 @@ function insertNodeHook(vnode, parentNode, referenceNode) {
4479
4641
  }
4480
4642
 
4481
4643
  function removeNodeHook(vnode, parentNode) {
4482
- const {
4483
- renderer
4484
- } = vnode.owner;
4485
-
4486
4644
  if (process.env.NODE_ENV !== 'production') {
4487
4645
  unlockDomMutation();
4488
4646
  }
4489
4647
 
4490
- renderer.remove(vnode.elm, parentNode);
4648
+ remove$1(vnode.elm, parentNode);
4491
4649
 
4492
4650
  if (process.env.NODE_ENV !== 'production') {
4493
4651
  lockDomMutation();
@@ -4579,13 +4737,15 @@ function updateElmHook(oldVnode, vnode) {
4579
4737
 
4580
4738
  function updateChildrenHook(oldVnode, vnode) {
4581
4739
  const {
4582
- children,
4583
- owner
4740
+ elm,
4741
+ children
4584
4742
  } = vnode;
4585
- const fn = hasDynamicChildren(children) ? updateDynamicChildren : updateStaticChildren;
4586
- runWithBoundaryProtection(owner, owner.owner, noop, () => {
4587
- fn(vnode.elm, oldVnode.children, children);
4588
- }, noop);
4743
+
4744
+ if (hasDynamicChildren(children)) {
4745
+ updateDynamicChildren(elm, oldVnode.children, children);
4746
+ } else {
4747
+ updateStaticChildren(elm, oldVnode.children, children);
4748
+ }
4589
4749
  }
4590
4750
 
4591
4751
  function allocateChildrenHook(vnode, vm) {
@@ -4651,8 +4811,7 @@ function createViewModelHook(elm, vnode) {
4651
4811
  createVM(elm, def, {
4652
4812
  mode,
4653
4813
  owner,
4654
- tagName: sel,
4655
- renderer: owner.renderer
4814
+ tagName: sel
4656
4815
  });
4657
4816
 
4658
4817
  if (process.env.NODE_ENV !== 'production') {
@@ -4698,16 +4857,13 @@ function vnodesAndElementHaveCompatibleAttrs(vnode, elm) {
4698
4857
  const {
4699
4858
  data: {
4700
4859
  attrs = {}
4701
- },
4702
- owner: {
4703
- renderer
4704
4860
  }
4705
4861
  } = vnode;
4706
4862
  let nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
4707
4863
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
4708
4864
 
4709
4865
  for (const [attrName, attrValue] of Object.entries(attrs)) {
4710
- const elmAttrValue = renderer.getAttribute(elm, attrName);
4866
+ const elmAttrValue = getAttribute$1(elm, attrName);
4711
4867
 
4712
4868
  if (String(attrValue) !== elmAttrValue) {
4713
4869
  logError(`Mismatch hydrating element <${elm.tagName.toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
@@ -4723,9 +4879,6 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
4723
4879
  data: {
4724
4880
  className,
4725
4881
  classMap
4726
- },
4727
- owner: {
4728
- renderer
4729
4882
  }
4730
4883
  } = vnode;
4731
4884
  let nodesAreCompatible = true;
@@ -4737,7 +4890,7 @@ function vnodesAndElementHaveCompatibleClass(vnode, elm) {
4737
4890
  vnodeClassName = className;
4738
4891
  } else if (!isUndefined$1(classMap)) {
4739
4892
  // classMap is used when class is set to static value.
4740
- const classList = renderer.getClassList(elm);
4893
+ const classList = getClassList$1(elm);
4741
4894
  let computedClassName = ''; // all classes from the vnode should be in the element.classList
4742
4895
 
4743
4896
  for (const name in classMap) {
@@ -4767,12 +4920,9 @@ function vnodesAndElementHaveCompatibleStyle(vnode, elm) {
4767
4920
  data: {
4768
4921
  style,
4769
4922
  styleDecls
4770
- },
4771
- owner: {
4772
- renderer
4773
4923
  }
4774
4924
  } = vnode;
4775
- const elmStyle = renderer.getAttribute(elm, 'style') || '';
4925
+ const elmStyle = getAttribute$1(elm, 'style') || '';
4776
4926
  let vnodeStyle;
4777
4927
  let nodesAreCompatible = true;
4778
4928
 
@@ -4909,12 +5059,12 @@ function hasDynamicChildren(children) {
4909
5059
  */
4910
5060
 
4911
5061
 
4912
- function getUpgradableConstructor(tagName, renderer) {
5062
+ function getUpgradableConstructor(tagName) {
4913
5063
  // Should never get a tag with upper case letter at this point, the compiler should
4914
5064
  // produce only tags with lowercase letters
4915
5065
  // But, for backwards compatibility, we will lower case the tagName
4916
5066
  tagName = tagName.toLowerCase();
4917
- let CE = renderer.getCustomElement(tagName);
5067
+ let CE = getCustomElement$1(tagName);
4918
5068
 
4919
5069
  if (!isUndefined$1(CE)) {
4920
5070
  return CE;
@@ -4925,7 +5075,7 @@ function getUpgradableConstructor(tagName, renderer) {
4925
5075
  */
4926
5076
 
4927
5077
 
4928
- CE = class LWCUpgradableElement extends renderer.HTMLElement {
5078
+ CE = class LWCUpgradableElement extends HTMLElementExported$1 {
4929
5079
  constructor(upgradeCallback) {
4930
5080
  super();
4931
5081
 
@@ -4935,7 +5085,7 @@ function getUpgradableConstructor(tagName, renderer) {
4935
5085
  }
4936
5086
 
4937
5087
  };
4938
- renderer.defineCustomElement(tagName, CE);
5088
+ defineCustomElement$1(tagName, CE);
4939
5089
  return CE;
4940
5090
  }
4941
5091
  /*
@@ -4953,10 +5103,7 @@ const TextHook = {
4953
5103
  const {
4954
5104
  owner
4955
5105
  } = vnode;
4956
- const {
4957
- renderer
4958
- } = owner;
4959
- const elm = renderer.createText(vnode.text);
5106
+ const elm = createText$1(vnode.text);
4960
5107
  linkNodeToShadow(elm, owner);
4961
5108
  vnode.elm = elm;
4962
5109
  },
@@ -4990,10 +5137,7 @@ const CommentHook = {
4990
5137
  owner,
4991
5138
  text
4992
5139
  } = vnode;
4993
- const {
4994
- renderer
4995
- } = owner;
4996
- const elm = renderer.createComment(text);
5140
+ const elm = createComment$1(text);
4997
5141
  linkNodeToShadow(elm, owner);
4998
5142
  vnode.elm = elm;
4999
5143
  },
@@ -5035,11 +5179,8 @@ const ElementHook = {
5035
5179
  svg
5036
5180
  }
5037
5181
  } = vnode;
5038
- const {
5039
- renderer
5040
- } = owner;
5041
5182
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
5042
- const elm = renderer.createElement(sel, namespace);
5183
+ const elm = createElement$1(sel, namespace);
5043
5184
  linkNodeToShadow(elm, owner);
5044
5185
  fallbackElmHook(elm, vnode);
5045
5186
  vnode.elm = elm;
@@ -5099,10 +5240,7 @@ const CustomElementHook = {
5099
5240
  sel,
5100
5241
  owner
5101
5242
  } = vnode;
5102
- const {
5103
- renderer
5104
- } = owner;
5105
- const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5243
+ const UpgradableConstructor = getUpgradableConstructor(sel);
5106
5244
  /**
5107
5245
  * Note: if the upgradable constructor does not expect, or throw when we new it
5108
5246
  * with a callback as the first argument, we could implement a more advanced
@@ -5195,8 +5333,7 @@ const CustomElementHook = {
5195
5333
  createVM(elm, def, {
5196
5334
  mode,
5197
5335
  owner,
5198
- tagName: sel,
5199
- renderer: owner.renderer
5336
+ tagName: sel
5200
5337
  });
5201
5338
  vnode.elm = elm;
5202
5339
  const vm = getAssociatedVM(elm);
@@ -5225,12 +5362,11 @@ const CustomElementHook = {
5225
5362
 
5226
5363
  function linkNodeToShadow(elm, owner) {
5227
5364
  const {
5228
- renderer,
5229
5365
  renderMode,
5230
5366
  shadowMode
5231
5367
  } = owner; // TODO [#1164]: this should eventually be done by the polyfill directly
5232
5368
 
5233
- if (renderer.isSyntheticShadowDefined) {
5369
+ if (isSyntheticShadowDefined$1) {
5234
5370
  if (shadowMode === 1
5235
5371
  /* Synthetic */
5236
5372
  || renderMode === 0
@@ -5762,7 +5898,6 @@ function updateStylesheetToken(vm, template) {
5762
5898
  const {
5763
5899
  elm,
5764
5900
  context,
5765
- renderer,
5766
5901
  renderMode,
5767
5902
  shadowMode
5768
5903
  } = vm;
@@ -5789,11 +5924,11 @@ function updateStylesheetToken(vm, template) {
5789
5924
  } = context;
5790
5925
 
5791
5926
  if (oldHasTokenInClass) {
5792
- renderer.getClassList(elm).remove(makeHostToken(oldToken));
5927
+ getClassList$1(elm).remove(makeHostToken(oldToken));
5793
5928
  }
5794
5929
 
5795
5930
  if (oldHasTokenInAttribute) {
5796
- renderer.removeAttribute(elm, makeHostToken(oldToken));
5931
+ removeAttribute$1(elm, makeHostToken(oldToken));
5797
5932
  } // Apply the new template styling token to the host element, if the new template has any
5798
5933
  // associated stylesheets. In the case of light DOM, also ensure there is at least one scoped stylesheet.
5799
5934
 
@@ -5805,12 +5940,12 @@ function updateStylesheetToken(vm, template) {
5805
5940
 
5806
5941
  if (!isUndefined$1(newToken)) {
5807
5942
  if (hasScopedStyles) {
5808
- renderer.getClassList(elm).add(makeHostToken(newToken));
5943
+ getClassList$1(elm).add(makeHostToken(newToken));
5809
5944
  newHasTokenInClass = true;
5810
5945
  }
5811
5946
 
5812
5947
  if (isSyntheticShadow) {
5813
- renderer.setAttribute(elm, makeHostToken(newToken), '');
5948
+ setAttribute$1(elm, makeHostToken(newToken), '');
5814
5949
  newHasTokenInAttribute = true;
5815
5950
  }
5816
5951
  } // Update the styling tokens present on the context object.
@@ -5823,6 +5958,7 @@ function updateStylesheetToken(vm, template) {
5823
5958
 
5824
5959
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5825
5960
  const content = [];
5961
+ let root;
5826
5962
 
5827
5963
  for (let i = 0; i < stylesheets.length; i++) {
5828
5964
  let stylesheet = stylesheets[i];
@@ -5835,23 +5971,46 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5835
5971
  // the component instance might be attempting to use an old version of
5836
5972
  // the stylesheet, while internally, we have a replacement for it.
5837
5973
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5838
- } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5839
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5974
+ }
5840
5975
 
5976
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5977
+
5978
+ const scopeToken = isScopedCss || vm.shadowMode === 1
5979
+ /* Synthetic */
5980
+ && vm.renderMode === 1
5981
+ /* Shadow */
5982
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5983
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5841
5984
 
5842
- const isScopedCss = stylesheet[KEY__SCOPED_CSS];
5843
5985
  const useActualHostSelector = vm.renderMode === 0
5844
5986
  /* Light */
5845
5987
  ? !isScopedCss : vm.shadowMode === 0
5846
5988
  /* Native */
5847
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5989
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5990
+ // we use an attribute selector on the host to simulate :dir().
5848
5991
 
5849
- const scopeToken = isScopedCss || vm.shadowMode === 1
5850
- /* Synthetic */
5851
- && vm.renderMode === 1
5992
+ let useNativeDirPseudoclass;
5993
+
5994
+ if (vm.renderMode === 1
5852
5995
  /* Shadow */
5853
- ? stylesheetToken : undefined;
5854
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
5996
+ ) {
5997
+ useNativeDirPseudoclass = vm.shadowMode === 0
5998
+ /* Native */
5999
+ ;
6000
+ } else {
6001
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
6002
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
6003
+ if (isUndefined$1(root)) {
6004
+ // Only calculate the root once as necessary
6005
+ root = getNearestShadowComponent(vm);
6006
+ }
6007
+
6008
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
6009
+ /* Native */
6010
+ ;
6011
+ }
6012
+
6013
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5855
6014
  }
5856
6015
  }
5857
6016
 
@@ -5875,14 +6034,12 @@ function getStylesheetsContent(vm, template) {
5875
6034
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
5876
6035
 
5877
6036
 
5878
- function getNearestNativeShadowComponent(vm) {
6037
+ function getNearestShadowComponent(vm) {
5879
6038
  let owner = vm;
5880
6039
 
5881
6040
  while (!isNull(owner)) {
5882
6041
  if (owner.renderMode === 1
5883
6042
  /* Shadow */
5884
- && owner.shadowMode === 0
5885
- /* Native */
5886
6043
  ) {
5887
6044
  return owner;
5888
6045
  }
@@ -5893,9 +6050,22 @@ function getNearestNativeShadowComponent(vm) {
5893
6050
  return owner;
5894
6051
  }
5895
6052
 
6053
+ function getNearestNativeShadowComponent(vm) {
6054
+ const owner = getNearestShadowComponent(vm);
6055
+
6056
+ if (!isNull(owner) && owner.shadowMode === 1
6057
+ /* Synthetic */
6058
+ ) {
6059
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
6060
+ // synthetic, we know we won't find a native component if we go any further.
6061
+ return null;
6062
+ }
6063
+
6064
+ return owner;
6065
+ }
6066
+
5896
6067
  function createStylesheet(vm, stylesheets) {
5897
6068
  const {
5898
- renderer,
5899
6069
  renderMode,
5900
6070
  shadowMode
5901
6071
  } = vm;
@@ -5906,9 +6076,9 @@ function createStylesheet(vm, stylesheets) {
5906
6076
  /* Synthetic */
5907
6077
  ) {
5908
6078
  for (let i = 0; i < stylesheets.length; i++) {
5909
- renderer.insertGlobalStylesheet(stylesheets[i]);
6079
+ insertGlobalStylesheet$1(stylesheets[i]);
5910
6080
  }
5911
- } else if (renderer.ssr || renderer.isHydrating()) {
6081
+ } else if (ssr$1 || isHydrating$1()) {
5912
6082
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
5913
6083
  // This works in the client, because the stylesheets are created, and cached in the VM
5914
6084
  // the first time the VM renders.
@@ -5922,10 +6092,10 @@ function createStylesheet(vm, stylesheets) {
5922
6092
 
5923
6093
  for (let i = 0; i < stylesheets.length; i++) {
5924
6094
  if (isGlobal) {
5925
- renderer.insertGlobalStylesheet(stylesheets[i]);
6095
+ insertGlobalStylesheet$1(stylesheets[i]);
5926
6096
  } else {
5927
6097
  // local level
5928
- renderer.insertStylesheet(stylesheets[i], root.cmpRoot);
6098
+ insertStylesheet$1(stylesheets[i], root.cmpRoot);
5929
6099
  }
5930
6100
  }
5931
6101
  }
@@ -6559,7 +6729,6 @@ function createVM(elm, def, options) {
6559
6729
  const {
6560
6730
  mode,
6561
6731
  owner,
6562
- renderer,
6563
6732
  tagName
6564
6733
  } = options;
6565
6734
  const vm = {
@@ -6574,7 +6743,6 @@ function createVM(elm, def, options) {
6574
6743
  tagName,
6575
6744
  mode,
6576
6745
  owner,
6577
- renderer,
6578
6746
  children: EmptyArray,
6579
6747
  aChildren: EmptyArray,
6580
6748
  velements: EmptyArray,
@@ -6629,16 +6797,11 @@ function createVM(elm, def, options) {
6629
6797
 
6630
6798
  function computeShadowMode(vm) {
6631
6799
  const {
6632
- def,
6633
- renderer
6800
+ def
6634
6801
  } = vm;
6635
- const {
6636
- isNativeShadowDefined,
6637
- isSyntheticShadowDefined
6638
- } = renderer;
6639
6802
  let shadowMode;
6640
6803
 
6641
- if (isSyntheticShadowDefined) {
6804
+ if (isSyntheticShadowDefined$1) {
6642
6805
  if (def.renderMode === 0
6643
6806
  /* Light */
6644
6807
  ) {
@@ -6647,7 +6810,7 @@ function computeShadowMode(vm) {
6647
6810
  shadowMode = 0
6648
6811
  /* Native */
6649
6812
  ;
6650
- } else if (isNativeShadowDefined) {
6813
+ } else if (isNativeShadowDefined$1) {
6651
6814
  if (def.shadowSupportMode === "any"
6652
6815
  /* Any */
6653
6816
  ) {
@@ -6787,13 +6950,12 @@ function patchShadowRoot(vm, newCh) {
6787
6950
 
6788
6951
  function runRenderedCallback(vm) {
6789
6952
  const {
6790
- renderer,
6791
6953
  def: {
6792
6954
  renderedCallback
6793
6955
  }
6794
6956
  } = vm;
6795
6957
 
6796
- if (isTrue(renderer.ssr)) {
6958
+ if (isTrue(ssr$1)) {
6797
6959
  return;
6798
6960
  }
6799
6961
 
@@ -7019,8 +7181,7 @@ function recursivelyDisconnectChildren(vnodes) {
7019
7181
 
7020
7182
  function resetComponentRoot(vm) {
7021
7183
  const {
7022
- children,
7023
- renderer
7184
+ children
7024
7185
  } = vm;
7025
7186
  const rootNode = getRenderRoot(vm);
7026
7187
 
@@ -7028,7 +7189,7 @@ function resetComponentRoot(vm) {
7028
7189
  const child = children[i];
7029
7190
 
7030
7191
  if (!isNull(child) && !isUndefined$1(child.elm)) {
7031
- renderer.remove(child.elm, rootNode);
7192
+ remove$1(child.elm, rootNode);
7032
7193
  }
7033
7194
  }
7034
7195
 
@@ -7038,7 +7199,7 @@ function resetComponentRoot(vm) {
7038
7199
  }
7039
7200
 
7040
7201
  function scheduleRehydration(vm) {
7041
- if (isTrue(vm.renderer.ssr) || isTrue(vm.isScheduled)) {
7202
+ if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
7042
7203
  return;
7043
7204
  }
7044
7205
 
@@ -7265,7 +7426,6 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
7265
7426
 
7266
7427
  const {
7267
7428
  elm,
7268
- renderer,
7269
7429
  context: {
7270
7430
  wiredConnecting,
7271
7431
  wiredDisconnecting
@@ -7292,7 +7452,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
7292
7452
  }
7293
7453
 
7294
7454
  });
7295
- renderer.dispatchEvent(elm, contextRegistrationEvent);
7455
+ dispatchEvent$1(elm, contextRegistrationEvent);
7296
7456
  });
7297
7457
  }
7298
7458
 
@@ -7557,7 +7717,7 @@ function setHooks(hooks) {
7557
7717
  hooksAreSet = true;
7558
7718
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7559
7719
  }
7560
- /* version: 2.5.10 */
7720
+ /* version: 2.6.3 */
7561
7721
 
7562
7722
  /*
7563
7723
  * Copyright (c) 2020, salesforce.com, inc.
@@ -7631,7 +7791,7 @@ function registerCustomElement(name, ctor) {
7631
7791
  reverseRegistry.set(ctor, name);
7632
7792
  }
7633
7793
 
7634
- class HTMLElement$1 {
7794
+ class HTMLElementImpl {
7635
7795
  constructor() {
7636
7796
  const {
7637
7797
  constructor
@@ -7647,275 +7807,321 @@ class HTMLElement$1 {
7647
7807
 
7648
7808
  }
7649
7809
 
7650
- const renderer = {
7651
- ssr: true,
7652
-
7653
- isHydrating() {
7654
- return false;
7655
- },
7810
+ const ssr = true;
7656
7811
 
7657
- isNativeShadowDefined: false,
7658
- isSyntheticShadowDefined: false,
7812
+ function isHydrating() {
7813
+ return false;
7814
+ }
7659
7815
 
7660
- insert(node, parent, anchor) {
7661
- if (node.parent !== null && node.parent !== parent) {
7662
- const nodeIndex = node.parent.children.indexOf(node);
7663
- node.parent.children.splice(nodeIndex, 1);
7664
- }
7816
+ const isNativeShadowDefined = false;
7817
+ const isSyntheticShadowDefined = false;
7665
7818
 
7666
- node.parent = parent;
7667
- const anchorIndex = isNull(anchor) ? -1 : parent.children.indexOf(anchor);
7819
+ function insert(node, parent, anchor) {
7820
+ if (node.parent !== null && node.parent !== parent) {
7821
+ const nodeIndex = node.parent.children.indexOf(node);
7822
+ node.parent.children.splice(nodeIndex, 1);
7823
+ }
7668
7824
 
7669
- if (anchorIndex === -1) {
7670
- parent.children.push(node);
7671
- } else {
7672
- parent.children.splice(anchorIndex, 0, node);
7673
- }
7674
- },
7825
+ node.parent = parent;
7826
+ const anchorIndex = isNull(anchor) ? -1 : parent.children.indexOf(anchor);
7675
7827
 
7676
- remove(node, parent) {
7677
- const nodeIndex = parent.children.indexOf(node);
7678
- parent.children.splice(nodeIndex, 1);
7679
- },
7828
+ if (anchorIndex === -1) {
7829
+ parent.children.push(node);
7830
+ } else {
7831
+ parent.children.splice(anchorIndex, 0, node);
7832
+ }
7833
+ }
7680
7834
 
7681
- createElement,
7835
+ function remove(node, parent) {
7836
+ const nodeIndex = parent.children.indexOf(node);
7837
+ parent.children.splice(nodeIndex, 1);
7838
+ }
7682
7839
 
7683
- createText(content) {
7684
- return {
7685
- type: HostNodeType.Text,
7686
- value: String(content),
7687
- parent: null
7688
- };
7689
- },
7840
+ function createText(content) {
7841
+ return {
7842
+ type: HostNodeType.Text,
7843
+ value: String(content),
7844
+ parent: null
7845
+ };
7846
+ }
7690
7847
 
7691
- createComment(content) {
7692
- return {
7693
- type: HostNodeType.Comment,
7694
- value: content,
7695
- parent: null
7696
- };
7697
- },
7848
+ function createComment(content) {
7849
+ return {
7850
+ type: HostNodeType.Comment,
7851
+ value: content,
7852
+ parent: null
7853
+ };
7854
+ }
7698
7855
 
7699
- nextSibling(node) {
7700
- const {
7701
- parent
7702
- } = node;
7856
+ function nextSibling(node) {
7857
+ const {
7858
+ parent
7859
+ } = node;
7703
7860
 
7704
- if (isNull(parent)) {
7705
- return null;
7706
- }
7861
+ if (isNull(parent)) {
7862
+ return null;
7863
+ }
7707
7864
 
7708
- const nodeIndex = parent.children.indexOf(node);
7709
- return parent.children[nodeIndex + 1] || null;
7710
- },
7865
+ const nodeIndex = parent.children.indexOf(node);
7866
+ return parent.children[nodeIndex + 1] || null;
7867
+ }
7711
7868
 
7712
- attachShadow(element, config) {
7713
- element.shadowRoot = {
7714
- type: HostNodeType.ShadowRoot,
7715
- children: [],
7716
- mode: config.mode,
7717
- delegatesFocus: !!config.delegatesFocus
7718
- };
7719
- return element.shadowRoot;
7720
- },
7869
+ function attachShadow(element, config) {
7870
+ element.shadowRoot = {
7871
+ type: HostNodeType.ShadowRoot,
7872
+ children: [],
7873
+ mode: config.mode,
7874
+ delegatesFocus: !!config.delegatesFocus
7875
+ };
7876
+ return element.shadowRoot;
7877
+ }
7721
7878
 
7722
- getProperty(node, key) {
7723
- var _a, _b;
7879
+ function getProperty(node, key) {
7880
+ var _a, _b;
7724
7881
 
7725
- if (key in node) {
7726
- return node[key];
7727
- }
7882
+ if (key in node) {
7883
+ return node[key];
7884
+ }
7728
7885
 
7729
- if (node.type === HostNodeType.Element) {
7730
- const attrName = htmlPropertyToAttribute(key); // Handle all the boolean properties.
7886
+ if (node.type === HostNodeType.Element) {
7887
+ const attrName = htmlPropertyToAttribute(key); // Handle all the boolean properties.
7731
7888
 
7732
- if (isBooleanAttribute(attrName, node.name)) {
7733
- return (_a = this.getAttribute(node, attrName)) !== null && _a !== void 0 ? _a : false;
7734
- } // Handle global html attributes and AOM.
7889
+ if (isBooleanAttribute(attrName, node.name)) {
7890
+ return (_a = getAttribute(node, attrName)) !== null && _a !== void 0 ? _a : false;
7891
+ } // Handle global html attributes and AOM.
7735
7892
 
7736
7893
 
7737
- if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
7738
- return this.getAttribute(node, attrName);
7739
- } // Handle special elements live bindings. The checked property is already handled above
7740
- // in the boolean case.
7894
+ if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
7895
+ return getAttribute(node, attrName);
7896
+ } // Handle special elements live bindings. The checked property is already handled above
7897
+ // in the boolean case.
7741
7898
 
7742
7899
 
7743
- if (node.name === 'input' && key === 'value') {
7744
- return (_b = this.getAttribute(node, 'value')) !== null && _b !== void 0 ? _b : '';
7745
- }
7900
+ if (node.name === 'input' && key === 'value') {
7901
+ return (_b = getAttribute(node, 'value')) !== null && _b !== void 0 ? _b : '';
7746
7902
  }
7903
+ }
7747
7904
 
7748
- if (process.env.NODE_ENV !== 'production') {
7749
- // eslint-disable-next-line no-console
7750
- console.error(`Unexpected "${key}" property access from the renderer`);
7751
- }
7752
- },
7905
+ if (process.env.NODE_ENV !== 'production') {
7906
+ // eslint-disable-next-line no-console
7907
+ console.error(`Unexpected "${key}" property access from the renderer`);
7908
+ }
7909
+ }
7753
7910
 
7754
- setProperty(node, key, value) {
7755
- if (key in node) {
7756
- return node[key] = value;
7757
- }
7911
+ function setProperty(node, key, value) {
7912
+ if (key in node) {
7913
+ return node[key] = value;
7914
+ }
7758
7915
 
7759
- if (node.type === HostNodeType.Element) {
7760
- const attrName = htmlPropertyToAttribute(key);
7916
+ if (node.type === HostNodeType.Element) {
7917
+ const attrName = htmlPropertyToAttribute(key);
7761
7918
 
7762
- if (key === 'innerHTML') {
7763
- node.children = [{
7764
- type: HostNodeType.Raw,
7765
- parent: node,
7766
- value
7767
- }];
7768
- return;
7769
- } // Handle all the boolean properties.
7919
+ if (key === 'innerHTML') {
7920
+ node.children = [{
7921
+ type: HostNodeType.Raw,
7922
+ parent: node,
7923
+ value
7924
+ }];
7925
+ return;
7926
+ } // Handle all the boolean properties.
7770
7927
 
7771
7928
 
7772
- if (isBooleanAttribute(attrName, node.name)) {
7773
- return value === true ? this.setAttribute(node, attrName, '') : this.removeAttribute(node, attrName);
7774
- } // Handle global html attributes and AOM.
7929
+ if (isBooleanAttribute(attrName, node.name)) {
7930
+ return value === true ? setAttribute(node, attrName, '') : removeAttribute(node, attrName);
7931
+ } // Handle global html attributes and AOM.
7775
7932
 
7776
7933
 
7777
- if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
7778
- return this.setAttribute(node, attrName, value);
7779
- } // Handle special elements live bindings. The checked property is already handled above
7780
- // in the boolean case.
7934
+ if (isGlobalHtmlAttribute(attrName) || isAriaAttribute(attrName)) {
7935
+ return setAttribute(node, attrName, value);
7936
+ } // Handle special elements live bindings. The checked property is already handled above
7937
+ // in the boolean case.
7781
7938
 
7782
7939
 
7783
- if (node.name === 'input' && attrName === 'value') {
7784
- return isNull(value) || isUndefined$1(value) ? this.removeAttribute(node, 'value') : this.setAttribute(node, 'value', value);
7785
- }
7940
+ if (node.name === 'input' && attrName === 'value') {
7941
+ return isNull(value) || isUndefined$1(value) ? removeAttribute(node, 'value') : setAttribute(node, 'value', value);
7786
7942
  }
7943
+ }
7787
7944
 
7788
- if (process.env.NODE_ENV !== 'production') {
7789
- // eslint-disable-next-line no-console
7790
- console.error(`Unexpected attempt to set "${key}=${value}" property from the renderer`);
7791
- }
7792
- },
7945
+ if (process.env.NODE_ENV !== 'production') {
7946
+ // eslint-disable-next-line no-console
7947
+ console.error(`Unexpected attempt to set "${key}=${value}" property from the renderer`);
7948
+ }
7949
+ }
7793
7950
 
7794
- setText(node, content) {
7795
- if (node.type === HostNodeType.Text) {
7796
- node.value = content;
7797
- } else if (node.type === HostNodeType.Element) {
7798
- node.children = [{
7799
- type: HostNodeType.Text,
7800
- parent: node,
7801
- value: content
7802
- }];
7803
- }
7804
- },
7951
+ function setText(node, content) {
7952
+ if (node.type === HostNodeType.Text) {
7953
+ node.value = content;
7954
+ } else if (node.type === HostNodeType.Element) {
7955
+ node.children = [{
7956
+ type: HostNodeType.Text,
7957
+ parent: node,
7958
+ value: content
7959
+ }];
7960
+ }
7961
+ }
7805
7962
 
7806
- getAttribute(element, name, namespace = null) {
7807
- const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
7808
- return attribute ? attribute.value : null;
7809
- },
7963
+ function getAttribute(element, name, namespace = null) {
7964
+ const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
7965
+ return attribute ? attribute.value : null;
7966
+ }
7810
7967
 
7811
- setAttribute(element, name, value, namespace = null) {
7812
- const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
7968
+ function setAttribute(element, name, value, namespace = null) {
7969
+ const attribute = element.attributes.find(attr => attr.name === name && attr.namespace === namespace);
7813
7970
 
7814
- if (isUndefined$1(attribute)) {
7815
- element.attributes.push({
7816
- name,
7817
- namespace,
7818
- value: String(value)
7819
- });
7820
- } else {
7821
- attribute.value = value;
7971
+ if (isUndefined$1(namespace)) {
7972
+ namespace = null;
7973
+ }
7974
+
7975
+ if (isUndefined$1(attribute)) {
7976
+ element.attributes.push({
7977
+ name,
7978
+ namespace,
7979
+ value: String(value)
7980
+ });
7981
+ } else {
7982
+ attribute.value = value;
7983
+ }
7984
+ }
7985
+
7986
+ function removeAttribute(element, name, namespace) {
7987
+ element.attributes = element.attributes.filter(attr => attr.name !== name && attr.namespace !== namespace);
7988
+ }
7989
+
7990
+ function getClassList(element) {
7991
+ function getClassAttribute() {
7992
+ let classAttribute = element.attributes.find(attr => attr.name === 'class' && isNull(attr.namespace));
7993
+
7994
+ if (isUndefined$1(classAttribute)) {
7995
+ classAttribute = {
7996
+ name: 'class',
7997
+ namespace: null,
7998
+ value: ''
7999
+ };
8000
+ element.attributes.push(classAttribute);
7822
8001
  }
7823
- },
7824
8002
 
7825
- removeAttribute(element, name, namespace) {
7826
- element.attributes = element.attributes.filter(attr => attr.name !== name && attr.namespace !== namespace);
7827
- },
8003
+ return classAttribute;
8004
+ }
7828
8005
 
7829
- getClassList(element) {
7830
- function getClassAttribute() {
7831
- let classAttribute = element.attributes.find(attr => attr.name === 'class' && isNull(attr.namespace));
7832
-
7833
- if (isUndefined$1(classAttribute)) {
7834
- classAttribute = {
7835
- name: 'class',
7836
- namespace: null,
7837
- value: ''
7838
- };
7839
- element.attributes.push(classAttribute);
7840
- }
8006
+ return {
8007
+ add(...names) {
8008
+ const classAttribute = getClassAttribute();
8009
+ const tokenList = classNameToTokenList(classAttribute.value);
8010
+ names.forEach(name => tokenList.add(name));
8011
+ classAttribute.value = tokenListToClassName(tokenList);
8012
+ },
7841
8013
 
7842
- return classAttribute;
8014
+ remove(...names) {
8015
+ const classAttribute = getClassAttribute();
8016
+ const tokenList = classNameToTokenList(classAttribute.value);
8017
+ names.forEach(name => tokenList.delete(name));
8018
+ classAttribute.value = tokenListToClassName(tokenList);
7843
8019
  }
7844
8020
 
7845
- return {
7846
- add(...names) {
7847
- const classAttribute = getClassAttribute();
7848
- const tokenList = classNameToTokenList(classAttribute.value);
7849
- names.forEach(name => tokenList.add(name));
7850
- classAttribute.value = tokenListToClassName(tokenList);
7851
- },
8021
+ };
8022
+ }
7852
8023
 
7853
- remove(...names) {
7854
- const classAttribute = getClassAttribute();
7855
- const tokenList = classNameToTokenList(classAttribute.value);
7856
- names.forEach(name => tokenList.delete(name));
7857
- classAttribute.value = tokenListToClassName(tokenList);
7858
- }
8024
+ function setCSSStyleProperty(element, name, value, important) {
8025
+ const styleAttribute = element.attributes.find(attr => attr.name === 'style' && isNull(attr.namespace));
8026
+ const serializedProperty = `${name}: ${value}${important ? ' !important' : ''}`;
7859
8027
 
7860
- };
7861
- },
8028
+ if (isUndefined$1(styleAttribute)) {
8029
+ element.attributes.push({
8030
+ name: 'style',
8031
+ namespace: null,
8032
+ value: serializedProperty
8033
+ });
8034
+ } else {
8035
+ styleAttribute.value += `; ${serializedProperty}`;
8036
+ }
8037
+ }
7862
8038
 
7863
- setCSSStyleProperty(element, name, value, important) {
7864
- const styleAttribute = element.attributes.find(attr => attr.name === 'style' && isNull(attr.namespace));
7865
- const serializedProperty = `${name}: ${value}${important ? ' !important' : ''}`;
8039
+ function isConnected(node) {
8040
+ return !isNull(node.parent);
8041
+ } // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
8042
+ // synthetic shadow.
7866
8043
 
7867
- if (isUndefined$1(styleAttribute)) {
7868
- element.attributes.push({
7869
- name: 'style',
7870
- namespace: null,
7871
- value: serializedProperty
7872
- });
7873
- } else {
7874
- styleAttribute.value += `; ${serializedProperty}`;
7875
- }
7876
- },
7877
8044
 
7878
- isConnected(node) {
7879
- return !isNull(node.parent);
7880
- },
8045
+ const insertGlobalStylesheet = noop; // Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
8046
+ // synthetic shadow.
7881
8047
 
7882
- insertGlobalStylesheet() {// Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
7883
- // synthetic shadow.
7884
- },
8048
+ const insertStylesheet = noop; // Noop on SSR.
7885
8049
 
7886
- insertStylesheet() {// Noop on SSR (for now). This need to be reevaluated whenever we will implement support for
7887
- // synthetic shadow.
7888
- },
8050
+ const addEventListener = noop; // Noop on SSR.
7889
8051
 
7890
- addEventListener() {// Noop on SSR.
7891
- },
8052
+ const removeEventListener = noop;
8053
+ const dispatchEvent = unsupportedMethod('dispatchEvent');
8054
+ const getBoundingClientRect = unsupportedMethod('getBoundingClientRect');
8055
+ const querySelector = unsupportedMethod('querySelector');
8056
+ const querySelectorAll = unsupportedMethod('querySelectorAll');
8057
+ const getElementsByTagName = unsupportedMethod('getElementsByTagName');
8058
+ const getElementsByClassName = unsupportedMethod('getElementsByClassName');
8059
+ const getChildren = unsupportedMethod('getChildren');
8060
+ const getChildNodes = unsupportedMethod('getChildNodes');
8061
+ const getFirstChild = unsupportedMethod('getFirstChild');
8062
+ const getFirstElementChild = unsupportedMethod('getFirstElementChild');
8063
+ const getLastChild = unsupportedMethod('getLastChild');
8064
+ const getLastElementChild = unsupportedMethod('getLastElementChild');
7892
8065
 
7893
- removeEventListener() {// Noop on SSR.
7894
- },
8066
+ function defineCustomElement(name, constructor, _options) {
8067
+ registerCustomElement(name, constructor);
8068
+ }
7895
8069
 
7896
- dispatchEvent: unsupportedMethod('dispatchEvent'),
7897
- getBoundingClientRect: unsupportedMethod('getBoundingClientRect'),
7898
- querySelector: unsupportedMethod('querySelector'),
7899
- querySelectorAll: unsupportedMethod('querySelectorAll'),
7900
- getElementsByTagName: unsupportedMethod('getElementsByTagName'),
7901
- getElementsByClassName: unsupportedMethod('getElementsByClassName'),
7902
- getChildren: unsupportedMethod('getChildren'),
7903
- getChildNodes: unsupportedMethod('getChildNodes'),
7904
- getFirstChild: unsupportedMethod('getFirstChild'),
7905
- getFirstElementChild: unsupportedMethod('getFirstElementChild'),
7906
- getLastChild: unsupportedMethod('getLastChild'),
7907
- getLastElementChild: unsupportedMethod('getLastElementChild'),
7908
-
7909
- defineCustomElement(name, constructor, _options) {
7910
- registerCustomElement(name, constructor);
7911
- },
8070
+ function getCustomElement(name) {
8071
+ return registry[name];
8072
+ }
7912
8073
 
7913
- getCustomElement(name) {
7914
- return registry[name];
7915
- },
8074
+ const HTMLElementExported = HTMLElementImpl;
8075
+ /* noop */
7916
8076
 
7917
- HTMLElement: HTMLElement$1
7918
- };
8077
+ const assertInstanceOfHTMLElement = noop;
8078
+ /*
8079
+ * Copyright (c) 2020, salesforce.com, inc.
8080
+ * All rights reserved.
8081
+ * SPDX-License-Identifier: MIT
8082
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8083
+ */
8084
+
8085
+ setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
8086
+ setAttachShadow(attachShadow);
8087
+ setCreateComment(createComment);
8088
+ setCreateElement(createElement);
8089
+ setCreateText(createText);
8090
+ setDefineCustomElement(defineCustomElement);
8091
+ setDispatchEvent(dispatchEvent);
8092
+ setGetAttribute(getAttribute);
8093
+ setGetBoundingClientRect(getBoundingClientRect);
8094
+ setGetChildNodes(getChildNodes);
8095
+ setGetChildren(getChildren);
8096
+ setGetClassList(getClassList);
8097
+ setGetCustomElement(getCustomElement);
8098
+ setGetElementsByClassName(getElementsByClassName);
8099
+ setGetElementsByTagName(getElementsByTagName);
8100
+ setGetFirstChild(getFirstChild);
8101
+ setGetFirstElementChild(getFirstElementChild);
8102
+ setGetLastChild(getLastChild);
8103
+ setGetLastElementChild(getLastElementChild);
8104
+ setGetProperty(getProperty);
8105
+ setHTMLElement(HTMLElementExported);
8106
+ setInsert(insert);
8107
+ setInsertGlobalStylesheet(insertGlobalStylesheet);
8108
+ setInsertStylesheet(insertStylesheet);
8109
+ setIsConnected(isConnected);
8110
+ setIsHydrating(isHydrating);
8111
+ setIsNativeShadowDefined(isNativeShadowDefined);
8112
+ setIsSyntheticShadowDefined(isSyntheticShadowDefined);
8113
+ setNextSibling(nextSibling);
8114
+ setQuerySelector(querySelector);
8115
+ setQuerySelectorAll(querySelectorAll);
8116
+ setRemove(remove);
8117
+ setRemoveAttribute(removeAttribute);
8118
+ setRemoveEventListener(removeEventListener);
8119
+ setSetAttribute(setAttribute);
8120
+ setSetCSSStyleProperty(setCSSStyleProperty);
8121
+ setSetProperty(setProperty);
8122
+ setSetText(setText);
8123
+ setSsr(ssr);
8124
+ setAddEventListener(addEventListener);
7919
8125
  /*
7920
8126
  * Copyright (c) 2020, salesforce.com, inc.
7921
8127
  * All rights reserved.
@@ -8026,12 +8232,11 @@ function renderComponent(tagName, Ctor, props = {}) {
8026
8232
  throw new TypeError(`"renderComponent" expects an object as the third parameter but instead received ${props}.`);
8027
8233
  }
8028
8234
 
8029
- const element = renderer.createElement(tagName);
8235
+ const element = createElement(tagName);
8030
8236
  const def = getComponentInternalDef(Ctor);
8031
8237
  createVM(element, def, {
8032
8238
  mode: 'open',
8033
8239
  owner: null,
8034
- renderer,
8035
8240
  tagName
8036
8241
  });
8037
8242
 
@@ -8053,7 +8258,7 @@ function renderComponent(tagName, Ctor, props = {}) {
8053
8258
 
8054
8259
  freeze(LightningElement);
8055
8260
  seal(LightningElement.prototype);
8056
- /* version: 2.5.10 */
8261
+ /* version: 2.6.3 */
8057
8262
 
8058
8263
  exports.LightningElement = LightningElement;
8059
8264
  exports.api = api$1;