[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> api-fetch.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 355);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 1:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["i18n"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 15:
  98  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99  
 100  "use strict";
 101  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
 102  function _defineProperty(obj, key, value) {
 103    if (key in obj) {
 104      Object.defineProperty(obj, key, {
 105        value: value,
 106        enumerable: true,
 107        configurable: true,
 108        writable: true
 109      });
 110    } else {
 111      obj[key] = value;
 112    }
 113  
 114    return obj;
 115  }
 116  
 117  /***/ }),
 118  
 119  /***/ 21:
 120  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 121  
 122  "use strict";
 123  
 124  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
 125  function _objectWithoutPropertiesLoose(source, excluded) {
 126    if (source == null) return {};
 127    var target = {};
 128    var sourceKeys = Object.keys(source);
 129    var key, i;
 130  
 131    for (i = 0; i < sourceKeys.length; i++) {
 132      key = sourceKeys[i];
 133      if (excluded.indexOf(key) >= 0) continue;
 134      target[key] = source[key];
 135    }
 136  
 137    return target;
 138  }
 139  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
 140  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; });
 141  
 142  function _objectWithoutProperties(source, excluded) {
 143    if (source == null) return {};
 144    var target = _objectWithoutPropertiesLoose(source, excluded);
 145    var key, i;
 146  
 147    if (Object.getOwnPropertySymbols) {
 148      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
 149  
 150      for (i = 0; i < sourceSymbolKeys.length; i++) {
 151        key = sourceSymbolKeys[i];
 152        if (excluded.indexOf(key) >= 0) continue;
 153        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
 154        target[key] = source[key];
 155      }
 156    }
 157  
 158    return target;
 159  }
 160  
 161  /***/ }),
 162  
 163  /***/ 23:
 164  /***/ (function(module, exports, __webpack_require__) {
 165  
 166  module.exports = __webpack_require__(54);
 167  
 168  
 169  /***/ }),
 170  
 171  /***/ 25:
 172  /***/ (function(module, exports) {
 173  
 174  (function() { module.exports = this["wp"]["url"]; }());
 175  
 176  /***/ }),
 177  
 178  /***/ 355:
 179  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 180  
 181  "use strict";
 182  __webpack_require__.r(__webpack_exports__);
 183  
 184  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js
 185  var objectSpread = __webpack_require__(7);
 186  
 187  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules
 188  var objectWithoutProperties = __webpack_require__(21);
 189  
 190  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
 191  var external_this_wp_i18n_ = __webpack_require__(1);
 192  
 193  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/nonce.js
 194  
 195  
 196  function createNonceMiddleware(nonce) {
 197    function middleware(options, next) {
 198      var _options$headers = options.headers,
 199          headers = _options$headers === void 0 ? {} : _options$headers; // If an 'X-WP-Nonce' header (or any case-insensitive variation
 200      // thereof) was specified, no need to add a nonce header.
 201  
 202      for (var headerName in headers) {
 203        if (headerName.toLowerCase() === 'x-wp-nonce') {
 204          return next(options);
 205        }
 206      }
 207  
 208      return next(Object(objectSpread["a" /* default */])({}, options, {
 209        headers: Object(objectSpread["a" /* default */])({}, headers, {
 210          'X-WP-Nonce': middleware.nonce
 211        })
 212      }));
 213    }
 214  
 215    middleware.nonce = nonce;
 216    return middleware;
 217  }
 218  
 219  /* harmony default export */ var middlewares_nonce = (createNonceMiddleware);
 220  
 221  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/namespace-endpoint.js
 222  
 223  
 224  var namespace_endpoint_namespaceAndEndpointMiddleware = function namespaceAndEndpointMiddleware(options, next) {
 225    var path = options.path;
 226    var namespaceTrimmed, endpointTrimmed;
 227  
 228    if (typeof options.namespace === 'string' && typeof options.endpoint === 'string') {
 229      namespaceTrimmed = options.namespace.replace(/^\/|\/$/g, '');
 230      endpointTrimmed = options.endpoint.replace(/^\//, '');
 231  
 232      if (endpointTrimmed) {
 233        path = namespaceTrimmed + '/' + endpointTrimmed;
 234      } else {
 235        path = namespaceTrimmed;
 236      }
 237    }
 238  
 239    delete options.namespace;
 240    delete options.endpoint;
 241    return next(Object(objectSpread["a" /* default */])({}, options, {
 242      path: path
 243    }));
 244  };
 245  
 246  /* harmony default export */ var namespace_endpoint = (namespace_endpoint_namespaceAndEndpointMiddleware);
 247  
 248  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/root-url.js
 249  
 250  
 251  /**
 252   * Internal dependencies
 253   */
 254  
 255  
 256  var root_url_createRootURLMiddleware = function createRootURLMiddleware(rootURL) {
 257    return function (options, next) {
 258      return namespace_endpoint(options, function (optionsWithPath) {
 259        var url = optionsWithPath.url;
 260        var path = optionsWithPath.path;
 261        var apiRoot;
 262  
 263        if (typeof path === 'string') {
 264          apiRoot = rootURL;
 265  
 266          if (-1 !== rootURL.indexOf('?')) {
 267            path = path.replace('?', '&');
 268          }
 269  
 270          path = path.replace(/^\//, ''); // API root may already include query parameter prefix if site is
 271          // configured to use plain permalinks.
 272  
 273          if ('string' === typeof apiRoot && -1 !== apiRoot.indexOf('?')) {
 274            path = path.replace('?', '&');
 275          }
 276  
 277          url = apiRoot + path;
 278        }
 279  
 280        return next(Object(objectSpread["a" /* default */])({}, optionsWithPath, {
 281          url: url
 282        }));
 283      });
 284    };
 285  };
 286  
 287  /* harmony default export */ var root_url = (root_url_createRootURLMiddleware);
 288  
 289  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/preloading.js
 290  var createPreloadingMiddleware = function createPreloadingMiddleware(preloadedData) {
 291    return function (options, next) {
 292      function getStablePath(path) {
 293        var splitted = path.split('?');
 294        var query = splitted[1];
 295        var base = splitted[0];
 296  
 297        if (!query) {
 298          return base;
 299        } // 'b=1&c=2&a=5'
 300  
 301  
 302        return base + '?' + query // [ 'b=1', 'c=2', 'a=5' ]
 303        .split('&') // [ [ 'b, '1' ], [ 'c', '2' ], [ 'a', '5' ] ]
 304        .map(function (entry) {
 305          return entry.split('=');
 306        }) // [ [ 'a', '5' ], [ 'b, '1' ], [ 'c', '2' ] ]
 307        .sort(function (a, b) {
 308          return a[0].localeCompare(b[0]);
 309        }) // [ 'a=5', 'b=1', 'c=2' ]
 310        .map(function (pair) {
 311          return pair.join('=');
 312        }) // 'a=5&b=1&c=2'
 313        .join('&');
 314      }
 315  
 316      var _options$parse = options.parse,
 317          parse = _options$parse === void 0 ? true : _options$parse;
 318  
 319      if (typeof options.path === 'string') {
 320        var method = options.method || 'GET';
 321        var path = getStablePath(options.path);
 322  
 323        if (parse && 'GET' === method && preloadedData[path]) {
 324          return Promise.resolve(preloadedData[path].body);
 325        } else if ('OPTIONS' === method && preloadedData[method] && preloadedData[method][path]) {
 326          return Promise.resolve(preloadedData[method][path]);
 327        }
 328      }
 329  
 330      return next(options);
 331    };
 332  };
 333  
 334  /* harmony default export */ var preloading = (createPreloadingMiddleware);
 335  
 336  // EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js
 337  var regenerator = __webpack_require__(23);
 338  var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
 339  
 340  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
 341  var asyncToGenerator = __webpack_require__(44);
 342  
 343  // EXTERNAL MODULE: external {"this":["wp","url"]}
 344  var external_this_wp_url_ = __webpack_require__(25);
 345  
 346  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/fetch-all-middleware.js
 347  
 348  
 349  
 350  
 351  
 352  /**
 353   * WordPress dependencies
 354   */
 355   // Apply query arguments to both URL and Path, whichever is present.
 356  
 357  var fetch_all_middleware_modifyQuery = function modifyQuery(_ref, queryArgs) {
 358    var path = _ref.path,
 359        url = _ref.url,
 360        options = Object(objectWithoutProperties["a" /* default */])(_ref, ["path", "url"]);
 361  
 362    return Object(objectSpread["a" /* default */])({}, options, {
 363      url: url && Object(external_this_wp_url_["addQueryArgs"])(url, queryArgs),
 364      path: path && Object(external_this_wp_url_["addQueryArgs"])(path, queryArgs)
 365    });
 366  }; // Duplicates parsing functionality from apiFetch.
 367  
 368  
 369  var fetch_all_middleware_parseResponse = function parseResponse(response) {
 370    return response.json ? response.json() : Promise.reject(response);
 371  };
 372  
 373  var parseLinkHeader = function parseLinkHeader(linkHeader) {
 374    if (!linkHeader) {
 375      return {};
 376    }
 377  
 378    var match = linkHeader.match(/<([^>]+)>; rel="next"/);
 379    return match ? {
 380      next: match[1]
 381    } : {};
 382  };
 383  
 384  var getNextPageUrl = function getNextPageUrl(response) {
 385    var _parseLinkHeader = parseLinkHeader(response.headers.get('link')),
 386        next = _parseLinkHeader.next;
 387  
 388    return next;
 389  };
 390  
 391  var requestContainsUnboundedQuery = function requestContainsUnboundedQuery(options) {
 392    var pathIsUnbounded = options.path && options.path.indexOf('per_page=-1') !== -1;
 393    var urlIsUnbounded = options.url && options.url.indexOf('per_page=-1') !== -1;
 394    return pathIsUnbounded || urlIsUnbounded;
 395  }; // The REST API enforces an upper limit on the per_page option. To handle large
 396  // collections, apiFetch consumers can pass `per_page=-1`; this middleware will
 397  // then recursively assemble a full response array from all available pages.
 398  
 399  
 400  var fetchAllMiddleware =
 401  /*#__PURE__*/
 402  function () {
 403    var _ref2 = Object(asyncToGenerator["a" /* default */])(
 404    /*#__PURE__*/
 405    regenerator_default.a.mark(function _callee(options, next) {
 406      var response, results, nextPage, mergedResults, nextResponse, nextResults;
 407      return regenerator_default.a.wrap(function _callee$(_context) {
 408        while (1) {
 409          switch (_context.prev = _context.next) {
 410            case 0:
 411              if (!(options.parse === false)) {
 412                _context.next = 2;
 413                break;
 414              }
 415  
 416              return _context.abrupt("return", next(options));
 417  
 418            case 2:
 419              if (requestContainsUnboundedQuery(options)) {
 420                _context.next = 4;
 421                break;
 422              }
 423  
 424              return _context.abrupt("return", next(options));
 425  
 426            case 4:
 427              _context.next = 6;
 428              return next(Object(objectSpread["a" /* default */])({}, fetch_all_middleware_modifyQuery(options, {
 429                per_page: 100
 430              }), {
 431                // Ensure headers are returned for page 1.
 432                parse: false
 433              }));
 434  
 435            case 6:
 436              response = _context.sent;
 437              _context.next = 9;
 438              return fetch_all_middleware_parseResponse(response);
 439  
 440            case 9:
 441              results = _context.sent;
 442  
 443              if (Array.isArray(results)) {
 444                _context.next = 12;
 445                break;
 446              }
 447  
 448              return _context.abrupt("return", results);
 449  
 450            case 12:
 451              nextPage = getNextPageUrl(response);
 452  
 453              if (nextPage) {
 454                _context.next = 15;
 455                break;
 456              }
 457  
 458              return _context.abrupt("return", results);
 459  
 460            case 15:
 461              // Iteratively fetch all remaining pages until no "next" header is found.
 462              mergedResults = [].concat(results);
 463  
 464            case 16:
 465              if (!nextPage) {
 466                _context.next = 27;
 467                break;
 468              }
 469  
 470              _context.next = 19;
 471              return next(Object(objectSpread["a" /* default */])({}, options, {
 472                // Ensure the URL for the next page is used instead of any provided path.
 473                path: undefined,
 474                url: nextPage,
 475                // Ensure we still get headers so we can identify the next page.
 476                parse: false
 477              }));
 478  
 479            case 19:
 480              nextResponse = _context.sent;
 481              _context.next = 22;
 482              return fetch_all_middleware_parseResponse(nextResponse);
 483  
 484            case 22:
 485              nextResults = _context.sent;
 486              mergedResults = mergedResults.concat(nextResults);
 487              nextPage = getNextPageUrl(nextResponse);
 488              _context.next = 16;
 489              break;
 490  
 491            case 27:
 492              return _context.abrupt("return", mergedResults);
 493  
 494            case 28:
 495            case "end":
 496              return _context.stop();
 497          }
 498        }
 499      }, _callee, this);
 500    }));
 501  
 502    return function fetchAllMiddleware(_x, _x2) {
 503      return _ref2.apply(this, arguments);
 504    };
 505  }();
 506  
 507  /* harmony default export */ var fetch_all_middleware = (fetchAllMiddleware);
 508  
 509  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/http-v1.js
 510  
 511  
 512  /**
 513   * Set of HTTP methods which are eligible to be overridden.
 514   *
 515   * @type {Set}
 516   */
 517  var OVERRIDE_METHODS = new Set(['PATCH', 'PUT', 'DELETE']);
 518  /**
 519   * Default request method.
 520   *
 521   * "A request has an associated method (a method). Unless stated otherwise it
 522   * is `GET`."
 523   *
 524   * @see  https://fetch.spec.whatwg.org/#requests
 525   *
 526   * @type {string}
 527   */
 528  
 529  var DEFAULT_METHOD = 'GET';
 530  /**
 531   * API Fetch middleware which overrides the request method for HTTP v1
 532   * compatibility leveraging the REST API X-HTTP-Method-Override header.
 533   *
 534   * @param {Object}   options Fetch options.
 535   * @param {Function} next    [description]
 536   *
 537   * @return {*} The evaluated result of the remaining middleware chain.
 538   */
 539  
 540  function httpV1Middleware(options, next) {
 541    var _options = options,
 542        _options$method = _options.method,
 543        method = _options$method === void 0 ? DEFAULT_METHOD : _options$method;
 544  
 545    if (OVERRIDE_METHODS.has(method.toUpperCase())) {
 546      options = Object(objectSpread["a" /* default */])({}, options, {
 547        headers: Object(objectSpread["a" /* default */])({}, options.headers, {
 548          'X-HTTP-Method-Override': method,
 549          'Content-Type': 'application/json'
 550        }),
 551        method: 'POST'
 552      });
 553    }
 554  
 555    return next(options, next);
 556  }
 557  
 558  /* harmony default export */ var http_v1 = (httpV1Middleware);
 559  
 560  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/middlewares/user-locale.js
 561  /**
 562   * WordPress dependencies
 563   */
 564  
 565  
 566  function userLocaleMiddleware(options, next) {
 567    if (typeof options.url === 'string' && !Object(external_this_wp_url_["hasQueryArg"])(options.url, '_locale')) {
 568      options.url = Object(external_this_wp_url_["addQueryArgs"])(options.url, {
 569        _locale: 'user'
 570      });
 571    }
 572  
 573    if (typeof options.path === 'string' && !Object(external_this_wp_url_["hasQueryArg"])(options.path, '_locale')) {
 574      options.path = Object(external_this_wp_url_["addQueryArgs"])(options.path, {
 575        _locale: 'user'
 576      });
 577    }
 578  
 579    return next(options, next);
 580  }
 581  
 582  /* harmony default export */ var user_locale = (userLocaleMiddleware);
 583  
 584  // CONCATENATED MODULE: ./node_modules/@wordpress/api-fetch/build-module/index.js
 585  
 586  
 587  
 588  /**
 589   * WordPress dependencies
 590   */
 591  
 592  /**
 593   * Internal dependencies
 594   */
 595  
 596  
 597  
 598  
 599  
 600  
 601  
 602  
 603  /**
 604   * Default set of header values which should be sent with every request unless
 605   * explicitly provided through apiFetch options.
 606   *
 607   * @type {Object}
 608   */
 609  
 610  var DEFAULT_HEADERS = {
 611    // The backend uses the Accept header as a condition for considering an
 612    // incoming request as a REST request.
 613    //
 614    // See: https://core.trac.wordpress.org/ticket/44534
 615    Accept: 'application/json, */*;q=0.1'
 616  };
 617  /**
 618   * Default set of fetch option values which should be sent with every request
 619   * unless explicitly provided through apiFetch options.
 620   *
 621   * @type {Object}
 622   */
 623  
 624  var DEFAULT_OPTIONS = {
 625    credentials: 'include'
 626  };
 627  var middlewares = [user_locale, namespace_endpoint, http_v1, fetch_all_middleware];
 628  
 629  function registerMiddleware(middleware) {
 630    middlewares.unshift(middleware);
 631  }
 632  
 633  var build_module_defaultFetchHandler = function defaultFetchHandler(nextOptions) {
 634    var url = nextOptions.url,
 635        path = nextOptions.path,
 636        data = nextOptions.data,
 637        _nextOptions$parse = nextOptions.parse,
 638        parse = _nextOptions$parse === void 0 ? true : _nextOptions$parse,
 639        remainingOptions = Object(objectWithoutProperties["a" /* default */])(nextOptions, ["url", "path", "data", "parse"]);
 640  
 641    var body = nextOptions.body,
 642        headers = nextOptions.headers; // Merge explicitly-provided headers with default values.
 643  
 644    headers = Object(objectSpread["a" /* default */])({}, DEFAULT_HEADERS, headers); // The `data` property is a shorthand for sending a JSON body.
 645  
 646    if (data) {
 647      body = JSON.stringify(data);
 648      headers['Content-Type'] = 'application/json';
 649    }
 650  
 651    var responsePromise = window.fetch(url || path, Object(objectSpread["a" /* default */])({}, DEFAULT_OPTIONS, remainingOptions, {
 652      body: body,
 653      headers: headers
 654    }));
 655  
 656    var checkStatus = function checkStatus(response) {
 657      if (response.status >= 200 && response.status < 300) {
 658        return response;
 659      }
 660  
 661      throw response;
 662    };
 663  
 664    var parseResponse = function parseResponse(response) {
 665      if (parse) {
 666        if (response.status === 204) {
 667          return null;
 668        }
 669  
 670        return response.json ? response.json() : Promise.reject(response);
 671      }
 672  
 673      return response;
 674    };
 675  
 676    return responsePromise.then(checkStatus).then(parseResponse).catch(function (response) {
 677      if (!parse) {
 678        throw response;
 679      }
 680  
 681      var invalidJsonError = {
 682        code: 'invalid_json',
 683        message: Object(external_this_wp_i18n_["__"])('The response is not a valid JSON response.')
 684      };
 685  
 686      if (!response || !response.json) {
 687        throw invalidJsonError;
 688      }
 689  
 690      return response.json().catch(function () {
 691        throw invalidJsonError;
 692      }).then(function (error) {
 693        var unknownError = {
 694          code: 'unknown_error',
 695          message: Object(external_this_wp_i18n_["__"])('An unknown error occurred.')
 696        };
 697        throw error || unknownError;
 698      });
 699    });
 700  };
 701  
 702  var fetchHandler = build_module_defaultFetchHandler;
 703  /**
 704   * Defines a custom fetch handler for making the requests that will override
 705   * the default one using window.fetch
 706   *
 707   * @param {Function} newFetchHandler The new fetch handler
 708   */
 709  
 710  function setFetchHandler(newFetchHandler) {
 711    fetchHandler = newFetchHandler;
 712  }
 713  
 714  function apiFetch(options) {
 715    var steps = [].concat(middlewares, [fetchHandler]);
 716  
 717    var createRunStep = function createRunStep(index) {
 718      return function (workingOptions) {
 719        var step = steps[index];
 720  
 721        if (index === steps.length - 1) {
 722          return step(workingOptions);
 723        }
 724  
 725        var next = createRunStep(index + 1);
 726        return step(workingOptions, next);
 727      };
 728    };
 729  
 730    return createRunStep(0)(options);
 731  }
 732  
 733  apiFetch.use = registerMiddleware;
 734  apiFetch.setFetchHandler = setFetchHandler;
 735  apiFetch.createNonceMiddleware = middlewares_nonce;
 736  apiFetch.createPreloadingMiddleware = preloading;
 737  apiFetch.createRootURLMiddleware = root_url;
 738  apiFetch.fetchAllMiddleware = fetch_all_middleware;
 739  /* harmony default export */ var build_module = __webpack_exports__["default"] = (apiFetch);
 740  
 741  
 742  /***/ }),
 743  
 744  /***/ 44:
 745  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 746  
 747  "use strict";
 748  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
 749  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
 750    try {
 751      var info = gen[key](arg);
 752      var value = info.value;
 753    } catch (error) {
 754      reject(error);
 755      return;
 756    }
 757  
 758    if (info.done) {
 759      resolve(value);
 760    } else {
 761      Promise.resolve(value).then(_next, _throw);
 762    }
 763  }
 764  
 765  function _asyncToGenerator(fn) {
 766    return function () {
 767      var self = this,
 768          args = arguments;
 769      return new Promise(function (resolve, reject) {
 770        var gen = fn.apply(self, args);
 771  
 772        function _next(value) {
 773          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
 774        }
 775  
 776        function _throw(err) {
 777          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
 778        }
 779  
 780        _next(undefined);
 781      });
 782    };
 783  }
 784  
 785  /***/ }),
 786  
 787  /***/ 54:
 788  /***/ (function(module, exports, __webpack_require__) {
 789  
 790  /**
 791   * Copyright (c) 2014-present, Facebook, Inc.
 792   *
 793   * This source code is licensed under the MIT license found in the
 794   * LICENSE file in the root directory of this source tree.
 795   */
 796  
 797  var runtime = (function (exports) {
 798    "use strict";
 799  
 800    var Op = Object.prototype;
 801    var hasOwn = Op.hasOwnProperty;
 802    var undefined; // More compressible than void 0.
 803    var $Symbol = typeof Symbol === "function" ? Symbol : {};
 804    var iteratorSymbol = $Symbol.iterator || "@@iterator";
 805    var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
 806    var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
 807  
 808    function wrap(innerFn, outerFn, self, tryLocsList) {
 809      // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
 810      var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
 811      var generator = Object.create(protoGenerator.prototype);
 812      var context = new Context(tryLocsList || []);
 813  
 814      // The ._invoke method unifies the implementations of the .next,
 815      // .throw, and .return methods.
 816      generator._invoke = makeInvokeMethod(innerFn, self, context);
 817  
 818      return generator;
 819    }
 820    exports.wrap = wrap;
 821  
 822    // Try/catch helper to minimize deoptimizations. Returns a completion
 823    // record like context.tryEntries[i].completion. This interface could
 824    // have been (and was previously) designed to take a closure to be
 825    // invoked without arguments, but in all the cases we care about we
 826    // already have an existing method we want to call, so there's no need
 827    // to create a new function object. We can even get away with assuming
 828    // the method takes exactly one argument, since that happens to be true
 829    // in every case, so we don't have to touch the arguments object. The
 830    // only additional allocation required is the completion record, which
 831    // has a stable shape and so hopefully should be cheap to allocate.
 832    function tryCatch(fn, obj, arg) {
 833      try {
 834        return { type: "normal", arg: fn.call(obj, arg) };
 835      } catch (err) {
 836        return { type: "throw", arg: err };
 837      }
 838    }
 839  
 840    var GenStateSuspendedStart = "suspendedStart";
 841    var GenStateSuspendedYield = "suspendedYield";
 842    var GenStateExecuting = "executing";
 843    var GenStateCompleted = "completed";
 844  
 845    // Returning this object from the innerFn has the same effect as
 846    // breaking out of the dispatch switch statement.
 847    var ContinueSentinel = {};
 848  
 849    // Dummy constructor functions that we use as the .constructor and
 850    // .constructor.prototype properties for functions that return Generator
 851    // objects. For full spec compliance, you may wish to configure your
 852    // minifier not to mangle the names of these two functions.
 853    function Generator() {}
 854    function GeneratorFunction() {}
 855    function GeneratorFunctionPrototype() {}
 856  
 857    // This is a polyfill for %IteratorPrototype% for environments that
 858    // don't natively support it.
 859    var IteratorPrototype = {};
 860    IteratorPrototype[iteratorSymbol] = function () {
 861      return this;
 862    };
 863  
 864    var getProto = Object.getPrototypeOf;
 865    var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
 866    if (NativeIteratorPrototype &&
 867        NativeIteratorPrototype !== Op &&
 868        hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
 869      // This environment has a native %IteratorPrototype%; use it instead
 870      // of the polyfill.
 871      IteratorPrototype = NativeIteratorPrototype;
 872    }
 873  
 874    var Gp = GeneratorFunctionPrototype.prototype =
 875      Generator.prototype = Object.create(IteratorPrototype);
 876    GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
 877    GeneratorFunctionPrototype.constructor = GeneratorFunction;
 878    GeneratorFunctionPrototype[toStringTagSymbol] =
 879      GeneratorFunction.displayName = "GeneratorFunction";
 880  
 881    // Helper for defining the .next, .throw, and .return methods of the
 882    // Iterator interface in terms of a single ._invoke method.
 883    function defineIteratorMethods(prototype) {
 884      ["next", "throw", "return"].forEach(function(method) {
 885        prototype[method] = function(arg) {
 886          return this._invoke(method, arg);
 887        };
 888      });
 889    }
 890  
 891    exports.isGeneratorFunction = function(genFun) {
 892      var ctor = typeof genFun === "function" && genFun.constructor;
 893      return ctor
 894        ? ctor === GeneratorFunction ||
 895          // For the native GeneratorFunction constructor, the best we can
 896          // do is to check its .name property.
 897          (ctor.displayName || ctor.name) === "GeneratorFunction"
 898        : false;
 899    };
 900  
 901    exports.mark = function(genFun) {
 902      if (Object.setPrototypeOf) {
 903        Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
 904      } else {
 905        genFun.__proto__ = GeneratorFunctionPrototype;
 906        if (!(toStringTagSymbol in genFun)) {
 907          genFun[toStringTagSymbol] = "GeneratorFunction";
 908        }
 909      }
 910      genFun.prototype = Object.create(Gp);
 911      return genFun;
 912    };
 913  
 914    // Within the body of any async function, `await x` is transformed to
 915    // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
 916    // `hasOwn.call(value, "__await")` to determine if the yielded value is
 917    // meant to be awaited.
 918    exports.awrap = function(arg) {
 919      return { __await: arg };
 920    };
 921  
 922    function AsyncIterator(generator) {
 923      function invoke(method, arg, resolve, reject) {
 924        var record = tryCatch(generator[method], generator, arg);
 925        if (record.type === "throw") {
 926          reject(record.arg);
 927        } else {
 928          var result = record.arg;
 929          var value = result.value;
 930          if (value &&
 931              typeof value === "object" &&
 932              hasOwn.call(value, "__await")) {
 933            return Promise.resolve(value.__await).then(function(value) {
 934              invoke("next", value, resolve, reject);
 935            }, function(err) {
 936              invoke("throw", err, resolve, reject);
 937            });
 938          }
 939  
 940          return Promise.resolve(value).then(function(unwrapped) {
 941            // When a yielded Promise is resolved, its final value becomes
 942            // the .value of the Promise<{value,done}> result for the
 943            // current iteration.
 944            result.value = unwrapped;
 945            resolve(result);
 946          }, function(error) {
 947            // If a rejected Promise was yielded, throw the rejection back
 948            // into the async generator function so it can be handled there.
 949            return invoke("throw", error, resolve, reject);
 950          });
 951        }
 952      }
 953  
 954      var previousPromise;
 955  
 956      function enqueue(method, arg) {
 957        function callInvokeWithMethodAndArg() {
 958          return new Promise(function(resolve, reject) {
 959            invoke(method, arg, resolve, reject);
 960          });
 961        }
 962  
 963        return previousPromise =
 964          // If enqueue has been called before, then we want to wait until
 965          // all previous Promises have been resolved before calling invoke,
 966          // so that results are always delivered in the correct order. If
 967          // enqueue has not been called before, then it is important to
 968          // call invoke immediately, without waiting on a callback to fire,
 969          // so that the async generator function has the opportunity to do
 970          // any necessary setup in a predictable way. This predictability
 971          // is why the Promise constructor synchronously invokes its
 972          // executor callback, and why async functions synchronously
 973          // execute code before the first await. Since we implement simple
 974          // async functions in terms of async generators, it is especially
 975          // important to get this right, even though it requires care.
 976          previousPromise ? previousPromise.then(
 977            callInvokeWithMethodAndArg,
 978            // Avoid propagating failures to Promises returned by later
 979            // invocations of the iterator.
 980            callInvokeWithMethodAndArg
 981          ) : callInvokeWithMethodAndArg();
 982      }
 983  
 984      // Define the unified helper method that is used to implement .next,
 985      // .throw, and .return (see defineIteratorMethods).
 986      this._invoke = enqueue;
 987    }
 988  
 989    defineIteratorMethods(AsyncIterator.prototype);
 990    AsyncIterator.prototype[asyncIteratorSymbol] = function () {
 991      return this;
 992    };
 993    exports.AsyncIterator = AsyncIterator;
 994  
 995    // Note that simple async functions are implemented on top of
 996    // AsyncIterator objects; they just return a Promise for the value of
 997    // the final result produced by the iterator.
 998    exports.async = function(innerFn, outerFn, self, tryLocsList) {
 999      var iter = new AsyncIterator(
1000        wrap(innerFn, outerFn, self, tryLocsList)
1001      );
1002  
1003      return exports.isGeneratorFunction(outerFn)
1004        ? iter // If outerFn is a generator, return the full iterator.
1005        : iter.next().then(function(result) {
1006            return result.done ? result.value : iter.next();
1007          });
1008    };
1009  
1010    function makeInvokeMethod(innerFn, self, context) {
1011      var state = GenStateSuspendedStart;
1012  
1013      return function invoke(method, arg) {
1014        if (state === GenStateExecuting) {
1015          throw new Error("Generator is already running");
1016        }
1017  
1018        if (state === GenStateCompleted) {
1019          if (method === "throw") {
1020            throw arg;
1021          }
1022  
1023          // Be forgiving, per 25.3.3.3.3 of the spec:
1024          // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1025          return doneResult();
1026        }
1027  
1028        context.method = method;
1029        context.arg = arg;
1030  
1031        while (true) {
1032          var delegate = context.delegate;
1033          if (delegate) {
1034            var delegateResult = maybeInvokeDelegate(delegate, context);
1035            if (delegateResult) {
1036              if (delegateResult === ContinueSentinel) continue;
1037              return delegateResult;
1038            }
1039          }
1040  
1041          if (context.method === "next") {
1042            // Setting context._sent for legacy support of Babel's
1043            // function.sent implementation.
1044            context.sent = context._sent = context.arg;
1045  
1046          } else if (context.method === "throw") {
1047            if (state === GenStateSuspendedStart) {
1048              state = GenStateCompleted;
1049              throw context.arg;
1050            }
1051  
1052            context.dispatchException(context.arg);
1053  
1054          } else if (context.method === "return") {
1055            context.abrupt("return", context.arg);
1056          }
1057  
1058          state = GenStateExecuting;
1059  
1060          var record = tryCatch(innerFn, self, context);
1061          if (record.type === "normal") {
1062            // If an exception is thrown from innerFn, we leave state ===
1063            // GenStateExecuting and loop back for another invocation.
1064            state = context.done
1065              ? GenStateCompleted
1066              : GenStateSuspendedYield;
1067  
1068            if (record.arg === ContinueSentinel) {
1069              continue;
1070            }
1071  
1072            return {
1073              value: record.arg,
1074              done: context.done
1075            };
1076  
1077          } else if (record.type === "throw") {
1078            state = GenStateCompleted;
1079            // Dispatch the exception by looping back around to the
1080            // context.dispatchException(context.arg) call above.
1081            context.method = "throw";
1082            context.arg = record.arg;
1083          }
1084        }
1085      };
1086    }
1087  
1088    // Call delegate.iterator[context.method](context.arg) and handle the
1089    // result, either by returning a { value, done } result from the
1090    // delegate iterator, or by modifying context.method and context.arg,
1091    // setting context.delegate to null, and returning the ContinueSentinel.
1092    function maybeInvokeDelegate(delegate, context) {
1093      var method = delegate.iterator[context.method];
1094      if (method === undefined) {
1095        // A .throw or .return when the delegate iterator has no .throw
1096        // method always terminates the yield* loop.
1097        context.delegate = null;
1098  
1099        if (context.method === "throw") {
1100          // Note: ["return"] must be used for ES3 parsing compatibility.
1101          if (delegate.iterator["return"]) {
1102            // If the delegate iterator has a return method, give it a
1103            // chance to clean up.
1104            context.method = "return";
1105            context.arg = undefined;
1106            maybeInvokeDelegate(delegate, context);
1107  
1108            if (context.method === "throw") {
1109              // If maybeInvokeDelegate(context) changed context.method from
1110              // "return" to "throw", let that override the TypeError below.
1111              return ContinueSentinel;
1112            }
1113          }
1114  
1115          context.method = "throw";
1116          context.arg = new TypeError(
1117            "The iterator does not provide a 'throw' method");
1118        }
1119  
1120        return ContinueSentinel;
1121      }
1122  
1123      var record = tryCatch(method, delegate.iterator, context.arg);
1124  
1125      if (record.type === "throw") {
1126        context.method = "throw";
1127        context.arg = record.arg;
1128        context.delegate = null;
1129        return ContinueSentinel;
1130      }
1131  
1132      var info = record.arg;
1133  
1134      if (! info) {
1135        context.method = "throw";
1136        context.arg = new TypeError("iterator result is not an object");
1137        context.delegate = null;
1138        return ContinueSentinel;
1139      }
1140  
1141      if (info.done) {
1142        // Assign the result of the finished delegate to the temporary
1143        // variable specified by delegate.resultName (see delegateYield).
1144        context[delegate.resultName] = info.value;
1145  
1146        // Resume execution at the desired location (see delegateYield).
1147        context.next = delegate.nextLoc;
1148  
1149        // If context.method was "throw" but the delegate handled the
1150        // exception, let the outer generator proceed normally. If
1151        // context.method was "next", forget context.arg since it has been
1152        // "consumed" by the delegate iterator. If context.method was
1153        // "return", allow the original .return call to continue in the
1154        // outer generator.
1155        if (context.method !== "return") {
1156          context.method = "next";
1157          context.arg = undefined;
1158        }
1159  
1160      } else {
1161        // Re-yield the result returned by the delegate method.
1162        return info;
1163      }
1164  
1165      // The delegate iterator is finished, so forget it and continue with
1166      // the outer generator.
1167      context.delegate = null;
1168      return ContinueSentinel;
1169    }
1170  
1171    // Define Generator.prototype.{next,throw,return} in terms of the
1172    // unified ._invoke helper method.
1173    defineIteratorMethods(Gp);
1174  
1175    Gp[toStringTagSymbol] = "Generator";
1176  
1177    // A Generator should always return itself as the iterator object when the
1178    // @@iterator function is called on it. Some browsers' implementations of the
1179    // iterator prototype chain incorrectly implement this, causing the Generator
1180    // object to not be returned from this call. This ensures that doesn't happen.
1181    // See https://github.com/facebook/regenerator/issues/274 for more details.
1182    Gp[iteratorSymbol] = function() {
1183      return this;
1184    };
1185  
1186    Gp.toString = function() {
1187      return "[object Generator]";
1188    };
1189  
1190    function pushTryEntry(locs) {
1191      var entry = { tryLoc: locs[0] };
1192  
1193      if (1 in locs) {
1194        entry.catchLoc = locs[1];
1195      }
1196  
1197      if (2 in locs) {
1198        entry.finallyLoc = locs[2];
1199        entry.afterLoc = locs[3];
1200      }
1201  
1202      this.tryEntries.push(entry);
1203    }
1204  
1205    function resetTryEntry(entry) {
1206      var record = entry.completion || {};
1207      record.type = "normal";
1208      delete record.arg;
1209      entry.completion = record;
1210    }
1211  
1212    function Context(tryLocsList) {
1213      // The root entry object (effectively a try statement without a catch
1214      // or a finally block) gives us a place to store values thrown from
1215      // locations where there is no enclosing try statement.
1216      this.tryEntries = [{ tryLoc: "root" }];
1217      tryLocsList.forEach(pushTryEntry, this);
1218      this.reset(true);
1219    }
1220  
1221    exports.keys = function(object) {
1222      var keys = [];
1223      for (var key in object) {
1224        keys.push(key);
1225      }
1226      keys.reverse();
1227  
1228      // Rather than returning an object with a next method, we keep
1229      // things simple and return the next function itself.
1230      return function next() {
1231        while (keys.length) {
1232          var key = keys.pop();
1233          if (key in object) {
1234            next.value = key;
1235            next.done = false;
1236            return next;
1237          }
1238        }
1239  
1240        // To avoid creating an additional object, we just hang the .value
1241        // and .done properties off the next function object itself. This
1242        // also ensures that the minifier will not anonymize the function.
1243        next.done = true;
1244        return next;
1245      };
1246    };
1247  
1248    function values(iterable) {
1249      if (iterable) {
1250        var iteratorMethod = iterable[iteratorSymbol];
1251        if (iteratorMethod) {
1252          return iteratorMethod.call(iterable);
1253        }
1254  
1255        if (typeof iterable.next === "function") {
1256          return iterable;
1257        }
1258  
1259        if (!isNaN(iterable.length)) {
1260          var i = -1, next = function next() {
1261            while (++i < iterable.length) {
1262              if (hasOwn.call(iterable, i)) {
1263                next.value = iterable[i];
1264                next.done = false;
1265                return next;
1266              }
1267            }
1268  
1269            next.value = undefined;
1270            next.done = true;
1271  
1272            return next;
1273          };
1274  
1275          return next.next = next;
1276        }
1277      }
1278  
1279      // Return an iterator with no values.
1280      return { next: doneResult };
1281    }
1282    exports.values = values;
1283  
1284    function doneResult() {
1285      return { value: undefined, done: true };
1286    }
1287  
1288    Context.prototype = {
1289      constructor: Context,
1290  
1291      reset: function(skipTempReset) {
1292        this.prev = 0;
1293        this.next = 0;
1294        // Resetting context._sent for legacy support of Babel's
1295        // function.sent implementation.
1296        this.sent = this._sent = undefined;
1297        this.done = false;
1298        this.delegate = null;
1299  
1300        this.method = "next";
1301        this.arg = undefined;
1302  
1303        this.tryEntries.forEach(resetTryEntry);
1304  
1305        if (!skipTempReset) {
1306          for (var name in this) {
1307            // Not sure about the optimal order of these conditions:
1308            if (name.charAt(0) === "t" &&
1309                hasOwn.call(this, name) &&
1310                !isNaN(+name.slice(1))) {
1311              this[name] = undefined;
1312            }
1313          }
1314        }
1315      },
1316  
1317      stop: function() {
1318        this.done = true;
1319  
1320        var rootEntry = this.tryEntries[0];
1321        var rootRecord = rootEntry.completion;
1322        if (rootRecord.type === "throw") {
1323          throw rootRecord.arg;
1324        }
1325  
1326        return this.rval;
1327      },
1328  
1329      dispatchException: function(exception) {
1330        if (this.done) {
1331          throw exception;
1332        }
1333  
1334        var context = this;
1335        function handle(loc, caught) {
1336          record.type = "throw";
1337          record.arg = exception;
1338          context.next = loc;
1339  
1340          if (caught) {
1341            // If the dispatched exception was caught by a catch block,
1342            // then let that catch block handle the exception normally.
1343            context.method = "next";
1344            context.arg = undefined;
1345          }
1346  
1347          return !! caught;
1348        }
1349  
1350        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1351          var entry = this.tryEntries[i];
1352          var record = entry.completion;
1353  
1354          if (entry.tryLoc === "root") {
1355            // Exception thrown outside of any try block that could handle
1356            // it, so set the completion value of the entire function to
1357            // throw the exception.
1358            return handle("end");
1359          }
1360  
1361          if (entry.tryLoc <= this.prev) {
1362            var hasCatch = hasOwn.call(entry, "catchLoc");
1363            var hasFinally = hasOwn.call(entry, "finallyLoc");
1364  
1365            if (hasCatch && hasFinally) {
1366              if (this.prev < entry.catchLoc) {
1367                return handle(entry.catchLoc, true);
1368              } else if (this.prev < entry.finallyLoc) {
1369                return handle(entry.finallyLoc);
1370              }
1371  
1372            } else if (hasCatch) {
1373              if (this.prev < entry.catchLoc) {
1374                return handle(entry.catchLoc, true);
1375              }
1376  
1377            } else if (hasFinally) {
1378              if (this.prev < entry.finallyLoc) {
1379                return handle(entry.finallyLoc);
1380              }
1381  
1382            } else {
1383              throw new Error("try statement without catch or finally");
1384            }
1385          }
1386        }
1387      },
1388  
1389      abrupt: function(type, arg) {
1390        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1391          var entry = this.tryEntries[i];
1392          if (entry.tryLoc <= this.prev &&
1393              hasOwn.call(entry, "finallyLoc") &&
1394              this.prev < entry.finallyLoc) {
1395            var finallyEntry = entry;
1396            break;
1397          }
1398        }
1399  
1400        if (finallyEntry &&
1401            (type === "break" ||
1402             type === "continue") &&
1403            finallyEntry.tryLoc <= arg &&
1404            arg <= finallyEntry.finallyLoc) {
1405          // Ignore the finally entry if control is not jumping to a
1406          // location outside the try/catch block.
1407          finallyEntry = null;
1408        }
1409  
1410        var record = finallyEntry ? finallyEntry.completion : {};
1411        record.type = type;
1412        record.arg = arg;
1413  
1414        if (finallyEntry) {
1415          this.method = "next";
1416          this.next = finallyEntry.finallyLoc;
1417          return ContinueSentinel;
1418        }
1419  
1420        return this.complete(record);
1421      },
1422  
1423      complete: function(record, afterLoc) {
1424        if (record.type === "throw") {
1425          throw record.arg;
1426        }
1427  
1428        if (record.type === "break" ||
1429            record.type === "continue") {
1430          this.next = record.arg;
1431        } else if (record.type === "return") {
1432          this.rval = this.arg = record.arg;
1433          this.method = "return";
1434          this.next = "end";
1435        } else if (record.type === "normal" && afterLoc) {
1436          this.next = afterLoc;
1437        }
1438  
1439        return ContinueSentinel;
1440      },
1441  
1442      finish: function(finallyLoc) {
1443        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1444          var entry = this.tryEntries[i];
1445          if (entry.finallyLoc === finallyLoc) {
1446            this.complete(entry.completion, entry.afterLoc);
1447            resetTryEntry(entry);
1448            return ContinueSentinel;
1449          }
1450        }
1451      },
1452  
1453      "catch": function(tryLoc) {
1454        for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1455          var entry = this.tryEntries[i];
1456          if (entry.tryLoc === tryLoc) {
1457            var record = entry.completion;
1458            if (record.type === "throw") {
1459              var thrown = record.arg;
1460              resetTryEntry(entry);
1461            }
1462            return thrown;
1463          }
1464        }
1465  
1466        // The context.catch method must only be called with a location
1467        // argument that corresponds to a known catch block.
1468        throw new Error("illegal catch attempt");
1469      },
1470  
1471      delegateYield: function(iterable, resultName, nextLoc) {
1472        this.delegate = {
1473          iterator: values(iterable),
1474          resultName: resultName,
1475          nextLoc: nextLoc
1476        };
1477  
1478        if (this.method === "next") {
1479          // Deliberately forget the last sent value so that we don't
1480          // accidentally pass it on to the delegate.
1481          this.arg = undefined;
1482        }
1483  
1484        return ContinueSentinel;
1485      }
1486    };
1487  
1488    // Regardless of whether this script is executing as a CommonJS module
1489    // or not, return the runtime object so that we can declare the variable
1490    // regeneratorRuntime in the outer scope, which allows this module to be
1491    // injected easily by `bin/regenerator --include-runtime script.js`.
1492    return exports;
1493  
1494  }(
1495    // If this script is executing as a CommonJS module, use module.exports
1496    // as the regeneratorRuntime namespace. Otherwise create a new empty
1497    // object. Either way, the resulting object will be used to initialize
1498    // the regeneratorRuntime variable at the top of this file.
1499     true ? module.exports : undefined
1500  ));
1501  
1502  try {
1503    regeneratorRuntime = runtime;
1504  } catch (accidentalStrictMode) {
1505    // This module should not be running in strict mode, so the above
1506    // assignment should always work unless something is misconfigured. Just
1507    // in case runtime.js accidentally runs in strict mode, we can escape
1508    // strict mode using a global Function call. This could conceivably fail
1509    // if a Content Security Policy forbids using Function, but in that case
1510    // the proper solution is to fix the accidental strict mode problem. If
1511    // you've misconfigured your bundler to force strict mode and applied a
1512    // CSP to forbid Function, and you're not willing to fix either of those
1513    // problems, please detail your unique predicament in a GitHub issue.
1514    Function("r", "regeneratorRuntime = r")(runtime);
1515  }
1516  
1517  
1518  /***/ }),
1519  
1520  /***/ 7:
1521  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1522  
1523  "use strict";
1524  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; });
1525  /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
1526  
1527  function _objectSpread(target) {
1528    for (var i = 1; i < arguments.length; i++) {
1529      var source = arguments[i] != null ? arguments[i] : {};
1530      var ownKeys = Object.keys(source);
1531  
1532      if (typeof Object.getOwnPropertySymbols === 'function') {
1533        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
1534          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1535        }));
1536      }
1537  
1538      ownKeys.forEach(function (key) {
1539        Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]);
1540      });
1541    }
1542  
1543    return target;
1544  }
1545  
1546  /***/ })
1547  
1548  /******/ })["default"];


Generated: Sun Sep 15 01:00:03 2019 Cross-referenced by PHPXref 0.7.1