lwc 2.14.1 → 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 +449 -534
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +449 -533
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +393 -478
  5. package/dist/engine-dom/iife/es5/engine-dom.js +561 -700
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +498 -642
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +449 -533
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +393 -478
  11. package/dist/engine-dom/umd/es5/engine-dom.js +561 -700
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +498 -642
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +332 -437
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +332 -438
  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
@@ -293,7 +293,7 @@
293
293
  const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
294
294
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
295
295
  const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
296
- /** version: 2.14.1 */
296
+ /** version: 2.14.2 */
297
297
 
298
298
  /*
299
299
  * Copyright (c) 2018, salesforce.com, inc.
@@ -497,158 +497,6 @@
497
497
  return result;
498
498
  }
499
499
 
500
- //
501
- // Primitives
502
- //
503
- let ssr$1;
504
- function setSsr(ssrImpl) {
505
- ssr$1 = ssrImpl;
506
- }
507
- let isNativeShadowDefined$1;
508
- function setIsNativeShadowDefined(isNativeShadowDefinedImpl) {
509
- isNativeShadowDefined$1 = isNativeShadowDefinedImpl;
510
- }
511
- let isSyntheticShadowDefined$1;
512
- function setIsSyntheticShadowDefined(isSyntheticShadowDefinedImpl) {
513
- isSyntheticShadowDefined$1 = isSyntheticShadowDefinedImpl;
514
- }
515
- let HTMLElementExported$1;
516
- function setHTMLElement(HTMLElementImpl) {
517
- HTMLElementExported$1 = HTMLElementImpl;
518
- }
519
- let insert$1;
520
- function setInsert(insertImpl) {
521
- insert$1 = insertImpl;
522
- }
523
- let remove$1;
524
- function setRemove(removeImpl) {
525
- remove$1 = removeImpl;
526
- }
527
- let createElement$2;
528
- function setCreateElement(createElementImpl) {
529
- createElement$2 = createElementImpl;
530
- }
531
- let createText$1;
532
- function setCreateText(createTextImpl) {
533
- createText$1 = createTextImpl;
534
- }
535
- let createComment$1;
536
- function setCreateComment(createCommentImpl) {
537
- createComment$1 = createCommentImpl;
538
- }
539
- let nextSibling$1;
540
- function setNextSibling(nextSiblingImpl) {
541
- nextSibling$1 = nextSiblingImpl;
542
- }
543
- let attachShadow$1;
544
- function setAttachShadow(attachShadowImpl) {
545
- attachShadow$1 = attachShadowImpl;
546
- }
547
- let getProperty$1;
548
- function setGetProperty(getPropertyImpl) {
549
- getProperty$1 = getPropertyImpl;
550
- }
551
- let setProperty$1;
552
- function setSetProperty(setPropertyImpl) {
553
- setProperty$1 = setPropertyImpl;
554
- }
555
- let setText$1;
556
- function setSetText(setTextImpl) {
557
- setText$1 = setTextImpl;
558
- }
559
- let getAttribute$1;
560
- function setGetAttribute(getAttributeImpl) {
561
- getAttribute$1 = getAttributeImpl;
562
- }
563
- let setAttribute$1;
564
- function setSetAttribute(setAttributeImpl) {
565
- setAttribute$1 = setAttributeImpl;
566
- }
567
- let removeAttribute$1;
568
- function setRemoveAttribute(removeAttributeImpl) {
569
- removeAttribute$1 = removeAttributeImpl;
570
- }
571
- let addEventListener$1;
572
- function setAddEventListener(addEventListenerImpl) {
573
- addEventListener$1 = addEventListenerImpl;
574
- }
575
- let removeEventListener$1;
576
- function setRemoveEventListener(removeEventListenerImpl) {
577
- removeEventListener$1 = removeEventListenerImpl;
578
- }
579
- let dispatchEvent$1;
580
- function setDispatchEvent(dispatchEventImpl) {
581
- dispatchEvent$1 = dispatchEventImpl;
582
- }
583
- let getClassList$1;
584
- function setGetClassList(getClassListImpl) {
585
- getClassList$1 = getClassListImpl;
586
- }
587
- let setCSSStyleProperty$1;
588
- function setSetCSSStyleProperty(setCSSStylePropertyImpl) {
589
- setCSSStyleProperty$1 = setCSSStylePropertyImpl;
590
- }
591
- let getBoundingClientRect$1;
592
- function setGetBoundingClientRect(getBoundingClientRectImpl) {
593
- getBoundingClientRect$1 = getBoundingClientRectImpl;
594
- }
595
- let querySelector$1;
596
- function setQuerySelector(querySelectorImpl) {
597
- querySelector$1 = querySelectorImpl;
598
- }
599
- let querySelectorAll$1;
600
- function setQuerySelectorAll(querySelectorAllImpl) {
601
- querySelectorAll$1 = querySelectorAllImpl;
602
- }
603
- let getElementsByTagName$1;
604
- function setGetElementsByTagName(getElementsByTagNameImpl) {
605
- getElementsByTagName$1 = getElementsByTagNameImpl;
606
- }
607
- let getElementsByClassName$1;
608
- function setGetElementsByClassName(getElementsByClassNameImpl) {
609
- getElementsByClassName$1 = getElementsByClassNameImpl;
610
- }
611
- let getChildren$1;
612
- function setGetChildren(getChildrenImpl) {
613
- getChildren$1 = getChildrenImpl;
614
- }
615
- let getChildNodes$1;
616
- function setGetChildNodes(getChildNodesImpl) {
617
- getChildNodes$1 = getChildNodesImpl;
618
- }
619
- let getFirstChild$1;
620
- function setGetFirstChild(getFirstChildImpl) {
621
- getFirstChild$1 = getFirstChildImpl;
622
- }
623
- let getFirstElementChild$1;
624
- function setGetFirstElementChild(getFirstElementChildImpl) {
625
- getFirstElementChild$1 = getFirstElementChildImpl;
626
- }
627
- let getLastChild$1;
628
- function setGetLastChild(getLastChildImpl) {
629
- getLastChild$1 = getLastChildImpl;
630
- }
631
- let getLastElementChild$1;
632
- function setGetLastElementChild(getLastElementChildImpl) {
633
- getLastElementChild$1 = getLastElementChildImpl;
634
- }
635
- let isConnected$1;
636
- function setIsConnected(isConnectedImpl) {
637
- isConnected$1 = isConnectedImpl;
638
- }
639
- let insertStylesheet$1;
640
- function setInsertStylesheet(insertStylesheetImpl) {
641
- insertStylesheet$1 = insertStylesheetImpl;
642
- }
643
- let defineCustomElement$1;
644
- function setDefineCustomElement(defineCustomElementImpl) {
645
- defineCustomElement$1 = defineCustomElementImpl;
646
- }
647
- let getCustomElement$1;
648
- function setGetCustomElement(getCustomElementImpl) {
649
- getCustomElement$1 = getCustomElementImpl;
650
- }
651
-
652
500
  /*
653
501
  * Copyright (c) 2019, salesforce.com, inc.
654
502
  * All rights reserved.
@@ -1524,8 +1372,8 @@
1524
1372
  return this;
1525
1373
  };
1526
1374
  function doAttachShadow(vm) {
1527
- const { elm, mode, shadowMode, def: { ctor }, } = vm;
1528
- const shadowRoot = attachShadow$1(elm, {
1375
+ const { elm, mode, shadowMode, def: { ctor }, renderer: { attachShadow }, } = vm;
1376
+ const shadowRoot = attachShadow(elm, {
1529
1377
  [KEY__SYNTHETIC_MODE]: shadowMode === 1 /* Synthetic */,
1530
1378
  delegatesFocus: Boolean(ctor.delegatesFocus),
1531
1379
  mode,
