lwc 2.13.4 → 2.14.2

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 (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +488 -547
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +488 -546
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +430 -490
  5. package/dist/engine-dom/iife/es5/engine-dom.js +600 -715
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +535 -655
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +488 -546
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +430 -490
  11. package/dist/engine-dom/umd/es5/engine-dom.js +600 -715
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +535 -655
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +371 -450
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +371 -451
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +7 -7
@@ -298,9 +298,9 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
298
298
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
299
299
  */
300
300
  // Increment whenever the LWC template compiler changes
301
- const LWC_VERSION = "2.13.4";
301
+ const LWC_VERSION = "2.14.2";
302
302
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
303
- /** version: 2.13.4 */
303
+ /** version: 2.14.2 */
304
304
 
305
305
  /*
306
306
  * Copyright (c) 2018, salesforce.com, inc.
@@ -454,7 +454,32 @@ function setFeatureFlagForTest(name, value) {
454
454
  setFeatureFlag(name, value);
455
455
  }
456
456
  }
457
- /** version: 2.13.4 */
457
+ /** version: 2.14.2 */
458
+
459
+ /*
460
+ * Copyright (c) 2018, salesforce.com, inc.
461
+ * All rights reserved.
462
+ * SPDX-License-Identifier: MIT
463
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
464
+ */
465
+ // @ts-ignore
466
+
467
+ if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
468
+ window.addEventListener('test-dummy-flag', () => {
469
+ let hasFlag = false;
470
+
471
+ if (runtimeFlags.DUMMY_TEST_FLAG) {
472
+ hasFlag = true;
473
+ }
474
+
475
+ window.dispatchEvent(new CustomEvent('has-dummy-flag', {
476
+ detail: {
477
+ package: '@lwc/engine-dom',
478
+ hasFlag
479
+ }
480
+ }));
481
+ });
482
+ }
458
483
 
459
484
  /* proxy-compat-disable */
460
485
 
@@ -564,162 +589,6 @@ function flattenStylesheets(stylesheets) {
564
589
  return list;
565
590
  }
566
591
 
567
- //
568
- // Primitives
569
- //
570
- let ssr$1;
571
- function setSsr(ssrImpl) {
572
- ssr$1 = ssrImpl;
573
- }
574
- let isNativeShadowDefined$1;
575
- function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
576
- isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
577
- }
578
- let isSyntheticShadowDefined$1;
579
- function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
580
- isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
581
- }
582
- let HTMLElementExported$1;
583
- function setHTMLElement(HTMLElementImpl) {
584
- HTMLElementExported$1 = HTMLElementImpl;
585
- }
586
- let insert$1;
587
- function setInsert(insertImpl) {
588
- insert$1 = insertImpl;
589
- }
590
- let remove$1;
591
- function setRemove(removeImpl) {
592
- remove$1 = removeImpl;
593
- }
594
- let createElement$2;
595
- function setCreateElement(createElementImpl) {
596
- createElement$2 = createElementImpl;
597
- }
598
- let createText$1;
599
- function setCreateText(createTextImpl) {
600
- createText$1 = createTextImpl;
601
- }
602
- let createComment$1;
603
- function setCreateComment(createCommentImpl) {
604
- createComment$1 = createCommentImpl;
605
- }
606
- let nextSibling$1;
607
- function setNextSibling(nextSiblingImpl) {
608
- nextSibling$1 = nextSiblingImpl;
609
- }
610
- let attachShadow$1;
611
- function setAttachShadow(attachShadowImpl) {
612
- attachShadow$1 = attachShadowImpl;
613
- }
614
- let getProperty$1;
615
- function setGetProperty(getPropertyImpl) {
616
- getProperty$1 = getPropertyImpl;
617
- }
618
- let setProperty$1;
619
- function setSetProperty(setPropertyImpl) {
620
- setProperty$1 = setPropertyImpl;
621
- }
622
- let setText$1;
623
- function setSetText(setTextImpl) {
624
- setText$1 = setTextImpl;
625
- }
626
- let getAttribute$1;
627
- function setGetAttribute(getAttributeImpl) {
628
- getAttribute$1 = getAttributeImpl;
629
- }
630
- let setAttribute$1;
631
- function setSetAttribute(setAttributeImpl) {
632
- setAttribute$1 = setAttributeImpl;
633
- }
634
- let removeAttribute$1;
635
- function setRemoveAttribute(removeAttributeImpl) {
636
- removeAttribute$1 = removeAttributeImpl;
637
- }
638
- let addEventListener$1;
639
- function setAddEventListener(addEventListenerImpl) {
640
- addEventListener$1 = addEventListenerImpl;
641
- }
642
- let removeEventListener$1;
643
- function setRemoveEventListener(removeEventListenerImpl) {
644
- removeEventListener$1 = removeEventListenerImpl;
645
- }
646
- let dispatchEvent$1;
647
- function setDispatchEvent(dispatchEventImpl) {
648
- dispatchEvent$1 = dispatchEventImpl;
649
- }
650
- let getClassList$1;
651
- function setGetClassList(getClassListImpl) {
652
- getClassList$1 = getClassListImpl;
653
- }
654
- let setCSSStyleProperty$1;
655
- function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
656
- setCSSStyleProperty$1 = setCSSStylePropertyImpl;
657
- }
658
- let getBoundingClientRect$1;
659
- function setGetBoundingClientRect(getBoundingClientRectImpl) {
660
- getBoundingClientRect$1 = getBoundingClientRectImpl;
661
- }
662
- let querySelector$1;
663
- function setQuerySelector(querySelectorImpl) {
664
- querySelector$1 = querySelectorImpl;
665
- }
666
- let querySelectorAll$1;
667
- function setQuerySelectorAll(querySelectorAllImpl) {
668
- querySelectorAll$1 = querySelectorAllImpl;
669
- }
670
- let getElementsByTagName$1;
671
- function setGetElementsByTagName(getElementsByTagNameImpl) {
672
- getElementsByTagName$1 = getElementsByTagNameImpl;
673
- }
674
- let getElementsByClassName$1;
675
- function setGetElementsByClassName(getElementsByClassNameImpl) {
676
- getElementsByClassName$1 = getElementsByClassNameImpl;
677
- }
678
- let getChildren$1;
679
- function setGetChildren(getChildrenImpl) {
680
- getChildren$1 = getChildrenImpl;
681
- }
682
- let getChildNodes$1;
683
- function setGetChildNodes(getChildNodesImpl) {
684
- getChildNodes$1 = getChildNodesImpl;
685
- }
686
- let getFirstChild$1;
687
- function setGetFirstChild(getFirstChildImpl) {
688
- getFirstChild$1 = getFirstChildImpl;
689
- }
690
- let getFirstElementChild$1;
691
- function setGetFirstElementChild(getFirstElementChildImpl) {
692
- getFirstElementChild$1 = getFirstElementChildImpl;
693
- }
694
- let getLastChild$1;
695
- function setGetLastChild(getLastChildImpl) {
696
- getLastChild$1 = getLastChildImpl;
697
- }
698
- let getLastElementChild$1;
699
- function setGetLastElementChild(getLastElementChildImpl) {
700
- getLastElementChild$1 = getLastElementChildImpl;
701
- }
702
- let isConnected$1;
703
- function setIsConnected(isConnectedImpl) {
704
- isConnected$1 = isConnectedImpl;
705
- }
706
- let insertStylesheet$1;
707
- function setInsertStylesheet(insertStylesheetImpl) {
708
- insertStylesheet$1 = insertStylesheetImpl;
709
- }
710
- let assertInstanceOfHTMLElement$1;
711
- function setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElementImpl) {
712
- assertInstanceOfHTMLElement$1 = assertInstanceOfHTMLElementImpl;
713
- }
714
- let defineCustomElement$1;
715
- function setDefineCustomElement(defineCustomElementImpl) {
716
- defineCustomElement$1 = defineCustomElementImpl;
717
- }
718
- let getCustomElement$1;
719
- function setGetCustomElement(getCustomElementImpl) {
720
- getCustomElement$1 = getCustomElementImpl;
721
- }
722
-
723
592
  /*
724
593
  * Copyright (c) 2019, salesforce.com, inc.
725
594
  * All rights reserved.
@@ -2024,7 +1893,8 @@ const LightningElement = function () {
2024
1893
  const { def, elm } = vm;
2025
1894
  const { bridge } = def;
2026
1895
  if (process.env.NODE_ENV !== 'production') {
2027
- assertInstanceOfHTMLElement$1(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
1896
+ const { assertInstanceOfHTMLElement } = vm.renderer;
1897
+ assertInstanceOfHTMLElement(vm.elm, `Component creation requires a DOM element to be associated to ${vm}.`);
2028
1898
  }
2029
1899
  const component = this;
2030
1900
  setPrototypeOf(elm, bridge.prototype);
@@ -2058,8 +1928,8 @@ const LightningElement = function () {
2058
1928
  return this;
2059
1929
  };
2060
1930
  function doAttachShadow(vm) {
2061
- const { elm, mode, shadowMode, def: { ctor }, } = vm;
2062
- const shadowRoot = attachShadow$1(elm, {
1931
+ const { elm, mode, shadowMode, def: { ctor }, renderer: { attachShadow }, } = vm;
1932
+ const shadowRoot = attachShadow(elm, {
2063
1933
  [KEY__SYNTHETIC_MODE]: shadowMode === 1 /* Synthetic */,
2064
1934
  delegatesFocus: Boolean(ctor.delegatesFocus),
2065
1935
  mode,
