wp/wp-includes/js/dist/compose.js
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     1 /******/ (function() { // webpackBootstrap
     1 /******/ (() => { // webpackBootstrap
     2 /******/ 	var __webpack_modules__ = ({
     2 /******/ 	var __webpack_modules__ = ({
     3 
     3 
     4 /***/ 8294:
     4 /***/ 6689:
       
     5 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
       
     6 
       
     7 "use strict";
       
     8 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
       
     9 /* harmony export */   createUndoManager: () => (/* binding */ createUndoManager)
       
    10 /* harmony export */ });
       
    11 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(923);
       
    12 /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0__);
       
    13 /**
       
    14  * WordPress dependencies
       
    15  */
       
    16 
       
    17 
       
    18 /** @typedef {import('./types').HistoryRecord}  HistoryRecord */
       
    19 /** @typedef {import('./types').HistoryChange}  HistoryChange */
       
    20 /** @typedef {import('./types').HistoryChanges} HistoryChanges */
       
    21 /** @typedef {import('./types').UndoManager} UndoManager */
       
    22 
       
    23 /**
       
    24  * Merge changes for a single item into a record of changes.
       
    25  *
       
    26  * @param {Record< string, HistoryChange >} changes1 Previous changes
       
    27  * @param {Record< string, HistoryChange >} changes2 NextChanges
       
    28  *
       
    29  * @return {Record< string, HistoryChange >} Merged changes
       
    30  */
       
    31 function mergeHistoryChanges(changes1, changes2) {
       
    32   /**
       
    33    * @type {Record< string, HistoryChange >}
       
    34    */
       
    35   const newChanges = {
       
    36     ...changes1
       
    37   };
       
    38   Object.entries(changes2).forEach(([key, value]) => {
       
    39     if (newChanges[key]) {
       
    40       newChanges[key] = {
       
    41         ...newChanges[key],
       
    42         to: value.to
       
    43       };
       
    44     } else {
       
    45       newChanges[key] = value;
       
    46     }
       
    47   });
       
    48   return newChanges;
       
    49 }
       
    50 
       
    51 /**
       
    52  * Adds history changes for a single item into a record of changes.
       
    53  *
       
    54  * @param {HistoryRecord}  record  The record to merge into.
       
    55  * @param {HistoryChanges} changes The changes to merge.
       
    56  */
       
    57 const addHistoryChangesIntoRecord = (record, changes) => {
       
    58   const existingChangesIndex = record?.findIndex(({
       
    59     id: recordIdentifier
       
    60   }) => {
       
    61     return typeof recordIdentifier === 'string' ? recordIdentifier === changes.id : _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(recordIdentifier, changes.id);
       
    62   });
       
    63   const nextRecord = [...record];
       
    64   if (existingChangesIndex !== -1) {
       
    65     // If the edit is already in the stack leave the initial "from" value.
       
    66     nextRecord[existingChangesIndex] = {
       
    67       id: changes.id,
       
    68       changes: mergeHistoryChanges(nextRecord[existingChangesIndex].changes, changes.changes)
       
    69     };
       
    70   } else {
       
    71     nextRecord.push(changes);
       
    72   }
       
    73   return nextRecord;
       
    74 };
       
    75 
       
    76 /**
       
    77  * Creates an undo manager.
       
    78  *
       
    79  * @return {UndoManager} Undo manager.
       
    80  */
       
    81 function createUndoManager() {
       
    82   /**
       
    83    * @type {HistoryRecord[]}
       
    84    */
       
    85   let history = [];
       
    86   /**
       
    87    * @type {HistoryRecord}
       
    88    */
       
    89   let stagedRecord = [];
       
    90   /**
       
    91    * @type {number}
       
    92    */
       
    93   let offset = 0;
       
    94   const dropPendingRedos = () => {
       
    95     history = history.slice(0, offset || undefined);
       
    96     offset = 0;
       
    97   };
       
    98   const appendStagedRecordToLatestHistoryRecord = () => {
       
    99     var _history$index;
       
   100     const index = history.length === 0 ? 0 : history.length - 1;
       
   101     let latestRecord = (_history$index = history[index]) !== null && _history$index !== void 0 ? _history$index : [];
       
   102     stagedRecord.forEach(changes => {
       
   103       latestRecord = addHistoryChangesIntoRecord(latestRecord, changes);
       
   104     });
       
   105     stagedRecord = [];
       
   106     history[index] = latestRecord;
       
   107   };
       
   108 
       
   109   /**
       
   110    * Checks whether a record is empty.
       
   111    * A record is considered empty if it the changes keep the same values.
       
   112    * Also updates to function values are ignored.
       
   113    *
       
   114    * @param {HistoryRecord} record
       
   115    * @return {boolean} Whether the record is empty.
       
   116    */
       
   117   const isRecordEmpty = record => {
       
   118     const filteredRecord = record.filter(({
       
   119       changes
       
   120     }) => {
       
   121       return Object.values(changes).some(({
       
   122         from,
       
   123         to
       
   124       }) => typeof from !== 'function' && typeof to !== 'function' && !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_0___default()(from, to));
       
   125     });
       
   126     return !filteredRecord.length;
       
   127   };
       
   128   return {
       
   129     /**
       
   130      * Record changes into the history.
       
   131      *
       
   132      * @param {HistoryRecord=} record   A record of changes to record.
       
   133      * @param {boolean}        isStaged Whether to immediately create an undo point or not.
       
   134      */
       
   135     addRecord(record, isStaged = false) {
       
   136       const isEmpty = !record || isRecordEmpty(record);
       
   137       if (isStaged) {
       
   138         if (isEmpty) {
       
   139           return;
       
   140         }
       
   141         record.forEach(changes => {
       
   142           stagedRecord = addHistoryChangesIntoRecord(stagedRecord, changes);
       
   143         });
       
   144       } else {
       
   145         dropPendingRedos();
       
   146         if (stagedRecord.length) {
       
   147           appendStagedRecordToLatestHistoryRecord();
       
   148         }
       
   149         if (isEmpty) {
       
   150           return;
       
   151         }
       
   152         history.push(record);
       
   153       }
       
   154     },
       
   155     undo() {
       
   156       if (stagedRecord.length) {
       
   157         dropPendingRedos();
       
   158         appendStagedRecordToLatestHistoryRecord();
       
   159       }
       
   160       const undoRecord = history[history.length - 1 + offset];
       
   161       if (!undoRecord) {
       
   162         return;
       
   163       }
       
   164       offset -= 1;
       
   165       return undoRecord;
       
   166     },
       
   167     redo() {
       
   168       const redoRecord = history[history.length + offset];
       
   169       if (!redoRecord) {
       
   170         return;
       
   171       }
       
   172       offset += 1;
       
   173       return redoRecord;
       
   174     },
       
   175     hasUndo() {
       
   176       return !!history[history.length - 1 + offset];
       
   177     },
       
   178     hasRedo() {
       
   179       return !!history[history.length + offset];
       
   180     }
       
   181   };
       
   182 }
       
   183 
       
   184 
       
   185 /***/ }),
       
   186 
       
   187 /***/ 3758:
     5 /***/ (function(module) {
   188 /***/ (function(module) {
     6 
   189 
     7 /*!
   190 /*!
     8  * clipboard.js v2.0.10
   191  * clipboard.js v2.0.11
     9  * https://clipboardjs.com/
   192  * https://clipboardjs.com/
    10  *
   193  *
    11  * Licensed MIT © Zeno Rocha
   194  * Licensed MIT © Zeno Rocha
    12  */
   195  */
    13 (function webpackUniversalModuleDefinition(root, factory) {
   196 (function webpackUniversalModuleDefinition(root, factory) {
    17 })(this, function() {
   200 })(this, function() {
    18 return /******/ (function() { // webpackBootstrap
   201 return /******/ (function() { // webpackBootstrap
    19 /******/ 	var __webpack_modules__ = ({
   202 /******/ 	var __webpack_modules__ = ({
    20 
   203 
    21 /***/ 686:
   204 /***/ 686:
    22 /***/ (function(__unused_webpack_module, __webpack_exports__, __nested_webpack_require_623__) {
   205 /***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_623__) {
    23 
   206 
    24 "use strict";
   207 "use strict";
    25 
   208 
    26 // EXPORTS
   209 // EXPORTS
    27 __nested_webpack_require_623__.d(__webpack_exports__, {
   210 __nested_webpack_require_623__.d(__nested_webpack_exports__, {
    28   "default": function() { return /* binding */ clipboard; }
   211   "default": function() { return /* binding */ clipboard; }
    29 });
   212 });
    30 
   213 
    31 // EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
   214 // EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
    32 var tiny_emitter = __nested_webpack_require_623__(279);
   215 var tiny_emitter = __nested_webpack_require_623__(279);
    94 ;// CONCATENATED MODULE: ./src/actions/copy.js
   277 ;// CONCATENATED MODULE: ./src/actions/copy.js
    95 
   278 
    96 
   279 
    97 
   280 
    98 /**
   281 /**
       
   282  * Create fake copy action wrapper using a fake element.
       
   283  * @param {String} target
       
   284  * @param {Object} options
       
   285  * @return {String}
       
   286  */
       
   287 
       
   288 var fakeCopyAction = function fakeCopyAction(value, options) {
       
   289   var fakeElement = createFakeElement(value);
       
   290   options.container.appendChild(fakeElement);
       
   291   var selectedText = select_default()(fakeElement);
       
   292   command('copy');
       
   293   fakeElement.remove();
       
   294   return selectedText;
       
   295 };
       
   296 /**
    99  * Copy action wrapper.
   297  * Copy action wrapper.
   100  * @param {String|HTMLElement} target
   298  * @param {String|HTMLElement} target
   101  * @param {Object} options
   299  * @param {Object} options
   102  * @return {String}
   300  * @return {String}
   103  */
   301  */
       
   302 
   104 
   303 
   105 var ClipboardActionCopy = function ClipboardActionCopy(target) {
   304 var ClipboardActionCopy = function ClipboardActionCopy(target) {
   106   var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
   305   var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
   107     container: document.body
   306     container: document.body
   108   };
   307   };
   109   var selectedText = '';
   308   var selectedText = '';
   110 
   309 
   111   if (typeof target === 'string') {
   310   if (typeof target === 'string') {
   112     var fakeElement = createFakeElement(target);
   311     selectedText = fakeCopyAction(target, options);
   113     options.container.appendChild(fakeElement);
   312   } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {
   114     selectedText = select_default()(fakeElement);
   313     // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
   115     command('copy');
   314     selectedText = fakeCopyAction(target.value, options);
   116     fakeElement.remove();
       
   117   } else {
   315   } else {
   118     selectedText = select_default()(target);
   316     selectedText = select_default()(target);
   119     command('copy');
   317     command('copy');
   120   }
   318   }
   121 
   319 
   303         clearSelection: function clearSelection() {
   501         clearSelection: function clearSelection() {
   304           if (trigger) {
   502           if (trigger) {
   305             trigger.focus();
   503             trigger.focus();
   306           }
   504           }
   307 
   505 
   308           document.activeElement.blur();
       
   309           window.getSelection().removeAllRanges();
   506           window.getSelection().removeAllRanges();
   310         }
   507         }
   311       });
   508       });
   312     }
   509     }
   313     /**
   510     /**
   444 
   641 
   445 
   642 
   446 /***/ }),
   643 /***/ }),
   447 
   644 
   448 /***/ 438:
   645 /***/ 438:
   449 /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15133__) {
   646 /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15749__) {
   450 
   647 
   451 var closest = __nested_webpack_require_15133__(828);
   648 var closest = __nested_webpack_require_15749__(828);
   452 
   649 
   453 /**
   650 /**
   454  * Delegates event to a selector.
   651  * Delegates event to a selector.
   455  *
   652  *
   456  * @param {Element} element
   653  * @param {Element} element
   585 
   782 
   586 
   783 
   587 /***/ }),
   784 /***/ }),
   588 
   785 
   589 /***/ 370:
   786 /***/ 370:
   590 /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_18497__) {
   787 /***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19113__) {
   591 
   788 
   592 var is = __nested_webpack_require_18497__(879);
   789 var is = __nested_webpack_require_19113__(879);
   593 var delegate = __nested_webpack_require_18497__(438);
   790 var delegate = __nested_webpack_require_19113__(438);
   594 
   791 
   595 /**
   792 /**
   596  * Validates all params and calls the right
   793  * Validates all params and calls the right
   597  * listener function based on its target type.
   794  * listener function based on its target type.
   598  *
   795  *
   816 /************************************************************************/
  1013 /************************************************************************/
   817 /******/ 	// The module cache
  1014 /******/ 	// The module cache
   818 /******/ 	var __webpack_module_cache__ = {};
  1015 /******/ 	var __webpack_module_cache__ = {};
   819 /******/ 	
  1016 /******/ 	
   820 /******/ 	// The require function
  1017 /******/ 	// The require function
   821 /******/ 	function __nested_webpack_require_23879__(moduleId) {
  1018 /******/ 	function __nested_webpack_require_24495__(moduleId) {
   822 /******/ 		// Check if module is in cache
  1019 /******/ 		// Check if module is in cache
   823 /******/ 		if(__webpack_module_cache__[moduleId]) {
  1020 /******/ 		if(__webpack_module_cache__[moduleId]) {
   824 /******/ 			return __webpack_module_cache__[moduleId].exports;
  1021 /******/ 			return __webpack_module_cache__[moduleId].exports;
   825 /******/ 		}
  1022 /******/ 		}
   826 /******/ 		// Create a new module (and put it into the cache)
  1023 /******/ 		// Create a new module (and put it into the cache)
   829 /******/ 			// no module.loaded needed
  1026 /******/ 			// no module.loaded needed
   830 /******/ 			exports: {}
  1027 /******/ 			exports: {}
   831 /******/ 		};
  1028 /******/ 		};
   832 /******/ 	
  1029 /******/ 	
   833 /******/ 		// Execute the module function
  1030 /******/ 		// Execute the module function
   834 /******/ 		__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_23879__);
  1031 /******/ 		__webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_24495__);
   835 /******/ 	
  1032 /******/ 	
   836 /******/ 		// Return the exports of the module
  1033 /******/ 		// Return the exports of the module
   837 /******/ 		return module.exports;
  1034 /******/ 		return module.exports;
   838 /******/ 	}
  1035 /******/ 	}
   839 /******/ 	
  1036 /******/ 	
   840 /************************************************************************/
  1037 /************************************************************************/
   841 /******/ 	/* webpack/runtime/compat get default export */
  1038 /******/ 	/* webpack/runtime/compat get default export */
   842 /******/ 	!function() {
  1039 /******/ 	!function() {
   843 /******/ 		// getDefaultExport function for compatibility with non-harmony modules
  1040 /******/ 		// getDefaultExport function for compatibility with non-harmony modules
   844 /******/ 		__nested_webpack_require_23879__.n = function(module) {
  1041 /******/ 		__nested_webpack_require_24495__.n = function(module) {
   845 /******/ 			var getter = module && module.__esModule ?
  1042 /******/ 			var getter = module && module.__esModule ?
   846 /******/ 				function() { return module['default']; } :
  1043 /******/ 				function() { return module['default']; } :
   847 /******/ 				function() { return module; };
  1044 /******/ 				function() { return module; };
   848 /******/ 			__nested_webpack_require_23879__.d(getter, { a: getter });
  1045 /******/ 			__nested_webpack_require_24495__.d(getter, { a: getter });
   849 /******/ 			return getter;
  1046 /******/ 			return getter;
   850 /******/ 		};
  1047 /******/ 		};
   851 /******/ 	}();
  1048 /******/ 	}();
   852 /******/ 	
  1049 /******/ 	
   853 /******/ 	/* webpack/runtime/define property getters */
  1050 /******/ 	/* webpack/runtime/define property getters */
   854 /******/ 	!function() {
  1051 /******/ 	!function() {
   855 /******/ 		// define getter functions for harmony exports
  1052 /******/ 		// define getter functions for harmony exports
   856 /******/ 		__nested_webpack_require_23879__.d = function(exports, definition) {
  1053 /******/ 		__nested_webpack_require_24495__.d = function(exports, definition) {
   857 /******/ 			for(var key in definition) {
  1054 /******/ 			for(var key in definition) {
   858 /******/ 				if(__nested_webpack_require_23879__.o(definition, key) && !__nested_webpack_require_23879__.o(exports, key)) {
  1055 /******/ 				if(__nested_webpack_require_24495__.o(definition, key) && !__nested_webpack_require_24495__.o(exports, key)) {
   859 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  1056 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
   860 /******/ 				}
  1057 /******/ 				}
   861 /******/ 			}
  1058 /******/ 			}
   862 /******/ 		};
  1059 /******/ 		};
   863 /******/ 	}();
  1060 /******/ 	}();
   864 /******/ 	
  1061 /******/ 	
   865 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
  1062 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
   866 /******/ 	!function() {
  1063 /******/ 	!function() {
   867 /******/ 		__nested_webpack_require_23879__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  1064 /******/ 		__nested_webpack_require_24495__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
   868 /******/ 	}();
  1065 /******/ 	}();
   869 /******/ 	
  1066 /******/ 	
   870 /************************************************************************/
  1067 /************************************************************************/
   871 /******/ 	// module exports must be returned from runtime so entry inlining is disabled
  1068 /******/ 	// module exports must be returned from runtime so entry inlining is disabled
   872 /******/ 	// startup
  1069 /******/ 	// startup
   873 /******/ 	// Load entry module and return exports
  1070 /******/ 	// Load entry module and return exports
   874 /******/ 	return __nested_webpack_require_23879__(686);
  1071 /******/ 	return __nested_webpack_require_24495__(686);
   875 /******/ })()
  1072 /******/ })()
   876 .default;
  1073 .default;
   877 });
  1074 });
   878 
  1075 
   879 /***/ }),
  1076 /***/ }),
   880 
  1077 
   881 /***/ 7973:
  1078 /***/ 1933:
   882 /***/ (function(module, exports, __webpack_require__) {
  1079 /***/ ((module, exports, __webpack_require__) => {
   883 
  1080 
   884 var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
  1081 var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
   885 /**
  1082 /**
   886  * Copyright 2012-2017 Craig Campbell
  1083  * Copyright 2012-2017 Craig Campbell
   887  *
  1084  *
  1942 }) (typeof window !== 'undefined' ? window : null, typeof  window !== 'undefined' ? document : null);
  2139 }) (typeof window !== 'undefined' ? window : null, typeof  window !== 'undefined' ? document : null);
  1943 
  2140 
  1944 
  2141 
  1945 /***/ }),
  2142 /***/ }),
  1946 
  2143 
  1947 /***/ 5538:
  2144 /***/ 5760:
  1948 /***/ (function() {
  2145 /***/ (() => {
  1949 
  2146 
  1950 /**
  2147 /**
  1951  * adds a bindGlobal method to Mousetrap that allows you to
  2148  * adds a bindGlobal method to Mousetrap that allows you to
  1952  * bind specific keyboard shortcuts that will still work
  2149  * bind specific keyboard shortcuts that will still work
  1953  * inside a text input field
  2150  * inside a text input field
  1995 }) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined);
  2192 }) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined);
  1996 
  2193 
  1997 
  2194 
  1998 /***/ }),
  2195 /***/ }),
  1999 
  2196 
  2000 /***/ 235:
  2197 /***/ 923:
  2001 /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  2198 /***/ ((module) => {
  2002 
       
  2003 var e=__webpack_require__(9196),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]};
       
  2004 
       
  2005 
       
  2006 /***/ }),
       
  2007 
       
  2008 /***/ 9196:
       
  2009 /***/ (function(module) {
       
  2010 
  2199 
  2011 "use strict";
  2200 "use strict";
  2012 module.exports = window["React"];
  2201 module.exports = window["wp"]["isShallowEqual"];
  2013 
  2202 
  2014 /***/ })
  2203 /***/ })
  2015 
  2204 
  2016 /******/ 	});
  2205 /******/ 	});
  2017 /************************************************************************/
  2206 /************************************************************************/
  2039 /******/ 		return module.exports;
  2228 /******/ 		return module.exports;
  2040 /******/ 	}
  2229 /******/ 	}
  2041 /******/ 	
  2230 /******/ 	
  2042 /************************************************************************/
  2231 /************************************************************************/
  2043 /******/ 	/* webpack/runtime/compat get default export */
  2232 /******/ 	/* webpack/runtime/compat get default export */
  2044 /******/ 	!function() {
  2233 /******/ 	(() => {
  2045 /******/ 		// getDefaultExport function for compatibility with non-harmony modules
  2234 /******/ 		// getDefaultExport function for compatibility with non-harmony modules
  2046 /******/ 		__webpack_require__.n = function(module) {
  2235 /******/ 		__webpack_require__.n = (module) => {
  2047 /******/ 			var getter = module && module.__esModule ?
  2236 /******/ 			var getter = module && module.__esModule ?
  2048 /******/ 				function() { return module['default']; } :
  2237 /******/ 				() => (module['default']) :
  2049 /******/ 				function() { return module; };
  2238 /******/ 				() => (module);
  2050 /******/ 			__webpack_require__.d(getter, { a: getter });
  2239 /******/ 			__webpack_require__.d(getter, { a: getter });
  2051 /******/ 			return getter;
  2240 /******/ 			return getter;
  2052 /******/ 		};
  2241 /******/ 		};
  2053 /******/ 	}();
  2242 /******/ 	})();
  2054 /******/ 	
  2243 /******/ 	
  2055 /******/ 	/* webpack/runtime/define property getters */
  2244 /******/ 	/* webpack/runtime/define property getters */
  2056 /******/ 	!function() {
  2245 /******/ 	(() => {
  2057 /******/ 		// define getter functions for harmony exports
  2246 /******/ 		// define getter functions for harmony exports
  2058 /******/ 		__webpack_require__.d = function(exports, definition) {
  2247 /******/ 		__webpack_require__.d = (exports, definition) => {
  2059 /******/ 			for(var key in definition) {
  2248 /******/ 			for(var key in definition) {
  2060 /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  2249 /******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  2061 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  2250 /******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  2062 /******/ 				}
  2251 /******/ 				}
  2063 /******/ 			}
  2252 /******/ 			}
  2064 /******/ 		};
  2253 /******/ 		};
  2065 /******/ 	}();
  2254 /******/ 	})();
  2066 /******/ 	
  2255 /******/ 	
  2067 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
  2256 /******/ 	/* webpack/runtime/hasOwnProperty shorthand */
  2068 /******/ 	!function() {
  2257 /******/ 	(() => {
  2069 /******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  2258 /******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  2070 /******/ 	}();
  2259 /******/ 	})();
  2071 /******/ 	
  2260 /******/ 	
  2072 /******/ 	/* webpack/runtime/make namespace object */
  2261 /******/ 	/* webpack/runtime/make namespace object */
  2073 /******/ 	!function() {
  2262 /******/ 	(() => {
  2074 /******/ 		// define __esModule on exports
  2263 /******/ 		// define __esModule on exports
  2075 /******/ 		__webpack_require__.r = function(exports) {
  2264 /******/ 		__webpack_require__.r = (exports) => {
  2076 /******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  2265 /******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  2077 /******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  2266 /******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  2078 /******/ 			}
  2267 /******/ 			}
  2079 /******/ 			Object.defineProperty(exports, '__esModule', { value: true });
  2268 /******/ 			Object.defineProperty(exports, '__esModule', { value: true });
  2080 /******/ 		};
  2269 /******/ 		};
  2081 /******/ 	}();
  2270 /******/ 	})();
  2082 /******/ 	
  2271 /******/ 	
  2083 /************************************************************************/
  2272 /************************************************************************/
  2084 var __webpack_exports__ = {};
  2273 var __webpack_exports__ = {};
  2085 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  2274 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  2086 !function() {
  2275 (() => {
  2087 "use strict";
  2276 "use strict";
  2088 // ESM COMPAT FLAG
  2277 // ESM COMPAT FLAG
  2089 __webpack_require__.r(__webpack_exports__);
  2278 __webpack_require__.r(__webpack_exports__);
  2090 
  2279 
  2091 // EXPORTS
  2280 // EXPORTS
  2092 __webpack_require__.d(__webpack_exports__, {
  2281 __webpack_require__.d(__webpack_exports__, {
  2093   "__experimentalUseDialog": function() { return /* reexport */ use_dialog; },
  2282   __experimentalUseDialog: () => (/* reexport */ use_dialog),
  2094   "__experimentalUseDisabled": function() { return /* reexport */ useDisabled; },
  2283   __experimentalUseDragging: () => (/* reexport */ useDragging),
  2095   "__experimentalUseDragging": function() { return /* reexport */ useDragging; },
  2284   __experimentalUseDropZone: () => (/* reexport */ useDropZone),
  2096   "__experimentalUseDropZone": function() { return /* reexport */ useDropZone; },
  2285   __experimentalUseFixedWindowList: () => (/* reexport */ useFixedWindowList),
  2097   "__experimentalUseFixedWindowList": function() { return /* reexport */ useFixedWindowList; },
  2286   __experimentalUseFocusOutside: () => (/* reexport */ useFocusOutside),
  2098   "__experimentalUseFocusOutside": function() { return /* reexport */ useFocusOutside; },
  2287   compose: () => (/* reexport */ higher_order_compose),
  2099   "compose": function() { return /* reexport */ compose; },
  2288   createHigherOrderComponent: () => (/* reexport */ createHigherOrderComponent),
  2100   "createHigherOrderComponent": function() { return /* reexport */ create_higher_order_component; },
  2289   debounce: () => (/* reexport */ debounce),
  2101   "ifCondition": function() { return /* reexport */ if_condition; },
  2290   ifCondition: () => (/* reexport */ if_condition),
  2102   "pure": function() { return /* reexport */ higher_order_pure; },
  2291   observableMap: () => (/* reexport */ observableMap),
  2103   "useAsyncList": function() { return /* reexport */ use_async_list; },
  2292   pipe: () => (/* reexport */ higher_order_pipe),
  2104   "useConstrainedTabbing": function() { return /* reexport */ use_constrained_tabbing; },
  2293   pure: () => (/* reexport */ higher_order_pure),
  2105   "useCopyOnClick": function() { return /* reexport */ useCopyOnClick; },
  2294   throttle: () => (/* reexport */ throttle),
  2106   "useCopyToClipboard": function() { return /* reexport */ useCopyToClipboard; },
  2295   useAsyncList: () => (/* reexport */ use_async_list),
  2107   "useDebounce": function() { return /* reexport */ useDebounce; },
  2296   useConstrainedTabbing: () => (/* reexport */ use_constrained_tabbing),
  2108   "useFocusOnMount": function() { return /* reexport */ useFocusOnMount; },
  2297   useCopyOnClick: () => (/* reexport */ useCopyOnClick),
  2109   "useFocusReturn": function() { return /* reexport */ use_focus_return; },
  2298   useCopyToClipboard: () => (/* reexport */ useCopyToClipboard),
  2110   "useFocusableIframe": function() { return /* reexport */ useFocusableIframe; },
  2299   useDebounce: () => (/* reexport */ useDebounce),
  2111   "useInstanceId": function() { return /* reexport */ useInstanceId; },
  2300   useDebouncedInput: () => (/* reexport */ useDebouncedInput),
  2112   "useIsomorphicLayoutEffect": function() { return /* reexport */ use_isomorphic_layout_effect; },
  2301   useDisabled: () => (/* reexport */ useDisabled),
  2113   "useKeyboardShortcut": function() { return /* reexport */ use_keyboard_shortcut; },
  2302   useFocusOnMount: () => (/* reexport */ useFocusOnMount),
  2114   "useMediaQuery": function() { return /* reexport */ useMediaQuery; },
  2303   useFocusReturn: () => (/* reexport */ use_focus_return),
  2115   "useMergeRefs": function() { return /* reexport */ useMergeRefs; },
  2304   useFocusableIframe: () => (/* reexport */ useFocusableIframe),
  2116   "usePrevious": function() { return /* reexport */ usePrevious; },
  2305   useInstanceId: () => (/* reexport */ use_instance_id),
  2117   "useReducedMotion": function() { return /* reexport */ use_reduced_motion; },
  2306   useIsomorphicLayoutEffect: () => (/* reexport */ use_isomorphic_layout_effect),
  2118   "useRefEffect": function() { return /* reexport */ useRefEffect; },
  2307   useKeyboardShortcut: () => (/* reexport */ use_keyboard_shortcut),
  2119   "useResizeObserver": function() { return /* reexport */ use_resize_observer; },
  2308   useMediaQuery: () => (/* reexport */ useMediaQuery),
  2120   "useThrottle": function() { return /* reexport */ useThrottle; },
  2309   useMergeRefs: () => (/* reexport */ useMergeRefs),
  2121   "useViewportMatch": function() { return /* reexport */ use_viewport_match; },
  2310   useObservableValue: () => (/* reexport */ useObservableValue),
  2122   "useWarnOnChange": function() { return /* reexport */ use_warn_on_change; },
  2311   usePrevious: () => (/* reexport */ usePrevious),
  2123   "withGlobalEvents": function() { return /* reexport */ withGlobalEvents; },
  2312   useReducedMotion: () => (/* reexport */ use_reduced_motion),
  2124   "withInstanceId": function() { return /* reexport */ with_instance_id; },
  2313   useRefEffect: () => (/* reexport */ useRefEffect),
  2125   "withSafeTimeout": function() { return /* reexport */ with_safe_timeout; },
  2314   useResizeObserver: () => (/* reexport */ useResizeAware),
  2126   "withState": function() { return /* reexport */ withState; }
  2315   useStateWithHistory: () => (/* reexport */ useStateWithHistory),
       
  2316   useThrottle: () => (/* reexport */ useThrottle),
       
  2317   useViewportMatch: () => (/* reexport */ use_viewport_match),
       
  2318   useWarnOnChange: () => (/* reexport */ use_warn_on_change),
       
  2319   withGlobalEvents: () => (/* reexport */ withGlobalEvents),
       
  2320   withInstanceId: () => (/* reexport */ with_instance_id),
       
  2321   withSafeTimeout: () => (/* reexport */ with_safe_timeout),
       
  2322   withState: () => (/* reexport */ withState)
  2127 });
  2323 });
  2128 
  2324 
  2129 ;// CONCATENATED MODULE: external "lodash"
  2325 ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs
  2130 var external_lodash_namespaceObject = window["lodash"];
  2326 /******************************************************************************
       
  2327 Copyright (c) Microsoft Corporation.
       
  2328 
       
  2329 Permission to use, copy, modify, and/or distribute this software for any
       
  2330 purpose with or without fee is hereby granted.
       
  2331 
       
  2332 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
       
  2333 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
       
  2334 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
       
  2335 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
       
  2336 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
       
  2337 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
       
  2338 PERFORMANCE OF THIS SOFTWARE.
       
  2339 ***************************************************************************** */
       
  2340 /* global Reflect, Promise, SuppressedError, Symbol */
       
  2341 
       
  2342 var extendStatics = function(d, b) {
       
  2343   extendStatics = Object.setPrototypeOf ||
       
  2344       ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
       
  2345       function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
       
  2346   return extendStatics(d, b);
       
  2347 };
       
  2348 
       
  2349 function __extends(d, b) {
       
  2350   if (typeof b !== "function" && b !== null)
       
  2351       throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
       
  2352   extendStatics(d, b);
       
  2353   function __() { this.constructor = d; }
       
  2354   d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
       
  2355 }
       
  2356 
       
  2357 var __assign = function() {
       
  2358   __assign = Object.assign || function __assign(t) {
       
  2359       for (var s, i = 1, n = arguments.length; i < n; i++) {
       
  2360           s = arguments[i];
       
  2361           for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
       
  2362       }
       
  2363       return t;
       
  2364   }
       
  2365   return __assign.apply(this, arguments);
       
  2366 }
       
  2367 
       
  2368 function __rest(s, e) {
       
  2369   var t = {};
       
  2370   for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
       
  2371       t[p] = s[p];
       
  2372   if (s != null && typeof Object.getOwnPropertySymbols === "function")
       
  2373       for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
       
  2374           if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
       
  2375               t[p[i]] = s[p[i]];
       
  2376       }
       
  2377   return t;
       
  2378 }
       
  2379 
       
  2380 function __decorate(decorators, target, key, desc) {
       
  2381   var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
       
  2382   if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
       
  2383   else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
       
  2384   return c > 3 && r && Object.defineProperty(target, key, r), r;
       
  2385 }
       
  2386 
       
  2387 function __param(paramIndex, decorator) {
       
  2388   return function (target, key) { decorator(target, key, paramIndex); }
       
  2389 }
       
  2390 
       
  2391 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
       
  2392   function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
       
  2393   var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
       
  2394   var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
       
  2395   var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
       
  2396   var _, done = false;
       
  2397   for (var i = decorators.length - 1; i >= 0; i--) {
       
  2398       var context = {};
       
  2399       for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
       
  2400       for (var p in contextIn.access) context.access[p] = contextIn.access[p];
       
  2401       context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
       
  2402       var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
       
  2403       if (kind === "accessor") {
       
  2404           if (result === void 0) continue;
       
  2405           if (result === null || typeof result !== "object") throw new TypeError("Object expected");
       
  2406           if (_ = accept(result.get)) descriptor.get = _;
       
  2407           if (_ = accept(result.set)) descriptor.set = _;
       
  2408           if (_ = accept(result.init)) initializers.unshift(_);
       
  2409       }
       
  2410       else if (_ = accept(result)) {
       
  2411           if (kind === "field") initializers.unshift(_);
       
  2412           else descriptor[key] = _;
       
  2413       }
       
  2414   }
       
  2415   if (target) Object.defineProperty(target, contextIn.name, descriptor);
       
  2416   done = true;
       
  2417 };
       
  2418 
       
  2419 function __runInitializers(thisArg, initializers, value) {
       
  2420   var useValue = arguments.length > 2;
       
  2421   for (var i = 0; i < initializers.length; i++) {
       
  2422       value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
       
  2423   }
       
  2424   return useValue ? value : void 0;
       
  2425 };
       
  2426 
       
  2427 function __propKey(x) {
       
  2428   return typeof x === "symbol" ? x : "".concat(x);
       
  2429 };
       
  2430 
       
  2431 function __setFunctionName(f, name, prefix) {
       
  2432   if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
       
  2433   return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
       
  2434 };
       
  2435 
       
  2436 function __metadata(metadataKey, metadataValue) {
       
  2437   if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
       
  2438 }
       
  2439 
       
  2440 function __awaiter(thisArg, _arguments, P, generator) {
       
  2441   function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
       
  2442   return new (P || (P = Promise))(function (resolve, reject) {
       
  2443       function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
       
  2444       function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
       
  2445       function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
       
  2446       step((generator = generator.apply(thisArg, _arguments || [])).next());
       
  2447   });
       
  2448 }
       
  2449 
       
  2450 function __generator(thisArg, body) {
       
  2451   var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
       
  2452   return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
       
  2453   function verb(n) { return function (v) { return step([n, v]); }; }
       
  2454   function step(op) {
       
  2455       if (f) throw new TypeError("Generator is already executing.");
       
  2456       while (g && (g = 0, op[0] && (_ = 0)), _) try {
       
  2457           if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
       
  2458           if (y = 0, t) op = [op[0] & 2, t.value];
       
  2459           switch (op[0]) {
       
  2460               case 0: case 1: t = op; break;
       
  2461               case 4: _.label++; return { value: op[1], done: false };
       
  2462               case 5: _.label++; y = op[1]; op = [0]; continue;
       
  2463               case 7: op = _.ops.pop(); _.trys.pop(); continue;
       
  2464               default:
       
  2465                   if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
       
  2466                   if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
       
  2467                   if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
       
  2468                   if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
       
  2469                   if (t[2]) _.ops.pop();
       
  2470                   _.trys.pop(); continue;
       
  2471           }
       
  2472           op = body.call(thisArg, _);
       
  2473       } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
       
  2474       if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
       
  2475   }
       
  2476 }
       
  2477 
       
  2478 var __createBinding = Object.create ? (function(o, m, k, k2) {
       
  2479   if (k2 === undefined) k2 = k;
       
  2480   var desc = Object.getOwnPropertyDescriptor(m, k);
       
  2481   if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
       
  2482       desc = { enumerable: true, get: function() { return m[k]; } };
       
  2483   }
       
  2484   Object.defineProperty(o, k2, desc);
       
  2485 }) : (function(o, m, k, k2) {
       
  2486   if (k2 === undefined) k2 = k;
       
  2487   o[k2] = m[k];
       
  2488 });
       
  2489 
       
  2490 function __exportStar(m, o) {
       
  2491   for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
       
  2492 }
       
  2493 
       
  2494 function __values(o) {
       
  2495   var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
       
  2496   if (m) return m.call(o);
       
  2497   if (o && typeof o.length === "number") return {
       
  2498       next: function () {
       
  2499           if (o && i >= o.length) o = void 0;
       
  2500           return { value: o && o[i++], done: !o };
       
  2501       }
       
  2502   };
       
  2503   throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
       
  2504 }
       
  2505 
       
  2506 function __read(o, n) {
       
  2507   var m = typeof Symbol === "function" && o[Symbol.iterator];
       
  2508   if (!m) return o;
       
  2509   var i = m.call(o), r, ar = [], e;
       
  2510   try {
       
  2511       while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
       
  2512   }
       
  2513   catch (error) { e = { error: error }; }
       
  2514   finally {
       
  2515       try {
       
  2516           if (r && !r.done && (m = i["return"])) m.call(i);
       
  2517       }
       
  2518       finally { if (e) throw e.error; }
       
  2519   }
       
  2520   return ar;
       
  2521 }
       
  2522 
       
  2523 /** @deprecated */
       
  2524 function __spread() {
       
  2525   for (var ar = [], i = 0; i < arguments.length; i++)
       
  2526       ar = ar.concat(__read(arguments[i]));
       
  2527   return ar;
       
  2528 }
       
  2529 
       
  2530 /** @deprecated */
       
  2531 function __spreadArrays() {
       
  2532   for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
       
  2533   for (var r = Array(s), k = 0, i = 0; i < il; i++)
       
  2534       for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
       
  2535           r[k] = a[j];
       
  2536   return r;
       
  2537 }
       
  2538 
       
  2539 function __spreadArray(to, from, pack) {
       
  2540   if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
       
  2541       if (ar || !(i in from)) {
       
  2542           if (!ar) ar = Array.prototype.slice.call(from, 0, i);
       
  2543           ar[i] = from[i];
       
  2544       }
       
  2545   }
       
  2546   return to.concat(ar || Array.prototype.slice.call(from));
       
  2547 }
       
  2548 
       
  2549 function __await(v) {
       
  2550   return this instanceof __await ? (this.v = v, this) : new __await(v);
       
  2551 }
       
  2552 
       
  2553 function __asyncGenerator(thisArg, _arguments, generator) {
       
  2554   if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
       
  2555   var g = generator.apply(thisArg, _arguments || []), i, q = [];
       
  2556   return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
       
  2557   function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
       
  2558   function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
       
  2559   function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
       
  2560   function fulfill(value) { resume("next", value); }
       
  2561   function reject(value) { resume("throw", value); }
       
  2562   function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
       
  2563 }
       
  2564 
       
  2565 function __asyncDelegator(o) {
       
  2566   var i, p;
       
  2567   return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
       
  2568   function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
       
  2569 }
       
  2570 
       
  2571 function __asyncValues(o) {
       
  2572   if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
       
  2573   var m = o[Symbol.asyncIterator], i;
       
  2574   return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
       
  2575   function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
       
  2576   function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
       
  2577 }
       
  2578 
       
  2579 function __makeTemplateObject(cooked, raw) {
       
  2580   if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
       
  2581   return cooked;
       
  2582 };
       
  2583 
       
  2584 var __setModuleDefault = Object.create ? (function(o, v) {
       
  2585   Object.defineProperty(o, "default", { enumerable: true, value: v });
       
  2586 }) : function(o, v) {
       
  2587   o["default"] = v;
       
  2588 };
       
  2589 
       
  2590 function __importStar(mod) {
       
  2591   if (mod && mod.__esModule) return mod;
       
  2592   var result = {};
       
  2593   if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
       
  2594   __setModuleDefault(result, mod);
       
  2595   return result;
       
  2596 }
       
  2597 
       
  2598 function __importDefault(mod) {
       
  2599   return (mod && mod.__esModule) ? mod : { default: mod };
       
  2600 }
       
  2601 
       
  2602 function __classPrivateFieldGet(receiver, state, kind, f) {
       
  2603   if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
       
  2604   if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
       
  2605   return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
       
  2606 }
       
  2607 
       
  2608 function __classPrivateFieldSet(receiver, state, value, kind, f) {
       
  2609   if (kind === "m") throw new TypeError("Private method is not writable");
       
  2610   if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
       
  2611   if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
       
  2612   return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
       
  2613 }
       
  2614 
       
  2615 function __classPrivateFieldIn(state, receiver) {
       
  2616   if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
       
  2617   return typeof state === "function" ? receiver === state : state.has(receiver);
       
  2618 }
       
  2619 
       
  2620 function __addDisposableResource(env, value, async) {
       
  2621   if (value !== null && value !== void 0) {
       
  2622     if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
       
  2623     var dispose;
       
  2624     if (async) {
       
  2625         if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
       
  2626         dispose = value[Symbol.asyncDispose];
       
  2627     }
       
  2628     if (dispose === void 0) {
       
  2629         if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
       
  2630         dispose = value[Symbol.dispose];
       
  2631     }
       
  2632     if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
       
  2633     env.stack.push({ value: value, dispose: dispose, async: async });
       
  2634   }
       
  2635   else if (async) {
       
  2636     env.stack.push({ async: true });
       
  2637   }
       
  2638   return value;
       
  2639 }
       
  2640 
       
  2641 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
       
  2642   var e = new Error(message);
       
  2643   return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
       
  2644 };
       
  2645 
       
  2646 function __disposeResources(env) {
       
  2647   function fail(e) {
       
  2648     env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
       
  2649     env.hasError = true;
       
  2650   }
       
  2651   function next() {
       
  2652     while (env.stack.length) {
       
  2653       var rec = env.stack.pop();
       
  2654       try {
       
  2655         var result = rec.dispose && rec.dispose.call(rec.value);
       
  2656         if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
       
  2657       }
       
  2658       catch (e) {
       
  2659           fail(e);
       
  2660       }
       
  2661     }
       
  2662     if (env.hasError) throw env.error;
       
  2663   }
       
  2664   return next();
       
  2665 }
       
  2666 
       
  2667 /* harmony default export */ const tslib_es6 = ({
       
  2668   __extends,
       
  2669   __assign,
       
  2670   __rest,
       
  2671   __decorate,
       
  2672   __param,
       
  2673   __metadata,
       
  2674   __awaiter,
       
  2675   __generator,
       
  2676   __createBinding,
       
  2677   __exportStar,
       
  2678   __values,
       
  2679   __read,
       
  2680   __spread,
       
  2681   __spreadArrays,
       
  2682   __spreadArray,
       
  2683   __await,
       
  2684   __asyncGenerator,
       
  2685   __asyncDelegator,
       
  2686   __asyncValues,
       
  2687   __makeTemplateObject,
       
  2688   __importStar,
       
  2689   __importDefault,
       
  2690   __classPrivateFieldGet,
       
  2691   __classPrivateFieldSet,
       
  2692   __classPrivateFieldIn,
       
  2693   __addDisposableResource,
       
  2694   __disposeResources,
       
  2695 });
       
  2696 
       
  2697 ;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
       
  2698 /**
       
  2699  * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
       
  2700  */
       
  2701 var SUPPORTED_LOCALE = {
       
  2702     tr: {
       
  2703         regexp: /\u0130|\u0049|\u0049\u0307/g,
       
  2704         map: {
       
  2705             İ: "\u0069",
       
  2706             I: "\u0131",
       
  2707             İ: "\u0069",
       
  2708         },
       
  2709     },
       
  2710     az: {
       
  2711         regexp: /\u0130/g,
       
  2712         map: {
       
  2713             İ: "\u0069",
       
  2714             I: "\u0131",
       
  2715             İ: "\u0069",
       
  2716         },
       
  2717     },
       
  2718     lt: {
       
  2719         regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
       
  2720         map: {
       
  2721             I: "\u0069\u0307",
       
  2722             J: "\u006A\u0307",
       
  2723             Į: "\u012F\u0307",
       
  2724             Ì: "\u0069\u0307\u0300",
       
  2725             Í: "\u0069\u0307\u0301",
       
  2726             Ĩ: "\u0069\u0307\u0303",
       
  2727         },
       
  2728     },
       
  2729 };
       
  2730 /**
       
  2731  * Localized lower case.
       
  2732  */
       
  2733 function localeLowerCase(str, locale) {
       
  2734     var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
       
  2735     if (lang)
       
  2736         return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
       
  2737     return lowerCase(str);
       
  2738 }
       
  2739 /**
       
  2740  * Lower case as a function.
       
  2741  */
       
  2742 function lowerCase(str) {
       
  2743     return str.toLowerCase();
       
  2744 }
       
  2745 
       
  2746 ;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
       
  2747 
       
  2748 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
       
  2749 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
       
  2750 // Remove all non-word characters.
       
  2751 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
       
  2752 /**
       
  2753  * Normalize the string into something other libraries can manipulate easier.
       
  2754  */
       
  2755 function noCase(input, options) {
       
  2756     if (options === void 0) { options = {}; }
       
  2757     var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d;
       
  2758     var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
       
  2759     var start = 0;
       
  2760     var end = result.length;
       
  2761     // Trim the delimiter from around the output string.
       
  2762     while (result.charAt(start) === "\0")
       
  2763         start++;
       
  2764     while (result.charAt(end - 1) === "\0")
       
  2765         end--;
       
  2766     // Transform each token independently.
       
  2767     return result.slice(start, end).split("\0").map(transform).join(delimiter);
       
  2768 }
       
  2769 /**
       
  2770  * Replace `re` in the input string with the replacement value.
       
  2771  */
       
  2772 function replace(input, re, value) {
       
  2773     if (re instanceof RegExp)
       
  2774         return input.replace(re, value);
       
  2775     return re.reduce(function (input, re) { return input.replace(re, value); }, input);
       
  2776 }
       
  2777 
       
  2778 ;// CONCATENATED MODULE: ./node_modules/pascal-case/dist.es2015/index.js
       
  2779 
       
  2780 
       
  2781 function pascalCaseTransform(input, index) {
       
  2782     var firstChar = input.charAt(0);
       
  2783     var lowerChars = input.substr(1).toLowerCase();
       
  2784     if (index > 0 && firstChar >= "0" && firstChar <= "9") {
       
  2785         return "_" + firstChar + lowerChars;
       
  2786     }
       
  2787     return "" + firstChar.toUpperCase() + lowerChars;
       
  2788 }
       
  2789 function pascalCaseTransformMerge(input) {
       
  2790     return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
       
  2791 }
       
  2792 function pascalCase(input, options) {
       
  2793     if (options === void 0) { options = {}; }
       
  2794     return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
       
  2795 }
       
  2796 
  2131 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
  2797 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/create-higher-order-component/index.js
  2132 /**
  2798 /**
  2133  * External dependencies
  2799  * External dependencies
  2134  */
  2800  */
  2135 
       
  2136 
  2801 
  2137 /**
  2802 /**
  2138  * Given a function mapping a component to an enhanced component and modifier
  2803  * Given a function mapping a component to an enhanced component and modifier
  2139  * name, returns the enhanced component augmented with a generated displayName.
  2804  * name, returns the enhanced component augmented with a generated displayName.
  2140  *
  2805  *
  2141  * @param  mapComponent Function mapping component to enhanced component.
  2806  * @param mapComponent Function mapping component to enhanced component.
  2142  * @param  modifierName Seed name from which to generated display name.
  2807  * @param modifierName Seed name from which to generated display name.
  2143  *
  2808  *
  2144  * @return Component class with generated display name assigned.
  2809  * @return Component class with generated display name assigned.
  2145  */
  2810  */
  2146 function createHigherOrderComponent(mapComponent, modifierName) {
  2811 function createHigherOrderComponent(mapComponent, modifierName) {
  2147   return Inner => {
  2812   return Inner => {
  2148     const Outer = mapComponent(Inner);
  2813     const Outer = mapComponent(Inner);
  2149     const displayName = Inner.displayName || Inner.name || 'Component';
  2814     Outer.displayName = hocName(modifierName, Inner);
  2150     Outer.displayName = `${(0,external_lodash_namespaceObject.upperFirst)((0,external_lodash_namespaceObject.camelCase)(modifierName))}(${displayName})`;
       
  2151     return Outer;
  2815     return Outer;
  2152   };
  2816   };
  2153 }
  2817 }
  2154 
  2818 
  2155 /* harmony default export */ var create_higher_order_component = (createHigherOrderComponent);
  2819 /**
       
  2820  * Returns a displayName for a higher-order component, given a wrapper name.
       
  2821  *
       
  2822  * @example
       
  2823  *     hocName( 'MyMemo', Widget ) === 'MyMemo(Widget)';
       
  2824  *     hocName( 'MyMemo', <div /> ) === 'MyMemo(Component)';
       
  2825  *
       
  2826  * @param name  Name assigned to higher-order component's wrapper component.
       
  2827  * @param Inner Wrapped component inside higher-order component.
       
  2828  * @return       Wrapped name of higher-order component.
       
  2829  */
       
  2830 const hocName = (name, Inner) => {
       
  2831   const inner = Inner.displayName || Inner.name || 'Component';
       
  2832   const outer = pascalCase(name !== null && name !== void 0 ? name : '');
       
  2833   return `${outer}(${inner})`;
       
  2834 };
       
  2835 
       
  2836 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/debounce/index.js
       
  2837 /**
       
  2838  * Parts of this source were derived and modified from lodash,
       
  2839  * released under the MIT license.
       
  2840  *
       
  2841  * https://github.com/lodash/lodash
       
  2842  *
       
  2843  * Copyright JS Foundation and other contributors <https://js.foundation/>
       
  2844  *
       
  2845  * Based on Underscore.js, copyright Jeremy Ashkenas,
       
  2846  * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
       
  2847  *
       
  2848  * This software consists of voluntary contributions made by many
       
  2849  * individuals. For exact contribution history, see the revision history
       
  2850  * available at https://github.com/lodash/lodash
       
  2851  *
       
  2852  * The following license applies to all parts of this software except as
       
  2853  * documented below:
       
  2854  *
       
  2855  * ====
       
  2856  *
       
  2857  * Permission is hereby granted, free of charge, to any person obtaining
       
  2858  * a copy of this software and associated documentation files (the
       
  2859  * "Software"), to deal in the Software without restriction, including
       
  2860  * without limitation the rights to use, copy, modify, merge, publish,
       
  2861  * distribute, sublicense, and/or sell copies of the Software, and to
       
  2862  * permit persons to whom the Software is furnished to do so, subject to
       
  2863  * the following conditions:
       
  2864  *
       
  2865  * The above copyright notice and this permission notice shall be
       
  2866  * included in all copies or substantial portions of the Software.
       
  2867  *
       
  2868  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
  2869  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
  2870  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
  2871  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
       
  2872  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
       
  2873  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
       
  2874  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
  2875  */
       
  2876 
       
  2877 /**
       
  2878  * A simplified and properly typed version of lodash's `debounce`, that
       
  2879  * always uses timers instead of sometimes using rAF.
       
  2880  *
       
  2881  * Creates a debounced function that delays invoking `func` until after `wait`
       
  2882  * milliseconds have elapsed since the last time the debounced function was
       
  2883  * invoked. The debounced function comes with a `cancel` method to cancel delayed
       
  2884  * `func` invocations and a `flush` method to immediately invoke them. Provide
       
  2885  * `options` to indicate whether `func` should be invoked on the leading and/or
       
  2886  * trailing edge of the `wait` timeout. The `func` is invoked with the last
       
  2887  * arguments provided to the debounced function. Subsequent calls to the debounced
       
  2888  * function return the result of the last `func` invocation.
       
  2889  *
       
  2890  * **Note:** If `leading` and `trailing` options are `true`, `func` is
       
  2891  * invoked on the trailing edge of the timeout only if the debounced function
       
  2892  * is invoked more than once during the `wait` timeout.
       
  2893  *
       
  2894  * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
       
  2895  * until the next tick, similar to `setTimeout` with a timeout of `0`.
       
  2896  *
       
  2897  * @param {Function}                   func             The function to debounce.
       
  2898  * @param {number}                     wait             The number of milliseconds to delay.
       
  2899  * @param {Partial< DebounceOptions >} options          The options object.
       
  2900  * @param {boolean}                    options.leading  Specify invoking on the leading edge of the timeout.
       
  2901  * @param {number}                     options.maxWait  The maximum time `func` is allowed to be delayed before it's invoked.
       
  2902  * @param {boolean}                    options.trailing Specify invoking on the trailing edge of the timeout.
       
  2903  *
       
  2904  * @return Returns the new debounced function.
       
  2905  */
       
  2906 const debounce = (func, wait, options) => {
       
  2907   let lastArgs;
       
  2908   let lastThis;
       
  2909   let maxWait = 0;
       
  2910   let result;
       
  2911   let timerId;
       
  2912   let lastCallTime;
       
  2913   let lastInvokeTime = 0;
       
  2914   let leading = false;
       
  2915   let maxing = false;
       
  2916   let trailing = true;
       
  2917   if (options) {
       
  2918     leading = !!options.leading;
       
  2919     maxing = 'maxWait' in options;
       
  2920     if (options.maxWait !== undefined) {
       
  2921       maxWait = Math.max(options.maxWait, wait);
       
  2922     }
       
  2923     trailing = 'trailing' in options ? !!options.trailing : trailing;
       
  2924   }
       
  2925   function invokeFunc(time) {
       
  2926     const args = lastArgs;
       
  2927     const thisArg = lastThis;
       
  2928     lastArgs = undefined;
       
  2929     lastThis = undefined;
       
  2930     lastInvokeTime = time;
       
  2931     result = func.apply(thisArg, args);
       
  2932     return result;
       
  2933   }
       
  2934   function startTimer(pendingFunc, waitTime) {
       
  2935     timerId = setTimeout(pendingFunc, waitTime);
       
  2936   }
       
  2937   function cancelTimer() {
       
  2938     if (timerId !== undefined) {
       
  2939       clearTimeout(timerId);
       
  2940     }
       
  2941   }
       
  2942   function leadingEdge(time) {
       
  2943     // Reset any `maxWait` timer.
       
  2944     lastInvokeTime = time;
       
  2945     // Start the timer for the trailing edge.
       
  2946     startTimer(timerExpired, wait);
       
  2947     // Invoke the leading edge.
       
  2948     return leading ? invokeFunc(time) : result;
       
  2949   }
       
  2950   function getTimeSinceLastCall(time) {
       
  2951     return time - (lastCallTime || 0);
       
  2952   }
       
  2953   function remainingWait(time) {
       
  2954     const timeSinceLastCall = getTimeSinceLastCall(time);
       
  2955     const timeSinceLastInvoke = time - lastInvokeTime;
       
  2956     const timeWaiting = wait - timeSinceLastCall;
       
  2957     return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
       
  2958   }
       
  2959   function shouldInvoke(time) {
       
  2960     const timeSinceLastCall = getTimeSinceLastCall(time);
       
  2961     const timeSinceLastInvoke = time - lastInvokeTime;
       
  2962 
       
  2963     // Either this is the first call, activity has stopped and we're at the
       
  2964     // trailing edge, the system time has gone backwards and we're treating
       
  2965     // it as the trailing edge, or we've hit the `maxWait` limit.
       
  2966     return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
       
  2967   }
       
  2968   function timerExpired() {
       
  2969     const time = Date.now();
       
  2970     if (shouldInvoke(time)) {
       
  2971       return trailingEdge(time);
       
  2972     }
       
  2973     // Restart the timer.
       
  2974     startTimer(timerExpired, remainingWait(time));
       
  2975     return undefined;
       
  2976   }
       
  2977   function clearTimer() {
       
  2978     timerId = undefined;
       
  2979   }
       
  2980   function trailingEdge(time) {
       
  2981     clearTimer();
       
  2982 
       
  2983     // Only invoke if we have `lastArgs` which means `func` has been
       
  2984     // debounced at least once.
       
  2985     if (trailing && lastArgs) {
       
  2986       return invokeFunc(time);
       
  2987     }
       
  2988     lastArgs = lastThis = undefined;
       
  2989     return result;
       
  2990   }
       
  2991   function cancel() {
       
  2992     cancelTimer();
       
  2993     lastInvokeTime = 0;
       
  2994     clearTimer();
       
  2995     lastArgs = lastCallTime = lastThis = undefined;
       
  2996   }
       
  2997   function flush() {
       
  2998     return pending() ? trailingEdge(Date.now()) : result;
       
  2999   }
       
  3000   function pending() {
       
  3001     return timerId !== undefined;
       
  3002   }
       
  3003   function debounced(...args) {
       
  3004     const time = Date.now();
       
  3005     const isInvoking = shouldInvoke(time);
       
  3006     lastArgs = args;
       
  3007     lastThis = this;
       
  3008     lastCallTime = time;
       
  3009     if (isInvoking) {
       
  3010       if (!pending()) {
       
  3011         return leadingEdge(lastCallTime);
       
  3012       }
       
  3013       if (maxing) {
       
  3014         // Handle invocations in a tight loop.
       
  3015         startTimer(timerExpired, wait);
       
  3016         return invokeFunc(lastCallTime);
       
  3017       }
       
  3018     }
       
  3019     if (!pending()) {
       
  3020       startTimer(timerExpired, wait);
       
  3021     }
       
  3022     return result;
       
  3023   }
       
  3024   debounced.cancel = cancel;
       
  3025   debounced.flush = flush;
       
  3026   debounced.pending = pending;
       
  3027   return debounced;
       
  3028 };
       
  3029 
       
  3030 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/throttle/index.js
       
  3031 /**
       
  3032  * Parts of this source were derived and modified from lodash,
       
  3033  * released under the MIT license.
       
  3034  *
       
  3035  * https://github.com/lodash/lodash
       
  3036  *
       
  3037  * Copyright JS Foundation and other contributors <https://js.foundation/>
       
  3038  *
       
  3039  * Based on Underscore.js, copyright Jeremy Ashkenas,
       
  3040  * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
       
  3041  *
       
  3042  * This software consists of voluntary contributions made by many
       
  3043  * individuals. For exact contribution history, see the revision history
       
  3044  * available at https://github.com/lodash/lodash
       
  3045  *
       
  3046  * The following license applies to all parts of this software except as
       
  3047  * documented below:
       
  3048  *
       
  3049  * ====
       
  3050  *
       
  3051  * Permission is hereby granted, free of charge, to any person obtaining
       
  3052  * a copy of this software and associated documentation files (the
       
  3053  * "Software"), to deal in the Software without restriction, including
       
  3054  * without limitation the rights to use, copy, modify, merge, publish,
       
  3055  * distribute, sublicense, and/or sell copies of the Software, and to
       
  3056  * permit persons to whom the Software is furnished to do so, subject to
       
  3057  * the following conditions:
       
  3058  *
       
  3059  * The above copyright notice and this permission notice shall be
       
  3060  * included in all copies or substantial portions of the Software.
       
  3061  *
       
  3062  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
  3063  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
  3064  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
  3065  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
       
  3066  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
       
  3067  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
       
  3068  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
  3069  */
       
  3070 
       
  3071 /**
       
  3072  * Internal dependencies
       
  3073  */
       
  3074 
       
  3075 /**
       
  3076  * A simplified and properly typed version of lodash's `throttle`, that
       
  3077  * always uses timers instead of sometimes using rAF.
       
  3078  *
       
  3079  * Creates a throttled function that only invokes `func` at most once per
       
  3080  * every `wait` milliseconds. The throttled function comes with a `cancel`
       
  3081  * method to cancel delayed `func` invocations and a `flush` method to
       
  3082  * immediately invoke them. Provide `options` to indicate whether `func`
       
  3083  * should be invoked on the leading and/or trailing edge of the `wait`
       
  3084  * timeout. The `func` is invoked with the last arguments provided to the
       
  3085  * throttled function. Subsequent calls to the throttled function return
       
  3086  * the result of the last `func` invocation.
       
  3087  *
       
  3088  * **Note:** If `leading` and `trailing` options are `true`, `func` is
       
  3089  * invoked on the trailing edge of the timeout only if the throttled function
       
  3090  * is invoked more than once during the `wait` timeout.
       
  3091  *
       
  3092  * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
       
  3093  * until the next tick, similar to `setTimeout` with a timeout of `0`.
       
  3094  *
       
  3095  * @param {Function}                   func             The function to throttle.
       
  3096  * @param {number}                     wait             The number of milliseconds to throttle invocations to.
       
  3097  * @param {Partial< ThrottleOptions >} options          The options object.
       
  3098  * @param {boolean}                    options.leading  Specify invoking on the leading edge of the timeout.
       
  3099  * @param {boolean}                    options.trailing Specify invoking on the trailing edge of the timeout.
       
  3100  * @return Returns the new throttled function.
       
  3101  */
       
  3102 const throttle = (func, wait, options) => {
       
  3103   let leading = true;
       
  3104   let trailing = true;
       
  3105   if (options) {
       
  3106     leading = 'leading' in options ? !!options.leading : leading;
       
  3107     trailing = 'trailing' in options ? !!options.trailing : trailing;
       
  3108   }
       
  3109   return debounce(func, wait, {
       
  3110     leading,
       
  3111     trailing,
       
  3112     maxWait: wait
       
  3113   });
       
  3114 };
       
  3115 
       
  3116 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/utils/observable-map/index.js
       
  3117 /**
       
  3118  * A constructor (factory) for `ObservableMap`, a map-like key/value data structure
       
  3119  * where the individual entries are observable: using the `subscribe` method, you can
       
  3120  * subscribe to updates for a particular keys. Each subscriber always observes one
       
  3121  * specific key and is not notified about any unrelated changes (for different keys)
       
  3122  * in the `ObservableMap`.
       
  3123  *
       
  3124  * @template K The type of the keys in the map.
       
  3125  * @template V The type of the values in the map.
       
  3126  * @return   A new instance of the `ObservableMap` type.
       
  3127  */
       
  3128 function observableMap() {
       
  3129   const map = new Map();
       
  3130   const listeners = new Map();
       
  3131   function callListeners(name) {
       
  3132     const list = listeners.get(name);
       
  3133     if (!list) {
       
  3134       return;
       
  3135     }
       
  3136     for (const listener of list) {
       
  3137       listener();
       
  3138     }
       
  3139   }
       
  3140   return {
       
  3141     get(name) {
       
  3142       return map.get(name);
       
  3143     },
       
  3144     set(name, value) {
       
  3145       map.set(name, value);
       
  3146       callListeners(name);
       
  3147     },
       
  3148     delete(name) {
       
  3149       map.delete(name);
       
  3150       callListeners(name);
       
  3151     },
       
  3152     subscribe(name, listener) {
       
  3153       let list = listeners.get(name);
       
  3154       if (!list) {
       
  3155         list = new Set();
       
  3156         listeners.set(name, list);
       
  3157       }
       
  3158       list.add(listener);
       
  3159       return () => {
       
  3160         list.delete(listener);
       
  3161         if (list.size === 0) {
       
  3162           listeners.delete(name);
       
  3163         }
       
  3164       };
       
  3165     }
       
  3166   };
       
  3167 }
       
  3168 
       
  3169 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pipe.js
       
  3170 /**
       
  3171  * Parts of this source were derived and modified from lodash,
       
  3172  * released under the MIT license.
       
  3173  *
       
  3174  * https://github.com/lodash/lodash
       
  3175  *
       
  3176  * Copyright JS Foundation and other contributors <https://js.foundation/>
       
  3177  *
       
  3178  * Based on Underscore.js, copyright Jeremy Ashkenas,
       
  3179  * DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
       
  3180  *
       
  3181  * This software consists of voluntary contributions made by many
       
  3182  * individuals. For exact contribution history, see the revision history
       
  3183  * available at https://github.com/lodash/lodash
       
  3184  *
       
  3185  * The following license applies to all parts of this software except as
       
  3186  * documented below:
       
  3187  *
       
  3188  * ====
       
  3189  *
       
  3190  * Permission is hereby granted, free of charge, to any person obtaining
       
  3191  * a copy of this software and associated documentation files (the
       
  3192  * "Software"), to deal in the Software without restriction, including
       
  3193  * without limitation the rights to use, copy, modify, merge, publish,
       
  3194  * distribute, sublicense, and/or sell copies of the Software, and to
       
  3195  * permit persons to whom the Software is furnished to do so, subject to
       
  3196  * the following conditions:
       
  3197  *
       
  3198  * The above copyright notice and this permission notice shall be
       
  3199  * included in all copies or substantial portions of the Software.
       
  3200  *
       
  3201  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
       
  3202  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
       
  3203  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
       
  3204  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
       
  3205  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
       
  3206  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
       
  3207  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
       
  3208  */
       
  3209 
       
  3210 /**
       
  3211  * Creates a pipe function.
       
  3212  *
       
  3213  * Allows to choose whether to perform left-to-right or right-to-left composition.
       
  3214  *
       
  3215  * @see https://lodash.com/docs/4#flow
       
  3216  *
       
  3217  * @param {boolean} reverse True if right-to-left, false for left-to-right composition.
       
  3218  */
       
  3219 const basePipe = (reverse = false) => (...funcs) => (...args) => {
       
  3220   const functions = funcs.flat();
       
  3221   if (reverse) {
       
  3222     functions.reverse();
       
  3223   }
       
  3224   return functions.reduce((prev, func) => [func(...prev)], args)[0];
       
  3225 };
       
  3226 
       
  3227 /**
       
  3228  * Composes multiple higher-order components into a single higher-order component. Performs left-to-right function
       
  3229  * composition, where each successive invocation is supplied the return value of the previous.
       
  3230  *
       
  3231  * This is inspired by `lodash`'s `flow` function.
       
  3232  *
       
  3233  * @see https://lodash.com/docs/4#flow
       
  3234  */
       
  3235 const pipe = basePipe();
       
  3236 
       
  3237 /* harmony default export */ const higher_order_pipe = (pipe);
  2156 
  3238 
  2157 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
  3239 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/compose.js
  2158 /**
  3240 /**
  2159  * External dependencies
  3241  * Internal dependencies
  2160  */
  3242  */
       
  3243 
  2161 
  3244 
  2162 /**
  3245 /**
  2163  * Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
  3246  * Composes multiple higher-order components into a single higher-order component. Performs right-to-left function
  2164  * composition, where each successive invocation is supplied the return value of the previous.
  3247  * composition, where each successive invocation is supplied the return value of the previous.
  2165  *
  3248  *
  2166  * This is just a re-export of `lodash`'s `flowRight` function.
  3249  * This is inspired by `lodash`'s `flowRight` function.
  2167  *
  3250  *
  2168  * @see https://docs-lodash.com/v4/flow-right/
  3251  * @see https://lodash.com/docs/4#flow-right
  2169  */
  3252  */
  2170 
  3253 const compose = basePipe(true);
  2171 /* harmony default export */ var compose = (external_lodash_namespaceObject.flowRight);
  3254 /* harmony default export */ const higher_order_compose = (compose);
  2172 
  3255 
  2173 ;// CONCATENATED MODULE: external ["wp","element"]
  3256 ;// CONCATENATED MODULE: external "ReactJSXRuntime"
  2174 var external_wp_element_namespaceObject = window["wp"]["element"];
  3257 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
  2175 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
  3258 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/if-condition/index.js
  2176 
  3259 /**
       
  3260  * External dependencies
       
  3261  */
  2177 
  3262 
  2178 /**
  3263 /**
  2179  * Internal dependencies
  3264  * Internal dependencies
  2180  */
  3265  */
       
  3266 
  2181 
  3267 
  2182 /**
  3268 /**
  2183  * Higher-order component creator, creating a new component which renders if
  3269  * Higher-order component creator, creating a new component which renders if
  2184  * the given condition is satisfied or with the given optional prop name.
  3270  * the given condition is satisfied or with the given optional prop name.
  2185  *
  3271  *
  2190  * const ConditionalComponent = ifCondition( ( props: Props ) => props.foo.length !== 0 )( Component );
  3276  * const ConditionalComponent = ifCondition( ( props: Props ) => props.foo.length !== 0 )( Component );
  2191  * <ConditionalComponent foo="" />; // => null
  3277  * <ConditionalComponent foo="" />; // => null
  2192  * <ConditionalComponent foo="bar" />; // => <div>bar</div>;
  3278  * <ConditionalComponent foo="bar" />; // => <div>bar</div>;
  2193  * ```
  3279  * ```
  2194  *
  3280  *
  2195  * @param  predicate Function to test condition.
  3281  * @param predicate Function to test condition.
  2196  *
  3282  *
  2197  * @return Higher-order component.
  3283  * @return Higher-order component.
  2198  */
  3284  */
  2199 
  3285 
  2200 const ifCondition = predicate => create_higher_order_component(WrappedComponent => props => {
  3286 function ifCondition(predicate) {
  2201   if (!predicate(props)) {
  3287   return createHigherOrderComponent(WrappedComponent => props => {
  2202     return null;
  3288     if (!predicate(props)) {
  2203   }
  3289       return null;
  2204 
  3290     }
  2205   return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, props);
  3291     return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
  2206 }, 'ifCondition');
  3292       ...props
  2207 
  3293     });
  2208 /* harmony default export */ var if_condition = (ifCondition);
  3294   }, 'ifCondition');
  2209 
  3295 }
  2210 ;// CONCATENATED MODULE: external ["wp","isShallowEqual"]
  3296 /* harmony default export */ const if_condition = (ifCondition);
  2211 var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
  3297 
  2212 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
  3298 // EXTERNAL MODULE: external ["wp","isShallowEqual"]
       
  3299 var external_wp_isShallowEqual_ = __webpack_require__(923);
       
  3300 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_);
       
  3301 ;// CONCATENATED MODULE: external ["wp","element"]
       
  3302 const external_wp_element_namespaceObject = window["wp"]["element"];
  2213 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
  3303 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/pure/index.js
  2214 
  3304 /**
       
  3305  * External dependencies
       
  3306  */
  2215 
  3307 
  2216 /**
  3308 /**
  2217  * WordPress dependencies
  3309  * WordPress dependencies
  2218  */
  3310  */
  2219 
  3311 
  2220 
  3312 
       
  3313 
  2221 /**
  3314 /**
  2222  * Internal dependencies
  3315  * Internal dependencies
  2223  */
  3316  */
  2224 
  3317 
  2225 
       
  2226 /**
       
  2227  * External dependencies
       
  2228  */
       
  2229 
  3318 
  2230 /**
  3319 /**
  2231  * Given a component returns the enhanced component augmented with a component
  3320  * Given a component returns the enhanced component augmented with a component
  2232  * only re-rendering when its props/state change
  3321  * only re-rendering when its props/state change
  2233  */
  3322  *
  2234 const pure = create_higher_order_component(Wrapped => {
  3323  * @deprecated Use `memo` or `PureComponent` instead.
  2235   if (Wrapped.prototype instanceof external_wp_element_namespaceObject.Component) {
  3324  */
  2236     return class extends Wrapped {
  3325 
       
  3326 const pure = createHigherOrderComponent(function (WrappedComponent) {
       
  3327   if (WrappedComponent.prototype instanceof external_wp_element_namespaceObject.Component) {
       
  3328     return class extends WrappedComponent {
  2237       shouldComponentUpdate(nextProps, nextState) {
  3329       shouldComponentUpdate(nextProps, nextState) {
  2238         return !external_wp_isShallowEqual_default()(nextProps, this.props) || !external_wp_isShallowEqual_default()(nextState, this.state);
  3330         return !external_wp_isShallowEqual_default()(nextProps, this.props) || !external_wp_isShallowEqual_default()(nextState, this.state);
  2239       }
  3331       }
  2240 
       
  2241     };
  3332     };
  2242   }
  3333   }
  2243 
       
  2244   return class extends external_wp_element_namespaceObject.Component {
  3334   return class extends external_wp_element_namespaceObject.Component {
  2245     shouldComponentUpdate(nextProps) {
  3335     shouldComponentUpdate(nextProps) {
  2246       return !external_wp_isShallowEqual_default()(nextProps, this.props);
  3336       return !external_wp_isShallowEqual_default()(nextProps, this.props);
  2247     }
  3337     }
  2248 
       
  2249     render() {
  3338     render() {
  2250       return (0,external_wp_element_namespaceObject.createElement)(Wrapped, this.props);
  3339       return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
  2251     }
  3340         ...this.props
  2252 
  3341       });
       
  3342     }
  2253   };
  3343   };
  2254 }, 'pure');
  3344 }, 'pure');
  2255 /* harmony default export */ var higher_order_pure = (pure);
  3345 /* harmony default export */ const higher_order_pure = (pure);
  2256 
  3346 
  2257 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
       
  2258 function _extends() {
       
  2259   _extends = Object.assign ? Object.assign.bind() : function (target) {
       
  2260     for (var i = 1; i < arguments.length; i++) {
       
  2261       var source = arguments[i];
       
  2262 
       
  2263       for (var key in source) {
       
  2264         if (Object.prototype.hasOwnProperty.call(source, key)) {
       
  2265           target[key] = source[key];
       
  2266         }
       
  2267       }
       
  2268     }
       
  2269 
       
  2270     return target;
       
  2271   };
       
  2272   return _extends.apply(this, arguments);
       
  2273 }
       
  2274 ;// CONCATENATED MODULE: external ["wp","deprecated"]
  3347 ;// CONCATENATED MODULE: external ["wp","deprecated"]
  2275 var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  3348 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  2276 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  3349 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  2277 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js
  3350 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/listener.js
  2278 /**
       
  2279  * External dependencies
       
  2280  */
       
  2281 
       
  2282 /**
  3351 /**
  2283  * Class responsible for orchestrating event handling on the global window,
  3352  * Class responsible for orchestrating event handling on the global window,
  2284  * binding a single event to be shared across all handling instances, and
  3353  * binding a single event to be shared across all handling instances, and
  2285  * removing the handler when no instances are listening for the event.
  3354  * removing the handler when no instances are listening for the event.
  2286  */
  3355  */
  2287 
       
  2288 class Listener {
  3356 class Listener {
  2289   constructor() {
  3357   constructor() {
  2290     /** @type {any} */
  3358     /** @type {any} */
  2291     this.listeners = {};
  3359     this.listeners = {};
  2292     this.handleEvent = this.handleEvent.bind(this);
  3360     this.handleEvent = this.handleEvent.bind(this);
  2293   }
  3361   }
  2294 
  3362   add( /** @type {any} */eventType, /** @type {any} */instance) {
  2295   add(
       
  2296   /** @type {any} */
       
  2297   eventType,
       
  2298   /** @type {any} */
       
  2299   instance) {
       
  2300     if (!this.listeners[eventType]) {
  3363     if (!this.listeners[eventType]) {
  2301       // Adding first listener for this type, so bind event.
  3364       // Adding first listener for this type, so bind event.
  2302       window.addEventListener(eventType, this.handleEvent);
  3365       window.addEventListener(eventType, this.handleEvent);
  2303       this.listeners[eventType] = [];
  3366       this.listeners[eventType] = [];
  2304     }
  3367     }
  2305 
       
  2306     this.listeners[eventType].push(instance);
  3368     this.listeners[eventType].push(instance);
  2307   }
  3369   }
  2308 
  3370   remove( /** @type {any} */eventType, /** @type {any} */instance) {
  2309   remove(
  3371     if (!this.listeners[eventType]) {
  2310   /** @type {any} */
  3372       return;
  2311   eventType,
  3373     }
  2312   /** @type {any} */
  3374     this.listeners[eventType] = this.listeners[eventType].filter(( /** @type {any} */listener) => listener !== instance);
  2313   instance) {
       
  2314     this.listeners[eventType] = (0,external_lodash_namespaceObject.without)(this.listeners[eventType], instance);
       
  2315 
       
  2316     if (!this.listeners[eventType].length) {
  3375     if (!this.listeners[eventType].length) {
  2317       // Removing last listener for this type, so unbind event.
  3376       // Removing last listener for this type, so unbind event.
  2318       window.removeEventListener(eventType, this.handleEvent);
  3377       window.removeEventListener(eventType, this.handleEvent);
  2319       delete this.listeners[eventType];
  3378       delete this.listeners[eventType];
  2320     }
  3379     }
  2321   }
  3380   }
  2322 
  3381   handleEvent( /** @type {any} */event) {
  2323   handleEvent(
  3382     this.listeners[event.type]?.forEach(( /** @type {any} */instance) => {
  2324   /** @type {any} */
       
  2325   event) {
       
  2326     (0,external_lodash_namespaceObject.forEach)(this.listeners[event.type], instance => {
       
  2327       instance.handleEvent(event);
  3383       instance.handleEvent(event);
  2328     });
  3384     });
  2329   }
  3385   }
  2330 
  3386 }
  2331 }
  3387 /* harmony default export */ const listener = (Listener);
  2332 
       
  2333 /* harmony default export */ var listener = (Listener);
       
  2334 
  3388 
  2335 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
  3389 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-global-events/index.js
  2336 
       
  2337 
       
  2338 
       
  2339 /**
       
  2340  * External dependencies
       
  2341  */
       
  2342 
       
  2343 /**
  3390 /**
  2344  * WordPress dependencies
  3391  * WordPress dependencies
  2345  */
  3392  */
  2346 
  3393 
  2347 
  3394 
  2355 /**
  3402 /**
  2356  * Listener instance responsible for managing document event handling.
  3403  * Listener instance responsible for managing document event handling.
  2357  */
  3404  */
  2358 
  3405 
  2359 const with_global_events_listener = new listener();
  3406 const with_global_events_listener = new listener();
       
  3407 
  2360 /* eslint-disable jsdoc/no-undefined-types */
  3408 /* eslint-disable jsdoc/no-undefined-types */
  2361 
       
  2362 /**
  3409 /**
  2363  * Higher-order component creator which, given an object of DOM event types and
  3410  * Higher-order component creator which, given an object of DOM event types and
  2364  * values corresponding to a callback function name on the component, will
  3411  * values corresponding to a callback function name on the component, will
  2365  * create or update a window event handler to invoke the callback when an event
  3412  * create or update a window event handler to invoke the callback when an event
  2366  * occurs. On behalf of the consuming developer, the higher-order component
  3413  * occurs. On behalf of the consuming developer, the higher-order component
  2376  *                                                                                 instance which handles
  3423  *                                                                                 instance which handles
  2377  *                                                                                 the event.
  3424  *                                                                                 the event.
  2378  *
  3425  *
  2379  * @return {any} Higher-order component.
  3426  * @return {any} Higher-order component.
  2380  */
  3427  */
  2381 
       
  2382 function withGlobalEvents(eventTypesToHandlers) {
  3428 function withGlobalEvents(eventTypesToHandlers) {
  2383   external_wp_deprecated_default()('wp.compose.withGlobalEvents', {
  3429   external_wp_deprecated_default()('wp.compose.withGlobalEvents', {
  2384     since: '5.7',
  3430     since: '5.7',
  2385     alternative: 'useEffect'
  3431     alternative: 'useEffect'
  2386   }); // @ts-ignore We don't need to fix the type-related issues because this is deprecated.
  3432   });
  2387 
  3433 
  2388   return create_higher_order_component(WrappedComponent => {
  3434   // @ts-ignore We don't need to fix the type-related issues because this is deprecated.
       
  3435   return createHigherOrderComponent(WrappedComponent => {
  2389     class Wrapper extends external_wp_element_namespaceObject.Component {
  3436     class Wrapper extends external_wp_element_namespaceObject.Component {
  2390       constructor(
  3437       constructor( /** @type {any} */props) {
  2391       /** @type {any} */
       
  2392       props) {
       
  2393         super(props);
  3438         super(props);
  2394         this.handleEvent = this.handleEvent.bind(this);
  3439         this.handleEvent = this.handleEvent.bind(this);
  2395         this.handleRef = this.handleRef.bind(this);
  3440         this.handleRef = this.handleRef.bind(this);
  2396       }
  3441       }
  2397 
       
  2398       componentDidMount() {
  3442       componentDidMount() {
  2399         (0,external_lodash_namespaceObject.forEach)(eventTypesToHandlers, (_, eventType) => {
  3443         Object.keys(eventTypesToHandlers).forEach(eventType => {
  2400           with_global_events_listener.add(eventType, this);
  3444           with_global_events_listener.add(eventType, this);
  2401         });
  3445         });
  2402       }
  3446       }
  2403 
       
  2404       componentWillUnmount() {
  3447       componentWillUnmount() {
  2405         (0,external_lodash_namespaceObject.forEach)(eventTypesToHandlers, (_, eventType) => {
  3448         Object.keys(eventTypesToHandlers).forEach(eventType => {
  2406           with_global_events_listener.remove(eventType, this);
  3449           with_global_events_listener.remove(eventType, this);
  2407         });
  3450         });
  2408       }
  3451       }
  2409 
  3452       handleEvent( /** @type {any} */event) {
  2410       handleEvent(
  3453         const handler = eventTypesToHandlers[( /** @type {keyof GlobalEventHandlersEventMap} */
  2411       /** @type {any} */
       
  2412       event) {
       
  2413         const handler = eventTypesToHandlers[
       
  2414         /** @type {keyof GlobalEventHandlersEventMap} */
       
  2415         event.type
  3454         event.type
  2416         /* eslint-enable jsdoc/no-undefined-types */
  3455 
  2417         ];
  3456         /* eslint-enable jsdoc/no-undefined-types */)];
  2418 
       
  2419         if (typeof this.wrappedRef[handler] === 'function') {
  3457         if (typeof this.wrappedRef[handler] === 'function') {
  2420           this.wrappedRef[handler](event);
  3458           this.wrappedRef[handler](event);
  2421         }
  3459         }
  2422       }
  3460       }
  2423 
  3461       handleRef( /** @type {any} */el) {
  2424       handleRef(
  3462         this.wrappedRef = el;
  2425       /** @type {any} */
  3463         // Any component using `withGlobalEvents` that is not setting a `ref`
  2426       el) {
       
  2427         this.wrappedRef = el; // Any component using `withGlobalEvents` that is not setting a `ref`
       
  2428         // will cause `this.props.forwardedRef` to be `null`, so we need this
  3464         // will cause `this.props.forwardedRef` to be `null`, so we need this
  2429         // check.
  3465         // check.
  2430 
       
  2431         if (this.props.forwardedRef) {
  3466         if (this.props.forwardedRef) {
  2432           this.props.forwardedRef(el);
  3467           this.props.forwardedRef(el);
  2433         }
  3468         }
  2434       }
  3469       }
  2435 
       
  2436       render() {
  3470       render() {
  2437         return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, this.props.ownProps, {
  3471         return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
       
  3472           ...this.props.ownProps,
  2438           ref: this.handleRef
  3473           ref: this.handleRef
  2439         }));
  3474         });
  2440       }
  3475       }
  2441 
  3476     }
  2442     }
       
  2443 
       
  2444     return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
  3477     return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
  2445       return (0,external_wp_element_namespaceObject.createElement)(Wrapper, {
  3478       return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, {
  2446         ownProps: props,
  3479         ownProps: props,
  2447         forwardedRef: ref
  3480         forwardedRef: ref
  2448       });
  3481       });
  2449     });
  3482     });
  2450   }, 'withGlobalEvents');
  3483   }, 'withGlobalEvents');
  2451 }
  3484 }
  2452 
  3485 
  2453 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
  3486 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js
  2454 // Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case
       
  2455 // but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript
       
  2456 
       
  2457 /* eslint-disable jsdoc/check-types */
       
  2458 
       
  2459 /**
  3487 /**
  2460  * WordPress dependencies
  3488  * WordPress dependencies
  2461  */
  3489  */
  2462 
  3490 
  2463 /**
       
  2464  * @type {WeakMap<object, number>}
       
  2465  */
       
  2466 
       
  2467 const instanceMap = new WeakMap();
  3491 const instanceMap = new WeakMap();
       
  3492 
  2468 /**
  3493 /**
  2469  * Creates a new id for a given object.
  3494  * Creates a new id for a given object.
  2470  *
  3495  *
  2471  * @param {object} object Object reference to create an id for.
  3496  * @param object Object reference to create an id for.
  2472  * @return {number} The instance id (index).
  3497  * @return The instance id (index).
  2473  */
  3498  */
  2474 
       
  2475 function createId(object) {
  3499 function createId(object) {
  2476   const instances = instanceMap.get(object) || 0;
  3500   const instances = instanceMap.get(object) || 0;
  2477   instanceMap.set(object, instances + 1);
  3501   instanceMap.set(object, instances + 1);
  2478   return instances;
  3502   return instances;
  2479 }
  3503 }
       
  3504 
       
  3505 /**
       
  3506  * Specify the useInstanceId *function* signatures.
       
  3507  *
       
  3508  * More accurately, useInstanceId distinguishes between three different
       
  3509  * signatures:
       
  3510  *
       
  3511  * 1. When only object is given, the returned value is a number
       
  3512  * 2. When object and prefix is given, the returned value is a string
       
  3513  * 3. When preferredId is given, the returned value is the type of preferredId
       
  3514  *
       
  3515  * @param object Object reference to create an id for.
       
  3516  */
       
  3517 
  2480 /**
  3518 /**
  2481  * Provides a unique instance ID.
  3519  * Provides a unique instance ID.
  2482  *
  3520  *
  2483  * @param {object}          object           Object reference to create an id for.
  3521  * @param object        Object reference to create an id for.
  2484  * @param {string}          [prefix]         Prefix for the unique id.
  3522  * @param [prefix]      Prefix for the unique id.
  2485  * @param {string | number} [preferredId=''] Default ID to use.
  3523  * @param [preferredId] Default ID to use.
  2486  * @return {string | number} The unique instance id.
  3524  * @return The unique instance id.
  2487  */
  3525  */
  2488 
  3526 function useInstanceId(object, prefix, preferredId) {
  2489 
       
  2490 function useInstanceId(object, prefix) {
       
  2491   let preferredId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
       
  2492   return (0,external_wp_element_namespaceObject.useMemo)(() => {
  3527   return (0,external_wp_element_namespaceObject.useMemo)(() => {
  2493     if (preferredId) return preferredId;
  3528     if (preferredId) {
       
  3529       return preferredId;
       
  3530     }
  2494     const id = createId(object);
  3531     const id = createId(object);
  2495     return prefix ? `${prefix}-${id}` : id;
  3532     return prefix ? `${prefix}-${id}` : id;
  2496   }, [object]);
  3533   }, [object, preferredId, prefix]);
  2497 }
  3534 }
  2498 /* eslint-enable jsdoc/check-types */
  3535 /* harmony default export */ const use_instance_id = (useInstanceId);
  2499 
  3536 
  2500 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js
  3537 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-instance-id/index.js
  2501 
       
  2502 
       
  2503 
       
  2504 /**
  3538 /**
  2505  * Internal dependencies
  3539  * Internal dependencies
  2506  */
  3540  */
       
  3541 
       
  3542 
  2507 
  3543 
  2508 
  3544 
  2509 /**
  3545 /**
  2510  * A Higher Order Component used to be provide a unique instance ID by
  3546  * A Higher Order Component used to be provide a unique instance ID by
  2511  * component.
  3547  * component.
  2512  */
  3548  */
  2513 
  3549 const withInstanceId = createHigherOrderComponent(WrappedComponent => {
  2514 const withInstanceId = create_higher_order_component(WrappedComponent => {
       
  2515   return props => {
  3550   return props => {
  2516     const instanceId = useInstanceId(WrappedComponent); // @ts-ignore
  3551     const instanceId = use_instance_id(WrappedComponent);
  2517 
  3552     // @ts-ignore
  2518     return (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, {
  3553     return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, {
       
  3554       ...props,
  2519       instanceId: instanceId
  3555       instanceId: instanceId
  2520     }));
  3556     });
  2521   };
  3557   };
  2522 }, 'withInstanceId');
  3558 }, 'instanceId');
  2523 /* harmony default export */ var with_instance_id = (withInstanceId);
  3559 /* harmony default export */ const with_instance_id = (withInstanceId);
  2524 
  3560 
  2525 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js
  3561 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-safe-timeout/index.js
  2526 
       
  2527 
       
  2528 /**
       
  2529  * External dependencies
       
  2530  */
       
  2531 
       
  2532 
       
  2533 /**
  3562 /**
  2534  * WordPress dependencies
  3563  * WordPress dependencies
  2535  */
  3564  */
  2536 
  3565 
       
  3566 
  2537 /**
  3567 /**
  2538  * Internal dependencies
  3568  * Internal dependencies
  2539  */
  3569  */
       
  3570 
  2540 
  3571 
  2541 
  3572 
  2542 /**
  3573 /**
  2543  * We cannot use the `Window['setTimeout']` and `Window['clearTimeout']`
  3574  * We cannot use the `Window['setTimeout']` and `Window['clearTimeout']`
  2544  * types here because those functions include functionality that is not handled
  3575  * types here because those functions include functionality that is not handled
  2550 
  3581 
  2551 /**
  3582 /**
  2552  * A higher-order component used to provide and manage delayed function calls
  3583  * A higher-order component used to provide and manage delayed function calls
  2553  * that ought to be bound to a component's lifecycle.
  3584  * that ought to be bound to a component's lifecycle.
  2554  */
  3585  */
  2555 const withSafeTimeout = create_higher_order_component(OriginalComponent => {
  3586 const withSafeTimeout = createHigherOrderComponent(OriginalComponent => {
  2556   return class WrappedComponent extends external_wp_element_namespaceObject.Component {
  3587   return class WrappedComponent extends external_wp_element_namespaceObject.Component {
  2557     constructor(props) {
  3588     constructor(props) {
  2558       super(props);
  3589       super(props);
  2559       this.timeouts = [];
  3590       this.timeouts = [];
  2560       this.setTimeout = this.setTimeout.bind(this);
  3591       this.setTimeout = this.setTimeout.bind(this);
  2561       this.clearTimeout = this.clearTimeout.bind(this);
  3592       this.clearTimeout = this.clearTimeout.bind(this);
  2562     }
  3593     }
  2563 
       
  2564     componentWillUnmount() {
  3594     componentWillUnmount() {
  2565       this.timeouts.forEach(clearTimeout);
  3595       this.timeouts.forEach(clearTimeout);
  2566     }
  3596     }
  2567 
       
  2568     setTimeout(fn, delay) {
  3597     setTimeout(fn, delay) {
  2569       const id = setTimeout(() => {
  3598       const id = setTimeout(() => {
  2570         fn();
  3599         fn();
  2571         this.clearTimeout(id);
  3600         this.clearTimeout(id);
  2572       }, delay);
  3601       }, delay);
  2573       this.timeouts.push(id);
  3602       this.timeouts.push(id);
  2574       return id;
  3603       return id;
  2575     }
  3604     }
  2576 
       
  2577     clearTimeout(id) {
  3605     clearTimeout(id) {
  2578       clearTimeout(id);
  3606       clearTimeout(id);
  2579       this.timeouts = (0,external_lodash_namespaceObject.without)(this.timeouts, id);
  3607       this.timeouts = this.timeouts.filter(timeoutId => timeoutId !== id);
  2580     }
  3608     }
  2581 
       
  2582     render() {
  3609     render() {
  2583       const props = { ...this.props,
  3610       return (
  2584         setTimeout: this.setTimeout,
  3611         /*#__PURE__*/
  2585         clearTimeout: this.clearTimeout
  3612         // @ts-ignore
  2586       };
  3613         (0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
  2587       return (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, props);
  3614           ...this.props,
  2588     }
  3615           setTimeout: this.setTimeout,
  2589 
  3616           clearTimeout: this.clearTimeout
       
  3617         })
       
  3618       );
       
  3619     }
  2590   };
  3620   };
  2591 }, 'withSafeTimeout');
  3621 }, 'withSafeTimeout');
  2592 /* harmony default export */ var with_safe_timeout = (withSafeTimeout);
  3622 /* harmony default export */ const with_safe_timeout = (withSafeTimeout);
  2593 
  3623 
  2594 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js
  3624 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/higher-order/with-state/index.js
  2595 
       
  2596 
       
  2597 
       
  2598 /**
  3625 /**
  2599  * WordPress dependencies
  3626  * WordPress dependencies
  2600  */
  3627  */
       
  3628 
  2601 
  3629 
  2602 
  3630 
  2603 /**
  3631 /**
  2604  * Internal dependencies
  3632  * Internal dependencies
  2605  */
  3633  */
  2614  * @param {any} initialState Optional initial state of the component.
  3642  * @param {any} initialState Optional initial state of the component.
  2615  *
  3643  *
  2616  * @return {any} A higher order component wrapper accepting a component that takes the state props + its own props + `setState` and returning a component that only accepts the own props.
  3644  * @return {any} A higher order component wrapper accepting a component that takes the state props + its own props + `setState` and returning a component that only accepts the own props.
  2617  */
  3645  */
  2618 
  3646 
  2619 function withState() {
  3647 function withState(initialState = {}) {
  2620   let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
       
  2621   external_wp_deprecated_default()('wp.compose.withState', {
  3648   external_wp_deprecated_default()('wp.compose.withState', {
  2622     since: '5.8',
  3649     since: '5.8',
  2623     alternative: 'wp.element.useState'
  3650     alternative: 'wp.element.useState'
  2624   });
  3651   });
  2625   return create_higher_order_component(OriginalComponent => {
  3652   return createHigherOrderComponent(OriginalComponent => {
  2626     return class WrappedComponent extends external_wp_element_namespaceObject.Component {
  3653     return class WrappedComponent extends external_wp_element_namespaceObject.Component {
  2627       constructor(
  3654       constructor( /** @type {any} */props) {
  2628       /** @type {any} */
       
  2629       props) {
       
  2630         super(props);
  3655         super(props);
  2631         this.setState = this.setState.bind(this);
  3656         this.setState = this.setState.bind(this);
  2632         this.state = initialState;
  3657         this.state = initialState;
  2633       }
  3658       }
  2634 
       
  2635       render() {
  3659       render() {
  2636         return (0,external_wp_element_namespaceObject.createElement)(OriginalComponent, _extends({}, this.props, this.state, {
  3660         return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalComponent, {
       
  3661           ...this.props,
       
  3662           ...this.state,
  2637           setState: this.setState
  3663           setState: this.setState
  2638         }));
  3664         });
  2639       }
  3665       }
  2640 
       
  2641     };
  3666     };
  2642   }, 'withState');
  3667   }, 'withState');
  2643 }
  3668 }
  2644 
  3669 
  2645 ;// CONCATENATED MODULE: external ["wp","keycodes"]
       
  2646 var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
       
  2647 ;// CONCATENATED MODULE: external ["wp","dom"]
  3670 ;// CONCATENATED MODULE: external ["wp","dom"]
  2648 var external_wp_dom_namespaceObject = window["wp"]["dom"];
  3671 const external_wp_dom_namespaceObject = window["wp"]["dom"];
  2649 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-ref-effect/index.js
  3672 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-ref-effect/index.js
  2650 /**
  3673 /**
  2651  * External dependencies
  3674  * External dependencies
  2652  */
  3675  */
  2653 
  3676 
  2654 /**
  3677 /**
  2655  * WordPress dependencies
  3678  * WordPress dependencies
  2656  */
  3679  */
       
  3680 
  2657 
  3681 
  2658 /**
  3682 /**
  2659  * Effect-like ref callback. Just like with `useEffect`, this allows you to
  3683  * Effect-like ref callback. Just like with `useEffect`, this allows you to
  2660  * return a cleanup function to be run if the ref changes or one of the
  3684  * return a cleanup function to be run if the ref changes or one of the
  2661  * dependencies changes. The ref is provided as an argument to the callback
  3685  * dependencies changes. The ref is provided as an argument to the callback
  2667  * It's worth noting that if the dependencies array is empty, there's not
  3691  * It's worth noting that if the dependencies array is empty, there's not
  2668  * strictly a need to clean up event handlers for example, because the node is
  3692  * strictly a need to clean up event handlers for example, because the node is
  2669  * to be removed. It *is* necessary if you add dependencies because the ref
  3693  * to be removed. It *is* necessary if you add dependencies because the ref
  2670  * callback will be called multiple times for the same node.
  3694  * callback will be called multiple times for the same node.
  2671  *
  3695  *
  2672  * @param  callback     Callback with ref as argument.
  3696  * @param callback     Callback with ref as argument.
  2673  * @param  dependencies Dependencies of the callback.
  3697  * @param dependencies Dependencies of the callback.
  2674  *
  3698  *
  2675  * @return Ref callback.
  3699  * @return Ref callback.
  2676  */
  3700  */
  2677 
       
  2678 function useRefEffect(callback, dependencies) {
  3701 function useRefEffect(callback, dependencies) {
  2679   const cleanup = (0,external_wp_element_namespaceObject.useRef)();
  3702   const cleanup = (0,external_wp_element_namespaceObject.useRef)();
  2680   return (0,external_wp_element_namespaceObject.useCallback)(node => {
  3703   return (0,external_wp_element_namespaceObject.useCallback)(node => {
  2681     if (node) {
  3704     if (node) {
  2682       cleanup.current = callback(node);
  3705       cleanup.current = callback(node);
  2716  *         </div>
  3739  *         </div>
  2717  *     );
  3740  *     );
  2718  * }
  3741  * }
  2719  * ```
  3742  * ```
  2720  */
  3743  */
  2721 
       
  2722 function useConstrainedTabbing() {
  3744 function useConstrainedTabbing() {
  2723   return useRefEffect((
  3745   return useRefEffect(( /** @type {HTMLElement} */node) => {
  2724   /** @type {HTMLElement} */
  3746     function onKeyDown( /** @type {KeyboardEvent} */event) {
  2725   node) => {
       
  2726     /** @type {number|undefined} */
       
  2727     let timeoutId;
       
  2728 
       
  2729     function onKeyDown(
       
  2730     /** @type {KeyboardEvent} */
       
  2731     event) {
       
  2732       const {
  3747       const {
  2733         keyCode,
  3748         key,
  2734         shiftKey,
  3749         shiftKey,
  2735         target
  3750         target
  2736       } = event;
  3751       } = event;
  2737 
  3752       if (key !== 'Tab') {
  2738       if (keyCode !== external_wp_keycodes_namespaceObject.TAB) {
       
  2739         return;
  3753         return;
  2740       }
  3754       }
  2741 
       
  2742       const action = shiftKey ? 'findPrevious' : 'findNext';
  3755       const action = shiftKey ? 'findPrevious' : 'findNext';
  2743       const nextElement = external_wp_dom_namespaceObject.focus.tabbable[action](
  3756       const nextElement = external_wp_dom_namespaceObject.focus.tabbable[action]( /** @type {HTMLElement} */target) || null;
  2744       /** @type {HTMLElement} */
  3757 
  2745       target) || null; // If the element that is about to receive focus is outside the
  3758       // When the target element contains the element that is about to
       
  3759       // receive focus, for example when the target is a tabbable
       
  3760       // container, browsers may disagree on where to move focus next.
       
  3761       // In this case we can't rely on native browsers behavior. We need
       
  3762       // to manage focus instead.
       
  3763       // See https://github.com/WordPress/gutenberg/issues/46041.
       
  3764       if ( /** @type {HTMLElement} */target.contains(nextElement)) {
       
  3765         event.preventDefault();
       
  3766         nextElement?.focus();
       
  3767         return;
       
  3768       }
       
  3769 
       
  3770       // If the element that is about to receive focus is inside the
       
  3771       // area, rely on native browsers behavior and let tabbing follow
       
  3772       // the native tab sequence.
       
  3773       if (node.contains(nextElement)) {
       
  3774         return;
       
  3775       }
       
  3776 
       
  3777       // If the element that is about to receive focus is outside the
  2746       // area, move focus to a div and insert it at the start or end of
  3778       // area, move focus to a div and insert it at the start or end of
  2747       // the area, depending on the direction. Without preventing default
  3779       // the area, depending on the direction. Without preventing default
  2748       // behaviour, the browser will then move focus to the next element.
  3780       // behaviour, the browser will then move focus to the next element.
  2749 
       
  2750       if (node.contains(nextElement)) {
       
  2751         return;
       
  2752       }
       
  2753 
       
  2754       const domAction = shiftKey ? 'append' : 'prepend';
  3781       const domAction = shiftKey ? 'append' : 'prepend';
  2755       const {
  3782       const {
  2756         ownerDocument
  3783         ownerDocument
  2757       } = node;
  3784       } = node;
  2758       const trap = ownerDocument.createElement('div');
  3785       const trap = ownerDocument.createElement('div');
  2759       trap.tabIndex = -1;
  3786       trap.tabIndex = -1;
  2760       node[domAction](trap);
  3787       node[domAction](trap);
  2761       trap.focus(); // Remove after the browser moves focus to the next element.
  3788 
  2762 
  3789       // Remove itself when the trap loses focus.
  2763       timeoutId = setTimeout(() => node.removeChild(trap));
  3790       trap.addEventListener('blur', () => node.removeChild(trap));
  2764     }
  3791       trap.focus();
  2765 
  3792     }
  2766     node.addEventListener('keydown', onKeyDown);
  3793     node.addEventListener('keydown', onKeyDown);
  2767     return () => {
  3794     return () => {
  2768       node.removeEventListener('keydown', onKeyDown);
  3795       node.removeEventListener('keydown', onKeyDown);
  2769       clearTimeout(timeoutId);
       
  2770     };
  3796     };
  2771   }, []);
  3797   }, []);
  2772 }
  3798 }
  2773 
  3799 /* harmony default export */ const use_constrained_tabbing = (useConstrainedTabbing);
  2774 /* harmony default export */ var use_constrained_tabbing = (useConstrainedTabbing);
       
  2775 
  3800 
  2776 // EXTERNAL MODULE: ./node_modules/clipboard/dist/clipboard.js
  3801 // EXTERNAL MODULE: ./node_modules/clipboard/dist/clipboard.js
  2777 var dist_clipboard = __webpack_require__(8294);
  3802 var dist_clipboard = __webpack_require__(3758);
  2778 var clipboard_default = /*#__PURE__*/__webpack_require__.n(dist_clipboard);
  3803 var clipboard_default = /*#__PURE__*/__webpack_require__.n(dist_clipboard);
  2779 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-copy-on-click/index.js
  3804 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-copy-on-click/index.js
  2780 /**
  3805 /**
  2781  * External dependencies
  3806  * External dependencies
  2782  */
  3807  */
  2783 
  3808 
       
  3809 
  2784 /**
  3810 /**
  2785  * WordPress dependencies
  3811  * WordPress dependencies
  2786  */
  3812  */
  2787 
  3813 
  2788 
  3814 
  2789 
  3815 
  2790 /* eslint-disable jsdoc/no-undefined-types */
  3816 /* eslint-disable jsdoc/no-undefined-types */
  2791 
       
  2792 /**
  3817 /**
  2793  * Copies the text to the clipboard when the element is clicked.
  3818  * Copies the text to the clipboard when the element is clicked.
  2794  *
  3819  *
  2795  * @deprecated
  3820  * @deprecated
  2796  *
  3821  *
  2800  *                                                                                      state. 4 seconds by default.
  3825  *                                                                                      state. 4 seconds by default.
  2801  *
  3826  *
  2802  * @return {boolean} Whether or not the text has been copied. Resets after the
  3827  * @return {boolean} Whether or not the text has been copied. Resets after the
  2803  *                   timeout.
  3828  *                   timeout.
  2804  */
  3829  */
  2805 
  3830 function useCopyOnClick(ref, text, timeout = 4000) {
  2806 function useCopyOnClick(ref, text) {
       
  2807   let timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 4000;
       
  2808 
       
  2809   /* eslint-enable jsdoc/no-undefined-types */
  3831   /* eslint-enable jsdoc/no-undefined-types */
  2810   external_wp_deprecated_default()('wp.compose.useCopyOnClick', {
  3832   external_wp_deprecated_default()('wp.compose.useCopyOnClick', {
  2811     since: '5.8',
  3833     since: '5.8',
  2812     alternative: 'wp.compose.useCopyToClipboard'
  3834     alternative: 'wp.compose.useCopyToClipboard'
  2813   });
  3835   });
       
  3836 
  2814   /** @type {import('react').MutableRefObject<Clipboard | undefined>} */
  3837   /** @type {import('react').MutableRefObject<Clipboard | undefined>} */
  2815 
       
  2816   const clipboard = (0,external_wp_element_namespaceObject.useRef)();
  3838   const clipboard = (0,external_wp_element_namespaceObject.useRef)();
  2817   const [hasCopied, setHasCopied] = (0,external_wp_element_namespaceObject.useState)(false);
  3839   const [hasCopied, setHasCopied] = (0,external_wp_element_namespaceObject.useState)(false);
  2818   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3840   (0,external_wp_element_namespaceObject.useEffect)(() => {
  2819     /** @type {number | undefined} */
  3841     /** @type {number | undefined} */
  2820     let timeoutId;
  3842     let timeoutId;
  2821 
       
  2822     if (!ref.current) {
  3843     if (!ref.current) {
  2823       return;
  3844       return;
  2824     } // Clipboard listens to click events.
  3845     }
  2825 
  3846 
  2826 
  3847     // Clipboard listens to click events.
  2827     clipboard.current = new (clipboard_default())(ref.current, {
  3848     clipboard.current = new (clipboard_default())(ref.current, {
  2828       text: () => typeof text === 'function' ? text() : text
  3849       text: () => typeof text === 'function' ? text() : text
  2829     });
  3850     });
  2830     clipboard.current.on('success', _ref => {
  3851     clipboard.current.on('success', ({
  2831       let {
  3852       clearSelection,
  2832         clearSelection,
  3853       trigger
  2833         trigger
  3854     }) => {
  2834       } = _ref;
       
  2835       // Clearing selection will move focus back to the triggering button,
  3855       // Clearing selection will move focus back to the triggering button,
  2836       // ensuring that it is not reset to the body, and further that it is
  3856       // ensuring that it is not reset to the body, and further that it is
  2837       // kept within the rendered node.
  3857       // kept within the rendered node.
  2838       clearSelection(); // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
  3858       clearSelection();
  2839 
  3859 
       
  3860       // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680
  2840       if (trigger) {
  3861       if (trigger) {
  2841         /** @type {HTMLElement} */
  3862         /** @type {HTMLElement} */trigger.focus();
  2842         trigger.focus();
  3863       }
  2843       }
       
  2844 
       
  2845       if (timeout) {
  3864       if (timeout) {
  2846         setHasCopied(true);
  3865         setHasCopied(true);
  2847         clearTimeout(timeoutId);
  3866         clearTimeout(timeoutId);
  2848         timeoutId = setTimeout(() => setHasCopied(false), timeout);
  3867         timeoutId = setTimeout(() => setHasCopied(false), timeout);
  2849       }
  3868       }
  2850     });
  3869     });
  2851     return () => {
  3870     return () => {
  2852       if (clipboard.current) {
  3871       if (clipboard.current) {
  2853         clipboard.current.destroy();
  3872         clipboard.current.destroy();
  2854       }
  3873       }
  2855 
       
  2856       clearTimeout(timeoutId);
  3874       clearTimeout(timeoutId);
  2857     };
  3875     };
  2858   }, [text, timeout, setHasCopied]);
  3876   }, [text, timeout, setHasCopied]);
  2859   return hasCopied;
  3877   return hasCopied;
  2860 }
  3878 }
  2862 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-copy-to-clipboard/index.js
  3880 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-copy-to-clipboard/index.js
  2863 /**
  3881 /**
  2864  * External dependencies
  3882  * External dependencies
  2865  */
  3883  */
  2866 
  3884 
       
  3885 
  2867 /**
  3886 /**
  2868  * WordPress dependencies
  3887  * WordPress dependencies
  2869  */
  3888  */
  2870 
  3889 
  2871 
  3890 
  2877 /**
  3896 /**
  2878  * @template T
  3897  * @template T
  2879  * @param {T} value
  3898  * @param {T} value
  2880  * @return {import('react').RefObject<T>} The updated ref
  3899  * @return {import('react').RefObject<T>} The updated ref
  2881  */
  3900  */
  2882 
       
  2883 function useUpdatedRef(value) {
  3901 function useUpdatedRef(value) {
  2884   const ref = (0,external_wp_element_namespaceObject.useRef)(value);
  3902   const ref = (0,external_wp_element_namespaceObject.useRef)(value);
  2885   ref.current = value;
  3903   ref.current = value;
  2886   return ref;
  3904   return ref;
  2887 }
  3905 }
       
  3906 
  2888 /**
  3907 /**
  2889  * Copies the given text to the clipboard when the element is clicked.
  3908  * Copies the given text to the clipboard when the element is clicked.
  2890  *
  3909  *
  2891  * @template {HTMLElement} TElementType
  3910  * @template {HTMLElement} TElementType
  2892  * @param {string | (() => string)} text      The text to copy. Use a function if not
  3911  * @param {string | (() => string)} text      The text to copy. Use a function if not
  2893  *                                            already available and expensive to compute.
  3912  *                                            already available and expensive to compute.
  2894  * @param {Function}                onSuccess Called when to text is copied.
  3913  * @param {Function}                onSuccess Called when to text is copied.
  2895  *
  3914  *
  2896  * @return {import('react').Ref<TElementType>} A ref to assign to the target element.
  3915  * @return {import('react').Ref<TElementType>} A ref to assign to the target element.
  2897  */
  3916  */
  2898 
       
  2899 
       
  2900 function useCopyToClipboard(text, onSuccess) {
  3917 function useCopyToClipboard(text, onSuccess) {
  2901   // Store the dependencies as refs and continuesly update them so they're
  3918   // Store the dependencies as refs and continuously update them so they're
  2902   // fresh when the callback is called.
  3919   // fresh when the callback is called.
  2903   const textRef = useUpdatedRef(text);
  3920   const textRef = useUpdatedRef(text);
  2904   const onSuccessRef = useUpdatedRef(onSuccess);
  3921   const onSuccessRef = useUpdatedRef(onSuccess);
  2905   return useRefEffect(node => {
  3922   return useRefEffect(node => {
  2906     // Clipboard listens to click events.
  3923     // Clipboard listens to click events.
  2907     const clipboard = new (clipboard_default())(node, {
  3924     const clipboard = new (clipboard_default())(node, {
  2908       text() {
  3925       text() {
  2909         return typeof textRef.current === 'function' ? textRef.current() : textRef.current || '';
  3926         return typeof textRef.current === 'function' ? textRef.current() : textRef.current || '';
  2910       }
  3927       }
  2911 
       
  2912     });
  3928     });
  2913     clipboard.on('success', _ref => {
  3929     clipboard.on('success', ({
  2914       let {
  3930       clearSelection
  2915         clearSelection
  3931     }) => {
  2916       } = _ref;
       
  2917       // Clearing selection will move focus back to the triggering
  3932       // Clearing selection will move focus back to the triggering
  2918       // button, ensuring that it is not reset to the body, and
  3933       // button, ensuring that it is not reset to the body, and
  2919       // further that it is kept within the rendered node.
  3934       // further that it is kept within the rendered node.
  2920       clearSelection(); // Handle ClipboardJS focus bug, see
  3935       clearSelection();
  2921       // https://github.com/zenorocha/clipboard.js/issues/680
       
  2922 
       
  2923       node.focus();
       
  2924 
       
  2925       if (onSuccessRef.current) {
  3936       if (onSuccessRef.current) {
  2926         onSuccessRef.current();
  3937         onSuccessRef.current();
  2927       }
  3938       }
  2928     });
  3939     });
  2929     return () => {
  3940     return () => {
  2930       clipboard.destroy();
  3941       clipboard.destroy();
  2931     };
  3942     };
  2932   }, []);
  3943   }, []);
  2933 }
  3944 }
  2934 
  3945 
       
  3946 ;// CONCATENATED MODULE: external ["wp","keycodes"]
       
  3947 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
  2935 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-on-mount/index.js
  3948 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-on-mount/index.js
  2936 /**
  3949 /**
  2937  * WordPress dependencies
  3950  * WordPress dependencies
       
  3951  */
       
  3952 
       
  3953 
       
  3954 
       
  3955 /**
       
  3956  * Internal dependencies
  2938  */
  3957  */
  2939 
  3958 
  2940 
  3959 
  2941 /**
  3960 /**
  2942  * Hook used to focus the first tabbable element on mount.
  3961  * Hook used to focus the first tabbable element on mount.
  2957  *         </div>
  3976  *         </div>
  2958  *     );
  3977  *     );
  2959  * }
  3978  * }
  2960  * ```
  3979  * ```
  2961  */
  3980  */
  2962 
  3981 function useFocusOnMount(focusOnMount = 'firstElement') {
  2963 function useFocusOnMount() {
       
  2964   let focusOnMount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'firstElement';
       
  2965   const focusOnMountRef = (0,external_wp_element_namespaceObject.useRef)(focusOnMount);
  3982   const focusOnMountRef = (0,external_wp_element_namespaceObject.useRef)(focusOnMount);
       
  3983 
       
  3984   /**
       
  3985    * Sets focus on a DOM element.
       
  3986    *
       
  3987    * @param {HTMLElement} target The DOM element to set focus to.
       
  3988    * @return {void}
       
  3989    */
       
  3990   const setFocus = target => {
       
  3991     target.focus({
       
  3992       // When focusing newly mounted dialogs,
       
  3993       // the position of the popover is often not right on the first render
       
  3994       // This prevents the layout shifts when focusing the dialogs.
       
  3995       preventScroll: true
       
  3996     });
       
  3997   };
       
  3998 
       
  3999   /** @type {import('react').MutableRefObject<ReturnType<setTimeout> | undefined>} */
       
  4000   const timerId = (0,external_wp_element_namespaceObject.useRef)();
  2966   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4001   (0,external_wp_element_namespaceObject.useEffect)(() => {
  2967     focusOnMountRef.current = focusOnMount;
  4002     focusOnMountRef.current = focusOnMount;
  2968   }, [focusOnMount]);
  4003   }, [focusOnMount]);
  2969   return (0,external_wp_element_namespaceObject.useCallback)(node => {
  4004   return useRefEffect(node => {
  2970     var _node$ownerDocument$a, _node$ownerDocument;
  4005     var _node$ownerDocument$a;
  2971 
       
  2972     if (!node || focusOnMountRef.current === false) {
  4006     if (!node || focusOnMountRef.current === false) {
  2973       return;
  4007       return;
  2974     }
  4008     }
  2975 
  4009     if (node.contains((_node$ownerDocument$a = node.ownerDocument?.activeElement) !== null && _node$ownerDocument$a !== void 0 ? _node$ownerDocument$a : null)) {
  2976     if (node.contains((_node$ownerDocument$a = (_node$ownerDocument = node.ownerDocument) === null || _node$ownerDocument === void 0 ? void 0 : _node$ownerDocument.activeElement) !== null && _node$ownerDocument$a !== void 0 ? _node$ownerDocument$a : null)) {
       
  2977       return;
  4010       return;
  2978     }
  4011     }
  2979 
       
  2980     let target = node;
       
  2981 
       
  2982     if (focusOnMountRef.current === 'firstElement') {
  4012     if (focusOnMountRef.current === 'firstElement') {
  2983       const firstTabbable = external_wp_dom_namespaceObject.focus.tabbable.find(node)[0];
  4013       timerId.current = setTimeout(() => {
  2984 
  4014         const firstTabbable = external_wp_dom_namespaceObject.focus.tabbable.find(node)[0];
  2985       if (firstTabbable) {
  4015         if (firstTabbable) {
  2986         target =
  4016           setFocus(firstTabbable);
  2987         /** @type {HTMLElement} */
  4017         }
  2988         firstTabbable;
  4018       }, 0);
  2989       }
  4019       return;
  2990     }
  4020     }
  2991 
  4021     setFocus(node);
  2992     target.focus();
  4022     return () => {
       
  4023       if (timerId.current) {
       
  4024         clearTimeout(timerId.current);
       
  4025       }
       
  4026     };
  2993   }, []);
  4027   }, []);
  2994 }
  4028 }
  2995 
  4029 
  2996 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-return/index.js
  4030 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-return/index.js
  2997 /**
  4031 /**
  2998  * WordPress dependencies
  4032  * WordPress dependencies
  2999  */
  4033  */
  3000 
  4034 
  3001 /**
  4035 
  3002  * When opening modals/sidebars/dialogs, the focus
  4036 /** @type {Element|null} */
  3003  * must move to the opened area and return to the
  4037 let origin = null;
  3004  * previously focused element when closed.
  4038 
  3005  * The current hook implements the returning behavior.
  4039 /**
       
  4040  * Adds the unmount behavior of returning focus to the element which had it
       
  4041  * previously as is expected for roles like menus or dialogs.
  3006  *
  4042  *
  3007  * @param {() => void} [onFocusReturn] Overrides the default return behavior.
  4043  * @param {() => void} [onFocusReturn] Overrides the default return behavior.
  3008  * @return {import('react').RefCallback<HTMLElement>} Element Ref.
  4044  * @return {import('react').RefCallback<HTMLElement>} Element Ref.
  3009  *
  4045  *
  3010  * @example
  4046  * @example
  3020  *         </div>
  4056  *         </div>
  3021  *     );
  4057  *     );
  3022  * }
  4058  * }
  3023  * ```
  4059  * ```
  3024  */
  4060  */
  3025 
       
  3026 function useFocusReturn(onFocusReturn) {
  4061 function useFocusReturn(onFocusReturn) {
  3027   /** @type {import('react').MutableRefObject<null | HTMLElement>} */
  4062   /** @type {import('react').MutableRefObject<null | HTMLElement>} */
  3028   const ref = (0,external_wp_element_namespaceObject.useRef)(null);
  4063   const ref = (0,external_wp_element_namespaceObject.useRef)(null);
  3029   /** @type {import('react').MutableRefObject<null | Element>} */
  4064   /** @type {import('react').MutableRefObject<null | Element>} */
  3030 
       
  3031   const focusedBeforeMount = (0,external_wp_element_namespaceObject.useRef)(null);
  4065   const focusedBeforeMount = (0,external_wp_element_namespaceObject.useRef)(null);
  3032   const onFocusReturnRef = (0,external_wp_element_namespaceObject.useRef)(onFocusReturn);
  4066   const onFocusReturnRef = (0,external_wp_element_namespaceObject.useRef)(onFocusReturn);
  3033   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4067   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3034     onFocusReturnRef.current = onFocusReturn;
  4068     onFocusReturnRef.current = onFocusReturn;
  3035   }, [onFocusReturn]);
  4069   }, [onFocusReturn]);
  3036   return (0,external_wp_element_namespaceObject.useCallback)(node => {
  4070   return (0,external_wp_element_namespaceObject.useCallback)(node => {
  3037     if (node) {
  4071     if (node) {
  3038       // Set ref to be used when unmounting.
  4072       // Set ref to be used when unmounting.
  3039       ref.current = node; // Only set when the node mounts.
  4073       ref.current = node;
  3040 
  4074 
       
  4075       // Only set when the node mounts.
  3041       if (focusedBeforeMount.current) {
  4076       if (focusedBeforeMount.current) {
  3042         return;
  4077         return;
  3043       }
  4078       }
  3044 
       
  3045       focusedBeforeMount.current = node.ownerDocument.activeElement;
  4079       focusedBeforeMount.current = node.ownerDocument.activeElement;
  3046     } else if (focusedBeforeMount.current) {
  4080     } else if (focusedBeforeMount.current) {
  3047       var _ref$current, _ref$current2, _ref$current3;
  4081       const isFocused = ref.current?.contains(ref.current?.ownerDocument.activeElement);
  3048 
  4082       if (ref.current?.isConnected && !isFocused) {
  3049       const isFocused = (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.contains((_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.ownerDocument.activeElement);
  4083         var _origin;
  3050 
  4084         (_origin = origin) !== null && _origin !== void 0 ? _origin : origin = focusedBeforeMount.current;
  3051       if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.isConnected && !isFocused) {
       
  3052         return;
  4085         return;
  3053       } // Defer to the component's own explicit focus return behavior, if
  4086       }
       
  4087 
       
  4088       // Defer to the component's own explicit focus return behavior, if
  3054       // specified. This allows for support that the `onFocusReturn`
  4089       // specified. This allows for support that the `onFocusReturn`
  3055       // decides to allow the default behavior to occur under some
  4090       // decides to allow the default behavior to occur under some
  3056       // conditions.
  4091       // conditions.
  3057 
       
  3058 
       
  3059       if (onFocusReturnRef.current) {
  4092       if (onFocusReturnRef.current) {
  3060         onFocusReturnRef.current();
  4093         onFocusReturnRef.current();
  3061       } else {
  4094       } else {
  3062         var _focusedBeforeMount$c;
  4095         /** @type {null|HTMLElement} */(!focusedBeforeMount.current.isConnected ? origin : focusedBeforeMount.current)?.focus();
  3063 
  4096       }
  3064         /** @type {null | HTMLElement} */
  4097       origin = null;
  3065         (_focusedBeforeMount$c = focusedBeforeMount.current) === null || _focusedBeforeMount$c === void 0 ? void 0 : _focusedBeforeMount$c.focus();
       
  3066       }
       
  3067     }
  4098     }
  3068   }, []);
  4099   }, []);
  3069 }
  4100 }
  3070 
  4101 /* harmony default export */ const use_focus_return = (useFocusReturn);
  3071 /* harmony default export */ var use_focus_return = (useFocusReturn);
       
  3072 
  4102 
  3073 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-outside/index.js
  4103 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focus-outside/index.js
  3074 /**
       
  3075  * External dependencies
       
  3076  */
       
  3077 
       
  3078 /**
  4104 /**
  3079  * WordPress dependencies
  4105  * WordPress dependencies
  3080  */
  4106  */
  3081 
  4107 
  3082 
  4108 
  3083 /**
  4109 /**
  3084  * Input types which are classified as button types, for use in considering
  4110  * Input types which are classified as button types, for use in considering
  3085  * whether element is a (focus-normalized) button.
  4111  * whether element is a (focus-normalized) button.
  3086  *
  4112  */
  3087  * @type {string[]}
       
  3088  */
       
  3089 
       
  3090 const INPUT_BUTTON_TYPES = ['button', 'submit'];
  4113 const INPUT_BUTTON_TYPES = ['button', 'submit'];
  3091 /**
  4114 
  3092  * @typedef {HTMLButtonElement | HTMLLinkElement | HTMLInputElement} FocusNormalizedButton
  4115 /**
  3093  */
  4116  * List of HTML button elements subject to focus normalization
  3094 // Disable reason: Rule doesn't support predicate return types.
  4117  *
  3095 
  4118  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
  3096 /* eslint-disable jsdoc/valid-types */
  4119  */
  3097 
  4120 
  3098 /**
  4121 /**
  3099  * Returns true if the given element is a button element subject to focus
  4122  * Returns true if the given element is a button element subject to focus
  3100  * normalization, or false otherwise.
  4123  * normalization, or false otherwise.
  3101  *
  4124  *
  3102  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
  4125  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
  3103  *
  4126  *
  3104  * @param {EventTarget} eventTarget The target from a mouse or touch event.
  4127  * @param eventTarget The target from a mouse or touch event.
  3105  *
  4128  *
  3106  * @return {eventTarget is FocusNormalizedButton} Whether element is a button.
  4129  * @return Whether the element is a button element subject to focus normalization.
  3107  */
  4130  */
  3108 
       
  3109 function isFocusNormalizedButton(eventTarget) {
  4131 function isFocusNormalizedButton(eventTarget) {
  3110   if (!(eventTarget instanceof window.HTMLElement)) {
  4132   if (!(eventTarget instanceof window.HTMLElement)) {
  3111     return false;
  4133     return false;
  3112   }
  4134   }
  3113 
       
  3114   switch (eventTarget.nodeName) {
  4135   switch (eventTarget.nodeName) {
  3115     case 'A':
  4136     case 'A':
  3116     case 'BUTTON':
  4137     case 'BUTTON':
  3117       return true;
  4138       return true;
  3118 
       
  3119     case 'INPUT':
  4139     case 'INPUT':
  3120       return (0,external_lodash_namespaceObject.includes)(INPUT_BUTTON_TYPES,
  4140       return INPUT_BUTTON_TYPES.includes(eventTarget.type);
  3121       /** @type {HTMLInputElement} */
       
  3122       eventTarget.type);
       
  3123   }
  4141   }
  3124 
       
  3125   return false;
  4142   return false;
  3126 }
  4143 }
  3127 /* eslint-enable jsdoc/valid-types */
       
  3128 
       
  3129 /**
       
  3130  * @typedef {import('react').SyntheticEvent} SyntheticEvent
       
  3131  */
       
  3132 
       
  3133 /**
       
  3134  * @callback EventCallback
       
  3135  * @param {SyntheticEvent} event input related event.
       
  3136  */
       
  3137 
       
  3138 /**
       
  3139  * @typedef FocusOutsideReactElement
       
  3140  * @property {EventCallback} handleFocusOutside callback for a focus outside event.
       
  3141  */
       
  3142 
       
  3143 /**
       
  3144  * @typedef {import('react').MutableRefObject<FocusOutsideReactElement | undefined>} FocusOutsideRef
       
  3145  */
       
  3146 
       
  3147 /**
       
  3148  * @typedef {Object} FocusOutsideReturnValue
       
  3149  * @property {EventCallback} onFocus      An event handler for focus events.
       
  3150  * @property {EventCallback} onBlur       An event handler for blur events.
       
  3151  * @property {EventCallback} onMouseDown  An event handler for mouse down events.
       
  3152  * @property {EventCallback} onMouseUp    An event handler for mouse up events.
       
  3153  * @property {EventCallback} onTouchStart An event handler for touch start events.
       
  3154  * @property {EventCallback} onTouchEnd   An event handler for touch end events.
       
  3155  */
       
  3156 
       
  3157 /**
  4144 /**
  3158  * A react hook that can be used to check whether focus has moved outside the
  4145  * A react hook that can be used to check whether focus has moved outside the
  3159  * element the event handlers are bound to.
  4146  * element the event handlers are bound to.
  3160  *
  4147  *
  3161  * @param {EventCallback} onFocusOutside A callback triggered when focus moves outside
  4148  * @param onFocusOutside A callback triggered when focus moves outside
  3162  *                                       the element the event handlers are bound to.
  4149  *                       the element the event handlers are bound to.
  3163  *
  4150  *
  3164  * @return {FocusOutsideReturnValue} An object containing event handlers. Bind the event handlers
  4151  * @return An object containing event handlers. Bind the event handlers to a
  3165  *                                   to a wrapping element element to capture when focus moves
  4152  * wrapping element element to capture when focus moves outside that element.
  3166  *                                   outside that element.
  4153  */
  3167  */
       
  3168 
       
  3169 
       
  3170 function useFocusOutside(onFocusOutside) {
  4154 function useFocusOutside(onFocusOutside) {
  3171   const currentOnFocusOutside = (0,external_wp_element_namespaceObject.useRef)(onFocusOutside);
  4155   const currentOnFocusOutside = (0,external_wp_element_namespaceObject.useRef)(onFocusOutside);
  3172   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4156   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3173     currentOnFocusOutside.current = onFocusOutside;
  4157     currentOnFocusOutside.current = onFocusOutside;
  3174   }, [onFocusOutside]);
  4158   }, [onFocusOutside]);
  3175   const preventBlurCheck = (0,external_wp_element_namespaceObject.useRef)(false);
  4159   const preventBlurCheck = (0,external_wp_element_namespaceObject.useRef)(false);
  3176   /**
       
  3177    * @type {import('react').MutableRefObject<number | undefined>}
       
  3178    */
       
  3179 
       
  3180   const blurCheckTimeoutId = (0,external_wp_element_namespaceObject.useRef)();
  4160   const blurCheckTimeoutId = (0,external_wp_element_namespaceObject.useRef)();
       
  4161 
  3181   /**
  4162   /**
  3182    * Cancel a blur check timeout.
  4163    * Cancel a blur check timeout.
  3183    */
  4164    */
  3184 
       
  3185   const cancelBlurCheck = (0,external_wp_element_namespaceObject.useCallback)(() => {
  4165   const cancelBlurCheck = (0,external_wp_element_namespaceObject.useCallback)(() => {
  3186     clearTimeout(blurCheckTimeoutId.current);
  4166     clearTimeout(blurCheckTimeoutId.current);
  3187   }, []); // Cancel blur checks on unmount.
  4167   }, []);
  3188 
  4168 
       
  4169   // Cancel blur checks on unmount.
  3189   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4170   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3190     return () => cancelBlurCheck();
  4171     return () => cancelBlurCheck();
  3191   }, []); // Cancel a blur check if the callback or ref is no longer provided.
  4172   }, []);
  3192 
  4173 
       
  4174   // Cancel a blur check if the callback or ref is no longer provided.
  3193   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4175   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3194     if (!onFocusOutside) {
  4176     if (!onFocusOutside) {
  3195       cancelBlurCheck();
  4177       cancelBlurCheck();
  3196     }
  4178     }
  3197   }, [onFocusOutside, cancelBlurCheck]);
  4179   }, [onFocusOutside, cancelBlurCheck]);
       
  4180 
  3198   /**
  4181   /**
  3199    * Handles a mousedown or mouseup event to respectively assign and
  4182    * Handles a mousedown or mouseup event to respectively assign and
  3200    * unassign a flag for preventing blur check on button elements. Some
  4183    * unassign a flag for preventing blur check on button elements. Some
  3201    * browsers, namely Firefox and Safari, do not emit a focus event on
  4184    * browsers, namely Firefox and Safari, do not emit a focus event on
  3202    * button elements when clicked, while others do. The logic here
  4185    * button elements when clicked, while others do. The logic here
  3203    * intends to normalize this as treating click on buttons as focus.
  4186    * intends to normalize this as treating click on buttons as focus.
  3204    *
  4187    *
       
  4188    * @param event
  3205    * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
  4189    * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
  3206    *
       
  3207    * @param {SyntheticEvent} event Event for mousedown or mouseup.
       
  3208    */
  4190    */
  3209 
       
  3210   const normalizeButtonFocus = (0,external_wp_element_namespaceObject.useCallback)(event => {
  4191   const normalizeButtonFocus = (0,external_wp_element_namespaceObject.useCallback)(event => {
  3211     const {
  4192     const {
  3212       type,
  4193       type,
  3213       target
  4194       target
  3214     } = event;
  4195     } = event;
  3215     const isInteractionEnd = (0,external_lodash_namespaceObject.includes)(['mouseup', 'touchend'], type);
  4196     const isInteractionEnd = ['mouseup', 'touchend'].includes(type);
  3216 
       
  3217     if (isInteractionEnd) {
  4197     if (isInteractionEnd) {
  3218       preventBlurCheck.current = false;
  4198       preventBlurCheck.current = false;
  3219     } else if (isFocusNormalizedButton(target)) {
  4199     } else if (isFocusNormalizedButton(target)) {
  3220       preventBlurCheck.current = true;
  4200       preventBlurCheck.current = true;
  3221     }
  4201     }
  3222   }, []);
  4202   }, []);
       
  4203 
  3223   /**
  4204   /**
  3224    * A callback triggered when a blur event occurs on the element the handler
  4205    * A callback triggered when a blur event occurs on the element the handler
  3225    * is bound to.
  4206    * is bound to.
  3226    *
  4207    *
  3227    * Calls the `onFocusOutside` callback in an immediate timeout if focus has
  4208    * Calls the `onFocusOutside` callback in an immediate timeout if focus has
  3228    * move outside the bound element and is still within the document.
  4209    * move outside the bound element and is still within the document.
  3229    *
       
  3230    * @param {SyntheticEvent} event Blur event.
       
  3231    */
  4210    */
  3232 
       
  3233   const queueBlurCheck = (0,external_wp_element_namespaceObject.useCallback)(event => {
  4211   const queueBlurCheck = (0,external_wp_element_namespaceObject.useCallback)(event => {
  3234     // React does not allow using an event reference asynchronously
  4212     // React does not allow using an event reference asynchronously
  3235     // due to recycling behavior, except when explicitly persisted.
  4213     // due to recycling behavior, except when explicitly persisted.
  3236     event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
  4214     event.persist();
  3237 
  4215 
       
  4216     // Skip blur check if clicking button. See `normalizeButtonFocus`.
  3238     if (preventBlurCheck.current) {
  4217     if (preventBlurCheck.current) {
  3239       return;
  4218       return;
  3240     }
  4219     }
  3241 
  4220 
       
  4221     // The usage of this attribute should be avoided. The only use case
       
  4222     // would be when we load modals that are not React components and
       
  4223     // therefore don't exist in the React tree. An example is opening
       
  4224     // the Media Library modal from another dialog.
       
  4225     // This attribute should contain a selector of the related target
       
  4226     // we want to ignore, because we still need to trigger the blur event
       
  4227     // on all other cases.
       
  4228     const ignoreForRelatedTarget = event.target.getAttribute('data-unstable-ignore-focus-outside-for-relatedtarget');
       
  4229     if (ignoreForRelatedTarget && event.relatedTarget?.closest(ignoreForRelatedTarget)) {
       
  4230       return;
       
  4231     }
  3242     blurCheckTimeoutId.current = setTimeout(() => {
  4232     blurCheckTimeoutId.current = setTimeout(() => {
  3243       // If document is not focused then focus should remain
  4233       // If document is not focused then focus should remain
  3244       // inside the wrapped component and therefore we cancel
  4234       // inside the wrapped component and therefore we cancel
  3245       // this blur event thereby leaving focus in place.
  4235       // this blur event thereby leaving focus in place.
  3246       // https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus.
  4236       // https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus.
  3247       if (!document.hasFocus()) {
  4237       if (!document.hasFocus()) {
  3248         event.preventDefault();
  4238         event.preventDefault();
  3249         return;
  4239         return;
  3250       }
  4240       }
  3251 
       
  3252       if ('function' === typeof currentOnFocusOutside.current) {
  4241       if ('function' === typeof currentOnFocusOutside.current) {
  3253         currentOnFocusOutside.current(event);
  4242         currentOnFocusOutside.current(event);
  3254       }
  4243       }
  3255     }, 0);
  4244     }, 0);
  3256   }, []);
  4245   }, []);
  3267 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-merge-refs/index.js
  4256 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-merge-refs/index.js
  3268 /**
  4257 /**
  3269  * WordPress dependencies
  4258  * WordPress dependencies
  3270  */
  4259  */
  3271 
  4260 
       
  4261 
  3272 /* eslint-disable jsdoc/valid-types */
  4262 /* eslint-disable jsdoc/valid-types */
  3273 
       
  3274 /**
  4263 /**
  3275  * @template T
  4264  * @template T
  3276  * @typedef {T extends import('react').Ref<infer R> ? R : never} TypeFromRef
  4265  * @typedef {T extends import('react').Ref<infer R> ? R : never} TypeFromRef
  3277  */
  4266  */
  3278 
       
  3279 /* eslint-enable jsdoc/valid-types */
  4267 /* eslint-enable jsdoc/valid-types */
  3280 
  4268 
  3281 /**
  4269 /**
  3282  * @template T
  4270  * @template T
  3283  * @param {import('react').Ref<T>} ref
  4271  * @param {import('react').Ref<T>} ref
  3284  * @param {T}                      value
  4272  * @param {T}                      value
  3285  */
  4273  */
  3286 
       
  3287 function assignRef(ref, value) {
  4274 function assignRef(ref, value) {
  3288   if (typeof ref === 'function') {
  4275   if (typeof ref === 'function') {
  3289     ref(value);
  4276     ref(value);
  3290   } else if (ref && ref.hasOwnProperty('current')) {
  4277   } else if (ref && ref.hasOwnProperty('current')) {
  3291     /* eslint-disable jsdoc/no-undefined-types */
  4278     /* eslint-disable jsdoc/no-undefined-types */
  3292 
  4279     /** @type {import('react').MutableRefObject<T>} */ref.current = value;
  3293     /** @type {import('react').MutableRefObject<T>} */
       
  3294     ref.current = value;
       
  3295     /* eslint-enable jsdoc/no-undefined-types */
  4280     /* eslint-enable jsdoc/no-undefined-types */
  3296   }
  4281   }
  3297 }
  4282 }
       
  4283 
  3298 /**
  4284 /**
  3299  * Merges refs into one ref callback.
  4285  * Merges refs into one ref callback.
  3300  *
  4286  *
  3301  * It also ensures that the merged ref callbacks are only called when they
  4287  * It also ensures that the merged ref callbacks are only called when they
  3302  * change (as a result of a `useCallback` dependency update) OR when the ref
  4288  * change (as a result of a `useCallback` dependency update) OR when the ref
  3336  * @template {import('react').Ref<any>} TRef
  4322  * @template {import('react').Ref<any>} TRef
  3337  * @param {Array<TRef>} refs The refs to be merged.
  4323  * @param {Array<TRef>} refs The refs to be merged.
  3338  *
  4324  *
  3339  * @return {import('react').RefCallback<TypeFromRef<TRef>>} The merged ref callback.
  4325  * @return {import('react').RefCallback<TypeFromRef<TRef>>} The merged ref callback.
  3340  */
  4326  */
  3341 
       
  3342 
       
  3343 function useMergeRefs(refs) {
  4327 function useMergeRefs(refs) {
  3344   const element = (0,external_wp_element_namespaceObject.useRef)();
  4328   const element = (0,external_wp_element_namespaceObject.useRef)();
       
  4329   const isAttached = (0,external_wp_element_namespaceObject.useRef)(false);
  3345   const didElementChange = (0,external_wp_element_namespaceObject.useRef)(false);
  4330   const didElementChange = (0,external_wp_element_namespaceObject.useRef)(false);
  3346   /* eslint-disable jsdoc/no-undefined-types */
  4331   /* eslint-disable jsdoc/no-undefined-types */
  3347 
       
  3348   /** @type {import('react').MutableRefObject<TRef[]>} */
  4332   /** @type {import('react').MutableRefObject<TRef[]>} */
  3349 
       
  3350   /* eslint-enable jsdoc/no-undefined-types */
  4333   /* eslint-enable jsdoc/no-undefined-types */
  3351 
       
  3352   const previousRefs = (0,external_wp_element_namespaceObject.useRef)([]);
  4334   const previousRefs = (0,external_wp_element_namespaceObject.useRef)([]);
  3353   const currentRefs = (0,external_wp_element_namespaceObject.useRef)(refs); // Update on render before the ref callback is called, so the ref callback
  4335   const currentRefs = (0,external_wp_element_namespaceObject.useRef)(refs);
       
  4336 
       
  4337   // Update on render before the ref callback is called, so the ref callback
  3354   // always has access to the current refs.
  4338   // always has access to the current refs.
  3355 
  4339   currentRefs.current = refs;
  3356   currentRefs.current = refs; // If any of the refs change, call the previous ref with `null` and the new
  4340 
       
  4341   // If any of the refs change, call the previous ref with `null` and the new
  3357   // ref with the node, except when the element changes in the same cycle, in
  4342   // ref with the node, except when the element changes in the same cycle, in
  3358   // which case the ref callbacks will already have been called.
  4343   // which case the ref callbacks will already have been called.
  3359 
       
  3360   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  4344   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  3361     if (didElementChange.current === false) {
  4345     if (didElementChange.current === false && isAttached.current === true) {
  3362       refs.forEach((ref, index) => {
  4346       refs.forEach((ref, index) => {
  3363         const previousRef = previousRefs.current[index];
  4347         const previousRef = previousRefs.current[index];
  3364 
       
  3365         if (ref !== previousRef) {
  4348         if (ref !== previousRef) {
  3366           assignRef(previousRef, null);
  4349           assignRef(previousRef, null);
  3367           assignRef(ref, element.current);
  4350           assignRef(ref, element.current);
  3368         }
  4351         }
  3369       });
  4352       });
  3370     }
  4353     }
  3371 
       
  3372     previousRefs.current = refs;
  4354     previousRefs.current = refs;
  3373   }, refs); // No dependencies, must be reset after every render so ref callbacks are
  4355   }, refs);
       
  4356 
       
  4357   // No dependencies, must be reset after every render so ref callbacks are
  3374   // correctly called after a ref change.
  4358   // correctly called after a ref change.
  3375 
       
  3376   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  4359   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  3377     didElementChange.current = false;
  4360     didElementChange.current = false;
  3378   }); // There should be no dependencies so that `callback` is only called when
  4361   });
       
  4362 
       
  4363   // There should be no dependencies so that `callback` is only called when
  3379   // the node changes.
  4364   // the node changes.
  3380 
       
  3381   return (0,external_wp_element_namespaceObject.useCallback)(value => {
  4365   return (0,external_wp_element_namespaceObject.useCallback)(value => {
  3382     // Update the element so it can be used when calling ref callbacks on a
  4366     // Update the element so it can be used when calling ref callbacks on a
  3383     // dependency change.
  4367     // dependency change.
  3384     assignRef(element, value);
  4368     assignRef(element, value);
  3385     didElementChange.current = true; // When an element changes, the current ref callback should be called
  4369     didElementChange.current = true;
       
  4370     isAttached.current = value !== null;
       
  4371 
       
  4372     // When an element changes, the current ref callback should be called
  3386     // with the new element and the previous one with `null`.
  4373     // with the new element and the previous one with `null`.
  3387 
  4374     const refsToAssign = value ? currentRefs.current : previousRefs.current;
  3388     const refsToAssign = value ? currentRefs.current : previousRefs.current; // Update the latest refs.
  4375 
  3389 
  4376     // Update the latest refs.
  3390     for (const ref of refsToAssign) {
  4377     for (const ref of refsToAssign) {
  3391       assignRef(ref, value);
  4378       assignRef(ref, value);
  3392     }
  4379     }
  3393   }, []);
  4380   }, []);
  3394 }
  4381 }
  3395 
  4382 
  3396 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-dialog/index.js
  4383 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-dialog/index.js
  3397 /**
  4384 /**
       
  4385  * External dependencies
       
  4386  */
       
  4387 
       
  4388 /**
  3398  * WordPress dependencies
  4389  * WordPress dependencies
  3399  */
  4390  */
  3400 
  4391 
  3401 
  4392 
       
  4393 
  3402 /**
  4394 /**
  3403  * Internal dependencies
  4395  * Internal dependencies
  3404  */
  4396  */
  3405 
  4397 
  3406 
  4398 
  3407 
  4399 
  3408 
  4400 
  3409 
       
  3410 
       
  3411 /* eslint-disable jsdoc/valid-types */
       
  3412 
       
  3413 /**
       
  3414  * @typedef DialogOptions
       
  3415  * @property {Parameters<useFocusOnMount>[0]} focusOnMount Focus on mount arguments.
       
  3416  * @property {() => void}                     onClose      Function to call when the dialog is closed.
       
  3417  */
       
  3418 
       
  3419 /* eslint-enable jsdoc/valid-types */
       
  3420 
  4401 
  3421 /**
  4402 /**
  3422  * Returns a ref and props to apply to a dialog wrapper to enable the following behaviors:
  4403  * Returns a ref and props to apply to a dialog wrapper to enable the following behaviors:
  3423  *  - constrained tabbing.
  4404  *  - constrained tabbing.
  3424  *  - focus on mount.
  4405  *  - focus on mount.
  3425  *  - return focus on unmount.
  4406  *  - return focus on unmount.
  3426  *  - focus outside.
  4407  *  - focus outside.
  3427  *
  4408  *
  3428  * @param {DialogOptions} options Dialog Options.
  4409  * @param options Dialog Options.
  3429  */
  4410  */
  3430 
       
  3431 function useDialog(options) {
  4411 function useDialog(options) {
  3432   /**
       
  3433    * @type {import('react').MutableRefObject<DialogOptions | undefined>}
       
  3434    */
       
  3435   const currentOptions = (0,external_wp_element_namespaceObject.useRef)();
  4412   const currentOptions = (0,external_wp_element_namespaceObject.useRef)();
       
  4413   const {
       
  4414     constrainTabbing = options.focusOnMount !== false
       
  4415   } = options;
  3436   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4416   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3437     currentOptions.current = options;
  4417     currentOptions.current = options;
  3438   }, Object.values(options));
  4418   }, Object.values(options));
  3439   const constrainedTabbingRef = use_constrained_tabbing();
  4419   const constrainedTabbingRef = use_constrained_tabbing();
  3440   const focusOnMountRef = useFocusOnMount(options.focusOnMount);
  4420   const focusOnMountRef = useFocusOnMount(options.focusOnMount);
  3441   const focusReturnRef = use_focus_return();
  4421   const focusReturnRef = use_focus_return();
  3442   const focusOutsideProps = useFocusOutside(event => {
  4422   const focusOutsideProps = useFocusOutside(event => {
  3443     var _currentOptions$curre, _currentOptions$curre2;
       
  3444 
       
  3445     // This unstable prop  is here only to manage backward compatibility
  4423     // This unstable prop  is here only to manage backward compatibility
  3446     // for the Popover component otherwise, the onClose should be enough.
  4424     // for the Popover component otherwise, the onClose should be enough.
  3447     // @ts-ignore unstable property
  4425     if (currentOptions.current?.__unstableOnClose) {
  3448     if ((_currentOptions$curre = currentOptions.current) !== null && _currentOptions$curre !== void 0 && _currentOptions$curre.__unstableOnClose) {
       
  3449       // @ts-ignore unstable property
       
  3450       currentOptions.current.__unstableOnClose('focus-outside', event);
  4426       currentOptions.current.__unstableOnClose('focus-outside', event);
  3451     } else if ((_currentOptions$curre2 = currentOptions.current) !== null && _currentOptions$curre2 !== void 0 && _currentOptions$curre2.onClose) {
  4427     } else if (currentOptions.current?.onClose) {
  3452       currentOptions.current.onClose();
  4428       currentOptions.current.onClose();
  3453     }
  4429     }
  3454   });
  4430   });
  3455   const closeOnEscapeRef = (0,external_wp_element_namespaceObject.useCallback)(node => {
  4431   const closeOnEscapeRef = (0,external_wp_element_namespaceObject.useCallback)(node => {
  3456     if (!node) {
  4432     if (!node) {
  3457       return;
  4433       return;
  3458     }
  4434     }
  3459 
  4435     node.addEventListener('keydown', event => {
  3460     node.addEventListener('keydown', (
       
  3461     /** @type {KeyboardEvent} */
       
  3462     event) => {
       
  3463       var _currentOptions$curre3;
       
  3464 
       
  3465       // Close on escape.
  4436       // Close on escape.
  3466       if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented && (_currentOptions$curre3 = currentOptions.current) !== null && _currentOptions$curre3 !== void 0 && _currentOptions$curre3.onClose) {
  4437       if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented && currentOptions.current?.onClose) {
  3467         event.preventDefault();
  4438         event.preventDefault();
  3468         currentOptions.current.onClose();
  4439         currentOptions.current.onClose();
  3469       }
  4440       }
  3470     });
  4441     });
  3471   }, []);
  4442   }, []);
  3472   return [useMergeRefs([options.focusOnMount !== false ? constrainedTabbingRef : null, options.focusOnMount !== false ? focusReturnRef : null, options.focusOnMount !== false ? focusOnMountRef : null, closeOnEscapeRef]), { ...focusOutsideProps,
  4443   return [useMergeRefs([constrainTabbing ? constrainedTabbingRef : null, options.focusOnMount !== false ? focusReturnRef : null, options.focusOnMount !== false ? focusOnMountRef : null, closeOnEscapeRef]), {
  3473     tabIndex: '-1'
  4444     ...focusOutsideProps,
       
  4445     tabIndex: -1
  3474   }];
  4446   }];
  3475 }
  4447 }
  3476 
  4448 /* harmony default export */ const use_dialog = (useDialog);
  3477 /* harmony default export */ var use_dialog = (useDialog);
       
  3478 
  4449 
  3479 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-disabled/index.js
  4450 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-disabled/index.js
  3480 /**
  4451 /**
  3481  * External dependencies
  4452  * Internal dependencies
  3482  */
  4453  */
  3483 
  4454 
  3484 /**
  4455 
  3485  * WordPress dependencies
  4456 
  3486  */
       
  3487 
       
  3488 
       
  3489 
       
  3490 /**
       
  3491  * Names of control nodes which qualify for disabled behavior.
       
  3492  *
       
  3493  * See WHATWG HTML Standard: 4.10.18.5: "Enabling and disabling form controls: the disabled attribute".
       
  3494  *
       
  3495  * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute
       
  3496  *
       
  3497  * @type {string[]}
       
  3498  */
       
  3499 
       
  3500 const DISABLED_ELIGIBLE_NODE_NAMES = ['BUTTON', 'FIELDSET', 'INPUT', 'OPTGROUP', 'OPTION', 'SELECT', 'TEXTAREA'];
       
  3501 /**
  4457 /**
  3502  * In some circumstances, such as block previews, all focusable DOM elements
  4458  * In some circumstances, such as block previews, all focusable DOM elements
  3503  * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
  4459  * (input fields, links, buttons, etc.) need to be disabled. This hook adds the
  3504  * behavior to disable nested DOM elements to the returned ref.
  4460  * behavior to disable nested DOM elements to the returned ref.
  3505  *
  4461  *
  3506  * @return {import('react').RefObject<HTMLElement>} Element Ref.
  4462  * If you can, prefer the use of the inert HTML attribute.
       
  4463  *
       
  4464  * @param {Object}   config            Configuration object.
       
  4465  * @param {boolean=} config.isDisabled Whether the element should be disabled.
       
  4466  * @return {import('react').RefCallback<HTMLElement>} Element Ref.
  3507  *
  4467  *
  3508  * @example
  4468  * @example
  3509  * ```js
  4469  * ```js
  3510  * import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';
  4470  * import { useDisabled } from '@wordpress/compose';
       
  4471  *
  3511  * const DisabledExample = () => {
  4472  * const DisabledExample = () => {
  3512  * 	const disabledRef = useDisabled();
  4473  * 	const disabledRef = useDisabled();
  3513  *	return (
  4474  *	return (
  3514  *		<div ref={ disabledRef }>
  4475  *		<div ref={ disabledRef }>
  3515  *			<a href="#">This link will have tabindex set to -1</a>
  4476  *			<a href="#">This link will have tabindex set to -1</a>
  3517  *		</div>
  4478  *		</div>
  3518  *	);
  4479  *	);
  3519  * };
  4480  * };
  3520  * ```
  4481  * ```
  3521  */
  4482  */
  3522 
  4483 function useDisabled({
  3523 function useDisabled() {
  4484   isDisabled: isDisabledProp = false
  3524   /** @type {import('react').RefObject<HTMLElement>} */
  4485 } = {}) {
  3525   const node = (0,external_wp_element_namespaceObject.useRef)(null);
  4486   return useRefEffect(node => {
  3526 
  4487     if (isDisabledProp) {
  3527   const disable = () => {
       
  3528     if (!node.current) {
       
  3529       return;
  4488       return;
  3530     }
  4489     }
  3531 
  4490     const defaultView = node?.ownerDocument?.defaultView;
  3532     external_wp_dom_namespaceObject.focus.focusable.find(node.current).forEach(focusable => {
  4491     if (!defaultView) {
  3533       if ((0,external_lodash_namespaceObject.includes)(DISABLED_ELIGIBLE_NODE_NAMES, focusable.nodeName)) {
  4492       return;
  3534         focusable.setAttribute('disabled', '');
  4493     }
  3535       }
  4494 
  3536 
  4495     /** A variable keeping track of the previous updates in order to restore them. */
  3537       if (focusable.nodeName === 'A') {
  4496     const updates = [];
  3538         focusable.setAttribute('tabindex', '-1');
  4497     const disable = () => {
  3539       }
  4498       node.childNodes.forEach(child => {
  3540 
  4499         if (!(child instanceof defaultView.HTMLElement)) {
  3541       const tabIndex = focusable.getAttribute('tabindex');
  4500           return;
  3542 
  4501         }
  3543       if (tabIndex !== null && tabIndex !== '-1') {
  4502         if (!child.getAttribute('inert')) {
  3544         focusable.removeAttribute('tabindex');
  4503           child.setAttribute('inert', 'true');
  3545       }
  4504           updates.push(() => {
  3546 
  4505             child.removeAttribute('inert');
  3547       if (focusable.hasAttribute('contenteditable')) {
  4506           });
  3548         focusable.setAttribute('contenteditable', 'false');
  4507         }
  3549       }
  4508       });
       
  4509     };
       
  4510 
       
  4511     // Debounce re-disable since disabling process itself will incur
       
  4512     // additional mutations which should be ignored.
       
  4513     const debouncedDisable = debounce(disable, 0, {
       
  4514       leading: true
  3550     });
  4515     });
  3551   }; // Debounce re-disable since disabling process itself will incur
       
  3552   // additional mutations which should be ignored.
       
  3553 
       
  3554 
       
  3555   const debouncedDisable = (0,external_wp_element_namespaceObject.useCallback)((0,external_lodash_namespaceObject.debounce)(disable, undefined, {
       
  3556     leading: true
       
  3557   }), []);
       
  3558   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
       
  3559     disable();
  4516     disable();
       
  4517 
  3560     /** @type {MutationObserver | undefined} */
  4518     /** @type {MutationObserver | undefined} */
  3561 
  4519     const observer = new window.MutationObserver(debouncedDisable);
  3562     let observer;
  4520     observer.observe(node, {
  3563 
  4521       childList: true
  3564     if (node.current) {
  4522     });
  3565       observer = new window.MutationObserver(debouncedDisable);
       
  3566       observer.observe(node.current, {
       
  3567         childList: true,
       
  3568         attributes: true,
       
  3569         subtree: true
       
  3570       });
       
  3571     }
       
  3572 
       
  3573     return () => {
  4523     return () => {
  3574       if (observer) {
  4524       if (observer) {
  3575         observer.disconnect();
  4525         observer.disconnect();
  3576       }
  4526       }
  3577 
       
  3578       debouncedDisable.cancel();
  4527       debouncedDisable.cancel();
       
  4528       updates.forEach(update => update());
  3579     };
  4529     };
  3580   }, []);
  4530   }, [isDisabledProp]);
  3581   return node;
       
  3582 }
  4531 }
  3583 
  4532 
  3584 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-isomorphic-layout-effect/index.js
  4533 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-isomorphic-layout-effect/index.js
  3585 /**
  4534 /**
  3586  * WordPress dependencies
  4535  * WordPress dependencies
  3587  */
  4536  */
       
  4537 
  3588 
  4538 
  3589 /**
  4539 /**
  3590  * Preferred over direct usage of `useLayoutEffect` when supporting
  4540  * Preferred over direct usage of `useLayoutEffect` when supporting
  3591  * server rendered components (SSR) because currently React
  4541  * server rendered components (SSR) because currently React
  3592  * throws a warning when using useLayoutEffect in that environment.
  4542  * throws a warning when using useLayoutEffect in that environment.
  3593  */
  4543  */
  3594 
       
  3595 const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_wp_element_namespaceObject.useLayoutEffect : external_wp_element_namespaceObject.useEffect;
  4544 const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external_wp_element_namespaceObject.useLayoutEffect : external_wp_element_namespaceObject.useEffect;
  3596 /* harmony default export */ var use_isomorphic_layout_effect = (useIsomorphicLayoutEffect);
  4545 /* harmony default export */ const use_isomorphic_layout_effect = (useIsomorphicLayoutEffect);
  3597 
  4546 
  3598 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-dragging/index.js
  4547 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-dragging/index.js
  3599 /**
  4548 /**
  3600  * WordPress dependencies
  4549  * WordPress dependencies
  3601  */
  4550  */
  3602 
  4551 
       
  4552 
  3603 /**
  4553 /**
  3604  * Internal dependencies
  4554  * Internal dependencies
  3605  */
  4555  */
  3606 
  4556 
  3607 
  4557 
  3608 /**
  4558 // Event handlers that are triggered from `document` listeners accept a MouseEvent,
  3609  * @param {Object}                  props
  4559 // while those triggered from React listeners accept a React.MouseEvent.
  3610  * @param {(e: MouseEvent) => void} props.onDragStart
  4560 /**
  3611  * @param {(e: MouseEvent) => void} props.onDragMove
  4561  * @param {Object}                                  props
  3612  * @param {(e: MouseEvent) => void} props.onDragEnd
  4562  * @param {(e: import('react').MouseEvent) => void} props.onDragStart
  3613  */
  4563  * @param {(e: MouseEvent) => void}                 props.onDragMove
  3614 
  4564  * @param {(e?: MouseEvent) => void}                props.onDragEnd
  3615 function useDragging(_ref) {
  4565  */
  3616   let {
  4566 function useDragging({
  3617     onDragStart,
  4567   onDragStart,
  3618     onDragMove,
  4568   onDragMove,
  3619     onDragEnd
  4569   onDragEnd
  3620   } = _ref;
  4570 }) {
  3621   const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
  4571   const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false);
  3622   const eventsRef = (0,external_wp_element_namespaceObject.useRef)({
  4572   const eventsRef = (0,external_wp_element_namespaceObject.useRef)({
  3623     onDragStart,
  4573     onDragStart,
  3624     onDragMove,
  4574     onDragMove,
  3625     onDragEnd
  4575     onDragEnd
  3627   use_isomorphic_layout_effect(() => {
  4577   use_isomorphic_layout_effect(() => {
  3628     eventsRef.current.onDragStart = onDragStart;
  4578     eventsRef.current.onDragStart = onDragStart;
  3629     eventsRef.current.onDragMove = onDragMove;
  4579     eventsRef.current.onDragMove = onDragMove;
  3630     eventsRef.current.onDragEnd = onDragEnd;
  4580     eventsRef.current.onDragEnd = onDragEnd;
  3631   }, [onDragStart, onDragMove, onDragEnd]);
  4581   }, [onDragStart, onDragMove, onDragEnd]);
  3632   const onMouseMove = (0,external_wp_element_namespaceObject.useCallback)((
  4582 
  3633   /** @type {MouseEvent} */
  4583   /** @type {(e: MouseEvent) => void} */
  3634   event) => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event), []);
  4584   const onMouseMove = (0,external_wp_element_namespaceObject.useCallback)(event => eventsRef.current.onDragMove && eventsRef.current.onDragMove(event), []);
  3635   const endDrag = (0,external_wp_element_namespaceObject.useCallback)((
  4585   /** @type {(e?: MouseEvent) => void} */
  3636   /** @type {MouseEvent} */
  4586   const endDrag = (0,external_wp_element_namespaceObject.useCallback)(event => {
  3637   event) => {
       
  3638     if (eventsRef.current.onDragEnd) {
  4587     if (eventsRef.current.onDragEnd) {
  3639       eventsRef.current.onDragEnd(event);
  4588       eventsRef.current.onDragEnd(event);
  3640     }
  4589     }
  3641 
       
  3642     document.removeEventListener('mousemove', onMouseMove);
  4590     document.removeEventListener('mousemove', onMouseMove);
  3643     document.removeEventListener('mouseup', endDrag);
  4591     document.removeEventListener('mouseup', endDrag);
  3644     setIsDragging(false);
  4592     setIsDragging(false);
  3645   }, []);
  4593   }, []);
  3646   const startDrag = (0,external_wp_element_namespaceObject.useCallback)((
  4594   /** @type {(e: import('react').MouseEvent) => void} */
  3647   /** @type {MouseEvent} */
  4595   const startDrag = (0,external_wp_element_namespaceObject.useCallback)(event => {
  3648   event) => {
       
  3649     if (eventsRef.current.onDragStart) {
  4596     if (eventsRef.current.onDragStart) {
  3650       eventsRef.current.onDragStart(event);
  4597       eventsRef.current.onDragStart(event);
  3651     }
  4598     }
  3652 
       
  3653     document.addEventListener('mousemove', onMouseMove);
  4599     document.addEventListener('mousemove', onMouseMove);
  3654     document.addEventListener('mouseup', endDrag);
  4600     document.addEventListener('mouseup', endDrag);
  3655     setIsDragging(true);
  4601     setIsDragging(true);
  3656   }, []); // Remove the global events when unmounting if needed.
  4602   }, []);
  3657 
  4603 
       
  4604   // Remove the global events when unmounting if needed.
  3658   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4605   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3659     return () => {
  4606     return () => {
  3660       if (isDragging) {
  4607       if (isDragging) {
  3661         document.removeEventListener('mousemove', onMouseMove);
  4608         document.removeEventListener('mousemove', onMouseMove);
  3662         document.removeEventListener('mouseup', endDrag);
  4609         document.removeEventListener('mouseup', endDrag);
  3669     isDragging
  4616     isDragging
  3670   };
  4617   };
  3671 }
  4618 }
  3672 
  4619 
  3673 // EXTERNAL MODULE: ./node_modules/mousetrap/mousetrap.js
  4620 // EXTERNAL MODULE: ./node_modules/mousetrap/mousetrap.js
  3674 var mousetrap_mousetrap = __webpack_require__(7973);
  4621 var mousetrap_mousetrap = __webpack_require__(1933);
  3675 var mousetrap_default = /*#__PURE__*/__webpack_require__.n(mousetrap_mousetrap);
  4622 var mousetrap_default = /*#__PURE__*/__webpack_require__.n(mousetrap_mousetrap);
  3676 // EXTERNAL MODULE: ./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js
  4623 // EXTERNAL MODULE: ./node_modules/mousetrap/plugins/global-bind/mousetrap-global-bind.js
  3677 var mousetrap_global_bind = __webpack_require__(5538);
  4624 var mousetrap_global_bind = __webpack_require__(5760);
  3678 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-keyboard-shortcut/index.js
  4625 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-keyboard-shortcut/index.js
  3679 /**
  4626 /**
  3680  * External dependencies
  4627  * External dependencies
  3681  */
  4628  */
  3682 
  4629 
  3683 
  4630 
  3684 
  4631 
  3685 /**
  4632 /**
  3686  * WordPress dependencies
  4633  * WordPress dependencies
  3687  */
  4634  */
       
  4635 
  3688 
  4636 
  3689 
  4637 
  3690 /**
  4638 /**
  3691  * A block selection object.
  4639  * A block selection object.
  3692  *
  4640  *
  3696  * @property {string}                                 [eventName]  Event name used to trigger the handler, defaults to keydown.
  4644  * @property {string}                                 [eventName]  Event name used to trigger the handler, defaults to keydown.
  3697  * @property {boolean}                                [isDisabled] Disables the keyboard handler if the value is true.
  4645  * @property {boolean}                                [isDisabled] Disables the keyboard handler if the value is true.
  3698  * @property {import('react').RefObject<HTMLElement>} [target]     React reference to the DOM element used to catch the keyboard event.
  4646  * @property {import('react').RefObject<HTMLElement>} [target]     React reference to the DOM element used to catch the keyboard event.
  3699  */
  4647  */
  3700 
  4648 
  3701 /**
       
  3702  * Return true if platform is MacOS.
       
  3703  *
       
  3704  * @param {Window} [_window] window object by default; used for DI testing.
       
  3705  *
       
  3706  * @return {boolean} True if MacOS; false otherwise.
       
  3707  */
       
  3708 
       
  3709 function isAppleOS() {
       
  3710   let _window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
       
  3711 
       
  3712   const {
       
  3713     platform
       
  3714   } = _window.navigator;
       
  3715   return platform.indexOf('Mac') !== -1 || (0,external_lodash_namespaceObject.includes)(['iPad', 'iPhone'], platform);
       
  3716 }
       
  3717 /* eslint-disable jsdoc/valid-types */
  4649 /* eslint-disable jsdoc/valid-types */
  3718 
       
  3719 /**
  4650 /**
  3720  * Attach a keyboard shortcut handler.
  4651  * Attach a keyboard shortcut handler.
  3721  *
  4652  *
  3722  * @see https://craig.is/killing/mice#api.bind for information about the `callback` parameter.
  4653  * @see https://craig.is/killing/mice#api.bind for information about the `callback` parameter.
  3723  *
  4654  *
  3724  * @param {string[]|string}                                                       shortcuts Keyboard Shortcuts.
  4655  * @param {string[]|string}                                                       shortcuts Keyboard Shortcuts.
  3725  * @param {(e: import('mousetrap').ExtendedKeyboardEvent, combo: string) => void} callback  Shortcut callback.
  4656  * @param {(e: import('mousetrap').ExtendedKeyboardEvent, combo: string) => void} callback  Shortcut callback.
  3726  * @param {WPKeyboardShortcutConfig}                                              options   Shortcut options.
  4657  * @param {WPKeyboardShortcutConfig}                                              options   Shortcut options.
  3727  */
  4658  */
  3728 
  4659 function useKeyboardShortcut( /* eslint-enable jsdoc/valid-types */
  3729 
  4660 shortcuts, callback, {
  3730 function useKeyboardShortcut(
  4661   bindGlobal = false,
  3731 /* eslint-enable jsdoc/valid-types */
  4662   eventName = 'keydown',
  3732 shortcuts, callback) {
  4663   isDisabled = false,
  3733   let {
  4664   // This is important for performance considerations.
  3734     bindGlobal = false,
  4665   target
  3735     eventName = 'keydown',
  4666 } = {}) {
  3736     isDisabled = false,
       
  3737     // This is important for performance considerations.
       
  3738     target
       
  3739   } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
       
  3740   const currentCallback = (0,external_wp_element_namespaceObject.useRef)(callback);
  4667   const currentCallback = (0,external_wp_element_namespaceObject.useRef)(callback);
  3741   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4668   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3742     currentCallback.current = callback;
  4669     currentCallback.current = callback;
  3743   }, [callback]);
  4670   }, [callback]);
  3744   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4671   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3745     if (isDisabled) {
  4672     if (isDisabled) {
  3746       return;
  4673       return;
  3747     }
  4674     }
  3748 
  4675     const mousetrap = new (mousetrap_default())(target && target.current ? target.current :
  3749     const mousetrap = new (mousetrap_default())(target && target.current ? target.current : // We were passing `document` here previously, so to successfully cast it to Element we must cast it first to `unknown`.
  4676     // We were passing `document` here previously, so to successfully cast it to Element we must cast it first to `unknown`.
  3750     // Not sure if this is a mistake but it was the behavior previous to the addition of types so we're just doing what's
  4677     // Not sure if this is a mistake but it was the behavior previous to the addition of types so we're just doing what's
  3751     // necessary to maintain the existing behavior.
  4678     // necessary to maintain the existing behavior.
  3752 
  4679     /** @type {Element} */ /** @type {unknown} */
  3753     /** @type {Element} */
       
  3754 
       
  3755     /** @type {unknown} */
       
  3756     document);
  4680     document);
  3757     (0,external_lodash_namespaceObject.castArray)(shortcuts).forEach(shortcut => {
  4681     const shortcutsArray = Array.isArray(shortcuts) ? shortcuts : [shortcuts];
  3758       const keys = shortcut.split('+'); // Determines whether a key is a modifier by the length of the string.
  4682     shortcutsArray.forEach(shortcut => {
       
  4683       const keys = shortcut.split('+');
       
  4684       // Determines whether a key is a modifier by the length of the string.
  3759       // E.g. if I add a pass a shortcut Shift+Cmd+M, it'll determine that
  4685       // E.g. if I add a pass a shortcut Shift+Cmd+M, it'll determine that
  3760       // the modifiers are Shift and Cmd because they're not a single character.
  4686       // the modifiers are Shift and Cmd because they're not a single character.
  3761 
       
  3762       const modifiers = new Set(keys.filter(value => value.length > 1));
  4687       const modifiers = new Set(keys.filter(value => value.length > 1));
  3763       const hasAlt = modifiers.has('alt');
  4688       const hasAlt = modifiers.has('alt');
  3764       const hasShift = modifiers.has('shift'); // This should be better moved to the shortcut registration instead.
  4689       const hasShift = modifiers.has('shift');
  3765 
  4690 
  3766       if (isAppleOS() && (modifiers.size === 1 && hasAlt || modifiers.size === 2 && hasAlt && hasShift)) {
  4691       // This should be better moved to the shortcut registration instead.
       
  4692       if ((0,external_wp_keycodes_namespaceObject.isAppleOS)() && (modifiers.size === 1 && hasAlt || modifiers.size === 2 && hasAlt && hasShift)) {
  3767         throw new Error(`Cannot bind ${shortcut}. Alt and Shift+Alt modifiers are reserved for character input.`);
  4693         throw new Error(`Cannot bind ${shortcut}. Alt and Shift+Alt modifiers are reserved for character input.`);
  3768       }
  4694       }
  3769 
  4695       const bindFn = bindGlobal ? 'bindGlobal' : 'bind';
  3770       const bindFn = bindGlobal ? 'bindGlobal' : 'bind'; // @ts-ignore `bindGlobal` is an undocumented property
  4696       // @ts-ignore `bindGlobal` is an undocumented property
  3771 
  4697       mousetrap[bindFn](shortcut, ( /* eslint-disable jsdoc/valid-types */
  3772       mousetrap[bindFn](shortcut, function () {
  4698       /** @type {[e: import('mousetrap').ExtendedKeyboardEvent, combo: string]} */...args) => /* eslint-enable jsdoc/valid-types */
  3773         return (
  4699       currentCallback.current(...args), eventName);
  3774           /* eslint-enable jsdoc/valid-types */
       
  3775           currentCallback.current(...arguments)
       
  3776         );
       
  3777       }, eventName);
       
  3778     });
  4700     });
  3779     return () => {
  4701     return () => {
  3780       mousetrap.reset();
  4702       mousetrap.reset();
  3781     };
  4703     };
  3782   }, [shortcuts, bindGlobal, eventName, target, isDisabled]);
  4704   }, [shortcuts, bindGlobal, eventName, target, isDisabled]);
  3783 }
  4705 }
  3784 
  4706 /* harmony default export */ const use_keyboard_shortcut = (useKeyboardShortcut);
  3785 /* harmony default export */ var use_keyboard_shortcut = (useKeyboardShortcut);
       
  3786 
  4707 
  3787 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js
  4708 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-media-query/index.js
  3788 /**
  4709 /**
  3789  * WordPress dependencies
  4710  * WordPress dependencies
  3790  */
  4711  */
       
  4712 
       
  4713 const matchMediaCache = new Map();
       
  4714 
       
  4715 /**
       
  4716  * A new MediaQueryList object for the media query
       
  4717  *
       
  4718  * @param {string} [query] Media Query.
       
  4719  * @return {MediaQueryList|null} A new object for the media query
       
  4720  */
       
  4721 function getMediaQueryList(query) {
       
  4722   if (!query) {
       
  4723     return null;
       
  4724   }
       
  4725   let match = matchMediaCache.get(query);
       
  4726   if (match) {
       
  4727     return match;
       
  4728   }
       
  4729   if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
       
  4730     match = window.matchMedia(query);
       
  4731     matchMediaCache.set(query, match);
       
  4732     return match;
       
  4733   }
       
  4734   return null;
       
  4735 }
  3791 
  4736 
  3792 /**
  4737 /**
  3793  * Runs a media query and returns its value when it changes.
  4738  * Runs a media query and returns its value when it changes.
  3794  *
  4739  *
  3795  * @param {string} [query] Media Query.
  4740  * @param {string} [query] Media Query.
  3796  * @return {boolean} return value of the media query.
  4741  * @return {boolean} return value of the media query.
  3797  */
  4742  */
  3798 
       
  3799 function useMediaQuery(query) {
  4743 function useMediaQuery(query) {
  3800   const [match, setMatch] = (0,external_wp_element_namespaceObject.useState)(() => !!(query && typeof window !== 'undefined' && window.matchMedia(query).matches));
  4744   const source = (0,external_wp_element_namespaceObject.useMemo)(() => {
  3801   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4745     const mediaQueryList = getMediaQueryList(query);
  3802     if (!query) {
  4746     return {
  3803       return;
  4747       /** @type {(onStoreChange: () => void) => () => void} */
  3804     }
  4748       subscribe(onStoreChange) {
  3805 
  4749         if (!mediaQueryList) {
  3806     const updateMatch = () => setMatch(window.matchMedia(query).matches);
  4750           return () => {};
  3807 
  4751         }
  3808     updateMatch();
  4752 
  3809     const list = window.matchMedia(query);
  4753         // Avoid a fatal error when browsers don't support `addEventListener` on MediaQueryList.
  3810     list.addListener(updateMatch);
  4754         mediaQueryList.addEventListener?.('change', onStoreChange);
  3811     return () => {
  4755         return () => {
  3812       list.removeListener(updateMatch);
  4756           mediaQueryList.removeEventListener?.('change', onStoreChange);
       
  4757         };
       
  4758       },
       
  4759       getValue() {
       
  4760         var _mediaQueryList$match;
       
  4761         return (_mediaQueryList$match = mediaQueryList?.matches) !== null && _mediaQueryList$match !== void 0 ? _mediaQueryList$match : false;
       
  4762       }
  3813     };
  4763     };
  3814   }, [query]);
  4764   }, [query]);
  3815   return !!query && match;
  4765   return (0,external_wp_element_namespaceObject.useSyncExternalStore)(source.subscribe, source.getValue, () => false);
  3816 }
  4766 }
  3817 
  4767 
  3818 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js
  4768 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js
  3819 /**
  4769 /**
  3820  * WordPress dependencies
  4770  * WordPress dependencies
  3821  */
  4771  */
       
  4772 
  3822 
  4773 
  3823 /**
  4774 /**
  3824  * Use something's value from the previous render.
  4775  * Use something's value from the previous render.
  3825  * Based on https://usehooks.com/usePrevious/.
  4776  * Based on https://usehooks.com/usePrevious/.
  3826  *
  4777  *
  3827  * @param  value The value to track.
  4778  * @param value The value to track.
  3828  *
  4779  *
  3829  * @return The value from the previous render.
  4780  * @return The value from the previous render.
  3830  */
  4781  */
  3831 
       
  3832 function usePrevious(value) {
  4782 function usePrevious(value) {
  3833   const ref = (0,external_wp_element_namespaceObject.useRef)(); // Store current value in ref.
  4783   const ref = (0,external_wp_element_namespaceObject.useRef)();
  3834 
  4784 
       
  4785   // Store current value in ref.
  3835   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4786   (0,external_wp_element_namespaceObject.useEffect)(() => {
  3836     ref.current = value;
  4787     ref.current = value;
  3837   }, [value]); // Re-run when value changes.
  4788   }, [value]); // Re-run when value changes.
       
  4789 
  3838   // Return previous value (happens before update in useEffect above).
  4790   // Return previous value (happens before update in useEffect above).
  3839 
       
  3840   return ref.current;
  4791   return ref.current;
  3841 }
  4792 }
  3842 
  4793 
  3843 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
  4794 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-reduced-motion/index.js
  3844 /**
  4795 /**
  3845  * Internal dependencies
  4796  * Internal dependencies
  3846  */
  4797  */
  3847 
  4798 
       
  4799 
  3848 /**
  4800 /**
  3849  * Hook returning whether the user has a preference for reduced motion.
  4801  * Hook returning whether the user has a preference for reduced motion.
  3850  *
  4802  *
  3851  * @return {boolean} Reduced motion preference value.
  4803  * @return {boolean} Reduced motion preference value.
  3852  */
  4804  */
  3853 
       
  3854 const useReducedMotion = () => useMediaQuery('(prefers-reduced-motion: reduce)');
  4805 const useReducedMotion = () => useMediaQuery('(prefers-reduced-motion: reduce)');
  3855 
  4806 /* harmony default export */ const use_reduced_motion = (useReducedMotion);
  3856 /* harmony default export */ var use_reduced_motion = (useReducedMotion);
  4807 
       
  4808 // EXTERNAL MODULE: ./node_modules/@wordpress/undo-manager/build-module/index.js
       
  4809 var build_module = __webpack_require__(6689);
       
  4810 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-state-with-history/index.js
       
  4811 /**
       
  4812  * WordPress dependencies
       
  4813  */
       
  4814 
       
  4815 
       
  4816 function undoRedoReducer(state, action) {
       
  4817   switch (action.type) {
       
  4818     case 'UNDO':
       
  4819       {
       
  4820         const undoRecord = state.manager.undo();
       
  4821         if (undoRecord) {
       
  4822           return {
       
  4823             ...state,
       
  4824             value: undoRecord[0].changes.prop.from
       
  4825           };
       
  4826         }
       
  4827         return state;
       
  4828       }
       
  4829     case 'REDO':
       
  4830       {
       
  4831         const redoRecord = state.manager.redo();
       
  4832         if (redoRecord) {
       
  4833           return {
       
  4834             ...state,
       
  4835             value: redoRecord[0].changes.prop.to
       
  4836           };
       
  4837         }
       
  4838         return state;
       
  4839       }
       
  4840     case 'RECORD':
       
  4841       {
       
  4842         state.manager.addRecord([{
       
  4843           id: 'object',
       
  4844           changes: {
       
  4845             prop: {
       
  4846               from: state.value,
       
  4847               to: action.value
       
  4848             }
       
  4849           }
       
  4850         }], action.isStaged);
       
  4851         return {
       
  4852           ...state,
       
  4853           value: action.value
       
  4854         };
       
  4855       }
       
  4856   }
       
  4857   return state;
       
  4858 }
       
  4859 function initReducer(value) {
       
  4860   return {
       
  4861     manager: (0,build_module.createUndoManager)(),
       
  4862     value
       
  4863   };
       
  4864 }
       
  4865 
       
  4866 /**
       
  4867  * useState with undo/redo history.
       
  4868  *
       
  4869  * @param initialValue Initial value.
       
  4870  * @return Value, setValue, hasUndo, hasRedo, undo, redo.
       
  4871  */
       
  4872 function useStateWithHistory(initialValue) {
       
  4873   const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(undoRedoReducer, initialValue, initReducer);
       
  4874   return {
       
  4875     value: state.value,
       
  4876     setValue: (0,external_wp_element_namespaceObject.useCallback)((newValue, isStaged) => {
       
  4877       dispatch({
       
  4878         type: 'RECORD',
       
  4879         value: newValue,
       
  4880         isStaged
       
  4881       });
       
  4882     }, []),
       
  4883     hasUndo: state.manager.hasUndo(),
       
  4884     hasRedo: state.manager.hasRedo(),
       
  4885     undo: (0,external_wp_element_namespaceObject.useCallback)(() => {
       
  4886       dispatch({
       
  4887         type: 'UNDO'
       
  4888       });
       
  4889     }, []),
       
  4890     redo: (0,external_wp_element_namespaceObject.useCallback)(() => {
       
  4891       dispatch({
       
  4892         type: 'REDO'
       
  4893       });
       
  4894     }, [])
       
  4895   };
       
  4896 }
  3857 
  4897 
  3858 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-viewport-match/index.js
  4898 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-viewport-match/index.js
  3859 /**
  4899 /**
  3860  * WordPress dependencies
  4900  * WordPress dependencies
  3861  */
  4901  */
  3862 
  4902 
       
  4903 
  3863 /**
  4904 /**
  3864  * Internal dependencies
  4905  * Internal dependencies
  3865  */
  4906  */
  3866 
  4907 
  3867 
  4908 
  3874  *
  4915  *
  3875  * @see _breakpoints.scss
  4916  * @see _breakpoints.scss
  3876  *
  4917  *
  3877  * @type {Record<WPBreakpoint, number>}
  4918  * @type {Record<WPBreakpoint, number>}
  3878  */
  4919  */
  3879 
       
  3880 const BREAKPOINTS = {
  4920 const BREAKPOINTS = {
  3881   huge: 1440,
  4921   huge: 1440,
  3882   wide: 1280,
  4922   wide: 1280,
  3883   large: 960,
  4923   large: 960,
  3884   medium: 782,
  4924   medium: 782,
  3885   small: 600,
  4925   small: 600,
  3886   mobile: 480
  4926   mobile: 480
  3887 };
  4927 };
       
  4928 
  3888 /**
  4929 /**
  3889  * @typedef {">=" | "<"} WPViewportOperator
  4930  * @typedef {">=" | "<"} WPViewportOperator
  3890  */
  4931  */
  3891 
  4932 
  3892 /**
  4933 /**
  3893  * Object mapping media query operators to the condition to be used.
  4934  * Object mapping media query operators to the condition to be used.
  3894  *
  4935  *
  3895  * @type {Record<WPViewportOperator, string>}
  4936  * @type {Record<WPViewportOperator, string>}
  3896  */
  4937  */
  3897 
       
  3898 const CONDITIONS = {
  4938 const CONDITIONS = {
  3899   '>=': 'min-width',
  4939   '>=': 'min-width',
  3900   '<': 'max-width'
  4940   '<': 'max-width'
  3901 };
  4941 };
       
  4942 
  3902 /**
  4943 /**
  3903  * Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
  4944  * Object mapping media query operators to a function that given a breakpointValue and a width evaluates if the operator matches the values.
  3904  *
  4945  *
  3905  * @type {Record<WPViewportOperator, (breakpointValue: number, width: number) => boolean>}
  4946  * @type {Record<WPViewportOperator, (breakpointValue: number, width: number) => boolean>}
  3906  */
  4947  */
  3907 
       
  3908 const OPERATOR_EVALUATORS = {
  4948 const OPERATOR_EVALUATORS = {
  3909   '>=': (breakpointValue, width) => width >= breakpointValue,
  4949   '>=': (breakpointValue, width) => width >= breakpointValue,
  3910   '<': (breakpointValue, width) => width < breakpointValue
  4950   '<': (breakpointValue, width) => width < breakpointValue
  3911 };
  4951 };
  3912 const ViewportMatchWidthContext = (0,external_wp_element_namespaceObject.createContext)(
  4952 const ViewportMatchWidthContext = (0,external_wp_element_namespaceObject.createContext)( /** @type {null | number} */null);
  3913 /** @type {null | number} */
  4953 
  3914 null);
       
  3915 /**
  4954 /**
  3916  * Returns true if the viewport matches the given query, or false otherwise.
  4955  * Returns true if the viewport matches the given query, or false otherwise.
  3917  *
  4956  *
  3918  * @param {WPBreakpoint}       breakpoint      Breakpoint size name.
  4957  * @param {WPBreakpoint}       breakpoint      Breakpoint size name.
  3919  * @param {WPViewportOperator} [operator=">="] Viewport operator.
  4958  * @param {WPViewportOperator} [operator=">="] Viewport operator.
  3925  * useViewportMatch( 'medium' );
  4964  * useViewportMatch( 'medium' );
  3926  * ```
  4965  * ```
  3927  *
  4966  *
  3928  * @return {boolean} Whether viewport matches query.
  4967  * @return {boolean} Whether viewport matches query.
  3929  */
  4968  */
  3930 
  4969 const useViewportMatch = (breakpoint, operator = '>=') => {
  3931 const useViewportMatch = function (breakpoint) {
       
  3932   let operator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '>=';
       
  3933   const simulatedWidth = (0,external_wp_element_namespaceObject.useContext)(ViewportMatchWidthContext);
  4970   const simulatedWidth = (0,external_wp_element_namespaceObject.useContext)(ViewportMatchWidthContext);
  3934   const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint]}px)`;
  4971   const mediaQuery = !simulatedWidth && `(${CONDITIONS[operator]}: ${BREAKPOINTS[breakpoint]}px)`;
  3935   const mediaQueryResult = useMediaQuery(mediaQuery || undefined);
  4972   const mediaQueryResult = useMediaQuery(mediaQuery || undefined);
  3936 
       
  3937   if (simulatedWidth) {
  4973   if (simulatedWidth) {
  3938     return OPERATOR_EVALUATORS[operator](BREAKPOINTS[breakpoint], simulatedWidth);
  4974     return OPERATOR_EVALUATORS[operator](BREAKPOINTS[breakpoint], simulatedWidth);
  3939   }
  4975   }
  3940 
       
  3941   return mediaQueryResult;
  4976   return mediaQueryResult;
  3942 };
  4977 };
  3943 
       
  3944 useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
  4978 useViewportMatch.__experimentalWidthProvider = ViewportMatchWidthContext.Provider;
  3945 /* harmony default export */ var use_viewport_match = (useViewportMatch);
  4979 /* harmony default export */ const use_viewport_match = (useViewportMatch);
  3946 
  4980 
  3947 // EXTERNAL MODULE: ./node_modules/react-resize-aware/dist/index.js
       
  3948 var dist = __webpack_require__(235);
       
  3949 var dist_default = /*#__PURE__*/__webpack_require__.n(dist);
       
  3950 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
  4981 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-resize-observer/index.js
  3951 /**
  4982 /**
  3952  * External dependencies
  4983  * External dependencies
  3953  */
  4984  */
  3954 
  4985 
  3955 /**
  4986 /**
       
  4987  * WordPress dependencies
       
  4988  */
       
  4989 
       
  4990 
       
  4991 // This of course could've been more streamlined with internal state instead of
       
  4992 // refs, but then host hooks / components could not opt out of renders.
       
  4993 // This could've been exported to its own module, but the current build doesn't
       
  4994 // seem to work with module imports and I had no more time to spend on this...
       
  4995 function useResolvedElement(subscriber, refOrElement) {
       
  4996   const callbackRefElement = (0,external_wp_element_namespaceObject.useRef)(null);
       
  4997   const lastReportRef = (0,external_wp_element_namespaceObject.useRef)(null);
       
  4998   const cleanupRef = (0,external_wp_element_namespaceObject.useRef)();
       
  4999   const callSubscriber = (0,external_wp_element_namespaceObject.useCallback)(() => {
       
  5000     let element = null;
       
  5001     if (callbackRefElement.current) {
       
  5002       element = callbackRefElement.current;
       
  5003     } else if (refOrElement) {
       
  5004       if (refOrElement instanceof HTMLElement) {
       
  5005         element = refOrElement;
       
  5006       } else {
       
  5007         element = refOrElement.current;
       
  5008       }
       
  5009     }
       
  5010     if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.reporter === callSubscriber) {
       
  5011       return;
       
  5012     }
       
  5013     if (cleanupRef.current) {
       
  5014       cleanupRef.current();
       
  5015       // Making sure the cleanup is not called accidentally multiple times.
       
  5016       cleanupRef.current = null;
       
  5017     }
       
  5018     lastReportRef.current = {
       
  5019       reporter: callSubscriber,
       
  5020       element
       
  5021     };
       
  5022 
       
  5023     // Only calling the subscriber, if there's an actual element to report.
       
  5024     if (element) {
       
  5025       cleanupRef.current = subscriber(element);
       
  5026     }
       
  5027   }, [refOrElement, subscriber]);
       
  5028 
       
  5029   // On each render, we check whether a ref changed, or if we got a new raw
       
  5030   // element.
       
  5031   (0,external_wp_element_namespaceObject.useEffect)(() => {
       
  5032     // With this we're *technically* supporting cases where ref objects' current value changes, but only if there's a
       
  5033     // render accompanying that change as well.
       
  5034     // To guarantee we always have the right element, one must use the ref callback provided instead, but we support
       
  5035     // RefObjects to make the hook API more convenient in certain cases.
       
  5036     callSubscriber();
       
  5037   }, [callSubscriber]);
       
  5038   return (0,external_wp_element_namespaceObject.useCallback)(element => {
       
  5039     callbackRefElement.current = element;
       
  5040     callSubscriber();
       
  5041   }, [callSubscriber]);
       
  5042 }
       
  5043 
       
  5044 // Declaring my own type here instead of using the one provided by TS (available since 4.2.2), because this way I'm not
       
  5045 // forcing consumers to use a specific TS version.
       
  5046 
       
  5047 // We're only using the first element of the size sequences, until future versions of the spec solidify on how
       
  5048 // exactly it'll be used for fragments in multi-column scenarios:
       
  5049 // From the spec:
       
  5050 // > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,
       
  5051 // > which occur in multi-column scenarios. However the current definitions of content rect and border box do not
       
  5052 // > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single
       
  5053 // > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.
       
  5054 // > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.
       
  5055 // (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)
       
  5056 //
       
  5057 // Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,
       
  5058 // regardless of the "box" option.
       
  5059 // The spec states the following on this:
       
  5060 // > This does not have any impact on which box dimensions are returned to the defined callback when the event
       
  5061 // > is fired, it solely defines which box the author wishes to observe layout changes on.
       
  5062 // (https://drafts.csswg.org/resize-observer/#resize-observer-interface)
       
  5063 // I'm not exactly clear on what this means, especially when you consider a later section stating the following:
       
  5064 // > This section is non-normative. An author may desire to observe more than one CSS box.
       
  5065 // > In this case, author will need to use multiple ResizeObservers.
       
  5066 // (https://drafts.csswg.org/resize-observer/#resize-observer-interface)
       
  5067 // Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.
       
  5068 // For this reason I decided to only return the requested size,
       
  5069 // even though it seems we have access to results for all box types.
       
  5070 // This also means that we get to keep the current api, being able to return a simple { width, height } pair,
       
  5071 // regardless of box option.
       
  5072 const extractSize = (entry, boxProp, sizeType) => {
       
  5073   if (!entry[boxProp]) {
       
  5074     if (boxProp === 'contentBoxSize') {
       
  5075       // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.
       
  5076       // See the 6th step in the description for the RO algorithm:
       
  5077       // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h
       
  5078       // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of "content-box".
       
  5079       // In real browser implementations of course these objects differ, but the width/height values should be equivalent.
       
  5080       return entry.contentRect[sizeType === 'inlineSize' ? 'width' : 'height'];
       
  5081     }
       
  5082     return undefined;
       
  5083   }
       
  5084 
       
  5085   // A couple bytes smaller than calling Array.isArray() and just as effective here.
       
  5086   return entry[boxProp][0] ? entry[boxProp][0][sizeType] :
       
  5087   // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current
       
  5088   // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.
       
  5089   // @ts-ignore
       
  5090   entry[boxProp][sizeType];
       
  5091 };
       
  5092 function useResizeObserver(opts = {}) {
       
  5093   // Saving the callback as a ref. With this, I don't need to put onResize in the
       
  5094   // effect dep array, and just passing in an anonymous function without memoising
       
  5095   // will not reinstantiate the hook's ResizeObserver.
       
  5096   const onResize = opts.onResize;
       
  5097   const onResizeRef = (0,external_wp_element_namespaceObject.useRef)(undefined);
       
  5098   onResizeRef.current = onResize;
       
  5099   const round = opts.round || Math.round;
       
  5100 
       
  5101   // Using a single instance throughout the hook's lifetime
       
  5102   const resizeObserverRef = (0,external_wp_element_namespaceObject.useRef)();
       
  5103   const [size, setSize] = (0,external_wp_element_namespaceObject.useState)({
       
  5104     width: undefined,
       
  5105     height: undefined
       
  5106   });
       
  5107 
       
  5108   // In certain edge cases the RO might want to report a size change just after
       
  5109   // the component unmounted.
       
  5110   const didUnmount = (0,external_wp_element_namespaceObject.useRef)(false);
       
  5111   (0,external_wp_element_namespaceObject.useEffect)(() => {
       
  5112     didUnmount.current = false;
       
  5113     return () => {
       
  5114       didUnmount.current = true;
       
  5115     };
       
  5116   }, []);
       
  5117 
       
  5118   // Using a ref to track the previous width / height to avoid unnecessary renders.
       
  5119   const previous = (0,external_wp_element_namespaceObject.useRef)({
       
  5120     width: undefined,
       
  5121     height: undefined
       
  5122   });
       
  5123 
       
  5124   // This block is kinda like a useEffect, only it's called whenever a new
       
  5125   // element could be resolved based on the ref option. It also has a cleanup
       
  5126   // function.
       
  5127   const refCallback = useResolvedElement((0,external_wp_element_namespaceObject.useCallback)(element => {
       
  5128     // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.
       
  5129     // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.
       
  5130     if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {
       
  5131       resizeObserverRef.current = {
       
  5132         box: opts.box,
       
  5133         round,
       
  5134         instance: new ResizeObserver(entries => {
       
  5135           const entry = entries[0];
       
  5136           let boxProp = 'borderBoxSize';
       
  5137           if (opts.box === 'border-box') {
       
  5138             boxProp = 'borderBoxSize';
       
  5139           } else {
       
  5140             boxProp = opts.box === 'device-pixel-content-box' ? 'devicePixelContentBoxSize' : 'contentBoxSize';
       
  5141           }
       
  5142           const reportedWidth = extractSize(entry, boxProp, 'inlineSize');
       
  5143           const reportedHeight = extractSize(entry, boxProp, 'blockSize');
       
  5144           const newWidth = reportedWidth ? round(reportedWidth) : undefined;
       
  5145           const newHeight = reportedHeight ? round(reportedHeight) : undefined;
       
  5146           if (previous.current.width !== newWidth || previous.current.height !== newHeight) {
       
  5147             const newSize = {
       
  5148               width: newWidth,
       
  5149               height: newHeight
       
  5150             };
       
  5151             previous.current.width = newWidth;
       
  5152             previous.current.height = newHeight;
       
  5153             if (onResizeRef.current) {
       
  5154               onResizeRef.current(newSize);
       
  5155             } else if (!didUnmount.current) {
       
  5156               setSize(newSize);
       
  5157             }
       
  5158           }
       
  5159         })
       
  5160       };
       
  5161     }
       
  5162     resizeObserverRef.current.instance.observe(element, {
       
  5163       box: opts.box
       
  5164     });
       
  5165     return () => {
       
  5166       if (resizeObserverRef.current) {
       
  5167         resizeObserverRef.current.instance.unobserve(element);
       
  5168       }
       
  5169     };
       
  5170   }, [opts.box, round]), opts.ref);
       
  5171   return (0,external_wp_element_namespaceObject.useMemo)(() => ({
       
  5172     ref: refCallback,
       
  5173     width: size.width,
       
  5174     height: size.height
       
  5175   }), [refCallback, size ? size.width : null, size ? size.height : null]);
       
  5176 }
       
  5177 
       
  5178 /**
  3956  * Hook which allows to listen the resize event of any target element when it changes sizes.
  5179  * Hook which allows to listen the resize event of any target element when it changes sizes.
  3957  * _Note: `useResizeObserver` will report `null` until after first render_
  5180  * _Note: `useResizeObserver` will report `null` until after first render.
  3958  *
       
  3959  * Simply a re-export of `react-resize-aware` so refer to its documentation <https://github.com/FezVrasta/react-resize-aware>
       
  3960  * for more details.
       
  3961  *
       
  3962  * @see https://github.com/FezVrasta/react-resize-aware
       
  3963  *
  5181  *
  3964  * @example
  5182  * @example
  3965  *
  5183  *
  3966  * ```js
  5184  * ```js
  3967  * const App = () => {
  5185  * const App = () => {
  3973  * 			Your content here
  5191  * 			Your content here
  3974  * 		</div>
  5192  * 		</div>
  3975  * 	);
  5193  * 	);
  3976  * };
  5194  * };
  3977  * ```
  5195  * ```
  3978  *
  5196  */
  3979  */
  5197 function useResizeAware() {
  3980 
  5198   const {
  3981 /* harmony default export */ var use_resize_observer = ((dist_default()));
  5199     ref,
       
  5200     width,
       
  5201     height
       
  5202   } = useResizeObserver();
       
  5203   const sizes = (0,external_wp_element_namespaceObject.useMemo)(() => {
       
  5204     return {
       
  5205       width: width !== null && width !== void 0 ? width : null,
       
  5206       height: height !== null && height !== void 0 ? height : null
       
  5207     };
       
  5208   }, [width, height]);
       
  5209   const resizeListener = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
       
  5210     style: {
       
  5211       position: 'absolute',
       
  5212       top: 0,
       
  5213       left: 0,
       
  5214       right: 0,
       
  5215       bottom: 0,
       
  5216       pointerEvents: 'none',
       
  5217       opacity: 0,
       
  5218       overflow: 'hidden',
       
  5219       zIndex: -1
       
  5220     },
       
  5221     "aria-hidden": "true",
       
  5222     ref: ref
       
  5223   });
       
  5224   return [resizeListener, sizes];
       
  5225 }
  3982 
  5226 
  3983 ;// CONCATENATED MODULE: external ["wp","priorityQueue"]
  5227 ;// CONCATENATED MODULE: external ["wp","priorityQueue"]
  3984 var external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
  5228 const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"];
  3985 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-async-list/index.js
  5229 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-async-list/index.js
  3986 /**
  5230 /**
  3987  * WordPress dependencies
  5231  * WordPress dependencies
  3988  */
  5232  */
  3989 
  5233 
  3990 
  5234 
  3991 
       
  3992 /**
  5235 /**
  3993  * Returns the first items from list that are present on state.
  5236  * Returns the first items from list that are present on state.
  3994  *
  5237  *
  3995  * @param  list  New array.
  5238  * @param list  New array.
  3996  * @param  state Current state.
  5239  * @param state Current state.
  3997  * @return First items present iin state.
  5240  * @return First items present iin state.
  3998  */
  5241  */
  3999 function getFirstItemsPresentInState(list, state) {
  5242 function getFirstItemsPresentInState(list, state) {
  4000   const firstItems = [];
  5243   const firstItems = [];
  4001 
       
  4002   for (let i = 0; i < list.length; i++) {
  5244   for (let i = 0; i < list.length; i++) {
  4003     const item = list[i];
  5245     const item = list[i];
  4004 
       
  4005     if (!state.includes(item)) {
  5246     if (!state.includes(item)) {
  4006       break;
  5247       break;
  4007     }
  5248     }
  4008 
       
  4009     firstItems.push(item);
  5249     firstItems.push(item);
  4010   }
  5250   }
  4011 
       
  4012   return firstItems;
  5251   return firstItems;
  4013 }
  5252 }
       
  5253 
  4014 /**
  5254 /**
  4015  * React hook returns an array which items get asynchronously appended from a source array.
  5255  * React hook returns an array which items get asynchronously appended from a source array.
  4016  * This behavior is useful if we want to render a list of items asynchronously for performance reasons.
  5256  * This behavior is useful if we want to render a list of items asynchronously for performance reasons.
  4017  *
  5257  *
  4018  * @param  list   Source array.
  5258  * @param list   Source array.
  4019  * @param  config Configuration object.
  5259  * @param config Configuration object.
  4020  *
  5260  *
  4021  * @return Async array.
  5261  * @return Async array.
  4022  */
  5262  */
  4023 
  5263 function useAsyncList(list, config = {
  4024 
  5264   step: 1
  4025 function useAsyncList(list) {
  5265 }) {
  4026   let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
       
  4027     step: 1
       
  4028   };
       
  4029   const {
  5266   const {
  4030     step = 1
  5267     step = 1
  4031   } = config;
  5268   } = config;
  4032   const [current, setCurrent] = (0,external_wp_element_namespaceObject.useState)([]);
  5269   const [current, setCurrent] = (0,external_wp_element_namespaceObject.useState)([]);
  4033   (0,external_wp_element_namespaceObject.useEffect)(() => {
  5270   (0,external_wp_element_namespaceObject.useEffect)(() => {
  4034     // On reset, we keep the first items that were previously rendered.
  5271     // On reset, we keep the first items that were previously rendered.
  4035     let firstItems = getFirstItemsPresentInState(list, current);
  5272     let firstItems = getFirstItemsPresentInState(list, current);
  4036 
       
  4037     if (firstItems.length < step) {
  5273     if (firstItems.length < step) {
  4038       firstItems = firstItems.concat(list.slice(firstItems.length, step));
  5274       firstItems = firstItems.concat(list.slice(firstItems.length, step));
  4039     }
  5275     }
  4040 
       
  4041     setCurrent(firstItems);
  5276     setCurrent(firstItems);
  4042     let nextIndex = firstItems.length;
       
  4043     const asyncQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
  5277     const asyncQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)();
  4044 
  5278     for (let i = firstItems.length; i < list.length; i += step) {
  4045     const append = () => {
  5279       asyncQueue.add({}, () => {
  4046       if (list.length <= nextIndex) {
  5280         (0,external_wp_element_namespaceObject.flushSync)(() => {
  4047         return;
  5281           setCurrent(state => [...state, ...list.slice(i, i + step)]);
  4048       }
  5282         });
  4049 
  5283       });
  4050       setCurrent(state => [...state, ...list.slice(nextIndex, nextIndex + step)]);
  5284     }
  4051       nextIndex += step;
       
  4052       asyncQueue.add({}, append);
       
  4053     };
       
  4054 
       
  4055     asyncQueue.add({}, append);
       
  4056     return () => asyncQueue.reset();
  5285     return () => asyncQueue.reset();
  4057   }, [list]);
  5286   }, [list]);
  4058   return current;
  5287   return current;
  4059 }
  5288 }
  4060 
  5289 /* harmony default export */ const use_async_list = (useAsyncList);
  4061 /* harmony default export */ var use_async_list = (useAsyncList);
       
  4062 
  5290 
  4063 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-warn-on-change/index.js
  5291 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-warn-on-change/index.js
  4064 /**
  5292 /**
  4065  * Internal dependencies
  5293  * Internal dependencies
  4066  */
  5294  */
  4067  // Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case
  5295 
       
  5296 
       
  5297 // Disable reason: Object and object are distinctly different types in TypeScript and we mean the lowercase object in thise case
  4068 // but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript
  5298 // but eslint wants to force us to use `Object`. See https://stackoverflow.com/questions/49464634/difference-between-object-and-object-in-typescript
  4069 
       
  4070 /* eslint-disable jsdoc/check-types */
  5299 /* eslint-disable jsdoc/check-types */
  4071 
       
  4072 /**
  5300 /**
  4073  * Hook that performs a shallow comparison between the preview value of an object
  5301  * Hook that performs a shallow comparison between the preview value of an object
  4074  * and the new one, if there's a difference, it prints it to the console.
  5302  * and the new one, if there's a difference, it prints it to the console.
  4075  * this is useful in performance related work, to check why a component re-renders.
  5303  * this is useful in performance related work, to check why a component re-renders.
  4076  *
  5304  *
  4085  * ```
  5313  * ```
  4086  *
  5314  *
  4087  * @param {object} object Object which changes to compare.
  5315  * @param {object} object Object which changes to compare.
  4088  * @param {string} prefix Just a prefix to show when console logging.
  5316  * @param {string} prefix Just a prefix to show when console logging.
  4089  */
  5317  */
  4090 
  5318 function useWarnOnChange(object, prefix = 'Change detection') {
  4091 function useWarnOnChange(object) {
       
  4092   let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'Change detection';
       
  4093   const previousValues = usePrevious(object);
  5319   const previousValues = usePrevious(object);
  4094   Object.entries(previousValues !== null && previousValues !== void 0 ? previousValues : []).forEach(_ref => {
  5320   Object.entries(previousValues !== null && previousValues !== void 0 ? previousValues : []).forEach(([key, value]) => {
  4095     let [key, value] = _ref;
  5321     if (value !== object[( /** @type {keyof typeof object} */key)]) {
  4096 
       
  4097     if (value !== object[
       
  4098     /** @type {keyof typeof object} */
       
  4099     key]) {
       
  4100       // eslint-disable-next-line no-console
  5322       // eslint-disable-next-line no-console
  4101       console.warn(`${prefix}: ${key} key changed:`, value, object[
  5323       console.warn(`${prefix}: ${key} key changed:`, value, object[( /** @type {keyof typeof object} */key)]
  4102       /** @type {keyof typeof object} */
  5324       /* eslint-enable jsdoc/check-types */);
  4103       key]
       
  4104       /* eslint-enable jsdoc/check-types */
       
  4105       );
       
  4106     }
  5325     }
  4107   });
  5326   });
  4108 }
  5327 }
  4109 
  5328 /* harmony default export */ const use_warn_on_change = (useWarnOnChange);
  4110 /* harmony default export */ var use_warn_on_change = (useWarnOnChange);
  5329 
  4111 
  5330 ;// CONCATENATED MODULE: external "React"
  4112 // EXTERNAL MODULE: external "React"
  5331 const external_React_namespaceObject = window["React"];
  4113 var external_React_ = __webpack_require__(9196);
       
  4114 ;// CONCATENATED MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
  5332 ;// CONCATENATED MODULE: ./node_modules/use-memo-one/dist/use-memo-one.esm.js
  4115 
  5333 
  4116 
  5334 
  4117 function areInputsEqual(newInputs, lastInputs) {
  5335 function areInputsEqual(newInputs, lastInputs) {
  4118   if (newInputs.length !== lastInputs.length) {
  5336   if (newInputs.length !== lastInputs.length) {
  4127 
  5345 
  4128   return true;
  5346   return true;
  4129 }
  5347 }
  4130 
  5348 
  4131 function useMemoOne(getResult, inputs) {
  5349 function useMemoOne(getResult, inputs) {
  4132   var initial = (0,external_React_.useState)(function () {
  5350   var initial = (0,external_React_namespaceObject.useState)(function () {
  4133     return {
  5351     return {
  4134       inputs: inputs,
  5352       inputs: inputs,
  4135       result: getResult()
  5353       result: getResult()
  4136     };
  5354     };
  4137   })[0];
  5355   })[0];
  4138   var isFirstRun = (0,external_React_.useRef)(true);
  5356   var isFirstRun = (0,external_React_namespaceObject.useRef)(true);
  4139   var committed = (0,external_React_.useRef)(initial);
  5357   var committed = (0,external_React_namespaceObject.useRef)(initial);
  4140   var useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
  5358   var useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
  4141   var cache = useCache ? committed.current : {
  5359   var cache = useCache ? committed.current : {
  4142     inputs: inputs,
  5360     inputs: inputs,
  4143     result: getResult()
  5361     result: getResult()
  4144   };
  5362   };
  4145   (0,external_React_.useEffect)(function () {
  5363   (0,external_React_namespaceObject.useEffect)(function () {
  4146     isFirstRun.current = false;
  5364     isFirstRun.current = false;
  4147     committed.current = cache;
  5365     committed.current = cache;
  4148   }, [cache]);
  5366   }, [cache]);
  4149   return cache.result;
  5367   return cache.result;
  4150 }
  5368 }
  4167 /**
  5385 /**
  4168  * WordPress dependencies
  5386  * WordPress dependencies
  4169  */
  5387  */
  4170 
  5388 
  4171 
  5389 
  4172 /* eslint-disable jsdoc/valid-types */
  5390 /**
  4173 
  5391  * Internal dependencies
  4174 /**
  5392  */
  4175  * Debounces a function with Lodash's `debounce`. A new debounced function will
  5393 
       
  5394 
       
  5395 /**
       
  5396  * Debounces a function similar to Lodash's `debounce`. A new debounced function will
  4176  * be returned and any scheduled calls cancelled if any of the arguments change,
  5397  * be returned and any scheduled calls cancelled if any of the arguments change,
  4177  * including the function to debounce, so please wrap functions created on
  5398  * including the function to debounce, so please wrap functions created on
  4178  * render in components in `useCallback`.
  5399  * render in components in `useCallback`.
  4179  *
  5400  *
  4180  * @see https://docs-lodash.com/v4/debounce/
  5401  * @see https://lodash.com/docs/4#debounce
  4181  *
  5402  *
  4182  * @template {(...args: any[]) => void} TFunc
  5403  * @template {(...args: any[]) => void} TFunc
  4183  *
  5404  *
  4184  * @param {TFunc}                             fn        The function to debounce.
  5405  * @param {TFunc}                                          fn        The function to debounce.
  4185  * @param {number}                            [wait]    The number of milliseconds to delay.
  5406  * @param {number}                                         [wait]    The number of milliseconds to delay.
  4186  * @param {import('lodash').DebounceSettings} [options] The options object.
  5407  * @param {import('../../utils/debounce').DebounceOptions} [options] The options object.
  4187  * @return {import('lodash').DebouncedFunc<TFunc>} Debounced function.
  5408  * @return {import('../../utils/debounce').DebouncedFunc<TFunc>} Debounced function.
  4188  */
  5409  */
  4189 
       
  4190 function useDebounce(fn, wait, options) {
  5410 function useDebounce(fn, wait, options) {
  4191   /* eslint-enable jsdoc/valid-types */
  5411   const debounced = useMemoOne(() => debounce(fn, wait !== null && wait !== void 0 ? wait : 0, options), [fn, wait, options]);
  4192   const debounced = useMemoOne(() => (0,external_lodash_namespaceObject.debounce)(fn, wait, options), [fn, wait, options]);
       
  4193   (0,external_wp_element_namespaceObject.useEffect)(() => () => debounced.cancel(), [debounced]);
  5412   (0,external_wp_element_namespaceObject.useEffect)(() => () => debounced.cancel(), [debounced]);
  4194   return debounced;
  5413   return debounced;
  4195 }
  5414 }
  4196 
  5415 
       
  5416 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-debounced-input/index.js
       
  5417 /**
       
  5418  * WordPress dependencies
       
  5419  */
       
  5420 
       
  5421 
       
  5422 /**
       
  5423  * Internal dependencies
       
  5424  */
       
  5425 
       
  5426 
       
  5427 /**
       
  5428  * Helper hook for input fields that need to debounce the value before using it.
       
  5429  *
       
  5430  * @param defaultValue The default value to use.
       
  5431  * @return The input value, the setter and the debounced input value.
       
  5432  */
       
  5433 function useDebouncedInput(defaultValue = '') {
       
  5434   const [input, setInput] = (0,external_wp_element_namespaceObject.useState)(defaultValue);
       
  5435   const [debouncedInput, setDebouncedState] = (0,external_wp_element_namespaceObject.useState)(defaultValue);
       
  5436   const setDebouncedInput = useDebounce(setDebouncedState, 250);
       
  5437   (0,external_wp_element_namespaceObject.useEffect)(() => {
       
  5438     setDebouncedInput(input);
       
  5439   }, [input, setDebouncedInput]);
       
  5440   return [input, setInput, debouncedInput];
       
  5441 }
       
  5442 
  4197 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js
  5443 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js
  4198 /**
  5444 /**
  4199  * External dependencies
  5445  * External dependencies
  4200  */
  5446  */
  4201 
  5447 
  4204  * WordPress dependencies
  5450  * WordPress dependencies
  4205  */
  5451  */
  4206 
  5452 
  4207 
  5453 
  4208 /**
  5454 /**
  4209  * Throttles a function with Lodash's `throttle`. A new throttled function will
  5455  * Internal dependencies
       
  5456  */
       
  5457 
       
  5458 
       
  5459 /**
       
  5460  * Throttles a function similar to Lodash's `throttle`. A new throttled function will
  4210  * be returned and any scheduled calls cancelled if any of the arguments change,
  5461  * be returned and any scheduled calls cancelled if any of the arguments change,
  4211  * including the function to throttle, so please wrap functions created on
  5462  * including the function to throttle, so please wrap functions created on
  4212  * render in components in `useCallback`.
  5463  * render in components in `useCallback`.
  4213  *
  5464  *
  4214  * @see https://docs-lodash.com/v4/throttle/
  5465  * @see https://lodash.com/docs/4#throttle
  4215  *
  5466  *
  4216  * @template {(...args: any[]) => void} TFunc
  5467  * @template {(...args: any[]) => void} TFunc
  4217  *
  5468  *
  4218  * @param {TFunc}                             fn        The function to throttle.
  5469  * @param {TFunc}                                          fn        The function to throttle.
  4219  * @param {number}                            [wait]    The number of milliseconds to throttle invocations to.
  5470  * @param {number}                                         [wait]    The number of milliseconds to throttle invocations to.
  4220  * @param {import('lodash').ThrottleSettings} [options] The options object. See linked documentation for details.
  5471  * @param {import('../../utils/throttle').ThrottleOptions} [options] The options object. See linked documentation for details.
  4221  * @return {import('lodash').DebouncedFunc<TFunc>} Throttled function.
  5472  * @return {import('../../utils/debounce').DebouncedFunc<TFunc>} Throttled function.
  4222  */
  5473  */
  4223 
       
  4224 function useThrottle(fn, wait, options) {
  5474 function useThrottle(fn, wait, options) {
  4225   const throttled = useMemoOne(() => (0,external_lodash_namespaceObject.throttle)(fn, wait, options), [fn, wait, options]);
  5475   const throttled = useMemoOne(() => throttle(fn, wait !== null && wait !== void 0 ? wait : 0, options), [fn, wait, options]);
  4226   (0,external_wp_element_namespaceObject.useEffect)(() => () => throttled.cancel(), [throttled]);
  5476   (0,external_wp_element_namespaceObject.useEffect)(() => () => throttled.cancel(), [throttled]);
  4227   return throttled;
  5477   return throttled;
  4228 }
  5478 }
  4229 
  5479 
  4230 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-drop-zone/index.js
  5480 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-drop-zone/index.js
  4231 /**
  5481 /**
  4232  * WordPress dependencies
  5482  * WordPress dependencies
  4233  */
  5483  */
  4234 
  5484 
       
  5485 
  4235 /**
  5486 /**
  4236  * Internal dependencies
  5487  * Internal dependencies
  4237  */
  5488  */
  4238 
  5489 
  4239 
  5490 
  4240 /* eslint-disable jsdoc/valid-types */
  5491 /* eslint-disable jsdoc/valid-types */
  4241 
       
  4242 /**
  5492 /**
  4243  * @template T
  5493  * @template T
  4244  * @param {T} value
  5494  * @param {T} value
  4245  * @return {import('react').MutableRefObject<T|null>} A ref with the value.
  5495  * @return {import('react').MutableRefObject<T|null>} A ref with the value.
  4246  */
  5496  */
  4247 
       
  4248 function useFreshRef(value) {
  5497 function useFreshRef(value) {
  4249   /* eslint-enable jsdoc/valid-types */
  5498   /* eslint-enable jsdoc/valid-types */
  4250 
       
  4251   /* eslint-disable jsdoc/no-undefined-types */
  5499   /* eslint-disable jsdoc/no-undefined-types */
  4252 
       
  4253   /** @type {import('react').MutableRefObject<T>} */
  5500   /** @type {import('react').MutableRefObject<T>} */
  4254 
       
  4255   /* eslint-enable jsdoc/no-undefined-types */
  5501   /* eslint-enable jsdoc/no-undefined-types */
  4256   // Disable reason: We're doing something pretty JavaScript-y here where the
  5502   // Disable reason: We're doing something pretty JavaScript-y here where the
  4257   // ref will always have a current value that is not null or undefined but it
  5503   // ref will always have a current value that is not null or undefined but it
  4258   // needs to start as undefined. We don't want to change the return type so
  5504   // needs to start as undefined. We don't want to change the return type so
  4259   // it's easier to just ts-ignore this specific line that's complaining about
  5505   // it's easier to just ts-ignore this specific line that's complaining about
  4261   // @ts-ignore
  5507   // @ts-ignore
  4262   const ref = (0,external_wp_element_namespaceObject.useRef)();
  5508   const ref = (0,external_wp_element_namespaceObject.useRef)();
  4263   ref.current = value;
  5509   ref.current = value;
  4264   return ref;
  5510   return ref;
  4265 }
  5511 }
       
  5512 
  4266 /**
  5513 /**
  4267  * A hook to facilitate drag and drop handling.
  5514  * A hook to facilitate drag and drop handling.
  4268  *
  5515  *
  4269  * @param {Object}                  props             Named parameters.
  5516  * @param {Object}                  props                   Named parameters.
  4270  * @param {boolean}                 props.isDisabled  Whether or not to disable the drop zone.
  5517  * @param {?HTMLElement}            [props.dropZoneElement] Optional element to be used as the drop zone.
  4271  * @param {(e: DragEvent) => void}  props.onDragStart Called when dragging has started.
  5518  * @param {boolean}                 [props.isDisabled]      Whether or not to disable the drop zone.
  4272  * @param {(e: DragEvent) => void}  props.onDragEnter Called when the zone is entered.
  5519  * @param {(e: DragEvent) => void}  [props.onDragStart]     Called when dragging has started.
  4273  * @param {(e: DragEvent) => void}  props.onDragOver  Called when the zone is moved within.
  5520  * @param {(e: DragEvent) => void}  [props.onDragEnter]     Called when the zone is entered.
  4274  * @param {(e: DragEvent) => void}  props.onDragLeave Called when the zone is left.
  5521  * @param {(e: DragEvent) => void}  [props.onDragOver]      Called when the zone is moved within.
  4275  * @param {(e: MouseEvent) => void} props.onDragEnd   Called when dragging has ended.
  5522  * @param {(e: DragEvent) => void}  [props.onDragLeave]     Called when the zone is left.
  4276  * @param {(e: DragEvent) => void}  props.onDrop      Called when dropping in the zone.
  5523  * @param {(e: MouseEvent) => void} [props.onDragEnd]       Called when dragging has ended.
       
  5524  * @param {(e: DragEvent) => void}  [props.onDrop]          Called when dropping in the zone.
  4277  *
  5525  *
  4278  * @return {import('react').RefCallback<HTMLElement>} Ref callback to be passed to the drop zone element.
  5526  * @return {import('react').RefCallback<HTMLElement>} Ref callback to be passed to the drop zone element.
  4279  */
  5527  */
  4280 
  5528 function useDropZone({
  4281 
  5529   dropZoneElement,
  4282 function useDropZone(_ref) {
  5530   isDisabled,
  4283   let {
  5531   onDrop: _onDrop,
  4284     isDisabled,
  5532   onDragStart: _onDragStart,
  4285     onDrop: _onDrop,
  5533   onDragEnter: _onDragEnter,
  4286     onDragStart: _onDragStart,
  5534   onDragLeave: _onDragLeave,
  4287     onDragEnter: _onDragEnter,
  5535   onDragEnd: _onDragEnd,
  4288     onDragLeave: _onDragLeave,
  5536   onDragOver: _onDragOver
  4289     onDragEnd: _onDragEnd,
  5537 }) {
  4290     onDragOver: _onDragOver
       
  4291   } = _ref;
       
  4292   const onDropRef = useFreshRef(_onDrop);
  5538   const onDropRef = useFreshRef(_onDrop);
  4293   const onDragStartRef = useFreshRef(_onDragStart);
  5539   const onDragStartRef = useFreshRef(_onDragStart);
  4294   const onDragEnterRef = useFreshRef(_onDragEnter);
  5540   const onDragEnterRef = useFreshRef(_onDragEnter);
  4295   const onDragLeaveRef = useFreshRef(_onDragLeave);
  5541   const onDragLeaveRef = useFreshRef(_onDragLeave);
  4296   const onDragEndRef = useFreshRef(_onDragEnd);
  5542   const onDragEndRef = useFreshRef(_onDragEnd);
  4297   const onDragOverRef = useFreshRef(_onDragOver);
  5543   const onDragOverRef = useFreshRef(_onDragOver);
  4298   return useRefEffect(element => {
  5544   return useRefEffect(elem => {
  4299     if (isDisabled) {
  5545     if (isDisabled) {
  4300       return;
  5546       return;
  4301     }
  5547     }
  4302 
  5548 
       
  5549     // If a custom dropZoneRef is passed, use that instead of the element.
       
  5550     // This allows the dropzone to cover an expanded area, rather than
       
  5551     // be restricted to the area of the ref returned by this hook.
       
  5552     const element = dropZoneElement !== null && dropZoneElement !== void 0 ? dropZoneElement : elem;
  4303     let isDragging = false;
  5553     let isDragging = false;
  4304     const {
  5554     const {
  4305       ownerDocument
  5555       ownerDocument
  4306     } = element;
  5556     } = element;
       
  5557 
  4307     /**
  5558     /**
  4308      * Checks if an element is in the drop zone.
  5559      * Checks if an element is in the drop zone.
  4309      *
  5560      *
  4310      * @param {EventTarget|null} targetToCheck
  5561      * @param {EventTarget|null} targetToCheck
  4311      *
  5562      *
  4312      * @return {boolean} True if in drop zone, false if not.
  5563      * @return {boolean} True if in drop zone, false if not.
  4313      */
  5564      */
  4314 
       
  4315     function isElementInZone(targetToCheck) {
  5565     function isElementInZone(targetToCheck) {
  4316       const {
  5566       const {
  4317         defaultView
  5567         defaultView
  4318       } = ownerDocument;
  5568       } = ownerDocument;
  4319 
       
  4320       if (!targetToCheck || !defaultView || !(targetToCheck instanceof defaultView.HTMLElement) || !element.contains(targetToCheck)) {
  5569       if (!targetToCheck || !defaultView || !(targetToCheck instanceof defaultView.HTMLElement) || !element.contains(targetToCheck)) {
  4321         return false;
  5570         return false;
  4322       }
  5571       }
       
  5572 
  4323       /** @type {HTMLElement|null} */
  5573       /** @type {HTMLElement|null} */
  4324 
       
  4325 
       
  4326       let elementToCheck = targetToCheck;
  5574       let elementToCheck = targetToCheck;
  4327 
       
  4328       do {
  5575       do {
  4329         if (elementToCheck.dataset.isDropZone) {
  5576         if (elementToCheck.dataset.isDropZone) {
  4330           return elementToCheck === element;
  5577           return elementToCheck === element;
  4331         }
  5578         }
  4332       } while (elementToCheck = elementToCheck.parentElement);
  5579       } while (elementToCheck = elementToCheck.parentElement);
  4333 
       
  4334       return false;
  5580       return false;
  4335     }
  5581     }
  4336 
  5582     function maybeDragStart( /** @type {DragEvent} */event) {
  4337     function maybeDragStart(
       
  4338     /** @type {DragEvent} */
       
  4339     event) {
       
  4340       if (isDragging) {
  5583       if (isDragging) {
  4341         return;
  5584         return;
  4342       }
  5585       }
  4343 
       
  4344       isDragging = true;
  5586       isDragging = true;
  4345       ownerDocument.removeEventListener('dragenter', maybeDragStart); // Note that `dragend` doesn't fire consistently for file and
  5587 
       
  5588       // Note that `dragend` doesn't fire consistently for file and
  4346       // HTML drag events where the drag origin is outside the browser
  5589       // HTML drag events where the drag origin is outside the browser
  4347       // window. In Firefox it may also not fire if the originating
  5590       // window. In Firefox it may also not fire if the originating
  4348       // node is removed.
  5591       // node is removed.
  4349 
       
  4350       ownerDocument.addEventListener('dragend', maybeDragEnd);
  5592       ownerDocument.addEventListener('dragend', maybeDragEnd);
  4351       ownerDocument.addEventListener('mousemove', maybeDragEnd);
  5593       ownerDocument.addEventListener('mousemove', maybeDragEnd);
  4352 
       
  4353       if (onDragStartRef.current) {
  5594       if (onDragStartRef.current) {
  4354         onDragStartRef.current(event);
  5595         onDragStartRef.current(event);
  4355       }
  5596       }
  4356     }
  5597     }
  4357 
  5598     function onDragEnter( /** @type {DragEvent} */event) {
  4358     function onDragEnter(
  5599       event.preventDefault();
  4359     /** @type {DragEvent} */
  5600 
  4360     event) {
  5601       // The `dragenter` event will also fire when entering child
  4361       event.preventDefault(); // The `dragenter` event will also fire when entering child
       
  4362       // elements, but we only want to call `onDragEnter` when
  5602       // elements, but we only want to call `onDragEnter` when
  4363       // entering the drop zone, which means the `relatedTarget`
  5603       // entering the drop zone, which means the `relatedTarget`
  4364       // (element that has been left) should be outside the drop zone.
  5604       // (element that has been left) should be outside the drop zone.
  4365 
  5605       if (element.contains( /** @type {Node} */event.relatedTarget)) {
  4366       if (element.contains(
       
  4367       /** @type {Node} */
       
  4368       event.relatedTarget)) {
       
  4369         return;
  5606         return;
  4370       }
  5607       }
  4371 
       
  4372       if (onDragEnterRef.current) {
  5608       if (onDragEnterRef.current) {
  4373         onDragEnterRef.current(event);
  5609         onDragEnterRef.current(event);
  4374       }
  5610       }
  4375     }
  5611     }
  4376 
  5612     function onDragOver( /** @type {DragEvent} */event) {
  4377     function onDragOver(
       
  4378     /** @type {DragEvent} */
       
  4379     event) {
       
  4380       // Only call onDragOver for the innermost hovered drop zones.
  5613       // Only call onDragOver for the innermost hovered drop zones.
  4381       if (!event.defaultPrevented && onDragOverRef.current) {
  5614       if (!event.defaultPrevented && onDragOverRef.current) {
  4382         onDragOverRef.current(event);
  5615         onDragOverRef.current(event);
  4383       } // Prevent the browser default while also signalling to parent
  5616       }
       
  5617 
       
  5618       // Prevent the browser default while also signalling to parent
  4384       // drop zones that `onDragOver` is already handled.
  5619       // drop zones that `onDragOver` is already handled.
  4385 
       
  4386 
       
  4387       event.preventDefault();
  5620       event.preventDefault();
  4388     }
  5621     }
  4389 
  5622     function onDragLeave( /** @type {DragEvent} */event) {
  4390     function onDragLeave(
       
  4391     /** @type {DragEvent} */
       
  4392     event) {
       
  4393       // The `dragleave` event will also fire when leaving child
  5623       // The `dragleave` event will also fire when leaving child
  4394       // elements, but we only want to call `onDragLeave` when
  5624       // elements, but we only want to call `onDragLeave` when
  4395       // leaving the drop zone, which means the `relatedTarget`
  5625       // leaving the drop zone, which means the `relatedTarget`
  4396       // (element that has been entered) should be outside the drop
  5626       // (element that has been entered) should be outside the drop
  4397       // zone.
  5627       // zone.
       
  5628       // Note: This is not entirely reliable in Safari due to this bug
       
  5629       // https://bugs.webkit.org/show_bug.cgi?id=66547
  4398       if (isElementInZone(event.relatedTarget)) {
  5630       if (isElementInZone(event.relatedTarget)) {
  4399         return;
  5631         return;
  4400       }
  5632       }
  4401 
       
  4402       if (onDragLeaveRef.current) {
  5633       if (onDragLeaveRef.current) {
  4403         onDragLeaveRef.current(event);
  5634         onDragLeaveRef.current(event);
  4404       }
  5635       }
  4405     }
  5636     }
  4406 
  5637     function onDrop( /** @type {DragEvent} */event) {
  4407     function onDrop(
       
  4408     /** @type {DragEvent} */
       
  4409     event) {
       
  4410       // Don't handle drop if an inner drop zone already handled it.
  5638       // Don't handle drop if an inner drop zone already handled it.
  4411       if (event.defaultPrevented) {
  5639       if (event.defaultPrevented) {
  4412         return;
  5640         return;
  4413       } // Prevent the browser default while also signalling to parent
  5641       }
       
  5642 
       
  5643       // Prevent the browser default while also signalling to parent
  4414       // drop zones that `onDrop` is already handled.
  5644       // drop zones that `onDrop` is already handled.
  4415 
  5645       event.preventDefault();
  4416 
  5646 
  4417       event.preventDefault(); // This seemingly useless line has been shown to resolve a
  5647       // This seemingly useless line has been shown to resolve a
  4418       // Safari issue where files dragged directly from the dock are
  5648       // Safari issue where files dragged directly from the dock are
  4419       // not recognized.
  5649       // not recognized.
  4420       // eslint-disable-next-line no-unused-expressions
  5650       // eslint-disable-next-line no-unused-expressions
  4421 
       
  4422       event.dataTransfer && event.dataTransfer.files.length;
  5651       event.dataTransfer && event.dataTransfer.files.length;
  4423 
       
  4424       if (onDropRef.current) {
  5652       if (onDropRef.current) {
  4425         onDropRef.current(event);
  5653         onDropRef.current(event);
  4426       }
  5654       }
  4427 
       
  4428       maybeDragEnd(event);
  5655       maybeDragEnd(event);
  4429     }
  5656     }
  4430 
  5657     function maybeDragEnd( /** @type {MouseEvent} */event) {
  4431     function maybeDragEnd(
       
  4432     /** @type {MouseEvent} */
       
  4433     event) {
       
  4434       if (!isDragging) {
  5658       if (!isDragging) {
  4435         return;
  5659         return;
  4436       }
  5660       }
  4437 
       
  4438       isDragging = false;
  5661       isDragging = false;
  4439       ownerDocument.addEventListener('dragenter', maybeDragStart);
       
  4440       ownerDocument.removeEventListener('dragend', maybeDragEnd);
  5662       ownerDocument.removeEventListener('dragend', maybeDragEnd);
  4441       ownerDocument.removeEventListener('mousemove', maybeDragEnd);
  5663       ownerDocument.removeEventListener('mousemove', maybeDragEnd);
  4442 
       
  4443       if (onDragEndRef.current) {
  5664       if (onDragEndRef.current) {
  4444         onDragEndRef.current(event);
  5665         onDragEndRef.current(event);
  4445       }
  5666       }
  4446     }
  5667     }
  4447 
       
  4448     element.dataset.isDropZone = 'true';
  5668     element.dataset.isDropZone = 'true';
  4449     element.addEventListener('drop', onDrop);
  5669     element.addEventListener('drop', onDrop);
  4450     element.addEventListener('dragenter', onDragEnter);
  5670     element.addEventListener('dragenter', onDragEnter);
  4451     element.addEventListener('dragover', onDragOver);
  5671     element.addEventListener('dragover', onDragOver);
  4452     element.addEventListener('dragleave', onDragLeave); // The `dragstart` event doesn't fire if the drag started outside
  5672     element.addEventListener('dragleave', onDragLeave);
       
  5673     // The `dragstart` event doesn't fire if the drag started outside
  4453     // the document.
  5674     // the document.
  4454 
       
  4455     ownerDocument.addEventListener('dragenter', maybeDragStart);
  5675     ownerDocument.addEventListener('dragenter', maybeDragStart);
  4456     return () => {
  5676     return () => {
  4457       onDropRef.current = null;
       
  4458       onDragStartRef.current = null;
       
  4459       onDragEnterRef.current = null;
       
  4460       onDragLeaveRef.current = null;
       
  4461       onDragEndRef.current = null;
       
  4462       onDragOverRef.current = null;
       
  4463       delete element.dataset.isDropZone;
  5677       delete element.dataset.isDropZone;
  4464       element.removeEventListener('drop', onDrop);
  5678       element.removeEventListener('drop', onDrop);
  4465       element.removeEventListener('dragenter', onDragEnter);
  5679       element.removeEventListener('dragenter', onDragEnter);
  4466       element.removeEventListener('dragover', onDragOver);
  5680       element.removeEventListener('dragover', onDragOver);
  4467       element.removeEventListener('dragleave', onDragLeave);
  5681       element.removeEventListener('dragleave', onDragLeave);
  4468       ownerDocument.removeEventListener('dragend', maybeDragEnd);
  5682       ownerDocument.removeEventListener('dragend', maybeDragEnd);
  4469       ownerDocument.removeEventListener('mousemove', maybeDragEnd);
  5683       ownerDocument.removeEventListener('mousemove', maybeDragEnd);
  4470       ownerDocument.addEventListener('dragenter', maybeDragStart);
  5684       ownerDocument.removeEventListener('dragenter', maybeDragStart);
  4471     };
  5685     };
  4472   }, [isDisabled]);
  5686   }, [isDisabled, dropZoneElement] // Refresh when the passed in dropZoneElement changes.
       
  5687   );
  4473 }
  5688 }
  4474 
  5689 
  4475 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focusable-iframe/index.js
  5690 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-focusable-iframe/index.js
  4476 /**
  5691 /**
       
  5692  * External dependencies
       
  5693  */
       
  5694 
       
  5695 /**
  4477  * Internal dependencies
  5696  * Internal dependencies
  4478  */
  5697  */
       
  5698 
  4479 
  5699 
  4480 /**
  5700 /**
  4481  * Dispatches a bubbling focus event when the iframe receives focus. Use
  5701  * Dispatches a bubbling focus event when the iframe receives focus. Use
  4482  * `onFocus` as usual on the iframe or a parent element.
  5702  * `onFocus` as usual on the iframe or a parent element.
  4483  *
  5703  *
  4484  * @return {Object} Ref to pass to the iframe.
  5704  * @return Ref to pass to the iframe.
  4485  */
  5705  */
  4486 
       
  4487 function useFocusableIframe() {
  5706 function useFocusableIframe() {
  4488   return useRefEffect(element => {
  5707   return useRefEffect(element => {
  4489     const {
  5708     const {
  4490       ownerDocument
  5709       ownerDocument
  4491     } = element;
  5710     } = element;
  4492     if (!ownerDocument) return;
  5711     if (!ownerDocument) {
       
  5712       return;
       
  5713     }
  4493     const {
  5714     const {
  4494       defaultView
  5715       defaultView
  4495     } = ownerDocument;
  5716     } = ownerDocument;
  4496     if (!defaultView) return;
  5717     if (!defaultView) {
       
  5718       return;
       
  5719     }
       
  5720 
  4497     /**
  5721     /**
  4498      * Checks whether the iframe is the activeElement, inferring that it has
  5722      * Checks whether the iframe is the activeElement, inferring that it has
  4499      * then received focus, and dispatches a focus event.
  5723      * then received focus, and dispatches a focus event.
  4500      */
  5724      */
  4501 
       
  4502     function checkFocus() {
  5725     function checkFocus() {
  4503       if (ownerDocument && ownerDocument.activeElement === element) {
  5726       if (ownerDocument && ownerDocument.activeElement === element) {
  4504         /** @type {HTMLElement} */
       
  4505         element.focus();
  5727         element.focus();
  4506       }
  5728       }
  4507     }
  5729     }
  4508 
       
  4509     defaultView.addEventListener('blur', checkFocus);
  5730     defaultView.addEventListener('blur', checkFocus);
  4510     return () => {
  5731     return () => {
  4511       defaultView.removeEventListener('blur', checkFocus);
  5732       defaultView.removeEventListener('blur', checkFocus);
  4512     };
  5733     };
  4513   }, []);
  5734   }, []);
  4514 }
  5735 }
  4515 
  5736 
  4516 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-fixed-window-list/index.js
  5737 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-fixed-window-list/index.js
  4517 /**
  5738 /**
  4518  * External dependencies
       
  4519  */
       
  4520 
       
  4521 /**
       
  4522  * WordPress dependencies
  5739  * WordPress dependencies
  4523  */
  5740  */
  4524 
  5741 
  4525 
  5742 
  4526 
  5743 
  4527 
  5744 
       
  5745 /**
       
  5746  * Internal dependencies
       
  5747  */
       
  5748 
  4528 const DEFAULT_INIT_WINDOW_SIZE = 30;
  5749 const DEFAULT_INIT_WINDOW_SIZE = 30;
       
  5750 
  4529 /**
  5751 /**
  4530  * @typedef {Object} WPFixedWindowList
  5752  * @typedef {Object} WPFixedWindowList
  4531  *
  5753  *
  4532  * @property {number}                  visibleItems Items visible in the current viewport
  5754  * @property {number}                  visibleItems Items visible in the current viewport
  4533  * @property {number}                  start        Start index of the window
  5755  * @property {number}                  start        Start index of the window
  4539  * @typedef {Object} WPFixedWindowListOptions
  5761  * @typedef {Object} WPFixedWindowListOptions
  4540  *
  5762  *
  4541  * @property {number}  [windowOverscan] Renders windowOverscan number of items before and after the calculated visible window.
  5763  * @property {number}  [windowOverscan] Renders windowOverscan number of items before and after the calculated visible window.
  4542  * @property {boolean} [useWindowing]   When false avoids calculating the window size
  5764  * @property {boolean} [useWindowing]   When false avoids calculating the window size
  4543  * @property {number}  [initWindowSize] Initial window size to use on first render before we can calculate the window size.
  5765  * @property {number}  [initWindowSize] Initial window size to use on first render before we can calculate the window size.
       
  5766  * @property {any}     [expandedState]  Used to recalculate the window size when the expanded state of a list changes.
  4544  */
  5767  */
  4545 
  5768 
  4546 /**
  5769 /**
  4547  *
  5770  *
  4548  * @param {import('react').RefObject<HTMLElement>} elementRef Used to find the closest scroll container that contains element.
  5771  * @param {import('react').RefObject<HTMLElement>} elementRef Used to find the closest scroll container that contains element.
  4549  * @param { number }                               itemHeight Fixed item height in pixels
  5772  * @param { number }                               itemHeight Fixed item height in pixels
  4550  * @param { number }                               totalItems Total items in list
  5773  * @param { number }                               totalItems Total items in list
  4551  * @param { WPFixedWindowListOptions }             [options]  Options object
  5774  * @param { WPFixedWindowListOptions }             [options]  Options object
  4552  * @return {[ WPFixedWindowList, setFixedListWindow:(nextWindow:WPFixedWindowList)=>void]} Array with the fixed window list and setter
  5775  * @return {[ WPFixedWindowList, setFixedListWindow:(nextWindow:WPFixedWindowList)=>void]} Array with the fixed window list and setter
  4553  */
  5776  */
  4554 
       
  4555 function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
  5777 function useFixedWindowList(elementRef, itemHeight, totalItems, options) {
  4556   var _options$initWindowSi, _options$useWindowing;
  5778   var _options$initWindowSi, _options$useWindowing;
  4557 
  5779   const initWindowSize = (_options$initWindowSi = options?.initWindowSize) !== null && _options$initWindowSi !== void 0 ? _options$initWindowSi : DEFAULT_INIT_WINDOW_SIZE;
  4558   const initWindowSize = (_options$initWindowSi = options === null || options === void 0 ? void 0 : options.initWindowSize) !== null && _options$initWindowSi !== void 0 ? _options$initWindowSi : DEFAULT_INIT_WINDOW_SIZE;
  5780   const useWindowing = (_options$useWindowing = options?.useWindowing) !== null && _options$useWindowing !== void 0 ? _options$useWindowing : true;
  4559   const useWindowing = (_options$useWindowing = options === null || options === void 0 ? void 0 : options.useWindowing) !== null && _options$useWindowing !== void 0 ? _options$useWindowing : true;
       
  4560   const [fixedListWindow, setFixedListWindow] = (0,external_wp_element_namespaceObject.useState)({
  5781   const [fixedListWindow, setFixedListWindow] = (0,external_wp_element_namespaceObject.useState)({
  4561     visibleItems: initWindowSize,
  5782     visibleItems: initWindowSize,
  4562     start: 0,
  5783     start: 0,
  4563     end: initWindowSize,
  5784     end: initWindowSize,
  4564     itemInView: (
  5785     itemInView: ( /** @type {number} */index) => {
  4565     /** @type {number} */
       
  4566     index) => {
       
  4567       return index >= 0 && index <= initWindowSize;
  5786       return index >= 0 && index <= initWindowSize;
  4568     }
  5787     }
  4569   });
  5788   });
  4570   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  5789   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  4571     var _scrollContainer$owne, _scrollContainer$owne2, _scrollContainer$owne3, _scrollContainer$owne4;
       
  4572 
       
  4573     if (!useWindowing) {
  5790     if (!useWindowing) {
  4574       return;
  5791       return;
  4575     }
  5792     }
  4576 
       
  4577     const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
  5793     const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
  4578 
  5794     const measureWindow = ( /** @type {boolean | undefined} */initRender) => {
  4579     const measureWindow = (
       
  4580     /** @type {boolean | undefined} */
       
  4581     initRender) => {
       
  4582       var _options$windowOversc;
  5795       var _options$windowOversc;
  4583 
       
  4584       if (!scrollContainer) {
  5796       if (!scrollContainer) {
  4585         return;
  5797         return;
  4586       }
  5798       }
  4587 
  5799       const visibleItems = Math.ceil(scrollContainer.clientHeight / itemHeight);
  4588       const visibleItems = Math.ceil(scrollContainer.clientHeight / itemHeight); // Aim to keep opening list view fast, afterward we can optimize for scrolling.
  5800       // Aim to keep opening list view fast, afterward we can optimize for scrolling.
  4589 
  5801       const windowOverscan = initRender ? visibleItems : (_options$windowOversc = options?.windowOverscan) !== null && _options$windowOversc !== void 0 ? _options$windowOversc : visibleItems;
  4590       const windowOverscan = initRender ? visibleItems : (_options$windowOversc = options === null || options === void 0 ? void 0 : options.windowOverscan) !== null && _options$windowOversc !== void 0 ? _options$windowOversc : visibleItems;
       
  4591       const firstViewableIndex = Math.floor(scrollContainer.scrollTop / itemHeight);
  5802       const firstViewableIndex = Math.floor(scrollContainer.scrollTop / itemHeight);
  4592       const start = Math.max(0, firstViewableIndex - windowOverscan);
  5803       const start = Math.max(0, firstViewableIndex - windowOverscan);
  4593       const end = Math.min(totalItems - 1, firstViewableIndex + visibleItems + windowOverscan);
  5804       const end = Math.min(totalItems - 1, firstViewableIndex + visibleItems + windowOverscan);
  4594       setFixedListWindow(lastWindow => {
  5805       setFixedListWindow(lastWindow => {
  4595         const nextWindow = {
  5806         const nextWindow = {
  4596           visibleItems,
  5807           visibleItems,
  4597           start,
  5808           start,
  4598           end,
  5809           end,
  4599           itemInView: (
  5810           itemInView: ( /** @type {number} */index) => {
  4600           /** @type {number} */
       
  4601           index) => {
       
  4602             return start <= index && index <= end;
  5811             return start <= index && index <= end;
  4603           }
  5812           }
  4604         };
  5813         };
  4605 
       
  4606         if (lastWindow.start !== nextWindow.start || lastWindow.end !== nextWindow.end || lastWindow.visibleItems !== nextWindow.visibleItems) {
  5814         if (lastWindow.start !== nextWindow.start || lastWindow.end !== nextWindow.end || lastWindow.visibleItems !== nextWindow.visibleItems) {
  4607           return nextWindow;
  5815           return nextWindow;
  4608         }
  5816         }
  4609 
       
  4610         return lastWindow;
  5817         return lastWindow;
  4611       });
  5818       });
  4612     };
  5819     };
  4613 
       
  4614     measureWindow(true);
  5820     measureWindow(true);
  4615     const debounceMeasureList = (0,external_lodash_namespaceObject.debounce)(() => {
  5821     const debounceMeasureList = debounce(() => {
  4616       measureWindow();
  5822       measureWindow();
  4617     }, 16);
  5823     }, 16);
  4618     scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.addEventListener('scroll', debounceMeasureList);
  5824     scrollContainer?.addEventListener('scroll', debounceMeasureList);
  4619     scrollContainer === null || scrollContainer === void 0 ? void 0 : (_scrollContainer$owne = scrollContainer.ownerDocument) === null || _scrollContainer$owne === void 0 ? void 0 : (_scrollContainer$owne2 = _scrollContainer$owne.defaultView) === null || _scrollContainer$owne2 === void 0 ? void 0 : _scrollContainer$owne2.addEventListener('resize', debounceMeasureList);
  5825     scrollContainer?.ownerDocument?.defaultView?.addEventListener('resize', debounceMeasureList);
  4620     scrollContainer === null || scrollContainer === void 0 ? void 0 : (_scrollContainer$owne3 = scrollContainer.ownerDocument) === null || _scrollContainer$owne3 === void 0 ? void 0 : (_scrollContainer$owne4 = _scrollContainer$owne3.defaultView) === null || _scrollContainer$owne4 === void 0 ? void 0 : _scrollContainer$owne4.addEventListener('resize', debounceMeasureList);
  5826     scrollContainer?.ownerDocument?.defaultView?.addEventListener('resize', debounceMeasureList);
  4621     return () => {
  5827     return () => {
  4622       var _scrollContainer$owne5, _scrollContainer$owne6;
  5828       scrollContainer?.removeEventListener('scroll', debounceMeasureList);
  4623 
  5829       scrollContainer?.ownerDocument?.defaultView?.removeEventListener('resize', debounceMeasureList);
  4624       scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.removeEventListener('scroll', debounceMeasureList);
       
  4625       scrollContainer === null || scrollContainer === void 0 ? void 0 : (_scrollContainer$owne5 = scrollContainer.ownerDocument) === null || _scrollContainer$owne5 === void 0 ? void 0 : (_scrollContainer$owne6 = _scrollContainer$owne5.defaultView) === null || _scrollContainer$owne6 === void 0 ? void 0 : _scrollContainer$owne6.removeEventListener('resize', debounceMeasureList);
       
  4626     };
  5830     };
  4627   }, [itemHeight, elementRef, totalItems]);
  5831   }, [itemHeight, elementRef, totalItems, options?.expandedState, options?.windowOverscan, useWindowing]);
  4628   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  5832   (0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
  4629     var _scrollContainer$owne7, _scrollContainer$owne8;
       
  4630 
       
  4631     if (!useWindowing) {
  5833     if (!useWindowing) {
  4632       return;
  5834       return;
  4633     }
  5835     }
  4634 
       
  4635     const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
  5836     const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(elementRef.current);
  4636 
  5837     const handleKeyDown = ( /** @type {KeyboardEvent} */event) => {
  4637     const handleKeyDown = (
       
  4638     /** @type {KeyboardEvent} */
       
  4639     event) => {
       
  4640       switch (event.keyCode) {
  5838       switch (event.keyCode) {
  4641         case external_wp_keycodes_namespaceObject.HOME:
  5839         case external_wp_keycodes_namespaceObject.HOME:
  4642           {
  5840           {
  4643             return scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTo({
  5841             return scrollContainer?.scrollTo({
  4644               top: 0
  5842               top: 0
  4645             });
  5843             });
  4646           }
  5844           }
  4647 
       
  4648         case external_wp_keycodes_namespaceObject.END:
  5845         case external_wp_keycodes_namespaceObject.END:
  4649           {
  5846           {
  4650             return scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTo({
  5847             return scrollContainer?.scrollTo({
  4651               top: totalItems * itemHeight
  5848               top: totalItems * itemHeight
  4652             });
  5849             });
  4653           }
  5850           }
  4654 
       
  4655         case external_wp_keycodes_namespaceObject.PAGEUP:
  5851         case external_wp_keycodes_namespaceObject.PAGEUP:
  4656           {
  5852           {
  4657             return scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTo({
  5853             return scrollContainer?.scrollTo({
  4658               top: scrollContainer.scrollTop - fixedListWindow.visibleItems * itemHeight
  5854               top: scrollContainer.scrollTop - fixedListWindow.visibleItems * itemHeight
  4659             });
  5855             });
  4660           }
  5856           }
  4661 
       
  4662         case external_wp_keycodes_namespaceObject.PAGEDOWN:
  5857         case external_wp_keycodes_namespaceObject.PAGEDOWN:
  4663           {
  5858           {
  4664             return scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTo({
  5859             return scrollContainer?.scrollTo({
  4665               top: scrollContainer.scrollTop + fixedListWindow.visibleItems * itemHeight
  5860               top: scrollContainer.scrollTop + fixedListWindow.visibleItems * itemHeight
  4666             });
  5861             });
  4667           }
  5862           }
  4668       }
  5863       }
  4669     };
  5864     };
  4670 
  5865     scrollContainer?.ownerDocument?.defaultView?.addEventListener('keydown', handleKeyDown);
  4671     scrollContainer === null || scrollContainer === void 0 ? void 0 : (_scrollContainer$owne7 = scrollContainer.ownerDocument) === null || _scrollContainer$owne7 === void 0 ? void 0 : (_scrollContainer$owne8 = _scrollContainer$owne7.defaultView) === null || _scrollContainer$owne8 === void 0 ? void 0 : _scrollContainer$owne8.addEventListener('keydown', handleKeyDown);
       
  4672     return () => {
  5866     return () => {
  4673       var _scrollContainer$owne9, _scrollContainer$owne10;
  5867       scrollContainer?.ownerDocument?.defaultView?.removeEventListener('keydown', handleKeyDown);
  4674 
       
  4675       scrollContainer === null || scrollContainer === void 0 ? void 0 : (_scrollContainer$owne9 = scrollContainer.ownerDocument) === null || _scrollContainer$owne9 === void 0 ? void 0 : (_scrollContainer$owne10 = _scrollContainer$owne9.defaultView) === null || _scrollContainer$owne10 === void 0 ? void 0 : _scrollContainer$owne10.removeEventListener('keydown', handleKeyDown);
       
  4676     };
  5868     };
  4677   }, [totalItems, itemHeight, elementRef, fixedListWindow.visibleItems]);
  5869   }, [totalItems, itemHeight, elementRef, fixedListWindow.visibleItems, useWindowing, options?.expandedState]);
  4678   return [fixedListWindow, setFixedListWindow];
  5870   return [fixedListWindow, setFixedListWindow];
  4679 }
  5871 }
  4680 
  5872 
       
  5873 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/hooks/use-observable-value/index.js
       
  5874 /**
       
  5875  * WordPress dependencies
       
  5876  */
       
  5877 
       
  5878 
       
  5879 /**
       
  5880  * Internal dependencies
       
  5881  */
       
  5882 
       
  5883 /**
       
  5884  * React hook that lets you observe an entry in an `ObservableMap`. The hook returns the
       
  5885  * current value corresponding to the key, or `undefined` when there is no value stored.
       
  5886  * It also observes changes to the value and triggers an update of the calling component
       
  5887  * in case the value changes.
       
  5888  *
       
  5889  * @template K    The type of the keys in the map.
       
  5890  * @template V    The type of the values in the map.
       
  5891  * @param    map  The `ObservableMap` to observe.
       
  5892  * @param    name The map key to observe.
       
  5893  * @return   The value corresponding to the map key requested.
       
  5894  */
       
  5895 function useObservableValue(map, name) {
       
  5896   const [subscribe, getValue] = (0,external_wp_element_namespaceObject.useMemo)(() => [listener => map.subscribe(name, listener), () => map.get(name)], [map, name]);
       
  5897   return (0,external_wp_element_namespaceObject.useSyncExternalStore)(subscribe, getValue, getValue);
       
  5898 }
       
  5899 
  4681 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/index.js
  5900 ;// CONCATENATED MODULE: ./node_modules/@wordpress/compose/build-module/index.js
  4682 // Utils.
  5901 // The `createHigherOrderComponent` helper and helper types.
  4683  // Compose helper (aliased flowRight from Lodash)
  5902 
  4684 
  5903 // The `debounce` helper and its types.
  4685  // Higher-order components.
  5904 
  4686 
  5905 // The `throttle` helper and its types.
  4687 
  5906 
  4688 
  5907 // The `ObservableMap` data structure
  4689 
  5908 
  4690 
  5909 
  4691 
  5910 // The `compose` and `pipe` helpers (inspired by `flowRight` and `flow` from Lodash).
  4692  // Hooks.
  5911 
  4693 
  5912 
  4694 
  5913 
  4695 
  5914 // Higher-order components.
  4696 
  5915 
  4697 
  5916 
  4698 
  5917 
  4699 
  5918 
  4700 
  5919 
  4701 
  5920 
  4702 
  5921 
  4703 
  5922 // Hooks.
  4704 
  5923 
  4705 
  5924 
  4706 
  5925 
  4707 
  5926 
  4708 
  5927 
  4709 
  5928 
  4710 
  5929 
  4711 
  5930 
  4712 
  5931 
  4713 
  5932 
  4714 
  5933 
  4715 
  5934 
  4716 
  5935 
  4717 
  5936 
  4718 
  5937 
  4719 
  5938 
  4720 
  5939 
  4721 }();
  5940 
       
  5941 
       
  5942 
       
  5943 
       
  5944 
       
  5945 
       
  5946 
       
  5947 
       
  5948 
       
  5949 
       
  5950 
       
  5951 
       
  5952 
       
  5953 })();
       
  5954 
  4722 (window.wp = window.wp || {}).compose = __webpack_exports__;
  5955 (window.wp = window.wp || {}).compose = __webpack_exports__;
  4723 /******/ })()
  5956 /******/ })()
  4724 ;
  5957 ;