@mjhls/mjh-framework 1.0.840-seomanager-v1 → 1.0.840

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 (180) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD300x250.js +1 -1
  3. package/dist/cjs/AD300x250x600.js +1 -1
  4. package/dist/cjs/AD728x90.js +1 -1
  5. package/dist/cjs/ADFloatingFooter.js +1 -1
  6. package/dist/cjs/ADGutter.js +1 -1
  7. package/dist/cjs/ADSkyscraper.js +1 -1
  8. package/dist/cjs/ADSponsoredResources.js +1 -1
  9. package/dist/cjs/ADWebcast.js +1 -1
  10. package/dist/cjs/ADWelcome.js +1 -1
  11. package/dist/cjs/AccordionPanel.js +2 -2
  12. package/dist/cjs/AdSlot.js +1 -1
  13. package/dist/cjs/AdSlotsProvider.js +6 -2
  14. package/dist/cjs/AlgoliaSearch.js +37 -14
  15. package/dist/cjs/ArticleCarousel.js +1 -1
  16. package/dist/cjs/ArticleProgramLandingPage.js +4 -4
  17. package/dist/cjs/ArticleSeriesLandingPage.js +3 -3
  18. package/dist/cjs/ArticleSeriesListing.js +3 -3
  19. package/dist/cjs/Auth.js +2 -2
  20. package/dist/cjs/AuthWrapper.js +290 -1564
  21. package/dist/cjs/CMEDeck.js +1 -1
  22. package/dist/cjs/Column3.js +1 -1
  23. package/dist/cjs/DeckContent.js +2 -2
  24. package/dist/cjs/DeckQueue.js +3 -3
  25. package/dist/cjs/EventsDeck.js +1 -1
  26. package/dist/cjs/ExternalResources.js +4 -4
  27. package/dist/cjs/Feature.js +1 -1
  28. package/dist/cjs/GridContent.js +164 -45
  29. package/dist/cjs/HamMagazine.js +6 -6
  30. package/dist/cjs/HorizontalArticleListing.js +4 -4
  31. package/dist/cjs/HorizontalHero.js +2 -2
  32. package/dist/cjs/IssueLanding.js +6 -6
  33. package/dist/cjs/LeftNav.js +1 -1
  34. package/dist/cjs/MasterDeck.js +3 -3
  35. package/dist/cjs/MediaSeriesLanding.js +20 -120
  36. package/dist/cjs/NavMagazine.js +6 -6
  37. package/dist/cjs/NavNative.js +3 -3
  38. package/dist/cjs/OncliveHero.js +1 -1
  39. package/dist/cjs/PartnerDetailListing.js +6 -6
  40. package/dist/cjs/PdfDownload.js +2 -2
  41. package/dist/cjs/PubSection.js +3 -3
  42. package/dist/cjs/QueueDeckExpanded.js +3 -3
  43. package/dist/cjs/RecentNews.js +2 -2
  44. package/dist/cjs/SeriesListingDeck.js +2 -2
  45. package/dist/cjs/{SeriesSlider-34c6cc2b.js → SeriesSlider-cbab9f0f.js} +1 -1
  46. package/dist/cjs/{SocialSearchComponent-948138c7.js → SocialSearchComponent-ecb4f972.js} +3 -3
  47. package/dist/cjs/TaxonomyDescription.js +4 -4
  48. package/dist/cjs/TemplateNormal.js +6 -6
  49. package/dist/cjs/Ustream.js +4 -4
  50. package/dist/cjs/VideoProgramLandingPage.js +4 -4
  51. package/dist/cjs/VideoSeriesLandingPage.js +3 -3
  52. package/dist/cjs/VideoSeriesListing.js +7 -5
  53. package/dist/cjs/View.js +13 -55
  54. package/dist/cjs/YoutubeGroup.js +1 -1
  55. package/dist/cjs/getSerializers.js +4 -4
  56. package/dist/{esm/iconBase-ccc56b97.js → cjs/iconBase-68959171.js} +5 -2
  57. package/dist/cjs/{index-060c5d65.js → index-0a582ba9.js} +75 -24
  58. package/dist/cjs/{index-50be6759.js → index-8041a4eb.js} +9 -15
  59. package/dist/cjs/{index.esm-f27f80d9.js → index.esm-05850a2f.js} +1 -1
  60. package/dist/cjs/{index.esm-c1e16606.js → index.esm-44f3e2d0.js} +1 -1
  61. package/dist/cjs/{index.esm-2bb721c8.js → index.esm-8123cf40.js} +1 -1
  62. package/dist/cjs/{index.esm-00a6aade.js → index.esm-974f47d9.js} +1 -1
  63. package/dist/cjs/index.js +13 -14
  64. package/dist/cjs/{main-f1c77adb.js → main-025fdc78.js} +3 -3
  65. package/dist/esm/AD.js +7 -7
  66. package/dist/esm/AD300x250.js +6 -6
  67. package/dist/esm/AD300x250x600.js +6 -6
  68. package/dist/esm/AD728x90.js +7 -7
  69. package/dist/esm/ADFloatingFooter.js +9 -9
  70. package/dist/esm/ADFooter.js +6 -6
  71. package/dist/esm/ADGutter.js +9 -9
  72. package/dist/esm/{ADInfeed-4bf3b2f9.js → ADInfeed-28b1e946.js} +5 -5
  73. package/dist/esm/ADSkyscraper.js +9 -9
  74. package/dist/esm/ADSponsoredResources.js +9 -9
  75. package/dist/esm/ADWebcast.js +9 -9
  76. package/dist/esm/ADWelcome.js +13 -13
  77. package/dist/esm/{ADlgInfeed-a3377c4a.js → ADlgInfeed-0b474b02.js} +4 -4
  78. package/dist/esm/AccordionPanel.js +18 -18
  79. package/dist/esm/AdSlot.js +5 -5
  80. package/dist/esm/AdSlotsProvider.js +9 -5
  81. package/dist/esm/AlgoliaSearch.js +247 -224
  82. package/dist/esm/AlphabeticList.js +13 -13
  83. package/dist/esm/ArticleCarousel.js +6 -6
  84. package/dist/esm/ArticleProgramLandingPage.js +17 -17
  85. package/dist/esm/ArticleSeriesLandingPage.js +12 -12
  86. package/dist/esm/ArticleSeriesListing.js +31 -31
  87. package/dist/esm/Auth.js +72 -72
  88. package/dist/esm/AuthWrapper.js +306 -1580
  89. package/dist/esm/{AuthorComponent-30aeba69.js → AuthorComponent-5ae7409f.js} +10 -10
  90. package/dist/esm/{BlockContent-c99c9a8d.js → BlockContent-52cf21c5.js} +3 -3
  91. package/dist/esm/Breadcrumbs.js +11 -11
  92. package/dist/esm/CMEDeck.js +61 -61
  93. package/dist/esm/Column1.js +5 -5
  94. package/dist/esm/Column2.js +12 -12
  95. package/dist/esm/Column3.js +23 -23
  96. package/dist/esm/ConferenceArticleCard.js +13 -13
  97. package/dist/esm/{ConferenceBanner-8792ebd2.js → ConferenceBanner-9162d0ca.js} +4 -4
  98. package/dist/esm/DeckContent.js +49 -49
  99. package/dist/esm/DeckQueue.js +44 -44
  100. package/dist/esm/{Dfp-2c43d2a0.js → Dfp-43f121ff.js} +10 -10
  101. package/dist/esm/EventsDeck.js +64 -64
  102. package/dist/esm/ExternalResources.js +35 -35
  103. package/dist/esm/Feature.js +15 -15
  104. package/dist/esm/ForbesHero.js +26 -26
  105. package/dist/esm/GridContent.js +222 -104
  106. package/dist/esm/GridHero.js +27 -27
  107. package/dist/esm/GroupDeck.js +34 -34
  108. package/dist/esm/HamMagazine.js +86 -86
  109. package/dist/esm/Header.js +8 -8
  110. package/dist/esm/Hero.js +6 -6
  111. package/dist/esm/HighlightenVideo.js +14 -14
  112. package/dist/esm/HorizontalArticleListing.js +31 -31
  113. package/dist/esm/HorizontalHero.js +20 -20
  114. package/dist/esm/IssueContentDeck.js +39 -39
  115. package/dist/esm/IssueDeck.js +33 -33
  116. package/dist/esm/IssueLanding.js +22 -22
  117. package/dist/esm/LeftNav.js +16 -16
  118. package/dist/esm/MasterDeck.js +38 -38
  119. package/dist/esm/MediaSeriesLanding.js +336 -436
  120. package/dist/esm/NavDvm.js +43 -43
  121. package/dist/esm/{NavFooter-e27bd93b.js → NavFooter-c29526b7.js} +12 -12
  122. package/dist/esm/NavMagazine.js +89 -89
  123. package/dist/esm/NavNative.js +77 -77
  124. package/dist/esm/OncliveHero.js +13 -13
  125. package/dist/esm/OncliveLargeHero.js +50 -50
  126. package/dist/esm/PageFilter.js +6 -6
  127. package/dist/esm/PartnerDetailListing.js +62 -62
  128. package/dist/esm/PdfDownload.js +7 -7
  129. package/dist/esm/PopUpModal.js +8 -8
  130. package/dist/esm/PubSection.js +14 -14
  131. package/dist/esm/PubToc.js +5 -5
  132. package/dist/esm/PublicationDeck.js +33 -33
  133. package/dist/esm/PublicationLanding.js +49 -49
  134. package/dist/esm/QueueDeckExpanded.js +246 -246
  135. package/dist/esm/RecentNews.js +18 -18
  136. package/dist/esm/RelatedContent.js +15 -15
  137. package/dist/esm/RelatedTopicsDropdown.js +11 -11
  138. package/dist/esm/RolesDeck.js +13 -13
  139. package/dist/esm/Search.js +5 -5
  140. package/dist/esm/SeriesListingDeck.js +19 -19
  141. package/dist/esm/{SeriesSlider-5d5c08f4.js → SeriesSlider-5c62a578.js} +19 -19
  142. package/dist/esm/SideFooter.js +19 -19
  143. package/dist/esm/SocialIcons.js +7 -7
  144. package/dist/esm/{SocialSearchComponent-db963c3e.js → SocialSearchComponent-cd38ae60.js} +22 -22
  145. package/dist/esm/SocialShare.js +25 -25
  146. package/dist/esm/TaxonomyCard.js +35 -35
  147. package/dist/esm/TaxonomyDescription.js +13 -13
  148. package/dist/esm/TemplateNormal.js +29 -29
  149. package/dist/esm/ThumbnailCard.js +9 -9
  150. package/dist/esm/Ustream.js +18 -18
  151. package/dist/esm/VerticalHero.js +11 -11
  152. package/dist/esm/VideoProgramLandingPage.js +24 -24
  153. package/dist/esm/VideoSeriesCard.js +14 -14
  154. package/dist/esm/VideoSeriesFilter.js +6 -6
  155. package/dist/esm/VideoSeriesLandingPage.js +12 -12
  156. package/dist/esm/VideoSeriesListing.js +51 -49
  157. package/dist/esm/View.js +172 -214
  158. package/dist/esm/YahooHero.js +23 -23
  159. package/dist/esm/YoutubeGroup.js +28 -28
  160. package/dist/esm/{brightcove-react-player-loader.es-57a70a56.js → brightcove-react-player-loader.es-b43c695a.js} +3 -3
  161. package/dist/esm/getSerializers.js +8 -8
  162. package/dist/{cjs/iconBase-be4097c0.js → esm/iconBase-602d52fe.js} +8 -33
  163. package/dist/esm/{index-f0fc23eb.js → index-2446af28.js} +3 -3
  164. package/dist/esm/{index-755f2cc2.js → index-35bdcc81.js} +4 -4
  165. package/dist/esm/{index-01d53c17.js → index-66ffc224.js} +407 -356
  166. package/dist/esm/{index-98ca9cec.js → index-67e1773f.js} +9 -15
  167. package/dist/esm/{index.es-a6137319.js → index.es-c6222053.js} +5 -5
  168. package/dist/esm/{index.esm-f6156a57.js → index.esm-3fdda599.js} +1 -1
  169. package/dist/esm/{index.esm-37268dca.js → index.esm-8016b507.js} +16 -16
  170. package/dist/esm/{index.esm-d4932dea.js → index.esm-a8ff922c.js} +1 -1
  171. package/dist/esm/{index.esm-9b042655.js → index.esm-c6715e80.js} +1 -1
  172. package/dist/esm/index.js +39 -40
  173. package/dist/esm/{main-d4165069.js → main-b5c5aac1.js} +19 -19
  174. package/dist/esm/{react-social-icons-9be47857.js → react-social-icons-91f9716f.js} +5 -5
  175. package/dist/esm/{visibility-sensor-72fd8f8b.js → visibility-sensor-f40c2564.js} +2 -2
  176. package/package.json +1 -1
  177. package/dist/cjs/typeof-1358762e.js +0 -33
  178. package/dist/esm/typeof-2f07d0e8.js +0 -30
  179. /package/dist/cjs/{ADInfeed-859820d9.js → ADInfeed-8b336c67.js} +0 -0
  180. /package/dist/cjs/{ADlgInfeed-da3a36a6.js → ADlgInfeed-aedd5e18.js} +0 -0
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var slicedToArray$1 = require('./slicedToArray-5d1bc3b3.js');
3
+ var slicedToArray = require('./slicedToArray-5d1bc3b3.js');
4
4
  var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
