@jsenv/core 36.2.0 → 36.3.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 (124) hide show
  1. package/dist/babel_helpers/AsyncGenerator/AsyncGenerator.js +45 -35
  2. package/dist/babel_helpers/AwaitValue/AwaitValue.js +3 -3
  3. package/dist/babel_helpers/applyDecoratedDescriptor/applyDecoratedDescriptor.js +13 -13
  4. package/dist/babel_helpers/applyDecs/applyDecs.js +227 -42
  5. package/dist/babel_helpers/applyDecs2203/applyDecs2203.js +559 -418
  6. package/dist/babel_helpers/applyDecs2203R/applyDecs2203R.js +235 -87
  7. package/dist/babel_helpers/applyDecs2301/applyDecs2301.js +591 -456
  8. package/dist/babel_helpers/applyDecs2305/applyDecs2305.js +681 -0
  9. package/dist/babel_helpers/arrayLikeToArray/arrayLikeToArray.js +5 -5
  10. package/dist/babel_helpers/arrayWithHoles/arrayWithHoles.js +3 -3
  11. package/dist/babel_helpers/arrayWithoutHoles/arrayWithoutHoles.js +4 -4
  12. package/dist/babel_helpers/assertThisInitialized/assertThisInitialized.js +4 -4
  13. package/dist/babel_helpers/asyncGeneratorDelegate/asyncGeneratorDelegate.js +12 -4
  14. package/dist/babel_helpers/asyncIterator/asyncIterator.js +13 -11
  15. package/dist/babel_helpers/asyncToGenerator/asyncToGenerator.js +18 -17
  16. package/dist/babel_helpers/awaitAsyncGenerator/awaitAsyncGenerator.js +2 -1
  17. package/dist/babel_helpers/checkInRHS/checkInRHS.js +8 -5
  18. package/dist/babel_helpers/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +7 -7
  19. package/dist/babel_helpers/classApplyDescriptorGet/classApplyDescriptorGet.js +3 -3
  20. package/dist/babel_helpers/classApplyDescriptorSet/classApplyDescriptorSet.js +4 -4
  21. package/dist/babel_helpers/classCallCheck/classCallCheck.js +2 -2
  22. package/dist/babel_helpers/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +2 -2
  23. package/dist/babel_helpers/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +2 -2
  24. package/dist/babel_helpers/classExtractFieldDescriptor/classExtractFieldDescriptor.js +3 -3
  25. package/dist/babel_helpers/classNameTDZError/classNameTDZError.js +2 -2
  26. package/dist/babel_helpers/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +6 -5
  27. package/dist/babel_helpers/classPrivateFieldGet/classPrivateFieldGet.js +6 -5
  28. package/dist/babel_helpers/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +3 -3
  29. package/dist/babel_helpers/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +3 -3
  30. package/dist/babel_helpers/classPrivateFieldSet/classPrivateFieldSet.js +7 -6
  31. package/dist/babel_helpers/classPrivateMethodGet/classPrivateMethodGet.js +3 -3
  32. package/dist/babel_helpers/classPrivateMethodSet/classPrivateMethodSet.js +2 -2
  33. package/dist/babel_helpers/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +8 -7
  34. package/dist/babel_helpers/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +15 -9
  35. package/dist/babel_helpers/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +5 -4
  36. package/dist/babel_helpers/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +2 -2
  37. package/dist/babel_helpers/construct/construct.js +10 -9
  38. package/dist/babel_helpers/createClass/createClass.js +2 -3
  39. package/dist/babel_helpers/createForOfIteratorHelper/createForOfIteratorHelper.js +30 -29
  40. package/dist/babel_helpers/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +18 -16
  41. package/dist/babel_helpers/createRawReactElement/createRawReactElement.js +23 -17
  42. package/dist/babel_helpers/createSuper/createSuper.js +14 -12
  43. package/dist/babel_helpers/decorate/decorate.js +242 -210
  44. package/dist/babel_helpers/defaults/defaults.js +6 -6
  45. package/dist/babel_helpers/defineAccessor/defineAccessor.js +1 -4
  46. package/dist/babel_helpers/defineEnumerableProperties/defineEnumerableProperties.js +12 -12
  47. package/dist/babel_helpers/defineProperty/defineProperty.js +7 -6
  48. package/dist/babel_helpers/extends/extends.js +5 -4
  49. package/dist/babel_helpers/get/get.js +2 -1
  50. package/dist/babel_helpers/getPrototypeOf/getPrototypeOf.js +4 -3
  51. package/dist/babel_helpers/inherits/inherits.js +3 -4
  52. package/dist/babel_helpers/inheritsLoose/inheritsLoose.js +6 -5
  53. package/dist/babel_helpers/initializerDefineProperty/initializerDefineProperty.js +4 -4
  54. package/dist/babel_helpers/initializerWarningHelper/initializerWarningHelper.js +5 -2
  55. package/dist/babel_helpers/instanceof/instanceof.js +3 -3
  56. package/dist/babel_helpers/interopRequireDefault/interopRequireDefault.js +2 -4
  57. package/dist/babel_helpers/interopRequireWildcard/interopRequireWildcard.js +19 -21
  58. package/dist/babel_helpers/isNativeFunction/isNativeFunction.js +2 -2
  59. package/dist/babel_helpers/isNativeReflectConstruct/isNativeReflectConstruct.js +7 -7
  60. package/dist/babel_helpers/iterableToArray/iterableToArray.js +6 -2
  61. package/dist/babel_helpers/iterableToArrayLimit/iterableToArrayLimit.js +6 -1
  62. package/dist/babel_helpers/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +6 -2
  63. package/dist/babel_helpers/jsx/jsx.js +14 -7
  64. package/dist/babel_helpers/maybeArrayLike/maybeArrayLike.js +6 -5
  65. package/dist/babel_helpers/newArrowCheck/newArrowCheck.js +2 -2
  66. package/dist/babel_helpers/nonIterableRest/nonIterableRest.js +5 -3
  67. package/dist/babel_helpers/nonIterableSpread/nonIterableSpread.js +5 -3
  68. package/dist/babel_helpers/objectDestructuringEmpty/objectDestructuringEmpty.js +2 -2
  69. package/dist/babel_helpers/objectSpread/objectSpread.js +15 -12
  70. package/dist/babel_helpers/objectSpread2/objectSpread2.js +7 -2
  71. package/dist/babel_helpers/objectWithoutProperties/objectWithoutProperties.js +15 -13
  72. package/dist/babel_helpers/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +11 -11
  73. package/dist/babel_helpers/possibleConstructorReturn/possibleConstructorReturn.js +7 -6
  74. package/dist/babel_helpers/readOnlyError/readOnlyError.js +2 -2
  75. package/dist/babel_helpers/regeneratorRuntime/regeneratorRuntime.js +124 -73
  76. package/dist/babel_helpers/set/set.js +23 -20
  77. package/dist/babel_helpers/setPrototypeOf/setPrototypeOf.js +6 -5
  78. package/dist/babel_helpers/skipFirstGeneratorNext/skipFirstGeneratorNext.js +5 -5
  79. package/dist/babel_helpers/slicedToArray/slicedToArray.js +10 -5
  80. package/dist/babel_helpers/slicedToArrayLoose/slicedToArrayLoose.js +12 -6
  81. package/dist/babel_helpers/superPropBase/superPropBase.js +6 -5
  82. package/dist/babel_helpers/taggedTemplateLiteral/taggedTemplateLiteral.js +7 -7
  83. package/dist/babel_helpers/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +4 -4
  84. package/dist/babel_helpers/tdz/tdz.js +2 -2
  85. package/dist/babel_helpers/temporalRef/temporalRef.js +5 -4
  86. package/dist/babel_helpers/temporalUndefined/temporalUndefined.js +1 -1
  87. package/dist/babel_helpers/toArray/toArray.js +10 -5
  88. package/dist/babel_helpers/toConsumableArray/toConsumableArray.js +10 -5
  89. package/dist/babel_helpers/toPrimitive/toPrimitive.js +7 -7
  90. package/dist/babel_helpers/toPropertyKey/toPropertyKey.js +5 -4
  91. package/dist/babel_helpers/typeof/typeof.js +14 -5
  92. package/dist/babel_helpers/unsupportedIterableToArray/unsupportedIterableToArray.js +10 -8
  93. package/dist/babel_helpers/wrapAsyncGenerator/wrapAsyncGenerator.js +5 -4
  94. package/dist/babel_helpers/wrapNativeSuper/wrapNativeSuper.js +17 -15
  95. package/dist/babel_helpers/wrapRegExp/wrapRegExp.js +19 -8
  96. package/dist/babel_helpers/writeOnlyError/writeOnlyError.js +2 -2
  97. package/dist/js/autoreload.js +148 -133
  98. package/dist/js/import_meta_hot.js +19 -13
  99. package/dist/js/inline_content.js +1 -3
  100. package/dist/js/new_stylesheet.js +119 -60
  101. package/dist/js/regenerator_runtime.js +204 -102
  102. package/dist/js/ribbon.js +11 -6
  103. package/dist/js/server_events_client.js +122 -98
  104. package/dist/js/ws.js +968 -265
  105. package/dist/jsenv_core.js +8513 -6162
  106. package/package.json +9 -9
  107. package/src/build/build.js +497 -486
  108. package/src/build/version_mappings_injection.js +21 -44
  109. package/src/kitchen/errors.js +2 -2
  110. package/src/kitchen/fetched_content_compliance.js +6 -2
  111. package/src/kitchen/kitchen.js +285 -80
  112. package/src/kitchen/prepend_content.js +135 -0
  113. package/src/kitchen/url_graph/url_graph_visitor.js +99 -0
  114. package/src/kitchen/url_graph/url_info_transformations.js +140 -21
  115. package/src/kitchen/url_graph.js +59 -29
  116. package/src/plugins/autoreload/jsenv_plugin_hmr.js +1 -2
  117. package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +2 -2
  118. package/src/plugins/importmap/jsenv_plugin_importmap.js +2 -2
  119. package/src/plugins/inlining/jsenv_plugin_inlining_as_data_url.js +1 -1
  120. package/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js +44 -23
  121. package/src/plugins/reference_analysis/js/jsenv_plugin_js_reference_analysis.js +2 -1
  122. package/dist/js/global_this_js_classic.js +0 -24
  123. package/dist/js/global_this_js_module.js +0 -20
  124. package/src/build/graph_utils.js +0 -34
