9
|
1 |
this["wp"] = this["wp"] || {}; this["wp"]["notices"] = |
|
2 |
/******/ (function(modules) { // webpackBootstrap |
|
3 |
/******/ // The module cache |
|
4 |
/******/ var installedModules = {}; |
|
5 |
/******/ |
|
6 |
/******/ // The require function |
|
7 |
/******/ function __webpack_require__(moduleId) { |
|
8 |
/******/ |
|
9 |
/******/ // Check if module is in cache |
|
10 |
/******/ if(installedModules[moduleId]) { |
|
11 |
/******/ return installedModules[moduleId].exports; |
|
12 |
/******/ } |
|
13 |
/******/ // Create a new module (and put it into the cache) |
|
14 |
/******/ var module = installedModules[moduleId] = { |
|
15 |
/******/ i: moduleId, |
|
16 |
/******/ l: false, |
|
17 |
/******/ exports: {} |
|
18 |
/******/ }; |
|
19 |
/******/ |
|
20 |
/******/ // Execute the module function |
|
21 |
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
|
22 |
/******/ |
|
23 |
/******/ // Flag the module as loaded |
|
24 |
/******/ module.l = true; |
|
25 |
/******/ |
|
26 |
/******/ // Return the exports of the module |
|
27 |
/******/ return module.exports; |
|
28 |
/******/ } |
|
29 |
/******/ |
|
30 |
/******/ |
|
31 |
/******/ // expose the modules object (__webpack_modules__) |
|
32 |
/******/ __webpack_require__.m = modules; |
|
33 |
/******/ |
|
34 |
/******/ // expose the module cache |
|
35 |
/******/ __webpack_require__.c = installedModules; |
|
36 |
/******/ |
|
37 |
/******/ // define getter function for harmony exports |
|
38 |
/******/ __webpack_require__.d = function(exports, name, getter) { |
|
39 |
/******/ if(!__webpack_require__.o(exports, name)) { |
|
40 |
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); |
|
41 |
/******/ } |
|
42 |
/******/ }; |
|
43 |
/******/ |
|
44 |
/******/ // define __esModule on exports |
|
45 |
/******/ __webpack_require__.r = function(exports) { |
|
46 |
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
|
47 |
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
|
48 |
/******/ } |
|
49 |
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
|
50 |
/******/ }; |
|
51 |
/******/ |
|
52 |
/******/ // create a fake namespace object |
|
53 |
/******/ // mode & 1: value is a module id, require it |
|
54 |
/******/ // mode & 2: merge all properties of value into the ns |
|
55 |
/******/ // mode & 4: return value when already ns object |
|
56 |
/******/ // mode & 8|1: behave like require |
|
57 |
/******/ __webpack_require__.t = function(value, mode) { |
|
58 |
/******/ if(mode & 1) value = __webpack_require__(value); |
|
59 |
/******/ if(mode & 8) return value; |
|
60 |
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; |
|
61 |
/******/ var ns = Object.create(null); |
|
62 |
/******/ __webpack_require__.r(ns); |
|
63 |
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); |
|
64 |
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); |
|
65 |
/******/ return ns; |
|
66 |
/******/ }; |
|
67 |
/******/ |
|
68 |
/******/ // getDefaultExport function for compatibility with non-harmony modules |
|
69 |
/******/ __webpack_require__.n = function(module) { |
|
70 |
/******/ var getter = module && module.__esModule ? |
|
71 |
/******/ function getDefault() { return module['default']; } : |
|
72 |
/******/ function getModuleExports() { return module; }; |
|
73 |
/******/ __webpack_require__.d(getter, 'a', getter); |
|
74 |
/******/ return getter; |
|
75 |
/******/ }; |
|
76 |
/******/ |
|
77 |
/******/ // Object.prototype.hasOwnProperty.call |
|
78 |
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; |
|
79 |
/******/ |
|
80 |
/******/ // __webpack_public_path__ |
|
81 |
/******/ __webpack_require__.p = ""; |
|
82 |
/******/ |
|
83 |
/******/ |
|
84 |
/******/ // Load entry module and return exports |
|
85 |
/******/ return __webpack_require__(__webpack_require__.s = 371); |
|
86 |
/******/ }) |
|
87 |
/************************************************************************/ |
|
88 |
/******/ ({ |
|
89 |
|
|
90 |
/***/ 15: |
|
91 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
92 |
|
|
93 |
"use strict"; |
|
94 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); |
|
95 |
function _defineProperty(obj, key, value) { |
|
96 |
if (key in obj) { |
|
97 |
Object.defineProperty(obj, key, { |
|
98 |
value: value, |
|
99 |
enumerable: true, |
|
100 |
configurable: true, |
|
101 |
writable: true |
|
102 |
}); |
|
103 |
} else { |
|
104 |
obj[key] = value; |
|
105 |
} |
|
106 |
|
|
107 |
return obj; |
|
108 |
} |
|
109 |
|
|
110 |
/***/ }), |
|
111 |
|
|
112 |
/***/ 17: |
|
113 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
114 |
|
|
115 |
"use strict"; |
|
116 |
|
|
117 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
|
118 |
function _arrayWithoutHoles(arr) { |
|
119 |
if (Array.isArray(arr)) { |
|
120 |
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { |
|
121 |
arr2[i] = arr[i]; |
|
122 |
} |
|
123 |
|
|
124 |
return arr2; |
|
125 |
} |
|
126 |
} |
|
127 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
|
128 |
var iterableToArray = __webpack_require__(34); |
|
129 |
|
|
130 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
|
131 |
function _nonIterableSpread() { |
|
132 |
throw new TypeError("Invalid attempt to spread non-iterable instance"); |
|
133 |
} |
|
134 |
// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
|
135 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _toConsumableArray; }); |
|
136 |
|
|
137 |
|
|
138 |
|
|
139 |
function _toConsumableArray(arr) { |
|
140 |
return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || _nonIterableSpread(); |
|
141 |
} |
|
142 |
|
|
143 |
/***/ }), |
|
144 |
|
|
145 |
/***/ 2: |
|
146 |
/***/ (function(module, exports) { |
|
147 |
|
|
148 |
(function() { module.exports = this["lodash"]; }()); |
|
149 |
|
|
150 |
/***/ }), |
|
151 |
|
|
152 |
/***/ 23: |
|
153 |
/***/ (function(module, exports, __webpack_require__) { |
|
154 |
|
|
155 |
module.exports = __webpack_require__(54); |
|
156 |
|
|
157 |
|
|
158 |
/***/ }), |
|
159 |
|
|
160 |
/***/ 34: |
|
161 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
162 |
|
|
163 |
"use strict"; |
|
164 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); |
|
165 |
function _iterableToArray(iter) { |
|
166 |
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); |
|
167 |
} |
|
168 |
|
|
169 |
/***/ }), |
|
170 |
|
|
171 |
/***/ 371: |
|
172 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
173 |
|
|
174 |
"use strict"; |
|
175 |
__webpack_require__.r(__webpack_exports__); |
|
176 |
var actions_namespaceObject = {}; |
|
177 |
__webpack_require__.r(actions_namespaceObject); |
|
178 |
__webpack_require__.d(actions_namespaceObject, "createNotice", function() { return createNotice; }); |
|
179 |
__webpack_require__.d(actions_namespaceObject, "createSuccessNotice", function() { return createSuccessNotice; }); |
|
180 |
__webpack_require__.d(actions_namespaceObject, "createInfoNotice", function() { return createInfoNotice; }); |
|
181 |
__webpack_require__.d(actions_namespaceObject, "createErrorNotice", function() { return createErrorNotice; }); |
|
182 |
__webpack_require__.d(actions_namespaceObject, "createWarningNotice", function() { return createWarningNotice; }); |
|
183 |
__webpack_require__.d(actions_namespaceObject, "removeNotice", function() { return removeNotice; }); |
|
184 |
var selectors_namespaceObject = {}; |
|
185 |
__webpack_require__.r(selectors_namespaceObject); |
|
186 |
__webpack_require__.d(selectors_namespaceObject, "getNotices", function() { return getNotices; }); |
|
187 |
|
|
188 |
// EXTERNAL MODULE: external {"this":["wp","data"]} |
|
189 |
var external_this_wp_data_ = __webpack_require__(5); |
|
190 |
|
|
191 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules |
|
192 |
var toConsumableArray = __webpack_require__(17); |
|
193 |
|
|
194 |
// EXTERNAL MODULE: external "lodash" |
|
195 |
var external_lodash_ = __webpack_require__(2); |
|
196 |
|
|
197 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
|
198 |
var defineProperty = __webpack_require__(15); |
|
199 |
|
|
200 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js |
|
201 |
var objectSpread = __webpack_require__(7); |
|
202 |
|
|
203 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/utils/on-sub-key.js |
|
204 |
|
|
205 |
|
|
206 |
|
|
207 |
/** |
|
208 |
* Higher-order reducer creator which creates a combined reducer object, keyed |
|
209 |
* by a property on the action object. |
|
210 |
* |
|
211 |
* @param {string} actionProperty Action property by which to key object. |
|
212 |
* |
|
213 |
* @return {Function} Higher-order reducer. |
|
214 |
*/ |
|
215 |
var on_sub_key_onSubKey = function onSubKey(actionProperty) { |
|
216 |
return function (reducer) { |
|
217 |
return function () { |
|
218 |
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|
219 |
var action = arguments.length > 1 ? arguments[1] : undefined; |
|
220 |
// Retrieve subkey from action. Do not track if undefined; useful for cases |
|
221 |
// where reducer is scoped by action shape. |
|
222 |
var key = action[actionProperty]; |
|
223 |
|
|
224 |
if (key === undefined) { |
|
225 |
return state; |
|
226 |
} // Avoid updating state if unchanged. Note that this also accounts for a |
|
227 |
// reducer which returns undefined on a key which is not yet tracked. |
|
228 |
|
|
229 |
|
|
230 |
var nextKeyState = reducer(state[key], action); |
|
231 |
|
|
232 |
if (nextKeyState === state[key]) { |
|
233 |
return state; |
|
234 |
} |
|
235 |
|
|
236 |
return Object(objectSpread["a" /* default */])({}, state, Object(defineProperty["a" /* default */])({}, key, nextKeyState)); |
|
237 |
}; |
|
238 |
}; |
|
239 |
}; |
|
240 |
/* harmony default export */ var on_sub_key = (on_sub_key_onSubKey); |
|
241 |
|
|
242 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/reducer.js |
|
243 |
|
|
244 |
|
|
245 |
/** |
|
246 |
* External dependencies |
|
247 |
*/ |
|
248 |
|
|
249 |
/** |
|
250 |
* Internal dependencies |
|
251 |
*/ |
|
252 |
|
|
253 |
|
|
254 |
/** |
|
255 |
* Reducer returning the next notices state. The notices state is an object |
|
256 |
* where each key is a context, its value an array of notice objects. |
|
257 |
* |
|
258 |
* @param {Object} state Current state. |
|
259 |
* @param {Object} action Dispatched action. |
|
260 |
* |
|
261 |
* @return {Object} Updated state. |
|
262 |
*/ |
|
263 |
|
|
264 |
var notices = on_sub_key('context')(function () { |
|
265 |
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; |
|
266 |
var action = arguments.length > 1 ? arguments[1] : undefined; |
|
267 |
|
|
268 |
switch (action.type) { |
|
269 |
case 'CREATE_NOTICE': |
|
270 |
// Avoid duplicates on ID. |
|
271 |
return [].concat(Object(toConsumableArray["a" /* default */])(Object(external_lodash_["reject"])(state, { |
|
272 |
id: action.notice.id |
|
273 |
})), [action.notice]); |
|
274 |
|
|
275 |
case 'REMOVE_NOTICE': |
|
276 |
return Object(external_lodash_["reject"])(state, { |
|
277 |
id: action.id |
|
278 |
}); |
|
279 |
} |
|
280 |
|
|
281 |
return state; |
|
282 |
}); |
|
283 |
/* harmony default export */ var store_reducer = (notices); |
|
284 |
|
|
285 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/regenerator/index.js |
|
286 |
var regenerator = __webpack_require__(23); |
|
287 |
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator); |
|
288 |
|
|
289 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/constants.js |
|
290 |
/** |
|
291 |
* Default context to use for notice grouping when not otherwise specified. Its |
|
292 |
* specific value doesn't hold much meaning, but it must be reasonably unique |
|
293 |
* and, more importantly, referenced consistently in the store implementation. |
|
294 |
* |
|
295 |
* @type {string} |
|
296 |
*/ |
|
297 |
var DEFAULT_CONTEXT = 'global'; |
|
298 |
/** |
|
299 |
* Default notice status. |
|
300 |
* |
|
301 |
* @type {string} |
|
302 |
*/ |
|
303 |
|
|
304 |
var DEFAULT_STATUS = 'info'; |
|
305 |
|
|
306 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/actions.js |
|
307 |
|
|
308 |
|
|
309 |
var _marked = |
|
310 |
/*#__PURE__*/ |
|
311 |
regenerator_default.a.mark(createNotice); |
|
312 |
|
|
313 |
/** |
|
314 |
* External dependencies |
|
315 |
*/ |
|
316 |
|
|
317 |
/** |
|
318 |
* Internal dependencies |
|
319 |
*/ |
|
320 |
|
|
321 |
|
|
322 |
/** |
|
323 |
* Yields action objects used in signalling that a notice is to be created. |
|
324 |
* |
|
325 |
* @param {?string} status Notice status. |
|
326 |
* Defaults to `info`. |
|
327 |
* @param {string} content Notice message. |
|
328 |
* @param {?Object} options Notice options. |
|
329 |
* @param {?string} options.context Context under which to |
|
330 |
* group notice. |
|
331 |
* @param {?string} options.id Identifier for notice. |
|
332 |
* Automatically assigned |
|
333 |
* if not specified. |
|
334 |
* @param {?boolean} options.isDismissible Whether the notice can |
|
335 |
* be dismissed by user. |
|
336 |
* Defaults to `true`. |
|
337 |
* @param {?boolean} options.speak Whether the notice |
|
338 |
* content should be |
|
339 |
* announced to screen |
|
340 |
* readers. Defaults to |
|
341 |
* `true`. |
|
342 |
* @param {?Array<WPNoticeAction>} options.actions User actions to be |
|
343 |
* presented with notice. |
|
344 |
*/ |
|
345 |
|
|
346 |
function createNotice() { |
|
347 |
var status, |
|
348 |
content, |
|
349 |
options, |
|
350 |
_options$speak, |
|
351 |
speak, |
|
352 |
_options$isDismissibl, |
|
353 |
isDismissible, |
|
354 |
_options$context, |
|
355 |
context, |
|
356 |
_options$id, |
|
357 |
id, |
|
358 |
_options$actions, |
|
359 |
actions, |
|
360 |
__unstableHTML, |
|
361 |
_args = arguments; |
|
362 |
|
|
363 |
return regenerator_default.a.wrap(function createNotice$(_context) { |
|
364 |
while (1) { |
|
365 |
switch (_context.prev = _context.next) { |
|
366 |
case 0: |
|
367 |
status = _args.length > 0 && _args[0] !== undefined ? _args[0] : DEFAULT_STATUS; |
|
368 |
content = _args.length > 1 ? _args[1] : undefined; |
|
369 |
options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; |
|
370 |
_options$speak = options.speak, speak = _options$speak === void 0 ? true : _options$speak, _options$isDismissibl = options.isDismissible, isDismissible = _options$isDismissibl === void 0 ? true : _options$isDismissibl, _options$context = options.context, context = _options$context === void 0 ? DEFAULT_CONTEXT : _options$context, _options$id = options.id, id = _options$id === void 0 ? Object(external_lodash_["uniqueId"])(context) : _options$id, _options$actions = options.actions, actions = _options$actions === void 0 ? [] : _options$actions, __unstableHTML = options.__unstableHTML; // The supported value shape of content is currently limited to plain text |
|
371 |
// strings. To avoid setting expectation that e.g. a WPElement could be |
|
372 |
// supported, cast to a string. |
|
373 |
|
|
374 |
content = String(content); |
|
375 |
|
|
376 |
if (!speak) { |
|
377 |
_context.next = 8; |
|
378 |
break; |
|
379 |
} |
|
380 |
|
|
381 |
_context.next = 8; |
|
382 |
return { |
|
383 |
type: 'SPEAK', |
|
384 |
message: content |
|
385 |
}; |
|
386 |
|
|
387 |
case 8: |
|
388 |
_context.next = 10; |
|
389 |
return { |
|
390 |
type: 'CREATE_NOTICE', |
|
391 |
context: context, |
|
392 |
notice: { |
|
393 |
id: id, |
|
394 |
status: status, |
|
395 |
content: content, |
|
396 |
__unstableHTML: __unstableHTML, |
|
397 |
isDismissible: isDismissible, |
|
398 |
actions: actions |
|
399 |
} |
|
400 |
}; |
|
401 |
|
|
402 |
case 10: |
|
403 |
case "end": |
|
404 |
return _context.stop(); |
|
405 |
} |
|
406 |
} |
|
407 |
}, _marked, this); |
|
408 |
} |
|
409 |
/** |
|
410 |
* Returns an action object used in signalling that a success notice is to be |
|
411 |
* created. Refer to `createNotice` for options documentation. |
|
412 |
* |
|
413 |
* @see createNotice |
|
414 |
* |
|
415 |
* @param {string} content Notice message. |
|
416 |
* @param {?Object} options Optional notice options. |
|
417 |
* |
|
418 |
* @return {Object} Action object. |
|
419 |
*/ |
|
420 |
|
|
421 |
function createSuccessNotice(content, options) { |
|
422 |
return createNotice('success', content, options); |
|
423 |
} |
|
424 |
/** |
|
425 |
* Returns an action object used in signalling that an info notice is to be |
|
426 |
* created. Refer to `createNotice` for options documentation. |
|
427 |
* |
|
428 |
* @see createNotice |
|
429 |
* |
|
430 |
* @param {string} content Notice message. |
|
431 |
* @param {?Object} options Optional notice options. |
|
432 |
* |
|
433 |
* @return {Object} Action object. |
|
434 |
*/ |
|
435 |
|
|
436 |
function createInfoNotice(content, options) { |
|
437 |
return createNotice('info', content, options); |
|
438 |
} |
|
439 |
/** |
|
440 |
* Returns an action object used in signalling that an error notice is to be |
|
441 |
* created. Refer to `createNotice` for options documentation. |
|
442 |
* |
|
443 |
* @see createNotice |
|
444 |
* |
|
445 |
* @param {string} content Notice message. |
|
446 |
* @param {?Object} options Optional notice options. |
|
447 |
* |
|
448 |
* @return {Object} Action object. |
|
449 |
*/ |
|
450 |
|
|
451 |
function createErrorNotice(content, options) { |
|
452 |
return createNotice('error', content, options); |
|
453 |
} |
|
454 |
/** |
|
455 |
* Returns an action object used in signalling that a warning notice is to be |
|
456 |
* created. Refer to `createNotice` for options documentation. |
|
457 |
* |
|
458 |
* @see createNotice |
|
459 |
* |
|
460 |
* @param {string} content Notice message. |
|
461 |
* @param {?Object} options Optional notice options. |
|
462 |
* |
|
463 |
* @return {Object} Action object. |
|
464 |
*/ |
|
465 |
|
|
466 |
function createWarningNotice(content, options) { |
|
467 |
return createNotice('warning', content, options); |
|
468 |
} |
|
469 |
/** |
|
470 |
* Returns an action object used in signalling that a notice is to be removed. |
|
471 |
* |
|
472 |
* @param {string} id Notice unique identifier. |
|
473 |
* @param {?string} context Optional context (grouping) in which the notice is |
|
474 |
* intended to appear. Defaults to default context. |
|
475 |
* |
|
476 |
* @return {Object} Action object. |
|
477 |
*/ |
|
478 |
|
|
479 |
function removeNotice(id) { |
|
480 |
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT; |
|
481 |
return { |
|
482 |
type: 'REMOVE_NOTICE', |
|
483 |
id: id, |
|
484 |
context: context |
|
485 |
}; |
|
486 |
} |
|
487 |
|
|
488 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/selectors.js |
|
489 |
/** |
|
490 |
* Internal dependencies |
|
491 |
*/ |
|
492 |
|
|
493 |
/** |
|
494 |
* The default empty set of notices to return when there are no notices |
|
495 |
* assigned for a given notices context. This can occur if the getNotices |
|
496 |
* selector is called without a notice ever having been created for the |
|
497 |
* context. A shared value is used to ensure referential equality between |
|
498 |
* sequential selector calls, since otherwise `[] !== []`. |
|
499 |
* |
|
500 |
* @type {Array} |
|
501 |
*/ |
|
502 |
|
|
503 |
var DEFAULT_NOTICES = []; |
|
504 |
/** |
|
505 |
* Notice object. |
|
506 |
* |
|
507 |
* @property {string} id Unique identifier of notice. |
|
508 |
* @property {string} status Status of notice, one of `success`, |
|
509 |
* `info`, `error`, or `warning`. Defaults |
|
510 |
* to `info`. |
|
511 |
* @property {string} content Notice message. |
|
512 |
* @property {string} __unstableHTML Notice message as raw HTML. Intended to |
|
513 |
* serve primarily for compatibility of |
|
514 |
* server-rendered notices, and SHOULD NOT |
|
515 |
* be used for notices. It is subject to |
|
516 |
* removal without notice. |
|
517 |
* @property {boolean} isDismissible Whether the notice can be dismissed by |
|
518 |
* user. Defaults to `true`. |
|
519 |
* @property {WPNoticeAction[]} actions User actions to present with notice. |
|
520 |
* |
|
521 |
* @typedef {WPNotice} |
|
522 |
*/ |
|
523 |
|
|
524 |
/** |
|
525 |
* Object describing a user action option associated with a notice. |
|
526 |
* |
|
527 |
* @property {string} label Message to use as action label. |
|
528 |
* @property {?string} url Optional URL of resource if action incurs |
|
529 |
* browser navigation. |
|
530 |
* @property {?Function} callback Optional function to invoke when action is |
|
531 |
* triggered by user. |
|
532 |
* |
|
533 |
* @typedef {WPNoticeAction} |
|
534 |
*/ |
|
535 |
|
|
536 |
/** |
|
537 |
* Returns all notices as an array, optionally for a given context. Defaults to |
|
538 |
* the global context. |
|
539 |
* |
|
540 |
* @param {Object} state Notices state. |
|
541 |
* @param {?string} context Optional grouping context. |
|
542 |
* |
|
543 |
* @return {WPNotice[]} Array of notices. |
|
544 |
*/ |
|
545 |
|
|
546 |
function getNotices(state) { |
|
547 |
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_CONTEXT; |
|
548 |
return state[context] || DEFAULT_NOTICES; |
|
549 |
} |
|
550 |
|
|
551 |
// EXTERNAL MODULE: external {"this":["wp","a11y"]} |
|
552 |
var external_this_wp_a11y_ = __webpack_require__(48); |
|
553 |
|
|
554 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/controls.js |
|
555 |
/** |
|
556 |
* WordPress dependencies |
|
557 |
*/ |
|
558 |
|
|
559 |
/* harmony default export */ var controls = ({ |
|
560 |
SPEAK: function SPEAK(action) { |
|
561 |
Object(external_this_wp_a11y_["speak"])(action.message, 'assertive'); |
|
562 |
} |
|
563 |
}); |
|
564 |
|
|
565 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/store/index.js |
|
566 |
/** |
|
567 |
* WordPress dependencies |
|
568 |
*/ |
|
569 |
|
|
570 |
/** |
|
571 |
* Internal dependencies |
|
572 |
*/ |
|
573 |
|
|
574 |
|
|
575 |
|
|
576 |
|
|
577 |
|
|
578 |
/* harmony default export */ var store = (Object(external_this_wp_data_["registerStore"])('core/notices', { |
|
579 |
reducer: store_reducer, |
|
580 |
actions: actions_namespaceObject, |
|
581 |
selectors: selectors_namespaceObject, |
|
582 |
controls: controls |
|
583 |
})); |
|
584 |
|
|
585 |
// CONCATENATED MODULE: ./node_modules/@wordpress/notices/build-module/index.js |
|
586 |
/** |
|
587 |
* Internal dependencies |
|
588 |
*/ |
|
589 |
|
|
590 |
|
|
591 |
|
|
592 |
/***/ }), |
|
593 |
|
|
594 |
/***/ 48: |
|
595 |
/***/ (function(module, exports) { |
|
596 |
|
|
597 |
(function() { module.exports = this["wp"]["a11y"]; }()); |
|
598 |
|
|
599 |
/***/ }), |
|
600 |
|
|
601 |
/***/ 5: |
|
602 |
/***/ (function(module, exports) { |
|
603 |
|
|
604 |
(function() { module.exports = this["wp"]["data"]; }()); |
|
605 |
|
|
606 |
/***/ }), |
|
607 |
|
|
608 |
/***/ 54: |
|
609 |
/***/ (function(module, exports, __webpack_require__) { |
|
610 |
|
|
611 |
/** |
|
612 |
* Copyright (c) 2014-present, Facebook, Inc. |
|
613 |
* |
|
614 |
* This source code is licensed under the MIT license found in the |
|
615 |
* LICENSE file in the root directory of this source tree. |
|
616 |
*/ |
|
617 |
|
|
618 |
// This method of obtaining a reference to the global object needs to be |
|
619 |
// kept identical to the way it is obtained in runtime.js |
|
620 |
var g = (function() { |
|
621 |
return this || (typeof self === "object" && self); |
|
622 |
})() || Function("return this")(); |
|
623 |
|
|
624 |
// Use `getOwnPropertyNames` because not all browsers support calling |
|
625 |
// `hasOwnProperty` on the global `self` object in a worker. See #183. |
|
626 |
var hadRuntime = g.regeneratorRuntime && |
|
627 |
Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; |
|
628 |
|
|
629 |
// Save the old regeneratorRuntime in case it needs to be restored later. |
|
630 |
var oldRuntime = hadRuntime && g.regeneratorRuntime; |
|
631 |
|
|
632 |
// Force reevalutation of runtime.js. |
|
633 |
g.regeneratorRuntime = undefined; |
|
634 |
|
|
635 |
module.exports = __webpack_require__(55); |
|
636 |
|
|
637 |
if (hadRuntime) { |
|
638 |
// Restore the original runtime. |
|
639 |
g.regeneratorRuntime = oldRuntime; |
|
640 |
} else { |
|
641 |
// Remove the global property added by runtime.js. |
|
642 |
try { |
|
643 |
delete g.regeneratorRuntime; |
|
644 |
} catch(e) { |
|
645 |
g.regeneratorRuntime = undefined; |
|
646 |
} |
|
647 |
} |
|
648 |
|
|
649 |
|
|
650 |
/***/ }), |
|
651 |
|
|
652 |
/***/ 55: |
|
653 |
/***/ (function(module, exports) { |
|
654 |
|
|
655 |
/** |
|
656 |
* Copyright (c) 2014-present, Facebook, Inc. |
|
657 |
* |
|
658 |
* This source code is licensed under the MIT license found in the |
|
659 |
* LICENSE file in the root directory of this source tree. |
|
660 |
*/ |
|
661 |
|
|
662 |
!(function(global) { |
|
663 |
"use strict"; |
|
664 |
|
|
665 |
var Op = Object.prototype; |
|
666 |
var hasOwn = Op.hasOwnProperty; |
|
667 |
var undefined; // More compressible than void 0. |
|
668 |
var $Symbol = typeof Symbol === "function" ? Symbol : {}; |
|
669 |
var iteratorSymbol = $Symbol.iterator || "@@iterator"; |
|
670 |
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; |
|
671 |
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; |
|
672 |
|
|
673 |
var inModule = typeof module === "object"; |
|
674 |
var runtime = global.regeneratorRuntime; |
|
675 |
if (runtime) { |
|
676 |
if (inModule) { |
|
677 |
// If regeneratorRuntime is defined globally and we're in a module, |
|
678 |
// make the exports object identical to regeneratorRuntime. |
|
679 |
module.exports = runtime; |
|
680 |
} |
|
681 |
// Don't bother evaluating the rest of this file if the runtime was |
|
682 |
// already defined globally. |
|
683 |
return; |
|
684 |
} |
|
685 |
|
|
686 |
// Define the runtime globally (as expected by generated code) as either |
|
687 |
// module.exports (if we're in a module) or a new, empty object. |
|
688 |
runtime = global.regeneratorRuntime = inModule ? module.exports : {}; |
|
689 |
|
|
690 |
function wrap(innerFn, outerFn, self, tryLocsList) { |
|
691 |
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. |
|
692 |
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; |
|
693 |
var generator = Object.create(protoGenerator.prototype); |
|
694 |
var context = new Context(tryLocsList || []); |
|
695 |
|
|
696 |
// The ._invoke method unifies the implementations of the .next, |
|
697 |
// .throw, and .return methods. |
|
698 |
generator._invoke = makeInvokeMethod(innerFn, self, context); |
|
699 |
|
|
700 |
return generator; |
|
701 |
} |
|
702 |
runtime.wrap = wrap; |
|
703 |
|
|
704 |
// Try/catch helper to minimize deoptimizations. Returns a completion |
|
705 |
// record like context.tryEntries[i].completion. This interface could |
|
706 |
// have been (and was previously) designed to take a closure to be |
|
707 |
// invoked without arguments, but in all the cases we care about we |
|
708 |
// already have an existing method we want to call, so there's no need |
|
709 |
// to create a new function object. We can even get away with assuming |
|
710 |
// the method takes exactly one argument, since that happens to be true |
|
711 |
// in every case, so we don't have to touch the arguments object. The |
|
712 |
// only additional allocation required is the completion record, which |
|
713 |
// has a stable shape and so hopefully should be cheap to allocate. |
|
714 |
function tryCatch(fn, obj, arg) { |
|
715 |
try { |
|
716 |
return { type: "normal", arg: fn.call(obj, arg) }; |
|
717 |
} catch (err) { |
|
718 |
return { type: "throw", arg: err }; |
|
719 |
} |
|
720 |
} |
|
721 |
|
|
722 |
var GenStateSuspendedStart = "suspendedStart"; |
|
723 |
var GenStateSuspendedYield = "suspendedYield"; |
|
724 |
var GenStateExecuting = "executing"; |
|
725 |
var GenStateCompleted = "completed"; |
|
726 |
|
|
727 |
// Returning this object from the innerFn has the same effect as |
|
728 |
// breaking out of the dispatch switch statement. |
|
729 |
var ContinueSentinel = {}; |
|
730 |
|
|
731 |
// Dummy constructor functions that we use as the .constructor and |
|
732 |
// .constructor.prototype properties for functions that return Generator |
|
733 |
// objects. For full spec compliance, you may wish to configure your |
|
734 |
// minifier not to mangle the names of these two functions. |
|
735 |
function Generator() {} |
|
736 |
function GeneratorFunction() {} |
|
737 |
function GeneratorFunctionPrototype() {} |
|
738 |
|
|
739 |
// This is a polyfill for %IteratorPrototype% for environments that |
|
740 |
// don't natively support it. |
|
741 |
var IteratorPrototype = {}; |
|
742 |
IteratorPrototype[iteratorSymbol] = function () { |
|
743 |
return this; |
|
744 |
}; |
|
745 |
|
|
746 |
var getProto = Object.getPrototypeOf; |
|
747 |
var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); |
|
748 |
if (NativeIteratorPrototype && |
|
749 |
NativeIteratorPrototype !== Op && |
|
750 |
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { |
|
751 |
// This environment has a native %IteratorPrototype%; use it instead |
|
752 |
// of the polyfill. |
|
753 |
IteratorPrototype = NativeIteratorPrototype; |
|
754 |
} |
|
755 |
|
|
756 |
var Gp = GeneratorFunctionPrototype.prototype = |
|
757 |
Generator.prototype = Object.create(IteratorPrototype); |
|
758 |
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; |
|
759 |
GeneratorFunctionPrototype.constructor = GeneratorFunction; |
|
760 |
GeneratorFunctionPrototype[toStringTagSymbol] = |
|
761 |
GeneratorFunction.displayName = "GeneratorFunction"; |
|
762 |
|
|
763 |
// Helper for defining the .next, .throw, and .return methods of the |
|
764 |
// Iterator interface in terms of a single ._invoke method. |
|
765 |
function defineIteratorMethods(prototype) { |
|
766 |
["next", "throw", "return"].forEach(function(method) { |
|
767 |
prototype[method] = function(arg) { |
|
768 |
return this._invoke(method, arg); |
|
769 |
}; |
|
770 |
}); |
|
771 |
} |
|
772 |
|
|
773 |
runtime.isGeneratorFunction = function(genFun) { |
|
774 |
var ctor = typeof genFun === "function" && genFun.constructor; |
|
775 |
return ctor |
|
776 |
? ctor === GeneratorFunction || |
|
777 |
// For the native GeneratorFunction constructor, the best we can |
|
778 |
// do is to check its .name property. |
|
779 |
(ctor.displayName || ctor.name) === "GeneratorFunction" |
|
780 |
: false; |
|
781 |
}; |
|
782 |
|
|
783 |
runtime.mark = function(genFun) { |
|
784 |
if (Object.setPrototypeOf) { |
|
785 |
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); |
|
786 |
} else { |
|
787 |
genFun.__proto__ = GeneratorFunctionPrototype; |
|
788 |
if (!(toStringTagSymbol in genFun)) { |
|
789 |
genFun[toStringTagSymbol] = "GeneratorFunction"; |
|
790 |
} |
|
791 |
} |
|
792 |
genFun.prototype = Object.create(Gp); |
|
793 |
return genFun; |
|
794 |
}; |
|
795 |
|
|
796 |
// Within the body of any async function, `await x` is transformed to |
|
797 |
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test |
|
798 |
// `hasOwn.call(value, "__await")` to determine if the yielded value is |
|
799 |
// meant to be awaited. |
|
800 |
runtime.awrap = function(arg) { |
|
801 |
return { __await: arg }; |
|
802 |
}; |
|
803 |
|
|
804 |
function AsyncIterator(generator) { |
|
805 |
function invoke(method, arg, resolve, reject) { |
|
806 |
var record = tryCatch(generator[method], generator, arg); |
|
807 |
if (record.type === "throw") { |
|
808 |
reject(record.arg); |
|
809 |
} else { |
|
810 |
var result = record.arg; |
|
811 |
var value = result.value; |
|
812 |
if (value && |
|
813 |
typeof value === "object" && |
|
814 |
hasOwn.call(value, "__await")) { |
|
815 |
return Promise.resolve(value.__await).then(function(value) { |
|
816 |
invoke("next", value, resolve, reject); |
|
817 |
}, function(err) { |
|
818 |
invoke("throw", err, resolve, reject); |
|
819 |
}); |
|
820 |
} |
|
821 |
|
|
822 |
return Promise.resolve(value).then(function(unwrapped) { |
|
823 |
// When a yielded Promise is resolved, its final value becomes |
|
824 |
// the .value of the Promise<{value,done}> result for the |
|
825 |
// current iteration. |
|
826 |
result.value = unwrapped; |
|
827 |
resolve(result); |
|
828 |
}, function(error) { |
|
829 |
// If a rejected Promise was yielded, throw the rejection back |
|
830 |
// into the async generator function so it can be handled there. |
|
831 |
return invoke("throw", error, resolve, reject); |
|
832 |
}); |
|
833 |
} |
|
834 |
} |
|
835 |
|
|
836 |
var previousPromise; |
|
837 |
|
|
838 |
function enqueue(method, arg) { |
|
839 |
function callInvokeWithMethodAndArg() { |
|
840 |
return new Promise(function(resolve, reject) { |
|
841 |
invoke(method, arg, resolve, reject); |
|
842 |
}); |
|
843 |
} |
|
844 |
|
|
845 |
return previousPromise = |
|
846 |
// If enqueue has been called before, then we want to wait until |
|
847 |
// all previous Promises have been resolved before calling invoke, |
|
848 |
// so that results are always delivered in the correct order. If |
|
849 |
// enqueue has not been called before, then it is important to |
|
850 |
// call invoke immediately, without waiting on a callback to fire, |
|
851 |
// so that the async generator function has the opportunity to do |
|
852 |
// any necessary setup in a predictable way. This predictability |
|
853 |
// is why the Promise constructor synchronously invokes its |
|
854 |
// executor callback, and why async functions synchronously |
|
855 |
// execute code before the first await. Since we implement simple |
|
856 |
// async functions in terms of async generators, it is especially |
|
857 |
// important to get this right, even though it requires care. |
|
858 |
previousPromise ? previousPromise.then( |
|
859 |
callInvokeWithMethodAndArg, |
|
860 |
// Avoid propagating failures to Promises returned by later |
|
861 |
// invocations of the iterator. |
|
862 |
callInvokeWithMethodAndArg |
|
863 |
) : callInvokeWithMethodAndArg(); |
|
864 |
} |
|
865 |
|
|
866 |
// Define the unified helper method that is used to implement .next, |
|
867 |
// .throw, and .return (see defineIteratorMethods). |
|
868 |
this._invoke = enqueue; |
|
869 |
} |
|
870 |
|
|
871 |
defineIteratorMethods(AsyncIterator.prototype); |
|
872 |
AsyncIterator.prototype[asyncIteratorSymbol] = function () { |
|
873 |
return this; |
|
874 |
}; |
|
875 |
runtime.AsyncIterator = AsyncIterator; |
|
876 |
|
|
877 |
// Note that simple async functions are implemented on top of |
|
878 |
// AsyncIterator objects; they just return a Promise for the value of |
|
879 |
// the final result produced by the iterator. |
|
880 |
runtime.async = function(innerFn, outerFn, self, tryLocsList) { |
|
881 |
var iter = new AsyncIterator( |
|
882 |
wrap(innerFn, outerFn, self, tryLocsList) |
|
883 |
); |
|
884 |
|
|
885 |
return runtime.isGeneratorFunction(outerFn) |
|
886 |
? iter // If outerFn is a generator, return the full iterator. |
|
887 |
: iter.next().then(function(result) { |
|
888 |
return result.done ? result.value : iter.next(); |
|
889 |
}); |
|
890 |
}; |
|
891 |
|
|
892 |
function makeInvokeMethod(innerFn, self, context) { |
|
893 |
var state = GenStateSuspendedStart; |
|
894 |
|
|
895 |
return function invoke(method, arg) { |
|
896 |
if (state === GenStateExecuting) { |
|
897 |
throw new Error("Generator is already running"); |
|
898 |
} |
|
899 |
|
|
900 |
if (state === GenStateCompleted) { |
|
901 |
if (method === "throw") { |
|
902 |
throw arg; |
|
903 |
} |
|
904 |
|
|
905 |
// Be forgiving, per 25.3.3.3.3 of the spec: |
|
906 |
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume |
|
907 |
return doneResult(); |
|
908 |
} |
|
909 |
|
|
910 |
context.method = method; |
|
911 |
context.arg = arg; |
|
912 |
|
|
913 |
while (true) { |
|
914 |
var delegate = context.delegate; |
|
915 |
if (delegate) { |
|
916 |
var delegateResult = maybeInvokeDelegate(delegate, context); |
|
917 |
if (delegateResult) { |
|
918 |
if (delegateResult === ContinueSentinel) continue; |
|
919 |
return delegateResult; |
|
920 |
} |
|
921 |
} |
|
922 |
|
|
923 |
if (context.method === "next") { |
|
924 |
// Setting context._sent for legacy support of Babel's |
|
925 |
// function.sent implementation. |
|
926 |
context.sent = context._sent = context.arg; |
|
927 |
|
|
928 |
} else if (context.method === "throw") { |
|
929 |
if (state === GenStateSuspendedStart) { |
|
930 |
state = GenStateCompleted; |
|
931 |
throw context.arg; |
|
932 |
} |
|
933 |
|
|
934 |
context.dispatchException(context.arg); |
|
935 |
|
|
936 |
} else if (context.method === "return") { |
|
937 |
context.abrupt("return", context.arg); |
|
938 |
} |
|
939 |
|
|
940 |
state = GenStateExecuting; |
|
941 |
|
|
942 |
var record = tryCatch(innerFn, self, context); |
|
943 |
if (record.type === "normal") { |
|
944 |
// If an exception is thrown from innerFn, we leave state === |
|
945 |
// GenStateExecuting and loop back for another invocation. |
|
946 |
state = context.done |
|
947 |
? GenStateCompleted |
|
948 |
: GenStateSuspendedYield; |
|
949 |
|
|
950 |
if (record.arg === ContinueSentinel) { |
|
951 |
continue; |
|
952 |
} |
|
953 |
|
|
954 |
return { |
|
955 |
value: record.arg, |
|
956 |
done: context.done |
|
957 |
}; |
|
958 |
|
|
959 |
} else if (record.type === "throw") { |
|
960 |
state = GenStateCompleted; |
|
961 |
// Dispatch the exception by looping back around to the |
|
962 |
// context.dispatchException(context.arg) call above. |
|
963 |
context.method = "throw"; |
|
964 |
context.arg = record.arg; |
|
965 |
} |
|
966 |
} |
|
967 |
}; |
|
968 |
} |
|
969 |
|
|
970 |
// Call delegate.iterator[context.method](context.arg) and handle the |
|
971 |
// result, either by returning a { value, done } result from the |
|
972 |
// delegate iterator, or by modifying context.method and context.arg, |
|
973 |
// setting context.delegate to null, and returning the ContinueSentinel. |
|
974 |
function maybeInvokeDelegate(delegate, context) { |
|
975 |
var method = delegate.iterator[context.method]; |
|
976 |
if (method === undefined) { |
|
977 |
// A .throw or .return when the delegate iterator has no .throw |
|
978 |
// method always terminates the yield* loop. |
|
979 |
context.delegate = null; |
|
980 |
|
|
981 |
if (context.method === "throw") { |
|
982 |
if (delegate.iterator.return) { |
|
983 |
// If the delegate iterator has a return method, give it a |
|
984 |
// chance to clean up. |
|
985 |
context.method = "return"; |
|
986 |
context.arg = undefined; |
|
987 |
maybeInvokeDelegate(delegate, context); |
|
988 |
|
|
989 |
if (context.method === "throw") { |
|
990 |
// If maybeInvokeDelegate(context) changed context.method from |
|
991 |
// "return" to "throw", let that override the TypeError below. |
|
992 |
return ContinueSentinel; |
|
993 |
} |
|
994 |
} |
|
995 |
|
|
996 |
context.method = "throw"; |
|
997 |
context.arg = new TypeError( |
|
998 |
"The iterator does not provide a 'throw' method"); |
|
999 |
} |
|
1000 |
|
|
1001 |
return ContinueSentinel; |
|
1002 |
} |
|
1003 |
|
|
1004 |
var record = tryCatch(method, delegate.iterator, context.arg); |
|
1005 |
|
|
1006 |
if (record.type === "throw") { |
|
1007 |
context.method = "throw"; |
|
1008 |
context.arg = record.arg; |
|
1009 |
context.delegate = null; |
|
1010 |
return ContinueSentinel; |
|
1011 |
} |
|
1012 |
|
|
1013 |
var info = record.arg; |
|
1014 |
|
|
1015 |
if (! info) { |
|
1016 |
context.method = "throw"; |
|
1017 |
context.arg = new TypeError("iterator result is not an object"); |
|
1018 |
context.delegate = null; |
|
1019 |
return ContinueSentinel; |
|
1020 |
} |
|
1021 |
|
|
1022 |
if (info.done) { |
|
1023 |
// Assign the result of the finished delegate to the temporary |
|
1024 |
// variable specified by delegate.resultName (see delegateYield). |
|
1025 |
context[delegate.resultName] = info.value; |
|
1026 |
|
|
1027 |
// Resume execution at the desired location (see delegateYield). |
|
1028 |
context.next = delegate.nextLoc; |
|
1029 |
|
|
1030 |
// If context.method was "throw" but the delegate handled the |
|
1031 |
// exception, let the outer generator proceed normally. If |
|
1032 |
// context.method was "next", forget context.arg since it has been |
|
1033 |
// "consumed" by the delegate iterator. If context.method was |
|
1034 |
// "return", allow the original .return call to continue in the |
|
1035 |
// outer generator. |
|
1036 |
if (context.method !== "return") { |
|
1037 |
context.method = "next"; |
|
1038 |
context.arg = undefined; |
|
1039 |
} |
|
1040 |
|
|
1041 |
} else { |
|
1042 |
// Re-yield the result returned by the delegate method. |
|
1043 |
return info; |
|
1044 |
} |
|
1045 |
|
|
1046 |
// The delegate iterator is finished, so forget it and continue with |
|
1047 |
// the outer generator. |
|
1048 |
context.delegate = null; |
|
1049 |
return ContinueSentinel; |
|
1050 |
} |
|
1051 |
|
|
1052 |
// Define Generator.prototype.{next,throw,return} in terms of the |
|
1053 |
// unified ._invoke helper method. |
|
1054 |
defineIteratorMethods(Gp); |
|
1055 |
|
|
1056 |
Gp[toStringTagSymbol] = "Generator"; |
|
1057 |
|
|
1058 |
// A Generator should always return itself as the iterator object when the |
|
1059 |
// @@iterator function is called on it. Some browsers' implementations of the |
|
1060 |
// iterator prototype chain incorrectly implement this, causing the Generator |
|
1061 |
// object to not be returned from this call. This ensures that doesn't happen. |
|
1062 |
// See https://github.com/facebook/regenerator/issues/274 for more details. |
|
1063 |
Gp[iteratorSymbol] = function() { |
|
1064 |
return this; |
|
1065 |
}; |
|
1066 |
|
|
1067 |
Gp.toString = function() { |
|
1068 |
return "[object Generator]"; |
|
1069 |
}; |
|
1070 |
|
|
1071 |
function pushTryEntry(locs) { |
|
1072 |
var entry = { tryLoc: locs[0] }; |
|
1073 |
|
|
1074 |
if (1 in locs) { |
|
1075 |
entry.catchLoc = locs[1]; |
|
1076 |
} |
|
1077 |
|
|
1078 |
if (2 in locs) { |
|
1079 |
entry.finallyLoc = locs[2]; |
|
1080 |
entry.afterLoc = locs[3]; |
|
1081 |
} |
|
1082 |
|
|
1083 |
this.tryEntries.push(entry); |
|
1084 |
} |
|
1085 |
|
|
1086 |
function resetTryEntry(entry) { |
|
1087 |
var record = entry.completion || {}; |
|
1088 |
record.type = "normal"; |
|
1089 |
delete record.arg; |
|
1090 |
entry.completion = record; |
|
1091 |
} |
|
1092 |
|
|
1093 |
function Context(tryLocsList) { |
|
1094 |
// The root entry object (effectively a try statement without a catch |
|
1095 |
// or a finally block) gives us a place to store values thrown from |
|
1096 |
// locations where there is no enclosing try statement. |
|
1097 |
this.tryEntries = [{ tryLoc: "root" }]; |
|
1098 |
tryLocsList.forEach(pushTryEntry, this); |
|
1099 |
this.reset(true); |
|
1100 |
} |
|
1101 |
|
|
1102 |
runtime.keys = function(object) { |
|
1103 |
var keys = []; |
|
1104 |
for (var key in object) { |
|
1105 |
keys.push(key); |
|
1106 |
} |
|
1107 |
keys.reverse(); |
|
1108 |
|
|
1109 |
// Rather than returning an object with a next method, we keep |
|
1110 |
// things simple and return the next function itself. |
|
1111 |
return function next() { |
|
1112 |
while (keys.length) { |
|
1113 |
var key = keys.pop(); |
|
1114 |
if (key in object) { |
|
1115 |
next.value = key; |
|
1116 |
next.done = false; |
|
1117 |
return next; |
|
1118 |
} |
|
1119 |
} |
|
1120 |
|
|
1121 |
// To avoid creating an additional object, we just hang the .value |
|
1122 |
// and .done properties off the next function object itself. This |
|
1123 |
// also ensures that the minifier will not anonymize the function. |
|
1124 |
next.done = true; |
|
1125 |
return next; |
|
1126 |
}; |
|
1127 |
}; |
|
1128 |
|
|
1129 |
function values(iterable) { |
|
1130 |
if (iterable) { |
|
1131 |
var iteratorMethod = iterable[iteratorSymbol]; |
|
1132 |
if (iteratorMethod) { |
|
1133 |
return iteratorMethod.call(iterable); |
|
1134 |
} |
|
1135 |
|
|
1136 |
if (typeof iterable.next === "function") { |
|
1137 |
return iterable; |
|
1138 |
} |
|
1139 |
|
|
1140 |
if (!isNaN(iterable.length)) { |
|
1141 |
var i = -1, next = function next() { |
|
1142 |
while (++i < iterable.length) { |
|
1143 |
if (hasOwn.call(iterable, i)) { |
|
1144 |
next.value = iterable[i]; |
|
1145 |
next.done = false; |
|
1146 |
return next; |
|
1147 |
} |
|
1148 |
} |
|
1149 |
|
|
1150 |
next.value = undefined; |
|
1151 |
next.done = true; |
|
1152 |
|
|
1153 |
return next; |
|
1154 |
}; |
|
1155 |
|
|
1156 |
return next.next = next; |
|
1157 |
} |
|
1158 |
} |
|
1159 |
|
|
1160 |
// Return an iterator with no values. |
|
1161 |
return { next: doneResult }; |
|
1162 |
} |
|
1163 |
runtime.values = values; |
|
1164 |
|
|
1165 |
function doneResult() { |
|
1166 |
return { value: undefined, done: true }; |
|
1167 |
} |
|
1168 |
|
|
1169 |
Context.prototype = { |
|
1170 |
constructor: Context, |
|
1171 |
|
|
1172 |
reset: function(skipTempReset) { |
|
1173 |
this.prev = 0; |
|
1174 |
this.next = 0; |
|
1175 |
// Resetting context._sent for legacy support of Babel's |
|
1176 |
// function.sent implementation. |
|
1177 |
this.sent = this._sent = undefined; |
|
1178 |
this.done = false; |
|
1179 |
this.delegate = null; |
|
1180 |
|
|
1181 |
this.method = "next"; |
|
1182 |
this.arg = undefined; |
|
1183 |
|
|
1184 |
this.tryEntries.forEach(resetTryEntry); |
|
1185 |
|
|
1186 |
if (!skipTempReset) { |
|
1187 |
for (var name in this) { |
|
1188 |
// Not sure about the optimal order of these conditions: |
|
1189 |
if (name.charAt(0) === "t" && |
|
1190 |
hasOwn.call(this, name) && |
|
1191 |
!isNaN(+name.slice(1))) { |
|
1192 |
this[name] = undefined; |
|
1193 |
} |
|
1194 |
} |
|
1195 |
} |
|
1196 |
}, |
|
1197 |
|
|
1198 |
stop: function() { |
|
1199 |
this.done = true; |
|
1200 |
|
|
1201 |
var rootEntry = this.tryEntries[0]; |
|
1202 |
var rootRecord = rootEntry.completion; |
|
1203 |
if (rootRecord.type === "throw") { |
|
1204 |
throw rootRecord.arg; |
|
1205 |
} |
|
1206 |
|
|
1207 |
return this.rval; |
|
1208 |
}, |
|
1209 |
|
|
1210 |
dispatchException: function(exception) { |
|
1211 |
if (this.done) { |
|
1212 |
throw exception; |
|
1213 |
} |
|
1214 |
|
|
1215 |
var context = this; |
|
1216 |
function handle(loc, caught) { |
|
1217 |
record.type = "throw"; |
|
1218 |
record.arg = exception; |
|
1219 |
context.next = loc; |
|
1220 |
|
|
1221 |
if (caught) { |
|
1222 |
// If the dispatched exception was caught by a catch block, |
|
1223 |
// then let that catch block handle the exception normally. |
|
1224 |
context.method = "next"; |
|
1225 |
context.arg = undefined; |
|
1226 |
} |
|
1227 |
|
|
1228 |
return !! caught; |
|
1229 |
} |
|
1230 |
|
|
1231 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
1232 |
var entry = this.tryEntries[i]; |
|
1233 |
var record = entry.completion; |
|
1234 |
|
|
1235 |
if (entry.tryLoc === "root") { |
|
1236 |
// Exception thrown outside of any try block that could handle |
|
1237 |
// it, so set the completion value of the entire function to |
|
1238 |
// throw the exception. |
|
1239 |
return handle("end"); |
|
1240 |
} |
|
1241 |
|
|
1242 |
if (entry.tryLoc <= this.prev) { |
|
1243 |
var hasCatch = hasOwn.call(entry, "catchLoc"); |
|
1244 |
var hasFinally = hasOwn.call(entry, "finallyLoc"); |
|
1245 |
|
|
1246 |
if (hasCatch && hasFinally) { |
|
1247 |
if (this.prev < entry.catchLoc) { |
|
1248 |
return handle(entry.catchLoc, true); |
|
1249 |
} else if (this.prev < entry.finallyLoc) { |
|
1250 |
return handle(entry.finallyLoc); |
|
1251 |
} |
|
1252 |
|
|
1253 |
} else if (hasCatch) { |
|
1254 |
if (this.prev < entry.catchLoc) { |
|
1255 |
return handle(entry.catchLoc, true); |
|
1256 |
} |
|
1257 |
|
|
1258 |
} else if (hasFinally) { |
|
1259 |
if (this.prev < entry.finallyLoc) { |
|
1260 |
return handle(entry.finallyLoc); |
|
1261 |
} |
|
1262 |
|
|
1263 |
} else { |
|
1264 |
throw new Error("try statement without catch or finally"); |
|
1265 |
} |
|
1266 |
} |
|
1267 |
} |
|
1268 |
}, |
|
1269 |
|
|
1270 |
abrupt: function(type, arg) { |
|
1271 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
1272 |
var entry = this.tryEntries[i]; |
|
1273 |
if (entry.tryLoc <= this.prev && |
|
1274 |
hasOwn.call(entry, "finallyLoc") && |
|
1275 |
this.prev < entry.finallyLoc) { |
|
1276 |
var finallyEntry = entry; |
|
1277 |
break; |
|
1278 |
} |
|
1279 |
} |
|
1280 |
|
|
1281 |
if (finallyEntry && |
|
1282 |
(type === "break" || |
|
1283 |
type === "continue") && |
|
1284 |
finallyEntry.tryLoc <= arg && |
|
1285 |
arg <= finallyEntry.finallyLoc) { |
|
1286 |
// Ignore the finally entry if control is not jumping to a |
|
1287 |
// location outside the try/catch block. |
|
1288 |
finallyEntry = null; |
|
1289 |
} |
|
1290 |
|
|
1291 |
var record = finallyEntry ? finallyEntry.completion : {}; |
|
1292 |
record.type = type; |
|
1293 |
record.arg = arg; |
|
1294 |
|
|
1295 |
if (finallyEntry) { |
|
1296 |
this.method = "next"; |
|
1297 |
this.next = finallyEntry.finallyLoc; |
|
1298 |
return ContinueSentinel; |
|
1299 |
} |
|
1300 |
|
|
1301 |
return this.complete(record); |
|
1302 |
}, |
|
1303 |
|
|
1304 |
complete: function(record, afterLoc) { |
|
1305 |
if (record.type === "throw") { |
|
1306 |
throw record.arg; |
|
1307 |
} |
|
1308 |
|
|
1309 |
if (record.type === "break" || |
|
1310 |
record.type === "continue") { |
|
1311 |
this.next = record.arg; |
|
1312 |
} else if (record.type === "return") { |
|
1313 |
this.rval = this.arg = record.arg; |
|
1314 |
this.method = "return"; |
|
1315 |
this.next = "end"; |
|
1316 |
} else if (record.type === "normal" && afterLoc) { |
|
1317 |
this.next = afterLoc; |
|
1318 |
} |
|
1319 |
|
|
1320 |
return ContinueSentinel; |
|
1321 |
}, |
|
1322 |
|
|
1323 |
finish: function(finallyLoc) { |
|
1324 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
1325 |
var entry = this.tryEntries[i]; |
|
1326 |
if (entry.finallyLoc === finallyLoc) { |
|
1327 |
this.complete(entry.completion, entry.afterLoc); |
|
1328 |
resetTryEntry(entry); |
|
1329 |
return ContinueSentinel; |
|
1330 |
} |
|
1331 |
} |
|
1332 |
}, |
|
1333 |
|
|
1334 |
"catch": function(tryLoc) { |
|
1335 |
for (var i = this.tryEntries.length - 1; i >= 0; --i) { |
|
1336 |
var entry = this.tryEntries[i]; |
|
1337 |
if (entry.tryLoc === tryLoc) { |
|
1338 |
var record = entry.completion; |
|
1339 |
if (record.type === "throw") { |
|
1340 |
var thrown = record.arg; |
|
1341 |
resetTryEntry(entry); |
|
1342 |
} |
|
1343 |
return thrown; |
|
1344 |
} |
|
1345 |
} |
|
1346 |
|
|
1347 |
// The context.catch method must only be called with a location |
|
1348 |
// argument that corresponds to a known catch block. |
|
1349 |
throw new Error("illegal catch attempt"); |
|
1350 |
}, |
|
1351 |
|
|
1352 |
delegateYield: function(iterable, resultName, nextLoc) { |
|
1353 |
this.delegate = { |
|
1354 |
iterator: values(iterable), |
|
1355 |
resultName: resultName, |
|
1356 |
nextLoc: nextLoc |
|
1357 |
}; |
|
1358 |
|
|
1359 |
if (this.method === "next") { |
|
1360 |
// Deliberately forget the last sent value so that we don't |
|
1361 |
// accidentally pass it on to the delegate. |
|
1362 |
this.arg = undefined; |
|
1363 |
} |
|
1364 |
|
|
1365 |
return ContinueSentinel; |
|
1366 |
} |
|
1367 |
}; |
|
1368 |
})( |
|
1369 |
// In sloppy mode, unbound `this` refers to the global object, fallback to |
|
1370 |
// Function constructor if we're in global strict mode. That is sadly a form |
|
1371 |
// of indirect eval which violates Content Security Policy. |
|
1372 |
(function() { |
|
1373 |
return this || (typeof self === "object" && self); |
|
1374 |
})() || Function("return this")() |
|
1375 |
); |
|
1376 |
|
|
1377 |
|
|
1378 |
/***/ }), |
|
1379 |
|
|
1380 |
/***/ 7: |
|
1381 |
/***/ (function(module, __webpack_exports__, __webpack_require__) { |
|
1382 |
|
|
1383 |
"use strict"; |
|
1384 |
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; }); |
|
1385 |
/* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); |
|
1386 |
|
|
1387 |
function _objectSpread(target) { |
|
1388 |
for (var i = 1; i < arguments.length; i++) { |
|
1389 |
var source = arguments[i] != null ? arguments[i] : {}; |
|
1390 |
var ownKeys = Object.keys(source); |
|
1391 |
|
|
1392 |
if (typeof Object.getOwnPropertySymbols === 'function') { |
|
1393 |
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { |
|
1394 |
return Object.getOwnPropertyDescriptor(source, sym).enumerable; |
|
1395 |
})); |
|
1396 |
} |
|
1397 |
|
|
1398 |
ownKeys.forEach(function (key) { |
|
1399 |
Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); |
|
1400 |
}); |
|
1401 |
} |
|
1402 |
|
|
1403 |
return target; |
|
1404 |
} |
|
1405 |
|
|
1406 |
/***/ }) |
|
1407 |
|
|
1408 |
/******/ }); |