@@ -2080,12 +1950,13 @@ function warnIfInvokedDuringConstruction(vm, methodOrPropName) {
2080
1950
  LightningElement.prototype = {
2081
1951
  constructor: LightningElement,
2082
1952
  dispatchEvent(event) {
2083
- const { elm } = getAssociatedVM(this);
2084
- return dispatchEvent$1(elm, event);
1953
+ const vm = getAssociatedVM(this);
1954
+ const { elm, renderer: { dispatchEvent }, } = vm;
1955
+ return dispatchEvent(elm, event);
2085
1956
  },
2086
1957
  addEventListener(type, listener, options) {
2087
1958
  const vm = getAssociatedVM(this);
2088
- const { elm } = vm;
1959
+ const { elm, renderer: { addEventListener }, } = vm;
2089
1960
  if (process.env.NODE_ENV !== 'production') {
2090
1961
  const vmBeingRendered = getVMBeingRendered();
2091
1962
  assert.invariant(!isInvokingRender, `${vmBeingRendered}.render() method has side effects on the state of ${vm} by adding an event listener for "${type}".`);
@@ -2093,83 +1964,91 @@ LightningElement.prototype = {
2093
1964
  assert.invariant(isFunction$1(listener), `Invalid second argument for this.addEventListener() in ${vm} for event "${type}". Expected an EventListener but received ${listener}.`);
2094
1965
  }
2095
1966
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2096
- addEventListener$1(elm, type, wrappedListener, options);
1967
+ addEventListener(elm, type, wrappedListener, options);
2097
1968
  },
2098
1969
  removeEventListener(type, listener, options) {
2099
1970
  const vm = getAssociatedVM(this);
2100
- const { elm } = vm;
1971
+ const { elm, renderer: { removeEventListener }, } = vm;
2101
1972
  const wrappedListener = getWrappedComponentsListener(vm, listener);
2102
- removeEventListener$1(elm, type, wrappedListener, options);
1973
+ removeEventListener(elm, type, wrappedListener, options);
2103
1974
  },
2104
1975
  hasAttribute(name) {
2105
- const { elm } = getAssociatedVM(this);
2106
- return !isNull(getAttribute$1(elm, name));
1976
+ const vm = getAssociatedVM(this);
1977
+ const { elm, renderer: { getAttribute }, } = vm;
1978
+ return !isNull(getAttribute(elm, name));
2107
1979
  },
2108
1980
  hasAttributeNS(namespace, name) {
2109
- const { elm } = getAssociatedVM(this);
2110
- return !isNull(getAttribute$1(elm, name, namespace));
1981
+ const vm = getAssociatedVM(this);
1982
+ const { elm, renderer: { getAttribute }, } = vm;
1983
+ return !isNull(getAttribute(elm, name, namespace));
2111
1984
  },
2112
1985
  removeAttribute(name) {
2113
- const { elm } = getAssociatedVM(this);
1986
+ const vm = getAssociatedVM(this);
1987
+ const { elm, renderer: { removeAttribute }, } = vm;
2114
1988
  unlockAttribute(elm, name);
2115
- removeAttribute$1(elm, name);
1989
+ removeAttribute(elm, name);
2116
1990
  lockAttribute();
2117
1991
  },
2118
1992
  removeAttributeNS(namespace, name) {
2119
- const { elm } = getAssociatedVM(this);
1993
+ const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
2120
1994
  unlockAttribute(elm, name);
2121
- removeAttribute$1(elm, name, namespace);
1995
+ removeAttribute(elm, name, namespace);
2122
1996
  lockAttribute();
2123
1997
  },
2124
1998
  getAttribute(name) {
2125
- const { elm } = getAssociatedVM(this);
2126
- return getAttribute$1(elm, name);
1999
+ const vm = getAssociatedVM(this);
2000
+ const { elm } = vm;
2001
+ const { getAttribute } = vm.renderer;
2002
+ return getAttribute(elm, name);
2127
2003
  },
2128
2004
  getAttributeNS(namespace, name) {
2129
- const { elm } = getAssociatedVM(this);
2130
- return getAttribute$1(elm, name, namespace);
2005
+ const vm = getAssociatedVM(this);
2006
+ const { elm } = vm;
2007
+ const { getAttribute } = vm.renderer;
2008
+ return getAttribute(elm, name, namespace);
2131
2009
  },
2132
2010
  setAttribute(name, value) {
2133
2011
  const vm = getAssociatedVM(this);
2134
- const { elm } = vm;
2012
+ const { elm, renderer: { setAttribute }, } = vm;
2135
2013
  if (process.env.NODE_ENV !== 'production') {
2136
2014
  assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
2137
2015
  }
2138
2016
  unlockAttribute(elm, name);
2139
- setAttribute$1(elm, name, value);
2017
+ setAttribute(elm, name, value);
2140
2018
  lockAttribute();
2141
2019
  },
2142
2020
  setAttributeNS(namespace, name, value) {
2143
2021
  const vm = getAssociatedVM(this);
2144
- const { elm } = vm;
2022
+ const { elm, renderer: { setAttribute }, } = vm;
2145
2023
  if (process.env.NODE_ENV !== 'production') {
2146
2024
  assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
2147
2025
  }
2148
2026
  unlockAttribute(elm, name);
2149
- setAttribute$1(elm, name, value, namespace);
2027
+ setAttribute(elm, name, value, namespace);
2150
2028
  lockAttribute();
2151
2029
  },
2152
2030
  getBoundingClientRect() {
2153
2031
  const vm = getAssociatedVM(this);
2154
- const { elm } = vm;
2032
+ const { elm, renderer: { getBoundingClientRect }, } = vm;
2155
2033
  if (process.env.NODE_ENV !== 'production') {
2156
2034
  warnIfInvokedDuringConstruction(vm, 'getBoundingClientRect()');
2157
2035
  }
2158
- return getBoundingClientRect$1(elm);
2036
+ return getBoundingClientRect(elm);
2159
2037
  },
2160
2038
  get isConnected() {
2161
- const { elm } = getAssociatedVM(this);
2162
- return isConnected$1(elm);
2039
+ const vm = getAssociatedVM(this);
2040
+ const { elm, renderer: { isConnected }, } = vm;
2041
+ return isConnected(elm);
2163
2042
  },
2164
2043
  get classList() {
2165
2044
  const vm = getAssociatedVM(this);
2166
- const { elm } = vm;
2045
+ const { elm, renderer: { getClassList }, } = vm;
2167
2046
  if (process.env.NODE_ENV !== 'production') {
2168
2047
  // TODO [#1290]: this still fails in dev but works in production, eventually, we should
2169
2048
  // just throw in all modes
2170
2049
  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.`);
2171
2050
  }
2172
- return getClassList$1(elm);
2051
+ return getClassList(elm);
2173
2052
  },
2174
2053
  get template() {
2175
2054
  const vm = getAssociatedVM(this);
@@ -2185,6 +2064,54 @@ LightningElement.prototype = {
2185
2064
  // Authors should rely on this.template instead.
2186
2065
  return null;
2187
2066
  },
2067
+ get children() {
2068
+ const vm = getAssociatedVM(this);
2069
+ const renderer = vm.renderer;
2070
+ if (process.env.NODE_ENV !== 'production') {
2071
+ warnIfInvokedDuringConstruction(vm, 'children');
2072
+ }
2073
+ return renderer.getChildren(vm.elm);
2074
+ },
2075
+ get childNodes() {
2076
+ const vm = getAssociatedVM(this);
2077
+ const renderer = vm.renderer;
2078
+ if (process.env.NODE_ENV !== 'production') {
2079
+ warnIfInvokedDuringConstruction(vm, 'childNodes');
2080
+ }
2081
+ return renderer.getChildNodes(vm.elm);
2082
+ },
2083
+ get firstChild() {
2084
+ const vm = getAssociatedVM(this);
2085
+ const renderer = vm.renderer;
2086
+ if (process.env.NODE_ENV !== 'production') {
2087
+ warnIfInvokedDuringConstruction(vm, 'firstChild');
2088
+ }
2089
+ return renderer.getFirstChild(vm.elm);
2090
+ },
2091
+ get firstElementChild() {
2092
+ const vm = getAssociatedVM(this);
2093
+ const renderer = vm.renderer;
2094
+ if (process.env.NODE_ENV !== 'production') {
2095
+ warnIfInvokedDuringConstruction(vm, 'firstElementChild');
2096
+ }
2097
+ return renderer.getFirstElementChild(vm.elm);
2098
+ },
2099
+ get lastChild() {
2100
+ const vm = getAssociatedVM(this);
2101
+ const renderer = vm.renderer;
2102
+ if (process.env.NODE_ENV !== 'production') {
2103
+ warnIfInvokedDuringConstruction(vm, 'lastChild');
2104
+ }
2105
+ return renderer.getLastChild(vm.elm);
2106
+ },
2107
+ get lastElementChild() {
2108
+ const vm = getAssociatedVM(this);
2109
+ const renderer = vm.renderer;
2110
+ if (process.env.NODE_ENV !== 'production') {
2111
+ warnIfInvokedDuringConstruction(vm, 'lastElementChild');
2112
+ }
2113
+ return renderer.getLastElementChild(vm.elm);
2114
+ },
2188
2115
  render() {
2189
2116
  const vm = getAssociatedVM(this);
2190
2117
  return vm.def.template;
@@ -2195,76 +2122,22 @@ LightningElement.prototype = {
2195
2122
  },
2196
2123
  };
2197
2124
  const queryAndChildGetterDescriptors = create(null);
2198
- // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
2199
- // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
2200
- // object representing the renderer, with a lot of methods we don't actually need.
2201
- const childGetters = [
2202
- 'children',
2203
- 'childNodes',
2204
- 'firstChild',
2205
- 'firstElementChild',
2206
- 'lastChild',
2207
- 'lastElementChild',
2208
- ];
2209
- function getChildGetter(methodName) {
2210
- switch (methodName) {
2211
- case 'children':
2212
- return getChildren$1;
2213
- case 'childNodes':
2214
- return getChildNodes$1;
2215
- case 'firstChild':
2216
- return getFirstChild$1;
2217
- case 'firstElementChild':
2218
- return getFirstElementChild$1;
2219
- case 'lastChild':
2220
- return getLastChild$1;
2221
- case 'lastElementChild':
2222
- return getLastElementChild$1;
2223
- }
2224
- }
2225
- // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
2226
- for (const childGetter of childGetters) {
2227
- queryAndChildGetterDescriptors[childGetter] = {
2228
- get() {
2229
- const vm = getAssociatedVM(this);
2230
- const { elm } = vm;
2231
- if (process.env.NODE_ENV !== 'production') {
2232
- warnIfInvokedDuringConstruction(vm, childGetter);
2233
- }
2234
- return getChildGetter(childGetter)(elm);
2235
- },
2236
- configurable: true,
2237
- enumerable: true,
2238
- };
2239
- }
2240
2125
  const queryMethods = [
2241
2126
  'getElementsByClassName',
2242
2127
  'getElementsByTagName',
2243
2128
  'querySelector',
2244
2129
  'querySelectorAll',
2245
2130
  ];
2246
- function getQueryMethod(methodName) {
2247
- switch (methodName) {
2248
- case 'getElementsByClassName':
2249
- return getElementsByClassName$1;
2250
- case 'getElementsByTagName':
2251
- return getElementsByTagName$1;
2252
- case 'querySelector':
2253
- return querySelector$1;
2254
- case 'querySelectorAll':
2255
- return querySelectorAll$1;
2256
- }
2257
- }
2258
2131
  // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
2259
2132
  for (const queryMethod of queryMethods) {
2260
2133
  queryAndChildGetterDescriptors[queryMethod] = {
2261
2134
  value(arg) {
2262
2135
  const vm = getAssociatedVM(this);
2263
- const { elm } = vm;
2136
+ const { elm, renderer } = vm;
2264
2137
  if (process.env.NODE_ENV !== 'production') {
2265
2138
  warnIfInvokedDuringConstruction(vm, `${queryMethod}()`);
2266
2139
  }
2267
- return getQueryMethod(queryMethod)(elm, arg);
2140
+ return renderer[queryMethod](elm, arg);
2268
2141
  },
2269
2142
  configurable: true,
2270
2143
  enumerable: true,
@@ -2769,7 +2642,8 @@ function getDecoratorsMeta(Ctor) {
2769
2642
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2770
2643
  */
2771
2644
  let warned = false;
2772
- if (process.env.NODE_ENV === 'development') {
2645
+ // @ts-ignore
2646
+ if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
2773
2647
  // @ts-ignore
2774
2648
  window.__lwcResetWarnedOnVersionMismatch = () => {
2775
2649
  warned = false;
@@ -3487,12 +3361,13 @@ function getComponentDef(Ctor) {
3487
3361
  * SPDX-License-Identifier: MIT
3488
3362
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3489
3363
  */
3490
- function getUpgradableConstructor(tagName) {
3364
+ function getUpgradableConstructor(tagName, renderer) {
3365
+ const { getCustomElement, HTMLElementExported: RendererHTMLElement, defineCustomElement, } = renderer;
3491
3366
  // Should never get a tag with upper case letter at this point, the compiler should
3492
3367
  // produce only tags with lowercase letters
3493
3368
  // But, for backwards compatibility, we will lower case the tagName
3494
3369
  tagName = tagName.toLowerCase();
3495
- let CE = getCustomElement$1(tagName);
3370
+ let CE = getCustomElement(tagName);
3496
3371
  if (!isUndefined$1(CE)) {
3497
3372
  return CE;
3498
3373
  }
@@ -3500,7 +3375,7 @@ function getUpgradableConstructor(tagName) {
3500
3375
  * LWC Upgradable Element reference to an element that was created
3501
3376
  * via the scoped registry mechanism, and that is ready to be upgraded.
3502
3377
  */
3503
- CE = class LWCUpgradableElement extends HTMLElementExported$1 {
3378
+ CE = class LWCUpgradableElement extends RendererHTMLElement {
3504
3379
  constructor(upgradeCallback) {
3505
3380
  super();
3506
3381
  if (isFunction$1(upgradeCallback)) {
@@ -3508,7 +3383,7 @@ function getUpgradableConstructor(tagName) {
3508
3383
  }
3509
3384
  }
3510
3385
  };
3511
- defineCustomElement$1(tagName, CE);
3386
+ defineCustomElement(tagName, CE);
3512
3387
  return CE;
3513
3388
  }
3514
3389
 
@@ -3533,7 +3408,7 @@ function isSameVnode(vnode1, vnode2) {
3533
3408
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3534
3409
  */
3535
3410
  const ColonCharCode = 58;
3536
- function patchAttributes(oldVnode, vnode) {
3411
+ function patchAttributes(oldVnode, vnode, renderer) {
3537
3412
  const { attrs } = vnode.data;
3538
3413
  if (isUndefined$1(attrs)) {
3539
3414
  return;
@@ -3543,6 +3418,7 @@ function patchAttributes(oldVnode, vnode) {
3543
3418
  return;
3544
3419
  }
3545
3420
  const { elm } = vnode;
3421
+ const { setAttribute, removeAttribute } = renderer;
3546
3422
  for (const key in attrs) {
3547
3423
  const cur = attrs[key];
3548
3424
  const old = oldAttrs[key];
@@ -3550,17 +3426,17 @@ function patchAttributes(oldVnode, vnode) {
3550
3426
  unlockAttribute(elm, key);
3551
3427
  if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
3552
3428
  // Assume xml namespace
3553
- setAttribute$1(elm, key, cur, XML_NAMESPACE);
3429
+ setAttribute(elm, key, cur, XML_NAMESPACE);
3554
3430
  }
3555
3431
  else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
3556
3432
  // Assume xlink namespace
3557
- setAttribute$1(elm, key, cur, XLINK_NAMESPACE);
3433
+ setAttribute(elm, key, cur, XLINK_NAMESPACE);
3558
3434
  }
3559
3435
  else if (isNull(cur) || isUndefined$1(cur)) {
3560
- removeAttribute$1(elm, key);
3436
+ removeAttribute(elm, key);
3561
3437
  }
3562
3438
  else {
3563
- setAttribute$1(elm, key, cur);
3439
+ setAttribute(elm, key, cur);
3564
3440
  }
3565
3441
  lockAttribute();
3566
3442
  }
@@ -3578,7 +3454,7 @@ function isLiveBindingProp(sel, key) {
3578
3454
  // instead of relying on internally tracked values.
3579
3455
  return sel === 'input' && (key === 'value' || key === 'checked');
3580
3456
  }
3581
- function patchProps(oldVnode, vnode) {
3457
+ function patchProps(oldVnode, vnode, renderer) {
3582
3458
  const { props } = vnode.data;
3583
3459
  if (isUndefined$1(props)) {
3584
3460
  return;
@@ -3589,13 +3465,14 @@ function patchProps(oldVnode, vnode) {
3589
3465
  }
3590
3466
  const isFirstPatch = isNull(oldVnode);
3591
3467
  const { elm, sel } = vnode;
3468
+ const { getProperty, setProperty } = renderer;
3592
3469
  for (const key in props) {
3593
3470
  const cur = props[key];
3594
3471
  // Set the property if it's the first time is is patched or if the previous property is
3595
3472
  // different than the one previously set.
3596
3473
  if (isFirstPatch ||
3597
- cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
3598
- setProperty$1(elm, key, cur);
3474
+ cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
3475
+ setProperty(elm, key, cur);
3599
3476
  }
3600
3477
  }
3601
3478
  }
@@ -3640,13 +3517,14 @@ function getMapFromClassName(className) {
3640
3517
  }
3641
3518
  return map;
3642
3519
  }
3643
- function patchClassAttribute(oldVnode, vnode) {
3520
+ function patchClassAttribute(oldVnode, vnode, renderer) {
3644
3521
  const { elm, data: { className: newClass }, } = vnode;
3645
3522
  const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
3646
3523
  if (oldClass === newClass) {
3647
3524
  return;
3648
3525
  }
3649
- const classList = getClassList$1(elm);
3526
+ const { getClassList } = renderer;
3527
+ const classList = getClassList(elm);
3650
3528
  const newClassMap = getMapFromClassName(newClass);
3651
3529
  const oldClassMap = getMapFromClassName(oldClass);
3652
3530
  let name;
@@ -3670,17 +3548,18 @@ function patchClassAttribute(oldVnode, vnode) {
3670
3548
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3671
3549
  */
3672
3550
  // The style property is a string when defined via an expression in the template.
3673
- function patchStyleAttribute(oldVnode, vnode) {
3551
+ function patchStyleAttribute(oldVnode, vnode, renderer) {
3674
3552
  const { elm, data: { style: newStyle }, } = vnode;
3675
3553
  const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
3676
3554
  if (oldStyle === newStyle) {
3677
3555
  return;
3678
3556
  }
3557
+ const { setAttribute, removeAttribute } = renderer;
3679
3558
  if (!isString(newStyle) || newStyle === '') {
3680
- removeAttribute$1(elm, 'style');
3559
+ removeAttribute(elm, 'style');
3681
3560
  }
3682
3561
  else {
3683
- setAttribute$1(elm, 'style', newStyle);
3562
+ setAttribute(elm, 'style', newStyle);
3684
3563
  }
3685
3564
  }
3686
3565
 
@@ -3690,14 +3569,15 @@ function patchStyleAttribute(oldVnode, vnode) {
3690
3569
  * SPDX-License-Identifier: MIT
3691
3570
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3692
3571
  */
3693
- function applyEventListeners(vnode) {
3572
+ function applyEventListeners(vnode, renderer) {
3694
3573
  const { elm, data: { on }, } = vnode;
3695
3574
  if (isUndefined$1(on)) {
3696
3575
  return;
3697
3576
  }
3577
+ const { addEventListener } = renderer;
3698
3578
  for (const name in on) {
3699
3579
  const handler = on[name];
3700
- addEventListener$1(elm, name, handler);
3580
+ addEventListener(elm, name, handler);
3701
3581
  }
3702
3582
  }
3703
3583
 
@@ -3710,12 +3590,13 @@ function applyEventListeners(vnode) {
3710
3590
  // The HTML class property becomes the vnode.data.classMap object when defined as a string in the template.
3711
3591
  // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
3712
3592
  // different classnames properties individually instead of via a string.
3713
- function applyStaticClassAttribute(vnode) {
3593
+ function applyStaticClassAttribute(vnode, renderer) {
3714
3594
  const { elm, data: { classMap }, } = vnode;
3715
3595
  if (isUndefined$1(classMap)) {
3716
3596
  return;
3717
3597
  }
3718
- const classList = getClassList$1(elm);
3598
+ const { getClassList } = renderer;
3599
+ const classList = getClassList(elm);
3719
3600
  for (const name in classMap) {
3720
3601
  classList.add(name);
3721
3602
  }
@@ -3730,14 +3611,15 @@ function applyStaticClassAttribute(vnode) {
3730
3611
  // The HTML style property becomes the vnode.data.styleDecls object when defined as a string in the template.
3731
3612
  // The compiler takes care of transforming the inline style into an object. It's faster to set the
3732
3613
  // different style properties individually instead of via a string.
3733
- function applyStaticStyleAttribute(vnode) {
3614
+ function applyStaticStyleAttribute(vnode, renderer) {
3734
3615
  const { elm, data: { styleDecls }, } = vnode;
3735
3616
  if (isUndefined$1(styleDecls)) {
3736
3617
  return;
3737
3618
  }
3619
+ const { setCSSStyleProperty } = renderer;
3738
3620
  for (let i = 0; i < styleDecls.length; i++) {
3739
3621
  const [prop, value, important] = styleDecls[i];
3740
- setCSSStyleProperty$1(elm, prop, value, important);
3622
+ setCSSStyleProperty(elm, prop, value, important);
3741
3623
  }
3742
3624
  }
3743
3625
 
@@ -3747,15 +3629,16 @@ function applyStaticStyleAttribute(vnode) {
3747
3629
  * SPDX-License-Identifier: MIT
3748
3630
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3749
3631
  */
3750
- function patchChildren(c1, c2, parent) {
3632
+ function patchChildren(c1, c2, parent, renderer) {
3751
3633
  if (hasDynamicChildren(c2)) {
3752
- updateDynamicChildren(c1, c2, parent);
3634
+ updateDynamicChildren(c1, c2, parent, renderer);
3753
3635
  }
3754
3636
  else {
3755
- updateStaticChildren(c1, c2, parent);
3637
+ updateStaticChildren(c1, c2, parent, renderer);
3756
3638
  }
3757
3639
  }
3758
- function patch(n1, n2) {
3640
+ function patch(n1, n2, renderer) {
3641
+ var _a, _b;
3759
3642
  if (n1 === n2) {
3760
3643
  return;
3761
3644
  }
@@ -3769,80 +3652,90 @@ function patch(n1, n2) {
3769
3652
  }
3770
3653
  switch (n2.type) {
3771
3654
  case 0 /* Text */:
3772
- patchText(n1, n2);
3655
+ // VText has no special capability, fallback to the owner's renderer
3656
+ patchText(n1, n2, renderer);
3773
3657
  break;
3774
3658
  case 1 /* Comment */:
3775
- patchComment(n1, n2);
3659
+ // VComment has no special capability, fallback to the owner's renderer
3660
+ patchComment(n1, n2, renderer);
3776
3661
  break;
3777
3662
  case 2 /* Element */:
3778
- patchElement(n1, n2);
3663
+ patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
3779
3664
  break;
3780
3665
  case 3 /* CustomElement */:
3781
- patchCustomElement(n1, n2);
3666
+ patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3782
3667
  break;
3783
3668
  }
3784
3669
  }
3785
- function mount(node, parent, anchor) {
3670
+ function mount(node, parent, renderer, anchor) {
3671
+ var _a, _b;
3786
3672
  switch (node.type) {
3787
3673
  case 0 /* Text */:
3788
- mountText(node, parent, anchor);
3674
+ // VText has no special capability, fallback to the owner's renderer
3675
+ mountText(node, parent, anchor, renderer);
3789
3676
  break;
3790
3677
  case 1 /* Comment */:
3791
- mountComment(node, parent, anchor);
3678
+ // VComment has no special capability, fallback to the owner's renderer
3679
+ mountComment(node, parent, anchor, renderer);
3792
3680
  break;
3793
3681
  case 2 /* Element */:
3794
- mountElement(node, parent, anchor);
3682
+ // If the vnode data has a renderer override use it, else fallback to owner's renderer
3683
+ mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
3795
3684
  break;
3796
3685
  case 3 /* CustomElement */:
3797
- mountCustomElement(node, parent, anchor);
3686
+ // If the vnode data has a renderer override use it, else fallback to owner's renderer
3687
+ mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3798
3688
  break;
3799
3689
  }
3800
3690
  }
3801
- function patchText(n1, n2) {
3691
+ function patchText(n1, n2, renderer) {
3802
3692
  n2.elm = n1.elm;
3803
3693
  if (n2.text !== n1.text) {
3804
- updateTextContent(n2);
3694
+ updateTextContent(n2, renderer);
3805
3695
  }
3806
3696
  }
3807
- function mountText(node, parent, anchor) {
3808
- const { owner } = node;
3809
- const textNode = (node.elm = createText$1(node.text));
3810
- linkNodeToShadow(textNode, owner);
3811
- insertNode(textNode, parent, anchor);
3697
+ function mountText(vnode, parent, anchor, renderer) {
3698
+ const { owner } = vnode;
3699
+ const { createText } = renderer;
3700
+ const textNode = (vnode.elm = createText(vnode.text));
3701
+ linkNodeToShadow(textNode, owner, renderer);
3702
+ insertNode(textNode, parent, anchor, renderer);
3812
3703
  }
3813
- function patchComment(n1, n2) {
3704
+ function patchComment(n1, n2, renderer) {
3814
3705
  n2.elm = n1.elm;
3815
3706
  // FIXME: Comment nodes should be static, we shouldn't need to diff them together. However
3816
3707
  // it is the case today.
3817
3708
  if (n2.text !== n1.text) {
3818
- updateTextContent(n2);
3709
+ updateTextContent(n2, renderer);
3819
3710
  }
3820
3711
  }
3821
- function mountComment(node, parent, anchor) {
3822
- const { owner } = node;
3823
- const commentNode = (node.elm = createComment$1(node.text));
3824
- linkNodeToShadow(commentNode, owner);
3825
- insertNode(commentNode, parent, anchor);
3712
+ function mountComment(vnode, parent, anchor, renderer) {
3713
+ const { owner } = vnode;
3714
+ const { createComment } = renderer;
3715
+ const commentNode = (vnode.elm = createComment(vnode.text));
3716
+ linkNodeToShadow(commentNode, owner, renderer);
3717
+ insertNode(commentNode, parent, anchor, renderer);
3826
3718
  }
3827
- function mountElement(vnode, parent, anchor) {
3719
+ function mountElement(vnode, parent, anchor, renderer) {
3828
3720
  const { sel, owner, data: { svg }, } = vnode;
3721
+ const { createElement } = renderer;
3829
3722
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
3830
- const elm = createElement$2(sel, namespace);
3831
- linkNodeToShadow(elm, owner);
3832
- fallbackElmHook(elm, vnode);
3723
+ const elm = createElement(sel, namespace);
3724
+ linkNodeToShadow(elm, owner, renderer);
3725
+ fallbackElmHook(elm, vnode, renderer);
3833
3726
  vnode.elm = elm;
3834
- patchElementPropsAndAttrs$1(null, vnode);
3835
- insertNode(elm, parent, anchor);
3836
- mountVNodes(vnode.children, elm, null);
3727
+ patchElementPropsAndAttrs$1(null, vnode, renderer);
3728
+ insertNode(elm, parent, anchor, renderer);
3729
+ mountVNodes(vnode.children, elm, renderer, null);
3837
3730
  }
3838
- function patchElement(n1, n2) {
3731
+ function patchElement(n1, n2, renderer) {
3839
3732
  const elm = (n2.elm = n1.elm);
3840
- patchElementPropsAndAttrs$1(n1, n2);
3841
- patchChildren(n1.children, n2.children, elm);
3733
+ patchElementPropsAndAttrs$1(n1, n2, renderer);
3734
+ patchChildren(n1.children, n2.children, elm, renderer);
3842
3735
  }
3843
- function mountCustomElement(vnode, parent, anchor) {
3736
+ function mountCustomElement(vnode, parent, anchor, renderer) {
3844
3737
  const { sel, owner } = vnode;
3845
- const UpgradableConstructor = getUpgradableConstructor(sel);
3738
+ const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
3846
3739
  /**
3847
3740
  * Note: if the upgradable constructor does not expect, or throw when we new it
3848
3741
  * with a callback as the first argument, we could implement a more advanced
@@ -3852,9 +3745,9 @@ function mountCustomElement(vnode, parent, anchor) {
3852
3745
  let vm;
3853
3746
  const elm = new UpgradableConstructor((elm) => {
3854
3747
  // the custom element from the registry is expecting an upgrade callback
3855
- vm = createViewModelHook(elm, vnode);
3748
+ vm = createViewModelHook(elm, vnode, renderer);
3856
3749
  });
3857
- linkNodeToShadow(elm, owner);
3750
+ linkNodeToShadow(elm, owner, renderer);
3858
3751
  vnode.elm = elm;
3859
3752
  vnode.vm = vm;
3860
3753
  if (vm) {
@@ -3863,23 +3756,23 @@ function mountCustomElement(vnode, parent, anchor) {
3863
3756
  else if (vnode.ctor !== UpgradableConstructor) {
3864
3757
  throw new TypeError(`Incorrect Component Constructor`);
3865
3758
  }
3866
- patchElementPropsAndAttrs$1(null, vnode);
3867
- insertNode(elm, parent, anchor);
3759
+ patchElementPropsAndAttrs$1(null, vnode, renderer);
3760
+ insertNode(elm, parent, anchor, renderer);
3868
3761
  if (vm) {
3869
3762
  if (process.env.NODE_ENV !== 'production') {
3870
3763
  assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
3871
3764
  }
3872
3765
  runConnectedCallback(vm);
3873
3766
  }
3874
- mountVNodes(vnode.children, elm, null);
3767
+ mountVNodes(vnode.children, elm, renderer, null);
3875
3768
  if (vm) {
3876
3769
  appendVM(vm);
3877
3770
  }
3878
3771
  }
3879
- function patchCustomElement(n1, n2) {
3772
+ function patchCustomElement(n1, n2, renderer) {
3880
3773
  const elm = (n2.elm = n1.elm);
3881
3774
  const vm = (n2.vm = n1.vm);
3882
- patchElementPropsAndAttrs$1(n1, n2);
3775
+ patchElementPropsAndAttrs$1(n1, n2, renderer);
3883
3776
  if (!isUndefined$1(vm)) {
3884
3777
  // in fallback mode, the allocation will always set children to
3885
3778
  // empty and delegate the real allocation to the slot elements
@@ -3887,33 +3780,38 @@ function patchCustomElement(n1, n2) {
3887
3780
  }
3888
3781
  // in fallback mode, the children will be always empty, so, nothing
3889
3782
  // will happen, but in native, it does allocate the light dom
3890
- patchChildren(n1.children, n2.children, elm);
3783
+ patchChildren(n1.children, n2.children, elm, renderer);
3891
3784
  if (!isUndefined$1(vm)) {
3892
3785
  // this will probably update the shadowRoot, but only if the vm is in a dirty state
3893
3786
  // this is important to preserve the top to bottom synchronous rendering phase.
3894
3787
  rerenderVM(vm);
3895
3788
  }
3896
3789
  }
3897
- function mountVNodes(vnodes, parent, anchor, start = 0, end = vnodes.length) {
3790
+ function mountVNodes(vnodes, parent, renderer, anchor, start = 0, end = vnodes.length) {
3898
3791
  for (; start < end; ++start) {
3899
3792
  const vnode = vnodes[start];
3900
3793
  if (isVNode(vnode)) {
3901
- mount(vnode, parent, anchor);
3794
+ mount(vnode, parent, renderer, anchor);
3902
3795
  }
3903
3796
  }
3904
3797
  }
3905
- function unmount(vnode, parent, doRemove = false) {
3798
+ function unmount(vnode, parent, renderer, doRemove = false) {
3906
3799
  const { type, elm, sel } = vnode;
3907
3800
  // When unmounting a VNode subtree not all the elements have to removed from the DOM. The
3908
3801
  // subtree root, is the only element worth unmounting from the subtree.
3909
3802
  if (doRemove) {
3910
- removeNode(elm, parent);
3803
+ // The vnode might or might not have a data.renderer associated to it
3804
+ // but the removal used here is from the owner instead.
3805
+ removeNode(elm, parent, renderer);
3911
3806
  }
3912
- const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
3913
3807
  switch (type) {
3914
- case 2 /* Element */:
3915
- unmountVNodes(vnode.children, elm, removeChildren);
3808
+ case 2 /* Element */: {
3809
+ // Slot content is removed to trigger slotchange event when removing slot.
3810
+ // Only required for synthetic shadow.
3811
+ const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
3812
+ unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
3916
3813
  break;
3814
+ }
3917
3815
  case 3 /* CustomElement */: {
3918
3816
  const { vm } = vnode;
3919
3817
  // No need to unmount the children here, `removeVM` will take care of removing the
@@ -3924,11 +3822,11 @@ function unmount(vnode, parent, doRemove = false) {
3924
3822
  }
3925
3823
  }
3926
3824
  }
3927
- function unmountVNodes(vnodes, parent, doRemove = false, start = 0, end = vnodes.length) {
3825
+ function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, end = vnodes.length) {
3928
3826
  for (; start < end; ++start) {
3929
3827
  const ch = vnodes[start];
3930
3828
  if (isVNode(ch)) {
3931
- unmount(ch, parent, doRemove);
3829
+ unmount(ch, parent, renderer, doRemove);
3932
3830
  }
3933
3831
  }
3934
3832
  }
@@ -3942,66 +3840,71 @@ function setElementShadowToken(elm, token) {
3942
3840
  elm.$shadowToken$ = token;
3943
3841
  }
3944
3842
  // Set the scope token class for *.scoped.css styles
3945
- function setScopeTokenClassIfNecessary(elm, owner) {
3843
+ function setScopeTokenClassIfNecessary(elm, owner, renderer) {
3946
3844
  const { cmpTemplate, context } = owner;
3845
+ const { getClassList } = renderer;
3947
3846
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
3948
3847
  if (!isUndefined$1(token) && context.hasScopedStyles) {
3949
- getClassList$1(elm).add(token);
3848
+ // TODO [#2762]: this dot notation with add is probably problematic
3849
+ // probably we should have a renderer api for just the add operation
3850
+ getClassList(elm).add(token);
3950
3851
  }
3951
3852
  }
3952
- function linkNodeToShadow(elm, owner) {
3853
+ function linkNodeToShadow(elm, owner, renderer) {
3953
3854
  const { renderRoot, renderMode, shadowMode } = owner;
3855
+ const { isSyntheticShadowDefined } = renderer;
3954
3856
  // TODO [#1164]: this should eventually be done by the polyfill directly
3955
- if (isSyntheticShadowDefined$1) {
3857
+ if (isSyntheticShadowDefined) {
3956
3858
  if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
3957
3859
  elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
3958
3860
  }
3959
3861
  }
3960
3862
  }
3961
- function updateTextContent(vnode) {
3863
+ function updateTextContent(vnode, renderer) {
3962
3864
  const { elm, text } = vnode;
3865
+ const { setText } = renderer;
3963
3866
  if (process.env.NODE_ENV !== 'production') {
3964
3867
  unlockDomMutation();
3965
3868
  }
3966
- setText$1(elm, text);
3869
+ setText(elm, text);
3967
3870
  if (process.env.NODE_ENV !== 'production') {
3968
3871
  lockDomMutation();
3969
3872
  }
3970
3873
  }
3971
- function insertNode(node, parent, anchor) {
3874
+ function insertNode(node, parent, anchor, renderer) {
3972
3875
  if (process.env.NODE_ENV !== 'production') {
3973
3876
  unlockDomMutation();
3974
3877
  }
3975
- insert$1(node, parent, anchor);
3878
+ renderer.insert(node, parent, anchor);
3976
3879
  if (process.env.NODE_ENV !== 'production') {
3977
3880
  lockDomMutation();
3978
3881
  }
3979
3882
  }
3980
- function removeNode(node, parent) {
3883
+ function removeNode(node, parent, renderer) {
3981
3884
  if (process.env.NODE_ENV !== 'production') {
3982
3885
  unlockDomMutation();
3983
3886
  }
3984
- remove$1(node, parent);
3887
+ renderer.remove(node, parent);
3985
3888
  if (process.env.NODE_ENV !== 'production') {
3986
3889
  lockDomMutation();
3987
3890
  }
3988
3891
  }
3989
- function patchElementPropsAndAttrs$1(oldVnode, vnode) {
3892
+ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
3990
3893
  if (isNull(oldVnode)) {
3991
- applyEventListeners(vnode);
3992
- applyStaticClassAttribute(vnode);
3993
- applyStaticStyleAttribute(vnode);
3894
+ applyEventListeners(vnode, renderer);
3895
+ applyStaticClassAttribute(vnode, renderer);
3896
+ applyStaticStyleAttribute(vnode, renderer);
3994
3897
  }
3995
3898
  // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
3996
3899
  // value is set before type=radio.
3997
- patchClassAttribute(oldVnode, vnode);
3998
- patchStyleAttribute(oldVnode, vnode);
3999
- patchAttributes(oldVnode, vnode);
4000
- patchProps(oldVnode, vnode);
3900
+ patchClassAttribute(oldVnode, vnode, renderer);
3901
+ patchStyleAttribute(oldVnode, vnode, renderer);
3902
+ patchAttributes(oldVnode, vnode, renderer);
3903
+ patchProps(oldVnode, vnode, renderer);
4001
3904
  }
4002
- function fallbackElmHook(elm, vnode) {
3905
+ function fallbackElmHook(elm, vnode, renderer) {
4003
3906
  const { owner } = vnode;
4004
- setScopeTokenClassIfNecessary(elm, owner);
3907
+ setScopeTokenClassIfNecessary(elm, owner, renderer);
4005
3908
  if (owner.shadowMode === 1 /* Synthetic */) {
4006
3909
  const { data: { context }, } = vnode;
4007
3910
  const { stylesheetToken } = owner.context;
@@ -4049,7 +3952,7 @@ function allocateChildren(vnode, vm) {
4049
3952
  vnode.children = EmptyArray;
4050
3953
  }
4051
3954
  }
4052
- function createViewModelHook(elm, vnode) {
3955
+ function createViewModelHook(elm, vnode, renderer) {
4053
3956
  let vm = getAssociatedVMIfPresent(elm);
4054
3957
  // There is a possibility that a custom element is registered under tagName, in which case, the
4055
3958
  // initialization is already carry on, and there is nothing else to do here since this hook is
@@ -4058,7 +3961,7 @@ function createViewModelHook(elm, vnode) {
4058
3961
  return vm;
4059
3962
  }
4060
3963
  const { sel, mode, ctor, owner } = vnode;
4061
- setScopeTokenClassIfNecessary(elm, owner);
3964
+ setScopeTokenClassIfNecessary(elm, owner, renderer);
4062
3965
  if (owner.shadowMode === 1 /* Synthetic */) {
4063
3966
  const { stylesheetToken } = owner.context;
4064
3967
  // when running in synthetic shadow mode, we need to set the shadowToken value
@@ -4067,7 +3970,7 @@ function createViewModelHook(elm, vnode) {
4067
3970
  setElementShadowToken(elm, stylesheetToken);
4068
3971
  }
4069
3972
  }
4070
- vm = createVM(elm, ctor, {
3973
+ vm = createVM(elm, ctor, renderer, {
4071
3974
  mode,
4072
3975
  owner,
4073
3976
  tagName: sel,
@@ -4142,7 +4045,7 @@ function createKeyToOldIdx(children, beginIdx, endIdx) {
4142
4045
  }
4143
4046
  return map;
4144
4047
  }
4145
- function updateDynamicChildren(oldCh, newCh, parent) {
4048
+ function updateDynamicChildren(oldCh, newCh, parent, renderer) {
4146
4049
  let oldStartIdx = 0;
4147
4050
  let newStartIdx = 0;
4148
4051
  let oldEndIdx = oldCh.length - 1;
@@ -4171,26 +4074,26 @@ function updateDynamicChildren(oldCh, newCh, parent) {
4171
4074
  newEndVnode = newCh[--newEndIdx];
4172
4075
  }
4173
4076
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
4174
- patch(oldStartVnode, newStartVnode);
4077
+ patch(oldStartVnode, newStartVnode, renderer);
4175
4078
  oldStartVnode = oldCh[++oldStartIdx];
4176
4079
  newStartVnode = newCh[++newStartIdx];
4177
4080
  }
4178
4081
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
4179
- patch(oldEndVnode, newEndVnode);
4082
+ patch(oldEndVnode, newEndVnode, renderer);
4180
4083
  oldEndVnode = oldCh[--oldEndIdx];
4181
4084
  newEndVnode = newCh[--newEndIdx];
4182
4085
  }
4183
4086
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
4184
4087
  // Vnode moved right
4185
- patch(oldStartVnode, newEndVnode);
4186
- insertNode(oldStartVnode.elm, parent, nextSibling$1(oldEndVnode.elm));
4088
+ patch(oldStartVnode, newEndVnode, renderer);
4089
+ insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
4187
4090
  oldStartVnode = oldCh[++oldStartIdx];
4188
4091
  newEndVnode = newCh[--newEndIdx];
4189
4092
  }
4190
4093
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
4191
4094
  // Vnode moved left
4192
- patch(oldEndVnode, newStartVnode);
4193
- insertNode(newStartVnode.elm, parent, oldStartVnode.elm);
4095
+ patch(oldEndVnode, newStartVnode, renderer);
4096
+ insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
4194
4097
  oldEndVnode = oldCh[--oldEndIdx];
4195
4098
  newStartVnode = newCh[++newStartIdx];
4196
4099
  }
@@ -4201,7 +4104,7 @@ function updateDynamicChildren(oldCh, newCh, parent) {
4201
4104
  idxInOld = oldKeyToIdx[newStartVnode.key];
4202
4105
  if (isUndefined$1(idxInOld)) {
4203
4106
  // New element
4204
- mount(newStartVnode, parent, oldStartVnode.elm);
4107
+ mount(newStartVnode, parent, renderer, oldStartVnode.elm);
4205
4108
  newStartVnode = newCh[++newStartIdx];
4206
4109
  }
4207
4110
  else {
@@ -4209,10 +4112,10 @@ function updateDynamicChildren(oldCh, newCh, parent) {
4209
4112
  if (isVNode(elmToMove)) {
4210
4113
  if (elmToMove.sel !== newStartVnode.sel) {
4211
4114
  // New element
4212
- mount(newStartVnode, parent, oldStartVnode.elm);
4115
+ mount(newStartVnode, parent, renderer, oldStartVnode.elm);
4213
4116
  }
4214
4117
  else {
4215
- patch(elmToMove, newStartVnode);
4118
+ patch(elmToMove, newStartVnode, renderer);
4216
4119
  // Delete the old child, but copy the array since it is read-only.
4217
4120
  // The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
4218
4121
  // so we only care about the `oldCh` object inside this function.
@@ -4224,7 +4127,7 @@ function updateDynamicChildren(oldCh, newCh, parent) {
4224
4127
  }
4225
4128
  // We've already cloned at least once, so it's no longer read-only
4226
4129
  oldCh[idxInOld] = undefined;
4227
- insertNode(elmToMove.elm, parent, oldStartVnode.elm);
4130
+ insertNode(elmToMove.elm, parent, oldStartVnode.elm, renderer);
4228
4131
  }
4229
4132
  }
4230
4133
  newStartVnode = newCh[++newStartIdx];
@@ -4241,25 +4144,25 @@ function updateDynamicChildren(oldCh, newCh, parent) {
4241
4144
  n = newCh[++i];
4242
4145
  } while (!isVNode(n) && i < newChEnd);
4243
4146
  before = isVNode(n) ? n.elm : null;
4244
- mountVNodes(newCh, parent, before, newStartIdx, newEndIdx + 1);
4147
+ mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
4245
4148
  }
4246
4149
  else {
4247
- unmountVNodes(oldCh, parent, true, oldStartIdx, oldEndIdx + 1);
4150
+ unmountVNodes(oldCh, parent, renderer, true, oldStartIdx, oldEndIdx + 1);
4248
4151
  }
4249
4152
  }
4250
4153
  }
4251
- function updateStaticChildren(c1, c2, parent) {
4154
+ function updateStaticChildren(c1, c2, parent, renderer) {
4252
4155
  const c1Length = c1.length;
4253
4156
  const c2Length = c2.length;
4254
4157
  if (c1Length === 0) {
4255
4158
  // the old list is empty, we can directly insert anything new
4256
- mountVNodes(c2, parent, null);
4159
+ mountVNodes(c2, parent, renderer, null);
4257
4160
  return;
4258
4161
  }
4259
4162
  if (c2Length === 0) {
4260
4163
  // the old list is nonempty and the new list is empty so we can directly remove all old nodes
4261
4164
  // this is the case in which the dynamic children of an if-directive should be removed
4262
- unmountVNodes(c1, parent, true);
4165
+ unmountVNodes(c1, parent, renderer, true);
4263
4166
  return;
4264
4167
  }
4265
4168
  // if the old list is not empty, the new list MUST have the same
@@ -4272,16 +4175,16 @@ function updateStaticChildren(c1, c2, parent) {
4272
4175
  if (isVNode(n1)) {
4273
4176
  if (isVNode(n2)) {
4274
4177
  // both vnodes are equivalent, and we just need to patch them
4275
- patch(n1, n2);
4178
+ patch(n1, n2, renderer);
4276
4179
  anchor = n2.elm;
4277
4180
  }
4278
4181
  else {
4279
4182
  // removing the old vnode since the new one is null
4280
- unmount(n1, parent, true);
4183
+ unmount(n1, parent, renderer, true);
4281
4184
  }
4282
4185
  }
4283
4186
  else if (isVNode(n2)) {
4284
- mount(n2, parent, anchor);
4187
+ mount(n2, parent, renderer, anchor);
4285
4188
  anchor = n2.elm;
4286
4189
  }
4287
4190
  }
@@ -4710,7 +4613,7 @@ function createInlineStyleVNode(content) {
4710
4613
  }, [api.t(content)]);
4711
4614
  }
4712
4615
  function updateStylesheetToken(vm, template) {
4713
- const { elm, context, renderMode, shadowMode } = vm;
4616
+ const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
4714
4617
  const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
4715
4618
  const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
4716
4619
  const { hasScopedStyles } = context;
@@ -4721,10 +4624,10 @@ function updateStylesheetToken(vm, template) {
4721
4624
  const { stylesheetToken: oldToken, hasTokenInClass: oldHasTokenInClass, hasTokenInAttribute: oldHasTokenInAttribute, } = context;
4722
4625
  if (!isUndefined$1(oldToken)) {
4723
4626
  if (oldHasTokenInClass) {
4724
- getClassList$1(elm).remove(makeHostToken(oldToken));
4627
+ getClassList(elm).remove(makeHostToken(oldToken));
4725
4628
  }
4726
4629
  if (oldHasTokenInAttribute) {
4727
- removeAttribute$1(elm, makeHostToken(oldToken));
4630
+ removeAttribute(elm, makeHostToken(oldToken));
4728
4631
  }
4729
4632
  }
4730
4633
  // Apply the new template styling token to the host element, if the new template has any
@@ -4735,11 +4638,11 @@ function updateStylesheetToken(vm, template) {
4735
4638
  // Set the new styling token on the host element
4736
4639
  if (!isUndefined$1(newToken)) {
4737
4640
  if (hasScopedStyles) {
4738
- getClassList$1(elm).add(makeHostToken(newToken));
4641
+ getClassList(elm).add(makeHostToken(newToken));
4739
4642
  newHasTokenInClass = true;
4740
4643
  }
4741
4644
  if (isSyntheticShadow) {
4742
- setAttribute$1(elm, makeHostToken(newToken), '');
4645
+ setAttribute(elm, makeHostToken(newToken), '');
4743
4646
  newHasTokenInAttribute = true;
4744
4647
  }
4745
4648
  }
@@ -4827,13 +4730,13 @@ function getNearestNativeShadowComponent(vm) {
4827
4730
  return owner;
4828
4731
  }
4829
4732
  function createStylesheet(vm, stylesheets) {
4830
- const { renderMode, shadowMode } = vm;
4733
+ const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
4831
4734
  if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
4832
4735
  for (let i = 0; i < stylesheets.length; i++) {
4833
- insertStylesheet$1(stylesheets[i]);
4736
+ insertStylesheet(stylesheets[i]);
4834
4737
  }
4835
4738
  }
4836
- else if (ssr$1 || vm.hydrated) {
4739
+ else if (ssr || vm.hydrated) {
4837
4740
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
4838
4741
  // This works in the client, because the stylesheets are created, and cached in the VM
4839
4742
  // the first time the VM renders.
@@ -4847,7 +4750,7 @@ function createStylesheet(vm, stylesheets) {
4847
4750
  // null root means a global style
4848
4751
  const target = isNull(root) ? undefined : root.shadowRoot;
4849
4752
  for (let i = 0; i < stylesheets.length; i++) {
4850
- insertStylesheet$1(stylesheets[i], target);
4753
+ insertStylesheet(stylesheets[i], target);
4851
4754
  }
4852
4755
  }
4853
4756
  return null;
@@ -5389,9 +5292,20 @@ function removeVM(vm) {
5389
5292
 
5390
5293
  resetComponentStateWhenRemoved(vm);
5391
5294
  }
5392
- function createVM(elm, ctor, options) {
5393
- var _a;
5394
5295
 
5296
+ function getNearestShadowAncestor(vm) {
5297
+ let ancestor = vm.owner;
5298
+
5299
+ while (!isNull(ancestor) && ancestor.renderMode === 0
5300
+ /* Light */
5301
+ ) {
5302
+ ancestor = ancestor.owner;
5303
+ }
5304
+
5305
+ return ancestor;
5306
+ }
5307
+
5308
+ function createVM(elm, ctor, renderer, options) {
5395
5309
  const {
5396
5310
  mode,
5397
5311
  owner,
@@ -5421,8 +5335,6 @@ function createVM(elm, ctor, options) {
5421
5335
  cmpTemplate: null,
5422
5336
  hydrated: Boolean(hydrated),
5423
5337
  renderMode: def.renderMode,
5424
- shadowMode: computeShadowMode(def, owner),
5425
- nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
5426
5338
  context: {
5427
5339
  stylesheetToken: undefined,
5428
5340
  hasTokenInClass: undefined,
@@ -5435,14 +5347,17 @@ function createVM(elm, ctor, options) {
5435
5347
  },
5436
5348
  // Properties set right after VM creation.
5437
5349
  tro: null,
5350
+ shadowMode: null,
5438
5351
  // Properties set by the LightningElement constructor.
5439
5352
  component: null,
5440
5353
  shadowRoot: null,
5441
5354
  renderRoot: null,
5442
5355
  callHook,
5443
5356
  setHook,
5444
- getHook
5357
+ getHook,
5358
+ renderer
5445
5359
  };
5360
+ vm.shadowMode = computeShadowMode(vm, renderer);
5446
5361
  vm.tro = getTemplateReactiveObserver(vm);
5447
5362
 
5448
5363
  if (process.env.NODE_ENV !== 'production') {
@@ -5467,12 +5382,17 @@ function createVM(elm, ctor, options) {
5467
5382
  return vm;
5468
5383
  }
5469
5384
 
5470
- function computeShadowMode(def, owner) {
5471
- var _a;
5472
-
5385
+ function computeShadowMode(vm, renderer) {
5386
+ const {
5387
+ def
5388
+ } = vm;
5389
+ const {
5390
+ isSyntheticShadowDefined,
5391
+ isNativeShadowDefined
5392
+ } = renderer;
5473
5393
  let shadowMode;
5474
5394
 
5475
- if (isSyntheticShadowDefined$1) {
5395
+ if (isSyntheticShadowDefined) {
5476
5396
  if (def.renderMode === 0
5477
5397
  /* Light */
5478
5398
  ) {
@@ -5481,7 +5401,7 @@ function computeShadowMode(def, owner) {
5481
5401
  shadowMode = 0
5482
5402
  /* Native */
5483
5403
  ;
5484
- } else if (isNativeShadowDefined$1) {
5404
+ } else if (isNativeShadowDefined) {
5485
5405
  // Not combined with above condition because @lwc/features only supports identifiers in
5486
5406
  // the if-condition.
5487
5407
  if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
@@ -5492,13 +5412,23 @@ function computeShadowMode(def, owner) {
5492
5412
  /* Native */
5493
5413
  ;
5494
5414
  } else {
5495
- // Transitive support for native Shadow DOM. A component in native mode
5496
- // transitively opts all of its descendants into native.
5497
- // Synthetic if neither this component nor any of its ancestors are configured
5498
- // to be native.
5499
- shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
5500
- /* Synthetic */
5501
- ;
5415
+ const shadowAncestor = getNearestShadowAncestor(vm);
5416
+
5417
+ if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
5418
+ /* Native */
5419
+ ) {
5420
+ // Transitive support for native Shadow DOM. A component in native mode
5421
+ // transitively opts all of its descendants into native.
5422
+ shadowMode = 0
5423
+ /* Native */
5424
+ ;
5425
+ } else {
5426
+ // Synthetic if neither this component nor any of its ancestors are configured
5427
+ // to be native.
5428
+ shadowMode = 1
5429
+ /* Synthetic */
5430
+ ;
5431
+ }
5502
5432
  }
5503
5433
  } else {
5504
5434
  shadowMode = 1
@@ -5561,7 +5491,8 @@ function rehydrate(vm) {
5561
5491
  function patchShadowRoot(vm, newCh) {
5562
5492
  const {
5563
5493
  renderRoot,
5564
- children: oldCh
5494
+ children: oldCh,
5495
+ renderer
5565
5496
  } = vm; // caching the new children collection
5566
5497
 
5567
5498
  vm.children = newCh;
@@ -5577,7 +5508,7 @@ function patchShadowRoot(vm, newCh) {
5577
5508
  , vm);
5578
5509
  }, () => {
5579
5510
  // job
5580
- patchChildren(oldCh, newCh, renderRoot);
5511
+ patchChildren(oldCh, newCh, renderRoot, renderer);
5581
5512
  }, () => {
5582
5513
  // post
5583
5514
  logOperationEnd(2
@@ -5602,10 +5533,13 @@ function runRenderedCallback(vm) {
5602
5533
  const {
5603
5534
  def: {
5604
5535
  renderedCallback
5536
+ },
5537
+ renderer: {
5538
+ ssr
5605
5539
  }
5606
5540
  } = vm;
5607
5541
 
5608
- if (isTrue(ssr$1)) {
5542
+ if (isTrue(ssr)) {
5609
5543
  return;
5610
5544
  }
5611
5545
 
@@ -5839,14 +5773,17 @@ function recursivelyDisconnectChildren(vnodes) {
5839
5773
  function resetComponentRoot(vm) {
5840
5774
  const {
5841
5775
  children,
5842
- renderRoot
5776
+ renderRoot,
5777
+ renderer: {
5778
+ remove
5779
+ }
5843
5780
  } = vm;
5844
5781
 
5845
5782
  for (let i = 0, len = children.length; i < len; i++) {
5846
5783
  const child = children[i];
5847
5784
 
5848
5785
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5849
- remove$1(child.elm, renderRoot);
5786
+ remove(child.elm, renderRoot);
5850
5787
  }
5851
5788
  }
5852
5789
 
@@ -5855,7 +5792,13 @@ function resetComponentRoot(vm) {
5855
5792
  vm.velements = EmptyArray;
5856
5793
  }
5857
5794
  function scheduleRehydration(vm) {
5858
- if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
5795
+ const {
5796
+ renderer: {
5797
+ ssr
5798
+ }
5799
+ } = vm;
5800
+
5801
+ if (isTrue(ssr) || isTrue(vm.isScheduled)) {
5859
5802
  return;
5860
5803
  }
5861
5804
 
@@ -6031,6 +5974,9 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
6031
5974
  context: {
6032
5975
  wiredConnecting,
6033
5976
  wiredDisconnecting
5977
+ },
5978
+ renderer: {
5979
+ dispatchEvent
6034
5980
  }
6035
5981
  } = vm; // waiting for the component to be connected to formally request the context via the token
6036
5982
 
@@ -6054,7 +6000,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
6054
6000
  }
6055
6001
 
6056
6002
  });
6057
- dispatchEvent$1(elm, contextRegistrationEvent);
6003
+ dispatchEvent(elm, contextRegistrationEvent);
6058
6004
  });
6059
6005
  }
6060
6006
 
@@ -6302,95 +6248,105 @@ function hydrateRoot(vm) {
6302
6248
  function hydrateVM(vm) {
6303
6249
  const children = renderComponent(vm);
6304
6250
  vm.children = children;
6305
- const parentNode = vm.renderRoot;
6306
- hydrateChildren(getFirstChild$1(parentNode), children, parentNode, vm);
6251
+ const { renderRoot: parentNode, renderer: { getFirstChild }, } = vm;
6252
+ hydrateChildren(getFirstChild(parentNode), children, parentNode, vm);
6307
6253
  runRenderedCallback(vm);
6308
6254
  }
6309
- function hydrateNode(node, vnode) {
6255
+ function hydrateNode(node, vnode, renderer) {
6256
+ var _a, _b;
6310
6257
  let hydratedNode;
6311
6258
  switch (vnode.type) {
6312
6259
  case 0 /* Text */:
6313
- hydratedNode = hydrateText(node, vnode);
6260
+ // VText has no special capability, fallback to the owner's renderer
6261
+ hydratedNode = hydrateText(node, vnode, renderer);
6314
6262
  break;
6315
6263
  case 1 /* Comment */:
6316
- hydratedNode = hydrateComment(node, vnode);
6264
+ // VComment has no special capability, fallback to the owner's renderer
6265
+ hydratedNode = hydrateComment(node, vnode, renderer);
6317
6266
  break;
6318
6267
  case 2 /* Element */:
6319
- hydratedNode = hydrateElement(node, vnode);
6268
+ hydratedNode = hydrateElement(node, vnode, (_a = vnode.data.renderer) !== null && _a !== void 0 ? _a : renderer);
6320
6269
  break;
6321
6270
  case 3 /* CustomElement */:
6322
- hydratedNode = hydrateCustomElement(node, vnode);
6271
+ hydratedNode = hydrateCustomElement(node, vnode, (_b = vnode.data.renderer) !== null && _b !== void 0 ? _b : renderer);
6323
6272
  break;
6324
6273
  }
6325
- return nextSibling$1(hydratedNode);
6274
+ return renderer.nextSibling(hydratedNode);
6326
6275
  }
6327
- function hydrateText(node, vnode) {
6276
+ function hydrateText(node, vnode, renderer) {
6328
6277
  var _a;
6329
- if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */)) {
6330
- return handleMismatch(node, vnode);
6278
+ if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */, renderer)) {
6279
+ return handleMismatch(node, vnode, renderer);
6331
6280
  }
6332
6281
  if (process.env.NODE_ENV !== 'production') {
6333
- const nodeValue = getProperty$1(node, 'nodeValue');
6282
+ const { getProperty } = renderer;
6283
+ const nodeValue = getProperty(node, 'nodeValue');
6334
6284
  if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
6335
6285
  logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
6336
6286
  }
6337
6287
  }
6338
- setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6288
+ const { setText } = renderer;
6289
+ setText(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6339
6290
  vnode.elm = node;
6340
6291
  return node;
6341
6292
  }
6342
- function hydrateComment(node, vnode) {
6293
+ function hydrateComment(node, vnode, renderer) {
6343
6294
  var _a;
6344
- if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */)) {
6345
- return handleMismatch(node, vnode);
6295
+ if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */, renderer)) {
6296
+ return handleMismatch(node, vnode, renderer);
6346
6297
  }
6347
6298
  if (process.env.NODE_ENV !== 'production') {
6348
- const nodeValue = getProperty$1(node, 'nodeValue');
6299
+ const { getProperty } = renderer;
6300
+ const nodeValue = getProperty(node, 'nodeValue');
6349
6301
  if (nodeValue !== vnode.text) {
6350
6302
  logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
6351
6303
  }
6352
6304
  }
6353
- setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6305
+ const { setProperty } = renderer;
6306
+ setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6354
6307
  vnode.elm = node;
6355
6308
  return node;
6356
6309
  }
6357
- function hydrateElement(elm, vnode) {
6358
- if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
6359
- !isMatchingElement(vnode, elm)) {
6360
- return handleMismatch(elm, vnode);
6310
+ function hydrateElement(elm, vnode, renderer) {
6311
+ if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
6312
+ !isMatchingElement(vnode, elm, renderer)) {
6313
+ return handleMismatch(elm, vnode, renderer);
6361
6314
  }
6362
6315
  vnode.elm = elm;
6316
+ const { owner } = vnode;
6363
6317
  const { context } = vnode.data;
6364
6318
  const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
6365
6319
  if (isDomManual) {
6366
6320
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
6367
6321
  // remove the innerHTML from props so it reuses the existing dom elements.
6368
- const { props } = vnode.data;
6322
+ const { data: { props }, } = vnode;
6323
+ const { getProperty } = renderer;
6369
6324
  if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
6370
- if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
6325
+ if (getProperty(elm, 'innerHTML') === props.innerHTML) {
6371
6326
  // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
6372
6327
  vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
6373
6328
  }
6374
6329
  else {
6375
6330
  if (process.env.NODE_ENV !== 'production') {
6376
- logWarn(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, vnode.owner);
6331
+ logWarn(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: innerHTML values do not match for element, will recover from the difference`, owner);
6377
6332
  }
6378
6333
  }
6379
6334
  }
6380
6335
  }