5
- var _typeof = require('./typeof-1358762e.js');
6
5
  var React = require('react');
7
6
  var reactBootstrap = require('react-bootstrap');
8
7
  var styleInject_es = require('./style-inject.es-dcee06b6.js');
@@ -15,998 +14,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
15
14
 
16
15
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
16
 
18
- var interopRequireWildcard = _commonjsHelpers.createCommonjsModule(function (module) {
19
- var _typeof$1 = _typeof._typeof_1["default"];
20
-
21
- function _getRequireWildcardCache(nodeInterop) {
22
- if (typeof WeakMap !== "function") return null;
23
- var cacheBabelInterop = new WeakMap();
24
- var cacheNodeInterop = new WeakMap();
25
- return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
26
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
27
- })(nodeInterop);
28
- }
29
-
30
- function _interopRequireWildcard(obj, nodeInterop) {
31
- if (!nodeInterop && obj && obj.__esModule) {
32
- return obj;
33
- }
34
-
35
- if (obj === null || _typeof$1(obj) !== "object" && typeof obj !== "function") {
36
- return {
37
- "default": obj
38
- };
39
- }
40
-
41
- var cache = _getRequireWildcardCache(nodeInterop);
42
-
43
- if (cache && cache.has(obj)) {
44
- return cache.get(obj);
45
- }
46
-
47
- var newObj = {};
48
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
49
-
50
- for (var key in obj) {
51
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
52
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
53
-
54
- if (desc && (desc.get || desc.set)) {
55
- Object.defineProperty(newObj, key, desc);
56
- } else {
57
- newObj[key] = obj[key];
58
- }
59
- }
60
- }
61
-
62
- newObj["default"] = obj;
63
-
64
- if (cache) {
65
- cache.set(obj, newObj);
66
- }
67
-
68
- return newObj;
69
- }
70
-
71
- module.exports = _interopRequireWildcard;
72
- module.exports["default"] = module.exports, module.exports.__esModule = true;
73
- });
74
-
75
- _commonjsHelpers.unwrapExports(interopRequireWildcard);
76
-
77
- var interopRequireDefault = _commonjsHelpers.createCommonjsModule(function (module) {
78
- function _interopRequireDefault(obj) {
79
- return obj && obj.__esModule ? obj : {
80
- "default": obj
81
- };
82
- }
83
-
84
- module.exports = _interopRequireDefault;
85
- module.exports["default"] = module.exports, module.exports.__esModule = true;
86
- });
87
-
88
- _commonjsHelpers.unwrapExports(interopRequireDefault);
89
-
90
- var runtime_1 = _commonjsHelpers.createCommonjsModule(function (module) {
91
- /**
92
- * Copyright (c) 2014-present, Facebook, Inc.
93
- *
94
- * This source code is licensed under the MIT license found in the
95
- * LICENSE file in the root directory of this source tree.
96
- */
97
-
98
- var runtime = (function (exports) {
99
-
100
- var Op = Object.prototype;
101
- var hasOwn = Op.hasOwnProperty;
102
- var undefined$1; // More compressible than void 0.
103
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
104
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
105
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
106
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
107
-
108
- function define(obj, key, value) {
109
- Object.defineProperty(obj, key, {
110
- value: value,
111
- enumerable: true,
112
- configurable: true,
113
- writable: true
114
- });
115
- return obj[key];
116
- }
117
- try {
118
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
119
- define({}, "");
120
- } catch (err) {
121
- define = function(obj, key, value) {
122
- return obj[key] = value;
123
- };
124
- }
125
-
126
- function wrap(innerFn, outerFn, self, tryLocsList) {
127
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
128
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
129
- var generator = Object.create(protoGenerator.prototype);
130
- var context = new Context(tryLocsList || []);
131
-
132
- // The ._invoke method unifies the implementations of the .next,
133
- // .throw, and .return methods.
134
- generator._invoke = makeInvokeMethod(innerFn, self, context);
135
-
136
- return generator;
137
- }
138
- exports.wrap = wrap;
139
-
140
- // Try/catch helper to minimize deoptimizations. Returns a completion
141
- // record like context.tryEntries[i].completion. This interface could
142
- // have been (and was previously) designed to take a closure to be
143
- // invoked without arguments, but in all the cases we care about we
144
- // already have an existing method we want to call, so there's no need
145
- // to create a new function object. We can even get away with assuming
146
- // the method takes exactly one argument, since that happens to be true
147
- // in every case, so we don't have to touch the arguments object. The
148
- // only additional allocation required is the completion record, which
149
- // has a stable shape and so hopefully should be cheap to allocate.
150
- function tryCatch(fn, obj, arg) {
151
- try {
152
- return { type: "normal", arg: fn.call(obj, arg) };
153
- } catch (err) {
154
- return { type: "throw", arg: err };
155
- }
156
- }
157
-
158
- var GenStateSuspendedStart = "suspendedStart";
159
- var GenStateSuspendedYield = "suspendedYield";
160
- var GenStateExecuting = "executing";
161
- var GenStateCompleted = "completed";
162
-
163
- // Returning this object from the innerFn has the same effect as
164
- // breaking out of the dispatch switch statement.
165
- var ContinueSentinel = {};
166
-
167
- // Dummy constructor functions that we use as the .constructor and
168
- // .constructor.prototype properties for functions that return Generator
169
- // objects. For full spec compliance, you may wish to configure your
170
- // minifier not to mangle the names of these two functions.
171
- function Generator() {}
172
- function GeneratorFunction() {}
173
- function GeneratorFunctionPrototype() {}
174
-
175
- // This is a polyfill for %IteratorPrototype% for environments that
176
- // don't natively support it.
177
- var IteratorPrototype = {};
178
- IteratorPrototype[iteratorSymbol] = function () {
179
- return this;
180
- };
181
-
182
- var getProto = Object.getPrototypeOf;
183
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
184
- if (NativeIteratorPrototype &&
185
- NativeIteratorPrototype !== Op &&
186
- hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
187
- // This environment has a native %IteratorPrototype%; use it instead
188
- // of the polyfill.
189
- IteratorPrototype = NativeIteratorPrototype;
190
- }
191
-
192
- var Gp = GeneratorFunctionPrototype.prototype =
193
- Generator.prototype = Object.create(IteratorPrototype);
194
- GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
195
- GeneratorFunctionPrototype.constructor = GeneratorFunction;
196
- GeneratorFunction.displayName = define(
197
- GeneratorFunctionPrototype,
198
- toStringTagSymbol,
199
- "GeneratorFunction"
200
- );
201
-
202
- // Helper for defining the .next, .throw, and .return methods of the
203
- // Iterator interface in terms of a single ._invoke method.
204
- function defineIteratorMethods(prototype) {
205
- ["next", "throw", "return"].forEach(function(method) {
206
- define(prototype, method, function(arg) {
207
- return this._invoke(method, arg);
208
- });
209
- });
210
- }
211
-
212
- exports.isGeneratorFunction = function(genFun) {
213
- var ctor = typeof genFun === "function" && genFun.constructor;
214
- return ctor
215
- ? ctor === GeneratorFunction ||
216
- // For the native GeneratorFunction constructor, the best we can
217
- // do is to check its .name property.
218
- (ctor.displayName || ctor.name) === "GeneratorFunction"
219
- : false;
220
- };
221
-
222
- exports.mark = function(genFun) {
223
- if (Object.setPrototypeOf) {
224
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
225
- } else {
226
- genFun.__proto__ = GeneratorFunctionPrototype;
227
- define(genFun, toStringTagSymbol, "GeneratorFunction");
228
- }
229
- genFun.prototype = Object.create(Gp);
230
- return genFun;
231
- };
232
-
233
- // Within the body of any async function, `await x` is transformed to
234
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
235
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
236
- // meant to be awaited.
237
- exports.awrap = function(arg) {
238
- return { __await: arg };
239
- };
240
-
241
- function AsyncIterator(generator, PromiseImpl) {
242
- function invoke(method, arg, resolve, reject) {
243
- var record = tryCatch(generator[method], generator, arg);
244
- if (record.type === "throw") {
245
- reject(record.arg);
246
- } else {
247
- var result = record.arg;
248
- var value = result.value;
249
- if (value &&
250
- typeof value === "object" &&
251
- hasOwn.call(value, "__await")) {
252
- return PromiseImpl.resolve(value.__await).then(function(value) {
253
- invoke("next", value, resolve, reject);
254
- }, function(err) {
255
- invoke("throw", err, resolve, reject);
256
- });
257
- }
258
-
259
- return PromiseImpl.resolve(value).then(function(unwrapped) {
260
- // When a yielded Promise is resolved, its final value becomes
261
- // the .value of the Promise<{value,done}> result for the
262
- // current iteration.
263
- result.value = unwrapped;
264
- resolve(result);
265
- }, function(error) {
266
- // If a rejected Promise was yielded, throw the rejection back
267
- // into the async generator function so it can be handled there.
268
- return invoke("throw", error, resolve, reject);
269
- });
270
- }
271
- }
272
-
273
- var previousPromise;
274
-
275
- function enqueue(method, arg) {
276
- function callInvokeWithMethodAndArg() {
277
- return new PromiseImpl(function(resolve, reject) {
278
- invoke(method, arg, resolve, reject);
279
- });
280
- }
281
-
282
- return previousPromise =
283
- // If enqueue has been called before, then we want to wait until
284
- // all previous Promises have been resolved before calling invoke,
285
- // so that results are always delivered in the correct order. If
286
- // enqueue has not been called before, then it is important to
287
- // call invoke immediately, without waiting on a callback to fire,
288
- // so that the async generator function has the opportunity to do
289
- // any necessary setup in a predictable way. This predictability
290
- // is why the Promise constructor synchronously invokes its
291
- // executor callback, and why async functions synchronously
292
- // execute code before the first await. Since we implement simple
293
- // async functions in terms of async generators, it is especially
294
- // important to get this right, even though it requires care.
295
- previousPromise ? previousPromise.then(
296
- callInvokeWithMethodAndArg,
297
- // Avoid propagating failures to Promises returned by later
298
- // invocations of the iterator.
299
- callInvokeWithMethodAndArg
300
- ) : callInvokeWithMethodAndArg();
301
- }
302
-
303
- // Define the unified helper method that is used to implement .next,
304
- // .throw, and .return (see defineIteratorMethods).
305
- this._invoke = enqueue;
306
- }
307
-
308
- defineIteratorMethods(AsyncIterator.prototype);
309
- AsyncIterator.prototype[asyncIteratorSymbol] = function () {
310
- return this;
311
- };
312
- exports.AsyncIterator = AsyncIterator;
313
-
314
- // Note that simple async functions are implemented on top of
315
- // AsyncIterator objects; they just return a Promise for the value of
316
- // the final result produced by the iterator.
317
- exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
318
- if (PromiseImpl === void 0) PromiseImpl = Promise;
319
-
320
- var iter = new AsyncIterator(
321
- wrap(innerFn, outerFn, self, tryLocsList),
322
- PromiseImpl
323
- );
324
-
325
- return exports.isGeneratorFunction(outerFn)
326
- ? iter // If outerFn is a generator, return the full iterator.
327
- : iter.next().then(function(result) {
328
- return result.done ? result.value : iter.next();
329
- });
330
- };
331
-
332
- function makeInvokeMethod(innerFn, self, context) {
333
- var state = GenStateSuspendedStart;
334
-
335
- return function invoke(method, arg) {
336
- if (state === GenStateExecuting) {
337
- throw new Error("Generator is already running");
338
- }
339
-
340
- if (state === GenStateCompleted) {
341
- if (method === "throw") {
342
- throw arg;
343
- }
344
-
345
- // Be forgiving, per 25.3.3.3.3 of the spec:
346
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
347
- return doneResult();
348
- }
349
-
350
- context.method = method;
351
- context.arg = arg;
352
-
353
- while (true) {
354
- var delegate = context.delegate;
355
- if (delegate) {
356
- var delegateResult = maybeInvokeDelegate(delegate, context);
357
- if (delegateResult) {
358
- if (delegateResult === ContinueSentinel) continue;
359
- return delegateResult;
360
- }
361
- }
362
-
363
- if (context.method === "next") {
364
- // Setting context._sent for legacy support of Babel's
365
- // function.sent implementation.
366
- context.sent = context._sent = context.arg;
367
-
368
- } else if (context.method === "throw") {
369
- if (state === GenStateSuspendedStart) {
370
- state = GenStateCompleted;
371
- throw context.arg;
372
- }
373
-
374
- context.dispatchException(context.arg);
375
-
376
- } else if (context.method === "return") {
377
- context.abrupt("return", context.arg);
378
- }
379
-
380
- state = GenStateExecuting;
381
-
382
- var record = tryCatch(innerFn, self, context);
383
- if (record.type === "normal") {
384
- // If an exception is thrown from innerFn, we leave state ===
385
- // GenStateExecuting and loop back for another invocation.
386
- state = context.done
387
- ? GenStateCompleted
388
- : GenStateSuspendedYield;
389
-
390
- if (record.arg === ContinueSentinel) {
391
- continue;
392
- }
393
-
394
- return {
395
- value: record.arg,
396
- done: context.done
397
- };
398
-
399
- } else if (record.type === "throw") {
400
- state = GenStateCompleted;
401
- // Dispatch the exception by looping back around to the
402
- // context.dispatchException(context.arg) call above.
403
- context.method = "throw";
404
- context.arg = record.arg;
405
- }
406
- }
407
- };
408
- }
409
-
410
- // Call delegate.iterator[context.method](context.arg) and handle the
411
- // result, either by returning a { value, done } result from the
412
- // delegate iterator, or by modifying context.method and context.arg,
413
- // setting context.delegate to null, and returning the ContinueSentinel.
414
- function maybeInvokeDelegate(delegate, context) {
415
- var method = delegate.iterator[context.method];
416
- if (method === undefined$1) {
417
- // A .throw or .return when the delegate iterator has no .throw
418
- // method always terminates the yield* loop.
419
- context.delegate = null;
420
-
421
- if (context.method === "throw") {
422
- // Note: ["return"] must be used for ES3 parsing compatibility.
423
- if (delegate.iterator["return"]) {
424
- // If the delegate iterator has a return method, give it a
425
- // chance to clean up.
426
- context.method = "return";
427
- context.arg = undefined$1;
428
- maybeInvokeDelegate(delegate, context);
429
-
430
- if (context.method === "throw") {
431
- // If maybeInvokeDelegate(context) changed context.method from
432
- // "return" to "throw", let that override the TypeError below.
433
- return ContinueSentinel;
434
- }
435
- }
436
-
437
- context.method = "throw";
438
- context.arg = new TypeError(
439
- "The iterator does not provide a 'throw' method");
440
- }
441
-
442
- return ContinueSentinel;
443
- }
444
-
445
- var record = tryCatch(method, delegate.iterator, context.arg);
446
-
447
- if (record.type === "throw") {
448
- context.method = "throw";
449
- context.arg = record.arg;
450
- context.delegate = null;
451
- return ContinueSentinel;
452
- }
453
-
454
- var info = record.arg;
455
-
456
- if (! info) {
457
- context.method = "throw";
458
- context.arg = new TypeError("iterator result is not an object");
459
- context.delegate = null;
460
- return ContinueSentinel;
461
- }
462
-
463
- if (info.done) {
464
- // Assign the result of the finished delegate to the temporary
465
- // variable specified by delegate.resultName (see delegateYield).
466
- context[delegate.resultName] = info.value;
467
-
468
- // Resume execution at the desired location (see delegateYield).
469
- context.next = delegate.nextLoc;
470
-
471
- // If context.method was "throw" but the delegate handled the
472
- // exception, let the outer generator proceed normally. If
473
- // context.method was "next", forget context.arg since it has been
474
- // "consumed" by the delegate iterator. If context.method was
475
- // "return", allow the original .return call to continue in the
476
- // outer generator.
477
- if (context.method !== "return") {
478
- context.method = "next";
479
- context.arg = undefined$1;
480
- }
481
-
482
- } else {
483
- // Re-yield the result returned by the delegate method.
484
- return info;
485
- }
486
-
487
- // The delegate iterator is finished, so forget it and continue with
488
- // the outer generator.
489
- context.delegate = null;
490
- return ContinueSentinel;
491
- }
492
-
493
- // Define Generator.prototype.{next,throw,return} in terms of the
494
- // unified ._invoke helper method.
495
- defineIteratorMethods(Gp);
496
-
497
- define(Gp, toStringTagSymbol, "Generator");
498
-
499
- // A Generator should always return itself as the iterator object when the
500
- // @@iterator function is called on it. Some browsers' implementations of the
501
- // iterator prototype chain incorrectly implement this, causing the Generator
502
- // object to not be returned from this call. This ensures that doesn't happen.
503
- // See https://github.com/facebook/regenerator/issues/274 for more details.
504
- Gp[iteratorSymbol] = function() {
505
- return this;
506
- };
507
-
508
- Gp.toString = function() {
509
- return "[object Generator]";
510
- };
511
-
512
- function pushTryEntry(locs) {
513
- var entry = { tryLoc: locs[0] };
514
-
515
- if (1 in locs) {
516
- entry.catchLoc = locs[1];
517
- }
518
-
519
- if (2 in locs) {
520
- entry.finallyLoc = locs[2];
521
- entry.afterLoc = locs[3];
522
- }
523
-
524
- this.tryEntries.push(entry);
525
- }
526
-
527
- function resetTryEntry(entry) {
528
- var record = entry.completion || {};
529
- record.type = "normal";
530
- delete record.arg;
531
- entry.completion = record;
532
- }
533
-
534
- function Context(tryLocsList) {
535
- // The root entry object (effectively a try statement without a catch
536
- // or a finally block) gives us a place to store values thrown from
537
- // locations where there is no enclosing try statement.
538
- this.tryEntries = [{ tryLoc: "root" }];
539
- tryLocsList.forEach(pushTryEntry, this);
540
- this.reset(true);
541
- }
542
-
543
- exports.keys = function(object) {
544
- var keys = [];
545
- for (var key in object) {
546
- keys.push(key);
547
- }
548
- keys.reverse();
549
-
550
- // Rather than returning an object with a next method, we keep
551
- // things simple and return the next function itself.
552
- return function next() {
553
- while (keys.length) {
554
- var key = keys.pop();
555
- if (key in object) {
556
- next.value = key;
557
- next.done = false;
558
- return next;
559
- }
560
- }
561
-
562
- // To avoid creating an additional object, we just hang the .value
563
- // and .done properties off the next function object itself. This
564
- // also ensures that the minifier will not anonymize the function.
565
- next.done = true;
566
- return next;
567
- };
568
- };
569
-
570
- function values(iterable) {
571
- if (iterable) {
572
- var iteratorMethod = iterable[iteratorSymbol];
573
- if (iteratorMethod) {
574
- return iteratorMethod.call(iterable);
575
- }
576
-
577
- if (typeof iterable.next === "function") {
578
- return iterable;
579
- }
580
-
581
- if (!isNaN(iterable.length)) {
582
- var i = -1, next = function next() {
583
- while (++i < iterable.length) {
584
- if (hasOwn.call(iterable, i)) {
585
- next.value = iterable[i];
586
- next.done = false;
587
- return next;
588
- }
589
- }
590
-
591
- next.value = undefined$1;
592
- next.done = true;
593
-
594
- return next;
595
- };
596
-
597
- return next.next = next;
598
- }
599
- }
600
-
601
- // Return an iterator with no values.
602
- return { next: doneResult };
603
- }
604
- exports.values = values;
605
-
606
- function doneResult() {
607
- return { value: undefined$1, done: true };
608
- }
609
-
610
- Context.prototype = {
611
- constructor: Context,
612
-
613
- reset: function(skipTempReset) {
614
- this.prev = 0;
615
- this.next = 0;
616
- // Resetting context._sent for legacy support of Babel's
617
- // function.sent implementation.
618
- this.sent = this._sent = undefined$1;
619
- this.done = false;
620
- this.delegate = null;
621
-
622
- this.method = "next";
623
- this.arg = undefined$1;
624
-
625
- this.tryEntries.forEach(resetTryEntry);
626
-
627
- if (!skipTempReset) {
628
- for (var name in this) {
629
- // Not sure about the optimal order of these conditions:
630
- if (name.charAt(0) === "t" &&
631
- hasOwn.call(this, name) &&
632
- !isNaN(+name.slice(1))) {
633
- this[name] = undefined$1;
634
- }
635
- }
636
- }
637
- },
638
-
639
- stop: function() {
640
- this.done = true;
641
-
642
- var rootEntry = this.tryEntries[0];
643
- var rootRecord = rootEntry.completion;
644
- if (rootRecord.type === "throw") {
645
- throw rootRecord.arg;
646
- }
647
-
648
- return this.rval;
649
- },
650
-
651
- dispatchException: function(exception) {
652
- if (this.done) {
653
- throw exception;
654
- }
655
-
656
- var context = this;
657
- function handle(loc, caught) {
658
- record.type = "throw";
659
- record.arg = exception;
660
- context.next = loc;
661
-
662
- if (caught) {
663
- // If the dispatched exception was caught by a catch block,
664
- // then let that catch block handle the exception normally.
665
- context.method = "next";
666
- context.arg = undefined$1;
667
- }
668
-
669
- return !! caught;
670
- }
671
-
672
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
673
- var entry = this.tryEntries[i];
674
- var record = entry.completion;
675
-
676
- if (entry.tryLoc === "root") {
677
- // Exception thrown outside of any try block that could handle
678
- // it, so set the completion value of the entire function to
679
- // throw the exception.
680
- return handle("end");
681
- }
682
-
683
- if (entry.tryLoc <= this.prev) {
684
- var hasCatch = hasOwn.call(entry, "catchLoc");
685
- var hasFinally = hasOwn.call(entry, "finallyLoc");
686
-
687
- if (hasCatch && hasFinally) {
688
- if (this.prev < entry.catchLoc) {
689
- return handle(entry.catchLoc, true);
690
- } else if (this.prev < entry.finallyLoc) {
691
- return handle(entry.finallyLoc);
692
- }
693
-
694
- } else if (hasCatch) {
695
- if (this.prev < entry.catchLoc) {
696
- return handle(entry.catchLoc, true);
697
- }
698
-
699
- } else if (hasFinally) {
700
- if (this.prev < entry.finallyLoc) {
701
- return handle(entry.finallyLoc);
702
- }
703
-
704
- } else {
705
- throw new Error("try statement without catch or finally");
706
- }
707
- }
708
- }
709
- },
710
-
711
- abrupt: function(type, arg) {
712
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
713
- var entry = this.tryEntries[i];
714
- if (entry.tryLoc <= this.prev &&
715
- hasOwn.call(entry, "finallyLoc") &&
716
- this.prev < entry.finallyLoc) {
717
- var finallyEntry = entry;
718
- break;
719
- }
720
- }
721
-
722
- if (finallyEntry &&
723
- (type === "break" ||
724
- type === "continue") &&
725
- finallyEntry.tryLoc <= arg &&
726
- arg <= finallyEntry.finallyLoc) {
727
- // Ignore the finally entry if control is not jumping to a
728
- // location outside the try/catch block.
729
- finallyEntry = null;
730
- }
731
-
732
- var record = finallyEntry ? finallyEntry.completion : {};
733
- record.type = type;
734
- record.arg = arg;
735
-
736
- if (finallyEntry) {
737
- this.method = "next";
738
- this.next = finallyEntry.finallyLoc;
739
- return ContinueSentinel;
740
- }
741
-
742
- return this.complete(record);
743
- },
744
-
745
- complete: function(record, afterLoc) {
746
- if (record.type === "throw") {
747
- throw record.arg;
748
- }
749
-
750
- if (record.type === "break" ||
751
- record.type === "continue") {
752
- this.next = record.arg;
753
- } else if (record.type === "return") {
754
- this.rval = this.arg = record.arg;
755
- this.method = "return";
756
- this.next = "end";
757
- } else if (record.type === "normal" && afterLoc) {
758
- this.next = afterLoc;
759
- }
760
-
761
- return ContinueSentinel;
762
- },
763
-
764
- finish: function(finallyLoc) {
765
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
766
- var entry = this.tryEntries[i];
767
- if (entry.finallyLoc === finallyLoc) {
768
- this.complete(entry.completion, entry.afterLoc);
769
- resetTryEntry(entry);
770
- return ContinueSentinel;
771
- }
772
- }
773
- },
774
-
775
- "catch": function(tryLoc) {
776
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
777
- var entry = this.tryEntries[i];
778
- if (entry.tryLoc === tryLoc) {
779
- var record = entry.completion;
780
- if (record.type === "throw") {
781
- var thrown = record.arg;
782
- resetTryEntry(entry);
783
- }
784
- return thrown;
785
- }
786
- }
787
-
788
- // The context.catch method must only be called with a location
789
- // argument that corresponds to a known catch block.
790
- throw new Error("illegal catch attempt");
791
- },
792
-
793
- delegateYield: function(iterable, resultName, nextLoc) {
794
- this.delegate = {
795
- iterator: values(iterable),
796
- resultName: resultName,
797
- nextLoc: nextLoc
798
- };
799
-
800
- if (this.method === "next") {
801
- // Deliberately forget the last sent value so that we don't
802
- // accidentally pass it on to the delegate.
803
- this.arg = undefined$1;
804
- }
805
-
806
- return ContinueSentinel;
807
- }
808
- };
809
-
810
- // Regardless of whether this script is executing as a CommonJS module
811
- // or not, return the runtime object so that we can declare the variable
812
- // regeneratorRuntime in the outer scope, which allows this module to be
813
- // injected easily by `bin/regenerator --include-runtime script.js`.
814
- return exports;
815
-
816
- }(
817
- // If this script is executing as a CommonJS module, use module.exports
818
- // as the regeneratorRuntime namespace. Otherwise create a new empty
819
- // object. Either way, the resulting object will be used to initialize
820
- // the regeneratorRuntime variable at the top of this file.
821
- module.exports
822
- ));
823
-
824
- try {
825
- regeneratorRuntime = runtime;
826
- } catch (accidentalStrictMode) {
827
- // This module should not be running in strict mode, so the above
828
- // assignment should always work unless something is misconfigured. Just
829
- // in case runtime.js accidentally runs in strict mode, we can escape
830
- // strict mode using a global Function call. This could conceivably fail
831
- // if a Content Security Policy forbids using Function, but in that case
832
- // the proper solution is to fix the accidental strict mode problem. If
833
- // you've misconfigured your bundler to force strict mode and applied a
834
- // CSP to forbid Function, and you're not willing to fix either of those
835
- // problems, please detail your unique predicament in a GitHub issue.
836
- Function("r", "regeneratorRuntime = r")(runtime);
837
- }
838
- });
839
-
840
- var regenerator = runtime_1;
841
-
842
- var defineProperty = _commonjsHelpers.createCommonjsModule(function (module) {
843
- function _defineProperty(obj, key, value) {
844
- if (key in obj) {
845
- Object.defineProperty(obj, key, {
846
- value: value,
847
- enumerable: true,
848
- configurable: true,
849
- writable: true
850
- });
851
- } else {
852
- obj[key] = value;
853
- }
854
-
855
- return obj;
856
- }
857
-
858
- module.exports = _defineProperty;
859
- module.exports["default"] = module.exports, module.exports.__esModule = true;
860
- });
861
-
862
- _commonjsHelpers.unwrapExports(defineProperty);
863
-
864
- var asyncToGenerator = _commonjsHelpers.createCommonjsModule(function (module) {
865
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
866
- try {
867
- var info = gen[key](arg);
868
- var value = info.value;
869
- } catch (error) {
870
- reject(error);
871
- return;
872
- }
873
-
874
- if (info.done) {
875
- resolve(value);
876
- } else {
877
- Promise.resolve(value).then(_next, _throw);
878
- }
879
- }
880
-
881
- function _asyncToGenerator(fn) {
882
- return function () {
883
- var self = this,
884
- args = arguments;
885
- return new Promise(function (resolve, reject) {
886
- var gen = fn.apply(self, args);
887
-
888
- function _next(value) {
889
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
890
- }
891
-
892
- function _throw(err) {
893
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
894
- }
895
-
896
- _next(undefined);
897
- });
898
- };
899
- }
900
-
901
- module.exports = _asyncToGenerator;
902
- module.exports["default"] = module.exports, module.exports.__esModule = true;
903
- });
904
-
905
- _commonjsHelpers.unwrapExports(asyncToGenerator);
906
-
907
- var arrayWithHoles = _commonjsHelpers.createCommonjsModule(function (module) {
908
- function _arrayWithHoles(arr) {
909
- if (Array.isArray(arr)) return arr;
910
- }
911
-
912
- module.exports = _arrayWithHoles;
913
- module.exports["default"] = module.exports, module.exports.__esModule = true;
914
- });
915
-
916
- _commonjsHelpers.unwrapExports(arrayWithHoles);
917
-
918
- var iterableToArrayLimit = _commonjsHelpers.createCommonjsModule(function (module) {
919
- function _iterableToArrayLimit(arr, i) {
920
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
921
-
922
- if (_i == null) return;
923
- var _arr = [];
924
- var _n = true;
925
- var _d = false;
926
-
927
- var _s, _e;
928
-
929
- try {
930
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
931
- _arr.push(_s.value);
932
-
933
- if (i && _arr.length === i) break;
934
- }
935
- } catch (err) {
936
- _d = true;
937
- _e = err;
938
- } finally {
939
- try {
940
- if (!_n && _i["return"] != null) _i["return"]();
941
- } finally {
942
- if (_d) throw _e;
943
- }
944
- }
945
-
946
- return _arr;
947
- }
948
-
949
- module.exports = _iterableToArrayLimit;
950
- module.exports["default"] = module.exports, module.exports.__esModule = true;
951
- });
952
-
953
- _commonjsHelpers.unwrapExports(iterableToArrayLimit);
954
-
955
- var arrayLikeToArray = _commonjsHelpers.createCommonjsModule(function (module) {
956
- function _arrayLikeToArray(arr, len) {
957
- if (len == null || len > arr.length) len = arr.length;
958
-
959
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
960
- arr2[i] = arr[i];
961
- }
962
-
963
- return arr2;
964
- }
965
-
966
- module.exports = _arrayLikeToArray;
967
- module.exports["default"] = module.exports, module.exports.__esModule = true;
968
- });
969
-
970
- _commonjsHelpers.unwrapExports(arrayLikeToArray);
971
-
972
- var unsupportedIterableToArray = _commonjsHelpers.createCommonjsModule(function (module) {
973
- function _unsupportedIterableToArray(o, minLen) {
974
- if (!o) return;
975
- if (typeof o === "string") return arrayLikeToArray(o, minLen);
976
- var n = Object.prototype.toString.call(o).slice(8, -1);
977
- if (n === "Object" && o.constructor) n = o.constructor.name;
978
- if (n === "Map" || n === "Set") return Array.from(o);
979
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
980
- }
981
-
982
- module.exports = _unsupportedIterableToArray;
983
- module.exports["default"] = module.exports, module.exports.__esModule = true;
984
- });
985
-
986
- _commonjsHelpers.unwrapExports(unsupportedIterableToArray);
987
-
988
- var nonIterableRest = _commonjsHelpers.createCommonjsModule(function (module) {
989
- function _nonIterableRest() {
990
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
991
- }
992
-
993
- module.exports = _nonIterableRest;
994
- module.exports["default"] = module.exports, module.exports.__esModule = true;
995
- });
996
-
997
- _commonjsHelpers.unwrapExports(nonIterableRest);
998
-
999
- var slicedToArray = _commonjsHelpers.createCommonjsModule(function (module) {
1000
- function _slicedToArray(arr, i) {
1001
- return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
1002
- }
1003
-
1004
- module.exports = _slicedToArray;
1005
- module.exports["default"] = module.exports, module.exports.__esModule = true;
1006
- });
1007
-
1008
- _commonjsHelpers.unwrapExports(slicedToArray);
1009
-
1010
17
  var logger = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1011
