lwc 2.11.1 → 2.11.5

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 +331 -259
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +331 -259
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +288 -124
  5. package/dist/engine-dom/iife/es5/engine-dom.js +1132 -1046
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +418 -180
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +331 -259
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +288 -124
  11. package/dist/engine-dom/umd/es5/engine-dom.js +1132 -1046
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +418 -180
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +36 -7
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +36 -7
  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 +8 -9
@@ -49,6 +49,8 @@ var LWC = (function (exports) {
49
49
 
50
50
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
51
51
 
52
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
53
+
52
54
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
53
55
 
54
56
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
@@ -345,7 +347,7 @@ var LWC = (function (exports) {
345
347
  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
346
348
  var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
347
349
  var XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
348
- /** version: 2.11.1 */
350
+ /** version: 2.11.5 */
349
351
 
350
352
  /*
351
353
  * Copyright (c) 2018, salesforce.com, inc.
@@ -515,7 +517,7 @@ var LWC = (function (exports) {
515
517
 
516
518
  function setFeatureFlagForTest(name, value) {
517
519
  }
518
- /** version: 2.11.1 */
520
+ /** version: 2.11.5 */
519
521
 
520
522
  /* proxy-compat-disable */
521
523
 
@@ -558,6 +560,42 @@ var LWC = (function (exports) {
558
560
 
559
561
  return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();
560
562
  } // Borrowed from Vue template compiler.
563
+ // https://github.com/vuejs/vue/blob/531371b818b0e31a989a06df43789728f23dc4e8/src/platforms/web/util/style.js#L5-L16
564
+
565
+
566
+ var DECLARATION_DELIMITER = /;(?![^(]*\))/g;
567
+ var PROPERTY_DELIMITER = /:(.+)/;
568
+
569
+ function parseStyleText(cssText) {
570
+ var styleMap = {};
571
+ var declarations = cssText.split(DECLARATION_DELIMITER);
572
+
573
+ var _iterator = _createForOfIteratorHelper(declarations),
574
+ _step;
575
+
576
+ try {
577
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
578
+ var declaration = _step.value;
579
+
580
+ if (declaration) {
581
+ var _declaration$split = declaration.split(PROPERTY_DELIMITER),
582
+ _declaration$split2 = _slicedToArray(_declaration$split, 2),
583
+ prop = _declaration$split2[0],
584
+ value = _declaration$split2[1];
585
+
586
+ if (prop !== undefined && value !== undefined) {
587
+ styleMap[prop.trim()] = value.trim();
588
+ }
589
+ }
590
+ }
591
+ } catch (err) {
592
+ _iterator.e(err);
593
+ } finally {
594
+ _iterator.f();
595
+ }
596
+
597
+ return styleMap;
598
+ } // Make a shallow copy of an object but omit the given key
561
599
 
562
600
 
563
601
  function cloneAndOmitKey(object, keyToOmit) {
@@ -1030,8 +1068,8 @@ var LWC = (function (exports) {
1030
1068
  }
1031
1069
  }
1032
1070
 
1033
- function logWarn(message, vm) {
1034
- log('warn', message, vm);
1071
+ function logError(message, vm) {
1072
+ log('error', message, vm);
1035
1073
  }
1036
1074
  /*
1037
1075
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2591,6 +2629,13 @@ var LWC = (function (exports) {
2591
2629
  var meta = signedDecoratorToMetaMap.get(Ctor);
2592
2630
  return isUndefined$1(meta) ? defaultMeta : meta;
2593
2631
  }
2632
+ /*
2633
+ * Copyright (c) 2018, salesforce.com, inc.
2634
+ * All rights reserved.
2635
+ * SPDX-License-Identifier: MIT
2636
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2637
+ */
2638
+
2594
2639
 
2595
2640
  var signedTemplateSet = new Set();
2596
2641
 
@@ -2611,7 +2656,33 @@ var LWC = (function (exports) {
2611
2656
 
2612
2657
  function registerTemplate(tpl) {
2613
2658
 
2614
- signedTemplateSet.add(tpl); // chaining this method as a way to wrap existing
2659
+ signedTemplateSet.add(tpl); // FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
2660
+ // the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
2661
+ // on top of stylesheetToken for anyone who is accessing the old internal API.
2662
+ // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2663
+
2664
+ defineProperty(tpl, 'stylesheetTokens', {
2665
+ get: function get() {
2666
+ var stylesheetToken = this.stylesheetToken;
2667
+
2668
+ if (isUndefined$1(stylesheetToken)) {
2669
+ return stylesheetToken;
2670
+ } // Shim for the old `stylesheetTokens` property
2671
+ // See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
2672
+
2673
+
2674
+ return {
2675
+ hostAttribute: "".concat(stylesheetToken, "-host"),
2676
+ shadowAttribute: stylesheetToken
2677
+ };
2678
+ },
2679
+ set: function set(value) {
2680
+ // If the value is null or some other exotic object, you would be broken anyway in the past
2681
+ // because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
2682
+ // However it may be undefined in newer versions of LWC, so we need to guard against that case.
2683
+ this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
2684
+ }
2685
+ }); // chaining this method as a way to wrap existing
2615
2686
  // assignment of templates easily, without too much transformation
2616
2687
 
2617
2688
  return tpl;
@@ -5054,140 +5125,6 @@ var LWC = (function (exports) {
5054
5125
  cbs[_i22].call(undefined, component, {}, def, context);
5055
5126
  }
5056
5127
  }
5057
- /*
5058
- * Copyright (c) 2022, salesforce.com, inc.
5059
- * All rights reserved.
5060
- * SPDX-License-Identifier: MIT
5061
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5062
- */
5063
-
5064
-
5065
- function hydrate(vnode, node) {
5066
- switch (vnode.type) {
5067
- case 0
5068
- /* Text */
5069
- :
5070
- hydrateText(vnode, node);
5071
- break;
5072
-
5073
- case 1
5074
- /* Comment */
5075
- :
5076
- hydrateComment(vnode, node);
5077
- break;
5078
-
5079
- case 2
5080
- /* Element */
5081
- :
5082
- hydrateElement(vnode, node);
5083
- break;
5084
-
5085
- case 3
5086
- /* CustomElement */
5087
- :
5088
- hydrateCustomElement(vnode, node);
5089
- break;
5090
- }
5091
- }
5092
-
5093
- function hydrateText(vnode, node) {
5094
- var _a;
5095
-
5096
-
5097
- setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5098
- vnode.elm = node;
5099
- }
5100
-
5101
- function hydrateComment(vnode, node) {
5102
- var _a;
5103
-
5104
-
5105
- setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
5106
- vnode.elm = node;
5107
- }
5108
-
5109
- function hydrateElement(vnode, node) {
5110
-
5111
- var elm = node;
5112
- vnode.elm = elm;
5113
- var context = vnode.data.context;
5114
- var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
5115
- /* Manual */
5116
- );
5117
-
5118
- if (isDomManual) {
5119
- // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
5120
- // remove the innerHTML from props so it reuses the existing dom elements.
5121
- var props = vnode.data.props;
5122
-
5123
- if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
5124
- if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
5125
- // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
5126
- vnode.data = Object.assign(Object.assign({}, vnode.data), {
5127
- props: cloneAndOmitKey(props, 'innerHTML')
5128
- });
5129
- } else {
5130
- logWarn("Mismatch hydrating element <".concat(getProperty$1(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), vnode.owner);
5131
- }
5132
- }
5133
- }
5134
-
5135
- patchElementPropsAndAttrs(vnode);
5136
-
5137
- if (!isDomManual) {
5138
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children, vnode.owner);
5139
- }
5140
- }
5141
-
5142
- function hydrateCustomElement(vnode, node) {
5143
-
5144
- var elm = node;
5145
- var sel = vnode.sel,
5146
- mode = vnode.mode,
5147
- ctor = vnode.ctor,
5148
- owner = vnode.owner;
5149
- var vm = createVM(elm, ctor, {
5150
- mode: mode,
5151
- owner: owner,
5152
- tagName: sel
5153
- });
5154
- vnode.elm = elm;
5155
- vnode.vm = vm;
5156
- allocateChildren(vnode, vm);
5157
- patchElementPropsAndAttrs(vnode); // Insert hook section:
5158
-
5159
- runConnectedCallback(vm);
5160
-
5161
- if (vm.renderMode !== 0
5162
- /* Light */
5163
- ) {
5164
- // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
5165
- // Note: for Light DOM, this is handled while hydrating the VM
5166
- hydrateChildren(getChildNodes$1(vnode.elm), vnode.children);
5167
- }
5168
-
5169
- hydrateVM(vm);
5170
- }
5171
-
5172
- function hydrateChildren(elmChildren, children, vm) {
5173
-
5174
- var childNodeIndex = 0;
5175
-
5176
- for (var _i23 = 0; _i23 < children.length; _i23++) {
5177
- var childVnode = children[_i23];
5178
-
5179
- if (!isNull(childVnode)) {
5180
- var childNode = elmChildren[childNodeIndex];
5181
- hydrate(childVnode, childNode);
5182
- childNodeIndex++;
5183
- }
5184
- }
5185
- }
5186
-
5187
- function patchElementPropsAndAttrs(vnode) {
5188
- applyEventListeners(vnode);
5189
- patchProps(null, vnode);
5190
- }
5191
5128
  /*
5192
5129
  * Copyright (c) 2018, salesforce.com, inc.
5193
5130
  * All rights reserved.
@@ -5238,12 +5175,6 @@ var LWC = (function (exports) {
5238
5175
  , vm);
5239
5176
  }
5240
5177
 
5241
- function hydrateRootElement(elm) {
5242
- var vm = getAssociatedVM(elm);
5243
- runConnectedCallback(vm);
5244
- hydrateVM(vm);
5245
- }
5246
-
5247
5178
  function disconnectRootElement(elm) {
5248
5179
  var vm = getAssociatedVM(elm);
5249
5180
  resetComponentStateWhenRemoved(vm);
@@ -5251,22 +5182,6 @@ var LWC = (function (exports) {
5251
5182
 
5252
5183
  function appendVM(vm) {
5253
5184
  rehydrate(vm);
5254
- }
5255
-
5256
- function hydrateVM(vm) {
5257
- if (isTrue(vm.isDirty)) {
5258
- // manually diffing/patching here.
5259
- // This routine is:
5260
- // patchShadowRoot(vm, children);
5261
- // -> addVnodes.
5262
- var children = renderComponent(vm);
5263
- vm.children = children;
5264
- var vmChildren = vm.renderMode === 0
5265
- /* Light */
5266
- ? getChildNodes$1(vm.elm) : getChildNodes$1(vm.elm.shadowRoot);
5267
- hydrateChildren(vmChildren, children);
5268
- runRenderedCallback(vm);
5269
- }
5270
5185
  } // just in case the component comes back, with this we guarantee re-rendering it
5271
5186
  // while preventing any attempt to rehydration until after reinsertion.
5272
5187
 
@@ -5532,19 +5447,19 @@ var LWC = (function (exports) {
5532
5447
  });
5533
5448
  rehydrateQueue = []; // reset to a new queue
5534
5449
 
5535
- for (var _i26 = 0, _len8 = vms.length; _i26 < _len8; _i26 += 1) {
5536
- var vm = vms[_i26];
5450
+ for (var _i23 = 0, _len8 = vms.length; _i23 < _len8; _i23 += 1) {
5451
+ var vm = vms[_i23];
5537
5452
 
5538
5453
  try {
5539
5454
  rehydrate(vm);
5540
5455
  } catch (error) {
5541
- if (_i26 + 1 < _len8) {
5456
+ if (_i23 + 1 < _len8) {
5542
5457
  // pieces of the queue are still pending to be rehydrated, those should have priority
5543
5458
  if (rehydrateQueue.length === 0) {
5544
5459
  addCallbackToNextTick(flushRehydrationQueue);
5545
5460
  }
5546
5461
 
5547
- ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i26 + 1));
5462
+ ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i23 + 1));
5548
5463
  } // we need to end the measure before throwing.
5549
5464
 
5550
5465
 
@@ -5643,8 +5558,8 @@ var LWC = (function (exports) {
5643
5558
  var vCustomElementCollection = vm.velements; // Reporting disconnection for every child in inverse order since they are
5644
5559
  // inserted in reserved order.
5645
5560
 
5646
- for (var _i27 = vCustomElementCollection.length - 1; _i27 >= 0; _i27 -= 1) {
5647
- var elm = vCustomElementCollection[_i27].elm; // There are two cases where the element could be undefined:
5561
+ for (var _i24 = vCustomElementCollection.length - 1; _i24 >= 0; _i24 -= 1) {
5562
+ var elm = vCustomElementCollection[_i24].elm; // There are two cases where the element could be undefined:
5648
5563
  // * when there is an error during the construction phase, and an error
5649
5564
  // boundary picks it, there is a possibility that the VCustomElement
5650
5565
  // is not properly initialized, and therefore is should be ignored.
@@ -5678,8 +5593,8 @@ var LWC = (function (exports) {
5678
5593
 
5679
5594
 
5680
5595
  function recursivelyDisconnectChildren(vnodes) {
5681
- for (var _i28 = 0, _len9 = vnodes.length; _i28 < _len9; _i28 += 1) {
5682
- var vnode = vnodes[_i28];
5596
+ for (var _i25 = 0, _len9 = vnodes.length; _i25 < _len9; _i25 += 1) {
5597
+ var vnode = vnodes[_i25];
5683
5598
 
5684
5599
  if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
5685
5600
  switch (vnode.type) {
@@ -5710,8 +5625,8 @@ var LWC = (function (exports) {
5710
5625
  var children = vm.children,
5711
5626
  renderRoot = vm.renderRoot;
5712
5627
 
5713
- for (var _i29 = 0, _len10 = children.length; _i29 < _len10; _i29++) {
5714
- var child = children[_i29];
5628
+ for (var _i26 = 0, _len10 = children.length; _i26 < _len10; _i26++) {
5629
+ var child = children[_i26];
5715
5630
 
5716
5631
  if (!isNull(child) && !isUndefined$1(child.elm)) {
5717
5632
  remove$1(child.elm, renderRoot);
@@ -6061,8 +5976,8 @@ var LWC = (function (exports) {
6061
5976
  function connectWireAdapters(vm) {
6062
5977
  var wiredConnecting = vm.context.wiredConnecting;
6063
5978
 
6064
- for (var _i30 = 0, _len11 = wiredConnecting.length; _i30 < _len11; _i30 += 1) {
6065
- wiredConnecting[_i30]();
5979
+ for (var _i27 = 0, _len11 = wiredConnecting.length; _i27 < _len11; _i27 += 1) {
5980
+ wiredConnecting[_i27]();
6066
5981
  }
6067
5982
  }
6068
5983
 
@@ -6070,8 +5985,8 @@ var LWC = (function (exports) {
6070
5985
  var wiredDisconnecting = vm.context.wiredDisconnecting;
6071
5986
  runWithBoundaryProtection(vm, vm, noop, function () {
6072
5987
  // job
6073
- for (var _i31 = 0, _len12 = wiredDisconnecting.length; _i31 < _len12; _i31 += 1) {
6074
- wiredDisconnecting[_i31]();
5988
+ for (var _i28 = 0, _len12 = wiredDisconnecting.length; _i28 < _len12; _i28 += 1) {
5989
+ wiredDisconnecting[_i28]();
6075
5990
  }
6076
5991
  }, noop);
6077
5992
  }
@@ -6141,6 +6056,327 @@ var LWC = (function (exports) {
6141
6056
 
6142
6057
  return reactiveMembrane.getReadOnlyProxy(obj);
6143
6058
  }
6059
+ /*
6060
+ * Copyright (c) 2022, salesforce.com, inc.
6061
+ * All rights reserved.
6062
+ * SPDX-License-Identifier: MIT
6063
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6064
+ */
6065
+ // flag indicating if the hydration recovered from the DOM mismatch
6066
+
6067
+
6068
+ var hasMismatch = false;
6069
+
6070
+ function hydrateRoot(vm) {
6071
+ hasMismatch = false;
6072
+ runConnectedCallback(vm);
6073
+ hydrateVM(vm);
6074
+
6075
+ if (hasMismatch) {
6076
+ logError('Hydration completed with errors.', vm);
6077
+ }
6078
+ }
6079
+
6080
+ function hydrateVM(vm) {
6081
+ var children = renderComponent(vm);
6082
+ vm.children = children;
6083
+ var parentNode = vm.renderRoot;
6084
+ hydrateChildren(getFirstChild$1(parentNode), children, parentNode);
6085
+ runRenderedCallback(vm);
6086
+ }
6087
+
6088
+ function hydrateNode(node, vnode) {
6089
+ var hydratedNode;
6090
+
6091
+ switch (vnode.type) {
6092
+ case 0
6093
+ /* Text */
6094
+ :
6095
+ hydratedNode = hydrateText(node, vnode);
6096
+ break;
6097
+
6098
+ case 1
6099
+ /* Comment */
6100
+ :
6101
+ hydratedNode = hydrateComment(node, vnode);
6102
+ break;
6103
+
6104
+ case 2
6105
+ /* Element */
6106
+ :
6107
+ hydratedNode = hydrateElement(node, vnode);
6108
+ break;
6109
+
6110
+ case 3
6111
+ /* CustomElement */
6112
+ :
6113
+ hydratedNode = hydrateCustomElement(node, vnode);
6114
+ break;
6115
+ }
6116
+
6117
+ return nextSibling$1(hydratedNode);
6118
+ }
6119
+
6120
+ function hydrateText(node, vnode) {
6121
+ var _a;
6122
+
6123
+ if (!hasCorrectNodeType(vnode, node, 3
6124
+ /* TEXT */
6125
+ )) {
6126
+ return handleMismatch(node, vnode);
6127
+ }
6128
+
6129
+ setText$1(node, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6130
+ vnode.elm = node;
6131
+ return node;
6132
+ }
6133
+
6134
+ function hydrateComment(node, vnode) {
6135
+ var _a;
6136
+
6137
+ if (!hasCorrectNodeType(vnode, node, 8
6138
+ /* COMMENT */
6139
+ )) {
6140
+ return handleMismatch(node, vnode);
6141
+ }
6142
+
6143
+ setProperty$1(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6144
+ vnode.elm = node;
6145
+ return node;
6146
+ }
6147
+
6148
+ function hydrateElement(elm, vnode) {
6149
+ if (!hasCorrectNodeType(vnode, elm, 1
6150
+ /* ELEMENT */
6151
+ ) || !isMatchingElement(vnode, elm)) {
6152
+ return handleMismatch(elm, vnode);
6153
+ }
6154
+
6155
+ vnode.elm = elm;
6156
+ var context = vnode.data.context;
6157
+ var isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual"
6158
+ /* Manual */
6159
+ );
6160
+
6161
+ if (isDomManual) {
6162
+ // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
6163
+ // remove the innerHTML from props so it reuses the existing dom elements.
6164
+ var props = vnode.data.props;
6165
+
6166
+ if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
6167
+ if (getProperty$1(elm, 'innerHTML') === props.innerHTML) {
6168
+ // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
6169
+ vnode.data = Object.assign(Object.assign({}, vnode.data), {
6170
+ props: cloneAndOmitKey(props, 'innerHTML')
6171
+ });
6172
+ }
6173
+ }
6174
+ }
6175
+
6176
+ patchElementPropsAndAttrs(vnode);
6177
+
6178
+ if (!isDomManual) {
6179
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm, vnode.owner);
6180
+ }
6181
+
6182
+ return elm;
6183
+ }
6184
+
6185
+ function hydrateCustomElement(elm, vnode) {
6186
+ if (!hasCorrectNodeType(vnode, elm, 1
6187
+ /* ELEMENT */
6188
+ ) || !isMatchingElement(vnode, elm)) {
6189
+ return handleMismatch(elm, vnode);
6190
+ }
6191
+
6192
+ var sel = vnode.sel,
6193
+ mode = vnode.mode,
6194
+ ctor = vnode.ctor,
6195
+ owner = vnode.owner;
6196
+ var vm = createVM(elm, ctor, {
6197
+ mode: mode,
6198
+ owner: owner,
6199
+ tagName: sel
6200
+ });
6201
+ vnode.elm = elm;
6202
+ vnode.vm = vm;
6203
+ allocateChildren(vnode, vm);
6204
+ patchElementPropsAndAttrs(vnode); // Insert hook section:
6205
+
6206
+ runConnectedCallback(vm);
6207
+
6208
+ if (vm.renderMode !== 0
6209
+ /* Light */
6210
+ ) {
6211
+ // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6212
+ // Note: for Light DOM, this is handled while hydrating the VM
6213
+ hydrateChildren(getFirstChild$1(elm), vnode.children, elm);
6214
+ }
6215
+
6216
+ hydrateVM(vm);
6217
+ return elm;
6218
+ }
6219
+
6220
+ function hydrateChildren(node, children, parentNode, owner) {
6221
+ var nextNode = node;
6222
+ var anchor = null;
6223
+
6224
+ for (var _i29 = 0; _i29 < children.length; _i29++) {
6225
+ var childVnode = children[_i29];
6226
+
6227
+ if (!isNull(childVnode)) {
6228
+ if (nextNode) {
6229
+ nextNode = hydrateNode(nextNode, childVnode);
6230
+ anchor = childVnode.elm;
6231
+ } else {
6232
+ hasMismatch = true;
6233
+
6234
+ mount(childVnode, parentNode, anchor);
6235
+ anchor = childVnode.elm;
6236
+ }
6237
+ }
6238
+ }
6239
+
6240
+ if (nextNode) {
6241
+ hasMismatch = true;
6242
+
6243
+ do {
6244
+ var current = nextNode;
6245
+ nextNode = nextSibling$1(nextNode);
6246
+ removeNode(current, parentNode);
6247
+ } while (nextNode);
6248
+ }
6249
+ }
6250
+
6251
+ function handleMismatch(node, vnode, msg) {
6252
+ hasMismatch = true;
6253
+
6254
+ var parentNode = getProperty$1(node, 'parentNode');
6255
+ mount(vnode, parentNode, node);
6256
+ removeNode(node, parentNode);
6257
+ return vnode.elm;
6258
+ }
6259
+
6260
+ function patchElementPropsAndAttrs(vnode) {
6261
+ applyEventListeners(vnode);
6262
+ patchProps(null, vnode);
6263
+ }
6264
+
6265
+ function hasCorrectNodeType(vnode, node, nodeType) {
6266
+ if (getProperty$1(node, 'nodeType') !== nodeType) {
6267
+
6268
+ return false;
6269
+ }
6270
+
6271
+ return true;
6272
+ }
6273
+
6274
+ function isMatchingElement(vnode, elm) {
6275
+ if (vnode.sel.toLowerCase() !== getProperty$1(elm, 'tagName').toLowerCase()) {
6276
+
6277
+ return false;
6278
+ }
6279
+
6280
+ var hasIncompatibleAttrs = validateAttrs(vnode, elm);
6281
+ var hasIncompatibleClass = validateClassAttr(vnode, elm);
6282
+ var hasIncompatibleStyle = validateStyleAttr(vnode, elm);
6283
+ return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6284
+ }
6285
+
6286
+ function validateAttrs(vnode, elm) {
6287
+ var _vnode$data$attrs = vnode.data.attrs,
6288
+ attrs = _vnode$data$attrs === void 0 ? {} : _vnode$data$attrs;
6289
+ var nodesAreCompatible = true; // Validate attributes, though we could always recovery from those by running the update mods.
6290
+ // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6291
+
6292
+ for (var _i30 = 0, _Object$entries = Object.entries(attrs); _i30 < _Object$entries.length; _i30++) {
6293
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i30], 2),
6294
+ attrName = _Object$entries$_i[0],
6295
+ attrValue = _Object$entries$_i[1];
6296
+
6297
+ var elmAttrValue = getAttribute$1(elm, attrName);
6298
+
6299
+ if (String(attrValue) !== elmAttrValue) {
6300
+
6301
+ nodesAreCompatible = false;
6302
+ }
6303
+ }
6304
+
6305
+ return nodesAreCompatible;
6306
+ }
6307
+
6308
+ function validateClassAttr(vnode, elm) {
6309
+ var _vnode$data = vnode.data,
6310
+ className = _vnode$data.className,
6311
+ classMap = _vnode$data.classMap;
6312
+ var nodesAreCompatible = true;
6313
+
6314
+ if (!isUndefined$1(className) && String(className) !== getProperty$1(elm, 'className')) {
6315
+ // className is used when class is bound to an expr.
6316
+ nodesAreCompatible = false;
6317
+ } else if (!isUndefined$1(classMap)) {
6318
+ // classMap is used when class is set to static value.
6319
+ var classList = getClassList$1(elm);
6320
+ var computedClassName = ''; // all classes from the vnode should be in the element.classList
6321
+
6322
+ for (var name in classMap) {
6323
+ computedClassName += ' ' + name;
6324
+
6325
+ if (!classList.contains(name)) {
6326
+ nodesAreCompatible = false;
6327
+ }
6328
+ }
6329
+
6330
+ computedClassName.trim();
6331
+
6332
+ if (classList.length > keys(classMap).length) {
6333
+ nodesAreCompatible = false;
6334
+ }
6335
+ }
6336
+
6337
+ return nodesAreCompatible;
6338
+ }
6339
+
6340
+ function validateStyleAttr(vnode, elm) {
6341
+ var _vnode$data2 = vnode.data,
6342
+ style = _vnode$data2.style,
6343
+ styleDecls = _vnode$data2.styleDecls;
6344
+ var elmStyle = getAttribute$1(elm, 'style') || '';
6345
+ var nodesAreCompatible = true;
6346
+
6347
+ if (!isUndefined$1(style) && style !== elmStyle) {
6348
+ nodesAreCompatible = false;
6349
+ } else if (!isUndefined$1(styleDecls)) {
6350
+ var parsedVnodeStyle = parseStyleText(elmStyle);
6351
+ var expectedStyle = []; // styleMap is used when style is set to static value.
6352
+
6353
+ for (var _i31 = 0, n = styleDecls.length; _i31 < n; _i31++) {
6354
+ var _styleDecls$_i2 = _slicedToArray(styleDecls[_i31], 3),
6355
+ prop = _styleDecls$_i2[0],
6356
+ value = _styleDecls$_i2[1],
6357
+ important = _styleDecls$_i2[2];
6358
+
6359
+ expectedStyle.push("".concat(prop, ": ").concat(value + (important ? ' important!' : '')));
6360
+ var parsedPropValue = parsedVnodeStyle[prop];
6361
+
6362
+ if (isUndefined$1(parsedPropValue)) {
6363
+ nodesAreCompatible = false;
6364
+ } else if (!parsedPropValue.startsWith(value)) {
6365
+ nodesAreCompatible = false;
6366
+ } else if (important && !parsedPropValue.endsWith('!important')) {
6367
+ nodesAreCompatible = false;
6368
+ }
6369
+ }
6370
+
6371
+ if (keys(parsedVnodeStyle).length > styleDecls.length) {
6372
+ nodesAreCompatible = false;
6373
+ }
6374
+
6375
+ ArrayJoin.call(expectedStyle, ';');
6376
+ }
6377
+
6378
+ return nodesAreCompatible;
6379
+ }
6144
6380
  /*
6145
6381
  * Copyright (c) 2018, salesforce.com, inc.
6146
6382
  * All rights reserved.
@@ -6156,7 +6392,7 @@ var LWC = (function (exports) {
6156
6392
  hooksAreSet = true;
6157
6393
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6158
6394
  }
6159
- /* version: 2.11.1 */
6395
+ /* version: 2.11.5 */
6160
6396
 
6161
6397
  /*
6162
6398
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6543,7 +6779,7 @@ var LWC = (function (exports) {
6543
6779
  }
6544
6780
 
6545
6781
  function createVMWithProps(element, Ctor, props) {
6546
- createVM(element, Ctor, {
6782
+ var vm = createVM(element, Ctor, {
6547
6783
  mode: 'open',
6548
6784
  owner: null,
6549
6785
  tagName: element.tagName.toLowerCase()
@@ -6556,6 +6792,8 @@ var LWC = (function (exports) {
6556
6792
 
6557
6793
  element[key] = value;
6558
6794
  }
6795
+
6796
+ return vm;
6559
6797
  }
6560
6798
 
6561
6799
  function hydrateComponent(element, Ctor) {
@@ -6583,8 +6821,8 @@ var LWC = (function (exports) {
6583
6821
  // Let the renderer know we are hydrating, so it does not replace the existing shadowRoot
6584
6822
  // and uses the same algo to create the stylesheets as in SSR.
6585
6823
  setIsHydrating(true);
6586
- createVMWithProps(element, Ctor, props);
6587
- hydrateRootElement(element); // set it back since now we finished hydration.
6824
+ var vm = createVMWithProps(element, Ctor, props);
6825
+ hydrateRoot(vm); // set it back since now we finished hydration.
6588
6826
 
6589
6827
  setIsHydrating(false);
6590
6828
  } catch (e) {
@@ -6899,7 +7137,7 @@ var LWC = (function (exports) {
6899
7137
  });
6900
7138
  freeze(LightningElement);
6901
7139
  seal(LightningElement.prototype);
6902
- /* version: 2.11.1 */
7140
+ /* version: 2.11.5 */
6903
7141
 
6904
7142
  exports.LightningElement = LightningElement;
6905
7143
  exports.__unstable__ProfilerControl = profilerControl;