@@ -4,68 +4,74 @@
4
4
  */
5
5
 
6
6
  const urlHotMetas = {};
7
- const createImportMetaHot = importMetaUrl => {
7
+
8
+ const createImportMetaHot = (importMetaUrl) => {
8
9
  const data = {};
9
10
  const url = asUrlWithoutHmrQuery(importMetaUrl);
11
+
10
12
  return {
11
13
  data,
12
14
  accept: (firstArg, secondArg) => {
13
15
  if (!firstArg) {
14
16
  addUrlMeta(url, {
15
17
  dependencies: [url],
16
- acceptCallback: () => {}
18
+ acceptCallback: () => {},
17
19
  });
18
20
  return;
19
21
  }
20
22
  if (typeof firstArg === "function") {
21
23
  addUrlMeta(url, {
22
24
  dependencies: [url],
23
- acceptCallback: firstArg
25
+ acceptCallback: firstArg,
24
26
  });
25
27
  return;
26
28
  }
27
29
  if (typeof firstArg === "string") {
28
30
  addUrlMeta(url, {
29
31
  dependencies: [firstArg],
30
- acceptCallback: secondArg
32
+ acceptCallback: secondArg,
31
33
  });
32
34
  return;
33
35
  }
34
36
  if (Array.isArray(firstArg)) {
35
37
  addUrlMeta(url, {
36
38
  dependencies: firstArg,
37
- acceptCallback: secondArg
39
+ acceptCallback: secondArg,
38
40
  });
39
41
  return;
40
42
  }
41
- throw new Error(`invalid call to import.meta.hot.accept(), received ${firstArg}`);
43
+ throw new Error(
44
+ `invalid call to import.meta.hot.accept(), received ${firstArg}`,
45
+ );
42
46
  },
43
- dispose: callback => {
47
+ dispose: (callback) => {
44
48
  addUrlMeta(url, {
45
49
  disposeCallback: () => {
46
50
  return callback(data);
47
- }
51
+ },
48
52
  });
49
53
  },
50
54
  decline: () => {
51
55
  addUrlMeta(url, {
52
- declined: true
56
+ declined: true,
53
57
  });
54
58
  },
55
59
  invalidate: () => {
56
60
  addUrlMeta(url, {
57
- invalidated: true
61
+ invalidated: true,
58
62
  });
59
- }
63
+ },
60
64
  };
61
65
  };
