lwc 2.5.10-alpha1 → 2.7.0

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 (54) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +168 -134
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +169 -135
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +154 -133
  5. package/dist/engine-dom/iife/es5/engine-dom.js +185 -145
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +172 -145
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +170 -136
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +155 -134
  11. package/dist/engine-dom/umd/es5/engine-dom.js +186 -146
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +173 -146
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +179 -142
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +179 -142
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -130
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +30 -131
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +30 -131
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +37 -128
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +37 -128
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +31 -132
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +31 -132
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +38 -129
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +38 -129
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +3 -3
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -3
  33. package/dist/wire-service/iife/es5/wire-service.js +12 -12
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +12 -12
  36. package/dist/wire-service/umd/es2017/wire-service.js +4 -4
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +4 -4
  38. package/dist/wire-service/umd/es5/wire-service.js +13 -13
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +13 -13
  41. package/package.json +8 -8
  42. package/dist/engine/esm/es2017/engine.js +0 -7981
  43. package/dist/engine/iife/es2017/engine.js +0 -8013
  44. package/dist/engine/iife/es2017/engine.min.js +0 -9
  45. package/dist/engine/iife/es2017/engine_debug.js +0 -6541
  46. package/dist/engine/iife/es5/engine.js +0 -6060
  47. package/dist/engine/iife/es5/engine.min.js +0 -23
  48. package/dist/engine/iife/es5/engine_debug.js +0 -4856
  49. package/dist/engine/umd/es2017/engine.js +0 -8014
  50. package/dist/engine/umd/es2017/engine.min.js +0 -9
  51. package/dist/engine/umd/es2017/engine_debug.js +0 -6542
  52. package/dist/engine/umd/es5/engine.js +0 -6061
  53. package/dist/engine/umd/es5/engine.min.js +0 -23
  54. package/dist/engine/umd/es5/engine_debug.js +0 -4857