@@ -1538,76 +1386,85 @@
1538
1386
  LightningElement.prototype = {
1539
1387
  constructor: LightningElement,
1540
1388
  dispatchEvent(event) {
1541
- const { elm } = getAssociatedVM(this);
1542
- return dispatchEvent$1(elm, event);
1389
+ const vm = getAssociatedVM(this);
1390
+ const { elm, renderer: { dispatchEvent }, } = vm;
1391
+ return dispatchEvent(elm, event);
1543
1392
  },
1544
1393
  addEventListener(type, listener, options) {
1545
1394
  const vm = getAssociatedVM(this);
1546
- const { elm } = vm;
1395
+ const { elm, renderer: { addEventListener }, } = vm;
1547
1396
  const wrappedListener = getWrappedComponentsListener(vm, listener);
1548
- addEventListener$1(elm, type, wrappedListener, options);
1397
+ addEventListener(elm, type, wrappedListener, options);
1549
1398
  },
1550
1399
  removeEventListener(type, listener, options) {
1551
1400
  const vm = getAssociatedVM(this);
1552
- const { elm } = vm;
1401
+ const { elm, renderer: { removeEventListener }, } = vm;
1553
1402
  const wrappedListener = getWrappedComponentsListener(vm, listener);
1554
- removeEventListener$1(elm, type, wrappedListener, options);
1403
+ removeEventListener(elm, type, wrappedListener, options);
1555
1404
  },
1556
1405
  hasAttribute(name) {
1557
- const { elm } = getAssociatedVM(this);
1558
- return !isNull(getAttribute$1(elm, name));
1406
+ const vm = getAssociatedVM(this);
1407
+ const { elm, renderer: { getAttribute }, } = vm;
1408
+ return !isNull(getAttribute(elm, name));
1559
1409
  },
1560
1410
  hasAttributeNS(namespace, name) {
1561
- const { elm } = getAssociatedVM(this);
1562
- return !isNull(getAttribute$1(elm, name, namespace));
1411
+ const vm = getAssociatedVM(this);
1412
+ const { elm, renderer: { getAttribute }, } = vm;
1413
+ return !isNull(getAttribute(elm, name, namespace));
1563
1414
  },
1564
1415
  removeAttribute(name) {
1565
- const { elm } = getAssociatedVM(this);
1416
+ const vm = getAssociatedVM(this);
1417
+ const { elm, renderer: { removeAttribute }, } = vm;
1566
1418
  unlockAttribute(elm, name);
1567
- removeAttribute$1(elm, name);
1419
+ removeAttribute(elm, name);
1568
1420
  lockAttribute();
1569
1421
  },
1570
1422
  removeAttributeNS(namespace, name) {
1571
- const { elm } = getAssociatedVM(this);
1423
+ const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
1572
1424
  unlockAttribute(elm, name);
1573
- removeAttribute$1(elm, name, namespace);
1425
+ removeAttribute(elm, name, namespace);
1574
1426
  lockAttribute();
1575
1427
  },
1576
1428
  getAttribute(name) {
1577
- const { elm } = getAssociatedVM(this);
1578
- return getAttribute$1(elm, name);
1429
+ const vm = getAssociatedVM(this);
1430
+ const { elm } = vm;
1431
+ const { getAttribute } = vm.renderer;
1432
+ return getAttribute(elm, name);
1579
1433
  },
1580
1434
  getAttributeNS(namespace, name) {
1581
- const { elm } = getAssociatedVM(this);
1582
- return getAttribute$1(elm, name, namespace);
1435
+ const vm = getAssociatedVM(this);
1436
+ const { elm } = vm;
1437
+ const { getAttribute } = vm.renderer;
1438
+ return getAttribute(elm, name, namespace);
1583
1439
  },
1584
1440
  setAttribute(name, value) {
1585
1441
  const vm = getAssociatedVM(this);
1586
- const { elm } = vm;
1442
+ const { elm, renderer: { setAttribute }, } = vm;
1587
1443
  unlockAttribute(elm, name);
1588
- setAttribute$1(elm, name, value);
1444
+ setAttribute(elm, name, value);
1589
1445
  lockAttribute();
1590
1446
  },
1591
1447
  setAttributeNS(namespace, name, value) {
1592
1448
  const vm = getAssociatedVM(this);
1593
- const { elm } = vm;
1449
+ const { elm, renderer: { setAttribute }, } = vm;
1594
1450
  unlockAttribute(elm, name);
1595
- setAttribute$1(elm, name, value, namespace);
1451
+ setAttribute(elm, name, value, namespace);
1596
1452
  lockAttribute();
1597
1453
  },
1598
1454
  getBoundingClientRect() {
1599
1455
  const vm = getAssociatedVM(this);
1600
- const { elm } = vm;
1601
- return getBoundingClientRect$1(elm);
1456
+ const { elm, renderer: { getBoundingClientRect }, } = vm;
1457
+ return getBoundingClientRect(elm);
1602
1458
  },
1603
1459
  get isConnected() {
1604
- const { elm } = getAssociatedVM(this);
1605
- return isConnected$1(elm);
1460
+ const vm = getAssociatedVM(this);
1461
+ const { elm, renderer: { isConnected }, } = vm;
1462
+ return isConnected(elm);
1606
1463
  },
1607
1464
  get classList() {
1608
1465
  const vm = getAssociatedVM(this);
1609
- const { elm } = vm;
1610
- return getClassList$1(elm);
1466
+ const { elm, renderer: { getClassList }, } = vm;
1467
+ return getClassList(elm);
1611
1468
  },
1612
1469
  get template() {
1613
1470
  const vm = getAssociatedVM(this);
@@ -1618,6 +1475,36 @@
1618
1475
  // Authors should rely on this.template instead.
1619
1476
  return null;
1620
1477
  },
1478
+ get children() {
1479
+ const vm = getAssociatedVM(this);
1480
+ const renderer = vm.renderer;
1481
+ return renderer.getChildren(vm.elm);
1482
+ },
1483
+ get childNodes() {
1484
+ const vm = getAssociatedVM(this);
1485
+ const renderer = vm.renderer;
1486
+ return renderer.getChildNodes(vm.elm);
1487
+ },
1488
+ get firstChild() {
1489
+ const vm = getAssociatedVM(this);
1490
+ const renderer = vm.renderer;
1491
+ return renderer.getFirstChild(vm.elm);
1492
+ },
1493
+ get firstElementChild() {
1494
+ const vm = getAssociatedVM(this);
1495
+ const renderer = vm.renderer;
1496
+ return renderer.getFirstElementChild(vm.elm);
1497
+ },
1498
+ get lastChild() {
1499
+ const vm = getAssociatedVM(this);
1500
+ const renderer = vm.renderer;
1501
+ return renderer.getLastChild(vm.elm);
1502
+ },
1503
+ get lastElementChild() {
1504
+ const vm = getAssociatedVM(this);
1505
+ const renderer = vm.renderer;
1506
+ return renderer.getLastElementChild(vm.elm);
1507
+ },
1621
1508
  render() {
1622
1509
  const vm = getAssociatedVM(this);
1623
1510
  return vm.def.template;
@@ -1628,70 +1515,19 @@
1628
1515
  },
1629
1516
  };
1630
1517
  const queryAndChildGetterDescriptors = create(null);
1631
- // The reason we don't just call `import * as renderer from '../renderer'` here is that the bundle size
1632
- // is smaller if we reference each function individually. Otherwise Rollup will create one big frozen
1633
- // object representing the renderer, with a lot of methods we don't actually need.
1634
- const childGetters = [
1635
- 'children',
1636
- 'childNodes',
1637
- 'firstChild',
1638
- 'firstElementChild',
1639
- 'lastChild',
1640
- 'lastElementChild',
1641
- ];
1642
- function getChildGetter(methodName) {
1643
- switch (methodName) {
1644
- case 'children':
1645
- return getChildren$1;
1646
- case 'childNodes':
1647
- return getChildNodes$1;
1648
- case 'firstChild':
1649
- return getFirstChild$1;
1650
- case 'firstElementChild':
1651
- return getFirstElementChild$1;
1652
- case 'lastChild':
1653
- return getLastChild$1;
1654
- case 'lastElementChild':
1655
- return getLastElementChild$1;
1656
- }
1657
- }
1658
- // Generic passthrough for child getters on HTMLElement to the relevant Renderer APIs
1659
- for (const childGetter of childGetters) {
1660
- queryAndChildGetterDescriptors[childGetter] = {
1661
- get() {
1662
- const vm = getAssociatedVM(this);
1663
- const { elm } = vm;
1664
- return getChildGetter(childGetter)(elm);
1665
- },
1666
- configurable: true,
1667
- enumerable: true,
1668
- };
1669
- }
1670
1518
  const queryMethods = [
1671
1519
  'getElementsByClassName',
1672
1520
  'getElementsByTagName',
1673
1521
  'querySelector',
1674
1522
  'querySelectorAll',
1675
1523
  ];
1676
- function getQueryMethod(methodName) {
1677
- switch (methodName) {
1678
- case 'getElementsByClassName':
1679
- return getElementsByClassName$1;
1680
- case 'getElementsByTagName':
1681
- return getElementsByTagName$1;
1682
- case 'querySelector':
1683
- return querySelector$1;
1684
- case 'querySelectorAll':
1685
- return querySelectorAll$1;
1686
- }
1687
- }
1688
1524
  // Generic passthrough for query APIs on HTMLElement to the relevant Renderer APIs