66
+
62
67
  const addUrlMeta = (url, meta) => {
63
68
  urlHotMetas[url] = {
64
69
  ...urlHotMetas[url],
65
- ...meta
70
+ ...meta,
66
71
  };
67
72
  };
68
- const asUrlWithoutHmrQuery = url => {
73
+
74
+ const asUrlWithoutHmrQuery = (url) => {
69
75
  const urlObject = new URL(url);
70
76
  if (urlObject.searchParams.has("hmr")) {
71
77
  urlObject.searchParams.delete("hmr");
@@ -11,9 +11,7 @@
11
11
  */
12
12
 
13
13
  const globalObject = typeof self === "object" ? self : process;
14
- globalObject.__InlineContent__ = function (content, {
15
- type = "text/plain"
16
- }) {
14
+ globalObject.__InlineContent__ = function (content, { type = "text/plain" }) {
17
15
  this.text = content;
18
16
  this.type = type;
19
17
  };
@@ -7,22 +7,28 @@
7
7
  if (typeof document === "undefined" || "adoptedStyleSheets" in document) {
8
8
  return;
9
9
  }
10
+
10
11
  var hasShadyCss = "ShadyCSS" in window && !ShadyCSS.nativeShadow;
11
12
  var bootstrapper = document.implementation.createHTMLDocument("");
12
13
  var closedShadowRootRegistry = new WeakMap();
13
14
  var _DOMException = typeof DOMException === "object" ? Error : DOMException;
14
15
  var defineProperty = Object.defineProperty;
15
16
  var forEach = Array.prototype.forEach;
17
+
16
18
  var importPattern = /@import.+?;?$/gm;
17
19
  function rejectImports(contents) {
18
20
  var _contents = contents.replace(importPattern, "");
19
21
  if (_contents !== contents) {
20
- console.warn("@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418");
22
+ console.warn(
23
+ "@import rules are not allowed here. See https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418",
24
+ );
21
25
  }
22
26
  return _contents.trim();
23
27
  }
24
28
  function isElementConnected(element) {
25
- return "isConnected" in element ? element.isConnected : document.contains(element);
29
+ return "isConnected" in element
30
+ ? element.isConnected
31
+ : document.contains(element);
26
32
  }
27
33
  function unique(arr) {
28
34
  return arr.filter(function (value, index) {
@@ -40,20 +46,37 @@
40
46
  function getShadowRoot(element) {
41
47
  return element.shadowRoot || closedShadowRootRegistry.get(element);
42
48
  }
43
- var cssStyleSheetMethods = ["addRule", "deleteRule", "insertRule", "removeRule"];
49
+
50
+ var cssStyleSheetMethods = [
51
+ "addRule",
52
+ "deleteRule",
53
+ "insertRule",
54
+ "removeRule",
55
+ ];
44
56
  var NonConstructedStyleSheet = CSSStyleSheet;
45
57
  var nonConstructedProto = NonConstructedStyleSheet.prototype;
46
58
  nonConstructedProto.replace = function () {
47
- return Promise.reject(new _DOMException("Can't call replace on non-constructed CSSStyleSheets."));
59
+ return Promise.reject(
60
+ new _DOMException(
61
+ "Can't call replace on non-constructed CSSStyleSheets.",
62
+ ),
63
+ );
48
64
  };
49
65
  nonConstructedProto.replaceSync = function () {
50
- throw new _DOMException("Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.");
66
+ throw new _DOMException(
67
+ "Failed to execute 'replaceSync' on 'CSSStyleSheet': Can't call replaceSync on non-constructed CSSStyleSheets.",
68
+ );
51
69
  };
52
70
  function isCSSStyleSheetInstance(instance) {
53
- return typeof instance === "object" ? proto$1.isPrototypeOf(instance) || nonConstructedProto.isPrototypeOf(instance) : false;
71
+ return typeof instance === "object"
72
+ ? proto$1.isPrototypeOf(instance) ||
73
+ nonConstructedProto.isPrototypeOf(instance)
74
+ : false;
54
75
  }
55
76
  function isNonConstructedStyleSheetInstance(instance) {
56
- return typeof instance === "object" ? nonConstructedProto.isPrototypeOf(instance) : false;
77
+ return typeof instance === "object"
78
+ ? nonConstructedProto.isPrototypeOf(instance)
79
+ : false;
57
80
  }
58
81
  var $basicStyleElement = new WeakMap();
59
82
  var $locations = new WeakMap();
@@ -70,9 +93,12 @@
70
93
  }
71
94
  function removeAdopterLocation(sheet, location) {
72
95
  $adoptersByLocation.get(sheet).delete(location);
73
- $locations.set(sheet, $locations.get(sheet).filter(function (_location) {
74
- return _location !== location;
75
- }));
96
+ $locations.set(
97
+ sheet,
98
+ $locations.get(sheet).filter(function (_location) {
99
+ return _location !== location;
100
+ }),
101
+ );
76
102
  }
77
103
  function restyleAdopter(sheet, adopter) {
78
104
  requestAnimationFrame(function () {
@@ -124,7 +150,7 @@
124
150
  get: function cssRules() {
125
151
  checkInvocationCorrectness(this);
126
152
  return $basicStyleElement.get(this).sheet.cssRules;
127
- }
153
+ },
128
154
  });
129
155
  defineProperty(proto$1, "media", {
130
156
  configurable: true,
@@ -132,17 +158,14 @@
132
158
  get: function media() {
133
159
  checkInvocationCorrectness(this);
134
160
  return $basicStyleElement.get(this).sheet.media;
135
- }
161
+ },
136
162
  });
137
163
  cssStyleSheetMethods.forEach(function (method) {
138
164
  proto$1[method] = function () {
139
165
  var self = this;
140
166
  checkInvocationCorrectness(self);
141
167
  var args = arguments;
142
- $appliedMethods.get(self).push({
143
- method: method,
144
- args: args
145
- });
168
+ $appliedMethods.get(self).push({ method: method, args: args });
146
169
  $locations.get(self).forEach(function (location) {
147
170
  if (location.isConnected()) {
148
171
  var sheet = getAdopterByLocation(self, location).sheet;
@@ -155,11 +178,12 @@
155
178
  });
156
179
  defineProperty(ConstructedStyleSheet, Symbol.hasInstance, {
157
180
  configurable: true,
158
- value: isCSSStyleSheetInstance
181
+ value: isCSSStyleSheetInstance,
159
182
  });
183
+
160
184
  var defaultObserverOptions = {
161
185
  childList: true,
162
- subtree: true
186
+ subtree: true,
163
187
  };
164
188
  var locations = new WeakMap();
165
189
  function getAssociatedLocation(element) {
@@ -179,14 +203,22 @@
179
203
  },
180
204
  set: function (sheets) {
181
205
  getAssociatedLocation(this).update(sheets);
182
- }
206
+ },
183
207
  });
184
208
  }
185
209
  function traverseWebComponents(node, callback) {
186
- var iter = document.createNodeIterator(node, NodeFilter.SHOW_ELEMENT, function (foundNode) {
187
- return getShadowRoot(foundNode) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
188
- }, null, false);
189
- for (var next = void 0; next = iter.nextNode();) {
210
+ var iter = document.createNodeIterator(
211
+ node,
212
+ NodeFilter.SHOW_ELEMENT,
213
+ function (foundNode) {
214
+ return getShadowRoot(foundNode)
215
+ ? NodeFilter.FILTER_ACCEPT
216
+ : NodeFilter.FILTER_REJECT;
217
+ },
218
+ null,
219
+ false,
220
+ );
221
+ for (var next = void 0; (next = iter.nextNode()); ) {
190
222
  callback(getShadowRoot(next));
191
223
  }
192
224
  }
@@ -194,9 +226,12 @@
194
226
  var $uniqueSheets = new WeakMap();
195
227
  var $observer = new WeakMap();
196
228
  function isExistingAdopter(self, element) {
197
- return element instanceof HTMLStyleElement && $uniqueSheets.get(self).some(function (sheet) {
198
- return getAdopterByLocation(sheet, self);
199
- });
229
+ return (
230
+ element instanceof HTMLStyleElement &&
231
+ $uniqueSheets.get(self).some(function (sheet) {
232
+ return getAdopterByLocation(sheet, self);
233
+ })
234
+ );
200
235
  }
201
236
  function getAdopterContainer(self) {
202
237
  var element = $element.get(self);
@@ -209,7 +244,9 @@
209
244
  var container = getAdopterContainer(self);
210
245
  observer.disconnect();
211
246
  sheets.forEach(function (sheet) {
212
- styleList.appendChild(getAdopterByLocation(sheet, self) || addAdopterLocation(sheet, self));
247
+ styleList.appendChild(
248
+ getAdopterByLocation(sheet, self) || addAdopterLocation(sheet, self),
249
+ );
213
250
  });
214
251
  container.insertBefore(styleList, null);
215
252
  observer.observe(container, defaultObserverOptions);
@@ -222,42 +259,47 @@
222
259
  self.sheets = [];
223
260
  $element.set(self, element);
224
261
  $uniqueSheets.set(self, []);
225
- $observer.set(self, new MutationObserver(function (mutations, observer) {
226
- if (!document) {
227
- observer.disconnect();
228
- return;
229
- }
230
- mutations.forEach(function (mutation) {
231
- if (!hasShadyCss) {
232
- forEach.call(mutation.addedNodes, function (node) {
233
- if (!(node instanceof Element)) {
234
- return;
235
- }
236
- traverseWebComponents(node, function (root) {
237
- getAssociatedLocation(root).connect();
238
- });
239
- });
262
+ $observer.set(
263
+ self,
264
+ new MutationObserver(function (mutations, observer) {
265
+ if (!document) {
266
+ observer.disconnect();
267
+ return;
240
268
  }
241
- forEach.call(mutation.removedNodes, function (node) {
242
- if (!(node instanceof Element)) {
243
- return;
244
- }
245
- if (isExistingAdopter(self, node)) {
246
- adopt(self);
247
- }
269
+ mutations.forEach(function (mutation) {
248
270
  if (!hasShadyCss) {
249
- traverseWebComponents(node, function (root) {
250
- getAssociatedLocation(root).disconnect();
271
+ forEach.call(mutation.addedNodes, function (node) {
272
+ if (!(node instanceof Element)) {
273
+ return;
274
+ }
275
+ traverseWebComponents(node, function (root) {
276
+ getAssociatedLocation(root).connect();
277
+ });
251
278
  });
252
279
  }
280
+ forEach.call(mutation.removedNodes, function (node) {
281
+ if (!(node instanceof Element)) {
282
+ return;
283
+ }
284
+ if (isExistingAdopter(self, node)) {
285
+ adopt(self);
286
+ }
287
+ if (!hasShadyCss) {
288
+ traverseWebComponents(node, function (root) {
289
+ getAssociatedLocation(root).disconnect();
290
+ });
291
+ }
292
+ });
253
293
  });
254
- });
255
- }));
294
+ }),
295
+ );
256
296
  }
257
297
  Location.prototype = {
258
298
  isConnected: function () {
259
299
  var element = $element.get(this);
260
- return element instanceof Document ? element.readyState !== "loading" : isElementConnected(element.host);
300
+ return element instanceof Document
301
+ ? element.readyState !== "loading"
302
+ : isElementConnected(element.host);
261
303
  },
262
304
  connect: function () {
263
305
  var container = getAdopterContainer(this);
@@ -274,15 +316,28 @@
274
316
  },
275
317
  update: function (sheets) {
276
318
  var self = this;
277
- var locationType = $element.get(self) === document ? "Document" : "ShadowRoot";
319
+ var locationType =
320
+ $element.get(self) === document ? "Document" : "ShadowRoot";
278
321
  if (!Array.isArray(sheets)) {
279
- throw new TypeError("Failed to set the 'adoptedStyleSheets' property on " + locationType + ": Iterator getter is not callable.");
322
+ throw new TypeError(
323
+ "Failed to set the 'adoptedStyleSheets' property on " +
324
+ locationType +
325
+ ": Iterator getter is not callable.",
326
+ );
280
327
  }
281
328
  if (!sheets.every(isCSSStyleSheetInstance)) {
282
- throw new TypeError("Failed to set the 'adoptedStyleSheets' property on " + locationType + ": Failed to convert value to 'CSSStyleSheet'");
329
+ throw new TypeError(
330
+ "Failed to set the 'adoptedStyleSheets' property on " +
331
+ locationType +
332
+ ": Failed to convert value to 'CSSStyleSheet'",
333
+ );
283
334
  }
284
335
  if (sheets.some(isNonConstructedStyleSheetInstance)) {
285
- throw new TypeError("Failed to set the 'adoptedStyleSheets' property on " + locationType + ": Can't adopt non-constructed stylesheets");
336
+ throw new TypeError(
337
+ "Failed to set the 'adoptedStyleSheets' property on " +
338
+ locationType +
339
+ ": Can't adopt non-constructed stylesheets",
340
+ );
286
341
  }
287
342
  self.sheets = sheets;
288
343
  var oldUniqueSheets = $uniqueSheets.get(self);
@@ -296,8 +351,9 @@
296
351
  if (self.isConnected() && uniqueSheets.length > 0) {
297
352
  adopt(self);
298
353
  }
299
- }
354
+ },
300
355
  };
356
+
301
357
  window.CSSStyleSheet = ConstructedStyleSheet;
302
358
  attachAdoptedStyleSheetProperty(Document);
303
359
  if ("ShadowRoot" in window) {
@@ -316,6 +372,9 @@
316
372
  if (documentLocation.isConnected()) {
317
373
  documentLocation.connect();
318
374
  } else {
319
- document.addEventListener("DOMContentLoaded", documentLocation.connect.bind(documentLocation));
375
+ document.addEventListener(
376
+ "DOMContentLoaded",
377
+ documentLocation.connect.bind(documentLocation),
378
+ );
320
379
  }
321
380
  })();