lwc 2.13.3 → 2.14.1

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 (43) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +351 -129
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +351 -128
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +195 -122
  5. package/dist/engine-dom/iife/es5/engine-dom.js +7581 -5773
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +5966 -4601
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +351 -128
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +195 -122
  11. package/dist/engine-dom/umd/es5/engine-dom.js +7581 -5773
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +5966 -4601
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +188 -52
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +188 -53
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -4
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +29 -4
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +10 -13
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4601 -3603
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +10 -1
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4424 -3481
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +29 -4
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +10 -13
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +4601 -3603
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +10 -1
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +4424 -3481
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service.min.js +1 -1
  33. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service.js +243 -258
  35. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  36. package/dist/wire-service/iife/es5/wire-service_debug.js +243 -258
  37. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
  39. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  40. package/dist/wire-service/umd/es5/wire-service.js +243 -258
  41. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  42. package/dist/wire-service/umd/es5/wire-service_debug.js +243 -258
  43. package/package.json +7 -7
@@ -46,7 +46,7 @@ var LWC = (function (exports) {
46
46
  */
47
47
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
48
48
  const { isArray: isArray$1 } = Array;
49
- const { filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
49
+ const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
50
50
  const { fromCharCode: StringFromCharCode } = String;
51
51
  const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
52
52
  function isUndefined$1(obj) {
@@ -290,7 +290,7 @@ var LWC = (function (exports) {
290
290
  const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
291
291
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
292
292
  const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
293
- /** version: 2.13.3 */
293
+ /** version: 2.14.1 */
294
294
 
295
295
  /*
296
296
  * Copyright (c) 2018, salesforce.com, inc.
@@ -380,6 +380,7 @@ var LWC = (function (exports) {
380
380
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
381
381
  */
382
382
  const features = {
383
+ DUMMY_TEST_FLAG: null,
383
384
  ENABLE_ELEMENT_PATCH: null,
384
385
  ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
385
386
  ENABLE_HMR: null,
@@ -433,9 +434,6 @@ var LWC = (function (exports) {
433
434
  */
434
435
  function setFeatureFlagForTest(name, value) {
435
436
  }
436
- /** version: 2.13.3 */
437
-
438
- /* proxy-compat-disable */
439
437
 
440
438
  /*
441
439
  * Copyright (c) 2018, salesforce.com, inc.
@@ -515,10 +513,6 @@ var LWC = (function (exports) {
515
513
  function setHTMLElement(HTMLElementImpl) {
516
514
  HTMLElementExported$1 = HTMLElementImpl;
517
515
  }
518
- let isHydrating$1;
519
- function setIsHydrating$1(isHydratingImpl) {
520
- isHydrating$1 = isHydratingImpl;
521
- }
522
516
  let insert$1;
523
517
  function setInsert(insertImpl) {
524
518
  insert$1 = insertImpl;
@@ -639,10 +633,6 @@ var LWC = (function (exports) {
639
633
  function setIsConnected(isConnectedImpl) {
640
634
  isConnected$1 = isConnectedImpl;
641
635
  }
642
- let insertGlobalStylesheet$1;
643
- function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
644
- insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
645
- }
646
636
  let insertStylesheet$1;
647
637
  function setInsertStylesheet(insertStylesheetImpl) {
648
638
  insertStylesheet$1 = insertStylesheetImpl;
@@ -2076,6 +2066,8 @@ var LWC = (function (exports) {
2076
2066
  // on top of stylesheetToken for anyone who is accessing the old internal API.
2077
2067
  // Details: https://salesforce.quip.com/v1rmAFu2cKAr
2078
2068
  defineProperty(tpl, 'stylesheetTokens', {
2069
+ enumerable: true,
2070
+ configurable: true,
2079
2071
  get() {
2080
2072
  const { stylesheetToken } = this;
2081
2073
  if (isUndefined$1(stylesheetToken)) {
@@ -2868,16 +2860,20 @@ var LWC = (function (exports) {
2868
2860
  }
2869
2861
  }
2870
2862
  function unmount(vnode, parent, doRemove = false) {
2871
- const { type, elm } = vnode;
2863
+ const { type, elm, sel } = vnode;
2872
2864
  // When unmounting a VNode subtree not all the elements have to removed from the DOM. The
2873
2865
  // subtree root, is the only element worth unmounting from the subtree.
2874
2866
  if (doRemove) {
2875
2867
  removeNode(elm, parent);
2876
2868
  }
2877
2869
  switch (type) {
2878
- case 2 /* Element */:
2879
- unmountVNodes(vnode.children, elm);
2870
+ case 2 /* Element */: {
2871
+ // Slot content is removed to trigger slotchange event when removing slot.
2872
+ // Only required for synthetic shadow.
2873
+ const removeChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
2874
+ unmountVNodes(vnode.children, elm, removeChildren);
2880
2875
  break;
2876
+ }
2881
2877
  case 3 /* CustomElement */: {
2882
2878
  const { vm } = vnode;
2883
2879
  // No need to unmount the children here, `removeVM` will take care of removing the
@@ -3644,10 +3640,10 @@ var LWC = (function (exports) {
3644
3640
  const { renderMode, shadowMode } = vm;
3645
3641
  if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
3646
3642
  for (let i = 0; i < stylesheets.length; i++) {
3647
- insertGlobalStylesheet$1(stylesheets[i]);
3643
+ insertStylesheet$1(stylesheets[i]);
3648
3644
  }
3649
3645
  }
3650
- else if (ssr$1 || isHydrating$1()) {
3646
+ else if (ssr$1 || vm.hydrated) {
3651
3647
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
3652
3648
  // This works in the client, because the stylesheets are created, and cached in the VM
3653
3649
  // the first time the VM renders.
@@ -3658,15 +3654,10 @@ var LWC = (function (exports) {
3658
3654
  else {
3659
3655
  // native shadow or light DOM, DOM renderer
3660
3656
  const root = getNearestNativeShadowComponent(vm);
3661
- const isGlobal = isNull(root);
3657
+ // null root means a global style
3658
+ const target = isNull(root) ? undefined : root.shadowRoot;
3662
3659
  for (let i = 0; i < stylesheets.length; i++) {
3663
- if (isGlobal) {
3664
- insertGlobalStylesheet$1(stylesheets[i]);
3665
- }
3666
- else {
3667
- // local level
3668
- insertStylesheet$1(stylesheets[i], root.shadowRoot);
3669
- }
3660
+ insertStylesheet$1(stylesheets[i], target);
3670
3661
  }
3671
3662
  }
3672
3663
  return null;
@@ -4065,13 +4056,25 @@ var LWC = (function (exports) {
4065
4056
 
4066
4057
  resetComponentStateWhenRemoved(vm);
4067
4058
  }
4068
- function createVM(elm, ctor, options) {
4069
- var _a;
4070
4059
 
4060
+ function getNearestShadowAncestor(vm) {
4061
+ let ancestor = vm.owner;
4062
+
4063
+ while (!isNull(ancestor) && ancestor.renderMode === 0
4064
+ /* Light */
4065
+ ) {
4066
+ ancestor = ancestor.owner;
4067
+ }
4068
+
4069
+ return ancestor;
4070
+ }
4071
+
4072
+ function createVM(elm, ctor, options) {
4071
4073
  const {
4072
4074
  mode,
4073
4075
  owner,
4074
- tagName
4076
+ tagName,
4077
+ hydrated
4075
4078
  } = options;
4076
4079
  const def = getComponentInternalDef(ctor);
4077
4080
  const vm = {
@@ -4094,9 +4097,8 @@ var LWC = (function (exports) {
4094
4097
  cmpSlots: create(null),
4095
4098
  oar: create(null),
4096
4099
  cmpTemplate: null,
4100
+ hydrated: Boolean(hydrated),
4097
4101
  renderMode: def.renderMode,
4098
- shadowMode: computeShadowMode(def, owner),
4099
- nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
4100
4102
  context: {
4101
4103
  stylesheetToken: undefined,
4102
4104
  hasTokenInClass: undefined,
@@ -4109,6 +4111,7 @@ var LWC = (function (exports) {
4109
4111
  },
4110
4112
  // Properties set right after VM creation.
4111
4113
  tro: null,
4114
+ shadowMode: null,
4112
4115
  // Properties set by the LightningElement constructor.
4113
4116
  component: null,
4114
4117
  shadowRoot: null,
@@ -4117,6 +4120,7 @@ var LWC = (function (exports) {
4117
4120
  setHook,
4118
4121
  getHook
4119
4122
  };
4123
+ vm.shadowMode = computeShadowMode(vm);
4120
4124
  vm.tro = getTemplateReactiveObserver(vm);
4121
4125
 
4122
4126
 
@@ -4129,9 +4133,10 @@ var LWC = (function (exports) {
4129
4133
  return vm;
4130
4134
  }
4131
4135
 
4132
- function computeShadowMode(def, owner) {
4133
- var _a;
4134
-
4136
+ function computeShadowMode(vm) {
4137
+ const {
4138
+ def
4139
+ } = vm;
4135
4140
  let shadowMode;
4136
4141
 
4137
4142
  if (isSyntheticShadowDefined$1) {
@@ -4154,13 +4159,23 @@ var LWC = (function (exports) {
4154
4159
  /* Native */
4155
4160
  ;
4156
4161
  } else {
4157
- // Transitive support for native Shadow DOM. A component in native mode
4158
- // transitively opts all of its descendants into native.
4159
- // Synthetic if neither this component nor any of its ancestors are configured
4160
- // to be native.
4161
- shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
4162
- /* Synthetic */
4163
- ;
4162
+ const shadowAncestor = getNearestShadowAncestor(vm);
4163
+
4164
+ if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
4165
+ /* Native */
4166
+ ) {
4167
+ // Transitive support for native Shadow DOM. A component in native mode
4168
+ // transitively opts all of its descendants into native.
4169
+ shadowMode = 0
4170
+ /* Native */
4171
+ ;
4172
+ } else {
4173
+ // Synthetic if neither this component nor any of its ancestors are configured
4174
+ // to be native.
4175
+ shadowMode = 1
4176
+ /* Synthetic */
4177
+ ;
4178
+ }
4164
4179
  }
4165
4180
  } else {
4166
4181
  shadowMode = 1
@@ -4987,6 +5002,7 @@ var LWC = (function (exports) {
4987
5002
  mode,
4988
5003
  owner,
4989
5004
  tagName: sel,
5005
+ hydrated: true,
4990
5006
  });
4991
5007
  vnode.elm = elm;
4992
5008
  vnode.vm = vm;
@@ -5136,6 +5152,10 @@ var LWC = (function (exports) {
5136
5152
  hooksAreSet = true;
5137
5153
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
5138
5154
  }
5155
+ // TODO [#2782]: eventually freezeTemplate() will _actually_ freeze the tmpl object. Today it
5156
+ // just warns on mutation.
5157
+ function freezeTemplate(tmpl) {
5158
+ }
5139
5159
 
5140
5160
  /*
5141
5161
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5159,7 +5179,7 @@ var LWC = (function (exports) {
5159
5179
  }
5160
5180
  return ctor;
5161
5181
  }
5162
- /* version: 2.13.3 */
5182
+ /* version: 2.14.1 */
5163
5183
 
5164
5184
  /*
5165
5185
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5167,17 +5187,138 @@ var LWC = (function (exports) {
5167
5187
  * SPDX-License-Identifier: MIT
5168
5188
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5169
5189
  */
5170
- const globalStylesheets = create(null);
5171
- const globalStylesheetsParentElement = document.head || document.body || document;
5172
- // This check for constructable stylesheets is similar to Fast's:
5190
+ //
5191
+ // Feature detection
5192
+ //
5193
+ // This check for constructable style sheets is similar to Fast's:
5173
5194
  // https://github.com/microsoft/fast/blob/d49d1ec/packages/web-components/fast-element/src/dom.ts#L51-L53
5174
5195
  // See also: https://github.com/whatwg/webidl/issues/1027#issuecomment-934510070
5175
- const supportsConstructableStyleSheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
5176
- const supportsMutableAdoptedStyleSheets = supportsConstructableStyleSheets &&
5196
+ const supportsConstructableStylesheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
5197
+ // The original adoptedStylesheet proposal used a frozen array. A follow-up proposal made the array mutable.
5198
+ // Chromium 99+ and Firefox 101+ support mutable arrays. We check if the array is mutable, to ensure backward compat.
5199
+ // (If the length is writable, then the array is mutable.) See: https://chromestatus.com/feature/5638996492288000
5200
+ // TODO [#2828]: Re-evaluate this in the future once we drop support for older browser versions.
5201
+ const supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets &&
5177
5202
  getOwnPropertyDescriptor$1(document.adoptedStyleSheets, 'length').writable;
5178
- const styleElements = create(null);
5179
- const styleSheets = create(null);
5180
- const shadowRootsToStyleSheets = new WeakMap();
5203
+ // Detect IE, via https://stackoverflow.com/a/9851769
5204
+ const isIE11 = !isUndefined$1(document.documentMode);
5205
+ const stylesheetCache = new Map();
5206
+ function isDocument(target) {
5207
+ return !isUndefined$1(target.head);
5208
+ }
5209
+ function createFreshStyleElement(content) {
5210
+ const elm = document.createElement('style');
5211
+ elm.type = 'text/css';
5212
+ elm.textContent = content;
5213
+ return elm;
5214
+ }
5215
+ function createStyleElement(content, cacheData) {
5216
+ const { stylesheet, used } = cacheData;
5217
+ // If the <style> was already used, then we should clone it. We cannot insert
5218
+ // the same <style> in two places in the DOM.
5219
+ if (used) {
5220
+ // For a mysterious reason, IE11 doesn't like the way we clone <style> nodes
5221
+ // and will render the incorrect styles if we do things that way. It's just
5222
+ // a perf optimization, so we can skip it for IE11.
5223
+ if (isIE11) {
5224
+ return createFreshStyleElement(content);
5225
+ }
5226
+ // This `<style>` may be repeated multiple times in the DOM, so cache it. It's a bit
5227
+ // faster to call `cloneNode()` on an existing node than to recreate it every time.
5228
+ return stylesheet.cloneNode(true);
5229
+ }
5230
+ // We don't clone every time, because that would be a perf tax on the first time
5231
+ cacheData.used = true;
5232
+ return stylesheet;
5233
+ }
5234
+ function createConstructableStylesheet(content) {
5235
+ const stylesheet = new CSSStyleSheet();
5236
+ stylesheet.replaceSync(content);
5237
+ return stylesheet;
5238
+ }
5239
+ function insertConstructableStylesheet(content, target, cacheData) {
5240
+ const { adoptedStyleSheets } = target;
5241
+ const { stylesheet } = cacheData;
5242
+ // Mutable adopted stylesheets are only supported in certain browsers.
5243
+ // The reason we use it is for perf: https://github.com/salesforce/lwc/pull/2683
5244
+ if (supportsMutableAdoptedStyleSheets) {
5245
+ adoptedStyleSheets.push(stylesheet);
5246
+ }
5247
+ else {
5248
+ target.adoptedStyleSheets = [...adoptedStyleSheets, stylesheet];
5249
+ }
5250
+ }
5251
+ function insertStyleElement(content, target, cacheData) {
5252
+ const elm = createStyleElement(content, cacheData);
5253
+ const targetAnchorPoint = isDocument(target) ? target.head : target;
5254
+ targetAnchorPoint.appendChild(elm);
5255
+ }
5256
+ function doInsertStylesheet(content, target, cacheData) {
5257
+ // Constructable stylesheets are only supported in certain browsers:
5258
+ // https://caniuse.com/mdn-api_document_adoptedstylesheets
5259
+ // The reason we use it is for perf: https://github.com/salesforce/lwc/pull/2460
5260
+ if (supportsConstructableStylesheets) {
5261
+ insertConstructableStylesheet(content, target, cacheData);
5262
+ }
5263
+ else {
5264
+ // Fall back to <style> element
5265
+ insertStyleElement(content, target, cacheData);
5266
+ }
5267
+ }
5268
+ function getCacheData(content) {
5269
+ let cacheData = stylesheetCache.get(content);
5270
+ if (isUndefined$1(cacheData)) {
5271
+ cacheData = {
5272
+ stylesheet: supportsConstructableStylesheets
5273
+ ? createConstructableStylesheet(content)
5274
+ : createFreshStyleElement(content),
5275
+ roots: undefined,
5276
+ global: false,
5277
+ used: false,
5278
+ };
5279
+ stylesheetCache.set(content, cacheData);
5280
+ }
5281
+ return cacheData;
5282
+ }
5283
+ function insertGlobalStylesheet(content) {
5284
+ const cacheData = getCacheData(content);
5285
+ if (cacheData.global) {
5286
+ // already inserted
5287
+ return;
5288
+ }
5289
+ cacheData.global = true; // mark inserted
5290
+ doInsertStylesheet(content, document, cacheData);
5291
+ }
5292
+ function insertLocalStylesheet(content, target) {
5293
+ const cacheData = getCacheData(content);
5294
+ let { roots } = cacheData;
5295
+ if (isUndefined$1(roots)) {
5296
+ roots = cacheData.roots = new WeakSet(); // lazily initialize (not needed for global styles)
5297
+ }
5298
+ else if (roots.has(target)) {
5299
+ // already inserted
5300
+ return;
5301
+ }
5302
+ roots.add(target); // mark inserted
5303
+ doInsertStylesheet(content, target, cacheData);
5304
+ }
5305
+ function insertStylesheet(content, target) {
5306
+ if (isUndefined$1(target)) {
5307
+ // global
5308
+ insertGlobalStylesheet(content);
5309
+ }
5310
+ else {
5311
+ // local
5312
+ insertLocalStylesheet(content, target);
5313
+ }
5314
+ }
5315
+
5316
+ /*
5317
+ * Copyright (c) 2018, salesforce.com, inc.
5318
+ * All rights reserved.
5319
+ * SPDX-License-Identifier: MIT
5320
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
5321
+ */
5181
5322
  let getCustomElement;
5182
5323
  let defineCustomElement;
5183
5324
  let HTMLElementConstructor;
@@ -5204,52 +5345,6 @@ var LWC = (function (exports) {
5204
5345
  return false;
5205
5346
  }
5206
5347
  }
5207
- function insertConstructableStyleSheet(content, target) {
5208
- // It's important for CSSStyleSheets to be unique based on their content, so that
5209
- // `shadowRoot.adoptedStyleSheets.includes(sheet)` works.
5210
- let styleSheet = styleSheets[content];
5211
- if (isUndefined$1(styleSheet)) {
5212
- styleSheet = new CSSStyleSheet();
5213
- styleSheet.replaceSync(content);
5214
- styleSheets[content] = styleSheet;
5215
- }
5216
- const { adoptedStyleSheets } = target;
5217
- if (!adoptedStyleSheets.includes(styleSheet)) {
5218
- if (supportsMutableAdoptedStyleSheets) {
5219
- // This is only supported in later versions of Chromium:
5220
- // https://chromestatus.com/feature/5638996492288000
5221
- adoptedStyleSheets.push(styleSheet);
5222
- }
5223
- else {
5224
- target.adoptedStyleSheets = [...adoptedStyleSheets, styleSheet];
5225
- }
5226
- }
5227
- }
5228
- function insertStyleElement(content, target) {
5229
- // Avoid inserting duplicate `<style>`s
5230
- let sheets = shadowRootsToStyleSheets.get(target);
5231
- if (isUndefined$1(sheets)) {
5232
- sheets = create(null);
5233
- shadowRootsToStyleSheets.set(target, sheets);
5234
- }
5235
- if (sheets[content]) {
5236
- return;
5237
- }
5238
- sheets[content] = true;
5239
- // This `<style>` may be repeated multiple times in the DOM, so cache it. It's a bit
5240
- // faster to call `cloneNode()` on an existing node than to recreate it every time.
5241
- let elm = styleElements[content];
5242
- if (isUndefined$1(elm)) {
5243
- elm = document.createElement('style');
5244
- elm.type = 'text/css';
5245
- elm.textContent = content;
5246
- styleElements[content] = elm;
5247
- }
5248
- else {
5249
- elm = elm.cloneNode(true);
5250
- }
5251
- target.appendChild(elm);
5252
- }
5253
5348
  if (isCustomElementRegistryAvailable()) {
5254
5349
  getCustomElement = customElements.get.bind(customElements);
5255
5350
  defineCustomElement = customElements.define.bind(customElements);
@@ -5288,9 +5383,6 @@ var LWC = (function (exports) {
5288
5383
  hydrating = value;
5289
5384
  }
5290
5385
  const ssr = false;
5291
- function isHydrating() {
5292
- return hydrating;
5293
- }
5294
5386
  const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
5295
5387
  const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
5296
5388
  function createElement$1(tagName, namespace) {
@@ -5399,25 +5491,6 @@ var LWC = (function (exports) {
5399
5491
  function isConnected(node) {
5400
5492
  return node.isConnected;
5401
5493
  }
5402
- function insertGlobalStylesheet(content) {
5403
- if (!isUndefined$1(globalStylesheets[content])) {
5404
- return;
5405
- }
5406
- globalStylesheets[content] = true;
5407
- const elm = document.createElement('style');
5408
- elm.type = 'text/css';
5409
- elm.textContent = content;
5410
- globalStylesheetsParentElement.appendChild(elm);
5411
- }
5412
- function insertStylesheet(content, target) {
5413
- if (supportsConstructableStyleSheets) {
5414
- insertConstructableStyleSheet(content, target);
5415
- }
5416
- else {
5417
- // Fall back to <style> element
5418
- insertStyleElement(content, target);
5419
- }
5420
- }
5421
5494
  const HTMLElementExported = HTMLElementConstructor;
5422
5495
  setAttachShadow(attachShadow);
5423
5496
  setCreateComment(createComment);
@@ -5440,10 +5513,7 @@ var LWC = (function (exports) {
5440
5513
  setGetProperty(getProperty);
5441
5514
  setHTMLElement(HTMLElementExported);
5442
5515
  setInsert(insert);
5443
- setInsertGlobalStylesheet(insertGlobalStylesheet);
5444
- setInsertStylesheet(insertStylesheet);
5445
5516
  setIsConnected(isConnected);
5446
- setIsHydrating$1(isHydrating);
5447
5517
  setIsNativeShadowDefined(isNativeShadowDefined);
5448
5518
  setIsSyntheticShadowDefined(isSyntheticShadowDefined);
5449
5519
  setNextSibling(nextSibling);
@@ -5458,6 +5528,7 @@ var LWC = (function (exports) {
5458
5528
  setSetText(setText);
5459
5529
  setSsr(ssr);
5460
5530
  setAddEventListener(addEventListener);
5531
+ setInsertStylesheet(insertStylesheet);
5461
5532
 
5462
5533
  /*
5463
5534
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5483,6 +5554,7 @@ var LWC = (function (exports) {
5483
5554
  mode: 'open',
5484
5555
  owner: null,
5485
5556
  tagName: element.tagName.toLowerCase(),
5557
+ hydrated: true,
5486
5558
  });
5487
5559
  for (const [key, value] of Object.entries(props)) {
5488
5560
  element[key] = value;
@@ -5745,7 +5817,7 @@ var LWC = (function (exports) {
5745
5817
  });
5746
5818
  freeze(LightningElement);
5747
5819
  seal(LightningElement.prototype);
5748
- /* version: 2.13.3 */
5820
+ /* version: 2.14.1 */
5749
5821
 
5750
5822
  exports.LightningElement = LightningElement;
5751
5823
  exports.__unstable__ProfilerControl = profilerControl;
@@ -5753,6 +5825,7 @@ var LWC = (function (exports) {
5753
5825
  exports.buildCustomElementConstructor = deprecatedBuildCustomElementConstructor;
5754
5826
  exports.createContextProvider = createContextProvider;
5755
5827
  exports.createElement = createElement;
5828
+ exports.freezeTemplate = freezeTemplate;
5756
5829
  exports.getComponentConstructor = getComponentConstructor;
5757
5830
  exports.getComponentDef = getComponentDef;
5758
5831
  exports.hydrateComponent = hydrateComponent;