@@ -15,13 +15,13 @@ var LWC = (function (exports) {
15
15
 
16
16
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
17
 
18
- function _get2(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get2 = Reflect.get; } else { _get2 = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get2(target, property, receiver || target); }
18
+ function _get2() { if (typeof Reflect !== "undefined" && Reflect.get) { _get2 = Reflect.get; } else { _get2 = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get2.apply(this, arguments); }
19
19
 
20
20
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf2(object); if (object === null) break; } return object; }
21
21
 
22
22
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
23
 
24
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
25
 
26
26
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
27
27
 
@@ -39,7 +39,7 @@ var LWC = (function (exports) {
39
39
 
40
40
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
41
41
 
42
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
42
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
43
43
 
44
44
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
45
45
 
@@ -55,7 +55,7 @@ var LWC = (function (exports) {
55
55
 
56
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; }
57
57
 
58
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
58
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
59
59
 
60
60
  /* proxy-compat-disable */
61
61
 
@@ -123,7 +123,7 @@ var LWC = (function (exports) {
123
123
  ArrayFilter = _Array$prototype.filter,
124
124
  ArrayIndexOf = _Array$prototype.indexOf,
125
125
  ArrayJoin = _Array$prototype.join,
126
- ArrayMap$1 = _Array$prototype.map,
126
+ ArrayMap = _Array$prototype.map,
127
127
  ArrayPush$1 = _Array$prototype.push,
128
128
  ArraySlice = _Array$prototype.slice,
129
129
  ArraySplice = _Array$prototype.splice,
@@ -184,7 +184,7 @@ var LWC = (function (exports) {
184
184
  // Array.prototype.toString directly will cause an error Iterate through
185
185
  // all the items and handle individually.
186
186
  if (isArray$1(obj)) {
187
- return ArrayJoin.call(ArrayMap$1.call(obj, toString$1), ',');
187
+ return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
188
188
  }
189
189
 
190
190
  return obj.toString();
@@ -348,7 +348,7 @@ var LWC = (function (exports) {
348
348
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
349
349
  return attributeName;
350
350
  }
351
- /** version: 2.5.10-alpha1 */
351
+ /** version: 2.7.0 */
352
352
 
353
353
  /*
354
354
  * Copyright (c) 2018, salesforce.com, inc.
@@ -460,7 +460,6 @@ var LWC = (function (exports) {
460
460
  ENABLE_NODE_LIST_PATCH: null,
461
461
  ENABLE_HTML_COLLECTIONS_PATCH: null,
462
462
  ENABLE_NODE_PATCH: null,
463
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
464
463
  ENABLE_MIXED_SHADOW_MODE: null,
465
464
  ENABLE_WIRE_SYNC_EMIT: null
466
465
  };
@@ -528,7 +527,7 @@ var LWC = (function (exports) {
528
527
  setFeatureFlag(name, value);
529
528
  }
530
529
  }
531
- /** version: 2.5.10-alpha1 */
530
+ /** version: 2.7.0 */
532
531
 
533
532
  /* proxy-compat-disable */
534
533
 
@@ -1912,7 +1911,8 @@ var LWC = (function (exports) {
1912
1911
  */
1913
1912
 
1914
1913
  var isArray = Array.isArray;
1915
- var _getPrototypeOf = Object.getPrototypeOf,
1914
+ var ObjectDotPrototype = Object.prototype,
1915
+ _getPrototypeOf = Object.getPrototypeOf,
1916
1916
  ObjectCreate = Object.create,
1917
1917
  ObjectDefineProperty = Object.defineProperty,
1918
1918
  _isExtensible = Object.isExtensible,
@@ -1990,7 +1990,10 @@ var LWC = (function (exports) {
1990
1990
  // but it will always be compatible with the previous descriptor
1991
1991
  // to preserve the object invariants, which makes these lines safe.
1992
1992
 
1993
- var originalDescriptor = _getOwnPropertyDescriptor(originalTarget, key);
1993
+ var originalDescriptor = _getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
1994
+
1995
+ /* istanbul ignore else */
1996
+
1994
1997
 
1995
1998
  if (!isUndefined(originalDescriptor)) {
1996
1999
  var wrappedDesc = this.wrapDescriptor(originalDescriptor);
@@ -2015,12 +2018,18 @@ var LWC = (function (exports) {
2015
2018
 
2016
2019
  _preventExtensions(shadowTarget);
2017
2020
  } // Shared Traps
2021
+ // TODO: apply() is never called
2022
+
2023
+ /* istanbul ignore next */
2018
2024
 
2019
2025
  }, {
2020
2026
  key: "apply",
2021
2027
  value: function apply(shadowTarget, thisArg, argArray) {
2022
2028
  /* No op */
2023
- }
2029
+ } // TODO: construct() is never called
2030
+
2031
+ /* istanbul ignore next */
2032
+
2024
2033
  }, {
2025
2034
  key: "construct",
2026
2035
  value: function construct(shadowTarget, argArray, newTarget) {
@@ -2125,8 +2134,8 @@ var LWC = (function (exports) {
2125
2134
  return BaseProxyHandler;
2126
2135
  }();
2127
2136
 
2128
- var getterMap = new WeakMap();
2129
- var setterMap = new WeakMap();
2137
+ var getterMap$1 = new WeakMap();
2138
+ var setterMap$1 = new WeakMap();
2130
2139
  var reverseGetterMap = new WeakMap();
2131
2140
  var reverseSetterMap = new WeakMap();
2132
2141
 
@@ -2149,7 +2158,7 @@ var LWC = (function (exports) {
2149
2158
  }, {
2150
2159
  key: "wrapGetter",
2151
2160
  value: function wrapGetter(originalGet) {
2152
- var wrappedGetter = getterMap.get(originalGet);
2161
+ var wrappedGetter = getterMap$1.get(originalGet);
2153
2162
 
2154
2163
  if (!isUndefined(wrappedGetter)) {
2155
2164
  return wrappedGetter;
@@ -2162,14 +2171,14 @@ var LWC = (function (exports) {
2162
2171
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2163
2172
  };
2164
2173
 
2165
- getterMap.set(originalGet, get);
2174
+ getterMap$1.set(originalGet, get);
2166
2175
  reverseGetterMap.set(get, originalGet);
2167
2176
  return get;
2168
2177
  }
2169
2178
  }, {
2170
2179
  key: "wrapSetter",
2171
2180
  value: function wrapSetter(originalSet) {
2172
- var wrappedSetter = setterMap.get(originalSet);
2181
+ var wrappedSetter = setterMap$1.get(originalSet);
2173
2182
 
2174
2183
  if (!isUndefined(wrappedSetter)) {
2175
2184
  return wrappedSetter;
@@ -2180,7 +2189,7 @@ var LWC = (function (exports) {
2180
2189
  originalSet.call(unwrap$1(this), unwrap$1(v));
2181
2190
  };
2182
2191
 
2183
- setterMap.set(originalSet, set);
2192
+ setterMap$1.set(originalSet, set);
2184
2193
  reverseSetterMap.set(set, originalSet);
2185
2194
  return set;
2186
2195
  }
@@ -2221,7 +2230,7 @@ var LWC = (function (exports) {
2221
2230
  return unwrap$1(redGet.call(handler.wrapValue(this)));
2222
2231
  };
2223
2232
 
2224
- getterMap.set(get, redGet);
2233
+ getterMap$1.set(get, redGet);
2225
2234
  reverseGetterMap.set(redGet, get);
2226
2235
  return get;
2227
2236
  }
@@ -2241,7 +2250,7 @@ var LWC = (function (exports) {
2241
2250
  redSet.call(handler.wrapValue(this), handler.wrapValue(v));
2242
2251
  };
2243
2252
 
2244
- setterMap.set(set, redSet);
2253
+ setterMap$1.set(set, redSet);
2245
2254
  reverseSetterMap.set(redSet, set);
2246
2255
  return set;
2247
2256
  }
@@ -2277,6 +2286,7 @@ var LWC = (function (exports) {
2277
2286
  }, {
2278
2287
  key: "setPrototypeOf",
2279
2288
  value: function setPrototypeOf(shadowTarget, prototype) {
2289
+ /* istanbul ignore else */
2280
2290
  if (process.env.NODE_ENV !== 'production') {
2281
2291
  throw new Error("Invalid setPrototypeOf invocation for reactive proxy ".concat(toString(this.originalTarget), ". Prototype of reactive objects cannot be changed."));
2282
2292
  }
@@ -2290,6 +2300,11 @@ var LWC = (function (exports) {
2290
2300
  _preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
2291
2301
  // the preventExtension call, in which case we should not attempt to lock down
2292
2302
  // the shadow target.
2303
+ // TODO: It should not actually be possible to reach this `if` statement.
2304
+ // If a proxy rejects extensions, then calling preventExtensions will throw an error:
2305
+ // https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
2306
+
2307
+ /* istanbul ignore if */
2293
2308
 
2294
2309
 
2295
2310
  if (_isExtensible(originalTarget)) {
@@ -2332,8 +2347,8 @@ var LWC = (function (exports) {
2332
2347
  return ReactiveProxyHandler;
2333
2348
  }(BaseProxyHandler);
2334
2349
 
2335
- var getterMap$1 = new WeakMap();
2336
- var setterMap$1 = new WeakMap();
2350
+ var getterMap = new WeakMap();
2351
+ var setterMap = new WeakMap();
2337
2352
 
2338
2353
  var ReadOnlyHandler = /*#__PURE__*/function (_BaseProxyHandler2) {
2339
2354
  _inherits(ReadOnlyHandler, _BaseProxyHandler2);
@@ -2354,7 +2369,7 @@ var LWC = (function (exports) {
2354
2369
  }, {
2355
2370
  key: "wrapGetter",
2356
2371
  value: function wrapGetter(originalGet) {
2357
- var wrappedGetter = getterMap$1.get(originalGet);
2372
+ var wrappedGetter = getterMap.get(originalGet);
2358
2373
 
2359
2374
  if (!isUndefined(wrappedGetter)) {
2360
2375
  return wrappedGetter;
@@ -2367,13 +2382,13 @@ var LWC = (function (exports) {
2367
2382
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2368
2383
  };
2369
2384
 
2370
- getterMap$1.set(originalGet, get);
2385
+ getterMap.set(originalGet, get);
2371
2386
  return get;
2372
2387
  }
2373
2388
  }, {
2374
2389
  key: "wrapSetter",
2375
2390
  value: function wrapSetter(originalSet) {
2376
- var wrappedSetter = setterMap$1.get(originalSet);
2391
+ var wrappedSetter = setterMap.get(originalSet);
2377
2392
 
2378
2393
  if (!isUndefined(wrappedSetter)) {
2379
2394
  return wrappedSetter;
@@ -2382,38 +2397,47 @@ var LWC = (function (exports) {
2382
2397
  var handler = this;
2383
2398
 
2384
2399
  var set = function set(v) {
2400
+ /* istanbul ignore else */
2385
2401
  if (process.env.NODE_ENV !== 'production') {
2386
2402
  var originalTarget = handler.originalTarget;
2387
2403
  throw new Error("Invalid mutation: Cannot invoke a setter on \"".concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2388
2404
  }
2389
2405
  };
2390
2406
 
2391
- setterMap$1.set(originalSet, set);
2407
+ setterMap.set(originalSet, set);
2392
2408
  return set;
2393
2409
  }
2394
2410
  }, {
2395
2411
  key: "set",
2396
2412
  value: function set(shadowTarget, key, value) {
2413
+ /* istanbul ignore else */
2397
2414
  if (process.env.NODE_ENV !== 'production') {
2398
2415
  var originalTarget = this.originalTarget;
2399
- throw new Error("Invalid mutation: Cannot set \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2416
+ var msg = isArray(originalTarget) ? "Invalid mutation: Cannot mutate array at index ".concat(key.toString(), ". Array is read-only.") : "Invalid mutation: Cannot set \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only.");
2417
+ throw new Error(msg);
2400
2418
  }
2419
+ /* istanbul ignore next */
2420
+
2401
2421
 
2402
2422
  return false;
2403
2423
  }
2404
2424
  }, {
2405
2425
  key: "deleteProperty",
2406
2426
  value: function deleteProperty(shadowTarget, key) {
2427
+ /* istanbul ignore else */
2407
2428
  if (process.env.NODE_ENV !== 'production') {
2408
2429
  var originalTarget = this.originalTarget;
2409
2430
  throw new Error("Invalid mutation: Cannot delete \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2410
2431
  }
2432
+ /* istanbul ignore next */
2433
+
2411
2434
 
2412
2435
  return false;
2413
2436
  }
2414
2437
  }, {
2415
2438
  key: "setPrototypeOf",
2416
2439
  value: function setPrototypeOf(shadowTarget, prototype) {
2440
+ /* istanbul ignore else */
2417
2441
  if (process.env.NODE_ENV !== 'production') {
2418
2442
  var originalTarget = this.originalTarget;
2419
2443
  throw new Error("Invalid prototype mutation: Cannot set prototype on \"".concat(originalTarget, "\". \"").concat(originalTarget, "\" prototype is read-only."));
@@ -2422,20 +2446,26 @@ var LWC = (function (exports) {
2422
2446
  }, {
2423
2447
  key: "preventExtensions",
2424
2448
  value: function preventExtensions(shadowTarget) {
2449
+ /* istanbul ignore else */
2425
2450
  if (process.env.NODE_ENV !== 'production') {
2426
2451
  var originalTarget = this.originalTarget;
2427
2452
  throw new Error("Invalid mutation: Cannot preventExtensions on ".concat(originalTarget, "\". \"").concat(originalTarget, " is read-only."));
2428
2453
  }
2454
+ /* istanbul ignore next */
2455
+
2429
2456
 
2430
2457
  return false;
2431
2458
  }
2432
2459
  }, {
2433
2460
  key: "defineProperty",
2434
2461
  value: function defineProperty(shadowTarget, key, descriptor) {
2462
+ /* istanbul ignore else */
2435
2463
  if (process.env.NODE_ENV !== 'production') {
2436
2464
  var originalTarget = this.originalTarget;
2437
2465
  throw new Error("Invalid mutation: Cannot defineProperty \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2438
2466
  }
2467
+ /* istanbul ignore next */
2468
+
2439
2469
 
2440
2470
  return false;
2441
2471
  }
@@ -2495,6 +2525,8 @@ var LWC = (function (exports) {
2495
2525
  }; // Inspired from paulmillr/es6-shim
2496
2526
  // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
2497
2527
 
2528
+ /* istanbul ignore next */
2529
+
2498
2530
  function getGlobal() {
2499
2531
  // the only reliable means to get the global object is `Function('return this')()`
2500
2532
  // However, this causes CSP violations in Chrome apps.
@@ -2519,6 +2551,7 @@ var LWC = (function (exports) {
2519
2551
  }
2520
2552
 
2521
2553
  function init() {
2554
+ /* istanbul ignore if */
2522
2555
  if (process.env.NODE_ENV === 'production') {
2523
2556
  // this method should never leak to prod
2524
2557
  throw new ReferenceError();
@@ -2533,13 +2566,13 @@ var LWC = (function (exports) {
2533
2566
  ArrayPush.call(devtoolsFormatters, formatter);
2534
2567
  global.devtoolsFormatters = devtoolsFormatters;
2535
2568
  }
2569
+ /* istanbul ignore else */
2570
+
2536
2571
 
2537
2572
  if (process.env.NODE_ENV !== 'production') {
2538
2573
  init();
2539
2574
  }
2540
2575
 
2541
- var ObjectDotPrototype = Object.prototype;
2542
-
2543
2576
  function defaultValueIsObservable(value) {
2544
2577
  // intentionally checking for null
2545
2578
  if (value === null) {
@@ -2568,64 +2601,54 @@ var LWC = (function (exports) {
2568
2601
  /* do nothing */
2569
2602
  };
2570
2603
 
2571
- var defaultValueDistortion = function defaultValueDistortion(value) {
2572
- return value;
2573
- };
2574
-
2575
2604
  function createShadowTarget(value) {
2576
2605
  return isArray(value) ? [] : {};
2577
2606
  }
2578
2607
 
2579
- var ReactiveMembrane = /*#__PURE__*/function () {
2580
- function ReactiveMembrane(options) {
2581
- _classCallCheck(this, ReactiveMembrane);
2608
+ var ObservableMembrane = /*#__PURE__*/function () {
2609
+ function ObservableMembrane() {
2610
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2582
2611
 
2583
- this.valueDistortion = defaultValueDistortion;
2584
- this.valueMutated = defaultValueMutated;
2585
- this.valueObserved = defaultValueObserved;
2586
- this.valueIsObservable = defaultValueIsObservable;
2587
- this.objectGraph = new WeakMap();
2612
+ _classCallCheck(this, ObservableMembrane);
2588
2613
 
2589
- if (!isUndefined(options)) {
2590
- var _valueDistortion = options.valueDistortion,
2591
- _valueMutated = options.valueMutated,
2592
- _valueObserved = options.valueObserved,
2593
- valueIsObservable = options.valueIsObservable,
2594
- tagPropertyKey = options.tagPropertyKey;
2595
- this.valueDistortion = isFunction(_valueDistortion) ? _valueDistortion : defaultValueDistortion;
2596
- this.valueMutated = isFunction(_valueMutated) ? _valueMutated : defaultValueMutated;
2597
- this.valueObserved = isFunction(_valueObserved) ? _valueObserved : defaultValueObserved;
2598
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2599
- this.tagPropertyKey = tagPropertyKey;
2600
- }
2614
+ this.readOnlyObjectGraph = new WeakMap();
2615
+ this.reactiveObjectGraph = new WeakMap();
2616
+ var valueMutated = options.valueMutated,
2617
+ valueObserved = options.valueObserved,
2618
+ valueIsObservable = options.valueIsObservable,
2619
+ tagPropertyKey = options.tagPropertyKey;
2620
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2621
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2622
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2623
+ this.tagPropertyKey = tagPropertyKey;
2601
2624
  }
2602
2625
 
2603
- _createClass(ReactiveMembrane, [{
2626
+ _createClass(ObservableMembrane, [{
2604
2627
  key: "getProxy",
2605
2628
  value: function getProxy(value) {
2606
2629
  var unwrappedValue = unwrap$1(value);
2607
- var distorted = this.valueDistortion(unwrappedValue);
2608
2630
 
2609
- if (this.valueIsObservable(distorted)) {
2610
- var o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
2611
- // we return the readonly.
2631
+ if (this.valueIsObservable(unwrappedValue)) {
2632
+ // When trying to extract the writable version of a readonly we return the readonly.
2633
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2634
+ return value;
2635
+ }
2612
2636
 
2613
- return o.readOnly === value ? value : o.reactive;
2637
+ return this.getReactiveHandler(unwrappedValue);
2614
2638
  }
2615
2639
 
2616
- return distorted;
2640
+ return unwrappedValue;
2617
2641
  }
2618
2642
  }, {
2619
2643
  key: "getReadOnlyProxy",
2620
2644
  value: function getReadOnlyProxy(value) {
2621
2645
  value = unwrap$1(value);
2622
- var distorted = this.valueDistortion(value);
2623
2646
 
2624
- if (this.valueIsObservable(distorted)) {
2625
- return this.getReactiveState(value, distorted).readOnly;
2647
+ if (this.valueIsObservable(value)) {
2648
+ return this.getReadOnlyHandler(value);
2626
2649
  }
2627
2650
 
2628
- return distorted;
2651
+ return value;
2629
2652
  }
2630
2653
  }, {
2631
2654
  key: "unwrapProxy",
@@ -2633,48 +2656,40 @@ var LWC = (function (exports) {
2633
2656
  return unwrap$1(p);
2634
2657
  }
2635
2658
  }, {
2636
- key: "getReactiveState",
2637
- value: function getReactiveState(value, distortedValue) {
2638
- var objectGraph = this.objectGraph;
2639
- var reactiveState = objectGraph.get(distortedValue);
2640
-
2641
- if (reactiveState) {
2642
- return reactiveState;
2659
+ key: "getReactiveHandler",
2660
+ value: function getReactiveHandler(value) {
2661
+ var proxy = this.reactiveObjectGraph.get(value);
2662
+
2663
+ if (isUndefined(proxy)) {
2664
+ // caching the proxy after the first time it is accessed
2665
+ var handler = new ReactiveProxyHandler(this, value);
2666
+ proxy = new Proxy(createShadowTarget(value), handler);
2667
+ registerProxy(proxy, value);
2668
+ this.reactiveObjectGraph.set(value, proxy);
2643
2669
  }
2644
2670
 
2645
- var membrane = this;
2646
- reactiveState = {
2647
- get reactive() {
2648
- var reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
2649
-
2650
- var proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
2651
- registerProxy(proxy, value);
2652
- ObjectDefineProperty(this, 'reactive', {
2653
- value: proxy
2654
- });
2655
- return proxy;
2656
- },
2657
-
2658
- get readOnly() {
2659
- var readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
2660
-
2661
- var proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
2662
- registerProxy(proxy, value);
2663
- ObjectDefineProperty(this, 'readOnly', {
2664
- value: proxy
2665
- });
2666
- return proxy;
2667
- }
2671
+ return proxy;
2672
+ }
2673
+ }, {
2674
+ key: "getReadOnlyHandler",
2675
+ value: function getReadOnlyHandler(value) {
2676
+ var proxy = this.readOnlyObjectGraph.get(value);
2677
+
2678
+ if (isUndefined(proxy)) {
2679
+ // caching the proxy after the first time it is accessed
2680
+ var handler = new ReadOnlyHandler(this, value);
2681
+ proxy = new Proxy(createShadowTarget(value), handler);
2682
+ registerProxy(proxy, value);
2683
+ this.readOnlyObjectGraph.set(value, proxy);
2684
+ }
2668
2685
 
2669
- };
2670
- objectGraph.set(distortedValue, reactiveState);
2671
- return reactiveState;
2686
+ return proxy;
2672
2687
  }
2673
2688
  }]);
2674
2689
 
2675
- return ReactiveMembrane;
2690
+ return ObservableMembrane;
2676
2691
  }();
2677
- /** version: 1.0.0 */
2692
+ /** version: 2.0.0 */
2678
2693
 
2679
2694
  /*
2680
2695
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2685,15 +2700,9 @@ var LWC = (function (exports) {
2685
2700
 
2686
2701
 
2687
2702
  var lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2688
-
2689
- function valueDistortion(value) {
2690
- return value;
2691
- }
2692
-
2693
- var reactiveMembrane = new ReactiveMembrane({
2703
+ var reactiveMembrane = new ObservableMembrane({
2694
2704
  valueObserved: valueObserved,
2695
2705
  valueMutated: valueMutated,
2696
- valueDistortion: valueDistortion,
2697
2706
  tagPropertyKey: lockerLivePropertyKey
2698
2707
  });
2699
2708
  /**
@@ -2702,16 +2711,9 @@ var LWC = (function (exports) {
2702
2711
  * change or being removed.
2703
2712
  */
2704
2713
 
2705
- var unwrap = function unwrap(value) {
2706
- var unwrapped = reactiveMembrane.unwrapProxy(value);
2707
-
2708
- if (unwrapped !== value) {
2709
- // if value is a proxy, unwrap to access original value and apply distortion
2710
- return valueDistortion(unwrapped);
2711
- }
2712
-
2713
- return value;
2714
- };
2714
+ function unwrap(value) {
2715
+ return reactiveMembrane.unwrapProxy(value);
2716
+ }
2715
2717
  /*
2716
2718
  * Copyright (c) 2018, salesforce.com, inc.
2717
2719
  * All rights reserved.
@@ -3810,7 +3812,7 @@ var LWC = (function (exports) {
3810
3812
  return _super4.apply(this, arguments);
3811
3813
  }
3812
3814
 
3813
- return HTMLBridgeElement;
3815
+ return _createClass(HTMLBridgeElement);
3814
3816
  }(SuperClass);
3815
3817
  } else {
3816
3818
  HTMLBridgeElement = function HTMLBridgeElement() {
@@ -4615,12 +4617,14 @@ var LWC = (function (exports) {
4615
4617
  }
4616
4618
 
4617
4619
  function updateChildrenHook(oldVnode, vnode) {
4618
- var children = vnode.children,
4619
- owner = vnode.owner;
4620
- var fn = hasDynamicChildren(children) ? updateDynamicChildren : updateStaticChildren;
4621
- runWithBoundaryProtection(owner, owner.owner, noop, function () {
4622
- fn(vnode.elm, oldVnode.children, children);
4623
- }, noop);
4620
+ var elm = vnode.elm,
4621
+ children = vnode.children;
4622
+
4623
+ if (hasDynamicChildren(children)) {
4624
+ updateDynamicChildren(elm, oldVnode.children, children);
4625
+ } else {
4626
+ updateStaticChildren(elm, oldVnode.children, children);
4627
+ }
4624
4628
  }
4625
4629
 
4626
4630
  function allocateChildrenHook(vnode, vm) {
@@ -4964,7 +4968,7 @@ var LWC = (function (exports) {
4964
4968
  return _this4;
4965
4969
  }
4966
4970
 
4967
- return LWCUpgradableElement;
4971
+ return _createClass(LWCUpgradableElement);
4968
4972
  }(renderer.HTMLElement);
4969
4973
 
4970
4974
  renderer.defineCustomElement(tagName, CE);
@@ -5811,6 +5815,7 @@ var LWC = (function (exports) {
5811
5815
 
5812
5816
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5813
5817
  var content = [];
5818
+ var root;
5814
5819
 
5815
5820
  for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
5816
5821
  var stylesheet = stylesheets[_i16];
@@ -5823,23 +5828,46 @@ var LWC = (function (exports) {
5823
5828
  // the component instance might be attempting to use an old version of
5824
5829
  // the stylesheet, while internally, we have a replacement for it.
5825
5830
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5826
- } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5827
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5831
+ }
5828
5832
 
5833
+ var isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5834
+
5835
+ var scopeToken = isScopedCss || vm.shadowMode === 1
5836
+ /* Synthetic */
5837
+ && vm.renderMode === 1
5838
+ /* Shadow */
5839
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5840
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5829
5841
 
5830
- var isScopedCss = stylesheet[KEY__SCOPED_CSS];
5831
5842
  var useActualHostSelector = vm.renderMode === 0
5832
5843
  /* Light */
5833
5844
  ? !isScopedCss : vm.shadowMode === 0
5834
5845
  /* Native */
5835
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5846
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5847
+ // we use an attribute selector on the host to simulate :dir().
5836
5848
 
5837
- var scopeToken = isScopedCss || vm.shadowMode === 1
5838
- /* Synthetic */
5839
- && vm.renderMode === 1
5849
+ var useNativeDirPseudoclass = void 0;
5850
+
5851
+ if (vm.renderMode === 1
5840
5852
  /* Shadow */
5841
- ? stylesheetToken : undefined;
5842
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
5853
+ ) {
5854
+ useNativeDirPseudoclass = vm.shadowMode === 0
5855
+ /* Native */
5856
+ ;
5857
+ } else {
5858
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
5859
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
5860
+ if (isUndefined$1(root)) {
5861
+ // Only calculate the root once as necessary
5862
+ root = getNearestShadowComponent(vm);
5863
+ }
5864
+
5865
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
5866
+ /* Native */
5867
+ ;
5868
+ }
5869
+
5870
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5843
5871
  }
5844
5872
  }
5845
5873
 
@@ -5861,14 +5889,12 @@ var LWC = (function (exports) {
5861
5889
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
5862
5890
 
5863
5891
 
5864
- function getNearestNativeShadowComponent(vm) {
5892
+ function getNearestShadowComponent(vm) {
5865
5893
  var owner = vm;
5866
5894
 
5867
5895
  while (!isNull(owner)) {
5868
5896
  if (owner.renderMode === 1
5869
5897
  /* Shadow */
5870
- && owner.shadowMode === 0
5871
- /* Native */
5872
5898
  ) {
5873
5899
  return owner;
5874
5900
  }
@@ -5879,6 +5905,20 @@ var LWC = (function (exports) {
5879
5905
  return owner;
5880
5906
  }
5881
5907
 
5908
+ function getNearestNativeShadowComponent(vm) {
5909
+ var owner = getNearestShadowComponent(vm);
5910
+
5911
+ if (!isNull(owner) && owner.shadowMode === 1
5912
+ /* Synthetic */
5913
+ ) {
5914
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
5915
+ // synthetic, we know we won't find a native component if we go any further.
5916
+ return null;
5917
+ }
5918
+
5919
+ return owner;
5920
+ }
5921
+
5882
5922
  function createStylesheet(vm, stylesheets) {
5883
5923
  var renderer = vm.renderer,
5884
5924
  renderMode = vm.renderMode,
@@ -5990,7 +6030,7 @@ var LWC = (function (exports) {
5990
6030
  if (isProfilerEnabled) {
5991
6031
  currentDispatcher(opId, 0
5992
6032
  /* Start */
5993
- , vm.tagName, vm.idx);
6033
+ , vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
5994
6034
  }
5995
6035
  }
5996
6036
 
@@ -6004,7 +6044,7 @@ var LWC = (function (exports) {
6004
6044
  if (isProfilerEnabled) {
6005
6045
  currentDispatcher(opId, 1
6006
6046
  /* Stop */
6007
- , vm.tagName, vm.idx);
6047
+ , vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
6008
6048
  }
6009
6049
  }
6010
6050
 
@@ -6018,7 +6058,7 @@ var LWC = (function (exports) {
6018
6058
  if (isProfilerEnabled) {
6019
6059
  currentDispatcher(opId, 0
6020
6060
  /* Start */
6021
- , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
6061
+ , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
6022
6062
  }
6023
6063
  }
6024
6064
 
@@ -6032,7 +6072,7 @@ var LWC = (function (exports) {
6032
6072
  if (isProfilerEnabled) {
6033
6073
  currentDispatcher(opId, 1
6034
6074
  /* Stop */
6035
- , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx);
6075
+ , vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
6036
6076
  }
6037
6077
  }
6038
6078
  /*
@@ -7204,7 +7244,7 @@ var LWC = (function (exports) {
7204
7244
  return _this5;
7205
7245
  }
7206
7246
 
7207
- return WireContextRegistrationEvent;
7247
+ return _createClass(WireContextRegistrationEvent);
7208
7248
  }( /*#__PURE__*/_wrapNativeSuper(CustomEvent));
7209
7249
 
7210
7250
  function createFieldDataCallback(vm, name) {
@@ -7548,7 +7588,7 @@ var LWC = (function (exports) {
7548
7588
  hooksAreSet = true;
7549
7589
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7550
7590
  }
7551
- /* version: 2.5.10-alpha1 */
7591
+ /* version: 2.7.0 */
7552
7592
 
7553
7593
  /*
7554
7594
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7605,7 +7645,7 @@ var LWC = (function (exports) {
7605
7645
  return _super7.apply(this, arguments);
7606
7646
  }
7607
7647
 
7608
- return clazz;
7648
+ return _createClass(clazz);
7609
7649
  }(HTMLElementAlias);
7610
7650
 
7611
7651
  customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
@@ -8201,7 +8241,7 @@ var LWC = (function (exports) {
8201
8241
  });
8202
8242
  freeze(LightningElement);
8203
8243
  seal(LightningElement.prototype);
8204
- /* version: 2.5.10-alpha1 */
8244
+ /* version: 2.7.0 */
8205
8245
 
8206
8246
  exports.LightningElement = LightningElement;
8207
8247
  exports.__unstable__ProfilerControl = profilerControl;
@@ -8234,4 +8274,4 @@ var LWC = (function (exports) {
8234
8274
 
8235
8275
  return exports;
8236
8276
 
8237
- }({}));
8277
+ })({});