[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> media-utils.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["mediaUtils"] =
   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 = 443);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 0:
  91  /***/ (function(module, exports) {
  92  
  93  (function() { module.exports = this["wp"]["element"]; }());
  94  
  95  /***/ }),
  96  
  97  /***/ 1:
  98  /***/ (function(module, exports) {
  99  
 100  (function() { module.exports = this["wp"]["i18n"]; }());
 101  
 102  /***/ }),
 103  
 104  /***/ 13:
 105  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 106  
 107  "use strict";
 108  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
 109  function _defineProperties(target, props) {
 110    for (var i = 0; i < props.length; i++) {
 111      var descriptor = props[i];
 112      descriptor.enumerable = descriptor.enumerable || false;
 113      descriptor.configurable = true;
 114      if ("value" in descriptor) descriptor.writable = true;
 115      Object.defineProperty(target, descriptor.key, descriptor);
 116    }
 117  }
 118  
 119  function _createClass(Constructor, protoProps, staticProps) {
 120    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
 121    if (staticProps) _defineProperties(Constructor, staticProps);
 122    return Constructor;
 123  }
 124  
 125  /***/ }),
 126  
 127  /***/ 14:
 128  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 129  
 130  "use strict";
 131  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
 132  function _classCallCheck(instance, Constructor) {
 133    if (!(instance instanceof Constructor)) {
 134      throw new TypeError("Cannot call a class as a function");
 135    }
 136  }
 137  
 138  /***/ }),
 139  
 140  /***/ 15:
 141  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 142  
 143  "use strict";
 144  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
 145  /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
 146  /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
 147  
 148  
 149  function _possibleConstructorReturn(self, call) {
 150    if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
 151      return call;
 152    }
 153  
 154    return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
 155  }
 156  
 157  /***/ }),
 158  
 159  /***/ 16:
 160  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 161  
 162  "use strict";
 163  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
 164  function _getPrototypeOf(o) {
 165    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
 166      return o.__proto__ || Object.getPrototypeOf(o);
 167    };
 168    return _getPrototypeOf(o);
 169  }
 170  
 171  /***/ }),
 172  
 173  /***/ 17:
 174  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 175  
 176  "use strict";
 177  
 178  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
 179  function _setPrototypeOf(o, p) {
 180    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
 181      o.__proto__ = p;
 182      return o;
 183    };
 184  
 185    return _setPrototypeOf(o, p);
 186  }
 187  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
 188  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
 189  
 190  function _inherits(subClass, superClass) {
 191    if (typeof superClass !== "function" && superClass !== null) {
 192      throw new TypeError("Super expression must either be null or a function");
 193    }
 194  
 195    subClass.prototype = Object.create(superClass && superClass.prototype, {
 196      constructor: {
 197        value: subClass,
 198        writable: true,
 199        configurable: true
 200      }
 201    });
 202    if (superClass) _setPrototypeOf(subClass, superClass);
 203  }
 204  
 205  /***/ }),
 206  
 207  /***/ 18:
 208  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 209  
 210  "use strict";
 211  
 212  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
 213  var arrayLikeToArray = __webpack_require__(25);
 214  
 215  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
 216  
 217  function _arrayWithoutHoles(arr) {
 218    if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
 219  }
 220  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
 221  var iterableToArray = __webpack_require__(35);
 222  
 223  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 224  var unsupportedIterableToArray = __webpack_require__(27);
 225  
 226  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
 227  function _nonIterableSpread() {
 228    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 229  }
 230  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
 231  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; });
 232  
 233  
 234  
 235  
 236  function _toConsumableArray(arr) {
 237    return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
 238  }
 239  
 240  /***/ }),
 241  
 242  /***/ 2:
 243  /***/ (function(module, exports) {
 244  
 245  (function() { module.exports = this["lodash"]; }());
 246  
 247  /***/ }),
 248  
 249  /***/ 20:
 250  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 251  
 252  "use strict";
 253  
 254  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
 255  var arrayWithHoles = __webpack_require__(38);
 256  
 257  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
 258  function _iterableToArrayLimit(arr, i) {
 259    if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
 260    var _arr = [];
 261    var _n = true;
 262    var _d = false;
 263    var _e = undefined;
 264  
 265    try {
 266      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
 267        _arr.push(_s.value);
 268  
 269        if (i && _arr.length === i) break;
 270      }
 271    } catch (err) {
 272      _d = true;
 273      _e = err;
 274    } finally {
 275      try {
 276        if (!_n && _i["return"] != null) _i["return"]();
 277      } finally {
 278        if (_d) throw _e;
 279      }
 280    }
 281  
 282    return _arr;
 283  }
 284  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
 285  var unsupportedIterableToArray = __webpack_require__(27);
 286  
 287  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
 288  var nonIterableRest = __webpack_require__(39);
 289  
 290  // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
 291  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
 292  
 293  
 294  
 295  
 296  function _slicedToArray(arr, i) {
 297    return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
 298  }
 299  
 300  /***/ }),
 301  
 302  /***/ 23:
 303  /***/ (function(module, exports) {
 304  
 305  (function() { module.exports = this["regeneratorRuntime"]; }());
 306  
 307  /***/ }),
 308  
 309  /***/ 25:
 310  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 311  
 312  "use strict";
 313  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
 314  function _arrayLikeToArray(arr, len) {
 315    if (len == null || len > arr.length) len = arr.length;
 316  
 317    for (var i = 0, arr2 = new Array(len); i < len; i++) {
 318      arr2[i] = arr[i];
 319    }
 320  
 321    return arr2;
 322  }
 323  
 324  /***/ }),
 325  
 326  /***/ 27:
 327  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 328  
 329  "use strict";
 330  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
 331  /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
 332  
 333  function _unsupportedIterableToArray(o, minLen) {
 334    if (!o) return;
 335    if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 336    var n = Object.prototype.toString.call(o).slice(8, -1);
 337    if (n === "Object" && o.constructor) n = o.constructor.name;
 338    if (n === "Map" || n === "Set") return Array.from(n);
 339    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
 340  }
 341  
 342  /***/ }),
 343  
 344  /***/ 34:
 345  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 346  
 347  "use strict";
 348  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
 349  function _typeof(obj) {
 350    "@babel/helpers - typeof";
 351  
 352    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
 353      _typeof = function _typeof(obj) {
 354        return typeof obj;
 355      };
 356    } else {
 357      _typeof = function _typeof(obj) {
 358        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
 359      };
 360    }
 361  
 362    return _typeof(obj);
 363  }
 364  
 365  /***/ }),
 366  
 367  /***/ 35:
 368  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 369  
 370  "use strict";
 371  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
 372  function _iterableToArray(iter) {
 373    if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
 374  }
 375  
 376  /***/ }),
 377  
 378  /***/ 38:
 379  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 380  
 381  "use strict";
 382  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
 383  function _arrayWithHoles(arr) {
 384    if (Array.isArray(arr)) return arr;
 385  }
 386  
 387  /***/ }),
 388  
 389  /***/ 39:
 390  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 391  
 392  "use strict";
 393  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
 394  function _nonIterableRest() {
 395    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
 396  }
 397  
 398  /***/ }),
 399  
 400  /***/ 41:
 401  /***/ (function(module, exports) {
 402  
 403  (function() { module.exports = this["wp"]["blob"]; }());
 404  
 405  /***/ }),
 406  
 407  /***/ 42:
 408  /***/ (function(module, exports) {
 409  
 410  (function() { module.exports = this["wp"]["apiFetch"]; }());
 411  
 412  /***/ }),
 413  
 414  /***/ 443:
 415  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 416  
 417  "use strict";
 418  __webpack_require__.r(__webpack_exports__);
 419  
 420  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
 421  var classCallCheck = __webpack_require__(14);
 422  
 423  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
 424  var createClass = __webpack_require__(13);
 425  
 426  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
 427  var possibleConstructorReturn = __webpack_require__(15);
 428  
 429  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
 430  var getPrototypeOf = __webpack_require__(16);
 431  
 432  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
 433  var assertThisInitialized = __webpack_require__(7);
 434  
 435  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
 436  var inherits = __webpack_require__(17);
 437  
 438  // EXTERNAL MODULE: external {"this":"lodash"}
 439  var external_this_lodash_ = __webpack_require__(2);
 440  
 441  // EXTERNAL MODULE: external {"this":["wp","element"]}
 442  var external_this_wp_element_ = __webpack_require__(0);
 443  
 444  // EXTERNAL MODULE: external {"this":["wp","i18n"]}
 445  var external_this_wp_i18n_ = __webpack_require__(1);
 446  
 447  // CONCATENATED MODULE: ./node_modules/@wordpress/media-utils/build-module/components/media-upload/index.js
 448  
 449  
 450  
 451  
 452  
 453  
 454  
 455  /**
 456   * External dependencies
 457   */
 458  
 459  /**
 460   * WordPress dependencies
 461   */
 462  
 463  
 464  
 465  var _window = window,
 466      wp = _window.wp;
 467  /**
 468   * Prepares the Featured Image toolbars and frames.
 469   *
 470   * @return {wp.media.view.MediaFrame.Select} The default media workflow.
 471   */
 472  
 473  var getFeaturedImageMediaFrame = function getFeaturedImageMediaFrame() {
 474    return wp.media.view.MediaFrame.Select.extend({
 475      /**
 476       * Enables the Set Featured Image Button.
 477       *
 478       * @param {Object} toolbar toolbar for featured image state
 479       * @return {void}
 480       */
 481      featuredImageToolbar: function featuredImageToolbar(toolbar) {
 482        this.createSelectToolbar(toolbar, {
 483          text: wp.media.view.l10n.setFeaturedImage,
 484          state: this.options.state
 485        });
 486      },
 487  
 488      /**
 489       * Handle the edit state requirements of selected media item.
 490       *
 491       * @return {void}
 492       */
 493      editState: function editState() {
 494        var selection = this.state('featured-image').get('selection');
 495        var view = new wp.media.view.EditImage({
 496          model: selection.single(),
 497          controller: this
 498        }).render(); // Set the view to the EditImage frame using the selected image.
 499  
 500        this.content.set(view); // After bringing in the frame, load the actual editor via an ajax call.
 501  
 502        view.loadEditor();
 503      },
 504  
 505      /**
 506       * Create the default states.
 507       *
 508       * @return {void}
 509       */
 510      createStates: function createStates() {
 511        this.on('toolbar:create:featured-image', this.featuredImageToolbar, this);
 512        this.on('content:render:edit-image', this.editState, this);
 513        this.states.add([new wp.media.controller.FeaturedImage(), new wp.media.controller.EditImage({
 514          model: this.options.editImage
 515        })]);
 516      }
 517    });
 518  };
 519  /**
 520   * Prepares the Gallery toolbars and frames.
 521   *
 522   * @return {wp.media.view.MediaFrame.Post} The default media workflow.
 523   */
 524  
 525  
 526  var media_upload_getGalleryDetailsMediaFrame = function getGalleryDetailsMediaFrame() {
 527    /**
 528     * Custom gallery details frame.
 529     *
 530     * @see https://github.com/xwp/wp-core-media-widgets/blob/905edbccfc2a623b73a93dac803c5335519d7837/wp-admin/js/widgets/media-gallery-widget.js
 531     * @class GalleryDetailsMediaFrame
 532     * @class
 533     */
 534    return wp.media.view.MediaFrame.Post.extend({
 535      /**
 536       * Set up gallery toolbar.
 537       *
 538       * @return {void}
 539       */
 540      galleryToolbar: function galleryToolbar() {
 541        var editing = this.state().get('editing');
 542        this.toolbar.set(new wp.media.view.Toolbar({
 543          controller: this,
 544          items: {
 545            insert: {
 546              style: 'primary',
 547              text: editing ? wp.media.view.l10n.updateGallery : wp.media.view.l10n.insertGallery,
 548              priority: 80,
 549              requires: {
 550                library: true
 551              },
 552  
 553              /**
 554               * @fires wp.media.controller.State#update
 555               */
 556              click: function click() {
 557                var controller = this.controller,
 558                    state = controller.state();
 559                controller.close();
 560                state.trigger('update', state.get('library')); // Restore and reset the default state.
 561  
 562                controller.setState(controller.options.state);
 563                controller.reset();
 564              }
 565            }
 566          }
 567        }));
 568      },
 569  
 570      /**
 571       * Handle the edit state requirements of selected media item.
 572       *
 573       * @return {void}
 574       */
 575      editState: function editState() {
 576        var selection = this.state('gallery').get('selection');
 577        var view = new wp.media.view.EditImage({
 578          model: selection.single(),
 579          controller: this
 580        }).render(); // Set the view to the EditImage frame using the selected image.
 581  
 582        this.content.set(view); // After bringing in the frame, load the actual editor via an ajax call.
 583  
 584        view.loadEditor();
 585      },
 586  
 587      /**
 588       * Create the default states.
 589       *
 590       * @return {void}
 591       */
 592      createStates: function createStates() {
 593        this.on('toolbar:create:main-gallery', this.galleryToolbar, this);
 594        this.on('content:render:edit-image', this.editState, this);
 595        this.states.add([new wp.media.controller.Library({
 596          id: 'gallery',
 597          title: wp.media.view.l10n.createGalleryTitle,
 598          priority: 40,
 599          toolbar: 'main-gallery',
 600          filterable: 'uploaded',
 601          multiple: 'add',
 602          editable: false,
 603          library: wp.media.query(Object(external_this_lodash_["defaults"])({
 604            type: 'image'
 605          }, this.options.library))
 606        }), new wp.media.controller.EditImage({
 607          model: this.options.editImage
 608        }), new wp.media.controller.GalleryEdit({
 609          library: this.options.selection,
 610          editing: this.options.editing,
 611          menu: 'gallery',
 612          displaySettings: false,
 613          multiple: true
 614        }), new wp.media.controller.GalleryAdd()]);
 615      }
 616    });
 617  }; // the media library image object contains numerous attributes
 618  // we only need this set to display the image in the library
 619  
 620  
 621  var media_upload_slimImageObject = function slimImageObject(img) {
 622    var attrSet = ['sizes', 'mime', 'type', 'subtype', 'id', 'url', 'alt', 'link', 'caption'];
 623    return Object(external_this_lodash_["pick"])(img, attrSet);
 624  };
 625  
 626  var getAttachmentsCollection = function getAttachmentsCollection(ids) {
 627    return wp.media.query({
 628      order: 'ASC',
 629      orderby: 'post__in',
 630      post__in: ids,
 631      posts_per_page: -1,
 632      query: true,
 633      type: 'image'
 634    });
 635  };
 636  
 637  var media_upload_MediaUpload =
 638  /*#__PURE__*/
 639  function (_Component) {
 640    Object(inherits["a" /* default */])(MediaUpload, _Component);
 641  
 642    function MediaUpload(_ref) {
 643      var _this;
 644  
 645      var allowedTypes = _ref.allowedTypes,
 646          _ref$gallery = _ref.gallery,
 647          gallery = _ref$gallery === void 0 ? false : _ref$gallery,
 648          _ref$unstableFeatured = _ref.unstableFeaturedImageFlow,
 649          unstableFeaturedImageFlow = _ref$unstableFeatured === void 0 ? false : _ref$unstableFeatured,
 650          modalClass = _ref.modalClass,
 651          _ref$multiple = _ref.multiple,
 652          multiple = _ref$multiple === void 0 ? false : _ref$multiple,
 653          _ref$title = _ref.title,
 654          title = _ref$title === void 0 ? Object(external_this_wp_i18n_["__"])('Select or Upload Media') : _ref$title;
 655  
 656      Object(classCallCheck["a" /* default */])(this, MediaUpload);
 657  
 658      _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(MediaUpload).apply(this, arguments));
 659      _this.openModal = _this.openModal.bind(Object(assertThisInitialized["a" /* default */])(_this));
 660      _this.onOpen = _this.onOpen.bind(Object(assertThisInitialized["a" /* default */])(_this));
 661      _this.onSelect = _this.onSelect.bind(Object(assertThisInitialized["a" /* default */])(_this));
 662      _this.onUpdate = _this.onUpdate.bind(Object(assertThisInitialized["a" /* default */])(_this));
 663      _this.onClose = _this.onClose.bind(Object(assertThisInitialized["a" /* default */])(_this));
 664  
 665      if (gallery) {
 666        _this.buildAndSetGalleryFrame();
 667      } else {
 668        var frameConfig = {
 669          title: title,
 670          multiple: multiple
 671        };
 672  
 673        if (!!allowedTypes) {
 674          frameConfig.library = {
 675            type: allowedTypes
 676          };
 677        }
 678  
 679        _this.frame = wp.media(frameConfig);
 680      }
 681  
 682      if (modalClass) {
 683        _this.frame.$el.addClass(modalClass);
 684      }
 685  
 686      if (unstableFeaturedImageFlow) {
 687        _this.buildAndSetFeatureImageFrame();
 688      }
 689  
 690      _this.initializeListeners();
 691  
 692      return _this;
 693    }
 694  
 695    Object(createClass["a" /* default */])(MediaUpload, [{
 696      key: "initializeListeners",
 697      value: function initializeListeners() {
 698        // When an image is selected in the media frame...
 699        this.frame.on('select', this.onSelect);
 700        this.frame.on('update', this.onUpdate);
 701        this.frame.on('open', this.onOpen);
 702        this.frame.on('close', this.onClose);
 703      }
 704      /**
 705       * Sets the Gallery frame and initializes listeners.
 706       *
 707       * @return {void}
 708       */
 709  
 710    }, {
 711      key: "buildAndSetGalleryFrame",
 712      value: function buildAndSetGalleryFrame() {
 713        var _this$props = this.props,
 714            _this$props$addToGall = _this$props.addToGallery,
 715            addToGallery = _this$props$addToGall === void 0 ? false : _this$props$addToGall,
 716            allowedTypes = _this$props.allowedTypes,
 717            _this$props$multiple = _this$props.multiple,
 718            multiple = _this$props$multiple === void 0 ? false : _this$props$multiple,
 719            _this$props$value = _this$props.value,
 720            value = _this$props$value === void 0 ? null : _this$props$value; // If the value did not changed there is no need to rebuild the frame,
 721        // we can continue to use the existing one.
 722  
 723        if (value === this.lastGalleryValue) {
 724          return;
 725        }
 726  
 727        this.lastGalleryValue = value; // If a frame already existed remove it.
 728  
 729        if (this.frame) {
 730          this.frame.remove();
 731        }
 732  
 733        var currentState;
 734  
 735        if (addToGallery) {
 736          currentState = 'gallery-library';
 737        } else {
 738          currentState = value ? 'gallery-edit' : 'gallery';
 739        }
 740  
 741        if (!this.GalleryDetailsMediaFrame) {
 742          this.GalleryDetailsMediaFrame = media_upload_getGalleryDetailsMediaFrame();
 743        }
 744  
 745        var attachments = getAttachmentsCollection(value);
 746        var selection = new wp.media.model.Selection(attachments.models, {
 747          props: attachments.props.toJSON(),
 748          multiple: multiple
 749        });
 750        this.frame = new this.GalleryDetailsMediaFrame({
 751          mimeType: allowedTypes,
 752          state: currentState,
 753          multiple: multiple,
 754          selection: selection,
 755          editing: value ? true : false
 756        });
 757        wp.media.frame = this.frame;
 758        this.initializeListeners();
 759      }
 760      /**
 761       * Initializes the Media Library requirements for the featured image flow.
 762       *
 763       * @return {void}
 764       */
 765  
 766    }, {
 767      key: "buildAndSetFeatureImageFrame",
 768      value: function buildAndSetFeatureImageFrame() {
 769        var featuredImageFrame = getFeaturedImageMediaFrame();
 770        var attachments = getAttachmentsCollection(this.props.value);
 771        var selection = new wp.media.model.Selection(attachments.models, {
 772          props: attachments.props.toJSON()
 773        });
 774        this.frame = new featuredImageFrame({
 775          mimeType: this.props.allowedTypes,
 776          state: 'featured-image',
 777          multiple: this.props.multiple,
 778          selection: selection,
 779          editing: this.props.value ? true : false
 780        });
 781        wp.media.frame = this.frame;
 782      }
 783    }, {
 784      key: "componentWillUnmount",
 785      value: function componentWillUnmount() {
 786        this.frame.remove();
 787      }
 788    }, {
 789      key: "onUpdate",
 790      value: function onUpdate(selections) {
 791        var _this$props2 = this.props,
 792            onSelect = _this$props2.onSelect,
 793            _this$props2$multiple = _this$props2.multiple,
 794            multiple = _this$props2$multiple === void 0 ? false : _this$props2$multiple;
 795        var state = this.frame.state();
 796        var selectedImages = selections || state.get('selection');
 797  
 798        if (!selectedImages || !selectedImages.models.length) {
 799          return;
 800        }
 801  
 802        if (multiple) {
 803          onSelect(selectedImages.models.map(function (model) {
 804            return media_upload_slimImageObject(model.toJSON());
 805          }));
 806        } else {
 807          onSelect(media_upload_slimImageObject(selectedImages.models[0].toJSON()));
 808        }
 809      }
 810    }, {
 811      key: "onSelect",
 812      value: function onSelect() {
 813        var _this$props3 = this.props,
 814            onSelect = _this$props3.onSelect,
 815            _this$props3$multiple = _this$props3.multiple,
 816            multiple = _this$props3$multiple === void 0 ? false : _this$props3$multiple; // Get media attachment details from the frame state
 817  
 818        var attachment = this.frame.state().get('selection').toJSON();
 819        onSelect(multiple ? attachment : attachment[0]);
 820      }
 821    }, {
 822      key: "onOpen",
 823      value: function onOpen() {
 824        this.updateCollection();
 825  
 826        if (!this.props.value) {
 827          return;
 828        }
 829  
 830        if (!this.props.gallery) {
 831          var selection = this.frame.state().get('selection');
 832          Object(external_this_lodash_["castArray"])(this.props.value).forEach(function (id) {
 833            selection.add(wp.media.attachment(id));
 834          });
 835        } // load the images so they are available in the media modal.
 836  
 837  
 838        getAttachmentsCollection(Object(external_this_lodash_["castArray"])(this.props.value)).more();
 839      }
 840    }, {
 841      key: "onClose",
 842      value: function onClose() {
 843        var onClose = this.props.onClose;
 844  
 845        if (onClose) {
 846          onClose();
 847        }
 848      }
 849    }, {
 850      key: "updateCollection",
 851      value: function updateCollection() {
 852        var frameContent = this.frame.content.get();
 853  
 854        if (frameContent && frameContent.collection) {
 855          var collection = frameContent.collection; // clean all attachments we have in memory.
 856  
 857          collection.toArray().forEach(function (model) {
 858            return model.trigger('destroy', model);
 859          }); // reset has more flag, if library had small amount of items all items may have been loaded before.
 860  
 861          collection.mirroring._hasMore = true; // request items
 862  
 863          collection.more();
 864        }
 865      }
 866    }, {
 867      key: "openModal",
 868      value: function openModal() {
 869        if (this.props.gallery && this.props.value && this.props.value.length > 0) {
 870          this.buildAndSetGalleryFrame();
 871        }
 872  
 873        this.frame.open();
 874      }
 875    }, {
 876      key: "render",
 877      value: function render() {
 878        return this.props.render({
 879          open: this.openModal
 880        });
 881      }
 882    }]);
 883  
 884    return MediaUpload;
 885  }(external_this_wp_element_["Component"]);
 886  
 887  /* harmony default export */ var media_upload = (media_upload_MediaUpload);
 888  
 889  // CONCATENATED MODULE: ./node_modules/@wordpress/media-utils/build-module/components/index.js
 890  
 891  
 892  // EXTERNAL MODULE: external {"this":"regeneratorRuntime"}
 893  var external_this_regeneratorRuntime_ = __webpack_require__(23);
 894  var external_this_regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(external_this_regeneratorRuntime_);
 895  
 896  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
 897  var defineProperty = __webpack_require__(5);
 898  
 899  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
 900  var asyncToGenerator = __webpack_require__(49);
 901  
 902  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
 903  var toConsumableArray = __webpack_require__(18);
 904  
 905  // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
 906  var slicedToArray = __webpack_require__(20);
 907  
 908  // EXTERNAL MODULE: external {"this":["wp","apiFetch"]}
 909  var external_this_wp_apiFetch_ = __webpack_require__(42);
 910  var external_this_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_apiFetch_);
 911  
 912  // EXTERNAL MODULE: external {"this":["wp","blob"]}
 913  var external_this_wp_blob_ = __webpack_require__(41);
 914  
 915  // CONCATENATED MODULE: ./node_modules/@wordpress/media-utils/build-module/utils/upload-media.js
 916  
 917  
 918  
 919  
 920  
 921  
 922  
 923  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
 924  
 925  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
 926  
 927  /**
 928   * External dependencies
 929   */
 930  
 931  /**
 932   * WordPress dependencies
 933   */
 934  
 935  
 936  
 937  
 938  /**
 939   * Browsers may use unexpected mime types, and they differ from browser to browser.
 940   * This function computes a flexible array of mime types from the mime type structured provided by the server.
 941   * Converts { jpg|jpeg|jpe: "image/jpeg" } into [ "image/jpeg", "image/jpg", "image/jpeg", "image/jpe" ]
 942   * The computation of this array instead of directly using the object,
 943   * solves the problem in chrome where mp3 files have audio/mp3 as mime type instead of audio/mpeg.
 944   * https://bugs.chromium.org/p/chromium/issues/detail?id=227004
 945   *
 946   * @param {?Object} wpMimeTypesObject Mime type object received from the server.
 947   *                                    Extensions are keys separated by '|' and values are mime types associated with an extension.
 948   *
 949   * @return {?Array} An array of mime types or the parameter passed if it was "falsy".
 950   */
 951  
 952  function getMimeTypesArray(wpMimeTypesObject) {
 953    if (!wpMimeTypesObject) {
 954      return wpMimeTypesObject;
 955    }
 956  
 957    return Object(external_this_lodash_["flatMap"])(wpMimeTypesObject, function (mime, extensionsString) {
 958      var _mime$split = mime.split('/'),
 959          _mime$split2 = Object(slicedToArray["a" /* default */])(_mime$split, 1),
 960          type = _mime$split2[0];
 961  
 962      var extensions = extensionsString.split('|');
 963      return [mime].concat(Object(toConsumableArray["a" /* default */])(Object(external_this_lodash_["map"])(extensions, function (extension) {
 964        return "".concat(type, "/").concat(extension);
 965      })));
 966    });
 967  }
 968  /**
 969   *    Media Upload is used by audio, image, gallery, video, and file blocks to
 970   *    handle uploading a media file when a file upload button is activated.
 971   *
 972   *    TODO: future enhancement to add an upload indicator.
 973   *
 974   * @param   {Object}   $0                    Parameters object passed to the function.
 975   * @param   {?Array}   $0.allowedTypes       Array with the types of media that can be uploaded, if unset all types are allowed.
 976   * @param   {?Object}  $0.additionalData     Additional data to include in the request.
 977   * @param   {Array}    $0.filesList          List of files.
 978   * @param   {?number}  $0.maxUploadFileSize  Maximum upload size in bytes allowed for the site.
 979   * @param   {Function} $0.onError            Function called when an error happens.
 980   * @param   {Function} $0.onFileChange       Function called each time a file or a temporary representation of the file is available.
 981   * @param   {?Object}  $0.wpAllowedMimeTypes List of allowed mime types and file extensions.
 982   */
 983  
 984  function uploadMedia(_x) {
 985    return _uploadMedia.apply(this, arguments);
 986  }
 987  /**
 988   * @param {File}    file           Media File to Save.
 989   * @param {?Object} additionalData Additional data to include in the request.
 990   *
 991   * @return {Promise} Media Object Promise.
 992   */
 993  
 994  function _uploadMedia() {
 995    _uploadMedia = Object(asyncToGenerator["a" /* default */])(
 996    /*#__PURE__*/
 997    external_this_regeneratorRuntime_default.a.mark(function _callee(_ref) {
 998      var allowedTypes, _ref$additionalData, additionalData, filesList, maxUploadFileSize, _ref$onError, onError, onFileChange, _ref$wpAllowedMimeTyp, wpAllowedMimeTypes, files, filesSet, setAndUpdateFiles, isAllowedType, allowedMimeTypesForUser, isAllowedMimeTypeForUser, triggerError, validFiles, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _mediaFile, idx, mediaFile, savedMedia, mediaObject, message;
 999  
1000      return external_this_regeneratorRuntime_default.a.wrap(function _callee$(_context) {
1001        while (1) {
1002          switch (_context.prev = _context.next) {
1003            case 0:
1004              allowedTypes = _ref.allowedTypes, _ref$additionalData = _ref.additionalData, additionalData = _ref$additionalData === void 0 ? {} : _ref$additionalData, filesList = _ref.filesList, maxUploadFileSize = _ref.maxUploadFileSize, _ref$onError = _ref.onError, onError = _ref$onError === void 0 ? external_this_lodash_["noop"] : _ref$onError, onFileChange = _ref.onFileChange, _ref$wpAllowedMimeTyp = _ref.wpAllowedMimeTypes, wpAllowedMimeTypes = _ref$wpAllowedMimeTyp === void 0 ? null : _ref$wpAllowedMimeTyp;
1005              // Cast filesList to array
1006              files = Object(toConsumableArray["a" /* default */])(filesList);
1007              filesSet = [];
1008  
1009              setAndUpdateFiles = function setAndUpdateFiles(idx, value) {
1010                Object(external_this_wp_blob_["revokeBlobURL"])(Object(external_this_lodash_["get"])(filesSet, [idx, 'url']));
1011                filesSet[idx] = value;
1012                onFileChange(Object(external_this_lodash_["compact"])(filesSet));
1013              }; // Allowed type specified by consumer
1014  
1015  
1016              isAllowedType = function isAllowedType(fileType) {
1017                if (!allowedTypes) {
1018                  return true;
1019                }
1020  
1021                return Object(external_this_lodash_["some"])(allowedTypes, function (allowedType) {
1022                  // If a complete mimetype is specified verify if it matches exactly the mime type of the file.
1023                  if (Object(external_this_lodash_["includes"])(allowedType, '/')) {
1024                    return allowedType === fileType;
1025                  } // Otherwise a general mime type is used and we should verify if the file mimetype starts with it.
1026  
1027  
1028                  return Object(external_this_lodash_["startsWith"])(fileType, "".concat(allowedType, "/"));
1029                });
1030              }; // Allowed types for the current WP_User
1031  
1032  
1033              allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes);
1034  
1035              isAllowedMimeTypeForUser = function isAllowedMimeTypeForUser(fileType) {
1036                return Object(external_this_lodash_["includes"])(allowedMimeTypesForUser, fileType);
1037              }; // Build the error message including the filename
1038  
1039  
1040              triggerError = function triggerError(error) {
1041                error.message = [Object(external_this_wp_element_["createElement"])("strong", {
1042                  key: "filename"
1043                }, error.file.name), ': ', error.message];
1044                onError(error);
1045              };
1046  
1047              validFiles = [];
1048              _iteratorNormalCompletion = true;
1049              _didIteratorError = false;
1050              _iteratorError = undefined;
1051              _context.prev = 12;
1052              _iterator = files[Symbol.iterator]();
1053  
1054            case 14:
1055              if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
1056                _context.next = 34;
1057                break;
1058              }
1059  
1060              _mediaFile = _step.value;
1061  
1062              if (!(allowedMimeTypesForUser && !isAllowedMimeTypeForUser(_mediaFile.type))) {
1063                _context.next = 19;
1064                break;
1065              }
1066  
1067              triggerError({
1068                code: 'MIME_TYPE_NOT_ALLOWED_FOR_USER',
1069                message: Object(external_this_wp_i18n_["__"])('Sorry, this file type is not permitted for security reasons.'),
1070                file: _mediaFile
1071              });
1072              return _context.abrupt("continue", 31);
1073  
1074            case 19:
1075              if (isAllowedType(_mediaFile.type)) {
1076                _context.next = 22;
1077                break;
1078              }
1079  
1080              triggerError({
1081                code: 'MIME_TYPE_NOT_SUPPORTED',
1082                message: Object(external_this_wp_i18n_["__"])('Sorry, this file type is not supported here.'),
1083                file: _mediaFile
1084              });
1085              return _context.abrupt("continue", 31);
1086  
1087            case 22:
1088              if (!(maxUploadFileSize && _mediaFile.size > maxUploadFileSize)) {
1089                _context.next = 25;
1090                break;
1091              }
1092  
1093              triggerError({
1094                code: 'SIZE_ABOVE_LIMIT',
1095                message: Object(external_this_wp_i18n_["__"])('This file exceeds the maximum upload size for this site.'),
1096                file: _mediaFile
1097              });
1098              return _context.abrupt("continue", 31);
1099  
1100            case 25:
1101              if (!(_mediaFile.size <= 0)) {
1102                _context.next = 28;
1103                break;
1104              }
1105  
1106              triggerError({
1107                code: 'EMPTY_FILE',
1108                message: Object(external_this_wp_i18n_["__"])('This file is empty.'),
1109                file: _mediaFile
1110              });
1111              return _context.abrupt("continue", 31);
1112  
1113            case 28:
1114              validFiles.push(_mediaFile); // Set temporary URL to create placeholder media file, this is replaced
1115              // with final file from media gallery when upload is `done` below
1116  
1117              filesSet.push({
1118                url: Object(external_this_wp_blob_["createBlobURL"])(_mediaFile)
1119              });
1120              onFileChange(filesSet);
1121  
1122            case 31:
1123              _iteratorNormalCompletion = true;
1124              _context.next = 14;
1125              break;
1126  
1127            case 34:
1128              _context.next = 40;
1129              break;
1130  
1131            case 36:
1132              _context.prev = 36;
1133              _context.t0 = _context["catch"](12);
1134              _didIteratorError = true;
1135              _iteratorError = _context.t0;
1136  
1137            case 40:
1138              _context.prev = 40;
1139              _context.prev = 41;
1140  
1141              if (!_iteratorNormalCompletion && _iterator.return != null) {
1142                _iterator.return();
1143              }
1144  
1145            case 43:
1146              _context.prev = 43;
1147  
1148              if (!_didIteratorError) {
1149                _context.next = 46;
1150                break;
1151              }
1152  
1153              throw _iteratorError;
1154  
1155            case 46:
1156              return _context.finish(43);
1157  
1158            case 47:
1159              return _context.finish(40);
1160  
1161            case 48:
1162              idx = 0;
1163  
1164            case 49:
1165              if (!(idx < validFiles.length)) {
1166                _context.next = 68;
1167                break;
1168              }
1169  
1170              mediaFile = validFiles[idx];
1171              _context.prev = 51;
1172              _context.next = 54;
1173              return createMediaFromFile(mediaFile, additionalData);
1174  
1175            case 54:
1176              savedMedia = _context.sent;
1177              mediaObject = _objectSpread({}, Object(external_this_lodash_["omit"])(savedMedia, ['alt_text', 'source_url']), {
1178                alt: savedMedia.alt_text,
1179                caption: Object(external_this_lodash_["get"])(savedMedia, ['caption', 'raw'], ''),
1180                title: savedMedia.title.raw,
1181                url: savedMedia.source_url
1182              });
1183              setAndUpdateFiles(idx, mediaObject);
1184              _context.next = 65;
1185              break;
1186  
1187            case 59:
1188              _context.prev = 59;
1189              _context.t1 = _context["catch"](51);
1190              // Reset to empty on failure.
1191              setAndUpdateFiles(idx, null);
1192              message = void 0;
1193  
1194              if (Object(external_this_lodash_["has"])(_context.t1, ['message'])) {
1195                message = Object(external_this_lodash_["get"])(_context.t1, ['message']);
1196              } else {
1197                message = Object(external_this_wp_i18n_["sprintf"])( // translators: %s: file name
1198                Object(external_this_wp_i18n_["__"])('Error while uploading file %s to the media library.'), mediaFile.name);
1199              }
1200  
1201              onError({
1202                code: 'GENERAL',
1203                message: message,
1204                file: mediaFile
1205              });
1206  
1207            case 65:
1208              ++idx;
1209              _context.next = 49;
1210              break;
1211  
1212            case 68:
1213            case "end":
1214              return _context.stop();
1215          }
1216        }
1217      }, _callee, null, [[12, 36, 40, 48], [41,, 43, 47], [51, 59]]);
1218    }));
1219    return _uploadMedia.apply(this, arguments);
1220  }
1221  
1222  function createMediaFromFile(file, additionalData) {
1223    // Create upload payload
1224    var data = new window.FormData();
1225    data.append('file', file, file.name || file.type.replace('/', '.'));
1226    Object(external_this_lodash_["forEach"])(additionalData, function (value, key) {
1227      return data.append(key, value);
1228    });
1229    return external_this_wp_apiFetch_default()({
1230      path: '/wp/v2/media',
1231      body: data,
1232      method: 'POST'
1233    });
1234  }
1235  
1236  // CONCATENATED MODULE: ./node_modules/@wordpress/media-utils/build-module/utils/index.js
1237  
1238  
1239  // CONCATENATED MODULE: ./node_modules/@wordpress/media-utils/build-module/index.js
1240  /* concated harmony reexport MediaUpload */__webpack_require__.d(__webpack_exports__, "MediaUpload", function() { return media_upload; });
1241  /* concated harmony reexport uploadMedia */__webpack_require__.d(__webpack_exports__, "uploadMedia", function() { return uploadMedia; });
1242  
1243  
1244  
1245  
1246  /***/ }),
1247  
1248  /***/ 49:
1249  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1250  
1251  "use strict";
1252  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
1253  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
1254    try {
1255      var info = gen[key](arg);
1256      var value = info.value;
1257    } catch (error) {
1258      reject(error);
1259      return;
1260    }
1261  
1262    if (info.done) {
1263      resolve(value);
1264    } else {
1265      Promise.resolve(value).then(_next, _throw);
1266    }
1267  }
1268  
1269  function _asyncToGenerator(fn) {
1270    return function () {
1271      var self = this,
1272          args = arguments;
1273      return new Promise(function (resolve, reject) {
1274        var gen = fn.apply(self, args);
1275  
1276        function _next(value) {
1277          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
1278        }
1279  
1280        function _throw(err) {
1281          asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
1282        }
1283  
1284        _next(undefined);
1285      });
1286    };
1287  }
1288  
1289  /***/ }),
1290  
1291  /***/ 5:
1292  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1293  
1294  "use strict";
1295  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
1296  function _defineProperty(obj, key, value) {
1297    if (key in obj) {
1298      Object.defineProperty(obj, key, {
1299        value: value,
1300        enumerable: true,
1301        configurable: true,
1302        writable: true
1303      });
1304    } else {
1305      obj[key] = value;
1306    }
1307  
1308    return obj;
1309  }
1310  
1311  /***/ }),
1312  
1313  /***/ 7:
1314  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1315  
1316  "use strict";
1317  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
1318  function _assertThisInitialized(self) {
1319    if (self === void 0) {
1320      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1321    }
1322  
1323    return self;
1324  }
1325  
1326  /***/ })
1327  
1328  /******/ });


Generated: Sun Apr 5 01:00:03 2020 Cross-referenced by PHPXref 0.7.1