1689
1525
  for (const queryMethod of queryMethods) {
1690
1526
  queryAndChildGetterDescriptors[queryMethod] = {
1691
1527
  value(arg) {
1692
1528
  const vm = getAssociatedVM(this);
1693
- const { elm } = vm;
1694
- return getQueryMethod(queryMethod)(elm, arg);
1529
+ const { elm, renderer } = vm;
1530
+ return renderer[queryMethod](elm, arg);
1695
1531
  },
1696
1532
  configurable: true,
1697
1533
  enumerable: true,
@@ -2462,12 +2298,13 @@
2462
2298
  * SPDX-License-Identifier: MIT
2463
2299
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2464
2300
  */
2465
- function getUpgradableConstructor(tagName) {
2301
+ function getUpgradableConstructor(tagName, renderer) {
2302
+ const { getCustomElement, HTMLElementExported: RendererHTMLElement, defineCustomElement, } = renderer;
2466
2303
  // Should never get a tag with upper case letter at this point, the compiler should
2467
2304
  // produce only tags with lowercase letters
2468
2305
  // But, for backwards compatibility, we will lower case the tagName
2469
2306
  tagName = tagName.toLowerCase();
2470
- let CE = getCustomElement$1(tagName);
2307
+ let CE = getCustomElement(tagName);
2471
2308
  if (!isUndefined$1(CE)) {
2472
2309
  return CE;
2473
2310
  }
@@ -2475,7 +2312,7 @@
2475
2312
  * LWC Upgradable Element reference to an element that was created
2476
2313
  * via the scoped registry mechanism, and that is ready to be upgraded.
2477
2314
  */
2478
- CE = class LWCUpgradableElement extends HTMLElementExported$1 {
2315
+ CE = class LWCUpgradableElement extends RendererHTMLElement {
2479
2316
  constructor(upgradeCallback) {
2480
2317
  super();
2481
2318
  if (isFunction$1(upgradeCallback)) {
@@ -2483,7 +2320,7 @@
2483
2320
  }
2484
2321
  }
2485
2322
  };
2486
- defineCustomElement$1(tagName, CE);
2323
+ defineCustomElement(tagName, CE);
2487
2324
  return CE;
2488
2325
  }
2489
2326
 
@@ -2508,7 +2345,7 @@
2508
2345
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2509
2346
  */
2510
2347
  const ColonCharCode = 58;
2511
- function patchAttributes(oldVnode, vnode) {
2348
+ function patchAttributes(oldVnode, vnode, renderer) {
2512
2349
  const { attrs } = vnode.data;
2513
2350
  if (isUndefined$1(attrs)) {
2514
2351
  return;
@@ -2518,6 +2355,7 @@
2518
2355
  return;
2519
2356
  }
2520
2357
  const { elm } = vnode;
2358
+ const { setAttribute, removeAttribute } = renderer;
2521
2359
  for (const key in attrs) {
2522
2360
  const cur = attrs[key];
2523
2361
  const old = oldAttrs[key];
@@ -2525,17 +2363,17 @@
2525
2363
  unlockAttribute(elm, key);
2526
2364
  if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
2527
2365
  // Assume xml namespace
2528
- setAttribute$1(elm, key, cur, XML_NAMESPACE);
2366
+ setAttribute(elm, key, cur, XML_NAMESPACE);
2529
2367
  }
2530
2368
  else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
2531
2369
  // Assume xlink namespace
2532
- setAttribute$1(elm, key, cur, XLINK_NAMESPACE);
2370
+ setAttribute(elm, key, cur, XLINK_NAMESPACE);
2533
2371
  }
2534
2372
  else if (isNull(cur) || isUndefined$1(cur)) {
2535
- removeAttribute$1(elm, key);
2373
+ removeAttribute(elm, key);
2536
2374
  }
2537
2375
  else {
2538
- setAttribute$1(elm, key, cur);
2376
+ setAttribute(elm, key, cur);
2539
2377
  }
2540
2378
  lockAttribute();
2541
2379
  }
@@ -2553,7 +2391,7 @@
2553
2391
  // instead of relying on internally tracked values.
2554
2392
  return sel === 'input' && (key === 'value' || key === 'checked');
2555
2393
  }
2556
- function patchProps(oldVnode, vnode) {
2394
+ function patchProps(oldVnode, vnode, renderer) {
2557
2395
  const { props } = vnode.data;
2558
2396
  if (isUndefined$1(props)) {
2559
2397
  return;
@@ -2564,13 +2402,14 @@
2564
2402
  }
2565
2403
  const isFirstPatch = isNull(oldVnode);
2566
2404
  const { elm, sel } = vnode;
2405
+ const { getProperty, setProperty } = renderer;
2567
2406
  for (const key in props) {
2568
2407
  const cur = props[key];
2569
2408
  // Set the property if it's the first time is is patched or if the previous property is
2570
2409
  // different than the one previously set.
2571
2410
  if (isFirstPatch ||
2572
- cur !== (isLiveBindingProp(sel, key) ? getProperty$1(elm, key) : oldProps[key])) {
2573
- setProperty$1(elm, key, cur);
2411
+ cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
2412
+ setProperty(elm, key, cur);
2574
2413
  }
2575
2414
  }
2576
2415
  }
@@ -2611,13 +2450,14 @@
2611
2450
  classNameToClassMap[className] = map;
2612
2451
  return map;
2613
2452
  }
2614
- function patchClassAttribute(oldVnode, vnode) {
2453
+ function patchClassAttribute(oldVnode, vnode, renderer) {
2615
2454
  const { elm, data: { className: newClass }, } = vnode;
2616
2455
  const oldClass = isNull(oldVnode) ? undefined : oldVnode.data.className;
2617
2456
  if (oldClass === newClass) {
2618
2457
  return;
2619
2458
  }
2620
- const classList = getClassList$1(elm);
2459
+ const { getClassList } = renderer;
2460
+ const classList = getClassList(elm);
2621
2461
  const newClassMap = getMapFromClassName(newClass);
2622
2462
  const oldClassMap = getMapFromClassName(oldClass);
2623
2463
  let name;
@@ -2641,17 +2481,18 @@
2641
2481
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2642
2482
  */
2643
2483
  // The style property is a string when defined via an expression in the template.
2644
- function patchStyleAttribute(oldVnode, vnode) {
2484
+ function patchStyleAttribute(oldVnode, vnode, renderer) {
2645
2485
  const { elm, data: { style: newStyle }, } = vnode;
2646
2486
  const oldStyle = isNull(oldVnode) ? undefined : oldVnode.data.style;
2647
2487
  if (oldStyle === newStyle) {
2648
2488
  return;
2649
2489
  }
2490
+ const { setAttribute, removeAttribute } = renderer;
2650
2491
  if (!isString(newStyle) || newStyle === '') {
2651
- removeAttribute$1(elm, 'style');
2492
+ removeAttribute(elm, 'style');
2652
2493
  }
2653
2494
  else {
2654
- setAttribute$1(elm, 'style', newStyle);
2495
+ setAttribute(elm, 'style', newStyle);
2655
2496
  }
2656
2497
  }
2657
2498
 
@@ -2661,14 +2502,15 @@
2661
2502
  * SPDX-License-Identifier: MIT
2662
2503
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2663
2504
  */
2664
- function applyEventListeners(vnode) {
2505
+ function applyEventListeners(vnode, renderer) {
2665
2506
  const { elm, data: { on }, } = vnode;
2666
2507
  if (isUndefined$1(on)) {
2667
2508
  return;
2668
2509
  }
2510
+ const { addEventListener } = renderer;
2669
2511
  for (const name in on) {
2670
2512
  const handler = on[name];
2671
- addEventListener$1(elm, name, handler);
2513
+ addEventListener(elm, name, handler);
2672
2514
  }
2673
2515
  }
2674
2516
 
@@ -2681,12 +2523,13 @@
2681
2523
  // The HTML class property becomes the vnode.data.classMap object when defined as a string in the template.
2682
2524
  // The compiler takes care of transforming the inline classnames into an object. It's faster to set the
2683
2525
  // different classnames properties individually instead of via a string.
2684
- function applyStaticClassAttribute(vnode) {
2526
+ function applyStaticClassAttribute(vnode, renderer) {
2685
2527
  const { elm, data: { classMap }, } = vnode;
2686
2528
  if (isUndefined$1(classMap)) {
2687
2529
  return;
2688
2530
  }
2689
- const classList = getClassList$1(elm);
2531
+ const { getClassList } = renderer;
2532
+ const classList = getClassList(elm);
2690
2533
  for (const name in classMap) {
2691
2534
  classList.add(name);
2692
2535
  }
@@ -2701,14 +2544,15 @@
2701
2544
  // The HTML style property becomes the vnode.data.styleDecls object when defined as a string in the template.
2702
2545
  // The compiler takes care of transforming the inline style into an object. It's faster to set the
2703
2546
  // different style properties individually instead of via a string.
2704
- function applyStaticStyleAttribute(vnode) {
2547
+ function applyStaticStyleAttribute(vnode, renderer) {
2705
2548
  const { elm, data: { styleDecls }, } = vnode;
2706
2549
  if (isUndefined$1(styleDecls)) {
2707
2550
  return;
2708
2551
  }
2552
+ const { setCSSStyleProperty } = renderer;
2709
2553
  for (let i = 0; i < styleDecls.length; i++) {
2710
2554
  const [prop, value, important] = styleDecls[i];
2711
- setCSSStyleProperty$1(elm, prop, value, important);
2555
+ setCSSStyleProperty(elm, prop, value, important);
2712
2556
  }
2713
2557
  }
2714
2558
 
@@ -2718,94 +2562,105 @@
2718
2562
  * SPDX-License-Identifier: MIT
2719
2563
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2720
2564
  */
2721
- function patchChildren(c1, c2, parent) {
2565
+ function patchChildren(c1, c2, parent, renderer) {
2722
2566
  if (hasDynamicChildren(c2)) {
2723
- updateDynamicChildren(c1, c2, parent);
2567
+ updateDynamicChildren(c1, c2, parent, renderer);
2724
2568
  }
2725
2569
  else {
2726
- updateStaticChildren(c1, c2, parent);
2570
+ updateStaticChildren(c1, c2, parent, renderer);
2727
2571
  }
2728
2572
  }
2729
- function patch(n1, n2) {
2573
+ function patch(n1, n2, renderer) {
2574
+ var _a, _b;
2730
2575
  if (n1 === n2) {
2731
2576
  return;
2732
2577
  }
2733
2578
  switch (n2.type) {
2734
2579
  case 0 /* Text */:
2735
- patchText(n1, n2);
2580
+ // VText has no special capability, fallback to the owner's renderer
2581
+ patchText(n1, n2, renderer);
2736
2582
  break;
2737
2583
  case 1 /* Comment */:
2738
- patchComment(n1, n2);
2584
+ // VComment has no special capability, fallback to the owner's renderer
2585
+ patchComment(n1, n2, renderer);
2739
2586
  break;
2740
2587
  case 2 /* Element */:
2741
- patchElement(n1, n2);
2588
+ patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
2742
2589
  break;
2743
2590
  case 3 /* CustomElement */:
2744
- patchCustomElement(n1, n2);
2591
+ patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
2745
2592
  break;
2746
2593
  }
2747
2594
  }
2748
- function mount(node, parent, anchor) {
2595
+ function mount(node, parent, renderer, anchor) {
2596
+ var _a, _b;
2749
2597
  switch (node.type) {
2750
2598
  case 0 /* Text */:
2751
- mountText(node, parent, anchor);
2599
+ // VText has no special capability, fallback to the owner's renderer
2600
+ mountText(node, parent, anchor, renderer);
2752
2601
  break;
2753
2602
  case 1 /* Comment */:
2754
- mountComment(node, parent, anchor);
2603
+ // VComment has no special capability, fallback to the owner's renderer
2604
+ mountComment(node, parent, anchor, renderer);
2755
2605
  break;
2756
2606
  case 2 /* Element */:
2757
- mountElement(node, parent, anchor);
2607
+ // If the vnode data has a renderer override use it, else fallback to owner's renderer
2608
+ mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
2758
2609
  break;
2759
2610
  case 3 /* CustomElement */:
2760
- mountCustomElement(node, parent, anchor);
2611
+ // If the vnode data has a renderer override use it, else fallback to owner's renderer
2612
+ mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
2761
2613
  break;
2762
2614
  }
2763
2615
  }
2764
- function patchText(n1, n2) {
2616
+ function patchText(n1, n2, renderer) {
2765
2617
  n2.elm = n1.elm;
2766
2618
  if (n2.text !== n1.text) {
2767
- updateTextContent(n2);
2619
+ updateTextContent(n2, renderer);
2768
2620
  }
2769
2621
  }
2770
- function mountText(node, parent, anchor) {
2771
- const { owner } = node;
2772
- const textNode = (node.elm = createText$1(node.text));
2773
- linkNodeToShadow(textNode, owner);
2774
- insertNode(textNode, parent, anchor);
2622
+ function mountText(vnode, parent, anchor, renderer) {
2623
+ const { owner } = vnode;
2624
+ const { createText } = renderer;
2625
+ const textNode = (vnode.elm = createText(vnode.text));
2626
+ linkNodeToShadow(textNode, owner, renderer);
2627
+ insertNode(textNode, parent, anchor, renderer);
2775
2628
  }
2776
- function patchComment(n1, n2) {
2629
+ function patchComment(n1, n2, renderer) {
2777
2630
  n2.elm = n1.elm;
2778
2631
  // FIXME: Comment nodes should be static, we shouldn't need to diff them together. However
2779
2632
  // it is the case today.
2780
2633
  if (n2.text !== n1.text) {
2781
- updateTextContent(n2);
2634
+ updateTextContent(n2, renderer);
2782
2635
  }
2783
2636
  }
2784
- function mountComment(node, parent, anchor) {
2785
- const { owner } = node;
2786
- const commentNode = (node.elm = createComment$1(node.text));
2787
- linkNodeToShadow(commentNode, owner);
2788
- insertNode(commentNode, parent, anchor);
2637
+ function mountComment(vnode, parent, anchor, renderer) {
2638
+ const { owner } = vnode;
2639
+ const { createComment } = renderer;
2640
+ const commentNode = (vnode.elm = createComment(vnode.text));
2641
+ linkNodeToShadow(commentNode, owner, renderer);
2642
+ insertNode(commentNode, parent, anchor, renderer);
2789
2643
  }
2790
- function mountElement(vnode, parent, anchor) {
2644
+ function mountElement(vnode, parent, anchor, renderer) {
2791
2645
  const { sel, owner, data: { svg }, } = vnode;
2646
+ const { createElement } = renderer;
2792
2647
  const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
2793
- const elm = createElement$2(sel, namespace);
2794
- linkNodeToShadow(elm, owner);
2795
- fallbackElmHook(elm, vnode);
2648
+ const elm = createElement(sel, namespace);
2649
+ linkNodeToShadow(elm, owner, renderer);
2650
+ fallbackElmHook(elm, vnode, renderer);
2796
2651
  vnode.elm = elm;
2797
- patchElementPropsAndAttrs$1(null, vnode);
2798
- insertNode(elm, parent, anchor);
2799
- mountVNodes(vnode.children, elm, null);
2652
+ patchElementPropsAndAttrs$1(null, vnode, renderer);
2653
+ insertNode(elm, parent, anchor, renderer);
2654
+ mountVNodes(vnode.children, elm, renderer, null);
2800
2655
  }
2801
- function patchElement(n1, n2) {
2656
+ function patchElement(n1, n2, renderer) {
2802
2657
  const elm = (n2.elm = n1.elm);
2803
- patchElementPropsAndAttrs$1(n1, n2);
2804
- patchChildren(n1.children, n2.children, elm);
2658
+ patchElementPropsAndAttrs$1(n1, n2, renderer);
2659
+ patchChildren(n1.children, n2.children, elm, renderer);
2805
2660
  }
2806
- function mountCustomElement(vnode, parent, anchor) {
2661
+ function mountCustomElement(vnode, parent, anchor, renderer) {
2807
2662
  const { sel, owner } = vnode;
2808
- const UpgradableConstructor = getUpgradableConstructor(sel);
2663
+ const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
2809
2664
  /**
2810
2665
  * Note: if the upgradable constructor does not expect, or throw when we new it
2811
2666
  * with a callback as the first argument, we could implement a more advanced
@@ -2815,9 +2670,9 @@
2815
2670
  let vm;
2816
2671
  const elm = new UpgradableConstructor((elm) => {
2817
2672
  // the custom element from the registry is expecting an upgrade callback
2818
- vm = createViewModelHook(elm, vnode);
2673
+ vm = createViewModelHook(elm, vnode, renderer);
2819
2674
  });
2820
- linkNodeToShadow(elm, owner);
2675
+ linkNodeToShadow(elm, owner, renderer);
2821
2676
  vnode.elm = elm;
2822
2677
  vnode.vm = vm;
2823
2678
  if (vm) {
@@ -2826,20 +2681,20 @@
2826
2681
  else if (vnode.ctor !== UpgradableConstructor) {
2827
2682
  throw new TypeError(`Incorrect Component Constructor`);
2828
2683
  }
2829
- patchElementPropsAndAttrs$1(null, vnode);
2830
- insertNode(elm, parent, anchor);
2684
+ patchElementPropsAndAttrs$1(null, vnode, renderer);
2685
+ insertNode(elm, parent, anchor, renderer);
2831
2686
  if (vm) {
2832
2687
  runConnectedCallback(vm);
2833
2688
  }
2834
- mountVNodes(vnode.children, elm, null);
2689
+ mountVNodes(vnode.children, elm, renderer, null);
2835
2690
  if (vm) {
2836
2691
  appendVM(vm);
2837
2692
  }
2838
2693
  }
2839
- function patchCustomElement(n1, n2) {
2694
+ function patchCustomElement(n1, n2, renderer) {
2840
2695
  const elm = (n2.elm = n1.elm);
2841
2696
  const vm = (n2.vm = n1.vm);
2842
- patchElementPropsAndAttrs$1(n1, n2);
2697
+ patchElementPropsAndAttrs$1(n1, n2, renderer);
2843
2698
  if (!isUndefined$1(vm)) {
2844
2699
  // in fallback mode, the allocation will always set children to
2845
2700
  // empty and delegate the real allocation to the slot elements
@@ -2847,34 +2702,36 @@
2847
2702
  }
2848
2703
  // in fallback mode, the children will be always empty, so, nothing
2849
2704
  // will happen, but in native, it does allocate the light dom
2850
- patchChildren(n1.children, n2.children, elm);
2705
+ patchChildren(n1.children, n2.children, elm, renderer);
2851
2706
  if (!isUndefined$1(vm)) {
2852
2707
  // this will probably update the shadowRoot, but only if the vm is in a dirty state
2853
2708
  // this is important to preserve the top to bottom synchronous rendering phase.
2854
2709
  rerenderVM(vm);
2855
2710
  }
2856
2711
  }
2857
- function mountVNodes(vnodes, parent, anchor, start = 0, end = vnodes.length) {
2712
+ function mountVNodes(vnodes, parent, renderer, anchor, start = 0, end = vnodes.length) {
2858
2713
  for (; start < end; ++start) {
2859
2714
  const vnode = vnodes[start];
2860
2715
  if (isVNode(vnode)) {
2861
- mount(vnode, parent, anchor);
2716
+ mount(vnode, parent, renderer, anchor);
2862
2717
  }
2863
2718
  }
2864
2719
  }
2865
- function unmount(vnode, parent, doRemove = false) {
2720
+ function unmount(vnode, parent, renderer, doRemove = false) {
2866
2721
  const { type, elm, sel } = vnode;
2867
2722
  // When unmounting a VNode subtree not all the elements have to removed from the DOM. The
2868
2723
  // subtree root, is the only element worth unmounting from the subtree.
2869
2724
  if (doRemove) {
2870
- removeNode(elm, parent);
2725
+ // The vnode might or might not have a data.renderer associated to it
2726
+ // but the removal used here is from the owner instead.
2727
+ removeNode(elm, parent, renderer);
2871
2728
  }
2872
2729
  switch (type) {
2873
2730
  case 2 /* Element */: {
2874
2731
  // Slot content is removed to trigger slotchange event when removing slot.
2875
2732
  // Only required for synthetic shadow.
2876
- const removeChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
2877
- unmountVNodes(vnode.children, elm, removeChildren);
2733
+ const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
2734
+ unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
2878
2735
  break;
2879
2736
  }
2880
2737
  case 3 /* CustomElement */: {
@@ -2887,11 +2744,11 @@
2887
2744
  }
2888
2745
  }
2889
2746
  }
2890
- function unmountVNodes(vnodes, parent, doRemove = false, start = 0, end = vnodes.length) {
2747
+ function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, end = vnodes.length) {
2891
2748
  for (; start < end; ++start) {
2892
2749
  const ch = vnodes[start];
2893
2750
  if (isVNode(ch)) {
2894
- unmount(ch, parent, doRemove);
2751
+ unmount(ch, parent, renderer, doRemove);
2895
2752
  }
2896
2753
  }
2897
2754
  }
@@ -2905,48 +2762,53 @@
2905
2762
  elm.$shadowToken$ = token;
2906
2763
  }
2907
2764
  // Set the scope token class for *.scoped.css styles
2908
- function setScopeTokenClassIfNecessary(elm, owner) {
2765
+ function setScopeTokenClassIfNecessary(elm, owner, renderer) {
2909
2766
  const { cmpTemplate, context } = owner;
2767
+ const { getClassList } = renderer;
2910
2768
  const token = cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken;
2911
2769
  if (!isUndefined$1(token) && context.hasScopedStyles) {
2912
- getClassList$1(elm).add(token);
2770
+ // TODO [#2762]: this dot notation with add is probably problematic
2771
+ // probably we should have a renderer api for just the add operation
2772
+ getClassList(elm).add(token);
2913
2773
  }
2914
2774
  }
2915
- function linkNodeToShadow(elm, owner) {
2775
+ function linkNodeToShadow(elm, owner, renderer) {
2916
2776
  const { renderRoot, renderMode, shadowMode } = owner;
2777
+ const { isSyntheticShadowDefined } = renderer;
2917
2778
  // TODO [#1164]: this should eventually be done by the polyfill directly
2918
- if (isSyntheticShadowDefined$1) {
2779
+ if (isSyntheticShadowDefined) {
2919
2780
  if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
2920
2781
  elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
2921
2782
  }
2922
2783
  }
2923
2784
  }
2924
- function updateTextContent(vnode) {
2785
+ function updateTextContent(vnode, renderer) {
2925
2786
  const { elm, text } = vnode;
2926
- setText$1(elm, text);
2787
+ const { setText } = renderer;
2788
+ setText(elm, text);
2927
2789
  }
2928
- function insertNode(node, parent, anchor) {
2929
- insert$1(node, parent, anchor);
2790
+ function insertNode(node, parent, anchor, renderer) {
2791
+ renderer.insert(node, parent, anchor);
2930
2792
  }
2931
- function removeNode(node, parent) {
2932
- remove$1(node, parent);
2793
+ function removeNode(node, parent, renderer) {
2794
+ renderer.remove(node, parent);
2933
2795
  }
2934
- function patchElementPropsAndAttrs$1(oldVnode, vnode) {
2796
+ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
2935
2797
  if (isNull(oldVnode)) {
2936
- applyEventListeners(vnode);
2937
- applyStaticClassAttribute(vnode);
2938
- applyStaticStyleAttribute(vnode);
2798
+ applyEventListeners(vnode, renderer);
2799
+ applyStaticClassAttribute(vnode, renderer);
2800
+ applyStaticStyleAttribute(vnode, renderer);
2939
2801
  }
2940
2802
  // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
2941
2803
  // value is set before type=radio.
2942
- patchClassAttribute(oldVnode, vnode);
2943
- patchStyleAttribute(oldVnode, vnode);
2944
- patchAttributes(oldVnode, vnode);
2945
- patchProps(oldVnode, vnode);
2804
+ patchClassAttribute(oldVnode, vnode, renderer);
2805
+ patchStyleAttribute(oldVnode, vnode, renderer);
2806
+ patchAttributes(oldVnode, vnode, renderer);
2807
+ patchProps(oldVnode, vnode, renderer);
2946
2808
  }
2947
- function fallbackElmHook(elm, vnode) {
2809
+ function fallbackElmHook(elm, vnode, renderer) {
2948
2810
  const { owner } = vnode;
2949
- setScopeTokenClassIfNecessary(elm, owner);
2811
+ setScopeTokenClassIfNecessary(elm, owner, renderer);
2950
2812
  if (owner.shadowMode === 1 /* Synthetic */) {
2951
2813
  const { data: { context }, } = vnode;
2952
2814
  const { stylesheetToken } = owner.context;
@@ -2986,7 +2848,7 @@
2986
2848
  vnode.children = EmptyArray;
2987
2849
  }
2988
2850
  }
2989
- function createViewModelHook(elm, vnode) {
2851
+ function createViewModelHook(elm, vnode, renderer) {
2990
2852
  let vm = getAssociatedVMIfPresent(elm);
2991
2853
  // There is a possibility that a custom element is registered under tagName, in which case, the
2992
2854
  // initialization is already carry on, and there is nothing else to do here since this hook is
@@ -2995,7 +2857,7 @@
2995
2857
  return vm;
2996
2858
  }
2997
2859
  const { sel, mode, ctor, owner } = vnode;
2998
- setScopeTokenClassIfNecessary(elm, owner);
2860
+ setScopeTokenClassIfNecessary(elm, owner, renderer);
2999
2861
  if (owner.shadowMode === 1 /* Synthetic */) {
3000
2862
  const { stylesheetToken } = owner.context;
3001
2863
  // when running in synthetic shadow mode, we need to set the shadowToken value
@@ -3004,7 +2866,7 @@
3004
2866
  setElementShadowToken(elm, stylesheetToken);
3005
2867
  }
3006
2868
  }
3007
- vm = createVM(elm, ctor, {
2869
+ vm = createVM(elm, ctor, renderer, {
3008
2870
  mode,
3009
2871
  owner,
3010
2872
  tagName: sel,
@@ -3076,7 +2938,7 @@
3076
2938
  }
3077
2939
  return map;
3078
2940
  }
3079
- function updateDynamicChildren(oldCh, newCh, parent) {
2941
+ function updateDynamicChildren(oldCh, newCh, parent, renderer) {
3080
2942
  let oldStartIdx = 0;
3081
2943
  let newStartIdx = 0;
3082
2944
  let oldEndIdx = oldCh.length - 1;
@@ -3105,26 +2967,26 @@
3105
2967
  newEndVnode = newCh[--newEndIdx];
3106
2968
  }
3107
2969
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
3108
- patch(oldStartVnode, newStartVnode);
2970
+ patch(oldStartVnode, newStartVnode, renderer);
3109
2971
  oldStartVnode = oldCh[++oldStartIdx];
3110
2972
  newStartVnode = newCh[++newStartIdx];
3111
2973
  }
3112
2974
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
3113
- patch(oldEndVnode, newEndVnode);
2975
+ patch(oldEndVnode, newEndVnode, renderer);
3114
2976
  oldEndVnode = oldCh[--oldEndIdx];
3115
2977
  newEndVnode = newCh[--newEndIdx];
3116
2978
  }
3117
2979
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
3118
2980
  // Vnode moved right
3119
- patch(oldStartVnode, newEndVnode);
3120
- insertNode(oldStartVnode.elm, parent, nextSibling$1(oldEndVnode.elm));
2981
+ patch(oldStartVnode, newEndVnode, renderer);
2982
+ insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
3121
2983
  oldStartVnode = oldCh[++oldStartIdx];
3122
2984
  newEndVnode = newCh[--newEndIdx];
3123
2985
  }
3124
2986
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
3125
2987
  // Vnode moved left
3126
- patch(oldEndVnode, newStartVnode);
3127
- insertNode(newStartVnode.elm, parent, oldStartVnode.elm);
2988
+ patch(oldEndVnode, newStartVnode, renderer);
2989
+ insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
3128
2990
  oldEndVnode = oldCh[--oldEndIdx];
3129
2991
  newStartVnode = newCh[++newStartIdx];
3130
2992
  }
@@ -3135,7 +2997,7 @@
3135
2997
  idxInOld = oldKeyToIdx[newStartVnode.key];
3136
2998
  if (isUndefined$1(idxInOld)) {
3137
2999
  // New element
3138
- mount(newStartVnode, parent, oldStartVnode.elm);
3000
+ mount(newStartVnode, parent, renderer, oldStartVnode.elm);
3139
3001
  newStartVnode = newCh[++newStartIdx];
3140
3002
  }
3141
3003
  else {
@@ -3143,10 +3005,10 @@
3143
3005
  if (isVNode(elmToMove)) {
3144
3006
  if (elmToMove.sel !== newStartVnode.sel) {
3145
3007
  // New element
3146
- mount(newStartVnode, parent, oldStartVnode.elm);
3008
+ mount(newStartVnode, parent, renderer, oldStartVnode.elm);
3147
3009
  }
3148
3010
  else {
3149
- patch(elmToMove, newStartVnode);
3011
+ patch(elmToMove, newStartVnode, renderer);
3150
3012
  // Delete the old child, but copy the array since it is read-only.
3151
3013
  // The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
3152
3014
  // so we only care about the `oldCh` object inside this function.
@@ -3158,7 +3020,7 @@
3158
3020
  }
3159
3021
  // We've already cloned at least once, so it's no longer read-only
3160
3022
  oldCh[idxInOld] = undefined;
3161
- insertNode(elmToMove.elm, parent, oldStartVnode.elm);
3023
+ insertNode(elmToMove.elm, parent, oldStartVnode.elm, renderer);
3162
3024
  }
3163
3025
  }
3164
3026
  newStartVnode = newCh[++newStartIdx];
@@ -3175,25 +3037,25 @@
3175
3037
  n = newCh[++i];
3176
3038
  } while (!isVNode(n) && i < newChEnd);
3177
3039
  before = isVNode(n) ? n.elm : null;
3178
- mountVNodes(newCh, parent, before, newStartIdx, newEndIdx + 1);
3040
+ mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
3179
3041
  }
3180
3042
  else {
3181
- unmountVNodes(oldCh, parent, true, oldStartIdx, oldEndIdx + 1);
3043
+ unmountVNodes(oldCh, parent, renderer, true, oldStartIdx, oldEndIdx + 1);
3182
3044
  }
3183
3045
  }
3184
3046
  }
3185
- function updateStaticChildren(c1, c2, parent) {
3047
+ function updateStaticChildren(c1, c2, parent, renderer) {
3186
3048
  const c1Length = c1.length;
3187
3049
  const c2Length = c2.length;
3188
3050
  if (c1Length === 0) {
3189
3051
  // the old list is empty, we can directly insert anything new
3190
- mountVNodes(c2, parent, null);
3052
+ mountVNodes(c2, parent, renderer, null);
3191
3053
  return;
3192
3054
  }
3193
3055
  if (c2Length === 0) {
3194
3056
  // the old list is nonempty and the new list is empty so we can directly remove all old nodes
3195
3057
  // this is the case in which the dynamic children of an if-directive should be removed
3196
- unmountVNodes(c1, parent, true);
3058
+ unmountVNodes(c1, parent, renderer, true);
3197
3059
  return;
3198
3060
  }
3199
3061
  // if the old list is not empty, the new list MUST have the same
@@ -3206,16 +3068,16 @@
3206
3068
  if (isVNode(n1)) {
3207
3069
  if (isVNode(n2)) {
3208
3070
  // both vnodes are equivalent, and we just need to patch them
3209
- patch(n1, n2);
3071
+ patch(n1, n2, renderer);
3210
3072
  anchor = n2.elm;
3211
3073
  }
3212
3074
  else {
3213
3075
  // removing the old vnode since the new one is null
3214
- unmount(n1, parent, true);
3076
+ unmount(n1, parent, renderer, true);
3215
3077
  }
3216
3078
  }
3217
3079
  else if (isVNode(n2)) {
3218
- mount(n2, parent, anchor);
3080
+ mount(n2, parent, renderer, anchor);
3219
3081
  anchor = n2.elm;
3220
3082
  }
3221
3083
  }
@@ -3531,7 +3393,7 @@
3531
3393
  }, [api.t(content)]);
3532
3394
  }
3533
3395
  function updateStylesheetToken(vm, template) {
3534
- const { elm, context, renderMode, shadowMode } = vm;
3396
+ const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
3535
3397
  const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
3536
3398
  const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
3537
3399
  const { hasScopedStyles } = context;
@@ -3542,10 +3404,10 @@
3542
3404
  const { stylesheetToken: oldToken, hasTokenInClass: oldHasTokenInClass, hasTokenInAttribute: oldHasTokenInAttribute, } = context;
3543
3405
  if (!isUndefined$1(oldToken)) {
3544
3406
  if (oldHasTokenInClass) {
3545
- getClassList$1(elm).remove(makeHostToken(oldToken));
3407
+ getClassList(elm).remove(makeHostToken(oldToken));
3546
3408
  }
3547
3409
  if (oldHasTokenInAttribute) {
3548
- removeAttribute$1(elm, makeHostToken(oldToken));
3410
+ removeAttribute(elm, makeHostToken(oldToken));
3549
3411
  }
3550
3412
  }
3551
3413
  // Apply the new template styling token to the host element, if the new template has any
@@ -3556,11 +3418,11 @@
3556
3418
  // Set the new styling token on the host element
3557
3419
  if (!isUndefined$1(newToken)) {
3558
3420
  if (hasScopedStyles) {
3559
- getClassList$1(elm).add(makeHostToken(newToken));
3421
+ getClassList(elm).add(makeHostToken(newToken));
3560
3422
  newHasTokenInClass = true;
3561
3423
  }
3562
3424
  if (isSyntheticShadow) {
3563
- setAttribute$1(elm, makeHostToken(newToken), '');
3425
+ setAttribute(elm, makeHostToken(newToken), '');
3564
3426
  newHasTokenInAttribute = true;
3565
3427
  }
3566
3428
  }
@@ -3640,13 +3502,13 @@
3640
3502
  return owner;
3641
3503
  }
3642
3504
  function createStylesheet(vm, stylesheets) {
3643
- const { renderMode, shadowMode } = vm;
3505
+ const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
3644
3506
  if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
3645
3507
  for (let i = 0; i < stylesheets.length; i++) {
3646
- insertStylesheet$1(stylesheets[i]);
3508
+ insertStylesheet(stylesheets[i]);
3647
3509
  }
3648
3510
  }
3649
- else if (ssr$1 || vm.hydrated) {
3511
+ else if (ssr || vm.hydrated) {
3650
3512
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
3651
3513
  // This works in the client, because the stylesheets are created, and cached in the VM
3652
3514
  // the first time the VM renders.
@@ -3660,7 +3522,7 @@
3660
3522
  // null root means a global style
3661
3523
  const target = isNull(root) ? undefined : root.shadowRoot;
3662
3524
  for (let i = 0; i < stylesheets.length; i++) {
3663
- insertStylesheet$1(stylesheets[i], target);
3525
+ insertStylesheet(stylesheets[i], target);
3664
3526
  }
3665
3527
  }
3666
3528
  return null;
@@ -4072,7 +3934,7 @@
4072
3934
  return ancestor;
4073
3935
  }
4074
3936
 
4075
- function createVM(elm, ctor, options) {
3937
+ function createVM(elm, ctor, renderer, options) {
4076
3938
  const {
4077
3939
  mode,
4078
3940
  owner,
@@ -4121,9 +3983,10 @@
4121
3983
  renderRoot: null,
4122
3984
  callHook,
4123
3985
  setHook,
4124
- getHook
3986
+ getHook,
3987
+ renderer
4125
3988
  };
4126
- vm.shadowMode = computeShadowMode(vm);
3989
+ vm.shadowMode = computeShadowMode(vm, renderer);
4127
3990
  vm.tro = getTemplateReactiveObserver(vm);
4128
3991
 
4129
3992
 
@@ -4136,13 +3999,17 @@
4136
3999
  return vm;
4137
4000
  }
4138
4001
 
4139
- function computeShadowMode(vm) {
4002
+ function computeShadowMode(vm, renderer) {
4140
4003
  const {
4141
4004
  def
4142
4005
  } = vm;
4006
+ const {
4007
+ isSyntheticShadowDefined,
4008
+ isNativeShadowDefined
4009
+ } = renderer;
4143
4010
  let shadowMode;
4144
4011
 
4145
- if (isSyntheticShadowDefined$1) {
4012
+ if (isSyntheticShadowDefined) {
4146
4013
  if (def.renderMode === 0
4147
4014
  /* Light */
4148
4015
  ) {
@@ -4151,7 +4018,7 @@
4151
4018
  shadowMode = 0
4152
4019
  /* Native */
4153
4020
  ;
4154
- } else if (isNativeShadowDefined$1) {
4021
+ } else if (isNativeShadowDefined) {
4155
4022
  // Not combined with above condition because @lwc/features only supports identifiers in
4156
4023
  // the if-condition.
4157
4024
  if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
@@ -4225,7 +4092,8 @@
4225
4092
  function patchShadowRoot(vm, newCh) {
4226
4093
  const {
4227
4094
  renderRoot,
4228
- children: oldCh
4095
+ children: oldCh,
4096
+ renderer
4229
4097
  } = vm; // caching the new children collection
4230
4098
 
4231
4099
  vm.children = newCh;
@@ -4241,7 +4109,7 @@
4241
4109
  , vm);
4242
4110
  }, () => {
4243
4111
  // job
4244
- patchChildren(oldCh, newCh, renderRoot);
4112
+ patchChildren(oldCh, newCh, renderRoot, renderer);
4245
4113
  }, () => {
4246
4114
  // post
4247
4115
  logOperationEnd(2
@@ -4266,10 +4134,13 @@
4266
4134
  const {
4267
4135
  def: {
4268
4136
  renderedCallback
4137
+ },
4138
+ renderer: {
4139
+ ssr
4269
4140
  }
4270
4141
  } = vm;
4271
4142
 
4272
- if (isTrue(ssr$1)) {
4143
+ if (isTrue(ssr)) {
4273
4144
  return;
4274
4145
  }
4275
4146
 
@@ -4494,14 +4365,17 @@
4494
4365
  function resetComponentRoot(vm) {
4495
4366
  const {
4496
4367
  children,
4497
- renderRoot
4368
+ renderRoot,
4369
+ renderer: {
4370
+ remove
4371
+ }
4498
4372
  } = vm;
4499
4373
 
4500
4374
  for (let i = 0, len = children.length; i < len; i++) {
4501
4375
  const child = children[i];
4502
4376
 
4503
4377
  if (!isNull(child) && !isUndefined$1(child.elm)) {
4504
- remove$1(child.elm, renderRoot);
4378
+ remove(child.elm, renderRoot);
4505
4379
  }
4506
4380
  }
4507
4381
 
@@ -4510,7 +4384,13 @@
4510
4384
  vm.velements = EmptyArray;
4511
4385
  }
4512
4386
  function scheduleRehydration(vm) {
4513
- if (isTrue(ssr$1) || isTrue(vm.isScheduled)) {
4387
+ const {
4388
+ renderer: {
4389
+ ssr
4390
+ }
4391
+ } = vm;
4392
+
4393
+ if (isTrue(ssr) || isTrue(vm.isScheduled)) {
4514
4394
  return;
4515
4395
  }
4516
4396
 
@@ -4669,6 +4549,9 @@
4669
4549
  context: {
4670
4550
  wiredConnecting,
4671
4551
  wiredDisconnecting
4552
+ },
4553
+ renderer: {
4554
+ dispatchEvent
4672
4555
  }
4673
4556
  } = vm; // waiting for the component to be connected to formally request the context via the token
4674
4557
 
@@ -4692,7 +4575,7 @@
4692
4575
  }
4693
4576
 
4694
4577
  });
4695
- dispatchEvent$1(elm, contextRegistrationEvent);
4578
+ dispatchEvent(elm, contextRegistrationEvent);
4696
4579
  });
4697
4580
  }
4698
4581
 
@@ -4930,78 +4813,86 @@
4930
4813
  function hydrateVM(vm) {
4931
4814
  const children = renderComponent(vm);
4932
4815
  vm.children = children;
4933
- const parentNode = vm.renderRoot;
4934
- hydrateChildren(getFirstChild$1(parentNode), children, parentNode);
4816
+ const { renderRoot: parentNode, renderer: { getFirstChild }, } = vm;
4817
+ hydrateChildren(getFirstChild(parentNode), children, parentNode, vm);
4935
4818
  runRenderedCallback(vm);
4936
4819
  }
4937
- function hydrateNode(node, vnode) {
4820
+ function hydrateNode(node, vnode, renderer) {
4821
+ var _a, _b;
4938
4822
  let hydratedNode;
4939
4823
  switch (vnode.type) {
4940
4824
  case 0 /* Text */:
4941
- hydratedNode = hydrateText(node, vnode);
4825
+ // VText has no special capability, fallback to the owner's renderer
4826
+ hydratedNode = hydrateText(node, vnode, renderer);
4942
4827
  break;
4943
4828
  case 1 /* Comment */:
4944
- hydratedNode = hydrateComment(node, vnode);
4829
+ // VComment has no special capability, fallback to the owner's renderer
4830
+ hydratedNode = hydrateComment(node, vnode, renderer);
4945
4831
  break;
4946
4832
  case 2 /* Element */:
4947
- hydratedNode = hydrateElement(node, vnode);
4833
+ hydratedNode = hydrateElement(node, vnode, (_a = vnode.data.renderer) !== null && _a !== void 0 ? _a : renderer);
4948
4834
  break;
4949
4835
  case 3 /* CustomElement */:
4950
- hydratedNode = hydrateCustomElement(node, vnode);
4836
+ hydratedNode = hydrateCustomElement(node, vnode, (_b = vnode.data.renderer) !== null && _b !== void 0 ? _b : renderer);
4951
4837
  break;
4952
4838
  }
4953
- return nextSibling$1(hydratedNode);
4839
+ return renderer.nextSibling(hydratedNode);
4954
4840
  }
4955
- function hydrateText(node, vnode) {
4841
+ function hydrateText(node, vnode, renderer) {
4956
4842
  var _a;
4957
- if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */)) {
4958
- return handleMismatch(node, vnode);
4843
+ if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */, renderer)) {
4844
+ return handleMismatch(node, vnode, renderer);
4959
4845
  }
4960
- setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
4846
+ const { setText } = renderer;
4847
+ setText(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
4961
4848
  vnode.elm = node;
4962
4849
  return node;
4963
4850
  }
4964
- function hydrateComment(node, vnode) {
4851
+ function hydrateComment(node, vnode, renderer) {
4965
4852
  var _a;
4966
- if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */)) {
4967
- return handleMismatch(node, vnode);
4853
+ if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */, renderer)) {
4854
+ return handleMismatch(node, vnode, renderer);
4968
4855
  }
4969
- setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
4856
+ const { setProperty } = renderer;
4857
+ setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
4970
4858
  vnode.elm = node;
4971
4859
  return node;
4972
4860
  }
4973
- function hydrateElement(elm, vnode) {
4974
- if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
4975
- !isMatchingElement(vnode, elm)) {
4976
- return handleMismatch(elm, vnode);
4861
+ function hydrateElement(elm, vnode, renderer) {
4862
+ if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
4863
+ !isMatchingElement(vnode, elm, renderer)) {
4864
+ return handleMismatch(elm, vnode, renderer);
4977
4865
  }
4978
4866
  vnode.elm = elm;
4867
+ const { owner } = vnode;
4979
4868
  const { context } = vnode.data;
4980
4869
  const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
4981
4870
  if (isDomManual) {
4982
4871
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
4983
4872
  // remove the innerHTML from props so it reuses the existing dom elements.
4984
- const { props } = vnode.data;
4873
+ const { data: { props }, } = vnode;
4874
+ const { getProperty } = renderer;
4985
4875
  if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
4986
- if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
4876
+ if (getProperty(elm, 'innerHTML') === props.innerHTML) {
4987
4877
  // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
4988
4878
  vnode.data = Object.assign(Object.assign({}, vnode.data), { props: cloneAndOmitKey(props, 'innerHTML') });
4989
4879
  }
4990
4880
  }
4991
4881
  }
4992
- patchElementPropsAndAttrs(vnode);
4882
+ patchElementPropsAndAttrs(vnode, renderer);
4993
4883
  if (!isDomManual) {
4994
- hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
4884
+ const { getFirstChild } = renderer;
4885
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
4995
4886
  }
4996
4887
  return elm;
4997
4888
  }
4998
- function hydrateCustomElement(elm, vnode) {
4999
- if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */) ||
5000
- !isMatchingElement(vnode, elm)) {
5001
- return handleMismatch(elm, vnode);
4889
+ function hydrateCustomElement(elm, vnode, renderer) {
4890
+ if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
4891
+ !isMatchingElement(vnode, elm, renderer)) {
4892
+ return handleMismatch(elm, vnode, renderer);
5002
4893
  }
5003
4894
  const { sel, mode, ctor, owner } = vnode;
5004
- const vm = createVM(elm, ctor, {
4895
+ const vm = createVM(elm, ctor, renderer, {
5005
4896
  mode,
5006
4897
  owner,
5007
4898
  tagName: sel,
@@ -5010,12 +4901,13 @@
5010
4901
  vnode.elm = elm;
5011
4902
  vnode.vm = vm;
5012
4903
  allocateChildren(vnode, vm);
5013
- patchElementPropsAndAttrs(vnode);
4904
+ patchElementPropsAndAttrs(vnode, renderer);
5014
4905
  runConnectedCallback(vm);
5015
4906
  if (vm.renderMode !== 0 /* Light */) {
4907
+ const { getFirstChild } = renderer;
5016
4908
  // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
5017
4909
  // Note: for Light DOM, this is handled while hydrating the VM
5018
- hydrateChildren(getFirstChild$1(elm), vnode.children, elm);
4910
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
5019
4911
  }
5020
4912
  hydrateVM(vm);
5021
4913
  return elm;
@@ -5023,78 +4915,89 @@
5023
4915
  function hydrateChildren(node, children, parentNode, owner) {
5024
4916
  let nextNode = node;
5025
4917
  let anchor = null;
4918
+ const { renderer } = owner;
5026
4919
  for (let i = 0; i < children.length; i++) {
5027
4920
  const childVnode = children[i];
5028
4921
  if (!isNull(childVnode)) {
5029
4922
  if (nextNode) {
5030
- nextNode = hydrateNode(nextNode, childVnode);
4923
+ nextNode = hydrateNode(nextNode, childVnode, renderer);
5031
4924
  anchor = childVnode.elm;
5032
4925
  }
5033
4926
  else {
5034
4927
  hasMismatch = true;
5035
- mount(childVnode, parentNode, anchor);
4928
+ mount(childVnode, parentNode, renderer, anchor);
5036
4929
  anchor = childVnode.elm;
5037
4930
  }
5038
4931
  }
5039
4932
  }
5040
4933
  if (nextNode) {
5041
4934
  hasMismatch = true;
4935
+ // nextSibling is mostly harmless, and since we don't have
4936
+ // a good reference to what element to act upon, we instead
4937
+ // rely on the vm's associated renderer for navigating to the
4938
+ // next node in the list to be hydrated.
4939
+ const { nextSibling } = renderer;
5042
4940
  do {
5043
4941
  const current = nextNode;
5044
- nextNode = nextSibling$1(nextNode);
5045
- removeNode(current, parentNode);
4942
+ nextNode = nextSibling(nextNode);
4943
+ removeNode(current, parentNode, renderer);
5046
4944
  } while (nextNode);
5047
4945
  }
5048
4946
  }
5049
- function handleMismatch(node, vnode, msg) {
4947
+ function handleMismatch(node, vnode, renderer) {
5050
4948
  hasMismatch = true;
5051
- const parentNode = getProperty$1(node, 'parentNode');
5052
- mount(vnode, parentNode, node);
5053
- removeNode(node, parentNode);
4949
+ const { getProperty } = renderer;
4950
+ const parentNode = getProperty(node, 'parentNode');
4951
+ mount(vnode, parentNode, renderer, node);
4952
+ removeNode(node, parentNode, renderer);
5054
4953
  return vnode.elm;
5055
4954
  }
5056
- function patchElementPropsAndAttrs(vnode) {
5057
- applyEventListeners(vnode);
5058
- patchProps(null, vnode);
4955
+ function patchElementPropsAndAttrs(vnode, renderer) {
4956
+ applyEventListeners(vnode, renderer);
4957
+ patchProps(null, vnode, renderer);
5059
4958
  }
5060
- function hasCorrectNodeType(vnode, node, nodeType) {
5061
- if (getProperty$1(node, 'nodeType') !== nodeType) {
4959
+ function hasCorrectNodeType(vnode, node, nodeType, renderer) {
4960
+ const { getProperty } = renderer;
4961
+ if (getProperty(node, 'nodeType') !== nodeType) {
5062
4962
  return false;
5063
4963
  }
5064
4964
  return true;
5065
4965
  }
5066
- function isMatchingElement(vnode, elm) {
5067
- if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
4966
+ function isMatchingElement(vnode, elm, renderer) {
4967
+ const { getProperty } = renderer;
4968
+ if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
5068
4969
  return false;
5069
4970
  }
5070
- const hasIncompatibleAttrs = validateAttrs(vnode, elm);
5071
- const hasIncompatibleClass = validateClassAttr(vnode, elm);
5072
- const hasIncompatibleStyle = validateStyleAttr(vnode, elm);
4971
+ const hasIncompatibleAttrs = validateAttrs(vnode, elm, renderer);
4972
+ const hasIncompatibleClass = validateClassAttr(vnode, elm, renderer);
4973
+ const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
5073
4974
  return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
5074
4975
  }
5075
- function validateAttrs(vnode, elm) {
4976
+ function validateAttrs(vnode, elm, renderer) {
5076
4977
  const { data: { attrs = {} }, } = vnode;
5077
4978
  let nodesAreCompatible = true;
5078
4979
  // Validate attributes, though we could always recovery from those by running the update mods.
5079
4980
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
5080
4981
  for (const [attrName, attrValue] of Object.entries(attrs)) {
5081
- const elmAttrValue = getAttribute$1(elm, attrName);
4982
+ const { getAttribute } = renderer;
4983
+ const elmAttrValue = getAttribute(elm, attrName);
5082
4984
  if (String(attrValue) !== elmAttrValue) {
5083
4985
  nodesAreCompatible = false;
5084
4986
  }
5085
4987
  }
5086
4988
  return nodesAreCompatible;
5087
4989
  }
5088
- function validateClassAttr(vnode, elm) {
4990
+ function validateClassAttr(vnode, elm, renderer) {
5089
4991
  const { data: { className, classMap }, } = vnode;
4992
+ const { getProperty, getClassList } = renderer;
5090
4993
  let nodesAreCompatible = true;
5091
- if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
4994
+ if (!isUndefined$1(className) && String(className) !== getProperty(elm, 'className')) {
5092
4995
  // className is used when class is bound to an expr.
5093
4996
  nodesAreCompatible = false;
5094
4997
  }
5095
4998
  else if (!isUndefined$1(classMap)) {
5096
4999
  // classMap is used when class is set to static value.
5097
- const classList = getClassList$1(elm);
5000
+ const classList = getClassList(elm);
5098
5001
  let computedClassName = '';
5099
5002
  // all classes from the vnode should be in the element.classList
5100
5003
  for (const name in classMap) {
@@ -5110,9 +5013,10 @@
5110
5013
  }
5111
5014
  return nodesAreCompatible;
5112
5015
  }
5113
- function validateStyleAttr(vnode, elm) {
5016
+ function validateStyleAttr(vnode, elm, renderer) {
5114
5017
  const { data: { style, styleDecls }, } = vnode;
5115
- const elmStyle = getAttribute$1(elm, 'style') || '';
5018
+ const { getAttribute } = renderer;
5019
+ const elmStyle = getAttribute(elm, 'style') || '';
5116
5020
  let nodesAreCompatible = true;
5117
5021
  if (!isUndefined$1(style) && style !== elmStyle) {
5118
5022
  nodesAreCompatible = false;
@@ -5182,7 +5086,7 @@
5182
5086
  }
5183
5087
  return ctor;
5184
5088
  }
5185
- /* version: 2.14.1 */
5089
+ /* version: 2.14.2 */
5186
5090
 
5187
5091
  /*
5188
5092
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5332,7 +5236,7 @@
5332
5236
  try {
5333
5237
  // dereference HTMLElement global because babel wraps globals in compat mode with a
5334
5238
  // _wrapNativeSuper()
5335
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElement which does not
5239
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
5336
5240
  // get wrapped by babel.
5337
5241
  const HTMLElementAlias = HTMLElement;
5338
5242
  // In case we use compat mode with a modern browser, the compat mode transformation
@@ -5386,6 +5290,9 @@
5386
5290
  hydrating = value;
5387
5291
  }
5388
5292
  const ssr = false;
5293
+ function isHydrating() {
5294
+ return hydrating;
5295
+ }
5389
5296
  const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
5390
5297
  const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
5391
5298
  function createElement$1(tagName, namespace) {
@@ -5494,44 +5401,51 @@
5494
5401
  function isConnected(node) {
5495
5402
  return node.isConnected;
5496
5403
  }
5404
+ function assertInstanceOfHTMLElement(elm, msg) {
5405
+ assert.invariant(elm instanceof HTMLElement, msg);
5406
+ }
5497
5407
  const HTMLElementExported = HTMLElementConstructor;
5498
- setAttachShadow(attachShadow);
5499
- setCreateComment(createComment);
5500
- setCreateElement(createElement$1);
5501
- setCreateText(createText);
5502
- setDefineCustomElement(defineCustomElement);
5503
- setDispatchEvent(dispatchEvent);
5504
- setGetAttribute(getAttribute);
5505
- setGetBoundingClientRect(getBoundingClientRect);
5506
- setGetChildNodes(getChildNodes);
5507
- setGetChildren(getChildren);
5508
- setGetClassList(getClassList);
5509
- setGetCustomElement(getCustomElement);
5510
- setGetElementsByClassName(getElementsByClassName);
5511
- setGetElementsByTagName(getElementsByTagName);
5512
- setGetFirstChild(getFirstChild);
5513
- setGetFirstElementChild(getFirstElementChild);
5514
- setGetLastChild(getLastChild);
5515
- setGetLastElementChild(getLastElementChild);
5516
- setGetProperty(getProperty);
5517
- setHTMLElement(HTMLElementExported);
5518
- setInsert(insert);
5519
- setIsConnected(isConnected);
5520
- setIsNativeShadowDefined(isNativeShadowDefined);
5521
- setIsSyntheticShadowDefined(isSyntheticShadowDefined);
5522
- setNextSibling(nextSibling);
5523
- setQuerySelector(querySelector);
5524
- setQuerySelectorAll(querySelectorAll);
5525
- setRemove(remove);
5526
- setRemoveAttribute(removeAttribute);
5527
- setRemoveEventListener(removeEventListener);
5528
- setSetAttribute(setAttribute);
5529
- setSetCSSStyleProperty(setCSSStyleProperty);
5530
- setSetProperty(setProperty);
5531
- setSetText(setText);
5532
- setSsr(ssr);
5533
- setAddEventListener(addEventListener);
5534
- setInsertStylesheet(insertStylesheet);
5408
+ const renderer = {
5409
+ ssr,
5410
+ isNativeShadowDefined,
5411
+ isSyntheticShadowDefined,
5412
+ HTMLElementExported,
5413
+ isHydrating,
5414
+ insert,
5415
+ remove,
5416
+ createElement: createElement$1,
5417
+ createText,
5418
+ createComment,
5419
+ nextSibling,
5420
+ attachShadow,
5421
+ getProperty,
5422
+ setProperty,
5423
+ setText,
5424
+ getAttribute,
5425
+ setAttribute,
5426
+ removeAttribute,
5427
+ addEventListener,
5428
+ removeEventListener,
5429
+ dispatchEvent,
5430
+ getClassList,
5431
+ setCSSStyleProperty,
5432
+ getBoundingClientRect,
5433
+ querySelector,
5434
+ querySelectorAll,
5435
+ getElementsByTagName,
5436
+ getElementsByClassName,
5437
+ getChildren,
5438
+ getChildNodes,
5439
+ getFirstChild,
5440
+ getFirstElementChild,
5441
+ getLastChild,
5442
+ getLastElementChild,
5443
+ isConnected,
5444
+ insertStylesheet,
5445
+ assertInstanceOfHTMLElement,
5446
+ defineCustomElement,
5447
+ getCustomElement,
5448
+ };
5535
5449
 
5536
5450
  /*
5537
5451
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5553,7 +5467,7 @@
5553
5467
  }
5554
5468
  }
5555
5469
  function createVMWithProps(element, Ctor, props) {
5556
- const vm = createVM(element, Ctor, {
5470
+ const vm = createVM(element, Ctor, renderer, {
5557
5471
  mode: 'open',
5558
5472
  owner: null,
5559
5473
  tagName: element.tagName.toLowerCase(),
@@ -5644,7 +5558,7 @@
5644
5558
  hydratedCustomElements.add(this);
5645
5559
  }
5646
5560
  else {
5647
- createVM(this, Ctor, {
5561
+ createVM(this, Ctor, renderer, {
5648
5562
  mode: 'open',
5649
5563
  owner: null,
5650
5564
  tagName: this.tagName,
@@ -5726,7 +5640,7 @@
5726
5640
  if (!isFunction$1(Ctor)) {
5727
5641
  throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
5728
5642
  }
5729
- const UpgradableConstructor = getUpgradableConstructor(sel);
5643
+ const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
5730
5644
  let wasComponentUpgraded = false;
5731
5645
  // the custom element from the registry is expecting an upgrade callback
5732
5646
  /**
@@ -5736,7 +5650,7 @@
5736
5650
  * an upgradable custom element.
5737
5651
  */
5738
5652
  const element = new UpgradableConstructor((elm) => {
5739
- createVM(elm, Ctor, {
5653
+ createVM(elm, Ctor, renderer, {
5740
5654
  tagName: sel,
5741
5655
  mode: options.mode !== 'closed' ? 'open' : 'closed',
5742
5656
  owner: null,
@@ -5820,7 +5734,7 @@
5820
5734
  });
5821
5735
  freeze(LightningElement);
5822
5736
  seal(LightningElement.prototype);
5823
- /* version: 2.14.1 */
5737
+ /* version: 2.14.2 */
5824
5738
 
5825
5739
  exports.LightningElement = LightningElement;
5826
5740
  exports.__unstable__ProfilerControl = profilerControl;
@@ -5839,6 +5753,7 @@
5839
5753
  exports.registerComponent = registerComponent;
5840
5754
  exports.registerDecorators = registerDecorators;
5841
5755
  exports.registerTemplate = registerTemplate;
5756
+ exports.renderer = renderer;
5842
5757
  exports.sanitizeAttribute = sanitizeAttribute;
5843
5758
  exports.setFeatureFlag = setFeatureFlag;
5844
5759
  exports.setFeatureFlagForTest = setFeatureFlagForTest;