6381
- patchElementPropsAndAttrs(vnode);
6336
+ patchElementPropsAndAttrs(vnode, renderer);
6382
6337
  if (!isDomManual) {
6383
- hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
6338
+ const { getFirstChild } = renderer;
6339
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
6384
6340
  }
6385
6341
  return elm;
6386
6342
  }
6387
- function hydrateCustomElement(elm, vnode) {
6388
- if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
6389
- !isMatchingElement(vnode, elm)) {
6390
- return handleMismatch(elm, vnode);
6343
+ function hydrateCustomElement(elm, vnode, renderer) {
6344
+ if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
6345
+ !isMatchingElement(vnode, elm, renderer)) {
6346
+ return handleMismatch(elm, vnode, renderer);
6391
6347
  }
6392
6348
  const { sel, mode, ctor, owner } = vnode;
6393
- const vm = createVM(elm, ctor, {
6349
+ const vm = createVM(elm, ctor, renderer, {
6394
6350
  mode,
6395
6351
  owner,
6396
6352
  tagName: sel,
@@ -6399,16 +6355,17 @@ function hydrateCustomElement(elm, vnode) {
6399
6355
  vnode.elm = elm;
6400
6356
  vnode.vm = vm;
6401
6357
  allocateChildren(vnode, vm);
6402
- patchElementPropsAndAttrs(vnode);
6358
+ patchElementPropsAndAttrs(vnode, renderer);
6403
6359
  // Insert hook section:
6404
6360
  if (process.env.NODE_ENV !== 'production') {
6405
6361
  assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
6406
6362
  }
6407
6363
  runConnectedCallback(vm);
6408
6364
  if (vm.renderMode !== 0 /* Light */) {
6365
+ const { getFirstChild } = renderer;
6409
6366
  // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6410
6367
  // Note: for Light DOM, this is handled while hydrating the VM
6411
- hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vm);
6368
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
6412
6369
  }
6413
6370
  hydrateVM(vm);
6414
6371
  return elm;
@@ -6417,11 +6374,12 @@ function hydrateChildren(node, children, parentNode, owner) {
6417
6374
  let hasWarned = false;
6418
6375
  let nextNode = node;
6419
6376
  let anchor = null;
6377
+ const { renderer } = owner;
6420
6378
  for (let i = 0; i < children.length; i++) {
6421
6379
  const childVnode = children[i];
6422
6380
  if (!isNull(childVnode)) {
6423
6381
  if (nextNode) {
6424
- nextNode = hydrateNode(nextNode, childVnode);
6382
+ nextNode = hydrateNode(nextNode, childVnode, renderer);
6425
6383
  anchor = childVnode.elm;
6426
6384
  }
6427
6385
  else {
@@ -6432,7 +6390,7 @@ function hydrateChildren(node, children, parentNode, owner) {
6432
6390
  logError(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
6433
6391
  }
6434
6392
  }
6435
- mount(childVnode, parentNode, anchor);
6393
+ mount(childVnode, parentNode, renderer, anchor);
6436
6394
  anchor = childVnode.elm;
6437
6395
  }
6438
6396
  }
@@ -6444,31 +6402,33 @@ function hydrateChildren(node, children, parentNode, owner) {
6444
6402
  logError(`Hydration mismatch: incorrect number of rendered nodes. Server rendered more nodes than the client.`, owner);
6445
6403
  }
6446
6404
  }
6405
+ // nextSibling is mostly harmless, and since we don't have
6406
+ // a good reference to what element to act upon, we instead
6407
+ // rely on the vm's associated renderer for navigating to the
6408
+ // next node in the list to be hydrated.
6409
+ const { nextSibling } = renderer;
6447
6410
  do {
6448
6411
  const current = nextNode;
6449
- nextNode = nextSibling$1(nextNode);
6450
- removeNode(current, parentNode);
6412
+ nextNode = nextSibling(nextNode);
6413
+ removeNode(current, parentNode, renderer);
6451
6414
  } while (nextNode);
6452
6415
  }
6453
6416
  }
6454
- function handleMismatch(node, vnode, msg) {
6417
+ function handleMismatch(node, vnode, renderer) {
6455
6418
  hasMismatch = true;
6456
- if (!isUndefined$1(msg)) {
6457
- if (process.env.NODE_ENV !== 'production') {
6458
- logError(msg, vnode.owner);
6459
- }
6460
- }
6461
- const parentNode = getProperty$1(node, 'parentNode');
6462
- mount(vnode, parentNode, node);
6463
- removeNode(node, parentNode);
6419
+ const { getProperty } = renderer;
6420
+ const parentNode = getProperty(node, 'parentNode');
6421
+ mount(vnode, parentNode, renderer, node);
6422
+ removeNode(node, parentNode, renderer);
6464
6423
  return vnode.elm;
6465
6424
  }
6466
- function patchElementPropsAndAttrs(vnode) {
6467
- applyEventListeners(vnode);
6468
- patchProps(null, vnode);
6425
+ function patchElementPropsAndAttrs(vnode, renderer) {
6426
+ applyEventListeners(vnode, renderer);
6427
+ patchProps(null, vnode, renderer);
6469
6428
  }
6470
- function hasCorrectNodeType(vnode, node, nodeType) {
6471
- if (getProperty$1(node, 'nodeType') !== nodeType) {
6429
+ function hasCorrectNodeType(vnode, node, nodeType, renderer) {
6430
+ const { getProperty } = renderer;
6431
+ if (getProperty(node, 'nodeType') !== nodeType) {
6472
6432
  if (process.env.NODE_ENV !== 'production') {
6473
6433
  logError('Hydration mismatch: incorrect node type received', vnode.owner);
6474
6434
  }
@@ -6476,46 +6436,51 @@ function hasCorrectNodeType(vnode, node, nodeType) {
6476
6436
  }
6477
6437
  return true;
6478
6438
  }
6479
- function isMatchingElement(vnode, elm) {
6480
- if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
6439
+ function isMatchingElement(vnode, elm, renderer) {
6440
+ const { getProperty } = renderer;
6441
+ if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
6481
6442
  if (process.env.NODE_ENV !== 'production') {
6482
- logError(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty$1(elm, 'tagName').toLowerCase()}".`, vnode.owner);
6443
+ logError(`Hydration mismatch: expecting element with tag "${vnode.sel.toLowerCase()}" but found "${getProperty(elm, 'tagName').toLowerCase()}".`, vnode.owner);
6483
6444
  }
6484
6445
  return false;
6485
6446
  }
6486
- const hasIncompatibleAttrs = validateAttrs(vnode, elm);
6487
- const hasIncompatibleClass = validateClassAttr(vnode, elm);
6488
- const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
6447
+ const hasIncompatibleAttrs = validateAttrs(vnode, elm, renderer);
6448
+ const hasIncompatibleClass = validateClassAttr(vnode, elm, renderer);
6449
+ const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
6489
6450
  return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6490
6451
  }
6491
- function validateAttrs(vnode, elm) {
6452
+ function validateAttrs(vnode, elm, renderer) {
6492
6453
  const { data: { attrs = {} }, } = vnode;
6493
6454
  let nodesAreCompatible = true;
6494
6455
  // Validate attributes, though we could always recovery from those by running the update mods.
6495
6456
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6496
6457
  for (const [attrName, attrValue] of Object.entries(attrs)) {
6497
- const elmAttrValue = getAttribute$1(elm, attrName);
6458
+ const { owner } = vnode;
6459
+ const { getAttribute } = renderer;
6460
+ const elmAttrValue = getAttribute(elm, attrName);
6498
6461
  if (String(attrValue) !== elmAttrValue) {
6499
6462
  if (process.env.NODE_ENV !== 'production') {
6500
- logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, vnode.owner);
6463
+ const { getProperty } = renderer;
6464
+ logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "${attrName}" has different values, expected "${attrValue}" but found "${elmAttrValue}"`, owner);
6501
6465
  }
6502
6466
  nodesAreCompatible = false;
6503
6467
  }
6504
6468
  }
6505
6469
  return nodesAreCompatible;
6506
6470
  }
6507
- function validateClassAttr(vnode, elm) {
6471
+ function validateClassAttr(vnode, elm, renderer) {
6508
6472
  const { data: { className, classMap }, } = vnode;
6473
+ const { getProperty, getClassList } = renderer;
6509
6474
  let nodesAreCompatible = true;
6510
6475
  let vnodeClassName;
6511
- if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
6476
+ if (!isUndefined$1(className) && String(className) !== getProperty(elm, 'className')) {
6512
6477
  // className is used when class is bound to an expr.
6513
6478
  nodesAreCompatible = false;
6514
6479
  vnodeClassName = className;
6515
6480
  }
6516
6481
  else if (!isUndefined$1(classMap)) {
6517
6482
  // classMap is used when class is set to static value.
6518
- const classList = getClassList$1(elm);
6483
+ const classList = getClassList(elm);
6519
6484
  let computedClassName = '';
6520
6485
  // all classes from the vnode should be in the element.classList
6521
6486
  for (const name in classMap) {
@@ -6531,14 +6496,15 @@ function validateClassAttr(vnode, elm) {
6531
6496
  }
6532
6497
  if (!nodesAreCompatible) {
6533
6498
  if (process.env.NODE_ENV !== 'production') {
6534
- logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${getProperty$1(elm, 'className')}"`, vnode.owner);
6499
+ logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "class" has different values, expected "${vnodeClassName}" but found "${getProperty(elm, 'className')}"`, vnode.owner);
6535
6500
  }
6536
6501
  }
6537
6502
  return nodesAreCompatible;
6538
6503
  }
6539
- function validateStyleAttr(vnode, elm) {
6504
+ function validateStyleAttr(vnode, elm, renderer) {
6540
6505
  const { data: { style, styleDecls }, } = vnode;
6541
- const elmStyle = getAttribute$1(elm, 'style') || '';
6506
+ const { getAttribute } = renderer;
6507
+ const elmStyle = getAttribute(elm, 'style') || '';
6542
6508
  let vnodeStyle;
6543
6509
  let nodesAreCompatible = true;
6544
6510
  if (!isUndefined$1(style) && style !== elmStyle) {
@@ -6570,7 +6536,8 @@ function validateStyleAttr(vnode, elm) {
6570
6536
  }
6571
6537
  if (!nodesAreCompatible) {
6572
6538
  if (process.env.NODE_ENV !== 'production') {
6573
- logError(`Mismatch hydrating element <${getProperty$1(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
6539
+ const { getProperty } = renderer;
6540
+ logError(`Mismatch hydrating element <${getProperty(elm, 'tagName').toLowerCase()}>: attribute "style" has different values, expected "${vnodeStyle}" but found "${elmStyle}".`, vnode.owner);
6574
6541
  }
6575
6542
  }
6576
6543
  return nodesAreCompatible;
@@ -6710,7 +6677,7 @@ function getComponentConstructor(elm) {
6710
6677
  }
6711
6678
  return ctor;
6712
6679
  }
6713
- /* version: 2.13.4 */
6680
+ /* version: 2.14.2 */
6714
6681
 
6715
6682
  /*
6716
6683
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6869,7 +6836,7 @@ function isCustomElementRegistryAvailable() {
6869
6836
  try {
6870
6837
  // dereference HTMLElement global because babel wraps globals in compat mode with a
6871
6838
  // _wrapNativeSuper()
6872
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElement which does not
6839
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
6873
6840
  // get wrapped by babel.
6874
6841
  const HTMLElementAlias = HTMLElement;
6875
6842
  // In case we use compat mode with a modern browser, the compat mode transformation
@@ -6923,6 +6890,9 @@ function setIsHydrating(value) {
6923
6890
  hydrating = value;
6924
6891
  }
6925
6892
  const ssr = false;
6893
+ function isHydrating() {
6894
+ return hydrating;
6895
+ }
6926
6896
  const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
6927
6897
  const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
6928
6898
  function createElement$1(tagName, namespace) {
@@ -7041,76 +7011,47 @@ function assertInstanceOfHTMLElement(elm, msg) {
7041
7011
  assert.invariant(elm instanceof HTMLElement, msg);
7042
7012
  }
7043
7013
  const HTMLElementExported = HTMLElementConstructor;
7044
-
7045
- /*
7046
- * Copyright (c) 2020, salesforce.com, inc.
7047
- * All rights reserved.
7048
- * SPDX-License-Identifier: MIT
7049
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7050
- */
7051
- setAssertInstanceOfHTMLElement(assertInstanceOfHTMLElement);
7052
- setAttachShadow(attachShadow);
7053
- setCreateComment(createComment);
7054
- setCreateElement(createElement$1);
7055
- setCreateText(createText);
7056
- setDefineCustomElement(defineCustomElement);
7057
- setDispatchEvent(dispatchEvent);
7058
- setGetAttribute(getAttribute);
7059
- setGetBoundingClientRect(getBoundingClientRect);
7060
- setGetChildNodes(getChildNodes);
7061
- setGetChildren(getChildren);
7062
- setGetClassList(getClassList);
7063
- setGetCustomElement(getCustomElement);
7064
- setGetElementsByClassName(getElementsByClassName);
7065
- setGetElementsByTagName(getElementsByTagName);
7066
- setGetFirstChild(getFirstChild);
7067
- setGetFirstElementChild(getFirstElementChild);
7068
- setGetLastChild(getLastChild);
7069
- setGetLastElementChild(getLastElementChild);
7070
- setGetProperty(getProperty);
7071
- setHTMLElement(HTMLElementExported);
7072
- setInsert(insert);
7073
- setIsConnected(isConnected);
7074
- setIsNativeShadowDefined(isNativeShadowDefined);
7075
- setIsSyntheticShadowDefined(isSyntheticShadowDefined);
7076
- setNextSibling(nextSibling);
7077
- setQuerySelector(querySelector);
7078
- setQuerySelectorAll(querySelectorAll);
7079
- setRemove(remove);
7080
- setRemoveAttribute(removeAttribute);
7081
- setRemoveEventListener(removeEventListener);
7082
- setSetAttribute(setAttribute);
7083
- setSetCSSStyleProperty(setCSSStyleProperty);
7084
- setSetProperty(setProperty);
7085
- setSetText(setText);
7086
- setSsr(ssr);
7087
- setAddEventListener(addEventListener);
7088
- setInsertStylesheet(insertStylesheet);
7089
-
7090
- /*
7091
- * Copyright (c) 2018, salesforce.com, inc.
7092
- * All rights reserved.
7093
- * SPDX-License-Identifier: MIT
7094
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7095
- */
7096
- // @ts-ignore
7097
-
7098
- if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
7099
- window.addEventListener('test-dummy-flag', () => {
7100
- let hasFlag = false;
7101
-
7102
- if (runtimeFlags.DUMMY_TEST_FLAG) {
7103
- hasFlag = true;
7104
- }
7105
-
7106
- window.dispatchEvent(new CustomEvent('has-dummy-flag', {
7107
- detail: {
7108
- package: '@lwc/engine-dom',
7109
- hasFlag
7110
- }
7111
- }));
7112
- });
7113
- }
7014
+ const renderer = {
7015
+ ssr,
7016
+ isNativeShadowDefined,
7017
+ isSyntheticShadowDefined,
7018
+ HTMLElementExported,
7019
+ isHydrating,
7020
+ insert,
7021
+ remove,
7022
+ createElement: createElement$1,
7023
+ createText,
7024
+ createComment,
7025
+ nextSibling,
7026
+ attachShadow,
7027
+ getProperty,
7028
+ setProperty,
7029
+ setText,
7030
+ getAttribute,
7031
+ setAttribute,
7032
+ removeAttribute,
7033
+ addEventListener,
7034
+ removeEventListener,
7035
+ dispatchEvent,
7036
+ getClassList,
7037
+ setCSSStyleProperty,
7038
+ getBoundingClientRect,
7039
+ querySelector,
7040
+ querySelectorAll,
7041
+ getElementsByTagName,
7042
+ getElementsByClassName,
7043
+ getChildren,
7044
+ getChildNodes,
7045
+ getFirstChild,
7046
+ getFirstElementChild,
7047
+ getLastChild,
7048
+ getLastElementChild,
7049
+ isConnected,
7050
+ insertStylesheet,
7051
+ assertInstanceOfHTMLElement,
7052
+ defineCustomElement,
7053
+ getCustomElement,
7054
+ };
7114
7055
 
7115
7056
  /*
7116
7057
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7132,7 +7073,7 @@ function resetShadowRootAndLightDom(element, Ctor) {
7132
7073
  }
7133
7074
  }
7134
7075
  function createVMWithProps(element, Ctor, props) {
7135
- const vm = createVM(element, Ctor, {
7076
+ const vm = createVM(element, Ctor, renderer, {
7136
7077
  mode: 'open',
7137
7078
  owner: null,
7138
7079
  tagName: element.tagName.toLowerCase(),
@@ -7228,7 +7169,7 @@ function buildCustomElementConstructor(Ctor) {
7228
7169
  hydratedCustomElements.add(this);
7229
7170
  }
7230
7171
  else {
7231
- createVM(this, Ctor, {
7172
+ createVM(this, Ctor, renderer, {
7232
7173
  mode: 'open',
7233
7174
  owner: null,
7234
7175
  tagName: this.tagName,
@@ -7313,7 +7254,7 @@ function createElement(sel, options) {
7313
7254
  if (!isFunction$1(Ctor)) {
7314
7255
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
7315
7256
  }
7316
- const UpgradableConstructor = getUpgradableConstructor(sel);
7257
+ const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
7317
7258
  let wasComponentUpgraded = false;
7318
7259
  // the custom element from the registry is expecting an upgrade callback
7319
7260
  /**
@@ -7323,7 +7264,7 @@ function createElement(sel, options) {
7323
7264
  * an upgradable custom element.
7324
7265
  */
7325
7266
  const element = new UpgradableConstructor((elm) => {
7326
- createVM(elm, Ctor, {
7267
+ createVM(elm, Ctor, renderer, {
7327
7268
  tagName: sel,
7328
7269
  mode: options.mode !== 'closed' ? 'open' : 'closed',
7329
7270
  owner: null,
@@ -7407,6 +7348,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
7407
7348
  });
7408
7349
  freeze(LightningElement);
7409
7350
  seal(LightningElement.prototype);
7410
- /* version: 2.13.4 */
7351
+ /* version: 2.14.2 */
7411
7352
 
7412
- export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
7353
+ export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, freezeTemplate, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeShadowed as isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };