You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

2082 line
62 KiB

  1. (window["webpackJsonp"] = window["webpackJsonp"] || []).push([["static/runtime/amp.js"],{
  2. /***/ "./node_modules/next/dist/build/polyfills/unfetch.js":
  3. /*!***********************************************************!*\
  4. !*** ./node_modules/next/dist/build/polyfills/unfetch.js ***!
  5. \***********************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports) {
  8. module.exports=function(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(JSON.parse(s.responseText))},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t}),t(a())},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})};
  9. //# sourceMappingURL=unfetch.js.map
  10. /***/ }),
  11. /***/ "./node_modules/next/dist/client/dev/amp-dev.js":
  12. /*!******************************************************!*\
  13. !*** ./node_modules/next/dist/client/dev/amp-dev.js ***!
  14. \******************************************************/
  15. /*! no static exports found */
  16. /***/ (function(module, exports, __webpack_require__) {
  17. "use strict";
  18. var _regeneratorRuntime = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/next/node_modules/@babel/runtime/regenerator/index.js");
  19. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  20. var _unfetch = _interopRequireDefault(__webpack_require__(/*! next/dist/build/polyfills/unfetch */ "./node_modules/next/dist/build/polyfills/unfetch.js"));
  21. var _eventSourcePolyfill = _interopRequireDefault(__webpack_require__(/*! ./event-source-polyfill */ "./node_modules/next/dist/client/dev/event-source-polyfill.js"));
  22. var _eventsource = __webpack_require__(/*! ./error-overlay/eventsource */ "./node_modules/next/dist/client/dev/error-overlay/eventsource.js");
  23. var _onDemandEntriesUtils = __webpack_require__(/*! ./on-demand-entries-utils */ "./node_modules/next/dist/client/dev/on-demand-entries-utils.js");
  24. var _fouc = __webpack_require__(/*! ./fouc */ "./node_modules/next/dist/client/dev/fouc.js");
  25. /* globals __webpack_hash__ */
  26. if (!window.EventSource) {
  27. window.EventSource = _eventSourcePolyfill["default"];
  28. }
  29. var data = JSON.parse(document.getElementById('__NEXT_DATA__').textContent);
  30. var assetPrefix = data.assetPrefix,
  31. page = data.page;
  32. assetPrefix = assetPrefix || '';
  33. var mostRecentHash = null;
  34. /* eslint-disable-next-line */
  35. var curHash = __webpack_require__.h();
  36. var hotUpdatePath = assetPrefix + (assetPrefix.endsWith('/') ? '' : '/') + '_next/static/webpack/'; // Is there a newer version of this code available?
  37. function isUpdateAvailable() {
  38. // __webpack_hash__ is the hash of the current compilation.
  39. // It's a global variable injected by Webpack.
  40. /* eslint-disable-next-line */
  41. return mostRecentHash !== __webpack_require__.h();
  42. } // Webpack disallows updates in other states.
  43. function canApplyUpdates() {
  44. return module.hot.status() === 'idle';
  45. } // This function reads code updates on the fly and hard
  46. // reloads the page when it has changed.
  47. function tryApplyUpdates() {
  48. var res, _data, curPage, pageUpdated;
  49. return _regeneratorRuntime.async(function tryApplyUpdates$(_context) {
  50. while (1) {
  51. switch (_context.prev = _context.next) {
  52. case 0:
  53. if (!(!isUpdateAvailable() || !canApplyUpdates())) {
  54. _context.next = 2;
  55. break;
  56. }
  57. return _context.abrupt("return");
  58. case 2:
  59. _context.prev = 2;
  60. _context.next = 5;
  61. return _regeneratorRuntime.awrap((0, _unfetch["default"])("" + hotUpdatePath + curHash + ".hot-update.json"));
  62. case 5:
  63. res = _context.sent;
  64. _context.next = 8;
  65. return _regeneratorRuntime.awrap(res.json());
  66. case 8:
  67. _data = _context.sent;
  68. curPage = page === '/' ? 'index' : page;
  69. pageUpdated = Object.keys(_data.c).some(function (mod) {
  70. return mod.indexOf("pages" + (curPage.substr(0, 1) === '/' ? curPage : "/" + curPage)) !== -1 || mod.indexOf(("pages" + (curPage.substr(0, 1) === '/' ? curPage : "/" + curPage)).replace(/\//g, '\\')) !== -1;
  71. });
  72. if (pageUpdated) {
  73. document.location.reload(true);
  74. } else {
  75. curHash = mostRecentHash;
  76. }
  77. _context.next = 18;
  78. break;
  79. case 14:
  80. _context.prev = 14;
  81. _context.t0 = _context["catch"](2);
  82. console.error('Error occurred checking for update', _context.t0);
  83. document.location.reload(true);
  84. case 18:
  85. case "end":
  86. return _context.stop();
  87. }
  88. }
  89. }, null, null, [[2, 14]], Promise);
  90. }
  91. (0, _eventsource.getEventSourceWrapper)({
  92. path: assetPrefix + "/_next/webpack-hmr"
  93. }).addMessageListener(function (event) {
  94. if (event.data === "\uD83D\uDC93") {
  95. return;
  96. }
  97. try {
  98. var message = JSON.parse(event.data);
  99. if (message.action === 'sync' || message.action === 'built') {
  100. if (!message.hash) {
  101. return;
  102. }
  103. mostRecentHash = message.hash;
  104. tryApplyUpdates();
  105. } else if (message.action === 'reloadPage') {
  106. document.location.reload(true);
  107. }
  108. } catch (ex) {
  109. console.warn('Invalid HMR message: ' + event.data + '\n' + ex);
  110. }
  111. });
  112. (0, _onDemandEntriesUtils.setupPing)(assetPrefix, function () {
  113. return page;
  114. });
  115. (0, _fouc.displayContent)();
  116. /***/ }),
  117. /***/ "./node_modules/next/dist/client/dev/error-overlay/eventsource.js":
  118. /*!************************************************************************!*\
  119. !*** ./node_modules/next/dist/client/dev/error-overlay/eventsource.js ***!
  120. \************************************************************************/
  121. /*! no static exports found */
  122. /***/ (function(module, exports, __webpack_require__) {
  123. "use strict";
  124. exports.__esModule = true;
  125. exports.getEventSourceWrapper = getEventSourceWrapper;
  126. var eventCallbacks = [];
  127. function EventSourceWrapper(options) {
  128. var source;
  129. var lastActivity = new Date();
  130. var listeners = [];
  131. if (!options.timeout) {
  132. options.timeout = 20 * 1000;
  133. }
  134. init();
  135. var timer = setInterval(function () {
  136. if (new Date() - lastActivity > options.timeout) {
  137. handleDisconnect();
  138. }
  139. }, options.timeout / 2);
  140. function init() {
  141. source = new window.EventSource(options.path);
  142. source.onopen = handleOnline;
  143. source.onerror = handleDisconnect;
  144. source.onmessage = handleMessage;
  145. }
  146. function handleOnline() {
  147. if (options.log) console.log('[HMR] connected');
  148. lastActivity = new Date();
  149. }
  150. function handleMessage(event) {
  151. lastActivity = new Date();
  152. for (var i = 0; i < listeners.length; i++) {
  153. listeners[i](event);
  154. }
  155. if (event.data.indexOf('action') !== -1) {
  156. eventCallbacks.forEach(function (cb) {
  157. return cb(event);
  158. });
  159. }
  160. }
  161. function handleDisconnect() {
  162. clearInterval(timer);
  163. source.close();
  164. setTimeout(init, options.timeout);
  165. }
  166. return {
  167. close: function close() {
  168. clearInterval(timer);
  169. source.close();
  170. },
  171. addMessageListener: function addMessageListener(fn) {
  172. listeners.push(fn);
  173. }
  174. };
  175. }
  176. function getEventSourceWrapper(options) {
  177. if (!options.ondemand) {
  178. return {
  179. addMessageListener: function addMessageListener(cb) {
  180. eventCallbacks.push(cb);
  181. }
  182. };
  183. }
  184. return EventSourceWrapper(options);
  185. }
  186. /***/ }),
  187. /***/ "./node_modules/next/dist/client/dev/event-source-polyfill.js":
  188. /*!********************************************************************!*\
  189. !*** ./node_modules/next/dist/client/dev/event-source-polyfill.js ***!
  190. \********************************************************************/
  191. /*! no static exports found */
  192. /***/ (function(module, exports, __webpack_require__) {
  193. "use strict";
  194. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  195. exports.__esModule = true;
  196. exports["default"] = void 0;
  197. var _unfetch = _interopRequireDefault(__webpack_require__(/*! next/dist/build/polyfills/unfetch */ "./node_modules/next/dist/build/polyfills/unfetch.js"));
  198. /* eslint-disable */
  199. // Improved version of https://github.com/Yaffle/EventSource/
  200. // Available under MIT License (MIT)
  201. // Only tries to support IE11 and nothing below
  202. var document = window.document;
  203. var Response = window.Response;
  204. var TextDecoder = window.TextDecoder;
  205. var TextEncoder = window.TextEncoder;
  206. var AbortController = window.AbortController;
  207. if (AbortController == undefined) {
  208. AbortController = function AbortController() {
  209. this.signal = null;
  210. this.abort = function () {};
  211. };
  212. }
  213. function TextDecoderPolyfill() {
  214. this.bitsNeeded = 0;
  215. this.codePoint = 0;
  216. }
  217. TextDecoderPolyfill.prototype.decode = function (octets) {
  218. function valid(codePoint, shift, octetsCount) {
  219. if (octetsCount === 1) {
  220. return codePoint >= 0x0080 >> shift && codePoint << shift <= 0x07ff;
  221. }
  222. if (octetsCount === 2) {
  223. return codePoint >= 0x0800 >> shift && codePoint << shift <= 0xd7ff || codePoint >= 0xe000 >> shift && codePoint << shift <= 0xffff;
  224. }
  225. if (octetsCount === 3) {
  226. return codePoint >= 0x010000 >> shift && codePoint << shift <= 0x10ffff;
  227. }
  228. throw new Error();
  229. }
  230. function octetsCount(bitsNeeded, codePoint) {
  231. if (bitsNeeded === 6 * 1) {
  232. return codePoint >> 6 > 15 ? 3 : codePoint > 31 ? 2 : 1;
  233. }
  234. if (bitsNeeded === 6 * 2) {
  235. return codePoint > 15 ? 3 : 2;
  236. }
  237. if (bitsNeeded === 6 * 3) {
  238. return 3;
  239. }
  240. throw new Error();
  241. }
  242. var REPLACER = 0xfffd;
  243. var string = '';
  244. var bitsNeeded = this.bitsNeeded;
  245. var codePoint = this.codePoint;
  246. for (var i = 0; i < octets.length; i += 1) {
  247. var octet = octets[i];
  248. if (bitsNeeded !== 0) {
  249. if (octet < 128 || octet > 191 || !valid(codePoint << 6 | octet & 63, bitsNeeded - 6, octetsCount(bitsNeeded, codePoint))) {
  250. bitsNeeded = 0;
  251. codePoint = REPLACER;
  252. string += String.fromCharCode(codePoint);
  253. }
  254. }
  255. if (bitsNeeded === 0) {
  256. if (octet >= 0 && octet <= 127) {
  257. bitsNeeded = 0;
  258. codePoint = octet;
  259. } else if (octet >= 192 && octet <= 223) {
  260. bitsNeeded = 6 * 1;
  261. codePoint = octet & 31;
  262. } else if (octet >= 224 && octet <= 239) {
  263. bitsNeeded = 6 * 2;
  264. codePoint = octet & 15;
  265. } else if (octet >= 240 && octet <= 247) {
  266. bitsNeeded = 6 * 3;
  267. codePoint = octet & 7;
  268. } else {
  269. bitsNeeded = 0;
  270. codePoint = REPLACER;
  271. }
  272. if (bitsNeeded !== 0 && !valid(codePoint, bitsNeeded, octetsCount(bitsNeeded, codePoint))) {
  273. bitsNeeded = 0;
  274. codePoint = REPLACER;
  275. }
  276. } else {
  277. bitsNeeded -= 6;
  278. codePoint = codePoint << 6 | octet & 63;
  279. }
  280. if (bitsNeeded === 0) {
  281. if (codePoint <= 0xffff) {
  282. string += String.fromCharCode(codePoint);
  283. } else {
  284. string += String.fromCharCode(0xd800 + (codePoint - 0xffff - 1 >> 10));
  285. string += String.fromCharCode(0xdc00 + (codePoint - 0xffff - 1 & 0x3ff));
  286. }
  287. }
  288. }
  289. this.bitsNeeded = bitsNeeded;
  290. this.codePoint = codePoint;
  291. return string;
  292. }; // Firefox < 38 throws an error with stream option
  293. var supportsStreamOption = function supportsStreamOption() {
  294. try {
  295. return new TextDecoder().decode(new TextEncoder().encode('test'), {
  296. stream: true
  297. }) === 'test';
  298. } catch (error) {
  299. console.log(error);
  300. }
  301. return false;
  302. }; // IE, Edge
  303. if (TextDecoder == undefined || TextEncoder == undefined || !supportsStreamOption()) {
  304. TextDecoder = TextDecoderPolyfill;
  305. }
  306. var k = function k() {};
  307. function XHRWrapper(xhr) {
  308. this.withCredentials = false;
  309. this.responseType = '';
  310. this.readyState = 0;
  311. this.status = 0;
  312. this.statusText = '';
  313. this.responseText = '';
  314. this.onprogress = k;
  315. this.onreadystatechange = k;
  316. this._contentType = '';
  317. this._xhr = xhr;
  318. this._sendTimeout = 0;
  319. this._abort = k;
  320. }
  321. XHRWrapper.prototype.open = function (method, url) {
  322. this._abort(true);
  323. var that = this;
  324. var xhr = this._xhr;
  325. var state = 1;
  326. var timeout = 0;
  327. this._abort = function (silent) {
  328. if (that._sendTimeout !== 0) {
  329. clearTimeout(that._sendTimeout);
  330. that._sendTimeout = 0;
  331. }
  332. if (state === 1 || state === 2 || state === 3) {
  333. state = 4;
  334. xhr.onload = k;
  335. xhr.onerror = k;
  336. xhr.onabort = k;
  337. xhr.onprogress = k;
  338. xhr.onreadystatechange = k; // IE 8 - 9: XDomainRequest#abort() does not fire any event
  339. // Opera < 10: XMLHttpRequest#abort() does not fire any event
  340. xhr.abort();
  341. if (timeout !== 0) {
  342. clearTimeout(timeout);
  343. timeout = 0;
  344. }
  345. if (!silent) {
  346. that.readyState = 4;
  347. that.onreadystatechange();
  348. }
  349. }
  350. state = 0;
  351. };
  352. var onStart = function onStart() {
  353. if (state === 1) {
  354. // state = 2;
  355. var status = 0;
  356. var statusText = '';
  357. var contentType = undefined;
  358. if (!('contentType' in xhr)) {
  359. try {
  360. status = xhr.status;
  361. statusText = xhr.statusText;
  362. contentType = xhr.getResponseHeader('Content-Type');
  363. } catch (error) {
  364. // IE < 10 throws exception for `xhr.status` when xhr.readyState === 2 || xhr.readyState === 3
  365. // Opera < 11 throws exception for `xhr.status` when xhr.readyState === 2
  366. // https://bugs.webkit.org/show_bug.cgi?id=29121
  367. status = 0;
  368. statusText = '';
  369. contentType = undefined; // Firefox < 14, Chrome ?, Safari ?
  370. // https://bugs.webkit.org/show_bug.cgi?id=29658
  371. // https://bugs.webkit.org/show_bug.cgi?id=77854
  372. }
  373. } else {
  374. status = 200;
  375. statusText = 'OK';
  376. contentType = xhr.contentType;
  377. }
  378. if (status !== 0) {
  379. state = 2;
  380. that.readyState = 2;
  381. that.status = status;
  382. that.statusText = statusText;
  383. that._contentType = contentType;
  384. that.onreadystatechange();
  385. }
  386. }
  387. };
  388. var onProgress = function onProgress() {
  389. onStart();
  390. if (state === 2 || state === 3) {
  391. state = 3;
  392. var responseText = '';
  393. try {
  394. responseText = xhr.responseText;
  395. } catch (error) {// IE 8 - 9 with XMLHttpRequest
  396. }
  397. that.readyState = 3;
  398. that.responseText = responseText;
  399. that.onprogress();
  400. }
  401. };
  402. var onFinish = function onFinish() {
  403. // Firefox 52 fires "readystatechange" (xhr.readyState === 4) without final "readystatechange" (xhr.readyState === 3)
  404. // IE 8 fires "onload" without "onprogress"
  405. onProgress();
  406. if (state === 1 || state === 2 || state === 3) {
  407. state = 4;
  408. if (timeout !== 0) {
  409. clearTimeout(timeout);
  410. timeout = 0;
  411. }
  412. that.readyState = 4;
  413. that.onreadystatechange();
  414. }
  415. };
  416. var onReadyStateChange = function onReadyStateChange() {
  417. if (xhr != undefined) {
  418. // Opera 12
  419. if (xhr.readyState === 4) {
  420. onFinish();
  421. } else if (xhr.readyState === 3) {
  422. onProgress();
  423. } else if (xhr.readyState === 2) {
  424. onStart();
  425. }
  426. }
  427. };
  428. var onTimeout = function onTimeout() {
  429. timeout = setTimeout(function () {
  430. onTimeout();
  431. }, 500);
  432. if (xhr.readyState === 3) {
  433. onProgress();
  434. }
  435. }; // XDomainRequest#abort removes onprogress, onerror, onload
  436. xhr.onload = onFinish;
  437. xhr.onerror = onFinish; // improper fix to match Firefox behaviour, but it is better than just ignore abort
  438. // see https://bugzilla.mozilla.org/show_bug.cgi?id=768596
  439. // https://bugzilla.mozilla.org/show_bug.cgi?id=880200
  440. // https://code.google.com/p/chromium/issues/detail?id=153570
  441. // IE 8 fires "onload" without "onprogress
  442. xhr.onabort = onFinish; // https://bugzilla.mozilla.org/show_bug.cgi?id=736723
  443. if (!('sendAsBinary' in XMLHttpRequest.prototype) && !('mozAnon' in XMLHttpRequest.prototype)) {
  444. xhr.onprogress = onProgress;
  445. } // IE 8 - 9 (XMLHTTPRequest)
  446. // Opera < 12
  447. // Firefox < 3.5
  448. // Firefox 3.5 - 3.6 - ? < 9.0
  449. // onprogress is not fired sometimes or delayed
  450. // see also #64
  451. xhr.onreadystatechange = onReadyStateChange;
  452. if ('contentType' in xhr) {
  453. url += (url.indexOf('?') === -1 ? '?' : '&') + 'padding=true';
  454. }
  455. xhr.open(method, url, true);
  456. if ('readyState' in xhr) {
  457. // workaround for Opera 12 issue with "progress" events
  458. // #91
  459. timeout = setTimeout(function () {
  460. onTimeout();
  461. }, 0);
  462. }
  463. };
  464. XHRWrapper.prototype.abort = function () {
  465. this._abort(false);
  466. };
  467. XHRWrapper.prototype.getResponseHeader = function (name) {
  468. return this._contentType;
  469. };
  470. XHRWrapper.prototype.setRequestHeader = function (name, value) {
  471. var xhr = this._xhr;
  472. if ('setRequestHeader' in xhr) {
  473. xhr.setRequestHeader(name, value);
  474. }
  475. };
  476. XHRWrapper.prototype.getAllResponseHeaders = function () {
  477. return this._xhr.getAllResponseHeaders != undefined ? this._xhr.getAllResponseHeaders() : '';
  478. };
  479. XHRWrapper.prototype.send = function () {
  480. // loading indicator in Safari < ? (6), Chrome < 14, Firefox
  481. if (!('ontimeout' in XMLHttpRequest.prototype) && document != undefined && document.readyState != undefined && document.readyState !== 'complete') {
  482. var that = this;
  483. that._sendTimeout = setTimeout(function () {
  484. that._sendTimeout = 0;
  485. that.send();
  486. }, 4);
  487. return;
  488. }
  489. var xhr = this._xhr; // withCredentials should be set after "open" for Safari and Chrome (< 19 ?)
  490. xhr.withCredentials = this.withCredentials;
  491. xhr.responseType = this.responseType;
  492. try {
  493. // xhr.send(); throws "Not enough arguments" in Firefox 3.0
  494. xhr.send(undefined);
  495. } catch (error1) {
  496. // Safari 5.1.7, Opera 12
  497. throw error1;
  498. }
  499. };
  500. function toLowerCase(name) {
  501. return name.replace(/[A-Z]/g, function (c) {
  502. return String.fromCharCode(c.charCodeAt(0) + 0x20);
  503. });
  504. }
  505. function HeadersPolyfill(all) {
  506. // Get headers: implemented according to mozilla's example code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
  507. var map = Object.create(null);
  508. var array = all.split('\r\n');
  509. for (var i = 0; i < array.length; i += 1) {
  510. var line = array[i];
  511. var parts = line.split(': ');
  512. var name = parts.shift();
  513. var value = parts.join(': ');
  514. map[toLowerCase(name)] = value;
  515. }
  516. this._map = map;
  517. }
  518. HeadersPolyfill.prototype.get = function (name) {
  519. return this._map[toLowerCase(name)];
  520. };
  521. function XHRTransport() {}
  522. XHRTransport.prototype.open = function (xhr, onStartCallback, onProgressCallback, onFinishCallback, url, withCredentials, headers) {
  523. xhr.open('GET', url);
  524. var offset = 0;
  525. xhr.onprogress = function () {
  526. var responseText = xhr.responseText;
  527. var chunk = responseText.slice(offset);
  528. offset += chunk.length;
  529. onProgressCallback(chunk);
  530. };
  531. xhr.onreadystatechange = function () {
  532. if (xhr.readyState === 2) {
  533. var status = xhr.status;
  534. var statusText = xhr.statusText;
  535. var contentType = xhr.getResponseHeader('Content-Type');
  536. var headers = xhr.getAllResponseHeaders();
  537. onStartCallback(status, statusText, contentType, new HeadersPolyfill(headers), function () {
  538. xhr.abort();
  539. });
  540. } else if (xhr.readyState === 4) {
  541. onFinishCallback();
  542. }
  543. };
  544. xhr.withCredentials = withCredentials;
  545. xhr.responseType = 'text';
  546. for (var name in headers) {
  547. if (Object.prototype.hasOwnProperty.call(headers, name)) {
  548. xhr.setRequestHeader(name, headers[name]);
  549. }
  550. }
  551. xhr.send();
  552. };
  553. function HeadersWrapper(headers) {
  554. this._headers = headers;
  555. }
  556. HeadersWrapper.prototype.get = function (name) {
  557. return this._headers.get(name);
  558. };
  559. function FetchTransport() {}
  560. FetchTransport.prototype.open = function (xhr, onStartCallback, onProgressCallback, onFinishCallback, url, withCredentials, headers) {
  561. var controller = new AbortController();
  562. var signal = controller.signal; // see #120
  563. var textDecoder = new TextDecoder();
  564. (0, _unfetch["default"])(url, {
  565. headers: headers,
  566. credentials: withCredentials ? 'include' : 'same-origin',
  567. signal: signal,
  568. cache: 'no-store'
  569. }).then(function (response) {
  570. var reader = response.body.getReader();
  571. onStartCallback(response.status, response.statusText, response.headers.get('Content-Type'), new HeadersWrapper(response.headers), function () {
  572. controller.abort();
  573. reader.cancel();
  574. });
  575. return new Promise(function (resolve, reject) {
  576. var readNextChunk = function readNextChunk() {
  577. reader.read().then(function (result) {
  578. if (result.done) {
  579. // Note: bytes in textDecoder are ignored
  580. resolve(undefined);
  581. } else {
  582. var chunk = textDecoder.decode(result.value, {
  583. stream: true
  584. });
  585. onProgressCallback(chunk);
  586. readNextChunk();
  587. }
  588. })['catch'](function (error) {
  589. reject(error);
  590. });
  591. };
  592. readNextChunk();
  593. });
  594. }).then(function (result) {
  595. onFinishCallback();
  596. return result;
  597. }, function (error) {
  598. onFinishCallback();
  599. return Promise.reject(error);
  600. });
  601. };
  602. function EventTarget() {
  603. this._listeners = Object.create(null);
  604. }
  605. function throwError(e) {
  606. setTimeout(function () {
  607. throw e;
  608. }, 0);
  609. }
  610. EventTarget.prototype.dispatchEvent = function (event) {
  611. event.target = this;
  612. var typeListeners = this._listeners[event.type];
  613. if (typeListeners != undefined) {
  614. var length = typeListeners.length;
  615. for (var i = 0; i < length; i += 1) {
  616. var listener = typeListeners[i];
  617. try {
  618. if (typeof listener.handleEvent === 'function') {
  619. listener.handleEvent(event);
  620. } else {
  621. listener.call(this, event);
  622. }
  623. } catch (e) {
  624. throwError(e);
  625. }
  626. }
  627. }
  628. };
  629. EventTarget.prototype.addEventListener = function (type, listener) {
  630. type = String(type);
  631. var listeners = this._listeners;
  632. var typeListeners = listeners[type];
  633. if (typeListeners == undefined) {
  634. typeListeners = [];
  635. listeners[type] = typeListeners;
  636. }
  637. var found = false;
  638. for (var i = 0; i < typeListeners.length; i += 1) {
  639. if (typeListeners[i] === listener) {
  640. found = true;
  641. }
  642. }
  643. if (!found) {
  644. typeListeners.push(listener);
  645. }
  646. };
  647. EventTarget.prototype.removeEventListener = function (type, listener) {
  648. type = String(type);
  649. var listeners = this._listeners;
  650. var typeListeners = listeners[type];
  651. if (typeListeners != undefined) {
  652. var filtered = [];
  653. for (var i = 0; i < typeListeners.length; i += 1) {
  654. if (typeListeners[i] !== listener) {
  655. filtered.push(typeListeners[i]);
  656. }
  657. }
  658. if (filtered.length === 0) {
  659. delete listeners[type];
  660. } else {
  661. listeners[type] = filtered;
  662. }
  663. }
  664. };
  665. function Event(type) {
  666. this.type = type;
  667. this.target = undefined;
  668. }
  669. function MessageEvent(type, options) {
  670. Event.call(this, type);
  671. this.data = options.data;
  672. this.lastEventId = options.lastEventId;
  673. }
  674. MessageEvent.prototype = Object.create(Event.prototype);
  675. function ConnectionEvent(type, options) {
  676. Event.call(this, type);
  677. this.status = options.status;
  678. this.statusText = options.statusText;
  679. this.headers = options.headers;
  680. }
  681. ConnectionEvent.prototype = Object.create(Event.prototype);
  682. var WAITING = -1;
  683. var CONNECTING = 0;
  684. var OPEN = 1;
  685. var CLOSED = 2;
  686. var AFTER_CR = -1;
  687. var FIELD_START = 0;
  688. var FIELD = 1;
  689. var VALUE_START = 2;
  690. var VALUE = 3;
  691. var contentTypeRegExp = /^text\/event\-stream;?(\s*charset\=utf\-8)?$/i;
  692. var MINIMUM_DURATION = 1000;
  693. var MAXIMUM_DURATION = 18000000;
  694. var parseDuration = function parseDuration(value, def) {
  695. var n = parseInt(value, 10);
  696. if (n !== n) {
  697. n = def;
  698. }
  699. return clampDuration(n);
  700. };
  701. var clampDuration = function clampDuration(n) {
  702. return Math.min(Math.max(n, MINIMUM_DURATION), MAXIMUM_DURATION);
  703. };
  704. var fire = function fire(that, f, event) {
  705. try {
  706. if (typeof f === 'function') {
  707. f.call(that, event);
  708. }
  709. } catch (e) {
  710. throwError(e);
  711. }
  712. };
  713. function EventSourcePolyfill(url, options) {
  714. EventTarget.call(this);
  715. this.onopen = undefined;
  716. this.onmessage = undefined;
  717. this.onerror = undefined;
  718. this.url = undefined;
  719. this.readyState = undefined;
  720. this.withCredentials = undefined;
  721. this._close = undefined;
  722. start(this, url, options);
  723. }
  724. var isFetchSupported = _unfetch["default"] != undefined && Response != undefined && 'body' in Response.prototype;
  725. function start(es, url, options) {
  726. url = String(url);
  727. var withCredentials = options != undefined && Boolean(options.withCredentials);
  728. var initialRetry = clampDuration(1000);
  729. var heartbeatTimeout = options != undefined && options.heartbeatTimeout != undefined ? parseDuration(options.heartbeatTimeout, 45000) : clampDuration(45000);
  730. var lastEventId = '';
  731. var retry = initialRetry;
  732. var wasActivity = false;
  733. var headers = options != undefined && options.headers != undefined ? JSON.parse(JSON.stringify(options.headers)) : undefined;
  734. var CurrentTransport = options != undefined && options.Transport != undefined ? options.Transport : XMLHttpRequest;
  735. var xhr = isFetchSupported && !(options != undefined && options.Transport != undefined) ? undefined : new XHRWrapper(new CurrentTransport());
  736. var transport = xhr == undefined ? new FetchTransport() : new XHRTransport();
  737. var cancelFunction = undefined;
  738. var timeout = 0;
  739. var currentState = WAITING;
  740. var dataBuffer = '';
  741. var lastEventIdBuffer = '';
  742. var eventTypeBuffer = '';
  743. var textBuffer = '';
  744. var state = FIELD_START;
  745. var fieldStart = 0;
  746. var valueStart = 0;
  747. var onStart = function onStart(status, statusText, contentType, headers, cancel) {
  748. if (currentState === CONNECTING) {
  749. cancelFunction = cancel;
  750. if (status === 200 && contentType != undefined && contentTypeRegExp.test(contentType)) {
  751. currentState = OPEN;
  752. wasActivity = true;
  753. retry = initialRetry;
  754. es.readyState = OPEN;
  755. var event = new ConnectionEvent('open', {
  756. status: status,
  757. statusText: statusText,
  758. headers: headers
  759. });
  760. es.dispatchEvent(event);
  761. fire(es, es.onopen, event);
  762. } else {
  763. var message = '';
  764. if (status !== 200) {
  765. if (statusText) {
  766. statusText = statusText.replace(/\s+/g, ' ');
  767. }
  768. message = "EventSource's response has a status " + status + ' ' + statusText + ' that is not 200. Aborting the connection.';
  769. } else {
  770. message = "EventSource's response has a Content-Type specifying an unsupported type: " + (contentType == undefined ? '-' : contentType.replace(/\s+/g, ' ')) + '. Aborting the connection.';
  771. }
  772. throwError(new Error(message));
  773. close();
  774. var event = new ConnectionEvent('error', {
  775. status: status,
  776. statusText: statusText,
  777. headers: headers
  778. });
  779. es.dispatchEvent(event);
  780. fire(es, es.onerror, event);
  781. }
  782. }
  783. };
  784. var onProgress = function onProgress(textChunk) {
  785. if (currentState === OPEN) {
  786. var n = -1;
  787. for (var i = 0; i < textChunk.length; i += 1) {
  788. var c = textChunk.charCodeAt(i);
  789. if (c === '\n'.charCodeAt(0) || c === '\r'.charCodeAt(0)) {
  790. n = i;
  791. }
  792. }
  793. var chunk = (n !== -1 ? textBuffer : '') + textChunk.slice(0, n + 1);
  794. textBuffer = (n === -1 ? textBuffer : '') + textChunk.slice(n + 1);
  795. if (chunk !== '') {
  796. wasActivity = true;
  797. }
  798. for (var position = 0; position < chunk.length; position += 1) {
  799. var c = chunk.charCodeAt(position);
  800. if (state === AFTER_CR && c === '\n'.charCodeAt(0)) {
  801. state = FIELD_START;
  802. } else {
  803. if (state === AFTER_CR) {
  804. state = FIELD_START;
  805. }
  806. if (c === '\r'.charCodeAt(0) || c === '\n'.charCodeAt(0)) {
  807. if (state !== FIELD_START) {
  808. if (state === FIELD) {
  809. valueStart = position + 1;
  810. }
  811. var field = chunk.slice(fieldStart, valueStart - 1);
  812. var value = chunk.slice(valueStart + (valueStart < position && chunk.charCodeAt(valueStart) === ' '.charCodeAt(0) ? 1 : 0), position);
  813. if (field === 'data') {
  814. dataBuffer += '\n';
  815. dataBuffer += value;
  816. } else if (field === 'id') {
  817. lastEventIdBuffer = value;
  818. } else if (field === 'event') {
  819. eventTypeBuffer = value;
  820. } else if (field === 'retry') {
  821. initialRetry = parseDuration(value, initialRetry);
  822. retry = initialRetry;
  823. } else if (field === 'heartbeatTimeout') {
  824. heartbeatTimeout = parseDuration(value, heartbeatTimeout);
  825. if (timeout !== 0) {
  826. clearTimeout(timeout);
  827. timeout = setTimeout(function () {
  828. onTimeout();
  829. }, heartbeatTimeout);
  830. }
  831. }
  832. }
  833. if (state === FIELD_START) {
  834. if (dataBuffer !== '') {
  835. lastEventId = lastEventIdBuffer;
  836. if (eventTypeBuffer === '') {
  837. eventTypeBuffer = 'message';
  838. }
  839. var event = new MessageEvent(eventTypeBuffer, {
  840. data: dataBuffer.slice(1),
  841. lastEventId: lastEventIdBuffer
  842. });
  843. es.dispatchEvent(event);
  844. if (eventTypeBuffer === 'message') {
  845. fire(es, es.onmessage, event);
  846. }
  847. if (currentState === CLOSED) {
  848. return;
  849. }
  850. }
  851. dataBuffer = '';
  852. eventTypeBuffer = '';
  853. }
  854. state = c === '\r'.charCodeAt(0) ? AFTER_CR : FIELD_START;
  855. } else {
  856. if (state === FIELD_START) {
  857. fieldStart = position;
  858. state = FIELD;
  859. }
  860. if (state === FIELD) {
  861. if (c === ':'.charCodeAt(0)) {
  862. valueStart = position + 1;
  863. state = VALUE_START;
  864. }
  865. } else if (state === VALUE_START) {
  866. state = VALUE;
  867. }
  868. }
  869. }
  870. }
  871. }
  872. };
  873. var onFinish = function onFinish() {
  874. if (currentState === OPEN || currentState === CONNECTING) {
  875. currentState = WAITING;
  876. if (timeout !== 0) {
  877. clearTimeout(timeout);
  878. timeout = 0;
  879. }
  880. timeout = setTimeout(function () {
  881. onTimeout();
  882. }, retry);
  883. retry = clampDuration(Math.min(initialRetry * 16, retry * 2));
  884. es.readyState = CONNECTING;
  885. var event = new Event('error');
  886. es.dispatchEvent(event);
  887. fire(es, es.onerror, event);
  888. }
  889. };
  890. var close = function close() {
  891. currentState = CLOSED;
  892. if (cancelFunction != undefined) {
  893. cancelFunction();
  894. cancelFunction = undefined;
  895. }
  896. if (timeout !== 0) {
  897. clearTimeout(timeout);
  898. timeout = 0;
  899. }
  900. es.readyState = CLOSED;
  901. };
  902. var onTimeout = function onTimeout() {
  903. timeout = 0;
  904. if (currentState !== WAITING) {
  905. if (!wasActivity && cancelFunction != undefined) {
  906. throwError(new Error('No activity within ' + heartbeatTimeout + ' milliseconds. Reconnecting.'));
  907. cancelFunction();
  908. cancelFunction = undefined;
  909. } else {
  910. wasActivity = false;
  911. timeout = setTimeout(function () {
  912. onTimeout();
  913. }, heartbeatTimeout);
  914. }
  915. return;
  916. }
  917. wasActivity = false;
  918. timeout = setTimeout(function () {
  919. onTimeout();
  920. }, heartbeatTimeout);
  921. currentState = CONNECTING;
  922. dataBuffer = '';
  923. eventTypeBuffer = '';
  924. lastEventIdBuffer = lastEventId;
  925. textBuffer = '';
  926. fieldStart = 0;
  927. valueStart = 0;
  928. state = FIELD_START; // https://bugzilla.mozilla.org/show_bug.cgi?id=428916
  929. // Request header field Last-Event-ID is not allowed by Access-Control-Allow-Headers.
  930. var requestURL = url;
  931. if (url.slice(0, 5) !== 'data:' && url.slice(0, 5) !== 'blob:') {
  932. if (lastEventId !== '') {
  933. requestURL += (url.indexOf('?') === -1 ? '?' : '&') + 'lastEventId=' + encodeURIComponent(lastEventId);
  934. }
  935. }
  936. var requestHeaders = {};
  937. requestHeaders['Accept'] = 'text/event-stream';
  938. if (headers != undefined) {
  939. for (var name in headers) {
  940. if (Object.prototype.hasOwnProperty.call(headers, name)) {
  941. requestHeaders[name] = headers[name];
  942. }
  943. }
  944. }
  945. try {
  946. transport.open(xhr, onStart, onProgress, onFinish, requestURL, withCredentials, requestHeaders);
  947. } catch (error) {
  948. close();
  949. throw error;
  950. }
  951. };
  952. es.url = url;
  953. es.readyState = CONNECTING;
  954. es.withCredentials = withCredentials;
  955. es._close = close;
  956. onTimeout();
  957. }
  958. EventSourcePolyfill.prototype = Object.create(EventTarget.prototype);
  959. EventSourcePolyfill.prototype.CONNECTING = CONNECTING;
  960. EventSourcePolyfill.prototype.OPEN = OPEN;
  961. EventSourcePolyfill.prototype.CLOSED = CLOSED;
  962. EventSourcePolyfill.prototype.close = function () {
  963. this._close();
  964. };
  965. EventSourcePolyfill.CONNECTING = CONNECTING;
  966. EventSourcePolyfill.OPEN = OPEN;
  967. EventSourcePolyfill.CLOSED = CLOSED;
  968. EventSourcePolyfill.prototype.withCredentials = undefined;
  969. var _default = EventSourcePolyfill;
  970. exports["default"] = _default;
  971. /***/ }),
  972. /***/ "./node_modules/next/dist/client/dev/fouc.js":
  973. /*!***************************************************!*\
  974. !*** ./node_modules/next/dist/client/dev/fouc.js ***!
  975. \***************************************************/
  976. /*! no static exports found */
  977. /***/ (function(module, exports, __webpack_require__) {
  978. "use strict";
  979. exports.__esModule = true;
  980. exports.displayContent = displayContent;
  981. function displayContent(callback) {
  982. // This is the fallback helper that removes Next.js' no-FOUC styles when
  983. // CSS mode is enabled. This only really activates if you haven't created
  984. // _any_ styles in your application yet.
  985. ;
  986. (window.requestAnimationFrame || setTimeout)(function () {
  987. for (var x = document.querySelectorAll('[data-next-hide-fouc]'), i = x.length; i--;) {
  988. x[i].parentNode.removeChild(x[i]);
  989. }
  990. if (callback) {
  991. callback();
  992. }
  993. });
  994. }
  995. /***/ }),
  996. /***/ "./node_modules/next/dist/client/dev/on-demand-entries-utils.js":
  997. /*!**********************************************************************!*\
  998. !*** ./node_modules/next/dist/client/dev/on-demand-entries-utils.js ***!
  999. \**********************************************************************/
  1000. /*! no static exports found */
  1001. /***/ (function(module, exports, __webpack_require__) {
  1002. "use strict";
  1003. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js");
  1004. exports.__esModule = true;
  1005. exports.closePing = closePing;
  1006. exports.setupPing = setupPing;
  1007. exports.currentPage = void 0;
  1008. var _unfetch = _interopRequireDefault(__webpack_require__(/*! next/dist/build/polyfills/unfetch */ "./node_modules/next/dist/build/polyfills/unfetch.js"));
  1009. var _eventsource = __webpack_require__(/*! ./error-overlay/eventsource */ "./node_modules/next/dist/client/dev/error-overlay/eventsource.js");
  1010. /* global location */
  1011. var evtSource;
  1012. var currentPage;
  1013. exports.currentPage = currentPage;
  1014. function closePing() {
  1015. if (evtSource) evtSource.close();
  1016. evtSource = null;
  1017. }
  1018. function setupPing(assetPrefix, pathnameFn, retry) {
  1019. var pathname = pathnameFn(); // Make sure to only create new EventSource request if page has changed
  1020. if (pathname === currentPage && !retry) return;
  1021. exports.currentPage = currentPage = pathname; // close current EventSource connection
  1022. closePing();
  1023. var url = assetPrefix + "/_next/webpack-hmr?page=" + currentPage;
  1024. evtSource = (0, _eventsource.getEventSourceWrapper)({
  1025. path: url,
  1026. timeout: 5000,
  1027. ondemand: 1
  1028. });
  1029. evtSource.addMessageListener(function (event) {
  1030. if (event.data.indexOf('{') === -1) return;
  1031. try {
  1032. var payload = JSON.parse(event.data);
  1033. if (payload.invalid) {
  1034. // Payload can be invalid even if the page does not exist.
  1035. // So, we need to make sure it exists before reloading.
  1036. (0, _unfetch["default"])(location.href, {
  1037. credentials: 'same-origin'
  1038. }).then(function (pageRes) {
  1039. if (pageRes.status === 200) {
  1040. location.reload();
  1041. }
  1042. });
  1043. }
  1044. } catch (err) {
  1045. console.error('on-demand-entries failed to parse response', err);
  1046. }
  1047. });
  1048. }
  1049. /***/ }),
  1050. /***/ "./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js":
  1051. /*!****************************************************************************************!*\
  1052. !*** ./node_modules/next/node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
  1053. \****************************************************************************************/
  1054. /*! no static exports found */
  1055. /***/ (function(module, exports) {
  1056. function _interopRequireDefault(obj) {
  1057. return obj && obj.__esModule ? obj : {
  1058. "default": obj
  1059. };
  1060. }
  1061. module.exports = _interopRequireDefault;
  1062. /***/ }),
  1063. /***/ "./node_modules/next/node_modules/@babel/runtime/regenerator/index.js":
  1064. /*!****************************************************************************!*\
  1065. !*** ./node_modules/next/node_modules/@babel/runtime/regenerator/index.js ***!
  1066. \****************************************************************************/
  1067. /*! no static exports found */
  1068. /***/ (function(module, exports, __webpack_require__) {
  1069. module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
  1070. /***/ }),
  1071. /***/ "./node_modules/regenerator-runtime/runtime.js":
  1072. /*!*****************************************************!*\
  1073. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  1074. \*****************************************************/
  1075. /*! no static exports found */
  1076. /***/ (function(module, exports, __webpack_require__) {
  1077. /**
  1078. * Copyright (c) 2014-present, Facebook, Inc.
  1079. *
  1080. * This source code is licensed under the MIT license found in the
  1081. * LICENSE file in the root directory of this source tree.
  1082. */
  1083. var runtime = (function (exports) {
  1084. "use strict";
  1085. var Op = Object.prototype;
  1086. var hasOwn = Op.hasOwnProperty;
  1087. var undefined; // More compressible than void 0.
  1088. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  1089. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  1090. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  1091. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  1092. function define(obj, key, value) {
  1093. Object.defineProperty(obj, key, {
  1094. value: value,
  1095. enumerable: true,
  1096. configurable: true,
  1097. writable: true
  1098. });
  1099. return obj[key];
  1100. }
  1101. try {
  1102. // IE 8 has a broken Object.defineProperty that only works on DOM objects.
  1103. define({}, "");
  1104. } catch (err) {
  1105. define = function(obj, key, value) {
  1106. return obj[key] = value;
  1107. };
  1108. }
  1109. function wrap(innerFn, outerFn, self, tryLocsList) {
  1110. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  1111. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  1112. var generator = Object.create(protoGenerator.prototype);
  1113. var context = new Context(tryLocsList || []);
  1114. // The ._invoke method unifies the implementations of the .next,
  1115. // .throw, and .return methods.
  1116. generator._invoke = makeInvokeMethod(innerFn, self, context);
  1117. return generator;
  1118. }
  1119. exports.wrap = wrap;
  1120. // Try/catch helper to minimize deoptimizations. Returns a completion
  1121. // record like context.tryEntries[i].completion. This interface could
  1122. // have been (and was previously) designed to take a closure to be
  1123. // invoked without arguments, but in all the cases we care about we
  1124. // already have an existing method we want to call, so there's no need
  1125. // to create a new function object. We can even get away with assuming
  1126. // the method takes exactly one argument, since that happens to be true
  1127. // in every case, so we don't have to touch the arguments object. The
  1128. // only additional allocation required is the completion record, which
  1129. // has a stable shape and so hopefully should be cheap to allocate.
  1130. function tryCatch(fn, obj, arg) {
  1131. try {
  1132. return { type: "normal", arg: fn.call(obj, arg) };
  1133. } catch (err) {
  1134. return { type: "throw", arg: err };
  1135. }
  1136. }
  1137. var GenStateSuspendedStart = "suspendedStart";
  1138. var GenStateSuspendedYield = "suspendedYield";
  1139. var GenStateExecuting = "executing";
  1140. var GenStateCompleted = "completed";
  1141. // Returning this object from the innerFn has the same effect as
  1142. // breaking out of the dispatch switch statement.
  1143. var ContinueSentinel = {};
  1144. // Dummy constructor functions that we use as the .constructor and
  1145. // .constructor.prototype properties for functions that return Generator
  1146. // objects. For full spec compliance, you may wish to configure your
  1147. // minifier not to mangle the names of these two functions.
  1148. function Generator() {}
  1149. function GeneratorFunction() {}
  1150. function GeneratorFunctionPrototype() {}
  1151. // This is a polyfill for %IteratorPrototype% for environments that
  1152. // don't natively support it.
  1153. var IteratorPrototype = {};
  1154. IteratorPrototype[iteratorSymbol] = function () {
  1155. return this;
  1156. };
  1157. var getProto = Object.getPrototypeOf;
  1158. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  1159. if (NativeIteratorPrototype &&
  1160. NativeIteratorPrototype !== Op &&
  1161. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  1162. // This environment has a native %IteratorPrototype%; use it instead
  1163. // of the polyfill.
  1164. IteratorPrototype = NativeIteratorPrototype;
  1165. }
  1166. var Gp = GeneratorFunctionPrototype.prototype =
  1167. Generator.prototype = Object.create(IteratorPrototype);
  1168. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  1169. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  1170. GeneratorFunction.displayName = define(
  1171. GeneratorFunctionPrototype,
  1172. toStringTagSymbol,
  1173. "GeneratorFunction"
  1174. );
  1175. // Helper for defining the .next, .throw, and .return methods of the
  1176. // Iterator interface in terms of a single ._invoke method.
  1177. function defineIteratorMethods(prototype) {
  1178. ["next", "throw", "return"].forEach(function(method) {
  1179. define(prototype, method, function(arg) {
  1180. return this._invoke(method, arg);
  1181. });
  1182. });
  1183. }
  1184. exports.isGeneratorFunction = function(genFun) {
  1185. var ctor = typeof genFun === "function" && genFun.constructor;
  1186. return ctor
  1187. ? ctor === GeneratorFunction ||
  1188. // For the native GeneratorFunction constructor, the best we can
  1189. // do is to check its .name property.
  1190. (ctor.displayName || ctor.name) === "GeneratorFunction"
  1191. : false;
  1192. };
  1193. exports.mark = function(genFun) {
  1194. if (Object.setPrototypeOf) {
  1195. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  1196. } else {
  1197. genFun.__proto__ = GeneratorFunctionPrototype;
  1198. define(genFun, toStringTagSymbol, "GeneratorFunction");
  1199. }
  1200. genFun.prototype = Object.create(Gp);
  1201. return genFun;
  1202. };
  1203. // Within the body of any async function, `await x` is transformed to
  1204. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  1205. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  1206. // meant to be awaited.
  1207. exports.awrap = function(arg) {
  1208. return { __await: arg };
  1209. };
  1210. function AsyncIterator(generator, PromiseImpl) {
  1211. function invoke(method, arg, resolve, reject) {
  1212. var record = tryCatch(generator[method], generator, arg);
  1213. if (record.type === "throw") {
  1214. reject(record.arg);
  1215. } else {
  1216. var result = record.arg;
  1217. var value = result.value;
  1218. if (value &&
  1219. typeof value === "object" &&
  1220. hasOwn.call(value, "__await")) {
  1221. return PromiseImpl.resolve(value.__await).then(function(value) {
  1222. invoke("next", value, resolve, reject);
  1223. }, function(err) {
  1224. invoke("throw", err, resolve, reject);
  1225. });
  1226. }
  1227. return PromiseImpl.resolve(value).then(function(unwrapped) {
  1228. // When a yielded Promise is resolved, its final value becomes
  1229. // the .value of the Promise<{value,done}> result for the
  1230. // current iteration.
  1231. result.value = unwrapped;
  1232. resolve(result);
  1233. }, function(error) {
  1234. // If a rejected Promise was yielded, throw the rejection back
  1235. // into the async generator function so it can be handled there.
  1236. return invoke("throw", error, resolve, reject);
  1237. });
  1238. }
  1239. }
  1240. var previousPromise;
  1241. function enqueue(method, arg) {
  1242. function callInvokeWithMethodAndArg() {
  1243. return new PromiseImpl(function(resolve, reject) {
  1244. invoke(method, arg, resolve, reject);
  1245. });
  1246. }
  1247. return previousPromise =
  1248. // If enqueue has been called before, then we want to wait until
  1249. // all previous Promises have been resolved before calling invoke,
  1250. // so that results are always delivered in the correct order. If
  1251. // enqueue has not been called before, then it is important to
  1252. // call invoke immediately, without waiting on a callback to fire,
  1253. // so that the async generator function has the opportunity to do
  1254. // any necessary setup in a predictable way. This predictability
  1255. // is why the Promise constructor synchronously invokes its
  1256. // executor callback, and why async functions synchronously
  1257. // execute code before the first await. Since we implement simple
  1258. // async functions in terms of async generators, it is especially
  1259. // important to get this right, even though it requires care.
  1260. previousPromise ? previousPromise.then(
  1261. callInvokeWithMethodAndArg,
  1262. // Avoid propagating failures to Promises returned by later
  1263. // invocations of the iterator.
  1264. callInvokeWithMethodAndArg
  1265. ) : callInvokeWithMethodAndArg();
  1266. }
  1267. // Define the unified helper method that is used to implement .next,
  1268. // .throw, and .return (see defineIteratorMethods).
  1269. this._invoke = enqueue;
  1270. }
  1271. defineIteratorMethods(AsyncIterator.prototype);
  1272. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  1273. return this;
  1274. };
  1275. exports.AsyncIterator = AsyncIterator;
  1276. // Note that simple async functions are implemented on top of
  1277. // AsyncIterator objects; they just return a Promise for the value of
  1278. // the final result produced by the iterator.
  1279. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  1280. if (PromiseImpl === void 0) PromiseImpl = Promise;
  1281. var iter = new AsyncIterator(
  1282. wrap(innerFn, outerFn, self, tryLocsList),
  1283. PromiseImpl
  1284. );
  1285. return exports.isGeneratorFunction(outerFn)
  1286. ? iter // If outerFn is a generator, return the full iterator.
  1287. : iter.next().then(function(result) {
  1288. return result.done ? result.value : iter.next();
  1289. });
  1290. };
  1291. function makeInvokeMethod(innerFn, self, context) {
  1292. var state = GenStateSuspendedStart;
  1293. return function invoke(method, arg) {
  1294. if (state === GenStateExecuting) {
  1295. throw new Error("Generator is already running");
  1296. }
  1297. if (state === GenStateCompleted) {
  1298. if (method === "throw") {
  1299. throw arg;
  1300. }
  1301. // Be forgiving, per 25.3.3.3.3 of the spec:
  1302. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  1303. return doneResult();
  1304. }
  1305. context.method = method;
  1306. context.arg = arg;
  1307. while (true) {
  1308. var delegate = context.delegate;
  1309. if (delegate) {
  1310. var delegateResult = maybeInvokeDelegate(delegate, context);
  1311. if (delegateResult) {
  1312. if (delegateResult === ContinueSentinel) continue;
  1313. return delegateResult;
  1314. }
  1315. }
  1316. if (context.method === "next") {
  1317. // Setting context._sent for legacy support of Babel's
  1318. // function.sent implementation.
  1319. context.sent = context._sent = context.arg;
  1320. } else if (context.method === "throw") {
  1321. if (state === GenStateSuspendedStart) {
  1322. state = GenStateCompleted;
  1323. throw context.arg;
  1324. }
  1325. context.dispatchException(context.arg);
  1326. } else if (context.method === "return") {
  1327. context.abrupt("return", context.arg);
  1328. }
  1329. state = GenStateExecuting;
  1330. var record = tryCatch(innerFn, self, context);
  1331. if (record.type === "normal") {
  1332. // If an exception is thrown from innerFn, we leave state ===
  1333. // GenStateExecuting and loop back for another invocation.
  1334. state = context.done
  1335. ? GenStateCompleted
  1336. : GenStateSuspendedYield;
  1337. if (record.arg === ContinueSentinel) {
  1338. continue;
  1339. }
  1340. return {
  1341. value: record.arg,
  1342. done: context.done
  1343. };
  1344. } else if (record.type === "throw") {
  1345. state = GenStateCompleted;
  1346. // Dispatch the exception by looping back around to the
  1347. // context.dispatchException(context.arg) call above.
  1348. context.method = "throw";
  1349. context.arg = record.arg;
  1350. }
  1351. }
  1352. };
  1353. }
  1354. // Call delegate.iterator[context.method](context.arg) and handle the
  1355. // result, either by returning a { value, done } result from the
  1356. // delegate iterator, or by modifying context.method and context.arg,
  1357. // setting context.delegate to null, and returning the ContinueSentinel.
  1358. function maybeInvokeDelegate(delegate, context) {
  1359. var method = delegate.iterator[context.method];
  1360. if (method === undefined) {
  1361. // A .throw or .return when the delegate iterator has no .throw
  1362. // method always terminates the yield* loop.
  1363. context.delegate = null;
  1364. if (context.method === "throw") {
  1365. // Note: ["return"] must be used for ES3 parsing compatibility.
  1366. if (delegate.iterator["return"]) {
  1367. // If the delegate iterator has a return method, give it a
  1368. // chance to clean up.
  1369. context.method = "return";
  1370. context.arg = undefined;
  1371. maybeInvokeDelegate(delegate, context);
  1372. if (context.method === "throw") {
  1373. // If maybeInvokeDelegate(context) changed context.method from
  1374. // "return" to "throw", let that override the TypeError below.
  1375. return ContinueSentinel;
  1376. }
  1377. }
  1378. context.method = "throw";
  1379. context.arg = new TypeError(
  1380. "The iterator does not provide a 'throw' method");
  1381. }
  1382. return ContinueSentinel;
  1383. }
  1384. var record = tryCatch(method, delegate.iterator, context.arg);
  1385. if (record.type === "throw") {
  1386. context.method = "throw";
  1387. context.arg = record.arg;
  1388. context.delegate = null;
  1389. return ContinueSentinel;
  1390. }
  1391. var info = record.arg;
  1392. if (! info) {
  1393. context.method = "throw";
  1394. context.arg = new TypeError("iterator result is not an object");
  1395. context.delegate = null;
  1396. return ContinueSentinel;
  1397. }
  1398. if (info.done) {
  1399. // Assign the result of the finished delegate to the temporary
  1400. // variable specified by delegate.resultName (see delegateYield).
  1401. context[delegate.resultName] = info.value;
  1402. // Resume execution at the desired location (see delegateYield).
  1403. context.next = delegate.nextLoc;
  1404. // If context.method was "throw" but the delegate handled the
  1405. // exception, let the outer generator proceed normally. If
  1406. // context.method was "next", forget context.arg since it has been
  1407. // "consumed" by the delegate iterator. If context.method was
  1408. // "return", allow the original .return call to continue in the
  1409. // outer generator.
  1410. if (context.method !== "return") {
  1411. context.method = "next";
  1412. context.arg = undefined;
  1413. }
  1414. } else {
  1415. // Re-yield the result returned by the delegate method.
  1416. return info;
  1417. }
  1418. // The delegate iterator is finished, so forget it and continue with
  1419. // the outer generator.
  1420. context.delegate = null;
  1421. return ContinueSentinel;
  1422. }
  1423. // Define Generator.prototype.{next,throw,return} in terms of the
  1424. // unified ._invoke helper method.
  1425. defineIteratorMethods(Gp);
  1426. define(Gp, toStringTagSymbol, "Generator");
  1427. // A Generator should always return itself as the iterator object when the
  1428. // @@iterator function is called on it. Some browsers' implementations of the
  1429. // iterator prototype chain incorrectly implement this, causing the Generator
  1430. // object to not be returned from this call. This ensures that doesn't happen.
  1431. // See https://github.com/facebook/regenerator/issues/274 for more details.
  1432. Gp[iteratorSymbol] = function() {
  1433. return this;
  1434. };
  1435. Gp.toString = function() {
  1436. return "[object Generator]";
  1437. };
  1438. function pushTryEntry(locs) {
  1439. var entry = { tryLoc: locs[0] };
  1440. if (1 in locs) {
  1441. entry.catchLoc = locs[1];
  1442. }
  1443. if (2 in locs) {
  1444. entry.finallyLoc = locs[2];
  1445. entry.afterLoc = locs[3];
  1446. }
  1447. this.tryEntries.push(entry);
  1448. }
  1449. function resetTryEntry(entry) {
  1450. var record = entry.completion || {};
  1451. record.type = "normal";
  1452. delete record.arg;
  1453. entry.completion = record;
  1454. }
  1455. function Context(tryLocsList) {
  1456. // The root entry object (effectively a try statement without a catch
  1457. // or a finally block) gives us a place to store values thrown from
  1458. // locations where there is no enclosing try statement.
  1459. this.tryEntries = [{ tryLoc: "root" }];
  1460. tryLocsList.forEach(pushTryEntry, this);
  1461. this.reset(true);
  1462. }
  1463. exports.keys = function(object) {
  1464. var keys = [];
  1465. for (var key in object) {
  1466. keys.push(key);
  1467. }
  1468. keys.reverse();
  1469. // Rather than returning an object with a next method, we keep
  1470. // things simple and return the next function itself.
  1471. return function next() {
  1472. while (keys.length) {
  1473. var key = keys.pop();
  1474. if (key in object) {
  1475. next.value = key;
  1476. next.done = false;
  1477. return next;
  1478. }
  1479. }
  1480. // To avoid creating an additional object, we just hang the .value
  1481. // and .done properties off the next function object itself. This
  1482. // also ensures that the minifier will not anonymize the function.
  1483. next.done = true;
  1484. return next;
  1485. };
  1486. };
  1487. function values(iterable) {
  1488. if (iterable) {
  1489. var iteratorMethod = iterable[iteratorSymbol];
  1490. if (iteratorMethod) {
  1491. return iteratorMethod.call(iterable);
  1492. }
  1493. if (typeof iterable.next === "function") {
  1494. return iterable;
  1495. }
  1496. if (!isNaN(iterable.length)) {
  1497. var i = -1, next = function next() {
  1498. while (++i < iterable.length) {
  1499. if (hasOwn.call(iterable, i)) {
  1500. next.value = iterable[i];
  1501. next.done = false;
  1502. return next;
  1503. }
  1504. }
  1505. next.value = undefined;
  1506. next.done = true;
  1507. return next;
  1508. };
  1509. return next.next = next;
  1510. }
  1511. }
  1512. // Return an iterator with no values.
  1513. return { next: doneResult };
  1514. }
  1515. exports.values = values;
  1516. function doneResult() {
  1517. return { value: undefined, done: true };
  1518. }
  1519. Context.prototype = {
  1520. constructor: Context,
  1521. reset: function(skipTempReset) {
  1522. this.prev = 0;
  1523. this.next = 0;
  1524. // Resetting context._sent for legacy support of Babel's
  1525. // function.sent implementation.
  1526. this.sent = this._sent = undefined;
  1527. this.done = false;
  1528. this.delegate = null;
  1529. this.method = "next";
  1530. this.arg = undefined;
  1531. this.tryEntries.forEach(resetTryEntry);
  1532. if (!skipTempReset) {
  1533. for (var name in this) {
  1534. // Not sure about the optimal order of these conditions:
  1535. if (name.charAt(0) === "t" &&
  1536. hasOwn.call(this, name) &&
  1537. !isNaN(+name.slice(1))) {
  1538. this[name] = undefined;
  1539. }
  1540. }
  1541. }
  1542. },
  1543. stop: function() {
  1544. this.done = true;
  1545. var rootEntry = this.tryEntries[0];
  1546. var rootRecord = rootEntry.completion;
  1547. if (rootRecord.type === "throw") {
  1548. throw rootRecord.arg;
  1549. }
  1550. return this.rval;
  1551. },
  1552. dispatchException: function(exception) {
  1553. if (this.done) {
  1554. throw exception;
  1555. }
  1556. var context = this;
  1557. function handle(loc, caught) {
  1558. record.type = "throw";
  1559. record.arg = exception;
  1560. context.next = loc;
  1561. if (caught) {
  1562. // If the dispatched exception was caught by a catch block,
  1563. // then let that catch block handle the exception normally.
  1564. context.method = "next";
  1565. context.arg = undefined;
  1566. }
  1567. return !! caught;
  1568. }
  1569. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  1570. var entry = this.tryEntries[i];
  1571. var record = entry.completion;
  1572. if (entry.tryLoc === "root") {
  1573. // Exception thrown outside of any try block that could handle
  1574. // it, so set the completion value of the entire function to
  1575. // throw the exception.
  1576. return handle("end");
  1577. }
  1578. if (entry.tryLoc <= this.prev) {
  1579. var hasCatch = hasOwn.call(entry, "catchLoc");
  1580. var hasFinally = hasOwn.call(entry, "finallyLoc");
  1581. if (hasCatch && hasFinally) {
  1582. if (this.prev < entry.catchLoc) {
  1583. return handle(entry.catchLoc, true);
  1584. } else if (this.prev < entry.finallyLoc) {
  1585. return handle(entry.finallyLoc);
  1586. }
  1587. } else if (hasCatch) {
  1588. if (this.prev < entry.catchLoc) {
  1589. return handle(entry.catchLoc, true);
  1590. }
  1591. } else if (hasFinally) {
  1592. if (this.prev < entry.finallyLoc) {
  1593. return handle(entry.finallyLoc);
  1594. }
  1595. } else {
  1596. throw new Error("try statement without catch or finally");
  1597. }
  1598. }
  1599. }
  1600. },
  1601. abrupt: function(type, arg) {
  1602. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  1603. var entry = this.tryEntries[i];
  1604. if (entry.tryLoc <= this.prev &&
  1605. hasOwn.call(entry, "finallyLoc") &&
  1606. this.prev < entry.finallyLoc) {
  1607. var finallyEntry = entry;
  1608. break;
  1609. }
  1610. }
  1611. if (finallyEntry &&
  1612. (type === "break" ||
  1613. type === "continue") &&
  1614. finallyEntry.tryLoc <= arg &&
  1615. arg <= finallyEntry.finallyLoc) {
  1616. // Ignore the finally entry if control is not jumping to a
  1617. // location outside the try/catch block.
  1618. finallyEntry = null;
  1619. }
  1620. var record = finallyEntry ? finallyEntry.completion : {};
  1621. record.type = type;
  1622. record.arg = arg;
  1623. if (finallyEntry) {
  1624. this.method = "next";
  1625. this.next = finallyEntry.finallyLoc;
  1626. return ContinueSentinel;
  1627. }
  1628. return this.complete(record);
  1629. },
  1630. complete: function(record, afterLoc) {
  1631. if (record.type === "throw") {
  1632. throw record.arg;
  1633. }
  1634. if (record.type === "break" ||
  1635. record.type === "continue") {
  1636. this.next = record.arg;
  1637. } else if (record.type === "return") {
  1638. this.rval = this.arg = record.arg;
  1639. this.method = "return";
  1640. this.next = "end";
  1641. } else if (record.type === "normal" && afterLoc) {
  1642. this.next = afterLoc;
  1643. }
  1644. return ContinueSentinel;
  1645. },
  1646. finish: function(finallyLoc) {
  1647. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  1648. var entry = this.tryEntries[i];
  1649. if (entry.finallyLoc === finallyLoc) {
  1650. this.complete(entry.completion, entry.afterLoc);
  1651. resetTryEntry(entry);
  1652. return ContinueSentinel;
  1653. }
  1654. }
  1655. },
  1656. "catch": function(tryLoc) {
  1657. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  1658. var entry = this.tryEntries[i];
  1659. if (entry.tryLoc === tryLoc) {
  1660. var record = entry.completion;
  1661. if (record.type === "throw") {
  1662. var thrown = record.arg;
  1663. resetTryEntry(entry);
  1664. }
  1665. return thrown;
  1666. }
  1667. }
  1668. // The context.catch method must only be called with a location
  1669. // argument that corresponds to a known catch block.
  1670. throw new Error("illegal catch attempt");
  1671. },
  1672. delegateYield: function(iterable, resultName, nextLoc) {
  1673. this.delegate = {
  1674. iterator: values(iterable),
  1675. resultName: resultName,
  1676. nextLoc: nextLoc
  1677. };
  1678. if (this.method === "next") {
  1679. // Deliberately forget the last sent value so that we don't
  1680. // accidentally pass it on to the delegate.
  1681. this.arg = undefined;
  1682. }
  1683. return ContinueSentinel;
  1684. }
  1685. };
  1686. // Regardless of whether this script is executing as a CommonJS module
  1687. // or not, return the runtime object so that we can declare the variable
  1688. // regeneratorRuntime in the outer scope, which allows this module to be
  1689. // injected easily by `bin/regenerator --include-runtime script.js`.
  1690. return exports;
  1691. }(
  1692. // If this script is executing as a CommonJS module, use module.exports
  1693. // as the regeneratorRuntime namespace. Otherwise create a new empty
  1694. // object. Either way, the resulting object will be used to initialize
  1695. // the regeneratorRuntime variable at the top of this file.
  1696. true ? module.exports : undefined
  1697. ));
  1698. try {
  1699. regeneratorRuntime = runtime;
  1700. } catch (accidentalStrictMode) {
  1701. // This module should not be running in strict mode, so the above
  1702. // assignment should always work unless something is misconfigured. Just
  1703. // in case runtime.js accidentally runs in strict mode, we can escape
  1704. // strict mode using a global Function call. This could conceivably fail
  1705. // if a Content Security Policy forbids using Function, but in that case
  1706. // the proper solution is to fix the accidental strict mode problem. If
  1707. // you've misconfigured your bundler to force strict mode and applied a
  1708. // CSP to forbid Function, and you're not willing to fix either of those
  1709. // problems, please detail your unique predicament in a GitHub issue.
  1710. Function("r", "regeneratorRuntime = r")(runtime);
  1711. }
  1712. /***/ })
  1713. },[["./node_modules/next/dist/client/dev/amp-dev.js","static/runtime/webpack.js"]]]);
  1714. //# sourceMappingURL=amp.js.map