compose.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  1. this["wp"] = this["wp"] || {}; this["wp"]["compose"] =
  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 = 354);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 0:
  90. /***/ (function(module, exports) {
  91. (function() { module.exports = this["wp"]["element"]; }());
  92. /***/ }),
  93. /***/ 11:
  94. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95. "use strict";
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; });
  97. function _defineProperties(target, props) {
  98. for (var i = 0; i < props.length; i++) {
  99. var descriptor = props[i];
  100. descriptor.enumerable = descriptor.enumerable || false;
  101. descriptor.configurable = true;
  102. if ("value" in descriptor) descriptor.writable = true;
  103. Object.defineProperty(target, descriptor.key, descriptor);
  104. }
  105. }
  106. function _createClass(Constructor, protoProps, staticProps) {
  107. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  108. if (staticProps) _defineProperties(Constructor, staticProps);
  109. return Constructor;
  110. }
  111. /***/ }),
  112. /***/ 110:
  113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114. "use strict";
  115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMediaQuery; });
  116. /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
  117. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
  118. /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__);
  119. /**
  120. * WordPress dependencies
  121. */
  122. /**
  123. * Runs a media query and returns its value when it changes.
  124. *
  125. * @param {string} query Media Query.
  126. * @return {boolean} return value of the media query.
  127. */
  128. function useMediaQuery(query) {
  129. var _useState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useState"])(false),
  130. _useState2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_useState, 2),
  131. match = _useState2[0],
  132. setMatch = _useState2[1];
  133. Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
  134. var updateMatch = function updateMatch() {
  135. return setMatch(window.matchMedia(query).matches);
  136. };
  137. updateMatch();
  138. var list = window.matchMedia(query);
  139. list.addListener(updateMatch);
  140. return function () {
  141. list.removeListener(updateMatch);
  142. };
  143. }, [query]);
  144. return match;
  145. }
  146. /***/ }),
  147. /***/ 12:
  148. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  149. "use strict";
  150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; });
  151. function _classCallCheck(instance, Constructor) {
  152. if (!(instance instanceof Constructor)) {
  153. throw new TypeError("Cannot call a class as a function");
  154. }
  155. }
  156. /***/ }),
  157. /***/ 13:
  158. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  159. "use strict";
  160. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; });
  161. /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
  162. /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
  163. function _possibleConstructorReturn(self, call) {
  164. if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) {
  165. return call;
  166. }
  167. return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self);
  168. }
  169. /***/ }),
  170. /***/ 14:
  171. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  172. "use strict";
  173. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; });
  174. function _getPrototypeOf(o) {
  175. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  176. return o.__proto__ || Object.getPrototypeOf(o);
  177. };
  178. return _getPrototypeOf(o);
  179. }
  180. /***/ }),
  181. /***/ 15:
  182. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  183. "use strict";
  184. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
  185. function _setPrototypeOf(o, p) {
  186. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  187. o.__proto__ = p;
  188. return o;
  189. };
  190. return _setPrototypeOf(o, p);
  191. }
  192. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
  193. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; });
  194. function _inherits(subClass, superClass) {
  195. if (typeof superClass !== "function" && superClass !== null) {
  196. throw new TypeError("Super expression must either be null or a function");
  197. }
  198. subClass.prototype = Object.create(superClass && superClass.prototype, {
  199. constructor: {
  200. value: subClass,
  201. writable: true,
  202. configurable: true
  203. }
  204. });
  205. if (superClass) _setPrototypeOf(subClass, superClass);
  206. }
  207. /***/ }),
  208. /***/ 18:
  209. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  210. "use strict";
  211. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
  212. function _extends() {
  213. _extends = Object.assign || function (target) {
  214. for (var i = 1; i < arguments.length; i++) {
  215. var source = arguments[i];
  216. for (var key in source) {
  217. if (Object.prototype.hasOwnProperty.call(source, key)) {
  218. target[key] = source[key];
  219. }
  220. }
  221. }
  222. return target;
  223. };
  224. return _extends.apply(this, arguments);
  225. }
  226. /***/ }),
  227. /***/ 2:
  228. /***/ (function(module, exports) {
  229. (function() { module.exports = this["lodash"]; }());
  230. /***/ }),
  231. /***/ 210:
  232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  233. "use strict";
  234. /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _use_media_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(110);
  235. /**
  236. * Internal dependencies
  237. */
  238. /**
  239. * Whether or not the user agent is Internet Explorer.
  240. *
  241. * @type {boolean}
  242. */
  243. var IS_IE = typeof window !== 'undefined' && window.navigator.userAgent.indexOf('Trident') >= 0;
  244. /**
  245. * Hook returning whether the user has a preference for reduced motion.
  246. *
  247. * @return {boolean} Reduced motion preference value.
  248. */
  249. var useReducedMotion = process.env.FORCE_REDUCED_MOTION || IS_IE ? function () {
  250. return true;
  251. } : function () {
  252. return Object(_use_media_query__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])('(prefers-reduced-motion: reduce)');
  253. };
  254. /* harmony default export */ __webpack_exports__["a"] = (useReducedMotion);
  255. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(316)))
  256. /***/ }),
  257. /***/ 23:
  258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  259. "use strict";
  260. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  261. var arrayWithHoles = __webpack_require__(38);
  262. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  263. function _iterableToArrayLimit(arr, i) {
  264. var _arr = [];
  265. var _n = true;
  266. var _d = false;
  267. var _e = undefined;
  268. try {
  269. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  270. _arr.push(_s.value);
  271. if (i && _arr.length === i) break;
  272. }
  273. } catch (err) {
  274. _d = true;
  275. _e = err;
  276. } finally {
  277. try {
  278. if (!_n && _i["return"] != null) _i["return"]();
  279. } finally {
  280. if (_d) throw _e;
  281. }
  282. }
  283. return _arr;
  284. }
  285. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  286. var nonIterableRest = __webpack_require__(39);
  287. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _slicedToArray; });
  289. function _slicedToArray(arr, i) {
  290. return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(nonIterableRest["a" /* default */])();
  291. }
  292. /***/ }),
  293. /***/ 31:
  294. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  295. "use strict";
  296. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; });
  297. function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
  298. function _typeof(obj) {
  299. if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
  300. _typeof = function _typeof(obj) {
  301. return _typeof2(obj);
  302. };
  303. } else {
  304. _typeof = function _typeof(obj) {
  305. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
  306. };
  307. }
  308. return _typeof(obj);
  309. }
  310. /***/ }),
  311. /***/ 316:
  312. /***/ (function(module, exports) {
  313. // shim for using process in browser
  314. var process = module.exports = {};
  315. // cached from whatever global is present so that test runners that stub it
  316. // don't break things. But we need to wrap it in a try catch in case it is
  317. // wrapped in strict mode code which doesn't define any globals. It's inside a
  318. // function because try/catches deoptimize in certain engines.
  319. var cachedSetTimeout;
  320. var cachedClearTimeout;
  321. function defaultSetTimout() {
  322. throw new Error('setTimeout has not been defined');
  323. }
  324. function defaultClearTimeout () {
  325. throw new Error('clearTimeout has not been defined');
  326. }
  327. (function () {
  328. try {
  329. if (typeof setTimeout === 'function') {
  330. cachedSetTimeout = setTimeout;
  331. } else {
  332. cachedSetTimeout = defaultSetTimout;
  333. }
  334. } catch (e) {
  335. cachedSetTimeout = defaultSetTimout;
  336. }
  337. try {
  338. if (typeof clearTimeout === 'function') {
  339. cachedClearTimeout = clearTimeout;
  340. } else {
  341. cachedClearTimeout = defaultClearTimeout;
  342. }
  343. } catch (e) {
  344. cachedClearTimeout = defaultClearTimeout;
  345. }
  346. } ())
  347. function runTimeout(fun) {
  348. if (cachedSetTimeout === setTimeout) {
  349. //normal enviroments in sane situations
  350. return setTimeout(fun, 0);
  351. }
  352. // if setTimeout wasn't available but was latter defined
  353. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  354. cachedSetTimeout = setTimeout;
  355. return setTimeout(fun, 0);
  356. }
  357. try {
  358. // when when somebody has screwed with setTimeout but no I.E. maddness
  359. return cachedSetTimeout(fun, 0);
  360. } catch(e){
  361. try {
  362. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  363. return cachedSetTimeout.call(null, fun, 0);
  364. } catch(e){
  365. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  366. return cachedSetTimeout.call(this, fun, 0);
  367. }
  368. }
  369. }
  370. function runClearTimeout(marker) {
  371. if (cachedClearTimeout === clearTimeout) {
  372. //normal enviroments in sane situations
  373. return clearTimeout(marker);
  374. }
  375. // if clearTimeout wasn't available but was latter defined
  376. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  377. cachedClearTimeout = clearTimeout;
  378. return clearTimeout(marker);
  379. }
  380. try {
  381. // when when somebody has screwed with setTimeout but no I.E. maddness
  382. return cachedClearTimeout(marker);
  383. } catch (e){
  384. try {
  385. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  386. return cachedClearTimeout.call(null, marker);
  387. } catch (e){
  388. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  389. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  390. return cachedClearTimeout.call(this, marker);
  391. }
  392. }
  393. }
  394. var queue = [];
  395. var draining = false;
  396. var currentQueue;
  397. var queueIndex = -1;
  398. function cleanUpNextTick() {
  399. if (!draining || !currentQueue) {
  400. return;
  401. }
  402. draining = false;
  403. if (currentQueue.length) {
  404. queue = currentQueue.concat(queue);
  405. } else {
  406. queueIndex = -1;
  407. }
  408. if (queue.length) {
  409. drainQueue();
  410. }
  411. }
  412. function drainQueue() {
  413. if (draining) {
  414. return;
  415. }
  416. var timeout = runTimeout(cleanUpNextTick);
  417. draining = true;
  418. var len = queue.length;
  419. while(len) {
  420. currentQueue = queue;
  421. queue = [];
  422. while (++queueIndex < len) {
  423. if (currentQueue) {
  424. currentQueue[queueIndex].run();
  425. }
  426. }
  427. queueIndex = -1;
  428. len = queue.length;
  429. }
  430. currentQueue = null;
  431. draining = false;
  432. runClearTimeout(timeout);
  433. }
  434. process.nextTick = function (fun) {
  435. var args = new Array(arguments.length - 1);
  436. if (arguments.length > 1) {
  437. for (var i = 1; i < arguments.length; i++) {
  438. args[i - 1] = arguments[i];
  439. }
  440. }
  441. queue.push(new Item(fun, args));
  442. if (queue.length === 1 && !draining) {
  443. runTimeout(drainQueue);
  444. }
  445. };
  446. // v8 likes predictible objects
  447. function Item(fun, array) {
  448. this.fun = fun;
  449. this.array = array;
  450. }
  451. Item.prototype.run = function () {
  452. this.fun.apply(null, this.array);
  453. };
  454. process.title = 'browser';
  455. process.browser = true;
  456. process.env = {};
  457. process.argv = [];
  458. process.version = ''; // empty string to avoid regexp issues
  459. process.versions = {};
  460. function noop() {}
  461. process.on = noop;
  462. process.addListener = noop;
  463. process.once = noop;
  464. process.off = noop;
  465. process.removeListener = noop;
  466. process.removeAllListeners = noop;
  467. process.emit = noop;
  468. process.prependListener = noop;
  469. process.prependOnceListener = noop;
  470. process.listeners = function (name) { return [] }
  471. process.binding = function (name) {
  472. throw new Error('process.binding is not supported');
  473. };
  474. process.cwd = function () { return '/' };
  475. process.chdir = function (dir) {
  476. throw new Error('process.chdir is not supported');
  477. };
  478. process.umask = function() { return 0; };
  479. /***/ }),
  480. /***/ 354:
  481. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  482. "use strict";
  483. __webpack_require__.r(__webpack_exports__);
  484. // EXTERNAL MODULE: external "lodash"
  485. var external_lodash_ = __webpack_require__(2);
  486. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
  487. /**
  488. * External dependencies
  489. */
  490. /**
  491. * Given a function mapping a component to an enhanced component and modifier
  492. * name, returns the enhanced component augmented with a generated displayName.
  493. *
  494. * @param {Function} mapComponentToEnhancedComponent Function mapping component
  495. * to enhanced component.
  496. * @param {string} modifierName Seed name from which to
  497. * generated display name.
  498. *
  499. * @return {WPComponent} Component class with generated display name assigned.
  500. */
  501. function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
  502. return function (OriginalComponent) {
  503. var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
  504. var _OriginalComponent$di = OriginalComponent.displayName,
  505. displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
  506. EnhancedComponent.displayName = "".concat(Object(external_lodash_["upperFirst"])(Object(external_lodash_["camelCase"])(modifierName)), "(").concat(displayName, ")");
  507. return EnhancedComponent;
  508. };
  509. }
  510. /* harmony default export */ var create_higher_order_component = (createHigherOrderComponent);
  511. // EXTERNAL MODULE: external {"this":["wp","element"]}
  512. var external_this_wp_element_ = __webpack_require__(0);
  513. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
  514. /**
  515. * Internal dependencies
  516. */
  517. /**
  518. * Higher-order component creator, creating a new component which renders if
  519. * the given condition is satisfied or with the given optional prop name.
  520. *
  521. * @param {Function} predicate Function to test condition.
  522. *
  523. * @return {Function} Higher-order component.
  524. */
  525. var if_condition_ifCondition = function ifCondition(predicate) {
  526. return create_higher_order_component(function (WrappedComponent) {
  527. return function (props) {
  528. if (!predicate(props)) {
  529. return null;
  530. }
  531. return Object(external_this_wp_element_["createElement"])(WrappedComponent, props);
  532. };
  533. }, 'ifCondition');
  534. };
  535. /* harmony default export */ var if_condition = (if_condition_ifCondition);
  536. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
  537. var classCallCheck = __webpack_require__(12);
  538. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
  539. var createClass = __webpack_require__(11);
  540. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
  541. var possibleConstructorReturn = __webpack_require__(13);
  542. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
  543. var getPrototypeOf = __webpack_require__(14);
  544. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules
  545. var inherits = __webpack_require__(15);
  546. // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]}
  547. var external_this_wp_isShallowEqual_ = __webpack_require__(41);
  548. var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_);
  549. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
  550. /**
  551. * WordPress dependencies
  552. */
  553. /**
  554. * Internal dependencies
  555. */
  556. /**
  557. * Given a component returns the enhanced component augmented with a component
  558. * only rerendering when its props/state change
  559. *
  560. * @param {Function} mapComponentToEnhancedComponent Function mapping component
  561. * to enhanced component.
  562. * @param {string} modifierName Seed name from which to
  563. * generated display name.
  564. *
  565. * @return {WPComponent} Component class with generated display name assigned.
  566. */
  567. var pure = create_higher_order_component(function (Wrapped) {
  568. if (Wrapped.prototype instanceof external_this_wp_element_["Component"]) {
  569. return (
  570. /*#__PURE__*/
  571. function (_Wrapped) {
  572. Object(inherits["a" /* default */])(_class, _Wrapped);
  573. function _class() {
  574. Object(classCallCheck["a" /* default */])(this, _class);
  575. return Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(_class).apply(this, arguments));
  576. }
  577. Object(createClass["a" /* default */])(_class, [{
  578. key: "shouldComponentUpdate",
  579. value: function shouldComponentUpdate(nextProps, nextState) {
  580. return !external_this_wp_isShallowEqual_default()(nextProps, this.props) || !external_this_wp_isShallowEqual_default()(nextState, this.state);
  581. }
  582. }]);
  583. return _class;
  584. }(Wrapped)
  585. );
  586. }
  587. return (
  588. /*#__PURE__*/
  589. function (_Component) {
  590. Object(inherits["a" /* default */])(_class2, _Component);
  591. function _class2() {
  592. Object(classCallCheck["a" /* default */])(this, _class2);
  593. return Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(_class2).apply(this, arguments));
  594. }
  595. Object(createClass["a" /* default */])(_class2, [{
  596. key: "shouldComponentUpdate",
  597. value: function shouldComponentUpdate(nextProps) {
  598. return !external_this_wp_isShallowEqual_default()(nextProps, this.props);
  599. }
  600. }, {
  601. key: "render",
  602. value: function render() {
  603. return Object(external_this_wp_element_["createElement"])(Wrapped, this.props);
  604. }
  605. }]);
  606. return _class2;
  607. }(external_this_wp_element_["Component"])
  608. );
  609. }, 'pure');
  610. /* harmony default export */ var higher_order_pure = (pure);
  611. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
  612. var esm_extends = __webpack_require__(18);
  613. // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
  614. var assertThisInitialized = __webpack_require__(5);
  615. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js
  616. /**
  617. * External dependencies
  618. */
  619. /**
  620. * Class responsible for orchestrating event handling on the global window,
  621. * binding a single event to be shared across all handling instances, and
  622. * removing the handler when no instances are listening for the event.
  623. */
  624. var listener_Listener =
  625. /*#__PURE__*/
  626. function () {
  627. function Listener() {
  628. Object(classCallCheck["a" /* default */])(this, Listener);
  629. this.listeners = {};
  630. this.handleEvent = this.handleEvent.bind(this);
  631. }
  632. Object(createClass["a" /* default */])(Listener, [{
  633. key: "add",
  634. value: function add(eventType, instance) {
  635. if (!this.listeners[eventType]) {
  636. // Adding first listener for this type, so bind event.
  637. window.addEventListener(eventType, this.handleEvent);
  638. this.listeners[eventType] = [];
  639. }
  640. this.listeners[eventType].push(instance);
  641. }
  642. }, {
  643. key: "remove",
  644. value: function remove(eventType, instance) {
  645. this.listeners[eventType] = Object(external_lodash_["without"])(this.listeners[eventType], instance);
  646. if (!this.listeners[eventType].length) {
  647. // Removing last listener for this type, so unbind event.
  648. window.removeEventListener(eventType, this.handleEvent);
  649. delete this.listeners[eventType];
  650. }
  651. }
  652. }, {
  653. key: "handleEvent",
  654. value: function handleEvent(event) {
  655. Object(external_lodash_["forEach"])(this.listeners[event.type], function (instance) {
  656. instance.handleEvent(event);
  657. });
  658. }
  659. }]);
  660. return Listener;
  661. }();
  662. /* harmony default export */ var listener = (listener_Listener);
  663. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
  664. /**
  665. * External dependencies
  666. */
  667. /**
  668. * WordPress dependencies
  669. */
  670. /**
  671. * Internal dependencies
  672. */
  673. /**
  674. * Listener instance responsible for managing document event handling.
  675. *
  676. * @type {Listener}
  677. */
  678. var with_global_events_listener = new listener();
  679. /**
  680. * Higher-order component creator which, given an object of DOM event types and
  681. * values corresponding to a callback function name on the component, will
  682. * create or update a window event handler to invoke the callback when an event
  683. * occurs. On behalf of the consuming developer, the higher-order component
  684. * manages unbinding when the component unmounts, and binding at most a single
  685. * event handler for the entire application.
  686. *
  687. * @param {Object<string,string>} eventTypesToHandlers Object with keys of DOM
  688. * event type, the value a
  689. * name of the function on
  690. * the original component's
  691. * instance which handles
  692. * the event.
  693. *
  694. * @return {Function} Higher-order component.
  695. */
  696. function withGlobalEvents(eventTypesToHandlers) {
  697. return create_higher_order_component(function (WrappedComponent) {
  698. var Wrapper =
  699. /*#__PURE__*/
  700. function (_Component) {
  701. Object(inherits["a" /* default */])(Wrapper, _Component);
  702. function Wrapper() {
  703. var _this;
  704. Object(classCallCheck["a" /* default */])(this, Wrapper);
  705. _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(Wrapper).apply(this, arguments));
  706. _this.handleEvent = _this.handleEvent.bind(Object(assertThisInitialized["a" /* default */])(_this));
  707. _this.handleRef = _this.handleRef.bind(Object(assertThisInitialized["a" /* default */])(_this));
  708. return _this;
  709. }
  710. Object(createClass["a" /* default */])(Wrapper, [{
  711. key: "componentDidMount",
  712. value: function componentDidMount() {
  713. var _this2 = this;
  714. Object(external_lodash_["forEach"])(eventTypesToHandlers, function (handler, eventType) {
  715. with_global_events_listener.add(eventType, _this2);
  716. });
  717. }
  718. }, {
  719. key: "componentWillUnmount",
  720. value: function componentWillUnmount() {
  721. var _this3 = this;
  722. Object(external_lodash_["forEach"])(eventTypesToHandlers, function (handler, eventType) {
  723. with_global_events_listener.remove(eventType, _this3);
  724. });
  725. }
  726. }, {
  727. key: "handleEvent",
  728. value: function handleEvent(event) {
  729. var handler = eventTypesToHandlers[event.type];
  730. if (typeof this.wrappedRef[handler] === 'function') {
  731. this.wrappedRef[handler](event);
  732. }
  733. }
  734. }, {
  735. key: "handleRef",
  736. value: function handleRef(el) {
  737. this.wrappedRef = el; // Any component using `withGlobalEvents` that is not setting a `ref`
  738. // will cause `this.props.forwardedRef` to be `null`, so we need this
  739. // check.
  740. if (this.props.forwardedRef) {
  741. this.props.forwardedRef(el);
  742. }
  743. }
  744. }, {
  745. key: "render",
  746. value: function render() {
  747. return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props.ownProps, {
  748. ref: this.handleRef
  749. }));
  750. }
  751. }]);
  752. return Wrapper;
  753. }(external_this_wp_element_["Component"]);
  754. return Object(external_this_wp_element_["forwardRef"])(function (props, ref) {
  755. return Object(external_this_wp_element_["createElement"])(Wrapper, {
  756. ownProps: props,
  757. forwardedRef: ref
  758. });
  759. });
  760. }, 'withGlobalEvents');
  761. }
  762. /* harmony default export */ var with_global_events = (withGlobalEvents);
  763. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js
  764. /**
  765. * WordPress dependencies
  766. */
  767. /**
  768. * Internal dependencies
  769. */
  770. /**
  771. * A Higher Order Component used to be provide a unique instance ID by
  772. * component.
  773. *
  774. * @param {WPElement} WrappedComponent The wrapped component.
  775. *
  776. * @return {Component} Component with an instanceId prop.
  777. */
  778. /* harmony default export */ var with_instance_id = (create_higher_order_component(function (WrappedComponent) {
  779. var instances = 0;
  780. return (
  781. /*#__PURE__*/
  782. function (_Component) {
  783. Object(inherits["a" /* default */])(_class, _Component);
  784. function _class() {
  785. var _this;
  786. Object(classCallCheck["a" /* default */])(this, _class);
  787. _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(_class).apply(this, arguments));
  788. _this.instanceId = instances++;
  789. return _this;
  790. }
  791. Object(createClass["a" /* default */])(_class, [{
  792. key: "render",
  793. value: function render() {
  794. return Object(external_this_wp_element_["createElement"])(WrappedComponent, Object(esm_extends["a" /* default */])({}, this.props, {
  795. instanceId: this.instanceId
  796. }));
  797. }
  798. }]);
  799. return _class;
  800. }(external_this_wp_element_["Component"])
  801. );
  802. }, 'withInstanceId'));
  803. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js
  804. /**
  805. * External dependencies
  806. */
  807. /**
  808. * WordPress dependencies
  809. */
  810. /**
  811. * Internal dependencies
  812. */
  813. /**
  814. * A higher-order component used to provide and manage delayed function calls
  815. * that ought to be bound to a component's lifecycle.
  816. *
  817. * @param {Component} OriginalComponent Component requiring setTimeout
  818. *
  819. * @return {Component} Wrapped component.
  820. */
  821. var withSafeTimeout = create_higher_order_component(function (OriginalComponent) {
  822. return (
  823. /*#__PURE__*/
  824. function (_Component) {
  825. Object(inherits["a" /* default */])(WrappedComponent, _Component);
  826. function WrappedComponent() {
  827. var _this;
  828. Object(classCallCheck["a" /* default */])(this, WrappedComponent);
  829. _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(WrappedComponent).apply(this, arguments));
  830. _this.timeouts = [];
  831. _this.setTimeout = _this.setTimeout.bind(Object(assertThisInitialized["a" /* default */])(_this));
  832. _this.clearTimeout = _this.clearTimeout.bind(Object(assertThisInitialized["a" /* default */])(_this));
  833. return _this;
  834. }
  835. Object(createClass["a" /* default */])(WrappedComponent, [{
  836. key: "componentWillUnmount",
  837. value: function componentWillUnmount() {
  838. this.timeouts.forEach(clearTimeout);
  839. }
  840. }, {
  841. key: "setTimeout",
  842. value: function (_setTimeout) {
  843. function setTimeout(_x, _x2) {
  844. return _setTimeout.apply(this, arguments);
  845. }
  846. setTimeout.toString = function () {
  847. return _setTimeout.toString();
  848. };
  849. return setTimeout;
  850. }(function (fn, delay) {
  851. var _this2 = this;
  852. var id = setTimeout(function () {
  853. fn();
  854. _this2.clearTimeout(id);
  855. }, delay);
  856. this.timeouts.push(id);
  857. return id;
  858. })
  859. }, {
  860. key: "clearTimeout",
  861. value: function (_clearTimeout) {
  862. function clearTimeout(_x3) {
  863. return _clearTimeout.apply(this, arguments);
  864. }
  865. clearTimeout.toString = function () {
  866. return _clearTimeout.toString();
  867. };
  868. return clearTimeout;
  869. }(function (id) {
  870. clearTimeout(id);
  871. this.timeouts = Object(external_lodash_["without"])(this.timeouts, id);
  872. })
  873. }, {
  874. key: "render",
  875. value: function render() {
  876. return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, this.props, {
  877. setTimeout: this.setTimeout,
  878. clearTimeout: this.clearTimeout
  879. }));
  880. }
  881. }]);
  882. return WrappedComponent;
  883. }(external_this_wp_element_["Component"])
  884. );
  885. }, 'withSafeTimeout');
  886. /* harmony default export */ var with_safe_timeout = (withSafeTimeout);
  887. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js
  888. /**
  889. * WordPress dependencies
  890. */
  891. /**
  892. * Internal dependencies
  893. */
  894. /**
  895. * A Higher Order Component used to provide and manage internal component state
  896. * via props.
  897. *
  898. * @param {?Object} initialState Optional initial state of the component.
  899. *
  900. * @return {Component} Wrapped component.
  901. */
  902. function withState() {
  903. var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  904. return create_higher_order_component(function (OriginalComponent) {
  905. return (
  906. /*#__PURE__*/
  907. function (_Component) {
  908. Object(inherits["a" /* default */])(WrappedComponent, _Component);
  909. function WrappedComponent() {
  910. var _this;
  911. Object(classCallCheck["a" /* default */])(this, WrappedComponent);
  912. _this = Object(possibleConstructorReturn["a" /* default */])(this, Object(getPrototypeOf["a" /* default */])(WrappedComponent).apply(this, arguments));
  913. _this.setState = _this.setState.bind(Object(assertThisInitialized["a" /* default */])(_this));
  914. _this.state = initialState;
  915. return _this;
  916. }
  917. Object(createClass["a" /* default */])(WrappedComponent, [{
  918. key: "render",
  919. value: function render() {
  920. return Object(external_this_wp_element_["createElement"])(OriginalComponent, Object(esm_extends["a" /* default */])({}, this.props, this.state, {
  921. setState: this.setState
  922. }));
  923. }
  924. }]);
  925. return WrappedComponent;
  926. }(external_this_wp_element_["Component"])
  927. );
  928. }, 'withState');
  929. }
  930. // EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js
  931. var use_media_query = __webpack_require__(110);
  932. // EXTERNAL MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
  933. var use_reduced_motion = __webpack_require__(210);
  934. // CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/index.js
  935. /* concated harmony reexport createHigherOrderComponent */__webpack_require__.d(__webpack_exports__, "createHigherOrderComponent", function() { return create_higher_order_component; });
  936. /* concated harmony reexport compose */__webpack_require__.d(__webpack_exports__, "compose", function() { return external_lodash_["flowRight"]; });
  937. /* concated harmony reexport ifCondition */__webpack_require__.d(__webpack_exports__, "ifCondition", function() { return if_condition; });
  938. /* concated harmony reexport pure */__webpack_require__.d(__webpack_exports__, "pure", function() { return higher_order_pure; });
  939. /* concated harmony reexport withGlobalEvents */__webpack_require__.d(__webpack_exports__, "withGlobalEvents", function() { return with_global_events; });
  940. /* concated harmony reexport withInstanceId */__webpack_require__.d(__webpack_exports__, "withInstanceId", function() { return with_instance_id; });
  941. /* concated harmony reexport withSafeTimeout */__webpack_require__.d(__webpack_exports__, "withSafeTimeout", function() { return with_safe_timeout; });
  942. /* concated harmony reexport withState */__webpack_require__.d(__webpack_exports__, "withState", function() { return withState; });
  943. /* concated harmony reexport useMediaQuery */__webpack_require__.d(__webpack_exports__, "useMediaQuery", function() { return use_media_query["a" /* default */]; });
  944. /* concated harmony reexport useReducedMotion */__webpack_require__.d(__webpack_exports__, "useReducedMotion", function() { return use_reduced_motion["a" /* default */]; });
  945. /**
  946. * External dependencies
  947. */
  948. // Utils
  949. /**
  950. * Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
  951. * composition, where each successive invocation is supplied the return value of the previous.
  952. *
  953. * @param {...Function} hocs The HOC functions to invoke.
  954. *
  955. * @return {Function} Returns the new composite function.
  956. */
  957. // Higher-order components
  958. // Hooks
  959. /***/ }),
  960. /***/ 38:
  961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  962. "use strict";
  963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
  964. function _arrayWithHoles(arr) {
  965. if (Array.isArray(arr)) return arr;
  966. }
  967. /***/ }),
  968. /***/ 39:
  969. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  970. "use strict";
  971. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
  972. function _nonIterableRest() {
  973. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  974. }
  975. /***/ }),
  976. /***/ 41:
  977. /***/ (function(module, exports) {
  978. (function() { module.exports = this["wp"]["isShallowEqual"]; }());
  979. /***/ }),
  980. /***/ 5:
  981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  982. "use strict";
  983. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; });
  984. function _assertThisInitialized(self) {
  985. if (self === void 0) {
  986. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  987. }
  988. return self;
  989. }
  990. /***/ })
  991. /******/ });