18
 
1012
19
  Object.defineProperty(exports, "__esModule", {
@@ -1015,25 +22,39 @@ Object.defineProperty(exports, "__esModule", {
1015
22
  exports.setLogger = setLogger;
1016
23
  exports.proxyLogger = proxyLogger;
1017
24
  exports.default = void 0;
1018
- const _logger = {
1019
- error(code, ...message) {
1020
- console.error(`[next-auth][error][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/errors#${code.toLowerCase()}`, ...message);
25
+ var _logger = {
26
+ error(code) {
27
+ for (var _len = arguments.length, message = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
28
+ message[_key - 1] = arguments[_key];
29
+ }
30
+
31
+ console.error("[next-auth][error][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/errors#".concat(code.toLowerCase()), ...message);
1021
32
  },
1022
33
 
1023
- warn(code, ...message) {
1024
- console.warn(`[next-auth][warn][${code.toLowerCase()}]`, `\nhttps://next-auth.js.org/warnings#${code.toLowerCase()}`, ...message);
34
+ warn(code) {
35
+ for (var _len2 = arguments.length, message = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
36
+ message[_key2 - 1] = arguments[_key2];
37
+ }
38
+
39
+ console.warn("[next-auth][warn][".concat(code.toLowerCase(), "]"), "\nhttps://next-auth.js.org/warnings#".concat(code.toLowerCase()), ...message);
1025
40
  },
1026
41
 
1027
- debug(code, ...message) {
42
+ debug(code) {
1028
43
  var _process, _process$env;
1029
44
 
1030
45
  if (!((_process = process) !== null && _process !== void 0 && (_process$env = _process.env) !== null && _process$env !== void 0 && _process$env._NEXTAUTH_DEBUG)) return;
1031
- console.log(`[next-auth][debug][${code.toLowerCase()}]`, ...message);
46
+
47
+ for (var _len3 = arguments.length, message = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
48
+ message[_key3 - 1] = arguments[_key3];
49
+ }
50
+
51
+ console.log("[next-auth][debug][".concat(code.toLowerCase(), "]"), ...message);
1032
52
  }
1033
53
 
1034
54
  };
1035
55
 
1036
- function setLogger(newLogger = {}) {
56
+ function setLogger() {
57
+ var newLogger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1037
58
  if (newLogger.error) _logger.error = newLogger.error;
1038
59
  if (newLogger.warn) _logger.warn = newLogger.warn;
1039
60
  if (newLogger.debug) _logger.debug = newLogger.debug;
@@ -1042,20 +63,27 @@ function setLogger(newLogger = {}) {
1042
63
  var _default = _logger;
1043
64
  exports.default = _default;
1044
65
 
1045
- function proxyLogger(logger = _logger, basePath) {
66
+ function proxyLogger() {
67
+ var logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _logger;
68
+ var basePath = arguments.length > 1 ? arguments[1] : undefined;
69
+
1046
70
  try {
1047
- if (typeof window === "undefined") {
71
+ if (typeof window === 'undefined') {
1048
72
  return logger;
1049
73
  }
1050
74
 
1051
- const clientLogger = {};
75
+ var clientLogger = {};
76
+
77
+ var _loop = function _loop(level) {
78
+ clientLogger[level] = function (code) {
79
+ for (var _len4 = arguments.length, message = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
80
+ message[_key4 - 1] = arguments[_key4];
81
+ }
1052
82
 
1053
- for (const level in logger) {
1054
- clientLogger[level] = (code, ...message) => {
1055
83
  _logger[level](code, ...message);
1056
84
 
1057
- const url = `${basePath}/_log`;
1058
- const body = new URLSearchParams({
85
+ var url = "".concat(basePath, "/_log");
86
+ var body = new URLSearchParams({
1059
87
  level,
1060
88
  code,
1061
89
  message: JSON.stringify(message.map(m => {
@@ -1076,17 +104,21 @@ function proxyLogger(logger = _logger, basePath) {
1076
104
  }
1077
105
 
1078
106
  return fetch(url, {
1079
- method: "POST",
107
+ method: 'POST',
1080
108
  headers: {
1081
- "Content-Type": "application/json"
109
+ 'Content-Type': 'application/json'
1082
110
  },
1083
111
  body
1084
112
  });
1085
113
  };
114
+ };
115
+
116
+ for (var level in logger) {
117
+ _loop(level);
1086
118
  }
1087
119
 
1088
120
  return clientLogger;
1089
- } catch {
121
+ } catch (_unused) {
1090
122
  return _logger;
1091
123
  }
1092
124
  }
@@ -1104,18 +136,18 @@ Object.defineProperty(exports, "__esModule", {
1104
136
  exports.default = parseUrl;
1105
137
 
1106
138
  function parseUrl(url) {
1107
- const defaultHost = 'http://localhost:3000';
1108
- const defaultPath = '/api/auth';
139
+ var defaultHost = 'http://localhost:3000';
140
+ var defaultPath = '/api/auth';
1109
141
 
1110
142
  if (!url) {
1111
- url = `${defaultHost}${defaultPath}`;
143
+ url = "".concat(defaultHost).concat(defaultPath);
1112
144
  }
1113
145
 
1114
- const protocol = url.startsWith('http:') ? 'http' : 'https';
146
+ var protocol = url.startsWith('http:') ? 'http' : 'https';
1115
147
  url = url.replace(/^https?:\/\//, '').replace(/\/$/, '');
1116
- const [_host, ..._path] = url.split('/');
1117
- const baseUrl = _host ? `${protocol}://${_host}` : defaultHost;
1118
- const basePath = _path.length > 0 ? `/${_path.join('/')}` : defaultPath;
148
+ var [_host, ..._path] = url.split('/');
149
+ var baseUrl = _host ? "".concat(protocol, "://").concat(_host) : defaultHost;
150
+ var basePath = _path.length > 0 ? "/".concat(_path.join('/')) : defaultPath;
1119
151
  return {
1120
152
  baseUrl,
1121
153
  basePath
@@ -1127,40 +159,39 @@ _commonjsHelpers.unwrapExports(parseUrl_1);
1127
159
 
1128
160
  var client$1 = _commonjsHelpers.createCommonjsModule(function (module, exports) {
1129
161
 
1130
-
1131
-
1132
-
1133
-
1134
162
  Object.defineProperty(exports, "__esModule", {
1135
163
  value: true
1136
164
  });
1137
165
  exports.useSession = useSession;
1138
- exports.session = exports.getSession = getSession;
1139
- exports.csrfToken = exports.getCsrfToken = getCsrfToken;
1140
- exports.providers = exports.getProviders = getProviders;
1141
- exports.signin = exports.signIn = signIn;
1142
- exports.signout = exports.signOut = signOut;
1143
- exports.options = exports.setOptions = setOptions;
166
+ exports.getSession = getSession;
167
+ exports.getProviders = getProviders;
168
+ exports.signIn = signIn;
169
+ exports.signOut = signOut;
170
+ exports.setOptions = setOptions;
1144
171
  exports.Provider = Provider;
1145
172
  exports.default = void 0;
1146
173
 
1147
- var _regenerator = interopRequireDefault(regenerator);
1148
174
 
1149
- var _defineProperty2 = interopRequireDefault(defineProperty);
1150
175
 
1151
- var _asyncToGenerator2 = interopRequireDefault(asyncToGenerator);
176
+ var _logger2 = _interopRequireWildcard(logger);
1152
177
 
1153
- var _slicedToArray2 = interopRequireDefault(slicedToArray);
178
+ var _parseUrl = _interopRequireDefault(parseUrl_1);
1154
179
 
180
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1155
181
 
182
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
1156
183
 
1157
- var _logger2 = interopRequireWildcard(logger);
1158
-
1159
- var _parseUrl = interopRequireDefault(parseUrl_1);
184
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1160
185
 
1161
186
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1162
187
 
1163
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
188
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
189
+
190
+ 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; }
191
+
192
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
193
+
194
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1164
195
 
1165
196
  var __NEXTAUTH = {
1166
197
  baseUrl: (0, _parseUrl.default)(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).baseUrl,
@@ -1173,19 +204,17 @@ var __NEXTAUTH = {
1173
204
  _clientSyncTimer: null,
1174
205
  _eventListenersAdded: false,
1175
206
  _clientSession: undefined,
1176
- _getSession: function _getSession() {}
207
+ _getSession: () => {}
1177
208
  };
1178
209
  var logger$1 = (0, _logger2.proxyLogger)(_logger2.default, __NEXTAUTH.basePath);
1179
210
  var broadcast = BroadcastChannel();
1180
211
 
1181
212
  if (typeof window !== 'undefined' && !__NEXTAUTH._eventListenersAdded) {
1182
213
  __NEXTAUTH._eventListenersAdded = true;
1183
- broadcast.receive(function () {
1184
- return __NEXTAUTH._getSession({
1185
- event: 'storage'
1186
- });
1187
- });
1188
- document.addEventListener('visibilitychange', function () {
214
+ broadcast.receive(() => __NEXTAUTH._getSession({
215
+ event: 'storage'
216
+ }));
217
+ document.addEventListener('visibilitychange', () => {
1189
218
  !document.hidden && __NEXTAUTH._getSession({
1190
219
  event: 'visibilitychange'
1191
220
  });
@@ -1201,103 +230,50 @@ function useSession(session) {
1201
230
  }
1202
231
 
1203
232
  function _useSessionHook(session) {
1204
- var _useState = (0, React__default['default'].useState)(session),
1205
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
1206
- data = _useState2[0],
1207
- setData = _useState2[1];
1208
-
1209
- var _useState3 = (0, React__default['default'].useState)(!data),
1210
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
1211
- loading = _useState4[0],
1212
- setLoading = _useState4[1];
1213
-
1214
- (0, React__default['default'].useEffect)(function () {
1215
- __NEXTAUTH._getSession = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee() {
1216
- var _ref2,
1217
- _ref2$event,
1218
- event,
1219
- triggredByEvent,
1220
- triggeredByStorageEvent,
1221
- clientMaxAge,
1222
- clientLastSync,
1223
- currentTime,
1224
- clientSession,
1225
- newClientSessionData,
1226
- _args = arguments;
1227
-
1228
- return _regenerator.default.wrap(function _callee$(_context) {
1229
- while (1) {
1230
- switch (_context.prev = _context.next) {
1231
- case 0:
1232
- _ref2 = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}, _ref2$event = _ref2.event, event = _ref2$event === void 0 ? null : _ref2$event;
1233
- _context.prev = 1;
1234
- triggredByEvent = event !== null;
1235
- triggeredByStorageEvent = event === 'storage';
1236
- clientMaxAge = __NEXTAUTH.clientMaxAge;
1237
- clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
1238
- currentTime = _now();
1239
- clientSession = __NEXTAUTH._clientSession;
1240
-
1241
- if (!(!triggeredByStorageEvent && clientSession !== undefined)) {
1242
- _context.next = 19;
1243
- break;
1244
- }
1245
-
1246
- if (!(clientMaxAge === 0 && triggredByEvent !== true)) {
1247
- _context.next = 13;
1248
- break;
1249
- }
1250
-
1251
- return _context.abrupt("return");
1252
-
1253
- case 13:
1254
- if (!(clientMaxAge > 0 && clientSession === null)) {
1255
- _context.next = 17;
1256
- break;
1257
- }
1258
-
1259
- return _context.abrupt("return");
1260
-
1261
- case 17:
1262
- if (!(clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge)) {
1263
- _context.next = 19;
1264
- break;
1265
- }
1266
-
1267
- return _context.abrupt("return");
1268
-
1269
- case 19:
1270
- if (clientSession === undefined) {
1271
- __NEXTAUTH._clientSession = null;
1272
- }
1273
-
1274
- __NEXTAUTH._clientLastSync = _now();
1275
- _context.next = 23;
1276
- return getSession({
1277
- triggerEvent: !triggeredByStorageEvent
1278
- });
1279
-
1280
- case 23:
1281
- newClientSessionData = _context.sent;
1282
- __NEXTAUTH._clientSession = newClientSessionData;
1283
- setData(newClientSessionData);
1284
- setLoading(false);
1285
- _context.next = 33;
1286
- break;
1287
-
1288
- case 29:
1289
- _context.prev = 29;
1290
- _context.t0 = _context["catch"](1);
1291
- logger$1.error('CLIENT_USE_SESSION_ERROR', _context.t0);
1292
- setLoading(false);
1293
-
1294
- case 33:
1295
- case "end":
1296
- return _context.stop();
233
+ var [data, setData] = (0, React__default['default'].useState)(session);
234
+ var [loading, setLoading] = (0, React__default['default'].useState)(!data);
235
+ (0, React__default['default'].useEffect)(() => {
236
+ __NEXTAUTH._getSession = _asyncToGenerator(function* () {
237
+ var {
238
+ event = null
239
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
240
+
241
+ try {
242
+ var triggredByEvent = event !== null;
243
+ var triggeredByStorageEvent = event === 'storage';
244
+ var clientMaxAge = __NEXTAUTH.clientMaxAge;
245
+ var clientLastSync = parseInt(__NEXTAUTH._clientLastSync);
246
+
247
+ var currentTime = _now();
248
+
249
+ var clientSession = __NEXTAUTH._clientSession;
250
+
251
+ if (!triggeredByStorageEvent && clientSession !== undefined) {
252
+ if (clientMaxAge === 0 && triggredByEvent !== true) {
253
+ return;
254
+ } else if (clientMaxAge > 0 && clientSession === null) {
255
+ return;
256
+ } else if (clientMaxAge > 0 && currentTime < clientLastSync + clientMaxAge) {
257
+ return;
1297
258
  }
1298
259
  }
1299
- }, _callee, null, [[1, 29]]);
1300
- }));
260
+
261
+ if (clientSession === undefined) {
262
+ __NEXTAUTH._clientSession = null;
263
+ }
264
+
265
+ __NEXTAUTH._clientLastSync = _now();
266
+ var newClientSessionData = yield getSession({
267
+ triggerEvent: !triggeredByStorageEvent
268
+ });
269
+ __NEXTAUTH._clientSession = newClientSessionData;
270
+ setData(newClientSessionData);
271
+ setLoading(false);
272
+ } catch (error) {
273
+ logger$1.error('CLIENT_USE_SESSION_ERROR', error);
274
+ setLoading(false);
275
+ }
276
+ });
1301
277
 
1302
278
  __NEXTAUTH._getSession();
1303
279
  });
@@ -1309,38 +285,22 @@ function getSession(_x) {
1309
285
  }
1310
286
 
1311
287
  function _getSession2() {
1312
- _getSession2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(ctx) {
288
+ _getSession2 = _asyncToGenerator(function* (ctx) {
1313
289
  var _ctx$triggerEvent;
1314
290
 
1315
- var session;
1316
- return _regenerator.default.wrap(function _callee4$(_context4) {
1317
- while (1) {
1318
- switch (_context4.prev = _context4.next) {
1319
- case 0:
1320
- _context4.next = 2;
1321
- return _fetchData('session', ctx);
1322
-
1323
- case 2:
1324
- session = _context4.sent;
1325
-
1326
- if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
1327
- broadcast.post({
1328
- event: 'session',
1329
- data: {
1330
- trigger: 'getSession'
1331
- }
1332
- });
1333
- }
291
+ var session = yield _fetchData('session', ctx);
1334
292
 
1335
- return _context4.abrupt("return", session);
1336
-
1337
- case 5:
1338
- case "end":
1339
- return _context4.stop();
293
+ if ((_ctx$triggerEvent = ctx === null || ctx === void 0 ? void 0 : ctx.triggerEvent) !== null && _ctx$triggerEvent !== void 0 ? _ctx$triggerEvent : true) {
294
+ broadcast.post({
295
+ event: 'session',
296
+ data: {
297
+ trigger: 'getSession'
1340
298
  }
1341
- }
1342
- }, _callee4);
1343
- }));
299
+ });
300
+ }
301
+
302
+ return session;
303
+ });
1344
304
  return _getSession2.apply(this, arguments);
1345
305
  }
1346
306
 
@@ -1349,50 +309,11 @@ function getCsrfToken(_x2) {
1349
309
  }
1350
310
 
1351
311
  function _getCsrfToken() {
1352
- _getCsrfToken = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(ctx) {
312
+ _getCsrfToken = _asyncToGenerator(function* (ctx) {
1353
313
  var _yield$_fetchData;
1354
314
 
1355
- return _regenerator.default.wrap(function _callee5$(_context5) {
1356
- while (1) {
1357
- switch (_context5.prev = _context5.next) {
1358
- case 0:
1359
- _context5.next = 2;
1360
- return _fetchData('csrf', ctx);
1361
-
1362
- case 2:
1363
- _context5.t1 = _yield$_fetchData = _context5.sent;
1364
- _context5.t0 = _context5.t1 === null;
1365
-
1366
- if (_context5.t0) {
1367
- _context5.next = 6;
1368
- break;
1369
- }
1370
-
1371
- _context5.t0 = _yield$_fetchData === void 0;
1372
-
1373
- case 6:
1374
- if (!_context5.t0) {
1375
- _context5.next = 10;
1376
- break;
1377
- }
1378
-
1379
- _context5.t2 = void 0;
1380
- _context5.next = 11;
1381
- break;
1382
-
1383
- case 10:
1384
- _context5.t2 = _yield$_fetchData.csrfToken;
1385
-
1386
- case 11:
1387
- return _context5.abrupt("return", _context5.t2);
1388
-
1389
- case 12:
1390
- case "end":
1391
- return _context5.stop();
1392
- }
1393
- }
1394
- }, _callee5);
1395
- }));
315
+ return (_yield$_fetchData = yield _fetchData('csrf', ctx)) === null || _yield$_fetchData === void 0 ? void 0 : _yield$_fetchData.csrfToken;
316
+ });
1396
317
  return _getCsrfToken.apply(this, arguments);
1397
318
  }
1398
319
 
@@ -1401,20 +322,9 @@ function getProviders() {
1401
322
  }
1402
323
 
1403
324
  function _getProviders() {
1404
- _getProviders = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6() {
1405
- return _regenerator.default.wrap(function _callee6$(_context6) {
1406
- while (1) {
1407
- switch (_context6.prev = _context6.next) {
1408
- case 0:
1409
- return _context6.abrupt("return", _fetchData('providers'));
1410
-
1411
- case 1:
1412
- case "end":
1413
- return _context6.stop();
1414
- }
1415
- }
1416
- }, _callee6);
1417
- }));
325
+ _getProviders = _asyncToGenerator(function* () {
326
+ return _fetchData('providers');
327
+ });
1418
328
  return _getProviders.apply(this, arguments);
1419
329
  }
1420
330
 
@@ -1423,130 +333,68 @@ function signIn(_x3) {
1423
333
  }
1424
334
 
1425
335
  function _signIn() {
1426
- _signIn = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(provider) {
1427
- var options,
1428
- authorizationParams,
1429
- _options$callbackUrl,
336
+ _signIn = _asyncToGenerator(function* (provider) {
337
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
338
+ var authorizationParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
339
+ var {
340
+ callbackUrl = window.location,
341
+ redirect = true
342
+ } = options;
343
+
344
+ var baseUrl = _apiBaseUrl();
345
+
346
+ var providers = yield getProviders();
347
+
348
+ if (!(provider in providers)) {
349
+ window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
350
+ return;
351
+ }
352
+
353
+ var isCredentials = providers[provider].type === 'credentials';
354
+ var isEmail = providers[provider].type === 'email';
355
+ var canRedirectBeDisabled = isCredentials || isEmail;
356
+ var signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
357
+ var fetchOptions = {
358
+ method: 'post',
359
+ headers: {
360
+ 'Content-Type': 'application/x-www-form-urlencoded'
361
+ },
362
+ body: new URLSearchParams(_objectSpread(_objectSpread({}, options), {}, {
363
+ csrfToken: yield getCsrfToken(),
1430
364
  callbackUrl,
1431
- _options$redirect,
1432
- redirect,
1433
- baseUrl,
1434
- providers,
1435
- isCredentials,
1436
- isEmail,
1437
- canRedirectBeDisabled,
1438
- signInUrl,
1439
- fetchOptions,
1440
- _signInUrl,
1441
- res,
1442
- data,
1443
- _data$url,
1444
- url,
1445
- error,
1446
- _args7 = arguments;
1447
-
1448
- return _regenerator.default.wrap(function _callee7$(_context7) {
1449
- while (1) {
1450
- switch (_context7.prev = _context7.next) {
1451
- case 0:
1452
- options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
1453
- authorizationParams = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {};
1454
- _options$callbackUrl = options.callbackUrl, callbackUrl = _options$callbackUrl === void 0 ? window.location : _options$callbackUrl, _options$redirect = options.redirect, redirect = _options$redirect === void 0 ? true : _options$redirect;
1455
- baseUrl = _apiBaseUrl();
1456
- _context7.next = 6;
1457
- return getProviders();
1458
-
1459
- case 6:
1460
- providers = _context7.sent;
1461
-
1462
- if (provider in providers) {
1463
- _context7.next = 10;
1464
- break;
1465
- }
365
+ json: true
366
+ }))
367
+ };
1466
368
 
1467
- window.location = "".concat(baseUrl, "/signin?callbackUrl=").concat(encodeURIComponent(callbackUrl));
1468
- return _context7.abrupt("return");
1469
-
1470
- case 10:
1471
- isCredentials = providers[provider].type === 'credentials';
1472
- isEmail = providers[provider].type === 'email';
1473
- canRedirectBeDisabled = isCredentials || isEmail;
1474
- signInUrl = isCredentials ? "".concat(baseUrl, "/callback/").concat(provider) : "".concat(baseUrl, "/signin/").concat(provider);
1475
- _context7.t0 = {
1476
- 'Content-Type': 'application/x-www-form-urlencoded'
1477
- };
1478
- _context7.t1 = URLSearchParams;
1479
- _context7.t2 = _objectSpread;
1480
- _context7.t3 = _objectSpread({}, options);
1481
- _context7.t4 = {};
1482
- _context7.next = 21;
1483
- return getCsrfToken();
1484
-
1485
- case 21:
1486
- _context7.t5 = _context7.sent;
1487
- _context7.t6 = callbackUrl;
1488
- _context7.t7 = {
1489
- csrfToken: _context7.t5,
1490
- callbackUrl: _context7.t6,
1491
- json: true
1492
- };
1493
- _context7.t8 = (0, _context7.t2)(_context7.t3, _context7.t4, _context7.t7);
1494
- _context7.t9 = new _context7.t1(_context7.t8);
1495
- fetchOptions = {
1496
- method: 'post',
1497
- headers: _context7.t0,
1498
- body: _context7.t9
1499
- };
1500
- _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
1501
- _context7.next = 30;
1502
- return fetch(_signInUrl, fetchOptions);
1503
-
1504
- case 30:
1505
- res = _context7.sent;
1506
- _context7.next = 33;
1507
- return res.json();
1508
-
1509
- case 33:
1510
- data = _context7.sent;
1511
-
1512
- if (!(redirect || !canRedirectBeDisabled)) {
1513
- _context7.next = 39;
1514
- break;
1515
- }
369
+ var _signInUrl = "".concat(signInUrl, "?").concat(new URLSearchParams(authorizationParams));
1516
370
 
1517
- url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
1518
- window.location = url;
1519
- if (url.includes('#')) window.location.reload();
1520
- return _context7.abrupt("return");
371
+ var res = yield fetch(_signInUrl, fetchOptions);
372
+ var data = yield res.json();
1521
373
 
1522
- case 39:
1523
- error = new URL(data.url).searchParams.get('error');
374
+ if (redirect || !canRedirectBeDisabled) {
375
+ var _data$url;
1524
376
 
1525
- if (!res.ok) {
1526
- _context7.next = 43;
1527
- break;
1528
- }
377
+ var url = (_data$url = data.url) !== null && _data$url !== void 0 ? _data$url : callbackUrl;
378
+ window.location = url;
379
+ if (url.includes('#')) window.location.reload();
380
+ return;
381
+ }
1529
382
 
1530
- _context7.next = 43;
1531
- return __NEXTAUTH._getSession({
1532
- event: 'storage'
1533
- });
1534
-
1535
- case 43:
1536
- return _context7.abrupt("return", {
1537
- error: error,
1538
- status: res.status,
1539
- ok: res.ok,
1540
- url: error ? null : data.url
1541
- });
1542
-
1543
- case 44:
1544
- case "end":
1545
- return _context7.stop();
1546
- }
1547
- }
1548
- }, _callee7);
1549
- }));
383
+ var error = new URL(data.url).searchParams.get('error');
384
+
385
+ if (res.ok) {
386
+ yield __NEXTAUTH._getSession({
387
+ event: 'storage'
388
+ });
389
+ }
390
+
391
+ return {
392
+ error,
393
+ status: res.status,
394
+ ok: res.ok,
395
+ url: error ? null : data.url
396
+ };
397
+ });
1550
398
  return _signIn.apply(this, arguments);
1551
399
  }
1552
400
 
@@ -1555,101 +403,59 @@ function signOut() {
1555
403
  }
1556
404
 
1557
405
  function _signOut() {
1558
- _signOut = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee8() {
1559
- var options,
1560
- _options$callbackUrl2,
406
+ _signOut = _asyncToGenerator(function* () {
407
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
408
+ var {
409
+ callbackUrl = window.location,
410
+ redirect = true
411
+ } = options;
412
+
413
+ var baseUrl = _apiBaseUrl();
414
+
415
+ var fetchOptions = {
416
+ method: 'post',
417
+ headers: {
418
+ 'Content-Type': 'application/x-www-form-urlencoded'
419
+ },
420
+ body: new URLSearchParams({
421
+ csrfToken: yield getCsrfToken(),
1561
422
  callbackUrl,
1562
- _options$redirect2,
1563
- redirect,
1564
- baseUrl,
1565
- fetchOptions,
1566
- res,
1567
- data,
1568
- _data$url2,
1569
- url,
1570
- _args8 = arguments;
1571
-
1572
- return _regenerator.default.wrap(function _callee8$(_context8) {
1573
- while (1) {
1574
- switch (_context8.prev = _context8.next) {
1575
- case 0:
1576
- options = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : {};
1577
- _options$callbackUrl2 = options.callbackUrl, callbackUrl = _options$callbackUrl2 === void 0 ? window.location : _options$callbackUrl2, _options$redirect2 = options.redirect, redirect = _options$redirect2 === void 0 ? true : _options$redirect2;
1578
- baseUrl = _apiBaseUrl();
1579
- _context8.t0 = {
1580
- 'Content-Type': 'application/x-www-form-urlencoded'
1581
- };
1582
- _context8.t1 = URLSearchParams;
1583
- _context8.next = 7;
1584
- return getCsrfToken();
1585
-
1586
- case 7:
1587
- _context8.t2 = _context8.sent;
1588
- _context8.t3 = callbackUrl;
1589
- _context8.t4 = {
1590
- csrfToken: _context8.t2,
1591
- callbackUrl: _context8.t3,
1592
- json: true
1593
- };
1594
- _context8.t5 = new _context8.t1(_context8.t4);
1595
- fetchOptions = {
1596
- method: 'post',
1597
- headers: _context8.t0,
1598
- body: _context8.t5
1599
- };
1600
- _context8.next = 14;
1601
- return fetch("".concat(baseUrl, "/signout"), fetchOptions);
1602
-
1603
- case 14:
1604
- res = _context8.sent;
1605
- _context8.next = 17;
1606
- return res.json();
1607
-
1608
- case 17:
1609
- data = _context8.sent;
1610
- broadcast.post({
1611
- event: 'session',
1612
- data: {
1613
- trigger: 'signout'
1614
- }
1615
- });
1616
-
1617
- if (!redirect) {
1618
- _context8.next = 24;
1619
- break;
1620
- }
1621
-
1622
- url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
1623
- window.location = url;
1624
- if (url.includes('#')) window.location.reload();
1625
- return _context8.abrupt("return");
423
+ json: true
424
+ })
425
+ };
426
+ var res = yield fetch("".concat(baseUrl, "/signout"), fetchOptions);
427
+ var data = yield res.json();
428
+ broadcast.post({
429
+ event: 'session',
430
+ data: {
431
+ trigger: 'signout'
432
+ }
433
+ });
1626
434
 
1627
- case 24:
1628
- _context8.next = 26;
1629
- return __NEXTAUTH._getSession({
1630
- event: 'storage'
1631
- });
435
+ if (redirect) {
436
+ var _data$url2;
1632
437
 
1633
- case 26:
1634
- return _context8.abrupt("return", data);
438
+ var url = (_data$url2 = data.url) !== null && _data$url2 !== void 0 ? _data$url2 : callbackUrl;
439
+ window.location = url;
440
+ if (url.includes('#')) window.location.reload();
441
+ return;
442
+ }
1635
443
 
1636
- case 27:
1637
- case "end":
1638
- return _context8.stop();
1639
- }
1640
- }
1641
- }, _callee8);
1642
- }));
444
+ yield __NEXTAUTH._getSession({
445
+ event: 'storage'
446
+ });
447
+ return data;
448
+ });
1643
449
  return _signOut.apply(this, arguments);
1644
450
  }
1645
451
 
1646
452
  function setOptions() {
1647
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1648
- baseUrl = _ref3.baseUrl,
1649
- basePath = _ref3.basePath,
1650
- clientMaxAge = _ref3.clientMaxAge,
1651
- keepAlive = _ref3.keepAlive;
1652
-
453
+ var {
454
+ baseUrl,
455
+ basePath,
456
+ clientMaxAge,
457
+ keepAlive
458
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1653
459
  if (baseUrl) __NEXTAUTH.baseUrl = baseUrl;
1654
460
  if (basePath) __NEXTAUTH.basePath = basePath;
1655
461
  if (clientMaxAge) __NEXTAUTH.clientMaxAge = clientMaxAge;
@@ -1662,38 +468,21 @@ function setOptions() {
1662
468
  clearTimeout(__NEXTAUTH._clientSyncTimer);
1663
469
  }
1664
470
 
1665
- __NEXTAUTH._clientSyncTimer = setTimeout((0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2() {
1666
- return _regenerator.default.wrap(function _callee2$(_context2) {
1667
- while (1) {
1668
- switch (_context2.prev = _context2.next) {
1669
- case 0:
1670
- if (__NEXTAUTH._clientSession) {
1671
- _context2.next = 2;
1672
- break;
1673
- }
1674
-
1675
- return _context2.abrupt("return");
1676
-
1677
- case 2:
1678
- _context2.next = 4;
1679
- return __NEXTAUTH._getSession({
1680
- event: 'timer'
1681
- });
1682
-
1683
- case 4:
1684
- case "end":
1685
- return _context2.stop();
1686
- }
1687
- }
1688
- }, _callee2);
1689
- })), keepAlive * 1000);
471
+ __NEXTAUTH._clientSyncTimer = setTimeout(_asyncToGenerator(function* () {
472
+ if (!__NEXTAUTH._clientSession) return;
473
+ yield __NEXTAUTH._getSession({
474
+ event: 'timer'
475
+ });
476
+ }), keepAlive * 1000);
1690
477
  }
1691
478
  }
1692
479
 
1693
- function Provider(_ref5) {
1694
- var children = _ref5.children,
1695
- session = _ref5.session,
1696
- options = _ref5.options;
480
+ function Provider(_ref3) {
481
+ var {
482
+ children,
483
+ session,
484
+ options
485
+ } = _ref3;
1697
486
  setOptions(options);
1698
487
  return (0, React__default['default'].createElement)(SessionContext.Provider, {
1699
488
  value: useSession(session)
@@ -1705,58 +494,27 @@ function _fetchData(_x4) {
1705
494
  }
1706
495
 
1707
496
  function _fetchData2() {
1708
- _fetchData2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee9(path) {
1709
- var _ref7,
1710
- ctx,
1711
- _ref7$req,
1712
- req,
1713
- baseUrl,
1714
- options,
1715
- res,
1716
- data,
1717
- _args9 = arguments;
1718
-
1719
- return _regenerator.default.wrap(function _callee9$(_context9) {
1720
- while (1) {
1721
- switch (_context9.prev = _context9.next) {
1722
- case 0:
1723
- _ref7 = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : {}, ctx = _ref7.ctx, _ref7$req = _ref7.req, req = _ref7$req === void 0 ? ctx === null || ctx === void 0 ? void 0 : ctx.req : _ref7$req;
1724
- _context9.prev = 1;
1725
- _context9.next = 4;
1726
- return _apiBaseUrl();
1727
-
1728
- case 4:
1729
- baseUrl = _context9.sent;
1730
- options = req ? {
1731
- headers: {
1732
- cookie: req.headers.cookie
1733
- }
1734
- } : {};
1735
- _context9.next = 8;
1736
- return fetch("".concat(baseUrl, "/").concat(path), options);
1737
-
1738
- case 8:
1739
- res = _context9.sent;
1740
- _context9.next = 11;
1741
- return res.json();
1742
-
1743
- case 11:
1744
- data = _context9.sent;
1745
- return _context9.abrupt("return", Object.keys(data).length > 0 ? data : null);
1746
-
1747
- case 15:
1748
- _context9.prev = 15;
1749
- _context9.t0 = _context9["catch"](1);
1750
- logger$1.error('CLIENT_FETCH_ERROR', path, _context9.t0);
1751
- return _context9.abrupt("return", null);
1752
-
1753
- case 19:
1754
- case "end":
1755
- return _context9.stop();
497
+ _fetchData2 = _asyncToGenerator(function* (path) {
498
+ var {
499
+ ctx,
500
+ req = ctx === null || ctx === void 0 ? void 0 : ctx.req
501
+ } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
502
+
503
+ try {
504
+ var baseUrl = yield _apiBaseUrl();
505
+ var options = req ? {
506
+ headers: {
507
+ cookie: req.headers.cookie
1756
508
  }
1757
- }
1758
- }, _callee9, null, [[1, 15]]);
1759
- }));
509
+ } : {};
510
+ var res = yield fetch("".concat(baseUrl, "/").concat(path), options);
511
+ var data = yield res.json();
512
+ return Object.keys(data).length > 0 ? data : null;
513
+ } catch (error) {
514
+ logger$1.error('CLIENT_FETCH_ERROR', path, error);
515
+ return null;
516
+ }
517
+ });
1760
518
  return _fetchData2.apply(this, arguments);
1761
519
  }
1762
520
 
@@ -1779,66 +537,41 @@ function _now() {
1779
537
  function BroadcastChannel() {
1780
538
  var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'nextauth.message';
1781
539
  return {
1782
- receive: function receive(onReceive) {
540
+ receive(onReceive) {
1783
541
  if (typeof window === 'undefined') return;
1784
542
  window.addEventListener('storage', function () {
1785
- var _ref6 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(event) {
1786
- var message;
1787
- return _regenerator.default.wrap(function _callee3$(_context3) {
1788
- while (1) {
1789
- switch (_context3.prev = _context3.next) {
1790
- case 0:
1791
- if (!(event.key !== name)) {
1792
- _context3.next = 2;
1793
- break;
1794
- }
1795
-
1796
- return _context3.abrupt("return");
1797
-
1798
- case 2:
1799
- message = JSON.parse(event.newValue);
1800
-
1801
- if (!((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data))) {
1802
- _context3.next = 5;
1803
- break;
1804
- }
1805
-
1806
- return _context3.abrupt("return");
1807
-
1808
- case 5:
1809
- onReceive(message);
1810
-
1811
- case 6:
1812
- case "end":
1813
- return _context3.stop();
1814
- }
1815
- }
1816
- }, _callee3);
1817
- }));
543
+ var _ref4 = _asyncToGenerator(function* (event) {
544
+ if (event.key !== name) return;
545
+ var message = JSON.parse(event.newValue);
546
+ if ((message === null || message === void 0 ? void 0 : message.event) !== 'session' || !(message !== null && message !== void 0 && message.data)) return;
547
+ onReceive(message);
548
+ });
1818
549
 
1819
550
  return function (_x5) {
1820
- return _ref6.apply(this, arguments);
551
+ return _ref4.apply(this, arguments);
1821
552
  };
1822
553
  }());
1823
554
  },
1824
- post: function post(message) {
555
+
556
+ post(message) {
1825
557
  if (typeof localStorage === 'undefined') return;
1826
558
  localStorage.setItem(name, JSON.stringify(_objectSpread(_objectSpread({}, message), {}, {
1827
559
  timestamp: _now()
1828
560
  })));
1829
561
  }
562
+
1830
563
  };
1831
564
  }
1832
565
 
1833
566
  var _default = {
1834
- getSession: getSession,
1835
- getCsrfToken: getCsrfToken,
1836
- getProviders: getProviders,
1837
- useSession: useSession,
1838
- signIn: signIn,
1839
- signOut: signOut,
1840
- Provider: Provider,
1841
- setOptions: setOptions,
567
+ getSession,
568
+ getCsrfToken,
569
+ getProviders,
570
+ useSession,
571
+ signIn,
572
+ signOut,
573
+ Provider,
574
+ setOptions,
1842
575
  options: setOptions,
1843
576
  session: getSession,
1844
577
  providers: getProviders,
@@ -1851,17 +584,10 @@ exports.default = _default;
1851
584
 
1852
585
  _commonjsHelpers.unwrapExports(client$1);
1853
586
  client$1.useSession;
1854
- client$1.session;
1855
587
  client$1.getSession;
1856
- client$1.csrfToken;
1857
- client$1.getCsrfToken;
1858
- client$1.providers;
1859
588
  client$1.getProviders;
1860
- client$1.signin;
1861
589
  client$1.signIn;
1862
- client$1.signout;
1863
590
  client$1.signOut;
1864
- client$1.options;
1865
591
  client$1.setOptions;
1866
592
  client$1.Provider;
1867
593
 
@@ -1878,27 +604,27 @@ var AuthWrapper = function AuthWrapper(_ref) {
1878
604
  formUrl = _ref$formUrl === undefined ? '' : _ref$formUrl;
1879
605
 
1880
606
  var _nextAuth$useSession = client.useSession(),
1881
- _nextAuth$useSession2 = slicedToArray$1._slicedToArray(_nextAuth$useSession, 2),
607
+ _nextAuth$useSession2 = slicedToArray._slicedToArray(_nextAuth$useSession, 2),
1882
608
  session = _nextAuth$useSession2[0],
1883
609
  loading = _nextAuth$useSession2[1];
1884
610
 
1885
611
  var _useState = React.useState(null),
1886
- _useState2 = slicedToArray$1._slicedToArray(_useState, 2),
612
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
1887
613
  callbackUrl = _useState2[0],
1888
614
  setCallbackUrl = _useState2[1];
1889
615
 
1890
616
  var _useState3 = React.useState(),
1891
- _useState4 = slicedToArray$1._slicedToArray(_useState3, 2),
617
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
1892
618
  email = _useState4[0],
1893
619
  setEmail = _useState4[1];
1894
620
 
1895
621
  var _useState5 = React.useState(false),
1896
- _useState6 = slicedToArray$1._slicedToArray(_useState5, 2),
622
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1897
623
  showForm = _useState6[0],
1898
624
  setShowForm = _useState6[1];
1899
625
 
1900
626
  var _useState7 = React.useState(),
1901
- _useState8 = slicedToArray$1._slicedToArray(_useState7, 2),
627
+ _useState8 = slicedToArray._slicedToArray(_useState7, 2),
1902
628
  password = _useState8[0],
1903
629
  setPassword = _useState8[1];
1904
630